/* Stage briefings: one surface, from centered instruction to compact live HUD. */
#stageHud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  color: #eee6ec;
}
#stageHud[hidden] { display: none !important; }
.stage-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 46%, #100c1280, #09070bbd 85%);
  opacity: 1;
  transition: opacity 600ms ease;
}
.stage-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(660px, calc(100% - 64px));
  height: 338px;
  transform: translate(-50%, -50%);
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(125deg, #1a141beF, #100d13f5 75%);
  border: 1px solid #bc9bb333;
  border-radius: 12px;
  box-shadow: 0 32px 100px #0006, inset 0 1px #f3d8ee08;
  transition: top 650ms cubic-bezier(.22,1,.36,1), transform 650ms cubic-bezier(.22,1,.36,1), height 650ms cubic-bezier(.22,1,.36,1), background 400ms, border-radius 650ms, box-shadow 650ms;
}
.stage-card::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 260px;
  right: -170px;
  top: -160px;
  border: 1px solid #c6acd015;
  border-radius: 50%;
  box-shadow: 0 0 0 32px #c6acd006, 0 0 0 65px #c6acd005;
  pointer-events: none;
  transition: opacity 180ms;
}
.stage-recap {
  position: absolute;
  left: 50%;
  top: calc(50% - 204px);
  transform: translateX(-50%);
  max-width: calc(100% - 64px);
  font: 10px/1.5 Consolas, monospace;
  letter-spacing: 1.5px;
  color: #b4a1b3;
  white-space: nowrap;
  transition: opacity 170ms, translate 250ms;
}
.stage-recap::before { content: ''; display: inline-block; width: 18px; height: 1px; background: #b69db450; margin: 0 12px 3px 0; }
#stageHud[data-completed=true] .stage-recap::before { content: '✓'; height: auto; width: auto; background: none; color: #ccb3ca; margin-bottom: 0; }
.stage-journey { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 3px; height: 2px; padding: 0 16px; }
.stage-journey i { flex: 1; min-width: 0; background: #d1b8ce12; }
.stage-journey i[data-state=complete] { background: #ac93b17d; }
.stage-journey i[data-state=current] { background: #e1bfd6; box-shadow: 0 0 10px #e1bfd659; }
.stage-journey i[data-state=skipped] { background: #d1b48880; }
.stage-overline { position: absolute; top: 29px; left: 32px; display: flex; align-items: center; gap: 13px; color: #b7a1b4; font: 9px/1.4 Consolas, monospace; letter-spacing: 1.6px; text-transform: uppercase; transition: top 650ms cubic-bezier(.22,1,.36,1), left 650ms, font-size 650ms; }
.stage-overline i { width: 2px; height: 2px; border-radius: 50%; background: #a88ca5; }
#stageNumber { position: absolute; right: 30px; top: 57px; color: #e4c6df0b; font: 100px/1.1 'Segoe UI', Arial, sans-serif; font-weight: 300; letter-spacing: -8px; transition: opacity 150ms; user-select: none; }
#stageTitle { position: absolute; top: 76px; left: 32px; right: 25px; display: block; font-size: 39px; line-height: 1.15; font-weight: 350; letter-spacing: -1.3px; text-transform: none; color: #f0e5ed; white-space: nowrap; transition: top 650ms cubic-bezier(.22,1,.36,1), left 650ms, font-size 650ms cubic-bezier(.22,1,.36,1), letter-spacing 650ms; }
#stageInstruction { position: absolute; left: 32px; right: 65px; top: 139px; max-width: 510px; margin: 0; color: #bcaebc; font-size: 14px; line-height: 1.8; transition: opacity 140ms, translate 220ms; }
.stage-bottom { position: absolute; bottom: 29px; left: 32px; right: 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #bc9bb31c; padding-top: 21px; transition: opacity 120ms, translate 160ms; }
.stage-prompt { display: flex; align-items: center; gap: 12px; color: #dec9d9; font-size: 12px; }
.stage-prompt kbd { display: flex; align-items: center; gap: 11px; margin: 0; padding: 7px 10px; background: #d6b7d00a; border: 1px solid #bca1b13b; border-bottom-color: #d7b9ce61; box-shadow: 0 2px 0 #0005; font: 10px/1 Consolas, monospace; color: #e4cedc; border-radius: 5px; }
.stage-prompt svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.stage-next { min-width: 0; text-align: right; }
.stage-next span { display: block; color: #837185; font: 8px/1.3 Consolas, monospace; letter-spacing: 1.5px; margin-bottom: 5px; }
.stage-next strong { display: block; color: #ad9daf; font-size: 11px; font-weight: 400; }
.stage-time { position: absolute; right: 32px; top: 28px; display: flex; align-items: center; gap: 7px; color: #d7c1d2; transition: top 650ms, right 650ms, gap 650ms; }
.stage-time svg { width: 12px; height: 12px; fill: none; stroke: #a18ca2; stroke-width: 1.25; }
#stageTime { float: none; font: 11px/1.4 Consolas, monospace; color: inherit; font-variant-numeric: tabular-nums; transition: font-size 650ms; }
.stage-time small { font: 8px Consolas, monospace; letter-spacing: 1px; color: #827183; margin-left: 2px; transition: opacity 100ms; }
#stageDockInstruction { position: absolute; left: 24px; right: 112px; top: 48px; margin: 0; opacity: 0; color: #a391a4; font-size: 10px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; transition: opacity 180ms; }
#stageStatus { position: absolute; right: 25px; top: 30px; color: #8f7b90; font: 8px Consolas, monospace; text-transform: uppercase; letter-spacing: 1px; opacity: 0; }
.stage-elapsed { position: absolute; height: 1px; left: 0; right: 0; bottom: 0; background: #cab1c811; opacity: 0; transition: opacity 180ms; }
.stage-examples { position: absolute; top: 204px; left: 32px; right: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; transition: opacity 100ms; }
.cue-example { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border: 1px solid #bca3b322; border-radius: 6px; background: #ffffff02; text-align: left; }
.cue-example svg { width: 44px; height: 44px; flex: 0 0 44px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; }
.cue-example .cue-solid { fill: currentColor; stroke: none; }
.cue-example strong { display: block; color: #eee4ea; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.cue-example span { display: block; margin-top: 3px; font: 9px Consolas,monospace; color: #aa96a8; }
#stageHud[data-examples=true]:not(.docked) .stage-card { height: 402px; }
#stageHud[data-examples=true]:not(.docked) .stage-recap { top: calc(50% - 235px); }
#stageHud.docked .stage-examples { opacity: 1; top: 72px; left: 24px; right: 112px; display: flex; gap: 24px; }
#stageHud[data-examples=true].docked .stage-card { height: 115px; }
#stageHud.docked .cue-example { border: 0; background: none; padding: 0; gap: 8px; }
#stageHud.docked .cue-example svg { width: 22px; height: 22px; flex-basis: 22px; }
#stageHud.docked .cue-example strong { font-size: 11px; }
#stageHud.docked .cue-example span { display: none; }
#stageProgressFill { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: linear-gradient(90deg,#a790bf,#dbb7cd); transition: transform 100ms linear; }

/* The header settles before capture is released by the assessment clock. */
#stageHud.docked .stage-card { top: 58px; height: 81px; transform: translate(-50%,0); border-radius: 8px; background: #100c13db; box-shadow: 0 8px 35px #0003; }
#stageHud.docked .stage-scrim { opacity: 0; }
#stageHud.docked .stage-recap { opacity: 0; translate: 0 -8px; }
#stageHud.docked .stage-overline { top: 12px; left: 24px; font-size: 8px; }
#stageHud.docked #stageTitle { top: 27px; left: 24px; right: 130px; font-size: 16px; letter-spacing: -.2px; }
#stageHud.docked #stageNumber, #stageHud.docked .stage-card::before { opacity: 0; }
#stageHud.docked #stageInstruction, #stageHud.docked .stage-bottom { opacity: 0; translate: 0 -8px; }
#stageHud.docked .stage-time { top: 23px; right: 24px; gap: 0; }
#stageHud.docked .stage-time svg, #stageHud.docked .stage-time small { display: none; }
#stageHud.docked #stageTime { font-size: 21px; }
#stageHud.docked #stageDockInstruction { opacity: 1; transition-delay: 340ms; }
#stageHud.docked #stageStatus { top: 53px; opacity: 1; transition: opacity 200ms 380ms; font-size: 7px; }
#stageHud.docked .stage-elapsed { opacity: 1; transition-delay: 400ms; }
#stageHud.stage-reset .stage-card, #stageHud.stage-reset .stage-card * { transition: none !important; }
#arena { transition: filter 450ms ease, transform 650ms cubic-bezier(.22,1,.36,1); }
.stage-intro #arena { filter: blur(5px) saturate(.65); transform: scale(1.012); }
.stage-intro.stage-launching #arena { filter: none; transform: none; }
.range-shell .hud-top,.range-shell .hud-bottom,.range-shell .burst-hud,.range-shell .crosshair { transition: opacity 300ms; }
.stage-intro:not(.stage-launching) .hud-top,.stage-intro:not(.stage-launching) .hud-bottom,.stage-intro:not(.stage-launching) .burst-hud { opacity: .18; }
.stage-intro:not(.stage-launching) .crosshair { opacity: 0; }

@media(max-width:800px) {
  .stage-card { width: calc(100% - 40px); }
  .stage-overline { font-size: 8px; letter-spacing: 1px; gap: 8px; }
  .stage-time small { display: none; }
  #stageTitle { font-size: 34px; }
}
@media(max-height:650px) {
  .stage-card { height: 300px; }
  .stage-recap { top: calc(50% - 177px); }
  #stageTitle { top: 68px; font-size: 34px; }
  #stageInstruction { top: 120px; font-size: 13px; line-height: 1.7; }
  .stage-bottom { bottom: 24px; padding-top: 17px; }
}
@media(prefers-reduced-motion:reduce) {
  #stageHud *,#arena,.range-shell .hud-top,.range-shell .hud-bottom,.range-shell .burst-hud,.range-shell .crosshair { transition: none !important; animation: none !important; }
  .stage-intro #arena { transform: none; }
}
.range-shell { container-type: size; }
@container(max-height:480px) {
 #stageHud[data-examples=true]:not(.docked) .stage-card { height: 338px; }
 #stageHud[data-examples=true]:not(.docked) .stage-recap { top: calc(50% - 192px); }
 #stageHud[data-examples=true]:not(.docked) #stageTitle { top: 64px; font-size: 31px; }
 #stageHud[data-examples=true]:not(.docked) #stageInstruction { top: 111px; font-size: 12px; line-height: 1.65; }
 #stageHud[data-examples=true]:not(.docked) .stage-examples { top: 166px; }
 #stageHud[data-examples=true]:not(.docked) .cue-example { padding: 9px 12px; }
 #stageHud[data-examples=true]:not(.docked) .cue-example svg { width: 36px; height: 36px; flex-basis: 36px; }
 #stageHud[data-examples=true]:not(.docked) .stage-bottom { bottom: 22px; padding-top: 16px; }
}
