/* BREACHPOINT — interface styling.
   The HUD is DOM rather than canvas so type stays crisp at any resolution. */

:root {
  --ink:        #05070a;
  --ink-2:      #0a0e13;
  --panel:      rgba(10, 14, 19, 0.94);
  --panel-solid:#0b0f14;
  --line:       rgba(150, 186, 210, 0.16);
  --line-hot:   rgba(120, 200, 255, 0.42);
  --text:       #ccd7e0;
  --text-hi:    #f2f7fb;
  --dim:        #6f7d8a;
  --dimmer:     #4b565f;

  --accent:     #4db2ff;
  --accent-dk:  #1c6fb0;
  --accent-gl:  rgba(77, 178, 255, 0.5);
  --amber:      #ffb13d;
  --danger:     #ff4a4a;
  --danger-gl:  rgba(255, 74, 74, 0.45);
  --good:       #63dd8a;

  --fs-ui: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --fs-display: 'Archivo', 'Barlow Condensed', sans-serif;
  --fs-alt: 'Oswald', 'Barlow Condensed', sans-serif;
  --fs-mono: 'Share Tech Mono', ui-monospace, monospace;

  --clip-tr: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  --clip-both: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--fs-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  cursor: default;
}

#app { position: fixed; inset: 0; }

#view {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: crosshair;
}

.hidden { display: none !important; }

/* ============================== overlays ============================== */
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 78% 74% at 50% 46%, transparent 42%, rgba(0,0,0,0.30) 74%, rgba(0,0,0,0.68) 100%);
  mix-blend-mode: multiply;
  z-index: 2;
}

.scanlines {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(
    to bottom, rgba(255,255,255,0.016) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}

/* ---------------------- directional damage indicators ---------------------- */
#dmg-dirs { position: absolute; inset: 0; pointer-events: none; z-index: 24; }
.dmg-dir {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  transform-origin: 0 0;
}
.dmg-dir::before {
  content: ''; position: absolute;
  left: -150px; top: -300px; width: 300px; height: 300px;
  background: conic-gradient(from 135deg,
    transparent 0deg, rgba(255,60,50,0.55) 35deg, rgba(255,60,50,0.85) 45deg,
    rgba(255,60,50,0.55) 55deg, transparent 90deg);
  -webkit-mask-image: radial-gradient(circle at 50% 100%, transparent 46%, #000 74%, transparent 100%);
  mask-image: radial-gradient(circle at 50% 100%, transparent 46%, #000 74%, transparent 100%);
  animation: dmgDir 0.85s ease-out forwards;
}
@keyframes dmgDir { 0% { opacity: 0 } 12% { opacity: 1 } 100% { opacity: 0 } }

/* ------------------------- off-screen edge markers ------------------------- */
#edge-markers { position: absolute; inset: 0; pointer-events: none; z-index: 22; }
.edge-mark {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  display: grid; place-items: center;
  transition: opacity 0.2s;
}
.edge-mark i {
  display: block; width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-bottom: 12px solid currentColor;
  filter: drop-shadow(0 0 6px currentColor);
}
/* Plated like every other HUD element, and counter-rotated so it stays upright
   whatever direction the pointer faces. */
.edge-mark span {
  position: absolute; left: 50%; top: 22px;
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 8px;
  background: rgba(7,11,16,0.88);
  border: 1px solid color-mix(in srgb, currentColor 34%, transparent);
  border-left: 2px solid currentColor;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%);
  font-family: var(--fs-ui); font-size: 10px; font-weight: 600;
  color: currentColor; letter-spacing: 0.16em; white-space: nowrap;
}
.edge-mark span b {
  font-family: var(--fs-mono); font-weight: 400; font-size: 10px;
  letter-spacing: 0; color: var(--dim);
}
.edge-mark.exfil { color: #4dff9b; }
.edge-mark.objective { color: #ff6a3a; }
.edge-mark.threat { color: var(--danger); }
.edge-mark.civ { color: var(--amber); }

#dmg-flash, #bang-flash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 40;
}
#dmg-flash {
  background: radial-gradient(ellipse at center, transparent 35%, rgba(180,10,10,0.62) 100%);
  transition: opacity 0.42s ease-out;
}
#bang-flash { background: #fff; transition: opacity 1.6s cubic-bezier(.1,.7,.3,1); }

#pause-overlay {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 13vh;
}
/* The desaturation layer is a child so it cannot dim the label above it. */
#pause-overlay::before {
  content: ''; position: absolute; inset: 0;
  /* Dim the periphery, not the plan — you pause in order to read the room. */
  background: radial-gradient(ellipse 52% 52% at 50% 50%,
    rgba(4,8,14,0.0) 0%, rgba(4,8,14,0.22) 48%, rgba(4,8,14,0.72) 100%);
  backdrop-filter: saturate(0.42) contrast(1.06);
}
/* Corner brackets make the frozen state unmistakable at a glance. */
@keyframes pauseBreath { 0%,100% { opacity: 0.78 } 50% { opacity: 1 } }
#pause-overlay::after {
  content: ''; position: absolute; inset: 22px; pointer-events: none;
  border: 1px solid rgba(120,190,235,0.5);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.45), inset 0 0 150px rgba(6,14,22,0.6);
}
/* Paused is when you read the HUD, so lift it rather than dimming it. */
#hud.paused .op-card,
#hud.paused #minimap,
#hud.paused #objective-panel { background: rgba(9,13,18,0.95); }
#hud.paused .op-name,
#hud.paused .obj-title { color: #fff; }
#hud.paused .minimap-canvas { filter: saturate(1.15) brightness(1.15); }
#pause-overlay.on { display: flex; animation: fadeIn 0.16s ease-out; }
#pause-overlay span {
  position: relative;
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--fs-display); font-weight: 800; font-size: 24px;
  letter-spacing: 0.38em; color: #ffffff;
  animation: pauseBreath 1.9s ease-in-out infinite;
  padding: 11px 26px 11px 22px; border: 1px solid var(--line-hot);
  background: rgba(6,10,15,0.88); clip-path: var(--clip-both);
  box-shadow: 0 0 40px rgba(77,178,255,0.16);
}
#pause-overlay span::before {
  content: ''; width: 11px; height: 14px;
  border-left: 3px solid var(--accent); border-right: 3px solid var(--accent);
  animation: pulseSoft 1.6s ease-in-out infinite;
}
#pause-overlay span::after {
  content: 'ORDERS STILL APPLY';
  position: absolute; left: 0; right: 0; bottom: -20px;
  font-family: var(--fs-ui); font-size: 10px; font-weight: 500;
  letter-spacing: 0.32em; color: var(--dim); text-align: center;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes pulseSoft { 0%,100% { opacity: 0.6 } 50% { opacity: 1 } }

