/* Global Overrides */
body, html {
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(13, 13, 26, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s, box-shadow 0.3s;
}

header.scrolled {
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: rgba(13, 13, 26, 0.95);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.logo span { color: var(--accent-1); }

nav { display: flex; gap: 24px; }
nav a { color: var(--text-dim); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
nav a:hover { color: white; }

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 99px;
    width: 240px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-2);
    background: rgba(255, 255, 255, 0.1);
    width: 300px;
}

/* Hero */
.hero {
    padding: 80px 0 40px;
    text-align: center;
}

.hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.9;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.hero p {
    color: var(--text-dim);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 32px;
}

/* Sections */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    justify-content: center;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 8px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background: white;
    color: var(--bg-dark);
    border-color: white;
}

.game-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Game Viewer */
#game-viewer {
    display: none;
    padding: 40px 0;
}

.viewer-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.iframe-wrapper {
    background: #000;
    border-radius: 32px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 4px solid var(--accent-5);
    position: relative;
    max-width: 100%;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

iframe { border: none; width: 100%; height: 100%; }

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.fullscreen-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.iframe-wrapper.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    border: none;
    aspect-ratio: auto;
}

.iframe-wrapper.is-fullscreen .fullscreen-btn {
    top: 20px;
    right: 20px;
}

/* Footer */
footer {
    margin-top: 100px;
    padding: 60px 0;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-col h3 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 20px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; }
.footer-col ul a:hover { color: white; }

.copyright {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 1024px) {
    .ad-leaderboard { width: 728px; max-width: 100%; }
    .viewer-container { grid-template-columns: 1fr; }
    .ad-sidebar { display: none; }
}

@media (max-width: 768px) {
    header nav { display: none; }
    .search-input { width: 160px; }
    .search-input:focus { width: 200px; }
    .ad-leaderboard { width: 320px; max-width: 100%; height: 100px; }
    .hero h1 { font-size: 3rem; }
    .ad-sticky-bottom { display: flex; }
    .game-grid { grid-template-columns: 1fr 1fr; }
    .iframe-wrapper { border-radius: 16px; border-width: 2px; }
    .game-stats-bar { flex-wrap: wrap; gap: 16px; padding: 12px 16px; }
    .game-info-sidebar { padding: 20px; border-radius: 16px; }
    .controls-guide { padding: 20px; }
}

@media (max-width: 480px) {
    .game-grid { grid-template-columns: 1fr; }
}
