/* Столовая № 67. Визуальный язык: нейро-советский плакат, талоны, штампы, крафт-бумага.
   Все содержательные блоки идут в одну колонку; угловое размещение допускается только для HUD. */

:root {
  /* Палитра */
  --kumach: #c8102e;
  --kumach-d: #8e0b20;
  --kumach-l: #e8435c;
  --gorch: #e0a526;
  --gorch-d: #a8760c;
  --gorch-l: #f3cf6e;
  --biruza: #1f9e94;
  --biruza-d: #146b65;
  --biruza-l: #7fd3c9;
  --kafel: #f4f1e8;
  --kafel-d: #e2ddcf;
  --kraft: #e6d3a8;
  --kraft-d: #c9ad76;
  --kraft-dd: #9a7e4c;
  --ink: #1d1a16;
  --ink-2: #3a342b;
  --ink-3: #6a6152;
  --alu: #b8bec4;
  --violet: #9b5de5;
  --food: #3fae4f;
  --fog-1: #7a3cff;
  --fog-2: #19d3c5;

  /* Поверхности HUD */
  --plate: rgba(29, 26, 22, 0.84);
  --plate-line: rgba(244, 241, 232, 0.18);
  --hud-text: #f4f1e8;
  --hud-muted: #c9c2b0;

  /* Уровни посуды */
  --tier-0: #8b8577;
  --tier-1: #b8bec4;
  --tier-2: #1f9e94;
  --tier-3: #e0a526;

  /* Шрифты */
  --f-logo: 'Rubik Mono One', 'Russo One', Impact, sans-serif;
  --f-head: 'Russo One', 'Oswald', Impact, sans-serif;
  --f-num: 'Oswald', 'PT Sans Narrow', 'Arial Narrow', sans-serif;
  --f-body: 'PT Sans', 'Segoe UI', Arial, sans-serif;
  --f-narrow: 'PT Sans Narrow', 'Arial Narrow', sans-serif;

  --shadow-hard: 4px 4px 0 var(--ink);
  --radius: 6px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b2620; color: var(--ink); font-family: var(--f-body); -webkit-font-smoothing: antialiased; }
#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ================= Экранные эффекты ================= */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }

/* Нейротуман: два плывущих слоя, строчная развёртка и распадающийся лозунг. */
#fogFx { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; }
#fogFx.on { opacity: var(--fog, 1); }
.fog-layer { position: absolute; inset: -20%; will-change: transform; }
.fog-a { background:
  radial-gradient(28% 24% at 22% 30%, rgba(122, 60, 255, 0.30), transparent 70%),
  radial-gradient(26% 30% at 78% 68%, rgba(25, 211, 197, 0.24), transparent 70%),
  radial-gradient(ellipse 60% 55% at center, transparent 45%, rgba(70, 20, 130, 0.62) 100%);
  animation: fogDrift 9s ease-in-out infinite alternate; }
.fog-b { mix-blend-mode: color; background:
  radial-gradient(40% 30% at 70% 20%, rgba(255, 60, 180, 0.35), transparent 70%),
  radial-gradient(40% 40% at 20% 80%, rgba(80, 255, 210, 0.30), transparent 70%);
  animation: fogDrift2 6s ease-in-out infinite alternate; }
.fog-scan { position: absolute; inset: 0; opacity: 0.35;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px);
  animation: scan 0.9s steps(6) infinite; }
.fog-slogan { position: absolute; left: 50%; top: 16%; transform: translateX(-50%) skewX(-8deg); white-space: nowrap;
  font-family: var(--f-logo); font-size: clamp(14px, 2.4vw, 26px); color: rgba(244, 241, 232, 0.55); letter-spacing: 3px;
  text-shadow: 3px 0 rgba(255, 0, 120, 0.6), -3px 0 rgba(0, 255, 220, 0.6); animation: glitch 2.3s steps(1) infinite; }
@keyframes fogDrift { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(3%, 2%, 0) scale(1.06); } }
@keyframes fogDrift2 { from { transform: translate3d(2%, 3%, 0) rotate(0deg); } to { transform: translate3d(-3%, -2%, 0) rotate(4deg); } }
@keyframes scan { to { transform: translateY(4px); } }
@keyframes glitch {
  0% { clip-path: inset(0 0 0 0); transform: translateX(-50%) skewX(-8deg); }
  20% { clip-path: inset(20% 0 40% 0); transform: translateX(-48%) skewX(10deg); }
  24% { clip-path: inset(0 0 0 0); transform: translateX(-50%) skewX(-8deg); }
  60% { clip-path: inset(55% 0 5% 0); transform: translateX(-53%) skewX(-20deg); }
  63% { clip-path: inset(0 0 0 0); transform: translateX(-50%) skewX(-8deg); }
}

#lowHpFx { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(ellipse 70% 65% at center, transparent 40%, rgba(200, 16, 46, 0.55) 75%, rgba(120, 0, 20, 0.9) 100%); }
#lowHpFx.on { animation: pulse 0.9s ease-in-out infinite; }
#hurtFx { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 35%, rgba(200, 16, 46, 0.55) 100%); }
#hurtFx.hit { animation: hurt 0.45s ease-out; }
@keyframes pulse { 50% { filter: brightness(1.5); } }
@keyframes hurt { from { opacity: 1; } to { opacity: 0; } }

