/* Laisvės linija – sąsaja. Meniu: vado žemėlapių stalas; mūšis: lauko planšetė. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('fonts/atkinson-next.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --hud: rgba(14, 20, 28, 0.92);
  --hud-solid: #0E141C;
  --hud-edge: #46566A;
  --ink: #1E2A44;
  --ink-soft: #3B4766;
  --paper: #EEE5CF;
  --paper-2: #E2D6B8;
  --paper-edge: #C9B994;
  --table: #1C2530;
  --table-2: #273342;
  --text: #F2F5F8;
  --muted: #AEB8C4;
  /* Akcentas – gintaras: trijų radijo balsų vardas (Gintaras, Dzintars, Merevaik) ir bendras Baltijos simbolis */
  --gold: #FFC72C;
  --accent: #6E3A0E;
  --accent-light: #D08A2E;
  --lt-yellow: #FDB913;
  --good-ink: #006A44;
  --lt-red: #C1272D;
  --lv-carmine: #9D2235;
  --ee-blue: #0072CE;
  --good: #3FBF7F;
  --danger: #FF6B5A;
  --danger-ink: #A3261A;
  --info: #4D9BFF;
  --stamp: #A3261A;
  --font: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--table);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.1; margin: 0; font-weight: 800; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.paper :focus-visible, .modal :focus-visible { outline-color: var(--accent); }

.ico { width: 1.25em; height: 1.25em; display: block; flex: none; }

/* ---------- fonas ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#bg-shade {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(30, 42, 58, 0.5), rgba(12, 18, 28, 0.84)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 6px);
}
body.in-game #bg, body.in-game #bg-shade, body.in-finale #bg, body.in-finale #bg-shade { display: none; }

#app { position: relative; z-index: 2; height: 100%; }

/* ---------- ekranai ---------- */
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: flex; animation: screen-in .26s var(--ease); }
.screen.overlay { z-index: 20; background: rgba(8, 12, 18, 0.72); align-items: center; justify-content: center; padding: 16px; }
/* tik poslinkis, be permatomumo: kol puslapis kraunasi, animacija gali užstrigti pradžioje, ir ekranas atrodytų išblukęs */
@keyframes screen-in { from { transform: translateY(6px); } to { transform: none; } }
body.reduced-motion .screen.active { animation: none; }

.menu { overflow-y: auto; overflow-x: hidden; padding: clamp(16px, 3.2vw, 44px); flex-direction: column; }

/* ---------- popierius ---------- */
.paper {
  position: relative;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
    linear-gradient(180deg, var(--paper), #E8DDC2);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 14px 30px -18px rgba(0,0,0,0.75);
}
.paper::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(120, 95, 50, 0.10) 1px, transparent 1.2px);
  background-size: 7px 7px;
}
.tape-strip {
  position: absolute; width: 112px; height: 24px; top: -11px; left: 26px; transform: rotate(-3deg);
  opacity: .92; z-index: 2; box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
/* trys vėliavos greta: Estija, Latvija, Lietuva */
.tape-baltic { background: rgba(214, 196, 150, .85); }
.tape-right { left: auto; right: 34px; transform: rotate(4deg); }
.tape { display: block; width: 84px; height: 20px; }

.kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.label-ink { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--paper); }
.label-ink.small { font-size: 12px; color: var(--ink-soft); }
.h-ink { color: var(--paper); font-size: clamp(32px, 3vw, 44px); line-height: 1.05; }
.campaign-sub { color: #C5CEDA; font-weight: 700; font-size: 15.5px; margin-top: 4px; }

/* ---------- mygtukai ---------- */
.btn {
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  padding: 10px 20px; font-weight: 800; font-size: 17px; letter-spacing: .01em;
  border-radius: 3px; min-height: 46px;
  transition: background .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--accent); }
.btn-primary:hover { background: #2A3A5E; }
.btn-quiet:hover { background: rgba(30, 42, 68, 0.08); }
.btn-ghost { border-color: rgba(242,245,248,.6); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.btn:disabled { opacity: .35; cursor: default; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0;
  background: rgba(255,255,255,0.04); border: 1px solid var(--hud-edge); color: var(--text); border-radius: 3px;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn[aria-pressed="false"] { color: var(--muted); }
.icon-btn-paper { border-color: var(--ink); color: var(--ink); background: transparent; }
.icon-btn-paper:hover { background: rgba(30, 42, 68, .1); }

/* ---------- pradžia ---------- */
/* centruojama auto paraštėmis, ne justify-content: kai turinys aukštesnis už ekraną (telefonas gulsčiai), viršus lieka pasiekiamas slenkant */
#screen-start { justify-content: flex-start; }
.start-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px);
  align-items: end; max-width: 1180px; width: 100%; margin: auto;
}
.title-card { padding: clamp(24px, 3.4vw, 44px); transform: rotate(-0.6deg); }
.title-card h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.05; margin: 10px 0 12px; letter-spacing: -0.01em; }
.tagline { font-size: clamp(18px, 1.7vw, 22px); font-weight: 700; color: var(--accent); }
.blurb { margin-top: 14px; font-size: 17px; max-width: 46ch; color: var(--ink-soft); }
.diff-block { display: flex; flex-direction: column; gap: 12px; }
.diff-cards { display: grid; gap: 10px; }
.diff-btn {
  text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; align-items: center;
  padding: 12px 16px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--paper-edge);
  border-radius: 2px; position: relative;
}
.diff-btn:hover { background: var(--paper); }
.diff-btn .d-name { font-weight: 800; font-size: 19px; }
.diff-btn .d-desc { grid-column: 1; font-size: 15.5px; color: var(--ink-soft); }
.diff-btn .d-nums { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 12px; font-variant-numeric: tabular-nums; }
.d-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.d-num b { font-size: 18px; }
.d-num span { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.diff-btn[aria-checked="true"] { background: var(--paper); outline: 3px solid var(--ink); outline-offset: -3px; }
.diff-btn[aria-checked="true"]::before {
  content: 'Pasirinkta'; position: absolute; top: -9px; right: 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--stamp); background: var(--paper); border: 2px solid var(--stamp); padding: 0 6px; transform: rotate(2deg);
}
.start-actions { display: flex; gap: 12px; margin-top: 6px; }
.start-actions .btn-primary { font-size: 20px; padding: 12px 40px; }

