/* 99 GAME — Global layout & typography */

html {
    background: var(--bg);
}

/* The [hidden] attribute must always win over a component's own display
   rule (e.g. .btn sets display:inline-flex, which otherwise has equal
   CSS specificity and would cancel out [hidden] since it's declared later
   in the cascade). */
[hidden] {
    display: none !important;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ---------------------------------------------------------------- */
/* Typography                                                       */
/* ---------------------------------------------------------------- */

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 0.6em; }
h3 { font-size: 1.05rem; }

p { color: var(--text-muted); }

main p, .static-page p, .faq-item p {
    color: var(--text-muted);
    max-width: 74ch;
}

a {
    transition: color var(--transition-fast);
}

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

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    z-index: 1000;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

/* ---------------------------------------------------------------- */
/* Buttons                                                          */
/* ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch-target);
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
    cursor: pointer;
}

.btn:active { transform: translateY(1px); }

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

.btn--secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--text); }

/* ---------------------------------------------------------------- */
/* Site header                                                      */
/* ---------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 15, 20, 0.92);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--border-soft);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text);
    flex-shrink: 0;
}
.brand__num { color: var(--accent); }
.brand__word { letter-spacing: 0.02em; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    flex-shrink: 0;
}
.icon-btn:hover {
    background: var(--bg-card);
    color: var(--text);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
}
.nav-toggle__bar {
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.primary-nav {
    flex: 1;
}
.primary-nav ul {
    display: flex;
    gap: 22px;
    align-items: center;
}
.primary-nav > ul > li {
    position: relative;
}
.primary-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 2px;
    display: inline-block;
}
.primary-nav a:hover {
    color: var(--text);
}

.has-dropdown .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 190px;
    display: none;
    box-shadow: var(--shadow-card);
    grid-template-columns: 1fr;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
    display: grid;
}
.dropdown li a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.dropdown li a:hover {
    background: var(--bg-card);
    color: var(--text);
}

.site-search {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding-inline: 6px;
    height: 40px;
}
.site-search input {
    background: none;
    border: 0;
    color: var(--text);
    padding: 0 8px;
    width: 180px;
}
.site-search input::placeholder { color: var(--text-faint); }
.site-search button { color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }

.audio-panel {
    position: absolute;
    right: 20px;
    top: var(--header-height);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 220px;
    box-shadow: var(--shadow-card);
    z-index: 100;
}
.audio-panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.audio-panel__row:last-child { margin-bottom: 0; }
.audio-panel input[type="range"] {
    width: 110px;
    accent-color: var(--accent);
}

/* ---------------------------------------------------------------- */
/* Hero                                                              */
/* ---------------------------------------------------------------- */

.hero {
    padding: 56px 0 40px;
    text-align: center;
    background:
        radial-gradient(60% 60% at 50% 0%, var(--accent-soft), transparent 70%),
        var(--bg);
    border-bottom: 1px solid var(--border-soft);
}
.hero__eyebrow {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.hero__title { margin-bottom: 10px; }
.hero__tagline {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.hero__desc {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ---------------------------------------------------------------- */
/* Sections                                                          */
/* ---------------------------------------------------------------- */

.intro {
    padding: 28px 0 4px;
}
.intro p {
    max-width: 78ch;
}

.home-section {
    padding: 36px 0;
}
.home-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.home-section__more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.home-section--all {
    text-align: center;
    border-top: 1px solid var(--border-soft);
}
.home-section--all p {
    max-width: 60ch;
    margin-inline: auto;
    margin-bottom: 20px;
}

/* Static content pages (about/privacy/terms/contact) */
.static-page {
    padding: 32px 0 64px;
    max-width: 800px;
}
.static-page h2 {
    margin-top: 1.6em;
}
.static-page ul {
    list-style: disc;
    padding-left: 1.4em;
    color: var(--text-muted);
    margin-bottom: 1em;
}
.static-page li { margin-bottom: 0.4em; }

/* Game page */
.game-page__top { padding-top: 24px; }
.game-page__title { margin: 10px 0 10px; }
.game-page__intro { max-width: 74ch; margin-bottom: 14px; }
.game-page__content { padding: 8px 0 60px; }
.game-page__content section { padding: 28px 0; border-top: 1px solid var(--border-soft); }

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.game-meta strong { color: var(--text); }

.game-container {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.game-coming-soon {
    color: var(--text-muted);
    text-align: center;
    padding: 60px 20px;
}

.game-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

footer, .site-footer { margin-top: auto; }

.site-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-soft);
    padding-top: 44px;
}
.site-footer__inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
}
.site-footer__brand p {
    margin-top: 8px;
    font-size: 0.9rem;
}
.site-footer__secondary { color: var(--text-faint); }
.site-footer__col h3 {
    color: var(--text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}
.site-footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.site-footer__col a { color: var(--text-muted); font-size: 0.92rem; }
.site-footer__col a:hover { color: var(--text); }

.site-footer__bottom {
    border-top: 1px solid var(--border-soft);
    padding: 18px 0;
    color: var(--text-faint);
    font-size: 0.85rem;
}