/* ============================== HUD shell ============================== */
#hud {
  position: absolute; inset: 0; z-index: 10; pointer-events: none;
  font-size: 14px;
  zoom: var(--ui-scale, 1);
}
#hud button, #hud .clickable { pointer-events: auto; }

/* ------------------------------ top bar ------------------------------ */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 62px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(5,8,12,0.90) 0%, rgba(5,8,12,0.55) 62%, transparent 100%);
}

.tb-left { justify-self: start; }
.tb-right { justify-self: end; display: flex; gap: 22px; align-items: center; }

.mission-chip {
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 14px 6px 12px;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, rgba(77,178,255,0.13), transparent 85%);
}
.mc-label { font-size: 10px; letter-spacing: 0.24em; color: var(--dim); font-weight: 500; }
.mc-name {
  font-family: var(--fs-alt); font-weight: 600; font-size: 19px;
  letter-spacing: 0.10em; color: var(--text-hi); line-height: 1;
}

#objective-panel {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 20px; min-width: 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: none;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
  box-shadow: 0 6px 26px rgba(0,0,0,0.55);
}
.obj-icon {
  width: 20px; height: 20px; flex: 0 0 20px;
  border: 2px solid var(--amber); border-radius: 50%;
  position: relative;
}
.obj-icon::after {
  content: ''; position: absolute; inset: 4px;
  background: var(--amber); border-radius: 50%;
  animation: pulseSoft 1.8s ease-in-out infinite;
}
.obj-icon.done { border-color: var(--good); }
.obj-icon.done::after { background: var(--good); animation: none; }
.obj-title {
  font-size: 14px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--text-hi); line-height: 1.15;
}
.obj-sub { font-size: 11px; letter-spacing: 0.16em; color: var(--dim); font-weight: 500; }

.stat-block { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.sb-label { font-size: 9.5px; letter-spacing: 0.26em; color: var(--dimmer); font-weight: 500; }
.sb-value {
  font-family: var(--fs-mono); font-size: 19px; color: var(--text-hi);
  letter-spacing: 0.04em; line-height: 1.05;
}
#threat-block .sb-value.low { color: var(--good); }
#threat-block .sb-value.med { color: var(--amber); }
#threat-block .sb-value.high { color: var(--danger); text-shadow: 0 0 12px var(--danger-gl); }

/* ------------------------------ squad ------------------------------ */
#squad {
  position: absolute; left: 14px; bottom: 96px;
  display: flex; flex-direction: column; gap: 7px;
  width: 232px;
}

