.opening-stage{
  --frame:#e1ddd2;
  --cream:#eee9dd;
  --ink:#05070d;
  --alert:#ef4444;
  --signal:#22d3ee;
  --mint:#a6e6d6;
  --proof:#6ee7b7;
  --violet:#a855f7;
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
  position:relative;isolation:isolate;overflow:hidden;
  height:clamp(440px,56vw,660px);
  background:var(--ink);
  border:3px solid var(--frame);
  outline:none;cursor:pointer;
}
.opening-stage:focus-visible{outline:2px solid var(--mint);outline-offset:4px}
.opening-stage[data-shot=answer]{cursor:auto}
.opening-stage[data-paused] *,.opening-stage[data-paused] *::before,.opening-stage[data-paused] *::after{animation-play-state:paused!important}

.opening-shot{position:absolute;inset:0;margin:0;opacity:0;visibility:hidden;transition:opacity .45s ease,visibility 0s linear .45s}
.opening-stage[data-shot=title] .opening-shot--title,
.opening-stage[data-shot=wallet] .opening-shot--wallet,
.opening-stage[data-shot=split] .opening-shot--split,
.opening-stage[data-shot=dive] .opening-shot--split,
.opening-stage[data-shot=barrage] .opening-shot--split,
.opening-stage[data-shot=answer] .opening-shot--split{opacity:1;visibility:visible;transition-delay:0s}
.opening-stage[data-shot=idle] .opening-shot--title{opacity:1;visibility:visible}

.opening-still,.opening-ghost,.opening-loop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.opening-loop{opacity:0;transition:opacity .6s ease}
.opening-loop[data-live]{opacity:1}

