:root {
  --bg: #0a0908;
  --paper: #d9cfb4;
  --paper-2: #cbbf9f;
  --ink: #241f1a;
  --ink-soft: #5d5447;
  --red: #a3261c;
  --red-2: #c8402f;
  --olive: #56633a;
  --hud: #ece3cf;
  --gold-1: #f3d57a;
  --gold-2: #b98a2c;
  --px: 'Silkscreen', ui-monospace, monospace;
  --type: 'VT323', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--hud);
  font-family: var(--type);
  font-size: 20px;
  overflow: hidden;
  -webkit-font-smoothing: none;
}
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}
#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  transition: filter 0.4s;
}
body.looking-away #game { filter: grayscale(1) brightness(0.4) blur(3px); }

#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
#grain {
  position: fixed; inset: -50%; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.6s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, 3%); }
}

/* ------------------------------------------------------------------ HUD */
#hud {
  position: fixed; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity 0.4s;
  font-family: var(--px);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 #000;
}
#hud.on { opacity: 1; }
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(rgba(0, 0, 0, 0.65), transparent);
}
#hud-title { font-size: 14px; color: #fff3da; }
#hud-counts { display: flex; gap: 14px; flex-wrap: wrap; }
#hud-counts b { color: #fff; font-weight: 700; }
#hud-counts .w b { color: #e6b45c; }
#hud-counts .d b { color: #ff7a66; }
.hud-progress {
  position: absolute; top: 44px; left: 16px; right: 16px;
  display: flex; align-items: center; gap: 10px; font-size: 10px; color: #b9ae98;
}
.hud-progress .bar { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.12); position: relative; }
#hud-front { position: absolute; left: 0; top: 0; bottom: 0; background: #8d9a62; }
#hud-lead { position: absolute; top: -3px; width: 3px; height: 12px; background: #fff3da; transform: translateX(-1px); transition: left 0.2s linear; }
.hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}
.hint { color: #9c917e; font-size: 10px; }
#lookaway {
  pointer-events: auto;
  font-family: var(--px); font-size: 13px; letter-spacing: 0.08em;
  color: var(--hud); background: rgba(20, 18, 16, 0.75);
  border: 2px solid #8c8370; padding: 8px 14px;
  transition: transform 0.1s, background 0.2s;
}
#lookaway:hover { background: #2a2622; transform: translateY(-1px); }
#lookaway:active { transform: translateY(1px); }

