/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #111118;
    --bg-secondary: #1b1b27;
    --bg-card: #212131;
    --bg-header: rgba(17, 17, 24, 0.97);
    --bg-input: #2a2a3d;
    --accent: #24ee5a;
    --accent-hover: #1dd44f;
    --accent-gradient: linear-gradient(135deg, #24ee5a, #1ab648);
    --blue: #2196f3;
    --text-white: #ffffff;
    --text-gray: #9a9aaf;
    --text-muted: #5e5e76;
    --border-color: rgba(255, 255, 255, 0.07);
    --radius: 10px;
    --radius-sm: 6px;
    --container: 1200px;
    --transition: 0.25s ease;
}

html {
    scroll-behavior: smooth;
}

/* Scroll offset for anchor links (sticky header) */
[id] {
    scroll-margin-top: 90px;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-white);
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.85rem; margin-bottom: 1rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; }

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: #111118;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #111118;
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-input);
    color: var(--text-white);
    border: none;
}

.btn-outline:hover {
    background: #363650;
    color: var(--text-white);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.85rem;
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    text-decoration: none;
    flex-shrink: 0;
}

.logo svg {
    height: 36px;
    width: auto;
}

.logo:hover {
    color: var(--text-white);
}

/* ===== NAVIGATION ===== */
.nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 24px 14px;
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-white);
}

.nav-link .arrow {
    font-size: 0.65rem;
    transition: transform var(--transition);
}

.nav-item:hover .arrow {
    transform: rotate(180deg);
}

/* ===== DROPDOWN / SUBMENU ===== */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--transition);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--text-gray);
    font-size: 0.88rem;
    transition: all var(--transition);
}

.dropdown a:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.04);
    padding-left: 24px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ===== MOBILE MENU ===== */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-white);
    border-radius: 2px;
    transition: all var(--transition);
}

.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== HERO (MAIN) ===== */
.hero {
    padding: 100px 0 80px;
    background: linear-gradient(135deg, #0e0e1a 0%, #151525 40%, #111120 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(36, 238, 90, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
}

.hero h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    position: relative;
}

/* ===== HERO (INNER PAGES) ===== */
.hero-inner {
    padding: 40px 0 35px;
    background: linear-gradient(135deg, #0e0e1a 0%, #1b1b27 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero-inner h1 {
    font-size: 2rem;
    margin-top: 10px;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs .sep {
    color: var(--text-muted);
    opacity: 0.5;
}

/* ===== SECTIONS ===== */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-alt {
    background: var(--bg-secondary);
}

/* ===== GAMES GRID ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(36, 238, 90, 0.25);
    box-shadow: 0 8px 30px rgba(36, 238, 90, 0.08);
}

.game-card-img {
    aspect-ratio: 3 / 2;
    background: linear-gradient(135deg, #2a2a3d, #1e1e30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
}

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

.game-card-img .placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.game-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity var(--transition);
}

.game-card:hover .game-card-play {
    opacity: 1;
}

.game-card-play .btn-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--accent);
    color: #111118;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--transition);
}

.game-card-play .btn-play:hover {
    background: var(--accent-hover);
    color: #111118;
}

.game-card-play .btn-play::before {
    content: '▶';
    font-size: 0.7rem;
}

.game-card-body {
    padding: 12px 14px;
}

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

.game-card-body span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ===== TOC ===== */
.toc {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px 30px;
    margin-bottom: 2.5rem;
}

.toc-title {
    font-size: 1.1rem;
    color: var(--text-white);
    margin-bottom: 14px;
    font-weight: 600;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 30px;
}

.toc-list li {
    position: relative;
    padding-left: 18px;
}

.toc-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.toc-list a {
    color: var(--text-gray);
    font-size: 0.92rem;
}

.toc-list a:hover {
    color: var(--accent);
}

.cta-buttons {
    text-align: center;
    margin: 0.5rem 0;
}

/* ===== CONTENT BLOCK ===== */
.content-block img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.content-block h2 {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.content-block h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.content-block h3 {
    margin-top: 1.5rem;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
}

.table-wrap table {
    min-width: 500px;
}

.content-block table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.content-block .table-wrap table {
    margin-bottom: 0;
}

.content-block table th,
.content-block table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.content-block table th {
    color: var(--text-white);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
}

/* ===== 404 PAGE ===== */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404-code {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.15;
}

.error-404-text {
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

/* ===== REVIEWS ===== */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
}

.review-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.review-name {
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.95rem;
}

.review-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.review-stars {
    color: #ffc107;
    font-size: 0.9rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.review-text {
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ===== FAQ ===== */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--bg-card);
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    cursor: pointer;
    color: var(--text-white);
    font-weight: 600;
    font-size: 1rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition);
}

.faq-item summary h3 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: 300;
    flex-shrink: 0;
    margin-left: 16px;
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-item summary:hover {
    background: rgba(255, 255, 255, 0.02);
}

.faq-answer {
    padding: 0 24px 20px;
    color: var(--text-gray);
    font-size: 0.94rem;
    line-height: 1.7;
}

/* ===== FOOTER ===== */
.footer {
    background: #0b0b14;
    border-top: 1px solid var(--border-color);
    padding: 50px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-about {
    max-width: 300px;
}

.footer-about .logo {
    margin-bottom: 16px;
}

.footer-about p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-col h4 {
    color: var(--text-white);
    font-size: 0.95rem;
    margin-bottom: 18px;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: color var(--transition);
}

.footer-col ul a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }

    .hero { padding: 60px 0 50px; }
    .hero h1 { font-size: 2rem; }

    .header-actions .btn-outline {
        display: none;
    }

    .burger {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px);
        background: var(--bg-primary);
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 0;
        overflow-y: auto;
        z-index: 999;
        display: none;
    }

    .nav.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link {
        padding: 14px 0;
        font-size: 1rem;
        width: 100%;
        justify-content: space-between;
        border-bottom: none;
    }

    .nav-link .arrow {
        font-size: 0.55rem;
        transition: transform var(--transition);
    }

    .nav-item.open > .nav-link .arrow {
        transform: rotate(180deg);
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
        padding: 0 0 12px 16px;
        overflow: hidden;
        min-width: 0;
        max-height: 0;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .nav-item.open > .dropdown {
        max-height: 500px;
        padding: 0 0 12px 16px;
    }

    .nav-item:not(.open) > .dropdown {
        padding-top: 0;
        padding-bottom: 0;
    }

    .dropdown a {
        padding: 8px 0;
        font-size: 0.92rem;
    }

    .dropdown a:hover {
        padding-left: 0;
        background: transparent;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .toc-list {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .hero { padding: 40px 0 35px; }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-card-body {
        padding: 8px 10px;
    }

    .game-card-body h3 {
        font-size: 0.8rem;
    }
}
