/* train.cognitivesovereignty.institute — SHARED CHROME (D-279)
 *
 * Single source of truth for the chrome duplicated across all 9 surfaces
 * (index + atlas + the 7 games): the CSS reset, the fixed top nav (#app-nav),
 * and the fixed bottom icon-nav (#bottom-nav). Extracted from the per-page
 * inline <style> blocks, which had drifted (divergent nav backgrounds, missing
 * backdrop-blur on games, no mobile nav-scroll on games).
 *
 * TOKEN-DRIVEN — preserves each page's theme. This file never defines :root;
 * it reads each page's own --void-bg / --primary so per-game identity colors
 * survive. Per-page nav backgrounds and hover tints are reproduced exactly via
 * color-mix from those tokens (e.g. a page with --void-bg #050505 renders the
 * nav at rgba(5,5,5,0.95), exactly as before; #0a0a0f -> rgba(10,10,15,0.95)).
 *
 * CASCADE — link this in <head> BEFORE each page's inline <style>, so an
 * intentional per-page chrome override (same specificity) still wins.
 *
 * Per D-279 (extraction) / D-278 (the install-overlap fix + drift register).
 */

/* ── reset ───────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── top nav ─────────────────────────────────────────────────────────── */
#app-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: color-mix(in srgb, var(--void-bg) 95%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--primary);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}
.nav-left, .nav-right { display: flex; gap: 15px; align-items: center; }
.nav-logo { color: var(--primary); text-decoration: none; font-weight: bold; font-size: 1.1rem; }
.nav-link { color: var(--primary); text-decoration: none; opacity: 0.8; transition: opacity 0.2s; }
.nav-link:hover { opacity: 1; }
.game-select {
    background: #111;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    cursor: pointer;
}

/* ── bottom icon-nav ─────────────────────────────────────────────────── */
#bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: color-mix(in srgb, var(--void-bg) 98%, transparent);
    border-top: 1px solid var(--primary);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #8a8a8a;          /* deliberate neutral grey, consistent across all 9 (NOT --dim, which is themed per page) */
    font-size: 0.65rem;
    padding: 6px 8px;
    border-radius: 8px;
    transition: all 0.2s;
    min-width: 50px;
}
.bottom-nav-item:hover, .bottom-nav-item:active { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active .nav-icon { text-shadow: 0 0 10px var(--primary); }
.nav-icon { font-size: 1.4rem; margin-bottom: 4px; }

/* ── mobile chrome (the hub treatment, now applied to every surface — D-279 scope 4) ── */
@media (max-width: 600px) {
    #app-nav { padding: 10px 12px; gap: 8px; }
    .nav-left { gap: 8px; min-width: 0; flex-shrink: 1; overflow-x: auto; scrollbar-width: none; }
    .nav-left::-webkit-scrollbar { display: none; }
    .nav-left a { white-space: nowrap; }
    .nav-right { flex-shrink: 0; }
    #app-nav .nav-link, #app-nav .nav-logo { font-size: 0.78rem !important; }
    .game-select { padding: 6px 8px; font-size: 0.74rem; }
    .bottom-nav-item { min-width: 38px; padding: 4px 3px; }
    .nav-icon { font-size: 1.2rem; }
}
