:root {
    --obsidian-deep: #050505;
    --obsidian-surface: #121212;
    --neon-cyan: #00f2ff;
    --neon-magenta: #ff00e5;
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

html {
    font-size: 16px;
}

@media screen and (max-width: 768px) {
    html {
        font-size: 18px;
    }
    
    #homepage {
        padding: 10px;
    }

    .game-grid {
        gap: 8px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--obsidian-deep);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- BACKGROUND MATERIAL --- */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 0% 0%, rgba(0, 242, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(255, 0, 229, 0.05) 0%, transparent 50%);
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(var(--glass-border) 1px, transparent 1px), linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.1;
    z-index: -1;
}

/* --- NAVIGATION --- */
nav {
    padding: 20px 20px 20px 0; /* Reduced left padding to 0 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-left: 0; /* Ensure no left margin */
}

.logo img {
    display: block;
    height: 40px;
    width: auto;
    /* margin-left: -5px; Removed negative margin to be cleaner */
}

/* --- SEARCH BAR --- */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 10px auto;
    padding: 0 20px;
    z-index: 50;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    background: rgba(18, 18, 18, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s var(--ease-out);
}

.search-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.1);
    background: rgba(18, 18, 18, 0.95);
}

.search-icon {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background: var(--obsidian-surface);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.search-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(255,255,255,0.05);
}

.search-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.search-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.search-item-info span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* --- HOMEPAGE SECTION --- */
#homepage {
    padding: 20px;
    animation: fadeIn 0.8s var(--ease-out);
}

.hero {
    padding: 20px 0;
    position: relative;
    overflow: hidden;
}

.swiper-container {
    width: 100%;
    height: 300px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: var(--obsidian-surface);
}

.swiper-slide {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: transform 0.5s ease;
}

.swiper-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    z-index: 10;
}

.swiper-slide h2 {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.swiper-pagination-bullet {
    background: var(--text-secondary);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: var(--neon-cyan);
    opacity: 1;
    box-shadow: 0 0 8px var(--neon-cyan);
}

/* Featured Card */
.featured-card {
    width: 100%;
    height: 400px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    background: var(--obsidian-surface);
    border: 1px solid var(--glass-border);
    margin-bottom: 40px;
    cursor: pointer;
    transition: transform 0.4s var(--ease-out);
}

.featured-card:active {
    transform: scale(0.98);
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.5s var(--ease-out);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(transparent, var(--obsidian-deep));
}

.featured-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--neon-cyan);
    color: black;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    margin-bottom: 10px;
}

/* Game List */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.game-item {
    background: var(--obsidian-surface);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    padding: 10px;
    transition: all 0.3s var(--ease-out);
    min-width: 0;
}

.game-thumb {
    aspect-ratio: 1;
    background: #222;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-item h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* --- DETAIL PAGE --- */
#detail-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--obsidian-deep);
    z-index: 200;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--ease-out);
}

#detail-page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.detail-hero {
    height: 60vh;
    position: relative;
    background-size: cover;
    background-position: center;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
}

.detail-content {
    padding: 30px 20px 120px 20px;
    background: linear-gradient(to bottom, transparent, var(--obsidian-deep) 100px);
    margin-top: -100px;
    position: relative;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 10px;
    line-height: 1;
}

.detail-info-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.info-item span {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.info-item b {
    color: var(--neon-cyan);
}

.detail-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 40px;
}

.play-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(transparent, var(--obsidian-deep) 50%);
    display: flex;
    justify-content: center;
}

.btn-play {
    width: 100%;
    max-width: 400px;
    padding: 18px;
    background: var(--neon-cyan);
    color: black;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.3);
    transition: transform 0.2s;
}

.btn-play:active {
    transform: scale(0.95);
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--obsidian-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
}
