/* Atomschlag – cheap menus for tablets and phones (§8.20.5). theme.js sets <html data-q="low|medium|high|ultra">
   and html.ui-lite at low and medium. The rooms keep their look; only the costly passes go:
   - low + medium: no backdrop-filter, no full-screen filter, no mix-blend-mode on large layers, no animated
     filter / box-shadow / background-position; the theme grain is the pre-baked tile (textures.js --tex-grain)
   - low: no continuous CSS animation at all (one-shot entrances and press feedback stay)
   The running match is the hud package's business (html.in-match is left alone). */

/* ------------------------------------------------------------------ low + medium */
html.ui-lite:not(.in-match) *, html.ui-lite:not(.in-match) *::before, html.ui-lite:not(.in-match) *::after {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
/* glass without blur needs a denser pane to stay readable */
html.ui-lite[data-theme='modern'] .panel { background-color: rgba(16, 20, 26, 0.92); }
html.ui-lite .menu-root[data-scene='modern'] .menu-card { background: linear-gradient(180deg, rgba(160, 200, 240, 0.09), rgba(160, 200, 240, 0) 38%), rgba(12, 18, 26, 0.84); }
html.ui-lite .menu-root[data-scene='modern'] .menu-chip, html.ui-lite .menu-root[data-scene='modern'] .menu-brief,
html.ui-lite .menu-root[data-scene='modern'] .menu-news, html.ui-lite .menu-root[data-scene='modern'] .menu-icon { background: rgba(18, 22, 28, 0.92); }

/* the theme overlay over the whole screen: a static, composited layer – ww2 grain baked, no blend mode */
html.ui-lite body::after { mix-blend-mode: normal !important; transform: translateZ(0); }
html.ui-lite[data-theme='ww2'] body::after, html.ui-lite:not([data-theme]) body::after { background: var(--tex-grain, none) 0 0 / 160px 160px; opacity: 1; }

/* ww2 tent: the dusk is painted, not blended */
html.ui-lite .sc-sunset { display: none; }
html.ui-lite .sc-window { background: linear-gradient(180deg, #2a1530 0%, #7a2e22 9%, #d0582a 16%, #f49a46 21%, #ffcb7a 24%, #5a3214 27%, #22150a 100%); }
html.ui-lite .sc-sun { mix-blend-mode: normal; opacity: 0.8; }
html.ui-lite .sc-rays, html.ui-lite .sc-grain, html.ui-lite .sc-board, html.ui-lite .loading-rays { mix-blend-mode: normal; }
/* modern: the projector cone behind the sub screens is plain translucent light */
html.ui-lite .sc-cone { mix-blend-mode: normal; opacity: 0.75; }
html.ui-lite .fx-blend-screen { mix-blend-mode: normal; }

/* modern: the beam onto the start button as painted light (the Laser Flow shader needs a third WebGL context) */
html.ui-lite .menu-root[data-scene='modern'] .menu-brief-beam { pointer-events: none;
  background: radial-gradient(ellipse 45% 22% at 50% 100%, rgba(133, 218, 1, 0.35), transparent 70%), linear-gradient(90deg, transparent 47%, rgba(190, 255, 90, 0.5) 50%, transparent 53%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%); mask-image: linear-gradient(180deg, transparent, #000 60%); }

/* loading screen: the key art stands still and is graded by the dark veil above it, not by a filter */
html.ui-lite .loading-bg::before { filter: none; animation: none; transform: scale(1.04); opacity: 0.38; }

/* animations that repaint every frame (filter, box-shadow, background-position) */
html.ui-lite .brand-static .as-logo { animation: none; }
html.ui-lite .mi-pulse, html.ui-lite .hub-missions.flash, html.ui-lite .lb-countdown { animation: none; }
html.ui-lite .menu-root[data-scene='modern'] .mb-pv::after { animation: none; background-position: 0 50%; opacity: 0.5; }
html.ui-lite .fx-shiny { animation: none; background-position: 100% 0; }
html.ui-lite .fx-scanlines.fx-scan-flicker { animation: none; }
html.ui-lite .menu-root[data-scene='coldwar'] .menu-brief.is-fresh { animation: crt-on-lite 300ms steps(5); }
html.ui-lite .menu-root[data-scene='modern'] .menu-brief.is-fresh { animation: holo-in-lite 360ms var(--ease-out); }
@keyframes crt-on-lite { 0% { clip-path: inset(48% 0 48% 0); opacity: 0.6; } 50% { clip-path: inset(10% 0 10% 0); } 100% { clip-path: inset(0); opacity: 1; } }
@keyframes holo-in-lite { 0% { opacity: 0; translate: 0 0.4rem; } 100% { opacity: 1; translate: 0 0; } }

/* ------------------------------------------------------------------ software rasterizer (§8.25) */
/* html.gl-soft (theme.js): WebGL runs on the CPU (SwiftShader, llvmpipe – perf.js gpuClass 'software'). Every
   blend mode and backdrop filter there is an extra full-screen read-back pass on the CPU (~25 % of a menu frame).
   The shader and canvas effects stay; the passes go exactly as on tablets (the lite rules above): blends become
   normal, the ww2 dusk is painted, the grain is the baked tile, glass panes get denser instead of blurred. */
html.gl-soft:not(.in-match) *, html.gl-soft:not(.in-match) *::before, html.gl-soft:not(.in-match) *::after {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html.gl-soft[data-theme='modern'] .panel { background-color: rgba(16, 20, 26, 0.92); }
html.gl-soft .menu-root[data-scene='modern'] .menu-card { background: linear-gradient(180deg, rgba(160, 200, 240, 0.09), rgba(160, 200, 240, 0) 38%), rgba(12, 18, 26, 0.84); }
html.gl-soft .menu-root[data-scene='modern'] .menu-chip, html.gl-soft .menu-root[data-scene='modern'] .menu-brief,
html.gl-soft .menu-root[data-scene='modern'] .menu-news, html.gl-soft .menu-root[data-scene='modern'] .menu-icon { background: rgba(18, 22, 28, 0.92); }
html.gl-soft body::after { mix-blend-mode: normal !important; transform: translateZ(0); }
html.gl-soft[data-theme='ww2'] body::after, html.gl-soft:not([data-theme]) body::after { background: var(--tex-grain, none) 0 0 / 160px 160px; opacity: 1; }
html.gl-soft .sc-sunset, html.gl-soft .sc-grain { display: none; }
html.gl-soft .sc-window { background: linear-gradient(180deg, #2a1530 0%, #7a2e22 9%, #d0582a 16%, #f49a46 21%, #ffcb7a 24%, #5a3214 27%, #22150a 100%); }
html.gl-soft .sc-sun { mix-blend-mode: normal; opacity: 0.8; }
html.gl-soft .sc-rays, html.gl-soft .sc-board, html.gl-soft .loading-rays { mix-blend-mode: normal; }
html.gl-soft .sc-cone { mix-blend-mode: normal; opacity: 0.75; }
html.gl-soft .fx-blend-screen { mix-blend-mode: normal; }

/* ------------------------------------------------------------------ touch (§8.20.7): finger-sized targets */
@media (pointer: coarse) {
  .screen .btn, .dialog .btn, .screen .seg-btn, .screen .tab { min-height: 44px; }
  .screen .btn-icon, .dialog .btn-icon { min-width: 44px; min-height: 44px; }
  /* the footer's language switch grows to finger size: the card row moves up to make room */
  .menu-root[data-scene] .menu-cards { bottom: calc(0.35rem + 50px); }
  /* small text links keep their look and get an invisible hit area */
  .menu-news-more { position: relative; }
  .menu-news-more::after { content: ''; position: absolute; left: -0.4rem; right: -0.4rem; top: 50%; height: 44px; translate: 0 -50%; }
}

/* ------------------------------------------------------------------ low: no continuous animation */
html[data-q='low'] .sc-lamp, html[data-q='low'] .sc-beacon-light, html[data-q='low'] .sc-rec, html[data-q='low'] .server-dot.connecting,
html[data-q='low'] .loading-hint, html[data-q='low'] .loading-step.active .ico, html[data-q='low'] .spinner span,
html[data-q='low'] .mt-proj-lens, html[data-q='low'] .fx-caret, html[data-q='low'] .fx-scanlines, html[data-q='low'] .fx-scanlines::after, html[data-q='low'] .fx-scanlines.fx-scan-roll::after,
html[data-q='low'] .fx-circ-ring, html[data-q='low'] .intro-img.show {
  animation: none !important;
}
/* the glitch ghosts only make sense while they jump */
html[data-q='low'] .fx-glitch::before, html[data-q='low'] .fx-glitch::after { display: none; }
html[data-q='low'] .loading-step.active .ico, html[data-q='low'] .spinner span { opacity: 1; }