/* ------------------------------------------------------------------ big text */
.bigtext {
  position: fixed; left: 0; right: 0; top: 38%; text-align: center; pointer-events: none;
  opacity: 0; transform: scale(1.25); transition: opacity 0.35s, transform 0.5s cubic-bezier(.2, 1.4, .4, 1);
  text-shadow: 0 4px 0 #000, 0 0 24px rgba(0, 0, 0, 0.8);
}
.bigtext.on { opacity: 1; transform: scale(1); }
.bt-main { font-family: var(--px); font-size: clamp(30px, 7vw, 72px); letter-spacing: 0.06em; color: #fff3da; }
.bt-sub { font-size: clamp(18px, 2.4vw, 26px); color: #c9bfa9; margin-top: 4px; }
.bigtext.gold .bt-main { color: var(--gold-1); }

/* ------------------------------------------------------------------ tooltip */
#tooltip {
  position: fixed; z-index: 30; pointer-events: none; max-width: 290px;
  background: rgba(14, 12, 10, 0.94); border: 2px solid #6e6656; padding: 7px 10px 8px;
  font-size: 18px; line-height: 1.05; color: #d9cfbd;
  opacity: 0; transition: opacity 0.12s;
}
#tooltip.on { opacity: 1; }
#tooltip b { color: #fff3da; font-weight: normal; font-size: 21px; }
#tooltip .st { margin-top: 4px; font-family: var(--px); font-size: 10px; letter-spacing: 0.05em; color: #b4c07a; }
#tooltip .st.dead { color: #ff8a76; }

/* ------------------------------------------------------------------ screens */
.screen {
  position: fixed; inset: 0; z-index: 10;
  overflow-y: auto; overflow-x: hidden;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 28px 16px;
  background: rgba(8, 7, 6, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.45s;
}
.screen.on { opacity: 1; pointer-events: auto; }
.screen.end { background: rgba(4, 3, 3, 0.94); }
.screen.title { align-items: center; background: rgba(8, 7, 6, 0.35); }

/* title */
.title-screen { text-align: center; max-width: 640px; margin: auto; }
.poster {
  display: inline-block; padding: 18px 34px 14px; margin-bottom: 26px;
  background: var(--red); color: #f1e6cc; border: 4px solid #f1e6cc; outline: 4px solid var(--red);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
  transform: rotate(-1.5deg);
  animation: poster-in 0.9s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes poster-in { from { transform: rotate(-8deg) scale(1.4); opacity: 0; } }
.poster-top, .poster-bottom { font-family: var(--px); font-size: 14px; letter-spacing: 0.35em; }
.logo { font-family: var(--px); font-weight: 700; font-size: clamp(40px, 10vw, 86px); margin: 4px 0; letter-spacing: 0.04em; line-height: 1; text-shadow: 4px 4px 0 #5e140e; }
.intro { font-size: 23px; line-height: 1.25; color: #d8ceb9; text-shadow: 0 2px 0 #000; }
.intro b { color: #fff; font-weight: normal; }
.note { color: #8d8372; font-size: 17px; margin-top: 20px; }
.btn-big {
  font-family: var(--px); font-size: 18px; letter-spacing: 0.1em;
  background: #e9dfc6; color: var(--ink); border: 0; padding: 14px 30px;
  box-shadow: 0 5px 0 #8c8167, 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-big:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #8c8167, 0 14px 34px rgba(0, 0, 0, 0.6); }
.btn-big:active { transform: translateY(4px); box-shadow: 0 1px 0 #8c8167; }

/* ------------------------------------------------------------------ dossier (briefing) */
.dossier, .report {
  position: relative;
  width: 100%; max-width: 1000px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.18), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(120, 90, 40, 0.18), transparent 50%),
    var(--paper);
  color: var(--ink);
  padding: 22px 26px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 0 60px rgba(90, 70, 30, 0.25);
  transform: rotate(-0.3deg);
  animation: paper-in 0.5s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes paper-in { from { transform: translateY(40px) rotate(-2deg); opacity: 0; } }
.classified { font-family: var(--px); font-size: 11px; letter-spacing: 0.2em; color: var(--red); }
.doss-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px double var(--ink); padding-bottom: 10px; }
.doss-head h1, .rep-head h1 { font-family: var(--px); font-size: clamp(22px, 4vw, 34px); margin: 2px 0 0; letter-spacing: 0.03em; }
.day { font-family: var(--px); font-size: 28px; text-align: right; line-height: 1; }
.day small { display: block; font-size: 11px; color: var(--ink-soft); letter-spacing: 0.15em; margin-top: 4px; }

.map { margin: 16px 0 8px; }
.map-track { position: relative; height: 34px; background: repeating-linear-gradient(90deg, #c2b593 0 18px, #bcae8b 18px 36px); border: 2px solid var(--ink); }
.map-held { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(86, 99, 58, 0.55); }
.map-dots i { position: absolute; top: 50%; width: 3px; height: 3px; margin-top: -1px; background: var(--red); opacity: 0.75; }
.map-dots i:nth-child(3n) { margin-top: -6px; }
.map-dots i:nth-child(3n+1) { margin-top: 5px; }
.map-front { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--olive); }
.map-front span, .map-obj span { position: absolute; top: 100%; margin-top: 6px; white-space: nowrap; font-family: var(--px); font-size: 10px; }
.map-front span { left: 0; }
.map-obj { position: absolute; right: -2px; top: -4px; bottom: -4px; width: 4px; background: var(--red); }
.map-obj span { right: 0; color: var(--red); }
.map-legend { margin-top: 24px; font-size: 17px; color: var(--ink-soft); font-style: italic; }

.doss-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 26px; margin-top: 8px; }
@media (max-width: 760px) { .doss-grid, .rep-cols { grid-template-columns: 1fr !important; } }
h3 { font-family: var(--px); font-size: 12px; letter-spacing: 0.2em; margin: 16px 0 8px; border-bottom: 1px solid rgba(36, 31, 26, 0.35); padding-bottom: 3px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; font-size: 20px; }
.stats dt { color: var(--ink-soft); }
.stats dd { margin: 0; }
.stats small { color: var(--ink-soft); }
.meter { display: inline-block; width: 90px; height: 9px; background: rgba(36, 31, 26, 0.15); border: 1px solid var(--ink); vertical-align: middle; margin-right: 4px; }
.meter span { display: block; height: 100%; background: var(--olive); }
.meter.warn span { background: #b0812c; }
.meter.bad span { background: var(--red); }

.order { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(36, 31, 26, 0.25); }
.order label { font-size: 20px; line-height: 1; }
.order label small { display: block; color: var(--ink-soft); font-size: 16px; margin-top: 2px; }
.seg { display: flex; flex-shrink: 0; }
.seg button, .toggle {
  font-family: var(--px); font-size: 11px; padding: 6px 9px;
  background: transparent; color: var(--ink); border: 2px solid var(--ink); margin-left: -2px;
  transition: background 0.12s, color 0.12s;
}
.seg button:hover:not(:disabled), .toggle:hover:not(:disabled) { background: rgba(36, 31, 26, 0.12); }
.seg button.on, .toggle.on { background: var(--ink); color: var(--paper); }
.toggle { min-width: 64px; flex-shrink: 0; }
.toggle.danger.on { background: var(--red); border-color: var(--red); color: #fff; }

.dispatches { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.disp { padding: 8px 12px 9px; background: rgba(255, 255, 255, 0.28); border-left: 4px solid var(--ink-soft); transition: opacity 0.3s, transform 0.3s; }
.disp.in { animation: disp-in 0.3s ease-out; }
@keyframes disp-in { from { transform: translateX(14px); } }
.disp .who { font-family: var(--px); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-soft); }
.disp .who small { font-size: 9px; }
.disp .txt { margin: 3px 0 0; font-size: 20px; line-height: 1.1; min-height: 1.1em; }
.disp .txt.typing::after { content: '▌'; animation: blink 0.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.k-holt { border-left-color: var(--olive); }
.k-strand { border-left-color: #3e4f6a; }
.k-overnight { border-left-color: #000; background: rgba(36, 31, 26, 0.1); }
.k-policy { border-left-color: var(--red); background: rgba(163, 38, 28, 0.08); }
.k-press { border-left-color: #222; background: #e9e2cf; }
.k-press .txt { font-family: var(--px); font-size: 14px; line-height: 1.3; }
.k-letter { border-left-color: #7b6a4f; background: #efe7d2; transform: rotate(0.4deg); }
.k-letter .txt { font-style: italic; }
.disp .sign { text-align: right; font-size: 18px; color: var(--ink-soft); margin-top: 4px; }

.doss-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; flex-wrap: wrap; }
.halt { background: none; border: 0; color: var(--ink-soft); font-size: 19px; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.halt:hover { color: var(--red); }

/* The SEND button gets more rewarding every wave. That is the point. */
.send {
  position: relative; overflow: hidden;
  font-family: var(--px); font-size: 16px; letter-spacing: 0.08em;
  padding: 14px 26px; border: 3px solid var(--ink); color: var(--ink); background: #a49b85;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
.send:hover:not(:disabled) { transform: translateY(-2px); }
.send:active:not(:disabled) { transform: translateY(3px) scale(0.98); }
.send:disabled { opacity: 1; }
.send.lvl-2 { background: var(--olive); color: #f2ead4; box-shadow: 0 4px 0 #2f3820; font-size: 17px; }
.send.lvl-3 { background: var(--olive); color: #fff6df; border-color: var(--red); box-shadow: 0 5px 0 #2f3820, 0 0 0 3px rgba(163, 38, 28, 0.25); font-size: 18px; }
.send.lvl-4, .send.lvl-5, .send.lvl-6 {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  color: #2a1a05; border-color: #6e4c10;
  box-shadow: 0 5px 0 #6e4c10, 0 0 30px rgba(243, 213, 122, 0.5);
  font-size: 19px;
  animation: glow 1.6s ease-in-out infinite;
}
.send.lvl-5, .send.lvl-6 { font-size: 21px; padding: 16px 32px; }
.send.lvl-6 { font-size: 23px; box-shadow: 0 6px 0 #6e4c10, 0 0 50px rgba(255, 220, 120, 0.8); }
@keyframes glow { 50% { filter: brightness(1.15) saturate(1.2); } }
.send.lvl-5::after, .send.lvl-6::after {
  content: ''; position: absolute; top: -50%; left: -60%; width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: rotate(20deg); animation: shine 2.2s ease-in-out infinite;
}
@keyframes shine { 0% { left: -60%; } 60%, 100% { left: 130%; } }
.spark {
  position: fixed; z-index: 50; pointer-events: none; color: var(--gold-1); font-size: 18px;
  text-shadow: 0 0 8px rgba(255, 210, 100, 0.9);
  animation: spark 0.9s ease-out forwards;
}
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(200deg) scale(0.3); opacity: 0; } }

.stamp {
  position: absolute; left: 50%; top: 45%; pointer-events: none;
  font-family: var(--px); font-weight: 700; font-size: clamp(40px, 8vw, 80px); letter-spacing: 0.1em;
  color: var(--red); border: 6px solid var(--red); padding: 6px 22px;
  transform: translate(-50%, -50%) rotate(-14deg) scale(3); opacity: 0;
  mix-blend-mode: multiply;
}
.stamp.on { animation: stamp 0.35s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes stamp { to { transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: 0.85; } }

/* ------------------------------------------------------------------ report */
.rep-head { border-bottom: 3px double var(--ink); padding-bottom: 10px; }
.rep-sub { font-size: 21px; color: var(--ink-soft); }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.tile { flex: 1 1 110px; border: 2px solid var(--ink); padding: 8px 10px; background: rgba(255, 255, 255, 0.25); }
.tile b { display: block; font-family: var(--px); font-size: 34px; line-height: 1; }
.tile span { font-family: var(--px); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-soft); }
.tile.bad b { color: var(--red); }
.tile.warn b { color: #8a5d14; }
.rep-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; }
#names { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; font-size: 19px; }
#names li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dotted rgba(36, 31, 26, 0.25); opacity: 0; transform: translateX(-8px); transition: opacity 0.25s, transform 0.25s; }
#names li.in { opacity: 1; transform: none; }
#names .nm em { color: var(--ink-soft); font-size: 16px; }
#names .fate { font-family: var(--px); font-size: 9px; letter-spacing: 0.05em; color: var(--ink-soft); text-align: right; align-self: center; }
#names .f-KIA .fate, #names .f-MISSING .fate, #names .f-DESERTER .fate { color: var(--red); }
#names .f-KIA .nm, #names .f-DESERTER .nm, #names .f-MISSING .nm { text-decoration: line-through; text-decoration-color: rgba(163, 38, 28, 0.6); }
.tag { font-family: var(--px); font-size: 9px; background: var(--red); color: #fff; padding: 1px 4px; }
.per-meter { font-family: var(--px); font-size: 13px; margin: 18px 0; color: var(--red); }

/* ------------------------------------------------------------------ modal */
#modal {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, 0.7); opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
#modal.on { opacity: 1; pointer-events: auto; }
.modal-box { max-width: 460px; background: var(--paper); color: var(--ink); padding: 22px 24px; box-shadow: 0 20px 60px #000; }
.modal-box h2 { font-family: var(--px); font-size: 20px; margin: 0 0 8px; }
.modal-box p { font-size: 21px; line-height: 1.15; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn { font-family: var(--px); font-size: 13px; padding: 10px 16px; background: var(--red); color: #fff; border: 0; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }

/* ------------------------------------------------------------------ endings */
.ending { width: 100%; max-width: 760px; text-align: center; padding: 6vh 0 60px; }
.end-title { font-family: var(--px); font-size: clamp(26px, 6vw, 54px); letter-spacing: 0.05em; color: #f1e6cc; margin: 0 0 30px; animation: fade-up 1.2s ease-out both; }
.k-victory .end-title { color: var(--gold-1); text-shadow: 0 0 30px rgba(243, 213, 122, 0.5); }
.end-lines { min-height: 30vh; }
.end-line { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.25; color: #d4cab6; margin: 0 0 18px; opacity: 0; transform: translateY(10px); transition: opacity 1.2s, transform 1.2s; }
.end-line.in { opacity: 1; transform: none; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }
.end-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 34px; margin: 30px 0; animation: fade-up 1s ease-out both; }
.end-stats b { display: block; font-family: var(--px); font-size: 30px; color: #fff3da; }
.end-stats span { font-size: 18px; color: #9b907d; }
.end-note { font-size: 24px; color: #e0a090; }
.medal { margin: 20px auto 10px; animation: medal 0.9s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes medal { from { transform: scale(0.2) rotate(-90deg); opacity: 0; } }
.medal-ico { font-size: 70px; color: var(--gold-1); text-shadow: 0 0 30px rgba(243, 213, 122, 0.8); line-height: 1; }
.rating { font-family: var(--px); font-size: 14px; letter-spacing: 0.1em; color: #e9dfc6; margin-top: 8px; }
.rating span { color: var(--gold-1); font-size: 26px; vertical-align: middle; }
.rating-sub { font-family: var(--px); font-size: 11px; color: #9b907d; margin-top: 4px; }
.memorial { margin: 40px 0 30px; animation: fade-up 1.5s ease-out both; }
.memorial h2 { font-family: var(--px); font-size: 14px; letter-spacing: 0.4em; color: #8d8372; }
.mem-names { columns: 3 160px; column-gap: 24px; text-align: left; }
.mem-wave { font-family: var(--px); font-size: 10px; letter-spacing: 0.2em; color: #8a5b4f; margin: 10px 0 4px; break-after: avoid; }
.mem-n { font-size: 19px; color: #c7bca7; opacity: 0; transition: opacity 0.6s; break-inside: avoid; }
.mem-n.in { opacity: 1; }
.mem-n small { color: #6d6556; }

@media (max-width: 560px) {
  html, body { font-size: 18px; }
  .dossier, .report { padding: 16px 14px 18px; }
  .order { flex-wrap: wrap; }
  .hint { display: none; }
  .send { width: 100%; }
}

/* test flag: ?still disables CSS motion for screenshots */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }

/* ================================================================== v2: top-down, radio, squads, dilemmas */
.hint { position: absolute; left: 16px; bottom: 64px; color: #9c917e; font-family: var(--px); font-size: 9px; letter-spacing: 0.04em; }
.hud-bottom { align-items: center; flex-wrap: wrap; }
.radio { pointer-events: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.radio-lbl { font-size: 10px; color: #b4a88f; margin-right: 4px; }
.radio button, #lookaway {
  font-family: var(--px); font-size: 12px; letter-spacing: 0.06em;
  color: var(--hud); background: rgba(20, 18, 16, 0.8);
  border: 2px solid #8c8370; padding: 8px 12px;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
}
.radio button:hover { background: #2e2923; transform: translateY(-1px); border-color: #c9bb98; }
.radio button:active { transform: translateY(2px); }
.radio [data-order="back"] { border-color: #8a5a4a; }
#btn-arty { border-color: #a3453a; }
#btn-arty b { color: #ffd27a; }
#btn-arty.on { background: #a3261c; color: #fff; animation: blink-bg 0.6s steps(2) infinite; }
@keyframes blink-bg { 50% { background: #5e140e; } }
#hud.no-radio .radio, #hud.no-radio .hint { display: none; }
body.targeting #game { cursor: crosshair; }

#hud-map { position: absolute; right: 16px; top: 52px; pointer-events: auto; border: 2px solid #6e6656; background: #000; box-shadow: 0 6px 20px rgba(0,0,0,0.6); }
#minimap { display: block; width: 96px; height: 250px; image-rendering: pixelated; cursor: pointer; }
body.targeting #minimap { cursor: crosshair; }
#hud-map .map-cols { display: flex; justify-content: space-around; font-family: var(--px); font-size: 8px; color: #9c917e; padding: 2px 0; background: #14110e; }
#radio-log { position: absolute; left: 16px; bottom: 86px; font-family: var(--type); font-size: 18px; line-height: 1.15; text-shadow: 0 2px 0 #000; }
#radio-log .sent { color: #ffd27a; }
#radio-log .done { color: #b4c07a; }
#radio-log .strike { color: #ff8a76; }
@media (max-width: 700px) {
  #hud-map { top: 74px; right: 8px; }
  #minimap { width: 64px; height: 167px; }
  .radio button, #lookaway { font-size: 10px; padding: 7px 8px; }
  #radio-log { bottom: 110px; font-size: 15px; }
}
.bigtext.small .bt-main { font-size: clamp(18px, 3.4vw, 32px); color: #ffd27a; }

/* statbar */
.statbar { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 0 12px; border-bottom: 1px solid rgba(36,31,26,0.3); }
.sb-item { display: flex; align-items: center; gap: 7px; font-size: 19px; }
.sb-l { color: var(--ink-soft); }
.sb-item .meter { width: 70px; }
.red { color: var(--red); }

/* dilemmas */
.events { display: grid; gap: 12px; margin: 16px 0 6px; }
.event { position: relative; background: #efe6cf; border: 2px solid var(--ink); padding: 12px 16px 14px; box-shadow: 4px 4px 0 rgba(36,31,26,0.25); animation: ev-in 0.4s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes ev-in { from { transform: translateY(-10px) rotate(-1deg); opacity: 0; } }
.ev-flag { position: absolute; top: -11px; right: 14px; background: var(--red); color: #fff; font-family: var(--px); font-size: 9px; letter-spacing: 0.15em; padding: 3px 8px; }
.ev-who { font-family: var(--px); font-size: 10px; color: var(--ink-soft); }
.ev-title { font-family: var(--px); font-size: 18px; margin: 2px 0 6px; }
.ev-text { font-size: 21px; line-height: 1.15; margin: 0 0 10px; }
.ev-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-choices button { font-family: var(--type); font-size: 19px; text-align: left; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 6px 12px; transition: background 0.1s, transform 0.08s; }
.ev-choices button:hover:not(:disabled) { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.event.done { background: transparent; box-shadow: none; border: 1px dashed rgba(36,31,26,0.4); padding: 8px 14px; animation: none; }
.event.done .ev-title { font-size: 13px; margin: 0; }
.ev-choice { font-size: 18px; color: var(--ink-soft); }
.ev-result { font-size: 19px; margin: 2px 0 0; font-style: italic; }

/* the front map + lanes */
.doss-grid { grid-template-columns: 250px 1fr; }
.map-wrap { width: 200px; border: 2px solid var(--ink); background: #000; }
#dmap { display: block; width: 200px; height: 330px; image-rendering: pixelated; }
.map-wrap .map-cols { display: flex; justify-content: space-around; background: var(--ink); color: var(--paper); font-family: var(--px); font-size: 9px; padding: 3px 0; }
.lanes-info { margin-top: 10px; display: grid; gap: 8px; }
.lane-i { font-size: 18px; line-height: 1.1; border-left: 4px solid; padding-left: 8px; }
.lane-i.l0 { border-color: #4b5a33; } .lane-i.l1 { border-color: #7a6040; } .lane-i.l2 { border-color: #6a6560; }
.lane-i b { font-family: var(--px); font-size: 11px; }
.lane-i .lm { float: right; font-family: var(--px); font-size: 10px; }
.lane-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.lane-tags span { font-family: var(--px); font-size: 8px; letter-spacing: 0.04em; padding: 2px 5px; background: rgba(36,31,26,0.1); }
.lane-tags .bad { background: rgba(163,38,28,0.15); color: var(--red); }
.lane-tags .good { background: rgba(86,99,58,0.2); color: #3b4a22; }
.lane-intel { color: var(--ink-soft); font-size: 16px; }
.k-letter-out { border-left-color: #6a5a40; background: #f3ecd8; }
.k-letter-out .txt { font-style: italic; }
.k-enemy { border-left-color: #333; }

/* squads */
h3 small { font-family: var(--type); font-size: 17px; letter-spacing: 0; color: var(--ink-soft); }
h3 small.blocked { color: var(--red); }
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 26px; }
.foot-links { display: flex; gap: 10px; }

/* report */
.lane-results { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.lr { flex: 1 1 150px; border: 2px solid var(--ink); padding: 6px 10px; display: flex; flex-direction: column; }
.lr b { font-family: var(--px); font-size: 10px; }
.lr span { font-family: var(--px); font-size: 18px; }
.lr small { color: var(--ink-soft); font-size: 16px; }
.lr.idle { opacity: 0.45; border-style: dashed; }
.rep-names { max-height: 52vh; overflow-y: auto; padding-right: 6px; }
.rs-head { font-family: var(--px); font-size: 11px; border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
.rs-head small { font-family: var(--type); font-size: 16px; color: var(--ink-soft); }
.changes { list-style: none; margin: 0; padding: 0; font-size: 18px; }
.changes li { padding: 2px 0; border-bottom: 1px dotted rgba(36,31,26,0.25); }
.last-letter { background: #f3ecd8; border-left: 4px solid #6a5a40; padding: 8px 12px; margin: 12px 0; transform: rotate(-0.4deg); }
.ll-h { font-family: var(--px); font-size: 9px; color: var(--ink-soft); }
.last-letter p { font-style: italic; font-size: 19px; margin: 6px 0 0; }
.dogline { font-style: italic; color: var(--ink-soft); }
@media (max-width: 760px) { .doss-grid { grid-template-columns: 1fr !important; } .map-wrap { margin: 0 auto; } }

/* ================================================================== v3: the war room counts, the field remembers */
.face { image-rendering: pixelated; image-rendering: crisp-edges; display: block; width: 48px; height: 60px; flex-shrink: 0; }
.face.dead { filter: grayscale(1) brightness(0.75) contrast(1.1); }

/* resources */
.res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 4px; }
.res { border: 2px solid var(--ink); padding: 8px 10px 6px; background: rgba(255,255,255,0.25); display: flex; flex-direction: column; }
.res b { font-family: var(--px); font-size: 28px; line-height: 1; }
.res span { font-family: var(--px); font-size: 9px; letter-spacing: 0.12em; margin-top: 4px; }
.res small { font-size: 16px; color: var(--ink-soft); line-height: 1.05; margin-top: 2px; }
.res.money b { font-size: 22px; color: #3b4a22; }
@media (max-width: 760px) { .res-grid { grid-template-columns: 1fr 1fr; } }
.doss-grid { grid-template-columns: 1fr 1fr; }

.ledger { width: 100%; border-collapse: collapse; font-size: 19px; }
.ledger td { padding: 2px 0; border-bottom: 1px dotted rgba(36,31,26,0.3); }
.ledger td:last-child { text-align: right; font-family: var(--px); font-size: 11px; white-space: nowrap; }
.ledger td small { color: var(--ink-soft); font-size: 15px; }
.ledger .plus { color: #3b4a22; }
.ledger .minus { color: var(--red); }
.ledger .total td { border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 4px; font-family: var(--px); font-size: 12px; }
.ledger .total td:last-child { font-size: 14px; }
.reqs { display: grid; gap: 4px; }
.req { display: grid; grid-template-columns: 1fr auto 70px; align-items: center; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(36,31,26,0.25); }
.req b { font-size: 19px; font-weight: normal; display: block; line-height: 1; }
.req small { display: block; font-size: 15px; color: var(--ink-soft); line-height: 1.05; }
.req .price { font-family: var(--px); font-size: 10px; white-space: nowrap; }
.req button, .wire-b { font-family: var(--px); font-size: 10px; padding: 6px 6px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); }
.req button:hover:not(:disabled), .wire-b:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.price-note { font-size: 17px; color: var(--ink-soft); font-style: italic; margin: 8px 0 0; }

/* the plan */
.plan-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; transition: opacity 0.2s; }
.plan-wrap.blocked { opacity: 0.45; pointer-events: none; }
.map-wrap.small { width: 150px; }
.map-wrap.small #dmap { width: 150px; height: 248px; }
.plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.al { border: 2px solid rgba(36,31,26,0.45); border-top-width: 5px; padding: 6px 9px 8px; background: rgba(255,255,255,0.18); display: flex; flex-direction: column; gap: 3px; }
.al.l0 { border-top-color: #4b5a33; } .al.l1 { border-top-color: #7a6040; } .al.l2 { border-top-color: #6a6560; }
.al.go { border-color: var(--ink); background: #ebe1c6; box-shadow: 3px 3px 0 rgba(36,31,26,0.25); }
.al.go.l0 { border-top-color: #4b5a33; } .al.go.l1 { border-top-color: #7a6040; } .al.go.l2 { border-top-color: #6a6560; }
.al-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.al-h b { font-family: var(--px); font-size: 11px; }
.al-h .lm { font-family: var(--px); font-size: 9px; color: var(--ink-soft); }
.al .lane-intel { font-size: 15px; line-height: 1.05; min-height: 32px; }
.al-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; border-top: 1px dotted rgba(36,31,26,0.3); padding-top: 4px; }
.al-l { font-size: 17px; line-height: 1; }
.al-l small { display: block; font-size: 14px; color: var(--ink-soft); }
.stepper { display: flex; align-items: center; }
.stepper button { font-family: var(--px); font-size: 10px; min-width: 24px; height: 24px; padding: 0 3px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); margin-left: -2px; }
.stepper button:hover { background: var(--ink); color: var(--paper); }
.stepper b { font-family: var(--px); font-size: 15px; min-width: 34px; text-align: center; }
.al.go .stepper[data-k="men"] b { color: var(--red); }
.commit { margin: 10px 0 4px; font-size: 18px; }
.commit-bar { height: 8px; border: 1px solid var(--ink); background: rgba(36,31,26,0.1); margin-bottom: 4px; }
.commit-bar span { display: block; height: 100%; background: var(--red); transition: width 0.2s; }
.policy { border-bottom: 0; }
.policy .seg button { font-size: 9px; padding: 6px 7px; }
@media (max-width: 860px) { .plan-wrap { grid-template-columns: 1fr; } .map-wrap.small { display: none; } }
@media (max-width: 640px) { .plan { grid-template-columns: 1fr; } .policy { flex-direction: column; align-items: stretch; } }

/* report: faces first */
.rep-head h1 { font-size: clamp(24px, 4.5vw, 40px); }
.wall { display: flex; flex-wrap: wrap; gap: 3px; margin: 14px 0 6px; }
.wf { position: relative; background: #b9ad8d; border: 2px solid var(--ink); opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
.wf.in { opacity: 1; transform: none; }
.wf .face { width: 32px; height: 40px; transition: filter 0.4s; }
.wf.gone.f-KIA, .wf.gone.f-DESERTER { background: #6e6658; border-color: var(--red); }
.wf.gone.f-KIA .face, .wf.gone.f-DESERTER .face { filter: grayscale(1) brightness(0.55); }
.wf.gone.f-KIA::after, .wf.gone.f-DESERTER::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 3px; background: var(--red); transform: rotate(-38deg); }
.wf.gone.f-MISSING { background: #8f8670; border-style: dashed; }
.wf.gone.f-MISSING .face { filter: grayscale(1) blur(1px) brightness(0.8); opacity: 0.6; }
.wf.gone.f-WOUNDED { background: #d1b8a0; border-color: #8a4a2a; }
.wf.gone.f-WOUNDED::after { content: '+'; position: absolute; right: 1px; top: -3px; font-family: var(--px); font-size: 11px; color: var(--red); }
.wall-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--px); font-size: 9px; color: var(--ink-soft); }
.wall-legend .k { color: var(--red); } .wall-legend .m { color: #6a6050; } .wall-legend .w { color: #8a4a2a; }
.stories { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 16px 0 4px; }
.story { display: flex; gap: 12px; align-items: flex-start; background: #efe6cf; border: 2px solid var(--ink); padding: 10px 12px; box-shadow: 4px 4px 0 rgba(36,31,26,0.2); animation: ev-in 0.5s 0.8s cubic-bezier(.2,1.4,.4,1) both; }
.story:nth-child(2) { animation-delay: 1.2s; } .story:nth-child(3) { animation-delay: 1.6s; }
.story .face { width: 64px; height: 80px; border: 2px solid var(--ink); background: #b9ad8d; }
.story.dead { border-color: var(--red); }
.story.dead .face { background: #6e6658; }
.story b { font-family: var(--px); font-size: 11px; }
.story p { margin: 4px 0 0; font-size: 19px; line-height: 1.12; }
.roll-g { margin-bottom: 12px; }
.roll-g ol { list-style: none; margin: 0; padding: 0; }
.rep-side .lane-results { margin: 0 0 8px; }
.rep-side .lr span { font-size: 14px; }
#cont { margin-top: 6px; }

/* memorial faces */
.mem-n { display: inline-flex; align-items: center; gap: 6px; }
.mem-n .face { width: 16px; height: 20px; }

/* field: death feed and the man we are watching */
#feed { position: absolute; left: 16px; top: 52px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.fd { display: flex; gap: 8px; align-items: center; background: rgba(12,10,9,0.72); border-left: 3px solid var(--red-2); padding: 3px 10px 3px 4px; min-width: 190px; transition: opacity 0.4s; }
.fd .face { width: 24px; height: 30px; }
.fd b { color: #fff3da; font-weight: normal; font-size: 18px; }
.fd small { display: block; font-family: var(--px); font-size: 8px; color: #ff8a76; letter-spacing: 0.05em; }
.fd.new { animation: fd-in 0.5s cubic-bezier(.2,1.5,.4,1); }
@keyframes fd-in { from { transform: translateX(-30px); background: rgba(160,30,20,0.85); } }
#spot { position: absolute; right: 16px; bottom: 86px; display: none; gap: 10px; align-items: flex-start; width: 300px; background: rgba(12,10,9,0.8); border: 2px solid #6e6656; padding: 8px 10px; pointer-events: none; }
#spot.on { display: flex; animation: fd-in 0.35s ease-out; }
#spot.pinned { border-color: #ffd27a; }
#spot .face { width: 48px; height: 60px; background: #3a342b; }
#spot.dead { border-color: var(--red-2); background: rgba(60,10,6,0.85); animation: spot-dead 0.6s ease-out; }
@keyframes spot-dead { 0% { transform: scale(1.06); background: rgba(200,40,20,0.9); } }
.sp-k { font-family: var(--px); font-size: 8px; letter-spacing: 0.15em; color: #9c917e; }
#spot.pinned .sp-k { color: #ffd27a; }
.sp-t b { font-weight: normal; font-size: 20px; color: #fff3da; display: block; line-height: 1; }
.sp-sub { font-size: 16px; color: #b8ab92; }
.sp-line { font-size: 17px; color: #e2d6bc; line-height: 1.05; font-style: italic; }
.sp-st { font-family: var(--px); font-size: 9px; color: #ffd27a; margin-top: 4px; }
#spot.dead .sp-st { color: #ff8a76; }
body.looking-away #spot { opacity: 0.35; }
@media (max-width: 760px) {
  #feed { top: 74px; } .fd { min-width: 0; } .fd:nth-child(n+4) { display: none; }
  #spot { right: 8px; left: 8px; width: auto; bottom: 150px; }
}
#feed, #spot { font-family: var(--type); text-transform: none; letter-spacing: 0; }
.fd b, .sp-t b { font-family: var(--type); }

/* ================================================================== v4 */
/* re-rendering the dossier must not replay its entrance */
.screen.settled .dossier, .screen.settled .event, .screen.settled .disp.in, .screen.settled .story { animation: none !important; }
.muted { color: var(--ink-soft); }

/* hover card for a face */
#tooltip.wide { max-width: 400px; }
.pt { display: flex; gap: 12px; align-items: flex-start; }
.pt .face { width: 64px; height: 80px; background: #3a342b; border: 2px solid #6e6656; }
.pt-sub { color: #b8ab92; font-size: 17px; }
.pt-line { font-style: italic; color: #e2d6bc; font-size: 18px; line-height: 1.05; margin-top: 2px; }
.pt-tr { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.pt-tr em { font-style: normal; font-family: var(--px); font-size: 8px; padding: 1px 4px; background: rgba(255,255,255,0.1); color: #d8ccb2; }
.pt-tr em.bad { color: #ff8a76; } .pt-tr em.good { color: #b4c07a; }
.pt-h { list-style: none; margin: 6px 0 0; padding: 4px 0 0; border-top: 1px solid rgba(255,255,255,0.15); font-size: 16px; line-height: 1.1; color: #d8ccb2; }
.pt-h b { font-family: var(--px); font-size: 9px; color: #fff3da; margin-right: 4px; }
.pt-h i { display: block; color: #ffd27a; }
[data-pid] { cursor: help; }

/* manpower */
.comp { margin: 6px 0 2px; }
.comp-bar { display: flex; height: 10px; border: 1px solid var(--ink); overflow: hidden; }
.comp-bar span { display: block; height: 100%; border-right: 1px solid rgba(0,0,0,0.25); }
.comp-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-family: var(--px); font-size: 8px; margin-top: 3px; color: var(--ink-soft); }
.comp-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 3px; vertical-align: -1px; }
.manpower { display: grid; gap: 3px; }
.mp { display: grid; grid-template-columns: 12px 1fr 150px 150px; gap: 10px; align-items: center; padding: 4px 6px; border: 1px dashed rgba(36,31,26,0.3); }
.mp.open { border-style: solid; background: rgba(255,255,255,0.22); }
.mp.locked { opacity: 0.55; }
.mp .dot { width: 12px; height: 12px; border: 1px solid var(--ink); }
.mp-n b { font-size: 19px; font-weight: normal; display: block; line-height: 1; }
.mp-n small { font-size: 15px; color: var(--ink-soft); line-height: 1.05; display: block; }
.mp-s { font-size: 17px; }
.mp-s b { font-family: var(--px); font-size: 13px; }
.mp-s em { color: #3b4a22; font-style: normal; }
.mp-a button { width: 100%; font-family: var(--px); font-size: 9px; padding: 6px 4px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); }
.mp-a button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.mp-a button.mob { border-color: var(--red); color: var(--red); }
.mp-a button.mob:hover:not(:disabled) { background: var(--red); color: #fff; }
.mp-a button small { display: block; font-family: var(--type); font-size: 14px; letter-spacing: 0; }
@media (max-width: 760px) { .mp { grid-template-columns: 12px 1fr; } .mp-s, .mp-a { grid-column: 2; } }

/* your son */
.title-son { display: flex; gap: 14px; align-items: center; max-width: 560px; margin: 0 auto 22px; text-align: left; background: rgba(0,0,0,0.35); border: 1px solid #4a4236; padding: 10px 14px; font-size: 20px; }
.title-son .face { width: 64px; height: 80px; border: 2px solid #8a7f68; background: #3a342b; }
.title-son b { color: #fff3da; font-weight: normal; }
.title-son small { display: block; color: #9c917e; font-size: 17px; margin-top: 4px; }
.son-row { display: flex; gap: 12px; align-items: center; margin: 10px 0 0; padding: 8px 12px; border: 2px solid var(--red); background: #efe3cf; font-size: 19px; }
.son-row .face { width: 40px; height: 50px; border: 1px solid var(--ink); background: #b9ad8d; }
.son-row > div { flex: 1; }
.son-row small { display: block; color: var(--ink-soft); font-size: 16px; }
.son-row button { font-family: var(--px); font-size: 9px; padding: 6px 8px; background: var(--paper); border: 2px solid var(--ink); color: var(--ink); }
.son-row button small { font-family: var(--type); font-size: 14px; color: var(--ink-soft); }
.son-row.safe { border-color: var(--ink-soft); }
.son-row.dead { border-color: #000; background: #d8d0bf; }
.event.son { border-color: var(--red); background: #f3e6d0; }
.k-son { border-left-color: var(--red); background: #f6efdf; transform: rotate(-0.5deg); }
.k-son .txt { font-style: italic; }
.k-form { border-left-color: #000; background: #fff; font-family: var(--px); }
.k-form .txt { font-family: var(--px); font-size: 12px; line-height: 1.5; }
.wf.son { border-color: #c9a14a; box-shadow: 0 0 0 2px #c9a14a; }
.story.son { grid-column: 1 / -1; border-width: 3px; }
.story.son .face { width: 96px; height: 120px; }
.son-k { font-family: var(--px); font-size: 9px; letter-spacing: 0.2em; color: var(--red); }
.story.son p { font-size: 21px; }
.fd.son { border-left-color: #ffd27a; background: rgba(90,20,10,0.9); }
#spot.son { border-color: #c9a14a; }
#spot.son .sp-k { color: #ffd27a; }
.bigtext.son .bt-main { color: #fff3da; letter-spacing: 0.3em; }
body.son-dead #game { filter: grayscale(0.85) contrast(1.15) brightness(0.8); transition: filter 1.5s; }
body.son-dead #vignette { background: radial-gradient(ellipse at center, transparent 30%, rgba(60, 0, 0, 0.75) 100%); }
.end-son { display: flex; gap: 14px; align-items: center; max-width: 560px; margin: 0 auto 24px; text-align: left; border: 1px solid #4a4236; padding: 12px 16px; background: rgba(0,0,0,0.4); }
.end-son .face { width: 64px; height: 80px; border: 2px solid #8a7f68; }
.end-son p { margin: 2px 0; font-size: 21px; color: #e9dec6; }
.mem-n.son { color: #ffd27a; }
