:root {
  color-scheme: dark;
  --bg: #010611;
  --panel: rgba(2, 13, 31, .94);
  --ink: #effcff;
  --muted: #9bc6d6;
  --cyan: #43dcff;
  --cyan-soft: rgba(67, 220, 255, .22);
  --violet: #8a6cff;
  --green: #62f2ae;
  --amber: #ffd21f;
  --danger: #ff6c68;
  --line: rgba(78, 224, 255, .88);
  --line-soft: rgba(78, 224, 255, .28);
  --radius: clamp(10px, 1.05cqw, 18px);
  --font: clamp(13px, 1.02cqw, 19px);
  --small: clamp(10px, .72cqw, 14px);
  --title: clamp(21px, 1.72cqw, 32px);
  --choice: clamp(16px, 1.28cqw, 24px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: radial-gradient(circle at 50% 10%, #0a1f3a 0, #010611 64%);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}
body { min-height: 100dvh; }
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.page-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 8px;
  overflow: auto;
}

.game-board {
  container-type: inline-size;
  position: relative;
  width: min(calc(100vw - 16px), calc((100dvh - 16px) * 16 / 9), 1800px);
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-rows: 7.5% 5.5% minmax(0, 1fr) 13.5%;
  gap: .75cqw;
  padding: .8cqw;
  overflow: hidden;
  border: 1px solid rgba(53, 203, 255, .46);
  background:
    linear-gradient(rgba(42, 151, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 151, 255, .045) 1px, transparent 1px),
    #010713;
  background-size: 1.35cqw 1.35cqw;
  box-shadow: 0 0 4cqw rgba(0, 112, 255, .22), inset 0 0 3cqw rgba(0, 95, 255, .12);
}

.eyebrow {
  margin: 0 0 .18cqw;
  color: #9cecff;
  font-size: var(--small);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.topbar {
  display: grid;
  grid-template-columns: 1.25fr .9fr 1.55fr auto;
  align-items: center;
  gap: 1cqw;
  min-width: 0;
  padding: .5cqw .75cqw;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(1, 10, 24, .91);
  box-shadow: inset 0 0 1.3cqw rgba(37, 135, 255, .11);
}

.brand-block, .mission-block { min-width: 0; }
.brand-block h1 {
  margin: 0;
  font-size: clamp(17px, 1.48cqw, 28px);
  line-height: 1;
}
.mission-block { display: grid; gap: .1cqw; }
.mission-block strong { color: var(--green); font-size: clamp(12px, .92cqw, 17px); letter-spacing: .06em; }
.mission-block span { color: var(--muted); font-size: var(--small); font-weight: 800; }

.critical-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45cqw;
}
.critical-metrics span {
  display: flex;
  justify-content: space-between;
  gap: .4cqw;
  padding: .4cqw .52cqw;
  border: 1px solid var(--line-soft);
  border-radius: .65cqw;
  background: rgba(2, 24, 48, .8);
  color: var(--muted);
  font-size: var(--small);
  font-weight: 800;
}
.critical-metrics b { color: var(--ink); }

.hud-button, .tiny-button, .danger-button, .back-button, .primary-button {
  border: 1px solid var(--line);
  border-radius: .75cqw;
  background: rgba(4, 33, 60, .92);
  padding: .55cqw .8cqw;
  font-size: var(--small);
  font-weight: 900;
  letter-spacing: .03em;
  cursor: pointer;
}
.hud-button:hover, .tiny-button:hover, .back-button:hover { background: rgba(8, 64, 96, .95); }
.danger-button { border-color: rgba(255,108,104,.65); color: #ffd3d2; background: rgba(70,16,26,.74); }

.role-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6cqw;
  min-height: 0;
}
.role-segment {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .5cqw;
  padding: .35cqw .55cqw;
  border: 1px solid rgba(85, 181, 217, .25);
  border-radius: .7cqw;
  background: rgba(1, 11, 27, .82);
  opacity: .58;
}
.role-segment.active { opacity: 1; border-color: var(--line); box-shadow: 0 0 .8cqw rgba(67,220,255,.25); }
.role-segment span { font-size: var(--small); font-weight: 900; white-space: nowrap; }
.role-segment i {
  display: block;
  height: .38cqw;
  min-height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(117,183,207,.2);
}
.role-segment em { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .3s ease; }

.scene {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #020b18;
  box-shadow: 0 0 1.2cqw rgba(50,219,255,.34), inset 0 0 2.6cqw rgba(0,0,0,.38);
}
.scene-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.98) contrast(1.03);
  transition: opacity .25s ease;
}
.scene-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(86,220,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86,220,255,.12) 1px, transparent 1px);
  background-size: 2cqw 2cqw;
  mix-blend-mode: screen;
}
.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, transparent 30%, rgba(0,5,14,.12) 64%, rgba(0,3,10,.72) 100%);
}