#dmgdir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dmg { position: absolute; left: -110px; top: -110px; width: 220px; height: 220px; border-radius: 50%;
  border: 8px solid transparent; border-top-color: var(--kumach);
  filter: drop-shadow(0 0 6px rgba(200, 16, 46, 0.9)); animation: dmgFade 1.1s ease-out forwards; }
@keyframes dmgFade { 0% { opacity: 1; } 60% { opacity: 0.85; } 100% { opacity: 0; } }

/* ================= HUD ================= */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; color: var(--hud-text); font-family: var(--f-narrow); }
.plate { background: var(--plate); border: 1px solid var(--plate-line); border-radius: var(--radius); }

.hud-tl { position: absolute; left: var(--gutter); top: var(--gutter); width: 184px; display: flex; flex-direction: column; gap: 8px; }
.mapbox { position: relative; width: 184px; height: 184px; border-radius: 50%; padding: 2px;
  background: var(--kafel); border: 3px solid var(--ink); box-shadow: var(--shadow-hard); }
#minimap { width: 100%; height: 100%; border-radius: 50%; display: block; background: #3d4a36; }
.mapbox-n { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); font-family: var(--f-head); font-size: 12px;
  background: var(--kumach); color: var(--kafel); border: 2px solid var(--ink); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.zonebox { background: var(--plate); border: 1px solid var(--plate-line); border-left: 5px solid var(--fog-1); border-radius: 4px; padding: 6px 10px; }
.zonebox-head { display: flex; flex-direction: column; gap: 0; font-family: var(--f-head); font-size: 11px; letter-spacing: 1px; color: var(--biruza-l); }
.zonebox-time { font-size: 15px; color: var(--hud-muted); margin-top: 2px; }
.zonebox-time b { font-family: var(--f-num); font-size: 22px; color: var(--hud-text); font-weight: 700; margin-left: 2px; }
.zonebox-state { font-size: 14px; color: var(--hud-muted); }
.zonebox.shrinking { border-left-color: var(--kumach); }
.zonebox.shrinking .zonebox-time b { color: var(--gorch-l); }
.zonebox.outside .zonebox-state { color: #ff8a9c; font-weight: 700; }

.hud-top { position: absolute; left: 50%; top: var(--gutter); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.zonewarn { font-family: var(--f-head); font-size: 17px; letter-spacing: 1px; color: var(--kafel); background: var(--kumach); border: 3px solid var(--ink);
  box-shadow: var(--shadow-hard); padding: 6px 16px; border-radius: 4px; white-space: nowrap; animation: warn 0.8s steps(2) infinite; }
@keyframes warn { 50% { background: var(--kumach-d); } }

.hud-tr { position: absolute; right: var(--gutter); top: var(--gutter); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; width: min(440px, 46vw); }
.counters { display: flex; gap: 8px; }
.ctr { display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: 4px 10px 5px; background: var(--kafel); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--ink); }
.ctr b { font-family: var(--f-num); font-size: 28px; line-height: 1; font-weight: 700; }
.ctr span { font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-2); }
.ctr-red { background: var(--kumach); color: var(--kafel); }
.ctr-red span { color: #ffd9de; }
.ctr.bump b { animation: bump 0.35s ease-out; }
@keyframes bump { 40% { transform: scale(1.35); } }

#killfeed { width: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 15px; }
.kf { background: var(--plate); padding: 3px 10px; border-radius: 3px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  animation: kfIn 0.18s ease-out, fadeOut 7s 0.18s forwards; border-left: 3px solid transparent; }
.kf .who { font-weight: 700; color: var(--hud-text); }
.kf .verb { color: var(--gorch-l); margin: 0 5px; }
.kf .w { color: var(--hud-muted); margin-left: 5px; font-size: 13px; }
.kf .hs { color: var(--kumach-l); font-family: var(--f-head); font-size: 11px; margin-left: 6px; }
.kf.me { border-left-color: var(--kumach); background: rgba(142, 11, 32, 0.85); }
.kf.me-victim { border-left-color: var(--ink); background: rgba(60, 10, 20, 0.9); }
@keyframes kfIn { from { transform: translateX(16px); opacity: 0; } }
@keyframes fadeOut { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* Прицел и хитмаркер */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: var(--kafel); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75); }
.ch-t, .ch-b { width: 2px; height: 8px; left: -1px; }
.ch-t { top: calc(-8px - var(--spread, 5px)); } .ch-b { top: var(--spread, 5px); }
.ch-l, .ch-r { height: 2px; width: 8px; top: -1px; }
.ch-l { left: calc(-8px - var(--spread, 5px)); } .ch-r { left: var(--spread, 5px); }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitmarker i { position: absolute; width: 3px; height: 11px; left: -1.5px; top: -5.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateY(-12px); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateY(-12px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateY(-12px); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateY(-12px); }
#hitmarker.armor i { background: var(--biruza-l); }
#hitmarker.head i { background: var(--kumach-l); height: 14px; }
#hitmarker.kill i { background: var(--gorch); height: 16px; width: 4px; }
#hitmarker.show { animation: hm 0.28s ease-out forwards; }
#hitmarker.show.head, #hitmarker.show.kill { animation: hmBig 0.42s ease-out forwards; }
@keyframes hm { 0% { opacity: 1; transform: scale(1.3); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
@keyframes hmBig { 0% { opacity: 1; transform: scale(1.8) rotate(10deg); } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1); } }

/* Указатель направления к зоне */
#zonePointer { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 3; }
#zonePointer svg { position: absolute; left: -23px; top: -23px; width: 46px; height: 46px; overflow: visible; }
#zonePointer path { fill: var(--kumach); stroke: var(--kafel); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)); }
#zonePointerDist { position: absolute; transform: translate(-50%, -50%); font-family: var(--f-num); font-weight: 700; font-size: 15px; border: 2px solid var(--kumach); color: var(--kafel);
  background: var(--plate); padding: 0 5px; border-radius: 3px; white-space: nowrap; }

