@import url("/shared/navigation.css");
/* Portal-only layer over the existing compiled utilities; game documents do not load it. */
.site-shell {
    color-scheme: dark;
    --page: #0a0a1a;
    --section: #101024;
    --surface: #17172f;
    --raised: #20203c;
    --ink: #f2f4fc;
    --muted: #afb7cc;
    --border: #33354e;
    --accent: #4facfe;
    --hover: #252d4a;
    --shadow: 0 12px 32px rgb(0 0 0 / .2);
    --header-height: 72px;
    scroll-padding-top: calc(var(--header-height) + 20px);
}
.site-shell[data-theme="light"] {
    color-scheme: light;
    --page: #f8f9fd;
    --section: #eff2fa;
    --surface: #fff;
    --raised: #e8edf7;
    --ink: #20243d;
    --muted: #555f77;
    --border: #cbd3e4;
    --accent: #1764aa;
    --hover: #e5effc;
    --shadow: 0 12px 32px rgb(38 50 91 / .08);
}
.site-shell body { background: var(--page); color: var(--ink); overflow-x: visible; }
.site-shell body, .site-shell .navbar, .site-shell .game-card {
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.site-shell :is(a, button, summary, input, textarea):focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}
.site-shell :is(button, summary) { -webkit-tap-highlight-color: transparent; }
.site-shell :is(.text-gray-400, .text-gray-500, .text-gray-600):not(.mockup-window *, .game-preview *) { color: var(--muted); }
.site-shell .text-white:not(.mockup-window *, .game-preview *, .logo svg) { color: var(--ink); }
.site-shell [class*="bg-dark-"]:not(.mockup-window, .mockup-window *, .game-preview, .game-preview *) { background-color: var(--surface); }
.site-shell [class*="border-white/"]:not(.mockup-window *, .game-preview *) { border-color: var(--border); }
.site-shell section[style*="background:#"] { background: var(--section) !important; }
.site-shell[data-theme="light"] .text-g1:not(.mockup-window *, .game-preview *) { color: #1764aa; }
.site-shell[data-theme="light"] .text-g2:not(.mockup-window *, .game-preview *) { color: #197244; }
.site-shell[data-theme="light"] .text-g3:not(.mockup-window *, .game-preview *) { color: #866000; }
.site-shell[data-theme="light"] .text-g4:not(.mockup-window *, .game-preview *) { color: #b33340; }
.site-shell[data-theme="light"] .text-g5:not(.mockup-window *, .game-preview *) { color: #7841ae; }
.site-shell .navbar { background: var(--page); border-color: var(--border); backdrop-filter: none; transition: background-color 180ms ease; }
.site-shell .navbar-container { padding-inline: clamp(12px, 3vw, 32px); }
.site-shell .navbar-content { gap: 12px; height: var(--header-height); }
.site-shell .logo { flex-shrink: 0; }
.site-shell .nav-links { margin-left: auto; gap: 6px; }
.site-shell .nav-links > a, .site-shell .mega-trigger { min-height: 44px; padding: 10px 12px; font-size: 14px; white-space: nowrap; }
.site-shell .mega-trigger { background: transparent; border: 1px solid transparent; color: var(--ink); border-radius: 12px; }
.site-shell .mega-trigger:hover, .site-shell .mega-trigger[aria-expanded="true"], .site-shell .nav-links > a:hover { background: var(--hover); border-color: var(--border); transform: none; }
.site-shell .mega-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.site-shell .theme-toggle, .site-shell .mobile-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.site-shell .theme-toggle:hover, .site-shell .mobile-btn:hover { background: var(--hover); }
.site-shell .mobile-btn { display: none; }
.site-shell .mega-menu { top: 100%; width: min(1180px, calc(100vw - 32px)); background: var(--surface); border-color: var(--border); border-radius: 0 0 20px 20px; box-shadow: var(--shadow); backdrop-filter: none; max-height: calc(100dvh - var(--header-height) - 16px); overflow-y: auto; transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms; }
.site-shell .mega-menu .mega-grid.grid { max-height: none; overflow: visible; }
.site-shell .mega-title { margin-bottom: 16px; }
.site-shell .mega-menu-inner > .flex { gap: 16px; flex-wrap: wrap; }
.site-shell .game-item { border: 1px solid var(--border); border-radius: 12px; min-height: 48px; }
.site-shell .game-item:hover { transform: none; background: var(--hover); box-shadow: none; border-color: var(--accent); }
.site-shell .game-info, .site-shell .category-col { min-width: 0; }
.site-shell #megaCategories .mega-grid, .site-shell .mobile-nav-group .mega-grid { display: block; }
.site-shell #megaCategories .game-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.site-shell .trending-tags { flex-wrap: wrap; margin-top: 0; }
.site-shell .mega-footer { margin-top: 12px; padding-top: 16px; }
.site-shell .mobile-menu { top: var(--header-height); height: auto; bottom: 0; padding: 16px; background: var(--page); border-color: var(--border); backdrop-filter: none; overscroll-behavior: contain; display: block; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms; }
.site-shell .mobile-menu.active { opacity: 1; visibility: visible; transform: none; }
.site-shell .mobile-game-link { min-height: 48px; border: 1px solid var(--border); }
.site-shell .mobile-nav-group { border-bottom: 1px solid var(--border); }
.site-shell .mobile-nav-group summary { cursor: pointer; padding: 18px 4px; font-weight: 800; min-height: 48px; }
.site-shell .mobile-nav-group .mega-menu-inner { padding: 8px 0 20px; }
.site-shell .mobile-nav-group .category-col { padding: 12px 0; }
.site-shell .mobile-nav-group .game-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-shell .mobile-nav-group .mega-footer { display: none; } /* Duplicate badges remain in desktop panels. */
.site-shell.navigation-open { overflow: hidden; }
.site-shell .game-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(20px, 2vw, 28px); box-shadow: 0 3px 10px rgb(0 0 0 / .03); }
.site-shell .game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.site-shell .game-card:focus-visible { border-color: var(--accent); }
.site-shell .game-card h3 { line-height: 1.3; }
.site-shell .game-card p { line-height: 1.65; }
.site-shell section { scroll-margin-top: 20px; }
.site-shell body > section:first-of-type { padding-top: calc(var(--header-height) + 56px); padding-bottom: 64px; min-height: min(900px, 100svh); }
.site-shell h1 { text-wrap: balance; }
.site-shell .anim-fu, .site-shell .anim-fu.visible { opacity: 1; animation: none; }
.site-shell .shimmer { animation: none; }
.site-shell[data-theme="light"] .shimmer { background-image: linear-gradient(90deg, #1764aa, #7841ae, #866000, #197244); }
.site-shell :is(.fl1, .fl2, .fl3, .fl4, .fl5, .sparkle, .spin-slow, .pulse-glow, .animate-pulse, .wave-anim, .draw-a, .bounce-s, .confetti) { animation: none; }
.site-shell :is(.jello-hover, .wiggle-hover):hover { animation: none; }
.site-shell body a[class*="bg-gradient-to-"] { color: #171b34; }
.site-shell .mockup-window { color-scheme: dark; color: #e2e8f0; box-shadow: var(--shadow); }
.site-shell #heroMockup { width: 100%; }
.site-shell .game-tab { min-height: 44px; }
.site-shell #global-footer { min-height: 650px; }
@media (max-width: 1180px) {
    .site-shell { --header-height: 64px; }
    .site-shell .nav-links { display: none; }
    .site-shell .theme-toggle { margin-left: auto; }
    .site-shell .mobile-btn { display: grid; }
    .site-shell .mega-menu { display: none; }
}
@media (min-width: 1181px) { .site-shell .mobile-menu { display: none; } }
@media (max-width: 639px) {
    .site-shell body > section:first-of-type { padding-top: calc(var(--header-height) + 32px); padding-bottom: 48px; }
    .site-shell .navbar-content { gap: 8px; }
    .site-shell .logo { gap: 8px; }
    .site-shell .mobile-nav-group .game-items { grid-template-columns: 1fr; }
    .site-shell .mobile-menu .grid-cols-2 { grid-template-columns: 1fr; }
    .site-shell #global-footer { min-height: 1700px; }
}
@media (prefers-reduced-motion: reduce) {
    .site-shell *, .site-shell *::before, .site-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Match the existing wave dividers to their adjacent theme surfaces. */
.site-shell .wave-anim[fill="#111128"] { fill: var(--section); }
.site-shell .wave-anim[fill="#0a0a1a"] { fill: var(--page); }

.site-shell .mega-menu.active, .site-shell .mobile-menu.active { transition-delay: 0s; }
/* Do not animate inherited visibility: links must accept focus as soon as a panel opens. */
.site-shell .navbar :is(a, button, svg, summary) {
    transition-property: background-color, color, border-color, box-shadow, transform;
}
.site-shell body :is(a, button).text-white[class*="bg-gradient-to-"] { color: #171b34; }
.site-shell .theme-toggle[aria-pressed="true"] { border-color: var(--accent); }
.site-shell #heroTabs { flex-wrap: wrap; overflow: visible; }
.site-shell #heroTabs .game-tab { flex: 1 1 130px; justify-content: center; white-space: normal; }
.site-shell .site-footer svg.text-white { color: #fff; }
@media (min-width: 1024px) and (max-width: 1180px) {
    .site-shell body > section:first-of-type a.inline-flex { padding-inline: 16px; font-size: 16px; gap: 8px; white-space: nowrap; }
}