.character-stage {
  position: absolute;
  left: 3.3%;
  bottom: 3.5%;
  width: 27%;
  height: 79%;
  display: grid;
  place-items: end center;
  pointer-events: none;
  transition: left .25s ease, width .25s ease, opacity .2s ease;
}
.character-sprite {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 82%;
  max-height: 88%;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 1.5cqw rgba(91,225,255,.66));
}
.character-sprite[data-role="mantis"] { max-height: 91%; max-width: 78%; }
.character-sprite[data-role="grey"] { max-height: 72%; max-width: 72%; }
.character-sprite[data-role="oversoul"] { opacity: .22; }
.character-base {
  position: absolute;
  z-index: 1;
  bottom: 0;
  width: 72%;
  height: 5%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(72,228,255,.62), rgba(72,228,255,0) 72%);
  filter: blur(.2cqw);
}
.character-name {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 1.2%;
  transform: translateX(-50%);
  padding: .28cqw .6cqw;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(1,12,28,.86);
  color: #c9f8ff;
  font-size: var(--small);
  font-weight: 900;
  white-space: nowrap;
}

.holo-console {
  position: absolute;
  z-index: 5;
  top: 4.5%;
  right: 2.2%;
  width: 67%;
  height: 91%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: .6cqw;
  padding: .85cqw;
  overflow: hidden;
  border: max(1px,.13cqw) solid var(--cyan);
  border-radius: 1cqw;
  background:
    linear-gradient(rgba(67,220,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67,220,255,.045) 1px, transparent 1px),
    rgba(1, 13, 31, .91);
  background-size: 1.1cqw 1.1cqw;
  box-shadow: 0 0 1.2cqw rgba(67,220,255,.44), inset 0 0 1.8cqw rgba(38,126,255,.18);
  backdrop-filter: blur(3px);
  transition: border-color .2s, box-shadow .2s;
}
.console-mantis { border-color: #9e79ff; box-shadow: 0 0 1.25cqw rgba(154,110,255,.52), inset 0 0 1.8cqw rgba(92,51,190,.22); }
.console-grey { border-color: #59e5ff; width: 61%; right: 3%; top: 6%; height: 88%; }
.console-oversoul { border-color: #9fcfff; width: 70%; right: 4%; top: 7%; height: 86%; box-shadow: 0 0 1.5cqw rgba(197,232,255,.5), inset 0 0 2cqw rgba(75,113,210,.22); }

.console-header {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .8cqw;
  align-items: start;
}
.console-role {
  margin: 0 0 .22cqw;
  color: var(--green);
  font-size: var(--small);
  font-weight: 950;
  letter-spacing: .08em;
}
.console-header h2 {
  margin: 0;
  font-size: var(--title);
  line-height: 1.05;
}
.risk-badge, .match-badge {
  align-self: start;
  padding: .35cqw .58cqw;
  border: 1px solid rgba(98,242,174,.55);
  border-radius: 999px;
  background: rgba(5,56,47,.74);
  color: var(--green);
  font-size: var(--small);
  font-weight: 900;
  white-space: nowrap;
}
.risk-badge.medium { color: var(--amber); border-color: rgba(255,210,31,.6); background: rgba(69,52,3,.72); }
.risk-badge.high { color: #ffaaa7; border-color: rgba(255,108,104,.65); background: rgba(75,18,27,.75); }
.prompt-copy {
  margin: 0;
  color: #b2d6e3;
  font-size: var(--font);
  line-height: 1.25;
}
.interactive-area {
  min-height: 0;
  overflow: auto;
  padding-right: .18cqw;
  scrollbar-width: thin;
  scrollbar-color: rgba(67,220,255,.46) transparent;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65cqw;
}
.choice-button {
  min-width: 0;
  min-height: clamp(56px, 7.1cqw, 112px);
  display: grid;
  align-content: center;
  gap: .28cqw;
  padding: .78cqw;
  text-align: left;
  border: 1px solid rgba(67,220,255,.68);
  border-radius: .8cqw;
  background: linear-gradient(135deg, rgba(7,40,78,.95), rgba(3,18,44,.96));
  cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s;
}
.choice-button:hover, .choice-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(8,58,94,.98), rgba(3,26,55,.98));
  outline: none;
}
.choice-button strong { font-size: var(--choice); line-height: 1.05; }
.choice-button span { color: #a8d0dd; font-size: var(--small); line-height: 1.25; }
.choice-button small { color: var(--green); font-size: var(--small); font-weight: 900; }
.choice-button.warning { border-color: rgba(255,210,31,.58); }
.choice-button.danger { border-color: rgba(255,108,104,.58); }
.choice-button.selected { border-color: var(--green); box-shadow: inset 0 0 1cqw rgba(98,242,174,.15); }

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .55cqw;
  margin-bottom: .65cqw;
}
.metric-card {
  padding: .58cqw .65cqw;
  border: 1px solid var(--line-soft);
  border-radius: .7cqw;
  background: rgba(2,25,50,.82);
}
.metric-card span { display: block; color: var(--muted); font-size: var(--small); font-weight: 800; }
.metric-card b { display: block; margin-top: .12cqw; font-size: clamp(17px,1.35cqw,25px); }
.metric-card.good b { color: var(--green); }
.metric-card.warn b { color: var(--amber); }
.metric-card.bad b { color: var(--danger); }

.timeline-shell {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  gap: .55cqw;
  height: 100%;
  min-height: 0;
}
.timeline-readout {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(0,1fr));
  gap: .45cqw;
}
.timeline-readout div {
  min-width: 0;
  padding: .46cqw .55cqw;
  border: 1px solid var(--line-soft);
  border-radius: .58cqw;
  background: rgba(1,19,42,.9);
}
.timeline-readout span { display:block; color:var(--muted); font-size:var(--small); font-weight:800; }
.timeline-readout b { display:block; margin-top:.1cqw; font-size:clamp(13px,1.02cqw,18px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.timeline-canvas-wrap {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(154,110,255,.64);
  border-radius: .72cqw;
  overflow: hidden;
  background: rgba(2,9,24,.9);
}
#timelineCanvas { display:block; width:100%; height:100%; cursor: crosshair; touch-action:none; }
.timeline-hint {
  position:absolute;
  left:.55cqw;
  bottom:.45cqw;
  padding:.28cqw .45cqw;
  border-radius:.45cqw;
  background:rgba(1,7,19,.78);
  color:#c3e8f1;
  font-size:var(--small);
  pointer-events:none;
}
.timeline-actions { display:flex; gap:.55cqw; justify-content:flex-end; align-items:center; }
.timeline-actions strong { margin-right:auto; color:var(--green); font-size:var(--font); }
.primary-button {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(10,88,78,.95), rgba(4,44,53,.96));
  color:#eafff7;
}
.primary-button:disabled { opacity:.42; cursor:not-allowed; }

.coherence-picker { display:grid; gap:.65cqw; }
.coherence-intro { margin:0; color:#b7dae5; font-size:var(--font); }
.coherence-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65cqw; }
.coherence-choice {
  display:grid;
  grid-template-rows:auto auto auto;
  gap:.35cqw;
  padding:.68cqw;
  border:1px solid var(--line-soft);
  border-radius:.75cqw;
  background:rgba(2,23,50,.88);
  cursor:pointer;
}
.coherence-choice:hover { border-color:var(--green); }
.coherence-choice strong { font-size:var(--choice); }
.coherence-choice span { font-size:var(--small); color:var(--muted); }
.coherence-bar { height:.52cqw; min-height:5px; overflow:hidden; border-radius:999px; background:rgba(112,171,197,.2); }
.coherence-bar i { display:block; height:100%; background:linear-gradient(90deg,var(--cyan),var(--green)); }
.coherence-choice.overload .coherence-bar i { background:linear-gradient(90deg,var(--amber),var(--danger)); }
.coherence-choice small { font-size:var(--small); font-weight:900; color:var(--green); }
.coherence-choice.overload small { color:var(--danger); }

.memory-editor { display:grid; gap:.62cqw; }
.slider-block {
  display:grid;
  grid-template-columns: 1fr auto;
  gap:.35cqw .8cqw;
  align-items:center;
  padding:.55cqw .65cqw;
  border:1px solid var(--line-soft);
  border-radius:.7cqw;
  background:rgba(1,19,42,.88);
}
.slider-block label { color:#d9f8ff; font-size:var(--font); font-weight:850; }
.slider-block output { color:var(--green); font-size:var(--font); font-weight:950; }
.slider-block input { grid-column:1/-1; width:100%; accent-color:var(--cyan); }
.memory-capacity { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55cqw; }
.memory-segments { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5cqw; }
.segment-toggle {
  display:grid;
  gap:.2cqw;
  min-height:4.6cqw;
  padding:.55cqw;
  border:1px solid var(--line-soft);
  border-radius:.62cqw;
  background:rgba(3,22,48,.9);
  cursor:pointer;
}
.segment-toggle input { position:absolute; opacity:0; pointer-events:none; }
.segment-toggle strong { font-size:var(--font); }
.segment-toggle span { color:var(--muted); font-size:var(--small); }
.segment-toggle.selected { border-color:var(--green); background:rgba(5,55,55,.82); }
.segment-toggle.low-priority { border-style:dashed; }
.memory-summary {
  display:flex;
  align-items:center;
  gap:.8cqw;
  padding:.55cqw .65cqw;
  border:1px solid var(--line-soft);
  border-radius:.68cqw;
  background:rgba(1,19,42,.9);
}
.memory-summary strong { color:var(--green); }
.memory-summary .primary-button { margin-left:auto; }

.opening-editor { display:grid; gap:.7cqw; }
.opening-visual {
  position:relative;
  height:clamp(140px,17cqw,260px);
  border:1px solid rgba(159,207,255,.5);
  border-radius:.75cqw;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 68%, rgba(79,168,255,.16), transparent 34%),
    linear-gradient(180deg,rgba(4,12,35,.95),rgba(2,5,17,.98));
}
.opening-line { position:absolute; left:5%; right:5%; top:56%; height:2px; background:linear-gradient(90deg,#55ddff,#a78aff,#ffffff); }
.opening-marker {
  position:absolute;
  top:calc(56% - .65cqw);
  left:5%;
  width:1.3cqw;
  height:1.3cqw;
  min-width:12px;
  min-height:12px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 1cqw #78dbff;
  transform:translateX(-50%);
}
.opening-labels { position:absolute; left:5%; right:5%; top:64%; display:flex; justify-content:space-between; color:var(--muted); font-size:var(--small); }
.opening-head {
  position:absolute;
  left:50%;
  bottom:4%;
  width:14%;
  height:30%;
  transform:translateX(-50%);
  border:2px solid rgba(157,226,255,.68);
  border-radius:50% 50% 38% 38%;
  box-shadow:0 0 2cqw rgba(75,190,255,.45);
}
.opening-ring { position:absolute; left:50%; bottom:7%; width:34%; aspect-ratio:1; transform:translateX(-50%); border:1px solid rgba(159,207,255,.18); border-radius:50%; }
.opening-ring.r2 { width:48%; bottom:0; }

.result-dashboard { display:grid; gap:.7cqw; }
.result-hero { display:grid; grid-template-columns:auto 1fr; gap:.8cqw; align-items:center; }
.result-grade {
  display:grid;
  place-items:center;
  width:5.2cqw;
  height:5.2cqw;
  min-width:58px;
  min-height:58px;
  border:2px solid var(--green);
  border-radius:50%;
  color:var(--green);
  font-size:clamp(26px,2.8cqw,48px);
  font-weight:950;
  box-shadow:0 0 1cqw rgba(98,242,174,.32);
}
.result-hero h3 { margin:0 0 .25cqw; font-size:var(--title); }
.result-hero p { margin:0; color:#b6dbe6; font-size:var(--font); line-height:1.28; }
.result-bars { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.55cqw; }
.result-actions { display:flex; justify-content:flex-end; gap:.6cqw; }

.effect-toast {
  position:absolute;
  z-index:20;
  left:50%;
  bottom:2.4%;
  max-width:62%;
  transform:translate(-50%, 1cqw);
  padding:.58cqw .85cqw;
  border:1px solid var(--green);
  border-radius:.7cqw;
  background:rgba(1,21,31,.95);
  color:#eafff5;
  font-size:var(--font);
  font-weight:800;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s, transform .18s;
  box-shadow:0 0 1.2cqw rgba(98,242,174,.25);
}
.effect-toast.visible { opacity:1; transform:translate(-50%,0); }
.effect-toast.bad { border-color:var(--danger); box-shadow:0 0 1.2cqw rgba(255,108,104,.2); }
.back-button { position:absolute; z-index:12; left:1.2%; bottom:1.4%; }
.back-button:disabled { opacity:.28; cursor:not-allowed; }

.bottom-strip {
  display:grid;
  grid-template-columns:1.35fr 1.65fr 1.05fr 1.3fr;
  gap:.6cqw;
  min-height:0;
}
.bottom-strip > div {
  min-width:0;
  display:grid;
  align-content:center;
  padding:.55cqw .65cqw;
  border:1px solid var(--line-soft);
  border-radius:.72cqw;
  background:rgba(1,12,29,.9);
}
.bottom-strip strong { display:block; font-size:clamp(13px,1.02cqw,18px); line-height:1.12; }
.bottom-strip span { display:block; margin-top:.18cqw; color:var(--muted); font-size:var(--small); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.candidate-mini { grid-template-columns:auto 1fr; gap:.55cqw; align-items:center; }
.candidate-orb { width:2.4cqw; height:2.4cqw; min-width:25px; min-height:25px; border:1px solid var(--cyan); border-radius:50%; background:radial-gradient(circle,#9be7ff,#2779af 62%,#07152c 64%); box-shadow:0 0 .8cqw rgba(67,220,255,.55); }
.campaign-mini b { color:var(--green); }

.analysis-drawer {
  position:absolute;
  z-index:50;
  top:0;
  right:0;
  width:min(53cqw,760px);
  height:100%;
  display:grid;
  grid-template-rows:auto 1fr;
  transform:translateX(103%);
  transition:transform .24s ease;
  border-left:1px solid var(--line);
  background:rgba(1,7,18,.985);
  box-shadow:-1cqw 0 3cqw rgba(0,0,0,.55);
}
.analysis-drawer.open { transform:translateX(0); }
.drawer-header { display:flex; align-items:center; justify-content:space-between; gap:1cqw; padding:1cqw; border-bottom:1px solid var(--line-soft); }
.drawer-header h2 { margin:0; font-size:var(--title); }
.drawer-actions { display:flex; gap:.5cqw; }
.drawer-scroll { min-height:0; overflow:auto; padding:1cqw; display:grid; align-content:start; gap:.8cqw; }
.drawer-card { padding:.8cqw; border:1px solid var(--line-soft); border-radius:.8cqw; background:rgba(3,18,39,.88); }
.drawer-card h3 { margin:0 0 .65cqw; font-size:clamp(16px,1.22cqw,23px); }
.drawer-title-row { display:flex; justify-content:space-between; gap:.6cqw; align-items:center; }
.profile-list, .contract-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5cqw; margin:0; }
.profile-list div, .contract-list div { padding:.48cqw .55cqw; border:1px solid rgba(78,224,255,.2); border-radius:.55cqw; background:rgba(1,12,29,.72); }
.profile-list .wide { grid-column:1/-1; }
dt { color:var(--muted); font-size:var(--small); font-weight:800; text-transform:uppercase; }
dd { margin:.12cqw 0 0; font-size:var(--font); font-weight:850; line-height:1.2; }
.drawer-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5cqw; }
.drawer-stat { padding:.48cqw .55cqw; border:1px solid rgba(78,224,255,.2); border-radius:.55cqw; background:rgba(1,12,29,.72); }
.drawer-stat span { display:block; color:var(--muted); font-size:var(--small); }
.drawer-stat b { display:block; margin-top:.1cqw; font-size:var(--font); }
.coherence-profile { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5cqw; }
.coherence-profile > div { padding:.55cqw; border:1px solid rgba(78,224,255,.2); border-radius:.55cqw; background:rgba(1,12,29,.72); }
.coherence-profile strong, .coherence-profile span { display:block; }
.coherence-profile span { color:var(--muted); font-size:var(--small); margin-top:.15cqw; }
.campaign-roster { display:grid; gap:.42cqw; }
.roster-row { display:grid; grid-template-columns:1.2fr .7fr .7fr .7fr; gap:.45cqw; align-items:center; padding:.45cqw .5cqw; border:1px solid rgba(78,224,255,.18); border-radius:.5cqw; background:rgba(1,12,29,.68); font-size:var(--small); }
.roster-row.current { border-color:var(--green); }
.roster-row.complete { background:rgba(6,50,47,.65); }
.roster-row b { color:var(--ink); }
.roster-row span { color:var(--muted); }
.decision-log { margin:0; padding-left:1.35em; display:grid; gap:.38cqw; color:#c7e8f0; font-size:var(--small); }
.drawer-shade { position:absolute; z-index:45; inset:0; background:rgba(0,0,0,.58); opacity:0; pointer-events:none; transition:opacity .2s; }
.drawer-shade.visible { opacity:1; pointer-events:auto; }

@container (max-width: 760px) {
  .topbar { grid-template-columns:1fr auto; }
  .brand-block, .critical-metrics { display:none; }
  .mission-block { grid-column:1; }
  .hud-button { grid-column:2; }
  .role-progress { grid-template-columns:repeat(4,1fr); }
  .role-segment { grid-template-columns:1fr; }
  .role-segment i { display:none; }
  .character-stage { opacity:.7; width:23%; }
  .holo-console, .console-grey, .console-oversoul { width:74%; right:1.5%; }
  .choice-grid { grid-template-columns:1fr; }
  .choice-button { min-height:48px; }
  .timeline-readout { grid-template-columns:repeat(2,1fr); }
  .timeline-readout div:first-child { grid-column:1/-1; }
  .coherence-grid, .memory-segments { grid-template-columns:1fr; }
  .bottom-strip { grid-template-columns:1fr 1fr; }
  .campaign-mini, .decision-summary { display:none !important; }
  .analysis-drawer { width:86cqw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}