/* Комиксовые тосты */
#toasts { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(92vw, 720px); }
.toast { font-family: var(--f-head); font-size: 22px; line-height: 1.15; color: var(--ink); background: var(--kafel); text-align: center;
  border: 3px solid var(--ink); border-radius: 14px; padding: 6px 16px; box-shadow: var(--shadow-hard); max-width: 100%;
  animation: toastIn 0.32s cubic-bezier(.2, 1.6, .4, 1), toastOut 0.4s ease-in forwards; animation-delay: 0s, var(--ttl, 2.6s); }
.toast.red { background: var(--kumach); color: var(--kafel); }
.toast.gold { background: var(--gorch); }
.toast.teal { background: var(--biruza); color: var(--kafel); }
.toast.big { font-family: var(--f-logo); font-size: 30px; letter-spacing: 1px; border-radius: 4px; }
@keyframes toastIn { from { transform: scale(0.4) rotate(var(--rot, -3deg)); opacity: 0; } to { transform: scale(1) rotate(var(--rot, -3deg)); opacity: 1; } }
@keyframes toastOut { to { transform: scale(0.9) rotate(var(--rot, -3deg)) translateY(-10px); opacity: 0; } }
.toast { transform: rotate(var(--rot, -3deg)); }

/* Еда и подсказка взаимодействия */
#eatBox { position: absolute; left: 50%; top: 61%; transform: translateX(-50%); width: min(300px, 80vw); text-align: center; }
.eat-label { font-family: var(--f-head); font-size: 15px; color: var(--kafel); text-shadow: 0 2px 0 var(--ink); margin-bottom: 4px; }
.eat-bar { height: 12px; background: var(--plate); border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
#eatFill { height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--food) 0 8px, #5cc96b 8px 16px); transition: width 0.06s linear; }
.prompt { position: absolute; left: 50%; top: 69%; transform: translateX(-50%); font-size: 18px; background: var(--plate); color: var(--kafel);
  padding: 5px 14px 5px 6px; border-radius: 4px; white-space: nowrap; display: flex; align-items: center; gap: 8px; border: 1px solid var(--plate-line); }
.prompt:empty { display: none; }
.prompt kbd { font-family: var(--f-head); font-size: 15px; color: var(--ink); background: var(--gorch); border: 2px solid var(--ink); border-radius: 4px; padding: 0 8px; box-shadow: 0 2px 0 var(--ink); }
.spectate { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); font-family: var(--f-head); font-size: 18px; text-align: center;
  background: var(--plate); padding: 8px 18px; border-radius: 4px; border: 2px solid var(--gorch); }
.spectate small { display: block; font-family: var(--f-narrow); font-size: 14px; color: var(--hud-muted); }