/* ---------- tamsūs pasakojimo ekranai ---------- */
.dark-screen {
  background: #080B10; flex-direction: column; align-items: flex-start; justify-content: flex-start; overflow-y: auto;
  padding: clamp(24px, 8vw, 120px); gap: 32px; z-index: 5;
}
.dark-screen > :first-child { margin-top: auto; }
.dark-screen > :last-child { margin-bottom: auto; }
.story-lines { max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.story-lines p { font-size: clamp(19px, 2vw, 25px); line-height: 1.45; color: #E4E8EE; opacity: 0; transform: translateY(6px); transition: opacity 1.1s ease, transform 1.1s ease; }
.story-lines p.shown { opacity: 1; transform: none; }
body.reduced-motion .story-lines p { transition: opacity .3s; transform: none; }
.interlude-box { display: flex; flex-direction: column; gap: 14px; }
.interlude-date { color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.interlude-title { font-size: clamp(36px, 5vw, 60px); color: var(--text); margin-bottom: 18px; }

/* ---------- kampanija ---------- */
.campaign-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.campaign-tools { display: flex; align-items: center; gap: 12px; }
#btn-settings { border-color: var(--paper-edge); color: var(--paper); }
#btn-settings:hover { background: rgba(238,229,207,.1); }
.diff-switch { display: flex; border: 1px solid var(--paper-edge); border-radius: 2px; overflow: hidden; }
.diff-switch .diff-btn {
  display: block; padding: 7px 14px; border: 0; border-radius: 0; background: transparent; color: var(--paper);
  font-weight: 700; font-size: 15px;
}
.diff-switch .diff-btn + .diff-btn { border-left: 1px solid var(--paper-edge); }
.diff-switch .diff-btn[aria-checked="true"] { background: var(--paper); color: var(--ink); outline: 0; }
.diff-switch .diff-btn[aria-checked="true"]::before { display: none; }
.paper .diff-switch { border-color: var(--ink); }
.paper .diff-switch .diff-btn { color: var(--ink); }
.paper .diff-switch .diff-btn + .diff-btn { border-left-color: var(--ink); }
.paper .diff-switch .diff-btn[aria-checked="true"] { background: var(--ink); color: var(--paper); }

.campaign-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.map-card { padding: 18px; }
.map-box { position: relative; width: 100%; aspect-ratio: 810 / 560; container-type: inline-size; }
.map-box svg.map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Mazgas centruojamas paraštėmis, be transform ir z-index: taip jis nekuria savo sluoksnio, ir visų smeigtukų
   z-index lyginamas viename žemėlapio sluoksnyje (žr. lietimo zoną žemiau) */
.stage-node {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0;
  border: 0; background: transparent;
}
.stage-node .pin {
  position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ink);
}
.stage-node.current .pin { background: var(--accent); box-shadow: 0 0 0 2px var(--ink), 0 0 0 7px rgba(110, 58, 14, 0.28); }
.stage-node.won .pin { background: var(--good-ink); }
.stage-node.locked .pin { background: #9A9078; border-color: var(--paper-2); box-shadow: 0 0 0 2px #9A9078; }
.stage-node .pin-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--paper); }
.stage-node .pin-label {
  position: absolute; white-space: nowrap; text-align: left; pointer-events: none;
  font-size: 13px; line-height: 1.2; color: var(--ink); background: rgba(238, 229, 207, 0.86); padding: 2px 5px;
}
.stage-node .pin-label b { display: block; font-size: 14px; }
.stage-node .pin-label .stars { display: inline-flex; gap: 1px; vertical-align: -2px; color: #B07C00; }
.stage-node .pin-label .stars .star { width: 13px; height: 13px; }
.stage-node.locked .pin-label { color: #5E5644; background: rgba(238, 229, 207, 0.86); font-size: 12px; }
.stage-node:hover .pin, .stage-node:focus-visible .pin { transform: scale(1.12); }
.stage-node.locked { cursor: not-allowed; }
/* smeigtukas, numeris ir etiketė – virš visų lietimo zonų: stačiame telefone zona didesnė už atstumą tarp artimų
   smeigtukų, ir 2 etapo zona dengdavo 1 etapo smeigtuką (7 – 8-o) */
.stage-node .pin, .stage-node .pin-num, .stage-node .pin-label { z-index: 3; }
.lbl-r .pin-label { left: 32px; top: 50%; transform: translateY(-50%); }
.lbl-l .pin-label { right: 32px; top: 50%; transform: translateY(-50%); text-align: right; }
.lbl-b .pin-label { top: 30px; left: 50%; transform: translateX(-50%); text-align: center; }
.lbl-t .pin-label { bottom: 30px; left: 50%; transform: translateX(-50%); text-align: center; }
/* siauras žemėlapis (≈1024 px langas): mažesnės etiketės, kad nedengtų smeigtukų */
@container (max-width: 620px) {
  .stage-node .pin-label { font-size: 11.5px; padding: 1px 4px; }
  .stage-node .pin-label b { font-size: 12.5px; }
  .stage-node .pin-label .stars .star { width: 11px; height: 11px; }
  .stage-node.locked .pin-label { font-size: 11px; }
  .lbl-r .pin-label { left: 28px; }
  .lbl-l .pin-label { right: 28px; }
}
/* telefono plotis: mažesni smeigtukai, kad Hostomelio ir Kyjivo mygtukai nepersidengtų */
@container (max-width: 400px) {
  .stage-node { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
  .stage-node .pin { inset: 2px; border-width: 2px; }
  .stage-node .pin-num { font-size: 10.5px; }
  .lbl-r .pin-label { left: 22px; }
  .lbl-l .pin-label { right: 22px; }
  .lbl-b .pin-label { top: 22px; }
  .lbl-t .pin-label { bottom: 22px; }
  /* etiketės netelpa – rodoma tik dabartinio etapo, kiti etapai – numeriai (pavadinimas – aria-label) */
  .stage-node:not(.current) .pin-label { display: none; }
}

.side-col { display: flex; flex-direction: column; gap: 18px; }
.machine-card {
  background: linear-gradient(180deg, #23262B, #16181B); border: 1px solid #3D4148; padding: 14px 16px 16px;
  color: #D5D9DF; position: relative;
}
.machine-card::before {
  content: ''; position: absolute; inset: 5px; border: 1px dashed rgba(255,255,255,.08); pointer-events: none;
}
.machine-card h2 { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: #C9CDD3; }
.machine-plan { font-size: 14px; line-height: 1.35; color: #AEB4BC; margin: 4px 0 0; }
.machine-svg { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.gear-run { animation: gear-spin var(--dur, 8s) linear infinite; transform-box: fill-box; transform-origin: center; }
.gear-run.rev { animation-direction: reverse; }
body.reduced-motion .gear-run { animation: none; }
@keyframes gear-spin { to { transform: rotate(360deg); } }
.meter { margin-top: 10px; }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15.5px; }
.meter-row b { font-size: 20px; font-variant-numeric: tabular-nums; color: #F2F5F8; }
.meter-track { height: 10px; background: #0D0E10; border: 1px solid #3D4148; margin-top: 4px; position: relative; overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(-45deg, #8B3A2E 0 6px, #6E2C23 6px 12px); transition: width 1.6s var(--ease); }
.meter-fill.waves { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }

.aid-card { padding: 16px 18px; }
.aid-card h2 { font-size: 16px; margin-bottom: 8px; }
.aid-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.aid-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 15.5px; line-height: 1.3; padding: 3px 0; border-bottom: 1px dashed rgba(30, 42, 68, .18); }
.aid-list li:last-child { border-bottom: 0; }
.aid-list .flags { display: flex; gap: 3px; }
.aid-list .flag { width: 21px; height: 14px; display: block; }
.aid-list .aid-when { font-size: 12.5px; color: var(--ink-soft); }
.aid-list .aid-when .ico { width: 13px; height: 13px; }
.aid-list li.locked { color: #6B6350; }
.aid-list li.locked .flags { filter: grayscale(1); opacity: .45; }
.aid-list li.locked .ico { width: 14px; height: 14px; }

/* ---------- instruktažas ---------- */
#screen-briefing { justify-content: flex-start; }
.brief-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 26px; max-width: 1180px; margin: auto; width: 100%; align-items: start; }
.brief-main { padding: clamp(22px, 3vw, 40px); }
.brief-main h1 { font-size: clamp(34px, 4.4vw, 56px); margin: 8px 0 16px; }
.brief-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; color: var(--ink-soft); font-size: 15px; padding-right: 150px; }
.brief-meta .sep { width: 18px; height: 2px; background: var(--ink-soft); display: inline-block; }
.brief-intro p { font-size: 17.5px; margin-bottom: 10px; max-width: 62ch; }
.brief-goal { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-weight: 800; font-size: 18px; padding: 10px 0; border-top: 2px dashed rgba(30, 42, 68, .35); border-bottom: 2px dashed rgba(30, 42, 68, .35); }
.goal-mark { width: 16px; height: 16px; margin-top: 4px; border: 3px solid var(--danger-ink); border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--danger-ink); }
.brief-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.brief-actions .btn-primary { font-size: 20px; padding: 12px 38px; }
.stamp {
  position: absolute; top: 22px; right: 22px; transform: rotate(6deg); border: 3px solid currentColor; padding: 4px 10px;
  font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--stamp); max-width: 150px; text-align: center; line-height: 1.15;
}
.stamp.fiction { color: var(--accent); }
.brief-side { display: flex; flex-direction: column; gap: 10px; }
.on-table { color: var(--paper); }
.news-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.news-item { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; background: rgba(14, 20, 28, 0.82); border: 1px solid var(--hud-edge); padding: 8px 12px 8px 8px; }
.news-item .n-ico { width: 56px; height: 56px; background: #26313F; display: grid; place-items: center; }
.news-item .n-ico img, .news-item .n-ico svg { width: 52px; height: 52px; display: block; }
.news-item .n-kind { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.news-item .n-name { font-weight: 800; font-size: 16px; color: var(--text); }
.news-item .n-text { font-size: 15.5px; color: #DCE2EA; }
.fact-card { padding: 18px 18px 16px; margin-top: 10px; }
.fact-card .tape { position: absolute; top: -9px; left: 18px; transform: rotate(-2deg); box-shadow: 0 2px 3px rgba(0,0,0,.25); }
.fact-card .fact-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 4px 0 4px; }
.fact-card p { font-size: 16px; }

/* ---------- mūšio ekranas ---------- */
#screen-game { flex-direction: column; background: #0A0E14; }
.hud-top, .hud-bottom {
  flex: none; display: flex; align-items: center; gap: 10px; background: var(--hud-solid); color: var(--text);
  border-color: var(--hud-edge); border-style: solid; border-width: 0; padding: 6px 10px; position: relative; z-index: 4;
}
.hud-top { border-bottom-width: 2px; min-height: 52px; }
.hud-bottom { border-top-width: 2px; padding: 6px 8px; align-items: stretch; gap: 8px; }
.hud-stat { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 21px; font-variant-numeric: tabular-nums; padding: 2px 8px; border-right: 1px solid var(--hud-edge); }
.hud-stat .hud-ico { color: var(--gold); display: block; }
.hud-stat .hud-ico .ico { width: 22px; height: 22px; }
#hud-lives .hud-ico { color: #E8ECF1; }
#hud-money .v { color: var(--gold); min-width: 3.2ch; }
#hud-lives .v { min-width: 2ch; }
#hud-lives.low .hud-ico, #hud-lives.low .v { color: var(--danger); }
#hud-lives.low { animation: pulse 1s ease-in-out infinite; }
#hud-lives.hit { animation: hit .45s ease; }
body.reduced-motion #hud-lives.low { animation: none; text-decoration: underline wavy var(--danger); }
@keyframes pulse { 50% { background: rgba(255, 107, 90, 0.18); } }
@keyframes hit { 30% { background: rgba(255, 107, 90, .45); } }
.hud-time { font-size: 17px; color: var(--muted); }
.hud-time .hud-ico { color: var(--muted); }
.hud-time .hud-ico .ico { width: 18px; height: 18px; }
.hud-wave { display: flex; flex-direction: column; gap: 3px; padding: 0 8px; border-right: 1px solid var(--hud-edge); min-width: 150px; }
.hud-wave .v { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.hud-wave .v b { color: var(--gold); font-size: 17px; letter-spacing: 0; }
.wave-bar { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.wave-bar i { flex: 1; height: 7px; background: #283240; display: block; min-width: 5px; position: relative; }
.wave-bar i.peak { height: 11px; }
.wave-bar i.done { background: var(--gold); }
.wave-bar i.cur { background: #D9AE2E; box-shadow: 0 0 0 1px var(--gold); }
.wave-bar i.boss { height: 14px; background: #4A2A26; }
.wave-bar i.boss.done { background: var(--danger); }
.wave-bar i.boss::after { content: ''; position: absolute; left: 50%; top: -5px; width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg); background: var(--danger); }
.hud-spacer { flex: 1; }
.hud-next { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-next b { color: var(--text); }
.btn-wave {
  border: 1px solid var(--gold); background: rgba(255, 199, 44, 0.1); color: var(--gold); font-weight: 800; font-size: 15px;
  padding: 7px 12px; border-radius: 3px; white-space: nowrap; min-height: 38px;
}
.btn-wave:hover:not(:disabled) { background: rgba(255, 199, 44, 0.2); }
.btn-wave:disabled { border-color: var(--hud-edge); color: #7D8794; background: transparent; cursor: default; }
.btn-wave .bonus { color: var(--text); }
.btn-wave:disabled .bonus { color: inherit; }
.hud-btns { display: flex; gap: 6px; }
.speed-v { font-weight: 800; font-size: 15px; }
#btn-speed.fast { color: var(--gold); border-color: var(--gold); }

.stage-wrap { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; background: #0A0E14; }
#game { position: absolute; left: 0; top: 0; display: block; touch-action: none; }
#game.placing { cursor: crosshair; }

.prep-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
  background: var(--hud); border: 1px solid var(--hud-edge); padding: 6px 8px 6px 16px; z-index: 5; white-space: nowrap;
}
.prep-text { font-size: 17px; font-weight: 700; }
.prep-text b { color: var(--gold); font-size: 20px; font-variant-numeric: tabular-nums; }

.announce { position: absolute; left: 0; right: 0; top: 18%; text-align: center; pointer-events: none; z-index: 6; }
.announce .a-main {
  display: inline-block; font-size: clamp(30px, 4.5vw, 54px); font-weight: 800; color: var(--text);
  text-shadow: 0 3px 0 rgba(0,0,0,.6), 0 0 24px rgba(0,0,0,.6); letter-spacing: .02em;
  -webkit-text-stroke: 2px rgba(8, 11, 16, 0.8); paint-order: stroke fill;
  animation: ann 2.6s var(--ease) forwards;
}
.announce .a-sub { display: block; width: max-content; margin: 8px auto 0; font-size: 17px; font-weight: 800; color: var(--hud-solid); background: var(--danger); padding: 3px 12px; animation: ann 2.6s var(--ease) forwards; }
.announce .a-sub .ico { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
@keyframes ann { 0% { opacity: 0; transform: translateY(10px) scale(.96); } 12%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
body.reduced-motion .announce .a-main, body.reduced-motion .announce .a-sub { animation-name: ann-flat; }
@keyframes ann-flat { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

.hint {
  pointer-events: none;
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: min(520px, 90%);
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 16px; border: 1px solid var(--paper-edge); box-shadow: 0 8px 18px -10px rgba(0,0,0,.8);
}
/* kol rodoma pasiruošimo juosta (iki 64 px), patarimas – po ja */
.prep-banner:not([hidden]) ~ .hint { top: 74px; }
.hint .ico { color: #9A6B00; width: 20px; height: 20px; }
.hint.show { animation: hint-in .3s var(--ease); }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, -6px); } }

.radio { position: absolute; left: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 6; max-width: min(420px, 55%); pointer-events: none; }
/* ginklo patarimas dengia radiją – kol jis rodomas, radijas paslepiamas */
.stage-wrap:has(.tower-tip:not([hidden])) .radio { visibility: hidden; }
.radio-msg {
  background: var(--hud); border: 1px solid var(--hud-edge); padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px;
  animation: radio-in .3s var(--ease); transition: opacity .5s;
}
.radio-msg.out { opacity: 0; }
.radio-msg .r-who { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); grid-column: 1 / -1; }
.radio-msg .r-who .ico { width: 15px; height: 15px; color: var(--muted); }
.radio-msg .r-who .role { color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; }
.radio-msg .flag { width: 21px; height: 14px; display: block; }
.radio-msg .r-text { grid-column: 1 / -1; font-size: 15.5px; line-height: 1.35; }
@keyframes radio-in { from { opacity: 0; transform: translateX(-10px); } }

.place-reason, .aim-label {
  position: absolute; z-index: 7; pointer-events: none; background: var(--hud-solid); color: var(--text); font-size: 14px; font-weight: 700;
  padding: 3px 9px 3px 7px; border: 1px solid var(--danger); white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.place-reason::before { content: ''; width: 12px; height: 12px; border: 2px solid var(--danger); border-radius: 50%; background: linear-gradient(45deg, transparent 43%, var(--danger) 43% 57%, transparent 57%); flex: none; }
.aim-label { border-color: var(--gold); }

/* ginklo skydelis */
.tower-panel {
  position: absolute; z-index: 8; width: 282px; background: var(--hud); border: 1px solid var(--hud-edge); color: var(--text);
  padding: 10px 12px 12px; font-size: 14px; box-shadow: 0 10px 24px -12px rgba(0,0,0,.9);
}
.tp-head { display: flex; align-items: center; gap: 8px; }
.tp-head .tp-name { font-weight: 800; font-size: 16px; line-height: 1.15; flex: 1; }
.tp-head .flags { display: flex; gap: 3px; }
.tp-head .flag { width: 21px; height: 14px; display: block; }
.tp-close { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); padding: 0; }
.tp-close:hover { color: var(--text); }
.tp-close .ico { width: 16px; height: 16px; }
.tp-fact { font-size: 12.5px; color: var(--muted); margin: 3px 0 8px; line-height: 1.3; }
.tp-equiv { font-size: 12.5px; color: var(--muted); margin: -4px 0 8px; line-height: 1.3; }
.tp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; }
.tp-lvl { display: flex; gap: 4px; align-items: center; }
.tp-lvl i { width: 10px; height: 10px; border: 2px solid var(--gold); display: block; transform: rotate(45deg); }
.tp-lvl i.on { background: var(--gold); }
.tp-branch-name { color: var(--gold); font-weight: 700; font-size: 13px; }
.tp-rank { font-weight: 800; }
.tp-rank .chev { display: inline-flex; gap: 1px; vertical-align: middle; margin-right: 4px; }
.tp-rank .chev svg { width: 12px; height: 10px; display: block; color: var(--gold); }
.tp-kills { color: var(--muted); font-variant-numeric: tabular-nums; }
.tp-vetbar { height: 5px; background: #283240; position: relative; margin: 2px 0 8px; }
.tp-vetbar span { position: absolute; inset: 0 auto 0 0; background: var(--gold); display: block; }
.tp-stats { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.tp-stats td { padding: 2px 0; }
.tp-stats td:first-child { color: var(--muted); }
.tp-stats td.val { text-align: right; font-weight: 800; }
.tp-stats td.nxt { text-align: right; width: 76px; color: var(--good); font-weight: 800; }
.tp-stats td.nxt .ico { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
.tp-stats td.nxt.down { color: var(--danger); }
.tp-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 6px;
  background: rgba(255,199,44,.1); border: 1px solid var(--gold); color: var(--text); font-weight: 800; border-radius: 2px; text-align: left;
}
.tp-btn b { color: var(--gold); font-variant-numeric: tabular-nums; }
.tp-btn:hover { background: rgba(255,199,44,.2); }
.tp-btn[aria-disabled="true"] { border-color: var(--hud-edge); background: transparent; color: var(--muted); }
.tp-btn[aria-disabled="true"] b { color: #8E8A6A; }
.tp-btn[aria-disabled="true"] b::before { content: ''; display: inline-block; width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; margin-right: 5px; background: linear-gradient(45deg, transparent 40%, currentColor 40% 60%, transparent 60%); vertical-align: 0; }
.branch-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.branch-btn {
  display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 8px; background: rgba(255,255,255,.04);
  border: 1px solid var(--gold); color: var(--text); border-radius: 2px; font-size: 12.5px; line-height: 1.25;
}
.branch-btn .b-name { font-weight: 800; font-size: 13.5px; }
.branch-btn .b-desc { color: var(--muted); }
.branch-btn .b-cost { color: var(--gold); font-weight: 800; margin-top: auto; }
.branch-btn:hover { background: rgba(255,199,44,.12); }
.branch-btn[aria-disabled="true"] { border-color: var(--hud-edge); }
.branch-btn[aria-disabled="true"] .b-cost { color: #8E8A6A; }
.tp-target { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-top: 8px; }
.tp-target .lbl { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 700; }
.target-btn { padding: 3px 7px; font-size: 12.5px; background: transparent; border: 1px solid var(--hud-edge); color: var(--muted); border-radius: 2px; font-weight: 700; }
.target-btn[aria-pressed="true"] { background: var(--text); color: var(--hud-solid); border-color: var(--text); }
.tp-sell { margin-top: 8px; width: 100%; display: flex; justify-content: space-between; padding: 6px 10px; background: transparent; border: 1px solid #636C78; color: var(--text); font-weight: 700; border-radius: 2px; }
.tp-sell b { color: var(--gold); font-variant-numeric: tabular-nums; }
.tp-sell:hover { border-color: var(--text); }
.tp-maxed { color: var(--muted); font-size: 13px; margin-top: 6px; }
.tp-status { font-size: 12.5px; font-weight: 700; color: var(--danger); margin: 2px 0; display: flex; gap: 6px; align-items: center; }
.tp-status .ico { width: 14px; height: 14px; }

/* apatinė juosta */
.tower-bar, .ability-bar { display: flex; gap: 5px; align-items: stretch; }
.tower-bar { flex: 1 1 auto; min-width: 0; }
.ability-bar { flex: none; padding-left: 8px; border-left: 1px solid var(--hud-edge); }
.ability-bar:empty { display: none; }
.tower-btn, .ability-btn {
  position: relative; display: grid; grid-template-columns: 40px auto; grid-template-rows: auto auto; column-gap: 7px; align-items: center;
  padding: 4px 22px 4px 5px; background: #16202B; border: 1px solid var(--hud-edge); color: var(--text); border-radius: 2px;
  min-height: 52px; text-align: left; flex: 0 1 auto; min-width: 0;
}
.tower-btn:hover, .ability-btn:hover { background: #1F2B38; border-color: #5F7590; }
.tower-btn .t-ico, .ability-btn .t-ico { grid-row: 1 / span 2; width: 40px; height: 40px; display: grid; place-items: center; }
.tower-btn .t-ico img, .tower-btn .t-ico svg, .ability-btn .t-ico img, .ability-btn .t-ico svg { width: 40px; height: 40px; display: block; }
.tower-btn .t-name, .ability-btn .t-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.tower-btn .t-cost { font-weight: 800; font-size: 15px; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tower-btn .t-key, .ability-btn .t-key {
  position: absolute; top: 2px; right: 3px; font-size: 10.5px; font-weight: 800; color: var(--muted); border: 1px solid #46566A; padding: 0 3px; line-height: 1.3; border-radius: 2px;
}
.tower-btn.selected, .ability-btn.aiming { border-color: var(--gold); background: #2A3444; box-shadow: inset 0 0 0 1px var(--gold); }
.tower-btn.poor .t-ico { opacity: .45; }
.tower-btn.poor .t-name { opacity: 1; color: var(--muted); }
.tower-btn.poor .t-cost { color: #9C8F5A; text-decoration: line-through; text-decoration-thickness: 1px; }
.tower-btn.locked { background: #10161E; }
.tower-btn.locked .t-ico { opacity: .25; filter: grayscale(1); }
.tower-btn.locked .t-name, .tower-btn.locked .t-cost { color: #8893A0; }
.tower-btn .t-lock { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tower-btn .t-lock .ico { width: 18px; height: 18px; }
.tower-btn.flash { animation: unlock-flash 1.6s ease 2; }
@keyframes unlock-flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--gold), 0 0 18px var(--gold); background: #2E3A4A; } }
.ability-btn { grid-template-columns: 40px auto; }
.ability-btn .a-flag { position: absolute; left: 3px; bottom: 3px; width: 15px; height: 10px; display: block; z-index: 2; }
/* Vėliava turi atsiskirti ir nuo tamsaus, ir nuo šviesaus fono: šviesus rėmelis tamsiame, tamsus kontūras šviesiame.
   Be jo Vokietijos juoda juosta ant pagalbos mygtuko susiliedavo ir vėliava atrodė kaip Lenkijos (tests/vaizdas.mjs). */
svg.flag, svg.a-flag { box-sizing: content-box; border: 1px solid rgba(255, 255, 255, .9); outline: 1px solid rgba(0, 0, 0, .45); }
.ability-btn .a-state { font-size: 12.5px; color: var(--good); font-weight: 800; font-variant-numeric: tabular-nums; }
.ability-btn .cd-ring { position: absolute; left: 5px; top: 50%; width: 40px; height: 40px; transform: translateY(-50%); border-radius: 50%; pointer-events: none;
  background: conic-gradient(rgba(8, 11, 16, 0.78) calc(var(--cd, 0) * 1%), transparent 0); }
.ability-btn.cooling .a-state { color: var(--muted); }
.ability-btn.unavailable { opacity: .55; }
.ability-btn.ready { border-color: #6F95C0; }
.ability-btn.ready::after { content: ''; position: absolute; inset: -1px; border: 1px solid var(--gold); opacity: 0; animation: ready-glow 2s ease-in-out infinite; pointer-events: none; }
body.reduced-motion .ability-btn.ready::after { animation: none; opacity: .6; }
@keyframes ready-glow { 50% { opacity: .9; } }

.tower-tip {
  position: absolute; bottom: 8px; z-index: 9; width: 290px; background: var(--paper); color: var(--ink); border: 1px solid var(--paper-edge);
  padding: 10px 12px; font-size: 14px; box-shadow: 0 10px 22px -12px rgba(0,0,0,.9); pointer-events: none;
}
.tower-tip h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.tower-tip h3 .flag { width: 21px; height: 14px; display: block; }
.tower-tip .tip-role { margin: 4px 0 6px; }
.tower-tip .tip-vs { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 13px; }
.tower-tip .tip-vs dt { font-weight: 800; display: flex; align-items: center; gap: 4px; }
.tower-tip .tip-vs dt .mk { width: 10px; height: 10px; display: inline-block; }
.tower-tip .tip-vs dt.strong .mk { background: var(--good-ink); border-radius: 50%; }
.tower-tip .tip-vs dt.weak .mk { border: 2px solid var(--danger-ink); background: linear-gradient(45deg, transparent 40%, var(--danger-ink) 40% 60%, transparent 60%); }
.tower-tip .tip-vs dd { margin: 0; }
.tower-tip .tip-fact { margin-top: 6px; font-size: 12.5px; color: var(--ink-soft); border-top: 1px dashed rgba(30,42,68,.3); padding-top: 5px; }
.tower-tip .tip-equiv { margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }
.tip-equiv .flag, .tp-equiv .flag { width: 18px; height: 12px; display: inline-block; vertical-align: -1px; margin-right: 6px; }
.tower-tip .tip-lock { margin-top: 6px; font-weight: 800; color: var(--danger-ink); }

/* ---------- pauzė, rezultatai ---------- */
.overlay-card { padding: clamp(20px, 3vw, 34px); width: min(880px, 100%); max-height: calc(100% - 8px); overflow-y: auto; }
.overlay-card.narrow { width: min(380px, 100%); }
.overlay-card h1 { font-size: clamp(36px, 3.4vw, 48px); line-height: 1.05; }
.pause-stage { color: var(--ink-soft); margin: 4px 0 18px; font-weight: 700; }
.stack { display: grid; gap: 10px; }
.stack .btn { width: 100%; }
.result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.result-stars { display: flex; gap: 6px; color: #B07C00; }
.result-stars .stars { display: flex; gap: 6px; }
.result-stars .star { width: 52px; height: 52px; color: #7A6A48; }
.result-stars .star:not(.on) path { stroke-width: 1.5; }
.result-stars .star.on { color: #C08A00; animation: star-pop .5s var(--ease) backwards; }
.result-stars .star.on:nth-child(2) { animation-delay: .25s; }
.result-stars .star.on:nth-child(3) { animation-delay: .5s; }
body.reduced-motion .result-stars .star.on { animation: none; }
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.2); } }
.result-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; }
.stats { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: 16px; }
.stats dt { padding: 5px 0; border-bottom: 1px dashed rgba(30,42,68,.25); color: var(--ink-soft); }
.stats dd { margin: 0; padding: 5px 0; border-bottom: 1px dashed rgba(30,42,68,.25); text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats dd.big { font-size: 22px; }
.mvp { margin-top: 14px; display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 8px; background: var(--paper-2); }
.mvp:empty { display: none; }
.mvp .m-ico { width: 52px; height: 52px; background: #3A4656; display: grid; place-items: center; }
.mvp .m-ico img, .mvp .m-ico svg { width: 48px; height: 48px; display: block; }
.mvp .m-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.mvp .m-name { font-weight: 800; }
.mvp .m-sub { font-size: 15.5px; color: var(--ink-soft); }
.outro { font-size: 16.5px; line-height: 1.5; }
.regime-drop { margin-top: 14px; display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; background: #1B1D20; color: #D5D9DF; padding: 10px 12px; }
.regime-drop:empty { display: none; }
.regime-drop svg { width: 74px; height: 74px; display: block; }
.regime-drop .rd-name { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #AEB4BC; font-weight: 800; }
.regime-drop .rd-gear { font-weight: 800; font-size: 16px; }
.regime-drop .meter-row b { color: #F2F5F8; }
.gear-stop { animation: gear-stop 2.4s cubic-bezier(.1,.6,.3,1) forwards; transform-box: fill-box; transform-origin: center; }
@keyframes gear-stop { from { transform: rotate(0deg); } to { transform: rotate(200deg); } }
.gear-jam { opacity: 0; animation: jam-in .4s 2.2s forwards; }
@keyframes jam-in { to { opacity: 1; } }
.gear-body { transition: fill 1s 2s; }
body.reduced-motion .gear-stop { animation: none; }
body.reduced-motion .gear-jam { animation: none; opacity: 1; }
/* tas pats ėjimas kitur: tikros poros iš Lietuvos, Ukrainos ir kaimynų istorijos */
.equiv { margin-top: 16px; background: var(--paper-2); padding: 12px 14px; }
.equiv .eq-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.equiv .eq-lead { font-weight: 700; margin-bottom: 6px; }
.eq-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.eq-rows li { display: grid; grid-template-columns: 8.2em minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15.5px; line-height: 1.4; }
.eq-where { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.eq-where > span { display: block; flex: none; }
.eq-where .flag { width: 21px; height: 14px; display: block; }
@media (max-width: 560px) { .eq-rows li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.result-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.defeat-line { font-size: 18px; font-weight: 700; margin-bottom: 14px; color: var(--danger-ink); }
.leak-report { background: var(--paper-2); padding: 12px 14px; }
.leak-report .lr-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.leak-report .lr-row { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; margin: 6px 0; }
.leak-report .lr-row img, .leak-report .lr-row svg { width: 48px; height: 48px; display: block; background: #3A4656; }
.leak-report .lr-name { font-weight: 800; }
.leak-report .lr-advice { margin-top: 6px; font-weight: 700; display: flex; gap: 8px; align-items: flex-start; }
.leak-report .lr-advice .ico { color: #9A6B00; margin-top: 2px; }
.defeat-diff { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- finalas ---------- */
#screen-finale { background: #04060A; flex-direction: column; align-items: center; justify-content: flex-start; z-index: 10; }
#finale-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.finale-label {
  position: relative; z-index: 2; margin-top: 18px; font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #E9E2C9; border: 1px solid rgba(233, 226, 201, .45); padding: 4px 12px; background: rgba(0,0,0,.6);
}
.finale-text { position: relative; z-index: 2; margin-top: auto; margin-bottom: 2vh; width: min(760px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; text-align: left; background: rgba(12, 17, 24, 0.78); border: 1px solid rgba(233, 226, 201, .25); padding: 16px 22px; }
.finale-text p { font-size: clamp(16px, 1.7vw, 21px); color: #FFFDF5; display: none; }
.finale-text p.shown { display: block; animation: fin-in 1.4s ease; }
.finale-text:not(:has(p.shown)) { visibility: hidden; }
@keyframes fin-in { from { opacity: 0; } }
.finale-text .salute { font-size: clamp(24px, 3vw, 36px); font-weight: 800; color: var(--gold); }
.finale-text .thanks { font-size: 17px; }
/* palyginimo lentelė: Suomija ir Baltijos šalys */
.finale-text { max-height: calc(100vh - 120px); overflow-y: auto; background: rgba(12, 16, 22, 0.92) !important; }
.finale-text .cmp-wrap { display: none; overflow-x: auto; }
/* slenkančiame flex stulpelyje vaikas su overflow kitaip susitraukia iki 0 ir lentelė dingsta */
.finale-text > * { flex-shrink: 0; }
.finale-text .cmp-wrap.shown { display: block; animation: fin-in 1.4s ease; }
.cmp { border-collapse: collapse; width: 100%; font-size: 14.5px; color: #FFFDF5; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid rgba(233, 226, 201, .22); }
.cmp tr:first-child th { color: var(--gold); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.cmp th[scope=row] { color: #cfd6dc; font-weight: 700; white-space: nowrap; }
.finale-text .context { font-size: 15.5px; color: #E8E4D6; }
.finale-text .lesson { font-weight: 800; color: #FFFDF5; border-left: 4px solid var(--gold); padding-left: 12px; }
.finale-text .scn-head b { color: var(--gold); }
.cmp.scn th[scope=row] { white-space: normal; min-width: 7.5em; }
/* siauras ekranas: keturi stulpeliai netelpa – kiekviena eilutė tampa kortele, šalis ar antraštė – virš reikšmės */
@media (max-width: 560px) {
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; width: auto; }
  .cmp tr:first-child { display: none; }
  .cmp tr { padding: 6px 0 8px; border-bottom: 1px solid rgba(233, 226, 201, .22); }
  .cmp th, .cmp td { border-bottom: 0; padding: 2px 4px; }
  .cmp th[scope=row], .cmp.scn th[scope=row] { white-space: normal; min-width: 0; font-size: 15.5px; color: #FFFDF5; }
  .cmp td::before { content: attr(data-label); display: block; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  .cmp td[data-label='']::before { content: none; }
}
.finale-btn { position: relative; z-index: 2; margin-bottom: 3vh; background: rgba(12, 17, 24, .85); }

/* ---------- nustatymai ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(6, 9, 14, 0.7); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(420px, 100%); padding: 18px 22px 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-head h2 { font-size: 24px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(30,42,68,.25); font-weight: 700; font-size: 17px; cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-note { margin: 6px 0 4px 34px; font-size: 14px; line-height: 1.4; opacity: .8; }
.set-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.set-range { justify-content: space-between; }
.set-range input { width: 55%; accent-color: var(--ink); }
.noscript { padding: 24px; }

/* ---------- prisitaikymas ----------
   Apatinė juosta: fit-1 – gebėjimų pavadinimai paslepiami, tarpai siauresni; fit-2 – ginklų trumpi
   pavadinimai mažesniu šriftu, gebėjimai – ikona su sekundėmis ant jos; fit-3 – vien ikonos (siauras langas). */
.hud-bottom.fit-1 .ability-btn .t-name { display: none; }
.hud-bottom.fit-1 .tower-bar, .hud-bottom.fit-1 .ability-bar { gap: 4px; }
.hud-bottom.fit-1 .tower-btn, .hud-bottom.fit-1 .ability-btn { column-gap: 5px; padding-right: 17px; }

.hud-bottom.fit-2 .tower-btn { grid-template-columns: 30px auto; column-gap: 4px; padding: 3px 18px 3px 4px; min-height: 46px; }
.hud-bottom.fit-2 .tower-btn .t-ico, .hud-bottom.fit-2 .tower-btn .t-ico img, .hud-bottom.fit-2 .tower-btn .t-ico svg { width: 30px; height: 30px; }
.hud-bottom.fit-2 .tower-btn .t-name { font-size: 11.5px; }
.hud-bottom.fit-2 .tower-btn .t-cost { font-size: 13px; }
.hud-bottom.fit-2 .tower-btn .t-key, .hud-bottom.fit-2 .ability-btn .t-key { font-size: 9.5px; top: 1px; right: 2px; }
.hud-bottom.fit-2 .tower-btn .t-lock { left: 10px; }
/* gebėjimas: viršuje juostelė vėliavėlei ir klavišui, po ja ikona; atsikrovimo sekundės – ant ikonos */
.hud-bottom.fit-2 .ability-btn { grid-template-columns: 30px; grid-template-rows: auto; padding: 15px 6px 3px; justify-items: center; align-content: start; min-height: 0; }
.hud-bottom.fit-2 .ability-btn .t-ico { grid-row: 1; }
.hud-bottom.fit-2 .ability-btn .t-ico, .hud-bottom.fit-2 .ability-btn .t-ico img, .hud-bottom.fit-2 .ability-btn .t-ico svg { width: 30px; height: 30px; }
.hud-bottom.fit-2 .ability-btn .a-flag { bottom: auto; top: 3px; left: 3px; }
.hud-bottom.fit-2 .ability-btn .cd-ring { top: 15px; transform: none; width: 30px; height: 30px; left: 50%; margin-left: -15px; }
.hud-bottom.fit-2 .ability-btn .a-state {
  position: absolute; left: 0; right: 0; top: 15px; height: 30px; display: grid; place-items: center; z-index: 1;
  font-size: 12.5px; color: var(--text); text-shadow: 0 0 3px #000, 0 1px 2px #000; white-space: nowrap; pointer-events: none;
}
.hud-bottom.fit-2 .ability-btn:not(.cooling) .a-state, .hud-bottom.fit-2 .ability-btn.used .a-state { display: none; }

.hud-bottom.fit-3 .tower-btn .t-name { display: none; }
.hud-bottom.fit-3 .tower-btn { grid-template-columns: 30px; grid-template-rows: auto auto; padding: 15px 5px 3px; justify-items: center; align-content: start; min-height: 0; }
.hud-bottom.fit-3 .tower-btn .t-ico { grid-row: 1; }
.hud-bottom.fit-3 .tower-btn .t-cost { font-size: 12.5px; }
.hud-bottom.fit-3 .tower-btn .t-lock { left: 50%; top: 21px; transform: translateX(-50%); }
.btn-wave .ico { display: none; width: 16px; height: 16px; }

@media (max-width: 1240px) {
  .tower-btn .t-name, .ability-btn .t-name { font-size: 12.5px; }
  .hud-wave { min-width: 120px; }
}
@media (max-width: 1100px) {
  .tower-btn, .ability-btn { grid-template-columns: 36px auto; }
  .tower-btn .t-ico, .ability-btn .t-ico, .tower-btn .t-ico img, .tower-btn .t-ico svg, .ability-btn .t-ico img, .ability-btn .t-ico svg { width: 36px; height: 36px; }
  .ability-btn .cd-ring { width: 36px; height: 36px; }
  .hud-next .long { display: none; }
  .hud-stat { font-size: 19px; padding: 2px 6px; }
  .campaign-grid { grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr); }
}
@media (max-width: 900px) {
  .hud-top { gap: 6px; padding: 5px 6px; }
  .hud-time { display: none; }
  .hud-wave { min-width: 96px; padding: 0 6px; }
  .hud-wave .lbl { display: none; }
  .btn-wave .lbl { display: none; }
  .btn-wave { display: inline-flex; align-items: center; gap: 4px; }
  .btn-wave .ico { display: block; }
  .btn-wave { padding: 6px 9px; }
  .icon-btn { width: 34px; height: 34px; }
  .hud-btns { gap: 4px; }
  .start-grid, .brief-grid, .campaign-grid, .result-body { grid-template-columns: minmax(0, 1fr); }
  .result-stars .star { width: 40px; height: 40px; }
  .brief-meta { padding-right: 0; margin-top: 34px; }
}
@media (max-height: 680px) {
  .hud-top { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
  .hud-stat { font-size: 18px; }
  .title-card h1 { font-size: clamp(40px, 5vw, 56px); }
  /* ginklo skydelis su šakomis turi tilpti į žemą langą */
  .tower-panel { padding: 7px 10px 8px; }
  .tower-panel .tp-fact, .tower-panel .tp-equiv { display: none; }
  .tower-panel .tp-head { margin-bottom: 2px; }
  .tower-panel .tp-row { margin: 2px 0; }
  .tower-panel .tp-vetbar { margin: 1px 0 4px; }
  .tower-panel .tp-stats { margin: 2px 0 3px; }
  .tower-panel .tp-stats td { padding: 1px 0; }
  .tower-panel .tp-btn { padding: 6px 10px; margin-top: 3px; }
  .tower-panel .branch-wrap { margin-top: 3px; gap: 5px; }
  .tower-panel .branch-btn { padding: 5px 7px; gap: 2px; }
  .tower-panel .branch-btn .b-desc { font-size: 12px; line-height: 1.2; }
  .tower-panel .tp-target { margin-top: 5px; }
  .tower-panel .tp-sell { margin-top: 5px; padding: 4px 10px; }
}
/* mažas langas: radijas siauresnis, tik paskutinė žinutė; bangos skelbimas žemiau patarimo */
@media (max-width: 1100px), (max-height: 680px) {
  .radio { max-width: min(320px, 38%); }
  .radio-msg:not(:last-child) { display: none; }
  .radio-msg .r-text { font-size: 14px; }
  .announce { top: 30%; }
}
/* kampanija žemame lange: Baltijos pagalbos sąrašas turi tilpti be slinkimo */
@media (max-height: 820px) {
  #screen-campaign { padding-top: 18px; padding-bottom: 16px; }
  .campaign-head { margin-bottom: 10px; }
  .side-col { gap: 12px; }
  .machine-card { padding: 10px 14px 12px; }
  .machine-svg { max-height: 190px; margin: 2px 0; }
  .meter { margin-top: 6px; }
  .aid-card { padding: 12px 16px; }
  .aid-card h2 { margin-bottom: 4px; }
  .aid-list li { padding: 1px 0; }
}
/* siauras langas (telefonas): viršutinė juosta – dviem eilėmis, apatinė – ginklai ir gebėjimai atskirai */
@media (max-width: 560px) {
  .hud-top { flex-wrap: wrap; gap: 4px; padding: 4px 6px; min-height: 0; max-width: 100%; overflow-x: clip; }
  #hud-next, .hud-spacer { display: none; }
  .hud-stat { font-size: 17px; padding: 2px 5px; gap: 4px; }
  .hud-stat .hud-ico .ico { width: 18px; height: 18px; }
  #hud-money .v { min-width: 0; }
  .hud-wave { min-width: 0; flex: 1 1 64px; padding: 0 5px; }
  .hud-wave .v { font-size: 12px; }
  .hud-wave .v b { font-size: 15px; }
  .wave-bar i { min-width: 2px; }
  .btn-wave { min-height: 34px; padding: 5px 8px; }
  .hud-btns { margin-left: auto; }
  .hud-bottom { flex-wrap: wrap; row-gap: 5px; padding: 5px 6px; }
  .ability-bar { padding-left: 0; border-left: 0; }
  .radio { max-width: calc(100% - 20px); }
  .prep-banner { top: 8px; gap: 8px; padding-left: 10px; }
  .prep-text { font-size: 15px; }
  .hint { top: 52px; font-size: 15px; }
  /* juosta užima beveik visą plotį: kol ji rodoma, prognozė (iki dviejų eilučių) ir patarimas – po ja */
  .prep-banner:not([hidden]) ~ .forecast { top: 62px; }
  .prep-banner:not([hidden]) ~ .hint { top: 132px; }
}
/* statmenas telefono langas: trumpas, nestabdantis patarimas pasukti ekraną */
.rotate-tip { display: none; }
@media (orientation: portrait) and (max-width: 900px), (max-width: 480px) {
  .rotate-tip {
    display: flex; align-items: center; gap: 8px; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
    z-index: 6; pointer-events: none; white-space: nowrap; padding: 6px 12px; font-weight: 700; font-size: 15px;
    background: var(--hud); color: var(--text); border: 1px solid var(--hud-edge);
    animation: rotate-tip 8s linear forwards;
  }
  .rotate-tip .ico { width: 18px; height: 18px; color: var(--gold); }
}
@keyframes rotate-tip { 0%, 88% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ---- audito pataisos ---- */
.brief-epigraph {
  margin: 0.2rem 0 1rem; padding-left: 0.9rem; border-left: 2px solid var(--ink);
  font-size: 16px; line-height: 1.45; color: color-mix(in srgb, var(--ink) 80%, transparent);
}
#hud-money.gain .v { animation: money-gain 0.6s ease-out; }
@keyframes money-gain { 0% { color: #FFE7A3; text-shadow: 0 0 10px rgba(255, 199, 44, 0.9); } 100% { color: var(--gold); text-shadow: none; } }
@media (prefers-reduced-motion: reduce) { #hud-money.gain .v { animation: none; color: #FFE7A3; } }
.hud-next .relax { color: var(--info); font-weight: 800; }
.tower-btn.locked.poor .t-cost { text-decoration: none; color: var(--muted); }
#btn-start-now:disabled { opacity: 0.55; cursor: default; }
body.reduced-motion #hud-money.gain .v { animation: none; color: #FFE7A3; }

/* ---------- 1.1: išsaugojimas, žvalgyba, žinynas, prognozė ---------- */
.start-actions { flex-wrap: wrap; }
#btn-continue { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
#btn-continue[hidden] { display: none; }
.cont-sub { font-size: 13px; font-weight: 700; opacity: .85; }
/* „Nauja partija“ šalia „Tęsti“ – ant tamsaus žemėlapio, todėl šviesus kontūras ir tamsus pagrindas */
.btn-new { color: var(--paper); border-color: rgba(242, 236, 220, .8); background: rgba(12, 17, 24, .72); }
.btn-new:hover { background: rgba(12, 17, 24, .9); border-color: var(--paper); }
.run-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--paper); color: var(--ink); border: 1px solid var(--paper-edge); padding: 8px 10px 8px 16px; margin-bottom: 16px;
}
.run-strip[hidden] { display: none; }
.run-text { font-weight: 800; font-size: 16px; }
.run-strip .btn { min-height: 40px; padding: 6px 20px; }

/* pauzė – žemėlapis lieka matomas ir paspaudžiamas; juosta apačioje, kad neuždengtų įėjimų kraštuose */
#screen-pause.screen.overlay { z-index: 7; background: rgba(8, 12, 18, 0.12); pointer-events: none; align-items: flex-end; justify-content: center; padding: 10px; }
.pause-dock {
  pointer-events: auto; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; justify-content: center;
  padding: 8px 10px 8px 16px; max-width: 100%; box-shadow: 0 14px 30px -14px rgba(0,0,0,.9);
}
.pd-info { display: grid; grid-template-columns: auto; line-height: 1.2; }
.pause-dock h1 { font-size: 22px; line-height: 1.05; }
.pause-dock .pause-stage { margin: 1px 0 0; font-size: 13.5px; }
.pause-saved { font-size: 12.5px; color: var(--ink-soft); margin: 1px 0 0; display: flex; gap: 6px; align-items: center; }
.pause-saved::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good-ink); flex: none; }
.pd-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pause-dock .btn { min-height: 40px; padding: 6px 14px; font-size: 15.5px; }
.pause-dock #btn-resume { padding: 6px 26px; }
.inspect-card {
  position: absolute; z-index: 9; width: 290px; pointer-events: none; display: flex; gap: 10px; align-items: flex-start;
  background: var(--paper); color: var(--ink); border: 1px solid var(--paper-edge); padding: 8px 10px; font-size: 13.5px; line-height: 1.3;
  box-shadow: 0 10px 22px -12px rgba(0,0,0,.9);
}
.inspect-card b { font-size: 15px; }
.inspect-card .ic-ico img { width: 44px; height: 44px; display: block; }
.inspect-card .ic-row { color: var(--ink-soft); }
.inspect-card .ic-best { font-weight: 800; color: var(--good-ink); }

/* artimiausių bangų prognozė */
.forecast {
  position: absolute; left: 10px; top: 10px; z-index: 5; pointer-events: none; display: grid; gap: 3px;
  background: var(--hud); border: 1px solid var(--hud-edge); padding: 5px 8px; color: var(--text); font-size: 13px; max-width: calc(50% - 20px);
}
.forecast[hidden], .forecast:empty { display: none; }
.forecast.all { max-width: min(560px, calc(100% - 20px)); }
.fc-row, .cx-waves li { display: flex; align-items: center; gap: 4px 6px; min-height: 30px; flex-wrap: wrap; }
.fc-w { font-weight: 800; color: var(--gold); min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.fc-when { color: var(--muted); min-width: 6.5ch; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fc-gs { display: flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.fc-g { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; }
.fc-g img, .fc-g svg { width: 26px; height: 26px; display: block; }
.fc-g b { font-weight: 800; }
.fc-route { font-style: normal; font-size: 11px; font-weight: 800; margin-left: 3px; padding: 0 4px; border: 1px solid var(--gold); color: var(--gold); line-height: 15px; }
.fc-g.air .fc-route { border-color: var(--info); color: var(--info); border-radius: 8px; }
.fc-row.air .fc-g.air .fc-route { border-color: var(--danger); color: var(--danger); }
.fc-air { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--hud-solid); background: var(--danger); padding: 1px 7px 1px 5px; white-space: nowrap; font-size: 12.5px; }
.fc-air .ico { width: 14px; height: 14px; }
.fc-row.boss .fc-w::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 3px; transform: rotate(45deg); background: var(--danger); vertical-align: 2px; }
@media (max-width: 900px), (max-height: 600px) {
  .forecast:not(.all) .fc-row + .fc-row { display: none; }
  .forecast .fc-air { font-size: 0; padding: 2px 4px; gap: 0; }
}
@media (max-width: 560px) { .pd-info { display: none; } .pause-dock .btn { font-size: 14px; padding: 5px 10px; } }

/* rinkliavos atsipirkimas */
.tip-pay, .tp-pay { font-size: 13px; font-weight: 700; margin: 6px 0 2px; padding-left: 8px; border-left: 3px solid var(--good-ink); }
.tip-pay.bad, .tp-pay.bad { border-left-color: var(--danger-ink); }
.tp-pay { color: var(--text); border-left-color: var(--good); }
.tp-pay.bad { color: #FFB3A8; border-left-color: var(--danger); }

/* nustatymai: išsaugojimas */
.set-h { font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 14px 0 8px; }
.set-save { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.set-save .btn { font-size: 15px; padding: 7px 10px; min-height: 42px; display: grid; place-items: center; text-align: center; cursor: pointer; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.set-msg { font-size: 14px; font-weight: 700; color: var(--good-ink); margin: 6px 0 0; min-height: 1em; }
.set-msg:empty { display: none; }
.set-msg.bad { color: var(--danger-ink); }
.backup-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
.backup-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; border-top: 1px dashed rgba(30,42,68,.25); padding-top: 6px; }
.backup-list small { color: var(--ink-soft); }
.btn-small { min-height: 34px; padding: 4px 12px; font-size: 14px; }

/* žinynas */
.codex-card { width: min(1040px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.codex-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--ink); margin-bottom: 10px; }
.codex-tab { border: 0; background: transparent; color: var(--ink-soft); font-weight: 800; font-size: 16px; padding: 8px 16px; border-bottom: 4px solid transparent; margin-bottom: -2px; cursor: pointer; }
.codex-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.codex-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; padding-right: 4px; }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cx-card { border: 1px solid var(--paper-edge); background: rgba(255,255,255,.28); padding: 10px 12px; font-size: 14px; }
.cx-card.locked { opacity: .62; }
.cx-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.cx-ico img, .cx-ico svg { width: 52px; height: 52px; display: block; background: #273342; }
.cx-name { font-size: 16px; }
.cx-flags { display: inline-flex; gap: 3px; vertical-align: -2px; }
.cx-flags .flag { width: 18px; height: 12px; display: block; }
.cx-role { color: var(--ink-soft); font-size: 13.5px; }
.cx-lock { font-weight: 800; color: var(--danger-ink); font-size: 13px; }
.cx-boss { font-size: 11px; font-weight: 800; text-transform: uppercase; color: #fff; background: var(--stamp); padding: 1px 5px; }
.cx-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 4px 0; }
.cx-table th, .cx-table td { text-align: right; padding: 2px 4px; border-bottom: 1px dashed rgba(30,42,68,.2); }
.cx-table th:first-child { text-align: left; font-weight: 700; color: var(--ink-soft); }
.cx-table thead th { font-size: 12px; color: var(--ink-soft); }
.cx-vs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: 6px 0; }
.cx-m { display: grid; text-align: center; padding: 3px 2px; font-size: 13px; border: 1px solid rgba(30,42,68,.2); }
.cx-m small { font-size: 10.5px; line-height: 1.1; color: var(--ink-soft); min-height: 2.2em; }
.cx-m.good { background: rgba(0,106,68,.16); }
.cx-m.bad { background: rgba(163,38,26,.14); }
.cx-m.no { color: #8A8170; }
.cx-pay { font-size: 13px; margin: 6px 0; padding-left: 8px; border-left: 3px solid var(--good-ink); }
.cx-branches { margin: 6px 0 0; padding-left: 16px; font-size: 13px; display: grid; gap: 4px; }
.cx-dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 4px 0; }
.cx-dl dt { color: var(--ink-soft); }
.cx-dl dd { margin: 0; font-weight: 700; }
.cx-best { font-weight: 800; color: var(--good-ink); margin-top: 4px; }
.cx-waves { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cx-waves li { border-bottom: 1px dashed rgba(30,42,68,.2); padding: 3px 0; }
.cx-waves li.done { opacity: .45; }
.cx-waves .fc-w { color: var(--ink); }
.cx-waves .fc-route { color: var(--ink); border-color: var(--ink); }
.cx-waves .fc-g.air .fc-route { color: var(--accent); border-color: var(--accent); }
.cx-waves .fc-g img { background: #273342; }

/* ---- telefonas gulsčiai: žemėlapis per visą aukštį, būsena kairėje, ginklai dešinėje ---- */
@media (orientation: landscape) and (max-height: 500px) {
  /* tik aktyvus: be .active ID taisyklė nugali .screen { display: none } ir mūšio ekranas uždengia meniu */
  #screen-game.active { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); }
  #screen-game > .hud-top {
    grid-column: 1; grid-row: 1; flex-direction: column; align-items: stretch; gap: 5px; min-height: 0; overflow-y: auto;
    border-bottom-width: 0; border-right-width: 2px; padding: 6px 4px; padding-left: max(4px, env(safe-area-inset-left));
  }
  #screen-game > .stage-wrap { grid-column: 2; grid-row: 1; }
  #screen-game > .hud-bottom {
    grid-column: 3; grid-row: 1; flex-direction: column; align-items: stretch; gap: 6px; overflow-y: auto; min-height: 0;
    border-top-width: 0; border-left-width: 2px; padding: 5px 4px; padding-right: max(4px, env(safe-area-inset-right));
  }
  .hud-top .hud-stat { font-size: 16px; padding: 1px 2px; gap: 4px; border-right: 0; justify-content: flex-start; }
  .hud-top .hud-stat .hud-ico .ico { width: 16px; height: 16px; }
  #hud-money .v { min-width: 0; }
  .hud-top .hud-wave { min-width: 0; padding: 0; border-right: 0; flex: none; }
  .hud-top .hud-wave .v { font-size: 11px; }
  .hud-top .hud-wave .v b { font-size: 14px; }
  .hud-top .wave-bar { gap: 1px; height: 11px; }
  .hud-top .wave-bar i { min-width: 1px; }
  .hud-time, .hud-spacer, #hud-next { display: none; }
  .hud-top .btn-wave { justify-content: center; padding: 4px 2px; min-height: 36px; font-size: 13px; }
  .hud-top .hud-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: auto; justify-items: center; }
  .hud-top .icon-btn { width: 32px; height: 32px; }
  .tower-bar, .ability-bar { display: grid; grid-template-columns: repeat(2, 48px); gap: 4px; flex: none; }
  .ability-bar { padding: 6px 0 0; border-left: 0; border-top: 1px solid var(--hud-edge); }
  .hud-bottom .tower-btn, .hud-bottom .ability-btn {
    grid-template-columns: 30px; grid-template-rows: auto auto; padding: 14px 2px 3px; justify-items: center; align-content: start; min-height: 0;
  }
  .hud-bottom .tower-btn .t-name, .hud-bottom .ability-btn .t-name { display: none; }
  .hud-bottom .tower-btn .t-ico, .hud-bottom .ability-btn .t-ico { grid-row: 1; }
  .hud-bottom .tower-btn .t-ico, .hud-bottom .tower-btn .t-ico img, .hud-bottom .tower-btn .t-ico svg,
  .hud-bottom .ability-btn .t-ico, .hud-bottom .ability-btn .t-ico img, .hud-bottom .ability-btn .t-ico svg { width: 30px; height: 30px; }
  .hud-bottom .tower-btn .t-cost { font-size: 12.5px; }
  .hud-bottom .tower-btn .t-lock { left: 50%; top: 20px; transform: translateX(-50%); }
  .hud-bottom .ability-btn .a-flag { bottom: auto; top: 3px; left: 3px; }
  .hud-bottom .ability-btn .cd-ring { top: 14px; transform: none; width: 30px; height: 30px; left: 50%; margin-left: -15px; }
  .hud-bottom .ability-btn .a-state { font-size: 11px; }
  .tower-btn .t-key, .ability-btn .t-key { display: none; }
  /* pasiruošimo juosta – dešinėje, kad neuždengtų kairėje esančios bangų prognozės */
  .prep-banner { top: 6px; left: auto; right: 8px; transform: none; gap: 6px; padding: 4px 6px 4px 10px; }
  .prep-text { font-size: 14px; }
  .forecast { transform: scale(.85); transform-origin: top left; }
  .hint { top: 46px; font-size: 14px; max-width: 70%; }
  .radio { max-width: min(300px, 46%); }
  .announce { font-size: 26px; }
}
/* siauras telefonas: sudėtingumo kortelėje skaičiai po aprašymu, ne siauru stulpeliu šalia */
@media (max-width: 560px) {
  .start-diffs .diff-btn, #start-diffs .diff-btn { grid-template-columns: minmax(0, 1fr); }
  #start-diffs .diff-btn .d-nums { grid-column: 1; grid-row: auto; margin-top: 6px; }
}
/* lietimo ekrane etapo taškas žemėlapyje turi didesnį nematomą paspaudimo plotą – po visais smeigtukais (z 3);
   tarp zonų pirmenybė einamajam etapui, užrakintas zonos neturi: į bakstelėjimą jis neatsako ir tik užstotų kaimyną */
@media (pointer: coarse) {
  .stage-node::after { content: ''; position: absolute; inset: -11px; z-index: 1; }
  .stage-node.current::after { z-index: 2; }
  .stage-node.locked::after { content: none; }
}

.edition-upgrade{display:flex;flex-direction:column;gap:4px;background:#2d4c3c;color:#f6f2df;padding:13px 17px;margin:0 0 20px;text-decoration:none;font-size:16px;font-weight:750;border-radius:4px}.edition-upgrade span{font-size:11px;color:#e4cb85;font-weight:400}.edition-upgrade:hover{background:#426348}.edition-upgrade:focus-visible{outline:3px solid #a76a37;outline-offset:3px}

/* Testuotojų įrankiai (js/testuotojai.js): pranešimas apie klaidą pauzėje ir vienas klausimas po partijos */
.bug-form { display: grid; gap: 8px; margin-top: 14px; }
.bug-form[hidden], .fb-row[hidden] { display: none; }
.bug-form label { font-size: 14px; line-height: 1.4; }
.bug-form textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.4; padding: 8px 10px; border: 1px solid rgba(30, 42, 68, .45); border-radius: 2px; background: #FFFDF6; color: var(--ink); resize: vertical; }
.bug-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bug-state { font-size: 14px; font-weight: 700; }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.fb-row p { margin: 0; font-weight: 700; flex-basis: 100%; }
.fb-row .btn { min-height: 44px; }


/* ---------- Kauno pilies gynyba ---------- */
/* Režimas akims: šiltesnė, mažesnio kontrasto paletė be baltų plotų, šriftas ×1,15, jokių animacijų ir drebėjimo.
   Įjungiamas vienu paspaudimu (.eyes-btn) bet kuriame ekrane; klasė html.akims dedama dar prieš pirmą piešimą (index.html). */
html.akims {
  --paper: #DCCFB2; --paper-2: #D1C3A2; --paper-edge: #B3A27E; --ink: #2E2A24; --ink-soft: #4A4337;
  --table: #2B2722; --table-2: #36302A; --hud: rgba(43, 39, 34, .96); --hud-solid: #2B2722; --hud-edge: #5E554A;
  --text: #E4D9C4; --muted: #BDB19A; --gold: #E2B24E; --danger: #D98A6E; --good: #8FB884; --info: #A9B7C4;
  font-size: 115%;
}
html.akims body { background: #2B2722; }
html.akims *, html.akims *::before, html.akims *::after { animation: none !important; transition: none !important; }
html.akims #bg-shade { background: rgba(43, 39, 34, .55); }
.eyes-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 4px;
  border: 1px solid var(--paper-edge); background: var(--table); color: var(--text); font: inherit; font-weight: 750; cursor: pointer; }
.eyes-btn svg { width: 20px; height: 20px; flex: none; }
.eyes-btn[aria-pressed="true"] { background: var(--gold); color: #2A241A; border-color: var(--gold); }
.eyes-corner { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 200; }
body[data-screen="screen-victory"] .hud-btns .eyes-btn, body[data-screen="screen-defeat"] .hud-btns .eyes-btn { visibility: hidden; }
body[data-screen="screen-game"] .eyes-corner, body[data-screen="screen-pause"] .eyes-corner, body[data-screen="screen-campaign"] .eyes-corner { display: none; }
.hud-btns .eyes-btn { min-height: 40px; padding: 0 10px; }
@media (max-width: 720px) { .eyes-btn .lbl { display: none; } .eyes-btn { padding: 0 10px; } }

/* Linijos skydelis: sienos atkarpos ir jų būklė; bakstelėjus – taisoma */
.line-panel { position: absolute; right: 10px; top: 10px; width: 230px; background: var(--hud); border: 1px solid var(--hud-edge); border-radius: 4px;
  padding: 8px 10px; color: var(--text); font-size: 13px; z-index: 6; }
.line-panel h4 { margin: 4px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.line-panel .seg-row { display: grid; grid-template-columns: 1fr 64px; gap: 8px; align-items: center; width: 100%; min-height: 26px; padding: 2px 4px;
  background: none; border: 0; border-radius: 3px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.line-panel .seg-row:hover, .line-panel .seg-row:focus-visible { background: rgba(255, 255, 255, .08); }
.line-panel .seg-row.crit { color: var(--danger); font-weight: 800; }
.line-panel .seg-row.gone { color: var(--muted); cursor: default; text-decoration: line-through; }
.line-panel .bar { height: 8px; background: #3a3936; border-radius: 1px; overflow: hidden; }
.line-panel .bar i { display: block; height: 100%; background: var(--gold); }
.line-panel .bar.warn i { background: #F08A2C; }
.line-panel .bar.crit i { background: #E33B2E; }
.line-panel .lp-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
@media (orientation: landscape) and (max-height: 500px) {
  .line-panel { top: auto; bottom: 6px; right: 6px; width: 180px; padding: 4px 6px; font-size: 11px; }
  .line-panel .seg-row:not(.crit):not(.warn), .line-panel h4, .line-panel .lp-note { display: none; }
}
@media (orientation: portrait) and (max-width: 700px) {
  .line-panel { top: auto; bottom: 6px; right: 6px; width: 170px; font-size: 11px; }
  .line-panel .seg-row:not(.crit):not(.warn), .line-panel h4, .line-panel .lp-note { display: none; }
}
.days-meter { display: grid; grid-template-columns: repeat(19, 1fr); gap: 2px; margin: 8px 0 6px; }
.days-meter i { height: 16px; background: #3b3a36; border-radius: 1px; }
.days-meter i.held { background: var(--gold); }
.days-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.days-legend b { color: var(--text); font-size: 19px; }

.fin-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; opacity: 0; transition: opacity .8s; }
.fin-cmp.shown { opacity: 1; }
.fin-cmp > div { border: 1px solid rgba(255, 255, 255, .25); padding: 10px 12px; }
.fin-cmp small { display: block; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
.fin-cmp b { display: block; font-size: 30px; color: var(--gold); }
.fin-timeline { list-style: none; margin: 12px 0; padding: 0 0 0 4px; border-left: 3px solid var(--gold); opacity: 0; transition: opacity .8s; }
.fin-timeline.shown { opacity: 1; }
.fin-timeline li { padding: 5px 0 5px 14px; line-height: 1.45; }
.fin-timeline b { color: var(--gold); margin-right: 6px; }
@media (max-width: 560px) { .fin-cmp { grid-template-columns: 1fr; } }
html.akims .finale-text p { color: var(--text); }
/* Gulsčias telefonas: šiame etape nepasiekiami ginklai neužima vietos, gebėjimo būsena – tik atvėsimo juosta */
@media (orientation: landscape) and (max-height: 500px) {
  .tower-btn.locked { display: none; }
  .ability-btn .a-state { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) { .hud-btns .eyes-btn .lbl { display: none; } .hud-top .hud-btns .eyes-btn { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; justify-content: center; } }