.op-card {
  position: relative;
  display: grid; grid-template-columns: 40px 1fr; gap: 9px;
  padding: 7px 10px 7px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--dimmer);
  clip-path: var(--clip-tr);
  transition: border-color 0.14s, background 0.14s, transform 0.14s;
  pointer-events: auto; cursor: pointer;
  box-shadow: 0 3px 14px rgba(0,0,0,0.5);
}
.op-card:hover { background: rgba(18,26,34,0.9); }
.op-card { border-left-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.op-card.sel { border-left-color: var(--acc); background: rgba(16,26,36,0.94); transform: translateX(4px); }
.op-card.sel::before {
  content: ''; position: absolute; left: -3px; top: 0; bottom: 0; width: 4px;
  background: var(--acc); box-shadow: 0 0 14px var(--acc);
}
.op-card.down { opacity: 0.42; border-left-color: var(--danger); }
.op-card.down .op-name { text-decoration: line-through; color: var(--dim); }
.op-card.hurt { animation: cardHit 0.4s ease-out; }
/* Under fire: stays up while rounds are coming at him, unlike .hurt, which is
   a one-shot flash on losing health. This is the readout that says which of
   the four men is being shot at. */
.op-card.fire { border-color: var(--danger); animation: cardFire 0.7s ease-in-out infinite; }
.op-card.fire .op-name { color: var(--danger); }
@keyframes cardFire {
  0%, 100% { box-shadow: 0 3px 14px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 3px 14px rgba(0,0,0,0.5), 0 0 16px var(--danger-gl); }
}
@keyframes cardHit {
  0% { background: rgba(120,20,20,0.85); } 100% { background: var(--panel); }
}

.op-portrait {
  width: 40px; height: 40px; position: relative;
  background: linear-gradient(160deg, #1a232c, #0c1116);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
}
.op-portrait { border-color: color-mix(in srgb, var(--acc) 40%, var(--line)); color: var(--acc); }
.op-portrait svg { width: 32px; height: 32px; opacity: 0.95; }
.op-portrait .op-num {
  position: absolute; right: 2px; bottom: 0px;
  font-family: var(--fs-mono); font-size: 11px; color: var(--acc);
  line-height: 1; text-shadow: 0 0 6px var(--acc);
}
.op-card.down .op-portrait { filter: grayscale(1) brightness(0.6); }

.op-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.op-row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.op-name {
  font-size: 14px; font-weight: 600; letter-spacing: 0.10em; color: var(--text-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.op-role { font-size: 9.5px; letter-spacing: 0.2em; color: var(--dim); font-weight: 500; }
/* Posture. SET is the man who shoots first — a third of his base reaction
   inside the arc he is covering — and it is worth as much as anything else on
   this card. SETTING is the same order given and not yet arrived at, so it is
   dimmer: it is a promise, not a state. */
.op-posture {
  font-size: 9px; letter-spacing: 0.18em; font-weight: 700; color: var(--dimmer);
  margin-left: auto; white-space: nowrap;
}
.op-card.set .op-posture { color: var(--acc); text-shadow: 0 0 7px var(--acc); }

.bar { height: 4px; background: rgba(255,255,255,0.07); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; display: block; transition: width 0.18s ease-out; }
.bar.hp i { background: linear-gradient(90deg, #3ec46f, #63dd8a); }
.bar.hp.mid i { background: linear-gradient(90deg, #d8a13a, #ffc563); }
.bar.hp.low i { background: linear-gradient(90deg, #c93636, #ff5c5c); }
.bar.ar { height: 3px; }
.bar.ar i { background: linear-gradient(90deg, #2f6f9e, #63a9dd); }

.op-row3 {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--fs-mono); font-size: 11px; color: var(--dim); letter-spacing: 0.02em;
}
.op-wpn { color: var(--text); letter-spacing: 0.06em; font-family: var(--fs-ui); font-size: 12px; font-weight: 500; }
.op-ammo b { color: var(--text-hi); font-weight: 400; }
.op-ammo.low b { color: var(--amber); }
.op-ammo.empty b { color: var(--danger); }
.op-state {
  font-size: 9.5px; letter-spacing: 0.18em; color: var(--amber);
  font-family: var(--fs-ui); font-weight: 600;
}
.op-nades { display: flex; gap: 3px; }
.op-nades i {
  width: 5px; height: 8px; background: var(--dimmer); display: block;
  clip-path: polygon(50% 0, 100% 30%, 100% 100%, 0 100%, 0 30%);
}
.op-nades i.flash { background: #cfe2ff; }
.op-nades i.he { background: #8fbf6a; }
.op-nades i.smoke { background: #b9c2cb; }

/* ------------------------------ command bar ------------------------------ */
#cmdbar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 16px;
  display: flex; align-items: stretch; gap: 8px;
  padding: 7px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--clip-both);
  box-shadow: 0 8px 34px rgba(0,0,0,0.65);
}
.cmd-group { display: flex; gap: 6px; }
.cmd-sep { width: 1px; background: var(--line); margin: 4px 2px; }

.cmd-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 66px; height: 54px;
  background: rgba(255,255,255,0.028);
  border: 1px solid transparent;
  color: var(--text); font-family: var(--fs-ui);
  cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cmd-btn:hover { background: rgba(77,178,255,0.13); border-color: var(--line-hot); color: var(--text-hi); }
.cmd-btn.active { background: rgba(77,178,255,0.22); border-color: var(--accent); color: #fff; }
.cmd-btn.disabled {
  pointer-events: none;
  color: rgba(190,205,218,0.42);
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.035) 0 4px, transparent 4px 9px),
    rgba(255,255,255,0.015);
}
.cmd-btn.disabled svg { opacity: 0.45; }
.cmd-btn.disabled .cmd-label { color: rgba(190,205,218,0.42); }
.cmd-btn.disabled .cmd-count { color: rgba(255,177,61,0.45); text-decoration: line-through; }
.cmd-btn svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.cmd-label { font-size: 10px; letter-spacing: 0.13em; font-weight: 600; }
.cmd-key {
  position: absolute; top: 3px; right: 5px;
  font-family: var(--fs-mono); font-size: 11px; color: var(--dim);
  opacity: 0.9;
}
.cmd-btn.active .cmd-key, .cmd-btn:hover .cmd-key { color: var(--accent); }
.cmd-count {
  position: absolute; bottom: 2px; right: 6px;
  font-family: var(--fs-mono); font-size: 12px; color: var(--amber);
  text-shadow: 0 0 8px rgba(255,177,61,0.4);
}

/* ------------------------------ time control ------------------------------ */
#timectl {
  position: absolute; right: 16px; bottom: 16px;
  display: flex; gap: 4px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line);
  clip-path: var(--clip-both);
}
.tc-btn {
  width: 38px; height: 34px; background: rgba(255,255,255,0.03);
  border: 1px solid transparent; color: var(--dim);
  font-family: var(--fs-mono); font-size: 13px; cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.12s;
}
.tc-btn:hover { color: var(--text-hi); background: rgba(77,178,255,0.12); }
.tc-btn.active { color: var(--accent); border-color: var(--line-hot); background: rgba(77,178,255,0.16); }
.ico-pause { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }

/* ------------------------------ killfeed ------------------------------ */
#killfeed {
  position: absolute; right: 16px; top: 74px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  width: 340px;
}
.kf-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px;
  background: rgba(7,11,16,0.94);
  border: 1px solid var(--line);
  border-right: 3px solid var(--dimmer);
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%);
  font-size: 15px; letter-spacing: 0.08em;
  animation: kfIn 0.22s cubic-bezier(.2,.8,.3,1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
@keyframes kfIn { from { opacity: 0; transform: translateX(26px) } to { opacity: 1; transform: none } }
.kf-row.out { opacity: 0; transform: translateX(20px); transition: all 0.35s ease-in; }
.kf-a { color: var(--text-hi); font-weight: 600; }
.kf-b { color: var(--danger); font-weight: 600; }
.kf-arrow { color: var(--dimmer); font-size: 13px; }
.kf-w {
  color: var(--text); font-family: var(--fs-mono); font-size: 12px; letter-spacing: 0;
  padding: 1px 6px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
}
.kf-row.hs { border-right-color: var(--amber); }
.kf-hs {
  color: #0a0e13; background: var(--amber); font-size: 10px;
  letter-spacing: 0.16em; font-weight: 700; padding: 2px 6px;
}
.kf-row.friendly { border-right-color: var(--danger); }

/* ------------------------------ alerts ------------------------------ */
#alerts {
  position: absolute; left: 50%; top: 76%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 640px; text-align: center;
}
.alert {
  font-family: var(--fs-display); font-weight: 800;
  font-size: 27px; letter-spacing: 0.20em; color: var(--text-hi);
  text-shadow: 0 3px 22px rgba(0,0,0,0.9);
  animation: alertIn 0.34s cubic-bezier(.15,.9,.25,1);
}
.alert.sub {
  font-family: var(--fs-ui); font-weight: 500; font-size: 14px;
  letter-spacing: 0.3em; color: var(--dim);
}
.alert.danger { color: var(--danger); text-shadow: 0 0 30px var(--danger-gl); }
.alert.good { color: var(--good); }
.alert.amber { color: var(--amber); }
.alert.out { opacity: 0; transform: translateY(-8px); transition: all 0.45s ease-in; }
@keyframes alertIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); letter-spacing: 0.4em }
  to   { opacity: 1; transform: none }
}

#tip {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 98px;
  font-size: 12.5px; letter-spacing: 0.18em; color: var(--dim);
  padding: 5px 16px; background: rgba(5,9,14,0.7);
  border: 1px solid var(--line); opacity: 0;
  transition: opacity 0.3s;
}
#tip.on { opacity: 1; }
#tip b { color: var(--accent); font-weight: 600; }

/* --------------------------- guided opening --------------------------- */
/* Right-hand column, below the killfeed's usual reach and clear of the squad
   roster on the left. Hidden until a step is rendered so a build that never
   starts one shows nothing. */
#tutorial {
  position: absolute; right: 16px; bottom: 96px; width: 306px;
  padding: 12px 16px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  clip-path: var(--clip-tr);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
  display: none;
}
#tutorial.on { display: block; opacity: 1; transform: none; }
.tut-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 7px;
}
#tut-step {
  font-family: var(--fs-mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--dimmer);
}
#tut-title {
  font-family: var(--fs-display); font-size: 14px; font-weight: 700;
  letter-spacing: 0.2em; color: var(--text-hi);
}
#tut-body {
  font-size: 13px; line-height: 1.55; color: var(--dim); letter-spacing: 0.02em;
}
#tut-body b { color: var(--accent); font-weight: 600; }
#tut-body i {
  display: inline-block; margin-top: 6px;
  font-style: normal; color: var(--text); letter-spacing: 0.06em;
}
#tut-skip {
  margin-top: 10px; padding: 3px 12px;
  font-family: var(--fs-ui); font-size: 10px; font-weight: 600;
  letter-spacing: 0.24em; color: var(--dimmer);
  background: transparent; border: 1px solid var(--line);
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
#tut-skip:hover { color: var(--text); border-color: var(--line-hot); }
/* Twenty seconds on one prompt: stop being decoration. */
#tutorial.stuck #tut-skip { color: var(--amber); border-color: var(--amber); }

