/* webgl-mix intro (P2-P8). Colours: night #080D15, warm white #EDE6DA. No glow. The only red is the pre-film red button
   (2026-10-15 user decision; drawn in WebGL by mix/redbutton.js, CSS only when there is no WebGL2). */
.mx-root { background: #080D15; }
.mx-root .intro-stage, .mx-root .intro-overlay { position: absolute; inset: 0; overflow: hidden; }
.mx-root .intro-stage { background: #080D15; }
.mx-canvas, .mx-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mx-video { object-fit: cover; opacity: 0; transition: opacity 250ms linear; background: #080D15; pointer-events: none; }  /* = the 6-frame lift; no pointer = no browser video menu, so no seek-to-end skip */
.mx-video.on { opacity: 1; }

/* the shell's own boot line stays for screen readers only while the intro owns the screen (design.md 10) */
.mx-root .boot-line { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.mx-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the shell's pulsing "press any key" prompt next to Start: not while the intro owns the screen (2026-10-15 review) */
.mx-root .intro-prompt { display: none !important; }

/* the centred ring: the pre-film VIDEO readiness only (since 2026-10-15 there is no post-film ring); hidden unless .on;
   never visible while the film plays; no text label on screen */
.mx-ringhost { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center;
  opacity: 0; visibility: hidden; transition: opacity 250ms linear, visibility 0s linear 250ms; pointer-events: none; }
.mx-ringhost.on { opacity: 1; visibility: visible; transition: opacity 250ms linear, visibility 0s; }
.mx-ring { position: relative; width: 64px; height: 64px; }
.mx-ring svg { display: block; transform: rotate(-90deg); overflow: visible; }
.mx-ring circle { fill: none; stroke-width: 2; }
.mx-trk { stroke: rgba(237, 230, 218, 0.15); }
.mx-val { stroke: rgba(237, 230, 218, 0.85); transition: stroke-dashoffset 200ms linear; }
.mx-ring.mx-instant .mx-val { transition: none; }
.mx-ind { stroke: rgba(237, 230, 218, 0.6); display: none; }
.mx-pct { position: absolute; inset: 0; display: grid; place-items: center; font: 400 15px/1 "Mandation Shell Text", "Mandation Shell CJK", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; color: rgba(237, 230, 218, 0.9); letter-spacing: 0; }
/* indeterminate (no whole-engine ratio from the shell): no number, no value arc, a short segment turning */
.mx-ring-ind .mx-val, .mx-ring-ind .mx-pct { display: none; }
/* 2026-10-16 red-button merge: the WebGL draws the ring (it becomes the button); only the % number stays DOM */
.mx-ring-gl .mx-ring svg { visibility: hidden; }
.mx-ring-ind .mx-ind { display: inline; transform-origin: 32px 32px; animation: mx-turn 1.6s linear infinite; }
@keyframes mx-turn { to { transform: rotate(360deg); } }

/* 1 px engine line along the bottom edge: from the film (400 ms after frame 1) through the ending until the game starts
   (2026-10-15 user decision; no ring after the film). <i> = the measured whole-engine ratio; without one the line is
   numberless: <b>, a short segment sliding slowly (reduced motion: a still, dim full-width track) */
/* the shell's old bottom gradient (.intro-art::after, for its boot line) lay over this overlay and darkened the film */
.mx-root .intro-art::after { display: none; }
.mx-line { position: absolute; left: 0; right: 0; bottom: env(safe-area-inset-bottom, 0px); height: 4px; overflow: hidden; background: rgba(7, 11, 18, 0.5); opacity: 0; visibility: hidden; transition: opacity 300ms linear, visibility 0s linear 300ms; pointer-events: none; }
.mx-line.on { opacity: 1; visibility: visible; transition: opacity 300ms linear, visibility 0s; }
.mx-line i { position: absolute; inset: 0; background: rgba(237, 230, 218, 0.95); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; transition: transform 260ms linear; }
/* the engine % over the film and the logo, bottom right, above the bar (2026-11-07 user decision) */
.mx-linepct { position: absolute; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); padding: 4px 8px; border-radius: 4px; background: rgba(7, 11, 18, 0.58); font: 600 18px/1 "Mandation Shell Text", "Mandation Shell CJK", system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #EDE6DA; opacity: 0; visibility: hidden; transition: opacity 300ms linear, visibility 0s linear 300ms; pointer-events: none; }
.mx-linepct.on { opacity: 1; visibility: visible; transition: opacity 300ms linear, visibility 0s; }
.mx-line b { position: absolute; top: 0; bottom: 0; left: 0; width: 18%; background: rgba(237, 230, 218, 0.8); display: none; }
.mx-line.mx-line-ind i { display: none; }
.mx-line.mx-line-ind b { display: block; animation: mx-slide 2.4s linear infinite; }
@keyframes mx-slide { from { transform: translateX(-100%); } to { transform: translateX(556%); } }

/* the start prompt (2026-10-15 user decision): the only text over the film, small and quiet - a rounded toy pill with a
   key cap; the press-and-hold fills its underline (no ring: rings belong to the pre-film video loader). No glow. */
.mx-root { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.mx-prompt { position: absolute; left: 50%; bottom: max(26px, 5.2%); transform: translateX(-50%); display: block; padding: 6px 15px 7px; border-radius: 999px;
  background: rgba(9, 13, 21, 0.62); color: rgba(237, 230, 218, 0.92); font: 400 14px/1.25 "Mandation Shell Text", "Mandation Shell CJK", system-ui, sans-serif; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity 300ms linear, visibility 0s linear 300ms; pointer-events: none; }
.mx-prompt.on { opacity: 1; visibility: visible; transition: opacity 300ms linear, visibility 0s; }
/* 2026-10-16 (lead's design): icons say what to press - a Space keycap, a mouse with its left button marked (the hold
   fills that button from the bottom), a finger on touch-only devices. Language-neutral strokes, no words inside, no glow.
   The words around them carry their own spaces ("Space 를" gap fixed: no margins on the keycap beyond 1 px) */
.mx-prompt-text { display: inline-block; vertical-align: top; }
.mx-icw { display: inline-block; width: auto; height: 20px; line-height: 0; vertical-align: middle; margin: -2px 0 0; }   /* 2026-10-26: no side margin - the words carry their own spaces (the keycap showed ~2 px extra on its right: 1 px margin + the stroke inset) */
.mx-ic { display: block; overflow: visible; }
/* 2026-10-26: the Space key in the mouse's style (outline 1.25, the pressed face marked 0.22, the glyph a stroke) */
.mx-ic .k-body { fill: none; stroke: rgba(237, 230, 218, 0.88); stroke-width: 1.25; stroke-linejoin: round; }
.mx-ic .k-face { fill: rgba(237, 230, 218, 0.22); }
.mx-ic .k-sym { fill: none; stroke: rgba(237, 230, 218, 0.88); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.mx-ic .m-body, .mx-ic .f-out { fill: none; stroke: rgba(237, 230, 218, 0.88); stroke-width: 1.25; stroke-linejoin: round; }
.mx-ic .m-div { fill: none; stroke: rgba(237, 230, 218, 0.88); stroke-width: 1.1; }
.mx-ic .m-lb { fill: rgba(237, 230, 218, 0.22); }
.mx-ic .f-hand { fill: rgba(237, 230, 218, 0.10); }
.mx-ic .f-tap { fill: none; stroke: rgba(237, 230, 218, 0.6); stroke-width: 1.1; stroke-linecap: round; }
.mx-ic .mx-hold { fill: rgba(237, 230, 218, 0.92); }

/* the red button's real control: transparent, over the drawn button (position from MxRedButton.hitCircle); its focus
   ring is drawn by the WebGL (a flat ring round the housing) */
.mx-rb { position: absolute; z-index: 4; border: 0; padding: 0; margin: 0; border-radius: 50%; background: transparent; cursor: pointer; pointer-events: auto; outline: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-touch-callout: none; }
.mx-rb[hidden] { display: none; }
/* the main-thread gate canvas (DOM <video> path): over the video until the button is gone */
.mx-rbc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* no WebGL2 at all: a CSS toy button, tilted with perspective, crossfaded from the SVG ring */
.mx-rbcss { position: absolute; left: 50%; top: 50%; width: var(--mx-rb-d, 146px); height: var(--mx-rb-d, 146px); transform: translate(-50%, -50%); perspective: 600px;
  opacity: 0; transition: opacity 250ms linear; pointer-events: none; }
.mx-rbcss.on { opacity: 1; }
.mx-rbcss.out { opacity: 0; transition-duration: 200ms; }
.mx-rbcss i { position: absolute; border-radius: 50%; transform: rotateX(35deg); }
.mx-rbcss .h { inset: 0; background: radial-gradient(circle at 50% 40%, #f1ebe1, #d9d2c6 70%); box-shadow: 0 9px 0 #a9a296; }
.mx-rbcss .d { inset: 12%; background: radial-gradient(circle at 42% 34%, #e2453d, #cc1e26 55%, #a3161d); box-shadow: 0 8px 0 #85121a; transition: transform 70ms ease-out, box-shadow 70ms ease-out; }
.mx-rbcss.hover .d { box-shadow: 0 9px 0 #85121a; }
.mx-rbcss.down .d { transform: rotateX(35deg) translateY(6px); box-shadow: 0 2px 0 #85121a; }
.mx-rb.mx-rb-css:focus-visible { outline: 2px solid rgba(237, 230, 218, 0.85); outline-offset: 4px; }

/* end picture: the DOM poster (T0, DOM path, reduced motion, save-data, iOS, a stand-in while the worker's scene loads) */
.mx-poster { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 300ms linear, visibility 0s linear 300ms; }
.mx-poster.on { opacity: 1; visibility: visible; transition-property: opacity, visibility; transition-delay: 0s; }
.mx-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* logo + left panel tone (spec 9): positions come from intro.js layout() (engine rect or the spec formula) */
.mx-logo { position: absolute; left: 0; top: 0; width: 0; height: auto; opacity: 0; visibility: hidden; transition: opacity 1.2s linear, visibility 0s linear 1.2s; pointer-events: none; }
.mx-logo.on { opacity: 1; visibility: visible; transition-property: opacity, visibility; transition-delay: 0s; }
.mx-panel { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(9, 13, 21, 0.82); opacity: 0; visibility: hidden; transition: opacity 0.6s linear, visibility 0s linear 0.6s; pointer-events: none; }
.mx-panel.on { opacity: 1; visibility: visible; transition-property: opacity, visibility; transition-delay: 0s; }
.mx-panel[hidden] { display: none; }
/* portrait: a flat-to-clear top tone under the logo (the 9:16 B frame puts the chairman's white hair there) */
.mx-scrim { position: absolute; left: 0; right: 0; top: 0; height: 34%; background: linear-gradient(rgba(9, 13, 21, 0.82) 0%, rgba(9, 13, 21, 0.82) 55%, rgba(9, 13, 21, 0) 100%);
  opacity: 0; visibility: hidden; transition: opacity 1.2s linear, visibility 0s linear 1.2s; pointer-events: none; }
.mx-scrim.on { opacity: 1; visibility: visible; transition-property: opacity, visibility; transition-delay: 0s; }
.mx-scrim[hidden] { display: none; }

/* NO SKIP (2026-10-16 user decision, design.md 14 #21): the shell's #intro-action (its Skip / Start button) never shows
   while the intro owns the screen - not on input, not on keyboard focus (display:none takes it out of the tab order and
   the accessibility tree). The start is the intro's own prompt. The shell's static fallback (the intro failed) keeps it. */
.mx-root:not([data-mode="static"]) .intro-actions { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .mx-val, .mx-line i { transition: none; }
  .mx-rbcss, .mx-rbcss .d { transition-duration: 1ms; }
  .mx-line.mx-line-ind b { animation: none; width: 100%; background: rgba(237, 230, 218, 0.16); }
  .mx-ring-ind .mx-ind { animation: none; display: none; }
}

/* PLAN W1 (web-4k/webgl-perf): raster warm-up before anything is on screen (3 frames at opacity 0.004) */
.mx-warm .mx-prompt, .mx-warm .mx-line, .mx-warm .mx-line b, .mx-warm .mx-panel, .mx-warm .mx-scrim { visibility: visible !important; opacity: 0.004 !important; transition: none !important; }
.mx-warm .mx-panel { width: 30% !important; }