.opening-shot--title{display:grid;place-content:center;justify-items:center;gap:20px;background:radial-gradient(55% 60% at 50% 45%,#140b16,var(--ink) 70%)}
.opening-title{margin:0;min-height:1em;font:200 clamp(72px,11vw,150px)/1 'Plus Jakarta Sans',sans-serif;letter-spacing:-.05em;color:var(--cream);white-space:nowrap}
.opening-title .ch{display:inline-block;opacity:0;filter:blur(10px);transform:translateY(.12em);transition:opacity .35s ease,filter .5s var(--ease-out),transform .5s var(--ease-out)}
.opening-title .ch[data-on]{opacity:1;filter:none;transform:none}
.opening-title::after{content:'';display:inline-block;width:.06em;height:.82em;margin-left:.06em;vertical-align:-.04em;background:var(--alert);box-shadow:0 0 18px var(--alert);animation:opening-caret .9s steps(1) infinite}
@keyframes opening-caret{50%{opacity:0}}
.opening-title-line{margin:0;max-width:30ch;text-align:center;font:italic 500 clamp(1rem,1.6vw,1.25rem)/1.5 Georgia,serif;color:#cfc9bd;opacity:0;transform:translateY(6px);transition:opacity .7s ease,transform .7s var(--ease-out)}
.opening-title-line[data-on]{opacity:1;transform:none}

.opening-stage[data-glitch] .opening-shot{animation:opening-glitch .34s steps(1) both}
@keyframes opening-glitch{
  0%{clip-path:inset(0 0 0 0);transform:none;filter:none}
  15%{clip-path:inset(12% 0 64% 0);transform:translateX(-14px);filter:hue-rotate(40deg) saturate(2)}
  30%{clip-path:inset(58% 0 18% 0);transform:translateX(18px)}
  45%{clip-path:inset(30% 0 41% 0);transform:translateX(-8px);filter:hue-rotate(-60deg) saturate(2.4)}
  60%{clip-path:inset(0 0 82% 0);transform:translateX(10px)}
  75%{clip-path:inset(76% 0 0 0);transform:translateX(-4px);filter:brightness(1.8)}
  100%{clip-path:inset(0 0 0 0);transform:none;filter:none}
}

.opening-shot--wallet .opening-still{clip-path:inset(50% 0 50% 0);opacity:0}
.opening-shot--wallet[data-on] .opening-still{animation:holo-on 1.25s var(--ease-out) forwards}
@keyframes holo-on{
  0%{clip-path:inset(50% 0 50% 0);opacity:.2;filter:brightness(2.6) saturate(.4)}
  18%{clip-path:inset(48% 0 48% 0);opacity:1}
  22%{opacity:.35}
  26%{opacity:1}
  55%{clip-path:inset(6% 0 6% 0);filter:brightness(1.35)}
  62%{opacity:.6}
  66%{opacity:1}
  100%{clip-path:inset(0 0 0 0);opacity:1;filter:none}
}
.opening-shot--wallet[data-flicker] .opening-still{animation:holo-flicker .5s steps(2) 1;clip-path:none;opacity:1}
@keyframes holo-flicker{0%,100%{opacity:1}30%{opacity:.62}55%{opacity:1}70%{opacity:.8}}
.opening-ghost{opacity:0;mix-blend-mode:screen;pointer-events:none}
.opening-ghost--red{filter:sepia(1) saturate(9) hue-rotate(-50deg) brightness(.8)}
.opening-ghost--cyan{filter:sepia(1) saturate(9) hue-rotate(140deg) brightness(.8)}
.opening-shot--wallet[data-on] .opening-ghost--red{animation:ghost-red 1.3s var(--ease-out) .2s both}
.opening-shot--wallet[data-on] .opening-ghost--cyan{animation:ghost-cyan 1.3s var(--ease-out) .2s both}
@keyframes ghost-red{0%{opacity:.75;transform:translateX(-9px)}70%{opacity:.35;transform:translateX(-2px)}100%{opacity:0;transform:none}}
@keyframes ghost-cyan{0%{opacity:.75;transform:translateX(9px)}70%{opacity:.35;transform:translateX(2px)}100%{opacity:0;transform:none}}
.fx-scanlines{position:absolute;inset:0;pointer-events:none;opacity:.16;mix-blend-mode:overlay;background:repeating-linear-gradient(180deg,rgba(255,255,255,.5) 0 1px,transparent 1px 4px);animation:scan-drift 6s linear infinite}
@keyframes scan-drift{to{background-position:0 80px}}

.fx-glow{position:absolute;left:0;top:0;width:10px;height:10px;border-radius:50%;pointer-events:none;mix-blend-mode:screen;opacity:0;transform:translate(-50%,-50%)}
.fx-glow--trophy{background:radial-gradient(closest-side,rgba(255,231,170,.85),rgba(255,200,90,.25) 55%,transparent)}
.fx-glow--wallet{background:radial-gradient(closest-side,rgba(255,70,70,.95),rgba(239,68,68,.35) 50%,transparent)}
.fx-glow--monitor{background:radial-gradient(closest-side,rgba(34,211,238,.8),rgba(34,211,238,.22) 55%,transparent)}
.fx-glow--phone{background:radial-gradient(closest-side,rgba(207,250,254,1),rgba(34,211,238,.55) 40%,transparent)}
.fx-glow--face{background:radial-gradient(closest-side,rgba(103,232,249,.45),transparent)}
.opening-shot--wallet[data-on] .fx-glow--trophy{animation:trophy-shine 4.2s ease-in-out 1.4s infinite}
@keyframes trophy-shine{0%,100%{opacity:0}45%{opacity:.7}55%{opacity:.55}}
.fx-glow[data-flare]{animation:glow-flare .9s var(--ease-out)}
@keyframes glow-flare{0%{opacity:0;transform:translate(-50%,-50%) scale(.5)}18%{opacity:1;transform:translate(-50%,-50%) scale(1.15)}100%{opacity:0;transform:translate(-50%,-50%) scale(1)}}
.fx-glow--wallet[data-beat]{animation:wallet-beat 1.6s ease-in-out infinite}
@keyframes wallet-beat{0%,100%{opacity:.25;transform:translate(-50%,-50%) scale(.92)}40%{opacity:.8;transform:translate(-50%,-50%) scale(1.06)}}
.opening-stage[data-shot=split] .fx-glow--monitor{animation:monitor-breathe 2.4s ease-in-out infinite}
@keyframes monitor-breathe{0%,100%{opacity:.35}50%{opacity:.75}}

.fx-trace{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.fx-trace-base{fill:none;stroke:none}
.fx-trace-pulse{fill:none;stroke:#ff5a5a;stroke-width:5;stroke-linecap:round;filter:drop-shadow(0 0 6px #ef4444) drop-shadow(0 0 14px #ef4444);opacity:0}
.fx-trace[data-pulse] .fx-trace-pulse{animation:trace-pulse 1.25s cubic-bezier(.55,0,.35,1)}
@keyframes trace-pulse{0%{opacity:1;stroke-dashoffset:var(--trace-start)}88%{opacity:1}100%{opacity:0;stroke-dashoffset:var(--trace-end)}}
.fx-check{fill:none;stroke:var(--proof);stroke-width:3;opacity:0;filter:drop-shadow(0 0 8px var(--proof));transform-box:fill-box;transform-origin:center}
.fx-check[data-on]{animation:check-ring .9s var(--ease-out) forwards}
@keyframes check-ring{0%{opacity:0;transform:scale(.6)}25%{opacity:1;transform:scale(1.25)}100%{opacity:0;transform:scale(1.6)}}

.opening-shot--split{display:grid;grid-template-columns:1fr 1fr}
.opening-shot--split::after{content:'';position:absolute;z-index:3;left:50%;top:0;bottom:0;width:3px;transform:translateX(-50%);background:var(--frame);transition:box-shadow .4s ease,background .4s ease}
.opening-shot--split[data-hot]::after{background:linear-gradient(180deg,var(--signal),var(--alert),var(--signal));box-shadow:0 0 18px rgba(34,211,238,.8)}
.opening-stage[data-shot=dive] .opening-shot--split::after,.opening-stage[data-shot=barrage] .opening-shot--split::after,.opening-stage[data-shot=answer] .opening-shot--split::after{opacity:0}
.opening-half{position:relative;margin:0;overflow:hidden;transition:transform .9s var(--ease-out),opacity .6s ease,filter .7s ease}
.opening-half--jay{transform:translateX(-14%);opacity:0}
.opening-half--kai{transform:translateX(14%);opacity:0}
.opening-stage[data-shot=split] .opening-half,.opening-stage[data-shot=dive] .opening-half,.opening-stage[data-shot=barrage] .opening-half,.opening-stage[data-shot=answer] .opening-half{transform:none;opacity:1}
.opening-stage[data-shot=dive] .opening-half--jay{opacity:0;transition-duration:.45s}
.opening-stage[data-shot=barrage] .opening-half,.opening-stage[data-shot=answer] .opening-half{filter:blur(9px) brightness(.38) saturate(.7)}
.opening-half--kai[data-buzz]{animation:half-buzz .3s linear}
@keyframes half-buzz{0%,100%{translate:0}20%{translate:-3px 0}40%{translate:3px 1px}60%{translate:-2px -1px}80%{translate:2px 0}}
.fx-led{position:absolute;left:0;right:8%;top:0;height:2.6%;pointer-events:none;mix-blend-mode:screen;background:linear-gradient(180deg,rgba(216,180,254,.75),rgba(168,85,247,.25) 55%,transparent);animation:led-flicker 5s steps(1) infinite}
@keyframes led-flicker{0%,100%{opacity:.7}8%{opacity:.35}9%{opacity:.8}52%{opacity:.6}53%{opacity:.9}}
.opening-room{position:absolute;top:14px;left:14px;z-index:2;padding:5px 9px;background:rgba(5,7,13,.72);color:var(--cream);font:700 .62rem/1 'Space Mono',monospace;letter-spacing:.08em;text-transform:uppercase}
.opening-stage[data-shot=dive] .opening-room,.opening-stage[data-shot=barrage] .opening-room,.opening-stage[data-shot=answer] .opening-room{opacity:0}

.opening-fx{position:absolute;inset:0;width:100%;height:100%;z-index:4;pointer-events:none}
.opening-flash{position:absolute;z-index:5;left:0;top:0;width:10px;height:10px;border-radius:50%;pointer-events:none;opacity:0;transform:translate(-50%,-50%);background:radial-gradient(closest-side,#f0fdff,rgba(103,232,249,.85) 45%,rgba(34,211,238,0))}

.opening-insert{
  position:absolute;z-index:6;top:14px;bottom:14px;left:50%;
  width:min(410px,calc(100% - 28px));transform:translateX(-50%);
  border-radius:30px;overflow:hidden;opacity:0;pointer-events:none;
  background:
    radial-gradient(70% 45% at 30% 20%,rgba(90,45,140,.78),transparent 70%),
    radial-gradient(60% 50% at 80% 85%,rgba(157,44,110,.58),transparent 70%),
    #0a0418;
  border:1px solid rgba(255,255,255,.16);box-shadow:0 30px 90px rgba(0,0,0,.75),0 0 0 7px rgba(255,255,255,.035);
}
.opening-stage[data-shot=barrage] .opening-insert,.opening-stage[data-shot=answer] .opening-insert{opacity:1;pointer-events:auto}
.opening-insert-clock{margin:36px 0 20px;text-align:center;font:200 4.6rem/1 'Plus Jakarta Sans',sans-serif;letter-spacing:-.04em;color:rgba(255,255,255,.94)}
.opening-insert[data-buzz]{animation:insert-buzz .28s linear}
@keyframes insert-buzz{0%,100%{translate:0}25%{translate:-3px 0}50%{translate:3px 0}75%{translate:-2px 0}}
.opening-barrage{margin:0;padding:0 12px;list-style:none;display:flex;flex-direction:column;gap:8px}
.opening-note{
  display:flex;align-items:flex-start;gap:10px;padding:10px 12px;
  background:rgba(28,28,36,.9);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,.1);border-radius:16px;
  box-shadow:0 12px 30px rgba(0,0,0,.5);
  animation:note-in .55s var(--ease-spring) both;
}
.opening-note img{width:34px;height:34px;border-radius:50%;object-fit:cover;flex-shrink:0}
.opening-note span{display:flex;flex-direction:column;min-width:0}
.opening-note strong{display:flex;justify-content:space-between;gap:10px;font:700 .82rem/1.3 'DM Sans',sans-serif;color:#fff}
.opening-note strong small{font-weight:500;color:rgba(255,255,255,.45)}
.opening-note em{font:400 .86rem/1.35 'DM Sans',sans-serif;font-style:normal;color:rgba(255,255,255,.88)}
.opening-barrage>li:nth-child(n+3) .opening-note{opacity:.82;transform:scale(.97)}
@keyframes note-in{from{opacity:0;transform:translateY(-26px) scale(.94)}to{opacity:1;transform:none}}
.opening-answer:focus-visible{outline:2px solid var(--mint);outline-offset:3px}
.opening-answer{
  display:flex;align-items:center;gap:12px;width:100%;margin:0;padding:12px 14px;text-align:left;cursor:pointer;text-decoration:none;
  background:var(--cream);color:#1a1720;border:0;border-radius:16px;
  box-shadow:0 0 0 0 rgba(166,230,214,.6),0 16px 36px rgba(0,0,0,.55);
  animation:note-in .55s var(--ease-spring) both,answer-pulse 1.8s ease-in-out .7s infinite;
}
.opening-answer img{width:38px;height:38px;border-radius:50%;object-fit:cover}
.opening-answer span{display:flex;flex-direction:column}
.opening-answer strong{font:800 .95rem/1.25 'Plus Jakarta Sans',sans-serif}
.opening-answer em{font:500 .8rem/1.3 'DM Sans',sans-serif;font-style:normal;color:#4b4552}
@keyframes answer-pulse{0%,100%{box-shadow:0 0 0 0 rgba(166,230,214,.55),0 16px 36px rgba(0,0,0,.55)}50%{box-shadow:0 0 0 8px rgba(166,230,214,0),0 16px 36px rgba(0,0,0,.55)}}

.opening-caption{
  position:absolute;z-index:7;left:22px;bottom:22px;max-width:min(430px,calc(100% - 44px));margin:0;
  padding:15px 18px;background:var(--cream);color:#27252b;
  font:500 clamp(1rem,1.5vw,1.25rem)/1.45 Georgia,serif;box-shadow:4px 4px 0 #171722bb;
  opacity:0;transform:translateY(8px);transition:opacity .4s ease,transform .5s var(--ease-out);
  pointer-events:none;
}
.opening-caption[data-visible]{opacity:1;transform:none}
.opening-caption .w{opacity:0;transition:opacity .3s ease}
.opening-caption .w[data-on]{opacity:1}
.opening-stage[data-shot=split] .opening-caption{left:auto;right:22px}
.opening-stage[data-shot=dive] .opening-caption,.opening-stage[data-shot=barrage] .opening-caption,.opening-stage[data-shot=answer] .opening-caption{opacity:0}

.opening-controls{position:absolute;z-index:8;top:12px;right:12px;display:flex;gap:8px}
.opening-controls [hidden]{display:none}
.opening-controls button{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:8px 12px;border-radius:99px;border:1px solid rgba(255,255,255,.2);background:rgba(5,7,13,.66);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);color:#fff;font:600 .78rem 'DM Sans',sans-serif;cursor:pointer}
.opening-controls svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.opening-sound .sound-on{display:none}
.opening-sound[aria-pressed=true] .sound-on{display:block}
.opening-sound[aria-pressed=true] .sound-off{display:none}
.opening-sound[aria-pressed=false]{animation:sound-hint 2.2s ease-in-out infinite}
@keyframes sound-hint{0%,100%{border-color:rgba(255,255,255,.2)}50%{border-color:rgba(166,230,214,.85)}}
.opening-stage[data-shot=answer] .opening-controls{top:auto;bottom:12px}
.opening-fallback{position:absolute;z-index:9;inset:auto 22px 22px;margin:0;padding:14px 16px;background:var(--cream);color:#27252b;font:500 .95rem 'DM Sans',sans-serif}

@media (max-width:760px){
  .opening-stage{height:min(84svh,720px)}
  .opening-title{font-size:clamp(64px,22vw,96px)}
  .opening-shot--split{grid-template-columns:1fr;grid-template-rows:1fr 1fr}
  .opening-shot--split::after{left:0;right:0;top:50%;bottom:auto;width:auto;height:3px;transform:translateY(-50%)}
  .opening-shot--split[data-hot]::after{background:linear-gradient(90deg,var(--signal),var(--alert),var(--signal))}
  .opening-half--jay{transform:translateY(-14%)}
  .opening-half--kai{transform:translateY(14%)}
  .opening-insert{top:0;bottom:0;width:100%;border-radius:0;border:0;box-shadow:none}
  .opening-insert-clock{margin-top:30px;font-size:3.8rem}
  .opening-note{padding:8px 10px}
  .opening-note img{width:28px;height:28px}
  .opening-caption,.opening-stage[data-shot=split] .opening-caption{left:12px;right:12px;bottom:12px;max-width:none;padding:12px 14px}
  .opening-stage[data-shot=barrage] .opening-controls{top:auto;bottom:12px}
}
@media (prefers-reduced-motion:reduce){
  .opening-stage *,.opening-stage *::before,.opening-stage *::after{animation:none!important;transition-duration:.01ms!important}
  .opening-shot--wallet .opening-still{clip-path:none;opacity:1}
  .opening-fx{display:none}
}