/* ============================== screens ============================== */
.screen {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
}

/* ------------------------------ main menu ------------------------------ */
#menu { background: transparent; }
.menu-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(100deg,
      rgba(3,5,9,0.94) 0%, rgba(3,5,9,0.90) 26%,
      rgba(3,5,9,0.62) 44%, rgba(3,5,9,0.30) 64%, rgba(3,5,9,0.42) 100%),
    linear-gradient(180deg, rgba(3,5,9,0.55), transparent 22%, transparent 74%, rgba(2,4,7,0.75));
  backdrop-filter: blur(1.5px) saturate(1.05);
}
.menu-bg::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px);
}
.menu-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start;
  margin-left: min(11vw, 170px); margin-right: auto;
  animation: menuIn 0.6s cubic-bezier(.16,.9,.28,1);
}
/* Transform only, deliberately. Animation clocks are frame-driven, so a screen
   that fades in from transparent is unreadable until the clock catches up —
   which on a slow first frame is long enough to matter. */
@keyframes menuIn { from { transform: translateY(14px) } to { transform: none } }

.brand { margin-bottom: 42px; }
.brand-mark { width: 52px; height: 52px; color: var(--accent); margin-bottom: 16px; opacity: 0.95; }
.brand-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 14px var(--accent-gl)); }
.brand-title {
  font-family: var(--fs-display); font-weight: 900;
  font-size: clamp(52px, 8.2vw, 108px); line-height: 0.86;
  letter-spacing: -0.018em; color: var(--text-hi);
  text-shadow: 0 8px 46px rgba(0,0,0,0.8);
}
.brand-title span { color: var(--accent); text-shadow: 0 0 40px var(--accent-gl); }
.brand-sub {
  margin-top: 14px; font-size: 13px; letter-spacing: 0.44em;
  color: var(--dim); font-weight: 500;
  padding-left: 3px;
}

