@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;750&display=swap');

:root{
  --paper:#f4f1e8;
  --paper-edge:#d8d1bd;
  --ink:#161311;
  --soft:#77706a;
  --blood:#9b111e;
  --bg:#fff;
  --panel:rgba(255,255,255,.91);
  --shadow:0 18px 45px rgba(24,20,14,.16), 0 4px 14px rgba(24,20,14,.08);
}
*{box-sizing:border-box}
html,body,#app{height:100%;margin:0}
body{
  background:radial-gradient(circle at 50% 20%, #fff 0%, #fff 45%, #f7f7f7 100%);
  color:var(--ink);
  font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;
  overflow:hidden;
}
.titlebar{
  position:fixed; z-index:20; top:0; left:0; right:0;
  display:flex; align-items:flex-start; justify-content:space-between; gap:1rem;
  padding:18px clamp(18px,4vw,44px) 8px;
  pointer-events:none;
}
.titlebar > *{pointer-events:auto}
.eyebrow{margin:0 0 3px; color:#777; font-size:.72rem; letter-spacing:.12em; text-transform:uppercase}
h1{margin:0; font-size:clamp(1.35rem,3vw,2.65rem); letter-spacing:-.055em}
.controls{display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px}
button{
  appearance:none; border:1px solid rgba(20,18,15,.16); background:rgba(255,255,255,.72);
  color:#191613; border-radius:999px; padding:9px 13px; font:600 .82rem/1 Inter,sans-serif;
  box-shadow:0 6px 18px rgba(0,0,0,.05); cursor:pointer; backdrop-filter:blur(8px);
}
button:hover{background:#fff}
button.primary{background:#1a1714;color:#fff;border-color:#1a1714}
#speedBtn.active{background:var(--blood);color:#fff;border-color:var(--blood);box-shadow:0 7px 22px rgba(155,17,30,.24)}
.stage{height:100%; position:relative}
#map{display:block; width:100%; height:100%}
.loading{
  position:absolute; inset:auto 50% 46% auto; transform:translate(50%,50%);
  padding:12px 16px; border-radius:999px; background:rgba(255,255,255,.86);
  box-shadow:var(--shadow); font-size:.85rem; color:#5f5a54; z-index:11;
}
.land{
  fill:var(--paper);
  stroke:rgba(122,111,91,.20);
  stroke-width:.9;
  filter:url(#paperShadow);
}
.paper-grain{mix-blend-mode:multiply; opacity:.35}
.bullet-hole{fill:#090706}
.tear{fill:none; stroke:#21170f; stroke-opacity:.22; stroke-linecap:round}
.paper-lift{fill:none; stroke:#faf7ef; stroke-opacity:.70; stroke-linecap:round; filter:drop-shadow(0 1px 1px rgba(30,20,12,.16))}
.flash{fill:#000; pointer-events:none}
.timeline{
  position:fixed; z-index:18; left:clamp(18px,4vw,44px); bottom:22px;
  width:min(520px, calc(100vw - 390px)); min-width:230px;
  color:#3a3632; font-size:.85rem; pointer-events:none;
}
#dateLabel{font-weight:750; letter-spacing:.02em}
.track{height:5px; width:100%; background:#ede9df; border-radius:999px; overflow:hidden; margin-top:7px}
#progress{height:100%; width:0%; background:#191613; border-radius:inherit}
.casualty-panel{
  position:fixed; z-index:21; right:22px; bottom:22px; width:min(340px,calc(100vw - 44px));
  background:var(--panel); border:1px solid rgba(20,18,15,.12); border-radius:20px;
  box-shadow:var(--shadow); overflow:hidden; backdrop-filter:blur(12px);
}
.panel-header{
  width:100%; border:0; border-radius:0; box-shadow:none; display:flex; justify-content:space-between;
  background:rgba(255,255,255,.72); padding:13px 15px; font-size:.93rem;
}
.panel-body{padding:12px 14px 14px; max-height:34vh; overflow:auto}
.casualty-panel:not(.expanded) .panel-body{display:none}
.panel-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:11px}
.panel-stats div{background:#f6f3ed;border-radius:12px;padding:8px;text-align:center}
.panel-stats b{display:block;font-size:1.15rem}
.panel-stats span{font-size:.65rem;text-transform:uppercase;letter-spacing:.08em;color:#766}
.icons{display:grid; grid-template-columns:repeat(auto-fill, minmax(11px,1fr)); gap:3px; align-items:center}
.person{
  width:10px;height:18px; position:relative; display:inline-block; color:var(--blood);
  filter:drop-shadow(0 1px 0 rgba(0,0,0,.13)); cursor:help;
}
.person:before{content:"";position:absolute;left:3px;top:0;width:5px;height:5px;border-radius:50%;background:currentColor}
.person:after{
  content:"";position:absolute;left:2px;top:6px;width:7px;height:11px;border-radius:3px 3px 1px 1px;
  background:currentColor; box-shadow:-3px 3px 0 -1px currentColor,3px 3px 0 -1px currentColor;
}
.tooltip{
  position:fixed; z-index:50; pointer-events:none; opacity:0; max-width:280px;
  background:#171411; color:#fff; padding:10px 11px; border-radius:12px;
  box-shadow:0 14px 36px rgba(0,0,0,.25); font-size:.78rem; line-height:1.35;
  transform:translate(-50%,-118%);
}
.tooltip.visible{opacity:1}
.modal{
  position:fixed; inset:0; z-index:70; display:none; place-items:center; padding:24px;
  background:rgba(255,255,255,.56); backdrop-filter:blur(5px);
}
.modal[aria-hidden="false"]{display:grid}
.modal-card{
  width:min(620px,100%); background:#fff; border:1px solid rgba(0,0,0,.1); border-radius:24px;
  box-shadow:var(--shadow); padding:24px; position:relative; line-height:1.5;
}
.modal-card h2{margin:0 0 10px; letter-spacing:-.04em}
.close{position:absolute;right:14px;top:14px;border:0;box-shadow:none;font-size:1.4rem;padding:5px 10px}
.made{margin-bottom:0;color:#5b5550}
a{color:#1a1714}
@media (max-width:760px){
  .titlebar{display:block}
  .controls{justify-content:flex-start;margin-top:9px}
  .timeline{width:calc(100vw - 44px); bottom:calc(210px + env(safe-area-inset-bottom))}
}