/* Левый нижний угол: броня, здоровье, усиления */
.hud-bl { position: absolute; left: var(--gutter); bottom: var(--gutter); width: 270px; display: flex; flex-direction: column; gap: 6px; }
.armor { background: var(--plate); border: 1px solid var(--plate-line); border-radius: var(--radius); padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.ar { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 6px; font-size: 13px; }
.ar-slot { font-family: var(--f-head); font-size: 10px; letter-spacing: 0.5px; color: var(--hud-muted); }
.ar-name { color: var(--hud-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-bar { height: 6px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; }
.ar-bar b { display: block; height: 100%; width: 0; background: var(--tier-1); transition: width 0.2s; }
.ar.empty .ar-name { color: var(--ink-3); font-style: italic; }
.ar.t1 .ar-bar b { background: var(--tier-1); }
.ar.t2 .ar-bar b { background: var(--tier-2); }
.ar.t3 .ar-bar b { background: var(--tier-3); }
.ar.worn .ar-bar b { background: var(--kumach-l); }
.ar.dent { animation: dent 0.35s ease-out; }
@keyframes dent { 30% { transform: translateX(-4px); background: rgba(200, 16, 46, 0.4); } 60% { transform: translateX(3px); } }
.ar-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.hp { background: var(--kafel); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius); padding: 4px 8px 7px; box-shadow: var(--shadow-hard); }
.hp-top { display: flex; justify-content: space-between; align-items: baseline; }
.hp-label { font-family: var(--f-head); font-size: 12px; letter-spacing: 1px; color: var(--ink-2); }
#hpNum { font-family: var(--f-num); font-size: 30px; line-height: 1; font-weight: 700; }
.hp-bar { position: relative; height: 14px; background: #d8d1bf; border: 2px solid var(--ink); border-radius: 3px; overflow: hidden; margin-top: 3px; }
#hpFill, #hpGhost { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; }
#hpGhost { background: var(--gorch); transition: width 0.6s 0.25s ease; }
#hpFill { background: linear-gradient(180deg, #4cc06a, #2f8f48); transition: width 0.12s; }
.hp.mid #hpFill { background: linear-gradient(180deg, var(--gorch-l), var(--gorch-d)); }
.hp.low #hpFill { background: linear-gradient(180deg, var(--kumach-l), var(--kumach-d)); }
.hp.low { animation: lowhp 0.9s ease-in-out infinite; }
.hp.low #hpNum { color: var(--kumach); }
@keyframes lowhp { 50% { background: #ffd6dc; } }

.boosts { display: flex; gap: 6px; }
.boost { flex: 1; min-width: 0; font-size: 13px; padding: 3px 8px; border-radius: 4px; background: var(--plate); border: 1px dashed rgba(244, 241, 232, 0.35); color: var(--hud-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boost.on { border: 2px solid var(--gorch); color: var(--hud-text); background: rgba(80, 56, 8, 0.85); }

/* Правый нижний угол: оружие, патроны, ноша */
.hud-br { position: absolute; right: var(--gutter); bottom: var(--gutter); width: 250px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: right; }
.slots { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.slot { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--hud-muted); background: var(--plate); padding: 2px 8px 2px 4px; border-radius: 3px; max-width: 100%; }
.slot kbd { font-family: var(--f-head); font-size: 11px; min-width: 18px; text-align: center; color: var(--ink); background: var(--kraft); border-radius: 3px; padding: 1px 4px; }
.slot .sn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .sa { font-family: var(--f-num); font-size: 12px; color: var(--hud-muted); }
.slot.empty { opacity: 0.55; }
.slot.cur { color: var(--hud-text); background: rgba(142, 11, 32, 0.9); }
.slot.cur kbd { background: var(--gorch); }
.weapon { background: var(--kafel); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius); padding: 4px 10px 6px; box-shadow: var(--shadow-hard); }
.w-name { font-family: var(--f-head); font-size: 14px; letter-spacing: 1px; color: var(--kumach); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-ammo { font-family: var(--f-num); font-weight: 700; font-size: 38px; line-height: 1.05; }
.w-ammo.low #ammoMag { color: var(--kumach); }
.w-ammo.none { font-size: 22px; color: var(--ink-3); }
.ammo-sep { opacity: 0.35; margin: 0 4px; font-size: 26px; }
#ammoRes { font-size: 22px; color: var(--ink-3); }
.weight { background: var(--plate); border-radius: 4px; padding: 3px 8px 5px; border: 1px solid var(--plate-line); }
.weight-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--hud-muted); }
.weight-top span:first-child { font-family: var(--f-head); font-size: 10px; letter-spacing: 1px; align-self: center; }
.weight-bar { height: 6px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.weight-bar > div { height: 100%; width: 0; background: var(--biruza); transition: width 0.2s; }
.weight-bar > div.heavy { background: var(--gorch); }
.weight-bar > div.over { background: var(--kumach-l); }

/* ================= Оверлеи: инвентарь и карта ================= */
.overlay { position: fixed; inset: 0; z-index: 25; overflow-y: auto; background: rgba(20, 17, 14, 0.78); padding: 24px var(--gutter) 40px; }
.sheet, .map-sheet { max-width: 680px; margin: 0 auto; background: var(--kraft); color: var(--ink); border: 3px solid var(--ink); border-radius: 8px; box-shadow: 6px 6px 0 var(--ink);
  padding: 18px 18px 14px; background-image: repeating-linear-gradient(0deg, rgba(110, 80, 30, 0.06) 0 2px, transparent 2px 5px); }
.sheet-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.sheet-head h2, .map-head h2 { font-family: var(--f-head); font-size: 24px; margin: 0; color: var(--ink); }
.stamp-num { align-self: flex-start; font-family: var(--f-head); font-size: 12px; letter-spacing: 1px; color: var(--kumach); border: 2px solid var(--kumach); padding: 2px 8px; border-radius: 3px; transform: rotate(-2deg); }
.inv-weight { font-size: 15px; }
.inv-weight .weight-bar { height: 10px; background: rgba(29, 26, 22, 0.15); border: 2px solid var(--ink); }
.sheet-foot { font-size: 14px; color: var(--ink-2); margin: 12px 0 0; }

.tabs { display: flex; gap: 4px; border-bottom: 3px solid var(--ink); flex-wrap: wrap; }
.tab { font-family: var(--f-head); font-size: 15px; padding: 9px 14px 8px; border: 3px solid var(--ink); border-bottom: none; border-radius: 6px 6px 0 0; background: var(--kraft-d); color: var(--ink);
  cursor: pointer; margin-bottom: -3px; position: relative; min-height: 44px; }
.tab[aria-selected="true"] { background: var(--kafel); color: var(--kumach); z-index: 1; padding-bottom: 11px; }
.tab:hover { background: var(--gorch-l); }
.tab-count { font-family: var(--f-num); font-size: 13px; background: var(--ink); color: var(--kafel); border-radius: 9px; padding: 0 6px; margin-left: 4px; vertical-align: 2px; }
.tabpanel { background: var(--kafel); border: 3px solid var(--ink); border-top: none; border-radius: 0 0 6px 6px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.inv-sec { display: flex; flex-direction: column; gap: 6px; }
.inv-sec h3 { font-family: var(--f-head); font-size: 14px; letter-spacing: 1px; color: var(--ink-2); margin: 4px 0 0; text-transform: uppercase; }
.item { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 8px 14px; border: 2px solid var(--ink); border-radius: 5px; background: #fffdf6; position: relative; }
.item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; border-radius: 3px 0 0 3px; background: var(--tier-c, var(--tier-0)); }
.item.t1 { --tier-c: var(--tier-1); } .item.t2 { --tier-c: var(--tier-2); } .item.t3 { --tier-c: var(--tier-3); }
.item.better { box-shadow: 0 0 0 3px var(--violet); }
.item.food { box-shadow: 0 0 0 3px var(--food); }
.item.empty { border-style: dashed; background: transparent; color: var(--ink-3); }
.item-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.item-slot { font-family: var(--f-head); font-size: 11px; letter-spacing: 0.5px; color: var(--ink-3); text-transform: uppercase; }
.item-name { font-weight: 700; font-size: 17px; }
.item-meta { font-family: var(--f-narrow); font-size: 15px; color: var(--ink-2); }
.item-dur { height: 6px; background: var(--kafel-d); border-radius: 3px; overflow: hidden; max-width: 240px; }
.item-dur b { display: block; height: 100%; background: var(--tier-c, var(--biruza)); }
.item-badge { font-family: var(--f-head); font-size: 11px; padding: 1px 6px; border-radius: 3px; color: var(--kafel); background: var(--violet); }
.item-badge.food { background: var(--food); }
.item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { font-family: var(--f-head); font-size: 13px; padding: 6px 12px; min-height: 34px; border: 2px solid var(--ink); border-radius: 4px; background: var(--kraft); color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.mini:hover { background: var(--gorch-l); }
.mini:active { transform: translate(2px, 2px); box-shadow: none; }
.mini.go { background: var(--biruza); color: var(--kafel); }
.mini.eat { background: var(--food); color: #fff; }
.mini.warn { background: var(--kafel); color: var(--kumach); }
.empty-note { color: var(--ink-3); font-style: italic; margin: 8px 0; }

.overlay-map .map-sheet { max-width: min(calc(72vh + 48px), 100%); min-width: min(100%, 360px); }
.map-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.map-legend { margin: 0; font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; }
.lg-zone { border: 3px solid var(--biruza); }
.lg-next { border: 2px dashed var(--kafel); background: var(--ink-2); }
.lg-me { background: var(--kumach); border: 2px solid var(--ink); }
.lg-mark { background: var(--gorch); border: 2px solid var(--ink); border-radius: 2px; }
#bigmapCanvas { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 72vh; max-width: 72vh; margin: 0 auto; border: 3px solid var(--ink); border-radius: 4px; background: #3d4a36; }

/* ================= Экраны ================= */
.screen { position: fixed; inset: 0; z-index: 30; overflow-y: auto; color: var(--ink);
  background:
    repeating-conic-gradient(from 0deg at 50% -10%, rgba(200, 16, 46, 0.07) 0 6deg, transparent 6deg 12deg),
    radial-gradient(ellipse at 50% 0%, rgba(255, 245, 210, 0.9), transparent 60%),
    repeating-linear-gradient(0deg, rgba(110, 80, 30, 0.05) 0 2px, transparent 2px 6px),
    var(--kraft); }
.screen-dark { color: var(--kafel); background:
    repeating-conic-gradient(from 0deg at 50% 40%, rgba(200, 16, 46, 0.22) 0 6deg, transparent 6deg 12deg),
    radial-gradient(circle at 50% 40%, #3a1016, #14110e 70%); }
.screen-glass { background: rgba(20, 17, 14, 0.66); backdrop-filter: blur(2px); }
.screen-glass .screen-inner { background: var(--kraft); border: 3px solid var(--ink); border-radius: 8px; box-shadow: 6px 6px 0 var(--ink); margin-top: 8vh; padding: 24px 20px; }
.screen-inner { max-width: 680px; margin: 0 auto; padding: 36px var(--gutter) 56px; display: flex; flex-direction: column; gap: 18px; }
.screen-inner.narrow { max-width: 520px; }

/* Логотип */
.logo { position: relative; text-align: center; padding: 6px 0 10px; }
.logo-kicker { font-family: var(--f-narrow); font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-2); }
.logo-title { margin: 6px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 400; }
.logo-word { font-family: var(--f-logo); font-size: clamp(34px, 9vw, 70px); line-height: 1; color: var(--kumach); letter-spacing: 1px;
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 rgba(29, 26, 22, 0.25); }
.logo-num { font-family: var(--f-logo); font-size: clamp(30px, 7vw, 54px); line-height: 1; color: var(--ink); background: var(--gorch); border: 4px solid var(--ink);
  padding: 6px 18px 4px; border-radius: 8px; transform: rotate(-3deg); box-shadow: var(--shadow-hard); margin-top: 8px; }
.logo-sub { font-size: 17px; color: var(--ink-2); max-width: 460px; margin: 14px auto 0; line-height: 1.4; }
.logo-small { margin-bottom: 8px; }
.logo-small .logo-word { color: var(--kafel); text-shadow: 3px 3px 0 var(--kumach); font-size: clamp(30px, 8vw, 54px); }
.logo-small { display: flex; flex-direction: column; align-items: center; }

/* Штамп */
.stamp { font-family: var(--f-head); color: var(--kumach); border: 4px double var(--kumach); border-radius: 6px; padding: 4px 10px; line-height: 1.1;
  text-align: center; letter-spacing: 1px; opacity: 0.85; mix-blend-mode: multiply; pointer-events: none; }
.stamp-logo { position: absolute; right: 2%; top: 50%; transform: rotate(14deg); font-size: 14px; }
.stamp-big { display: inline-block; font-size: 30px; transform: rotate(-8deg); align-self: center; padding: 6px 18px; }
.stamp-res { position: absolute; right: 14px; top: 64px; transform: rotate(12deg); font-size: 20px; }

/* Талон */
.talon { position: relative; background: var(--kafel); border: 3px solid var(--ink); border-radius: 8px; box-shadow: 6px 6px 0 var(--ink); padding: 18px 18px 20px;
  display: flex; flex-direction: column; gap: 16px; }
.talon { --tpad: 18px; }
.talon-head { position: relative; }
.talon-head::before, .talon-head::after { content: ''; position: absolute; bottom: -12px; width: 20px; height: 20px; border-radius: 50%; background: var(--kraft); border: 3px solid var(--ink); }
.talon-head::before { left: calc(-1 * var(--tpad) - 13px); clip-path: inset(0 0 0 50%); }
.talon-head::after { right: calc(-1 * var(--tpad) - 13px); clip-path: inset(0 50% 0 0); }
.talon-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding-bottom: 12px; border-bottom: 3px dashed var(--ink-3); }
.talon-head h2 { font-family: var(--f-head); font-size: 24px; margin: 0; color: var(--kumach); }
.talon-no { font-family: var(--f-num); font-size: 15px; color: var(--ink-2); letter-spacing: 1px; }

/* Поля */
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-family: var(--f-head); font-size: 13px; letter-spacing: 1px; color: var(--ink-2); text-transform: uppercase; padding: 0; }
.field-label b { color: var(--kumach); font-family: var(--f-num); font-size: 16px; }
input[type=text], input:not([type]), select { font: inherit; font-size: 18px; color: var(--ink); background: #fffdf6; border: 3px solid var(--ink); border-radius: 5px; padding: 10px 12px; width: 100%; }
input::placeholder { color: #9a917f; }
input[type=range] { width: 100%; accent-color: var(--kumach); height: 28px; margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 17px; cursor: pointer; min-height: 32px; }
.check input { width: 22px; height: 22px; accent-color: var(--kumach); flex: none; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 120px; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; font-family: var(--f-head); font-size: 15px; padding: 10px 8px; border: 3px solid var(--ink); border-radius: 5px; background: var(--kraft); }
.seg input:checked + span { background: var(--kumach); color: var(--kafel); box-shadow: inset 0 -4px 0 var(--kumach-d); }
.seg input:focus-visible + span { outline: 3px solid var(--gorch); outline-offset: 2px; }

/* Выбор героя: полоса жетонов-вкладок, под ней карточка выбранного героя */
.hero-tabs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.hero-tok { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px; cursor: pointer;
  background: var(--kraft); border: 3px solid var(--ink); border-radius: 6px; color: var(--ink); font-family: var(--f-narrow); font-size: 13px; line-height: 1.1; text-align: center; position: relative; }
.hero-tok svg { width: 100%; max-width: 52px; height: 56px; }
.hero-tok > span:not(.star) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-tok:hover { background: var(--gorch-l); }
.hero-tok[aria-checked="true"] { background: var(--gorch); box-shadow: inset 0 0 0 2px var(--kafel), 3px 3px 0 var(--ink); transform: translateY(-2px); }
.hero-tok .star { position: absolute; top: 2px; right: 4px; color: var(--kumach); font-size: 12px; }
.hero-card { display: flex; flex-direction: column; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; background: #fffdf6; }
.hero-preview { position: relative; height: 230px; display: grid; place-items: center; overflow: hidden;
  background: repeating-conic-gradient(from 0deg at 50% 100%, rgba(244, 241, 232, 0.16) 0 7deg, transparent 7deg 14deg), linear-gradient(180deg, var(--biruza), var(--biruza-d)); }
.hero-preview::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: repeating-linear-gradient(90deg, #f4f1e8 0 22px, #d9d3c3 22px 24px); border-top: 3px solid var(--ink); }
.hero-preview svg.hero-big { height: 196px; width: auto; position: relative; z-index: 1; margin-top: -8px; filter: drop-shadow(4px 4px 0 rgba(29, 26, 22, 0.35)); animation: idle 2.4s ease-in-out infinite; }
.hero-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
@keyframes idle { 50% { transform: translateY(-4px) scaleY(1.02); } }
.hero-info { padding: 12px 14px 14px; border-top: 3px solid var(--ink); display: flex; flex-direction: column; gap: 6px; }
.hero-role { font-family: var(--f-head); font-size: 12px; letter-spacing: 1px; color: var(--biruza-d); text-transform: uppercase; }
.hero-name { font-family: var(--f-head); font-size: 24px; margin: 0; color: var(--ink); }
.hero-quote { margin: 0; font-size: 19px; font-style: italic; color: var(--kumach); }
.hero-trait { margin: 0; font-size: 16px; line-height: 1.4; }

/* Кнопки */
.actions { display: flex; flex-direction: column; gap: 10px; }
.btn { font-family: var(--f-head); font-size: 18px; letter-spacing: 0.5px; color: var(--ink); background: var(--kafel); border: 3px solid var(--ink); border-radius: 6px;
  padding: 13px 16px; min-height: 52px; cursor: pointer; text-align: center; box-shadow: var(--shadow-hard); transition: transform 0.08s, box-shadow 0.08s, background 0.12s; }
.btn:hover { background: var(--gorch-l); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--kumach); color: var(--kafel); font-size: 22px; min-height: 60px; text-shadow: 2px 2px 0 var(--kumach-d); }
.btn-primary:hover { background: #dc1a3a; }
.btn-danger { color: var(--kumach); }
:focus-visible { outline: 3px solid var(--gorch); outline-offset: 3px; }
.btn:focus-visible, .tab:focus-visible, .mini:focus-visible, .hero-tok:focus-visible { outline: 4px solid var(--biruza); outline-offset: 3px; }

.menu-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; color: var(--ink-2); border-top: 2px dashed var(--ink-3); padding-top: 10px; }

/* Документы: «Как играть», настройки, пауза */
.doc-head { display: flex; flex-direction: column; gap: 8px; }
.doc-head h2 { font-family: var(--f-head); font-size: clamp(28px, 6vw, 40px); margin: 0; color: var(--kumach); text-shadow: 2px 2px 0 var(--ink); }
.lead { font-size: 18px; line-height: 1.45; margin: 0; color: var(--ink-2); }
.doc { background: var(--kafel); border: 3px solid var(--ink); border-left: 10px solid var(--kumach); border-radius: 6px; padding: 12px 16px 14px; box-shadow: 4px 4px 0 rgba(29, 26, 22, 0.8); }
.doc:nth-of-type(3n+2) { border-left-color: var(--biruza); }
.doc:nth-of-type(3n) { border-left-color: var(--gorch); }
.doc h3 { font-family: var(--f-head); font-size: 18px; margin: 0 0 6px; color: var(--ink); }
.doc p { margin: 0; font-size: 16px; line-height: 1.5; }
.keys { margin: 0; display: flex; flex-direction: column; }
.keys > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 0; border-bottom: 1px dashed var(--kraft-d); }
.keys > div:last-child { border-bottom: 0; }
.keys dt { min-width: 150px; font-size: 15px; font-weight: 700; }
.keys dd { margin: 0; font-size: 16px; color: var(--ink-2); }
kbd { font-family: var(--f-head); font-size: 13px; background: var(--kraft); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 4px; padding: 1px 7px; margin-right: 3px; display: inline-block; }

/* Загрузка */
.loading-inner { min-height: 100%; justify-content: center; align-items: stretch; text-align: center; }
.loading-plate { background: var(--kafel); color: var(--ink); border: 3px solid var(--ink); border-radius: 8px; padding: 16px; box-shadow: 6px 6px 0 var(--kumach); }
.loading-text { font-family: var(--f-head); font-size: 20px; margin-bottom: 10px; }
.loading-bar { height: 22px; border: 3px solid var(--ink); border-radius: 4px; background: var(--kafel-d); overflow: hidden; }
#loadingFill { height: 100%; width: 0; transition: width 0.2s; background: repeating-linear-gradient(-45deg, var(--kumach) 0 14px, var(--kumach-d) 14px 28px); animation: barMove 0.8s linear infinite; background-size: 40px 40px; }
@keyframes barMove { to { background-position: 40px 0; } }
.loading-pct { font-family: var(--f-num); font-size: 18px; margin-top: 6px; }
.loading-tip { color: var(--kraft); font-size: 17px; line-height: 1.45; margin: 0; }

/* Гибель */
.death-place { font-family: var(--f-head); font-size: 20px; margin: 0; }
.death-place b { color: var(--kumach); font-size: 30px; }

/* Итоги: чек из кассы столовой */
.receipt { position: relative; background: #fffdf6; color: var(--ink); padding: 22px 22px 30px; font-family: var(--f-narrow); box-shadow: 6px 6px 0 rgba(29, 26, 22, 0.5);
  border: 2px solid var(--ink); border-bottom: 0;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%; }
.receipt-head { text-align: center; font-family: var(--f-logo); font-size: 18px; border-bottom: 2px dashed var(--ink); padding-bottom: 10px; }
.receipt-small { font-family: var(--f-narrow); font-size: 14px; margin-top: 4px; color: var(--ink-2); }
.res-title { font-family: var(--f-head); font-size: clamp(24px, 5.5vw, 32px); line-height: 1.15; margin: 18px 0 4px; color: var(--kumach); padding-right: 90px; }
.res-sub { margin: 0 0 12px; font-size: 18px; color: var(--ink-2); }
.receipt-rows { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.receipt-rows > div { display: flex; align-items: baseline; gap: 8px; font-size: 18px; }
.receipt-rows dt { white-space: nowrap; flex: none; }
.receipt-rows dd { margin: 0 0 0 auto; font-family: var(--f-num); font-weight: 700; font-size: 20px; text-align: right; }
.receipt-rows .dots { flex: 1; border-bottom: 2px dotted var(--ink-3); transform: translateY(-5px); min-width: 12px; }
.receipt-total { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 2px dashed var(--ink); font-family: var(--f-head); font-size: 18px; }
.receipt-foot { text-align: center; margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.receipt.win .res-title { color: var(--gorch-d); }

/* ================= Адаптив ================= */
@media (max-width: 760px) {
  :root { --gutter: 10px; }
  .hud-tl { width: 120px; gap: 6px; }
  .mapbox { width: 120px; height: 120px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
  .zonebox { padding: 4px 6px; }
  .zonebox-head { font-size: 9px; }
  .zonebox-time { font-size: 12px; }
  .zonebox-time b { font-size: 17px; }
  .zonebox-state { font-size: 12px; }
  .hud-top { top: 236px; }
  .zonewarn { font-size: 12px; padding: 4px 8px; white-space: normal; text-align: center; max-width: 70vw; }
  .ctr { min-width: 58px; padding: 2px 6px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
  .ctr b { font-size: 20px; }
  .ctr span { font-size: 9px; }
  .hud-tr { width: calc(100vw - 150px); }
  .zonebox-time span { display: block; }
  #killfeed { font-size: 12px; }
  .kf:nth-last-child(n+4) { display: none; }
  .kf .w { display: none; }
  .hud-bl { width: 168px; gap: 4px; }
  .ar { grid-template-columns: 36px 1fr 30px; font-size: 11px; gap: 4px; }
  .ar-slot { font-size: 8px; }
  .armor { padding: 4px 6px; gap: 2px; }
  #hpNum { font-size: 22px; }
  .hp { padding: 2px 6px 5px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
  .hp-bar { height: 10px; }
  .boost { font-size: 11px; padding: 2px 5px; }
  .hud-br { width: 150px; gap: 4px; }
  .slot { font-size: 12px; }
  .weapon { padding: 2px 8px 4px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
  .w-name { font-size: 11px; }
  .w-ammo { font-size: 26px; }
  #ammoRes { font-size: 16px; }
  .weight-top { font-size: 11px; }
  .toast { font-size: 17px; }
  .toast.big { font-size: 20px; }
  .prompt { font-size: 15px; top: 64%; }
  #eatBox { top: 57%; }
  .spectate { top: auto; bottom: 300px; font-size: 15px; width: max-content; max-width: 90vw; }
  .talon { padding: 14px 12px 16px; --tpad: 12px; }
  .stamp-logo { position: static; display: inline-block; margin-top: 12px; transform: rotate(-4deg); }
  .hero-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-preview { height: 200px; }
  .hero-preview svg.hero-big { height: 168px; }
  .res-title { padding-right: 0; margin-top: 64px; }
  .stamp-res { top: 70px; right: auto; left: 22px; transform: rotate(-6deg); }
  .overlay { padding: 12px 8px 24px; }
  .sheet, .map-sheet { padding: 12px 10px; }
  .tab { font-size: 13px; padding: 8px 9px; }
  .keys dt { min-width: 0; width: 100%; }
}
@media (max-width: 760px) and (max-height: 500px) {
  .hud-bl .armor { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; transition-duration: 0.01s !important; }
}
/* Аккаунт, поиск матча и рейтинг. Содержимое идёт в одну колонку. */
.online-account { border-bottom: 2px dashed #9a8669; margin-bottom: 22px; padding-bottom: 20px; }
.online-account h3 { margin: 0 0 8px; }
.online-account p, .online-explain { font-size: 14px; line-height: 1.5; }
.online-account form { display: flex; flex-direction: column; gap: 10px; }
.online-account [hidden], .online-dialog[hidden], .online-badge[hidden] { display: none !important; }
.online-account .btn { width: 100%; }
.online-dialog { z-index: 120; overflow-y: auto; padding: 24px; background: rgba(20, 17, 15, .88); }
.online-dialog .sheet { max-width: 560px; width: 100%; margin: auto; padding: 24px; max-height: 85vh; overflow-y: auto; }
.online-dialog li { margin: 12px 0; overflow-wrap: anywhere; }
.online-badge { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 60; background: #211b17; color: #ffe7a0; padding: 5px 12px; border-radius: 5px; font-size: 12px; pointer-events: none; }
.online-explain { margin: 0 0 12px; }
.capture-prompt { position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(20,17,15,.58); color: #fff; padding: 24px; text-align: center; }
.capture-prompt[hidden] { display: none !important; }
.capture-prompt p { max-width: 480px; margin: 0; line-height: 1.5; }