.menu-nav { display: flex; flex-direction: column; gap: 3px; }
.mbtn {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 340px; padding: 12px 30px 12px 20px;
  background: rgba(255,255,255,0.022);
  border: 1px solid transparent; border-left: 2px solid rgba(255,255,255,0.10);
  color: var(--text); cursor: pointer;
  font-family: var(--fs-ui); font-size: 18px; font-weight: 600; letter-spacing: 0.24em;
  transition: all 0.15s cubic-bezier(.2,.8,.3,1);
  text-align: left;
}
.mbtn em {
  font-style: normal; font-size: 10px; letter-spacing: 0.22em;
  color: var(--dimmer); font-weight: 500;
}
.mbtn:hover, .mbtn:focus-visible {
  background: rgba(77,178,255,0.12); border-left-color: var(--accent);
  color: var(--text-hi); padding-left: 28px; outline: none;
}
.mbtn:hover em { color: var(--accent); }
/* The selected item has to be unmistakable, not 6% brighter than its neighbour. */
.mbtn.primary {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(77,178,255,0.26), rgba(77,178,255,0.05) 70%, transparent);
  color: var(--text-hi);
  box-shadow: inset 0 0 44px rgba(77,178,255,0.10), -6px 0 26px rgba(77,178,255,0.18);
}
.mbtn.primary em { color: var(--accent); }
.mbtn.primary::after {
  content: ''; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge { 0%,100% { right: 16px; opacity: 0.6 } 50% { right: 11px; opacity: 1 } }
.mbtn.primary:hover { box-shadow: inset 0 0 54px rgba(77,178,255,0.18), -6px 0 30px rgba(77,178,255,0.28); }
.mbtn.ghost { color: var(--dim); }
.mb-key { font-family: var(--fs-mono); font-size: 12px; color: var(--dimmer); letter-spacing: 0; }
.mbtn:hover .mb-key { color: var(--accent); }

.task-force {
  margin-top: 36px; padding-top: 18px;
  border-top: 1px solid var(--line);
  max-width: 460px;
}
.tf-label {
  font-size: 10px; letter-spacing: 0.42em; color: var(--dimmer);
  font-weight: 600; margin-bottom: 12px;
}
.tf-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.tf-list span {
  display: flex; align-items: baseline; gap: 9px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.16em; color: var(--text-hi);
}
.tf-list i { width: 3px; height: 13px; display: block; align-self: center; }
.tf-list em {
  font-style: normal; font-size: 10px; letter-spacing: 0.18em;
  color: var(--dim); font-weight: 500; margin-left: auto;
}

.menu-foot {
  margin-top: 48px; display: flex; gap: 10px; align-items: center;
  font-size: 11.5px; letter-spacing: 0.2em; color: var(--dimmer);
}
.menu-foot .dot { opacity: 0.5; }

/* ------------------------------ options ------------------------------ */
#options { background: linear-gradient(140deg, #070b10, #04070a 62%); }
.opt-inner { width: min(1080px, 92vw); animation: menuIn 0.4s cubic-bezier(.16,.9,.28,1); }
.opt-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 46px; align-items: start; }
.opt-col { display: flex; flex-direction: column; gap: 26px; }
.opt-grid section { display: flex; flex-direction: column; gap: 4px; }
.key-list { display: flex; flex-direction: column; gap: 1px; }
.key-list div {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: baseline;
  padding: 7px 12px; background: rgba(255,255,255,0.022);
}
.key-list b {
  font-family: var(--fs-mono); font-weight: 400; font-size: 12px;
  color: var(--accent); letter-spacing: 0;
}
.key-list span { font-size: 10.5px; letter-spacing: 0.16em; color: var(--dim); font-weight: 500; }
.opt-row {
  display: grid; grid-template-columns: 1fr 150px 56px; gap: 14px; align-items: center;
  padding: 11px 14px; background: rgba(255,255,255,0.026);
  border: 1px solid transparent; border-left: 2px solid var(--dimmer);
  transition: border-color 0.14s, background 0.14s;
}
.opt-row:hover { background: rgba(77,178,255,0.08); border-left-color: var(--accent); }
.opt-row span { font-size: 11.5px; letter-spacing: 0.2em; color: var(--text); font-weight: 600; }
.opt-row i {
  font-family: var(--fs-mono); font-style: normal; font-size: 13px;
  color: var(--accent); text-align: right;
}
.opt-row input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; background: rgba(255,255,255,0.12); outline: none;
}
.opt-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 16px; background: var(--accent); cursor: pointer;
  box-shadow: 0 0 10px var(--accent-gl);
  clip-path: polygon(50% 0, 100% 28%, 100% 100%, 0 100%, 0 28%);
}
.opt-foot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.opt-foot .mbtn { min-width: 220px; align-items: center; justify-content: center; font-size: 14px; }

/* --------------------------- mission select --------------------------- */
#missions { background: linear-gradient(140deg, #070b10, #04070a 62%); }
.ms-inner { width: min(1280px, 92vw); animation: menuIn 0.4s cubic-bezier(.16,.9,.28,1); }
.ms-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.ms-title {
  font-family: var(--fs-display); font-weight: 900; font-size: clamp(30px, 3.6vw, 50px);
  color: var(--text-hi); letter-spacing: -0.005em; margin-top: 4px;
}
.ms-head .mbtn { min-width: 150px; align-items: center; justify-content: center; font-size: 14px; }

.ms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ms-foot-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.24em; color: var(--dim); font-weight: 600;
}
.ms-foot-bar b {
  font-family: var(--fs-mono); font-size: 20px; color: var(--text-hi);
  font-weight: 400; letter-spacing: 0; margin-left: 10px;
}
.ms-foot-bar .ms-hint { color: var(--dimmer); letter-spacing: 0.2em; }
.ms-card {
  position: relative; display: flex; flex-direction: column;
  background: rgba(255,255,255,0.026); border: 1px solid var(--line);
  border-top: 2px solid var(--dimmer);
  clip-path: var(--clip-tr);
  cursor: pointer; text-align: left; padding: 0; overflow: hidden;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  font-family: var(--fs-ui);
}
.ms-card:hover {
  background: rgba(77,178,255,0.08); border-top-color: var(--accent);
  transform: translateY(-3px);
}
.ms-thumb {
  position: relative; height: 300px; background: #060a0e;
  display: grid; place-items: center; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.ms-thumb canvas { max-width: 92%; max-height: 92%; display: block; }
.ms-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4,7,11,0.85));
}
.ms-obj {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 9.5px; letter-spacing: 0.2em; font-weight: 600;
  padding: 3px 9px; background: rgba(4,7,11,0.8); border: 1px solid var(--line);
  color: var(--amber);
}
.ms-obj.rescue { color: #ffd45e; }
.ms-obj.defuse { color: #ff6a3a; }
.ms-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ms-name {
  font-family: var(--fs-alt); font-weight: 600; font-size: 24px;
  letter-spacing: 0.06em; color: var(--text-hi); line-height: 1;
}
.ms-sub { font-family: var(--fs-mono); font-size: 10.5px; color: var(--dim); letter-spacing: 0.04em; }
.ms-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.ms-tags span {
  font-size: 9px; letter-spacing: 0.16em; font-weight: 600; padding: 3px 7px;
  border: 1px solid var(--line); color: var(--text);
}
.ms-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
}
.ms-best { font-size: 9.5px; letter-spacing: 0.22em; color: var(--dimmer); font-weight: 600; line-height: 1.5; }
.ms-best b { font-family: var(--fs-mono); font-size: 19px; color: var(--text-hi); font-weight: 400; letter-spacing: 0; }
.ms-rank {
  font-family: var(--fs-display); font-weight: 900; font-size: 38px; line-height: 1;
  color: var(--dimmer);
}
.ms-rank.r-s { color: #ffd24a; } .ms-rank.r-a { color: var(--good); }
.ms-rank.r-b { color: var(--accent); } .ms-rank.r-c { color: #8fa0ae; }
.ms-rank.r-d, .ms-rank.r-f { color: var(--danger); }

/* ------------------------------ briefing ------------------------------ */
#briefing { background: linear-gradient(140deg, #070b10, #04070a 62%); }
.brief-grid {
  display: grid; gap: 44px;
  width: min(1640px, 94vw);
  animation: menuIn 0.4s cubic-bezier(.16,.9,.28,1);
}
.brief-eyebrow {
  font-size: 11px; letter-spacing: 0.46em; color: var(--accent);
  margin-bottom: 12px; font-weight: 600;
}
.brief-title {
  font-family: var(--fs-display); font-weight: 900; font-size: clamp(38px, 5vw, 66px);
  letter-spacing: -0.01em; color: var(--text-hi); line-height: 0.94;
}
.brief-sub {
  margin-top: 10px; font-family: var(--fs-mono); font-size: 13px;
  letter-spacing: 0.1em; color: var(--dim);
}
.brief-tags { display: flex; gap: 7px; margin: 20px 0 22px; flex-wrap: wrap; }
.tag {
  font-size: 10.5px; letter-spacing: 0.2em; font-weight: 600;
  padding: 4px 11px; color: var(--text);
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.brief-body {
  font-size: 16px; line-height: 1.62; color: var(--text);
  max-width: 62ch; font-weight: 400;
  border-left: 2px solid var(--line); padding-left: 18px;
}
.brief-stats { display: flex; gap: 34px; margin-top: 28px; }
.bstat { display: flex; flex-direction: column; gap: 2px; }
.bstat span { font-size: 10px; letter-spacing: 0.26em; color: var(--dimmer); font-weight: 500; }
.bstat b {
  font-family: var(--fs-mono); font-size: 21px; color: var(--text-hi); font-weight: 400;
}

.brief-side {
  border-left: 1px solid var(--line); padding-left: 34px;
  display: flex; flex-direction: column;
}
.panel-title {
  font-size: 11px; letter-spacing: 0.4em; color: var(--dim);
  padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
  font-weight: 600;
}
#loadout { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.lo-card {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 13px;
  background: rgba(255,255,255,0.028); border: 1px solid var(--line);
  border-left: 2px solid var(--accent-dk);
  clip-path: var(--clip-tr);
}
.lo-badge {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(77,178,255,0.08);
  font-family: var(--fs-mono); font-size: 12px; color: var(--accent);
}
.lo-name { font-size: 15px; font-weight: 600; letter-spacing: 0.1em; color: var(--text-hi); }
.lo-role { font-size: 10px; letter-spacing: 0.22em; color: var(--dim); }
.lo-gun {
  font-family: var(--fs-mono); font-size: 12px; color: var(--text);
  text-align: right; letter-spacing: 0;
}
.lo-gun small { display: block; color: var(--dimmer); font-size: 10px; }
.brief-actions { display: flex; gap: 10px; margin-top: 24px; }
.brief-actions .mbtn { min-width: 0; flex: 1; justify-content: center; font-size: 16px; padding: 14px 10px; }

/* ------------------------------ results ------------------------------ */
/* The mission's final frame is held live behind the panel — an opaque
   background here throws away the only image the player earned. */
#results {
  background:
    radial-gradient(ellipse 92% 92% at 50% 46%, rgba(4,7,11,0.20), rgba(3,5,9,0.74) 90%);
}
.res-inner {
  position: relative;
  width: min(1500px, 94vw);
  animation: menuIn 0.45s cubic-bezier(.16,.9,.28,1);
}
/* Soft plate so the panel stays readable over the held mission frame while the
   frame itself still shows at the edges. */
.res-inner::before {
  content: ''; position: absolute; inset: -56px -80px -40px; z-index: -1;
  background: radial-gradient(ellipse 62% 60% at 50% 50%,
    rgba(4,7,11,0.93) 0%, rgba(4,7,11,0.86) 55%, rgba(4,7,11,0.0) 100%);
}

.res-head {
  display: grid; grid-template-columns: 132px 1fr; gap: 30px; align-items: center;
  margin-bottom: 26px;
}
.res-badge { position: relative; width: 120px; height: 132px; color: var(--accent); }
.res-hex {
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 26px currentColor);
  animation: badgeIn 0.65s cubic-bezier(.16,.9,.28,1);
}
.res-badge::before {
  content: ''; position: absolute; inset: 12px;
  background: radial-gradient(circle at 50% 42%,
    color-mix(in srgb, currentColor 26%, transparent),
    color-mix(in srgb, currentColor 6%, transparent) 70%, transparent);
  clip-path: polygon(50% 2%, 96% 27%, 96% 76%, 50% 100%, 4% 76%, 4% 27%);
}
.res-badge::after {
  content: ''; position: absolute; inset: -6px;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  clip-path: polygon(50% 0, 100% 26%, 100% 76%, 50% 100%, 0 76%, 0 26%);
  animation: pulseSoft 3s ease-in-out infinite;
}
@keyframes badgeIn {
  from { opacity: 0; transform: scale(1.45) rotate(-12deg); filter: blur(10px) }
  to { opacity: 1 }
}
.res-rank {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--fs-display); font-weight: 900; font-size: 66px; line-height: 1;
  color: currentColor; text-shadow: 0 0 34px currentColor;
  padding-bottom: 4px;
}
.res-badge.r-s { color: #ffd24a; }
.res-badge.r-a { color: var(--good); }
.res-badge.r-b { color: var(--accent); }
.res-badge.r-c { color: #a9b8c6; }
.res-badge.r-d, .res-badge.r-f { color: var(--danger); }

.res-headtext { text-align: left; }
.res-eyebrow { font-size: 11px; letter-spacing: 0.5em; color: var(--dim); font-weight: 600; }
.res-title {
  font-family: var(--fs-display); font-weight: 900; font-size: clamp(30px, 3.4vw, 46px);
  letter-spacing: -0.005em; color: var(--text-hi); margin: 4px 0 14px;
}

.res-par { max-width: 460px; }
.res-par-track {
  position: relative; height: 5px; background: rgba(255,255,255,0.08);
  overflow: visible;
}
.res-par-track i {
  position: absolute; left: 0; top: 0; bottom: 0; display: block;
  background: linear-gradient(90deg, var(--accent-dk), var(--accent));
  box-shadow: 0 0 12px var(--accent-gl);
  transition: width 0.9s cubic-bezier(.2,.8,.3,1);
}
.res-par-track b {
  position: absolute; top: -4px; width: 2px; height: 13px;
  background: var(--amber);
}
.res-par { position: relative; }
.res-par-labels {
  display: flex; margin-top: 6px;
  font-family: var(--fs-mono); font-size: 12px; color: var(--text-hi); letter-spacing: 0.04em;
}
/* Positioned on the tick it names, not at the end of the track. */
.res-par-tag {
  position: absolute; top: 13px; transform: translateX(-50%);
  font-family: var(--fs-mono); font-size: 10px; color: var(--amber);
  letter-spacing: 0.04em; white-space: nowrap;
}

.res-body {
  display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 30px;
  margin-bottom: 20px;
}
.res-rows { display: flex; flex-direction: column; gap: 1px; }
.res-row {
  display: grid; grid-template-columns: 1fr minmax(0, 210px) 110px;
  gap: 16px; align-items: baseline; padding: 10px 16px;
  background: rgba(10,14,20,0.62); text-align: left;
  opacity: 0; transform: translateX(-12px);
  animation: rowIn 0.32s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes rowIn { to { opacity: 1; transform: none } }
.res-row span {
  font-size: 11px; letter-spacing: 0.24em; color: var(--dim); font-weight: 600;
}
/* The performance figure is the point of the row — it outranks the label. */
.res-row em {
  font-family: var(--fs-mono); font-style: normal; color: var(--text-hi);
  font-size: 20px; text-align: right; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.res-row b {
  font-family: var(--fs-mono); font-weight: 400; color: var(--good);
  text-align: right; font-size: 15px;
}
.res-row b.neg { color: var(--danger); }

.res-squad { border-left: 1px solid var(--line); padding-left: 26px; }
#res-roster { display: flex; flex-direction: column; gap: 6px; }
.rr-card {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 11px; align-items: center;
  padding: 9px 12px; background: rgba(10,14,20,0.68);
  border: 1px solid var(--line); clip-path: var(--clip-tr);
}
.rr-card.down { opacity: 0.5; filter: grayscale(0.8); border-color: rgba(255,74,74,0.4); }
.rr-bar { width: 4px; align-self: stretch; }
.rr-name { font-size: 14px; font-weight: 600; letter-spacing: 0.1em; color: var(--text-hi); }
.rr-role { font-size: 9.5px; letter-spacing: 0.2em; color: var(--dim); }
.rr-card.down .rr-name { text-decoration: line-through; color: var(--danger); }
.rr-stats {
  font-family: var(--fs-mono); font-size: 12px; color: var(--text); text-align: right;
}
.rr-stats small { display: block; color: var(--dimmer); font-size: 10px; }

.res-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 16px; border-top: 1px solid var(--line);
  font-size: 13px; letter-spacing: 0.3em; color: var(--dim); font-weight: 600;
}
.res-total b { font-family: var(--fs-mono); font-size: 40px; color: var(--text-hi); font-weight: 400; }
.res-actions { display: flex; gap: 10px; margin-top: 20px; }
.res-actions .mbtn {
  flex: 1; min-width: 0; align-items: center; justify-content: center;
  font-size: 15px; padding: 14px 8px;
  background: rgba(10,14,20,0.72);
}

/* ------------------------------ loading ------------------------------ */
#loading { background: var(--ink); z-index: 60; transition: opacity 0.5s; }
#loading.gone { opacity: 0; pointer-events: none; }
.load-inner { text-align: center; width: 320px; }
.load-mark {
  font-family: var(--fs-display); font-weight: 900; font-size: 30px;
  letter-spacing: 0.3em; color: var(--text-hi); margin-bottom: 22px;
}
.load-bar { height: 2px; background: rgba(255,255,255,0.09); overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width 0.3s; box-shadow: 0 0 12px var(--accent-gl); }
.load-status {
  margin-top: 12px; font-family: var(--fs-mono); font-size: 11px;
  letter-spacing: 0.2em; color: var(--dim);
}

/* ============================== minimap ============================== */
#minimap {
  position: absolute; left: 14px; top: 72px;
  width: 232px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--clip-tr);
  box-shadow: 0 4px 20px rgba(0,0,0,0.55);
  overflow: hidden;
}
.mm-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 5px 10px 4px;
  font-size: 9.5px; letter-spacing: 0.24em; color: var(--dim); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.mm-head i {
  font-family: var(--fs-mono); font-style: normal; font-size: 10px;
  color: var(--accent); letter-spacing: 0;
}
.mm-body { position: relative; padding: 6px; line-height: 0; }
.mm-body::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(77,178,255,0.05), transparent 40%);
}
.minimap-canvas {
  width: 100%; height: auto; display: block;
  image-rendering: auto;
  filter: saturate(1.1);
}

/* ============================== briefing plan ============================== */
.brief-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr) 360px; }
.brief-plan { display: flex; flex-direction: column; min-width: 0; }
.plan-frame {
  position: relative; flex: 1; min-height: 380px;
  border: 1px solid var(--line);
  background: #070b10;
  padding: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  min-height: 240px;
}
.plan-frame canvas {
  max-width: 100%; max-height: 58vh; width: auto; height: auto;
  display: block;
  image-rendering: auto;
  filter: drop-shadow(0 0 22px rgba(77,178,255,0.10));
}
.plan-frame::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(120,190,230,0.030) 0 1px, transparent 1px 3px);
}
.plan-corner {
  position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--accent); opacity: 0.75;
}
.plan-corner.tl { top: 5px; left: 5px; border-top: 2px solid; border-left: 2px solid; }
.plan-corner.tr { top: 5px; right: 5px; border-top: 2px solid; border-right: 2px solid; }
.plan-corner.bl { bottom: 5px; left: 5px; border-bottom: 2px solid; border-left: 2px solid; }
.plan-corner.br { bottom: 5px; right: 5px; border-bottom: 2px solid; border-right: 2px solid; }
.plan-scan {
  position: absolute; left: 0; right: 0; height: 90px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(77,178,255,0.10), transparent);
  animation: planScan 5.5s linear infinite;
}
@keyframes planScan { from { top: -90px } to { top: 100% } }
.plan-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px;
  font-size: 9.5px; letter-spacing: 0.18em; color: var(--dim); font-weight: 500;
}
.plan-legend span { display: inline-flex; align-items: center; gap: 5px; }
.plan-legend i { width: 7px; height: 7px; display: block; border-radius: 50%; }
