/* Warszawa Mikiego — poznaj swoje miasto.
 * Kolory: czerwień i żółć z flagi Warszawy oraz granat tabliczek z nazwami ulic.
 * Motyw przewodni: tabliczka — czerwony pasek z opisem nad granatowym polem z nazwą.
 */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/Barlow-Regular.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/Barlow-Medium.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/Barlow-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("../fonts/Barlow-Bold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/BarlowSemiCondensed-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/BarlowSemiCondensed-Bold.ttf") format("truetype"); }

:root {
  --red: #d71920;
  --red-deep: #b01218;
  --yellow: #ffd21f;
  --navy: #16306b;
  --navy-deep: #0e1f47;
  --ink: #0e1f47;
  --ink-soft: #57637f;
  --ground: #e6eaf1;
  --city: #ffffff;
  --water: #7ab2e8;
  --water-edge: #3f82c9;
  --panel: #ffffff;
  --line: #d3dae6;
  --ok: #1c8b57;
  --sign: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-plate: 6px;
  --r-ui: 8px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  font-family: var(--text);
  font-size: 16px;
  color: var(--ink);
  background: var(--ground);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 2px var(--navy-deep); }

/* flaga Warszawy: czerwony pas nad żółtym */
.flag {
  flex: none;
  height: calc(6px + env(safe-area-inset-top));
  background: linear-gradient(var(--red) 0 calc(100% - 3px), var(--yellow) calc(100% - 3px));
}

body[data-screen="home"] .game { display: none; }
body[data-screen="game"] .home { display: none; }

/* ---------- tabliczka ---------- */
.plate {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--r-plate);
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  text-align: left;
}
.plate-band {
  display: block;
  padding: 3px 12px 4px;
  background: var(--red);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plate-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 9px;
  min-height: 46px;
}
.plate-body b {
  font-family: var(--sign);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .1px;
}
.plate-art { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; }
.plate-art:empty { display: none; }
.thumb { fill: rgba(255,255,255,.2); stroke: #fff; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

/* ---------- ekran startowy ---------- */
.home { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.home-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(28px, 7vh, 72px) 20px calc(28px + env(safe-area-inset-bottom));
}
.home h1 {
  margin: 0;
  font-family: var(--sign);
  font-size: clamp(48px, 11vw, 100px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -1.5px;
  color: var(--navy);
}
.home-lead {
  margin: 14px 0 clamp(24px, 5vh, 44px);
  max-width: 32ch;
  font-size: clamp(18px, 2.6vw, 22px);
  line-height: 1.35;
  color: var(--ink-soft);
}
.home-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.plate-game { display: flex; flex-direction: column; box-shadow: 0 2px 0 var(--navy-deep); transition: transform .12s ease; }
.plate-game .plate-band { flex: none; align-self: stretch; }
.plate-game:hover { transform: translateY(-2px); }
.plate-game:active { transform: translateY(1px); box-shadow: none; }
.plate-game .plate-band { padding: 6px 16px 7px; font-size: 15px; }
.plate-game .plate-body { flex: 1; align-items: stretch; gap: 16px; padding: 16px; }
.plate-game .plate-art { width: 96px; height: 120px; }
.plate-game .plate-art svg { width: 100%; height: 100%; }
.plate-text { display: flex; flex-direction: column; min-width: 0; }
.plate-text b { font-size: 34px; }
.plate-text span { margin-top: 6px; font-size: 16px; line-height: 1.3; color: #d4dcf0; white-space: normal; }
.plate-text small { margin-top: auto; padding-top: 12px; font-size: 13.5px; color: var(--yellow); }
.art-river { fill: none; stroke: var(--water); stroke-width: 900; stroke-linecap: round; stroke-linejoin: round; }
.art-bridge { stroke: var(--yellow); stroke-width: 420; stroke-linecap: round; }
.art-district { fill: rgba(255,255,255,.12); stroke: #fff; stroke-width: 1.3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.home-foot { margin: 28px 0 0; font-size: 13px; color: var(--ink-soft); }

/* wybór wariantu (dzielnicy w grze „Osiedla") */
body[data-home="variants"] .home-lead { display: none; }
body[data-home="variants"] .home h1 { font-size: clamp(36px, 7vw, 56px); }
body[data-home="variants"] .home-games { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.variants-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 18px 0 6px; }
.variants-head .back { margin-left: -6px; align-self: center; }
.variants-head h2 { margin: 0; font-family: var(--sign); font-size: 34px; font-weight: 700; line-height: 1; color: var(--navy); }
.variants-head p { margin: 0; font-size: 18px; color: var(--ink-soft); }
.plate-variant .plate-body { gap: 12px; padding: 12px 14px; }
.plate-variant .plate-art { width: 64px; height: 64px; }
.plate-variant .plate-text b { font-size: 24px; white-space: normal; line-height: 1.05; }
.plate-variant .plate-text small { padding-top: 8px; }

/* ---------- okienko z wynikiem ---------- */
.result {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(14,31,71,.45);
  animation: result-fade .2s ease;
}
.result[hidden] { display: none; }
@keyframes result-fade { from { opacity: 0; } }
.result-card {
  width: min(400px, 100%);
  box-shadow: 0 3px 0 var(--navy-deep), 0 18px 50px rgba(14,31,71,.35);
  animation: result-in .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes result-in { from { transform: translateY(16px) scale(.96); opacity: 0; } }
.result-card .plate-band { padding: 7px 18px 8px; font-size: 14.5px; }
.result-body { padding: 18px 20px 14px; }
.result-score { display: flex; align-items: baseline; gap: 10px; margin: 0; font-family: var(--sign); font-weight: 700; line-height: 1; }
.result-score b { font-size: 64px; color: var(--yellow); letter-spacing: -1px; }
.result-score span { font-size: 22px; color: #d4dcf0; }
.result-meter { height: 8px; margin: 14px 0 0; border-radius: 4px; background: rgba(255,255,255,.16); overflow: hidden; }
.result-meter i { display: block; height: 100%; border-radius: 4px; background: var(--yellow); }
.result-text { margin: 14px 0 0; font-size: 17px; line-height: 1.35; }
.result-best { margin: 6px 0 0; font-size: 14.5px; color: #d4dcf0; }
.result-best.is-record { color: var(--yellow); font-weight: 600; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.result-btn {
  flex: 1 1 auto; min-height: 46px; padding: 0 16px;
  border: 2px solid rgba(255,255,255,.55); border-radius: var(--r-ui);
  background: transparent; color: #fff;
  font-family: var(--sign); font-size: 18px; font-weight: 700;
}
.result-btn:hover { background: rgba(255,255,255,.1); }
.result-btn.is-primary { border-color: var(--yellow); background: var(--yellow); color: var(--navy-deep); }
.result-btn.is-primary:hover { filter: brightness(1.05); }
.result-btn:focus-visible, .result-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.result-close {
  display: block; margin: 12px auto 0; padding: 6px 10px;
  border: 0; background: transparent; color: #d4dcf0;
  font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.result-close:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) { .result, .result-card { animation: none; } }

/* ---------- ekran gry: pasek górny ---------- */
.game { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.back {
  display: flex; align-items: center; gap: 7px;
  min-height: 36px;
  padding: 0 10px 0 6px;
  border: 0;
  border-radius: var(--r-ui);
  background: transparent;
  font-weight: 600;
  color: var(--navy);
}
.back:hover { background: var(--ground); }
.bar h2 {
  margin: 0 auto 0 0;
  font-family: var(--sign);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
  white-space: nowrap;
}
.modes { display: flex; padding: 3px; border-radius: var(--r-ui); background: var(--ground); }
.modes button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}
.modes button.is-active { background: var(--navy); color: #fff; }
.score {
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-ui);
  background: var(--yellow);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.score strong { font-family: var(--sign); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quiet-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ui);
  background: var(--panel);
  font-size: 15px;
  font-weight: 600;
}
.quiet-btn:hover { border-color: var(--navy); }

/* ---------- układ gry ---------- */
.stage { flex: 1; min-height: 0; display: flex; }
.map { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--ground); }
#svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#svg.is-panning { cursor: grabbing; }
#overlay, #ghost { pointer-events: none; }
#svg text { font-family: var(--text); }

/* ---------- mapa: wspólne ---------- */
#world path, #world polygon { vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.river, .river-edge { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.river { stroke: var(--water); }
.river-edge { stroke: var(--water-edge); }
.poi-dot { fill: var(--ink-soft); }
.poi { font-size: 12px; fill: var(--ink-soft); paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; stroke-linejoin: round; }
.river-name { font-size: 14px; font-style: italic; font-weight: 600; letter-spacing: 1.5px; fill: var(--water-edge); paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; }

/* ---------- mapa: mosty ---------- */
.city { fill: var(--city); stroke: #b9c3d6; stroke-width: 1.5; }
.tick { stroke: var(--navy-deep); stroke-width: 1.5; }
.tick.minor { stroke-width: 1; opacity: .5; }
.km-label {
  font-size: 12px; font-weight: 600; fill: var(--navy-deep);
  paint-order: stroke; stroke: var(--city); stroke-width: 3px; stroke-linejoin: round;
  font-variant-numeric: tabular-nums;
}
.km-label.major { font-size: 13.5px; font-weight: 700; }
.km-label.minor { font-size: 11px; font-weight: 500; opacity: .75; }
.area { font-size: 12.5px; font-weight: 500; letter-spacing: .4px; fill: #9aa5bb; }

.slot { fill: #fff; stroke: var(--navy); stroke-width: 1.6; stroke-dasharray: 5 4; }
.slot.is-hot { fill: var(--yellow); stroke: var(--navy-deep); stroke-dasharray: none; stroke-width: 2.2; }
.slot.is-wrong { fill: #f6b3b6; stroke: var(--red); stroke-dasharray: none; animation: shake .35s; }
.bridge { stroke-width: 1.5; }
.bridge.is-ok { fill: var(--ok); stroke: #0c4a2c; }
.bridge.is-miss { fill: var(--red); stroke: var(--red-deep); }
.bridge.is-ghost { fill: var(--yellow); stroke: var(--navy-deep); stroke-width: 2; }
.bridge.is-guess { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; stroke-dasharray: 4 3; }
.bridge-label {
  font-family: var(--sign) !important; font-size: 14.5px; font-weight: 700; fill: var(--navy-deep);
  paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round;
}
.bridge-sub, .guess-label { font-size: 11.5px; font-weight: 500; fill: var(--ink-soft); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.readout-bg { fill: var(--navy-deep); }
.readout { font-size: 13.5px; font-weight: 700; fill: #fff; font-variant-numeric: tabular-nums; }

@keyframes shake {
  25% { transform: translate(-4px, 0); }
  75% { transform: translate(4px, 0); }
}

/* ---------- mapa: dzielnice ---------- */
.base { fill: var(--city); stroke: var(--city); stroke-width: 1.5; }
.outline { fill: none; stroke: #8492ad; stroke-width: 2; }
.river.thin { opacity: .92; }
.d { fill: none; stroke: none; }
.d.is-slot { fill: rgba(255,255,255,.4); stroke: #8f9bb5; stroke-width: 1.2; stroke-dasharray: 5 4; }
.d.is-slot.is-hot { fill: var(--yellow); stroke: var(--navy-deep); stroke-dasharray: none; stroke-width: 2; }
.d.is-slot.is-wrong { fill: #f6b3b6; stroke: var(--red); stroke-dasharray: none; }
.d.c0 { --fill: #f7c5c7; } .d.c1 { --fill: #fbe189; } .d.c2 { --fill: #bdd0f1; } .d.c3 { --fill: #c8e5d3; }
.d.c4 { --fill: #e3d2f0; } .d.c5 { --fill: #fbd3b0; } .d.c6 { --fill: #d5dbe6; } .d.c7 { --fill: #cfeaea; }
.d.is-placed { fill: var(--fill); stroke: #fff; stroke-width: 1.6; }
.d.is-new { animation: pop .5s; }
@keyframes pop { 0% { fill: var(--yellow); } 100% { fill: var(--fill); } }
.ctx { fill: #f3f5f9; stroke: #c6cedc; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ctx-label { font-family: var(--sign); font-size: 13px; font-weight: 600; fill: #8f9bb5; text-anchor: middle; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; stroke-linejoin: round; }
.piece { fill: rgba(255,210,31,.72); stroke: var(--navy-deep); stroke-width: 2; pointer-events: none; }
.d-label {
  font-family: var(--sign) !important; font-size: 14px; font-weight: 700; fill: var(--navy-deep); text-anchor: middle;
  paint-order: stroke; stroke: rgba(255,255,255,.8); stroke-width: 3px; stroke-linejoin: round;
}

/* ---------- mapa: parki i wzniesienia ---------- */
.dlines { fill: none; stroke: #c6cedc; stroke-width: 1; }
.park { stroke-width: 1.4; }
.park.is-hidden { display: none; }
.park.is-slot { fill: rgba(28,139,87,.14); stroke: var(--ok); stroke-dasharray: 4 3; }
.park.is-slot.is-hot { fill: var(--yellow); stroke: var(--navy-deep); stroke-dasharray: none; stroke-width: 2; }
.park.is-slot.is-wrong { fill: #f6b3b6; stroke: var(--red); stroke-dasharray: none; }
.park.is-ok { fill: #5cc08a; stroke: #0c4a2c; }
.park.is-miss { fill: #f08a8e; stroke: var(--red-deep); }
.park.is-guess { fill: none; stroke: var(--ink-soft); stroke-dasharray: 4 3; }
.park.is-new { animation: pop-park .5s; }
@keyframes pop-park { 0% { fill: var(--yellow); } }

.mark { stroke-width: 1.6; stroke-linejoin: round; }
.mark.is-slot { fill: #fff; stroke: var(--navy); stroke-dasharray: 3 2; }
.mark.is-slot.is-hot { fill: var(--yellow); stroke: var(--navy-deep); stroke-dasharray: none; }
.mark.is-slot.is-wrong { fill: #f6b3b6; stroke: var(--red); stroke-dasharray: none; }
.mark.is-ok { fill: var(--ok); stroke: #0c4a2c; }
.mark.is-miss { fill: var(--red); stroke: var(--red-deep); }
.mark.is-guess { fill: none; stroke: var(--ink-soft); stroke-dasharray: 3 2; }
.mark.is-ghost { fill: var(--yellow); stroke: var(--navy-deep); stroke-width: 2; }
.miss-line { stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 3 3; }

/* ---------- mapa: metro ---------- */
.metro-track { fill: none; stroke: var(--metro, var(--navy)); stroke-width: 6; stroke-linecap: round; }
.metro-other { fill: none; stroke: #b9c3d6; stroke-width: 3; stroke-linecap: round; }
.st { stroke-width: 2.5; }
.st.is-slot { fill: #fff; stroke: var(--metro, var(--navy)); }
.st.is-slot.is-hot { fill: var(--yellow); stroke: var(--navy-deep); r: 9px; }
.st.is-slot.is-wrong { fill: #f6b3b6; stroke: var(--red); }
.st.is-ok { fill: #fff; stroke: var(--ok); stroke-width: 3.5; }
.st.is-ok.is-new { animation: pop-st .5s; }
@keyframes pop-st { 0% { fill: var(--yellow); } }
.st.is-miss { fill: #fff; stroke: var(--red); stroke-width: 3.5; }
.st.is-guess { fill: var(--ink-soft); stroke: #fff; stroke-width: 1.5; }
.st.is-ghost { fill: var(--yellow); stroke: var(--navy-deep); stroke-width: 2.5; }
.st-label {
  font-family: var(--sign); font-size: 13.5px; font-weight: 700; fill: var(--navy-deep);
  paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 3px; stroke-linejoin: round;
}
.art-metro { fill: none; stroke-width: 700; stroke-linecap: round; stroke-linejoin: round; }
.art-station { fill: #fff; }
.thumb-metro { font-family: var(--sign); font-size: 24px; font-weight: 700; }
.place-label {
  font-family: var(--sign) !important; font-size: 14.5px; font-weight: 700; fill: var(--navy-deep);
  paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round;
}
.place-sub { font-size: 11.5px; font-weight: 500; fill: var(--ink-soft); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }

.thumb-peak { fill: rgba(255,255,255,.2); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.art-river.thin { stroke-width: 380; }
.art-park { fill: #5cc08a; }
.art-peak { fill: var(--yellow); }

/* ---------- elementy na mapie ---------- */
.msg {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 14px;
  border-radius: var(--r-ui);
  background: var(--navy-deep);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 6px 20px rgba(14,31,71,.28);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.msg.is-on { opacity: 1; }
.msg.is-ok { background: var(--ok); }
.msg.is-bad { background: var(--red); }

.zoom {
  position: absolute;
  right: 12px;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-ui);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 2px 10px rgba(14,31,71,.18);
}
.zoom button {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  color: var(--navy);
}
.zoom button:last-child { border-bottom: 0; }
.zoom button:hover { background: var(--ground); }

.legend {
  position: absolute;
  left: 12px;
  bottom: 28px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-deep);
}
.north { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; line-height: 1; }
.scale i { display: block; height: 6px; border: 1.5px solid var(--navy-deep); border-top: 0; }
.scale b { display: block; text-align: center; margin-top: 2px; font-weight: 600; }
.attr { position: absolute; right: 8px; bottom: 4px; font-size: 10.5px; color: var(--ink-soft); pointer-events: none; }

/* ---------- lista ---------- */
.tray {
  flex: none;
  width: 290px;
  padding: 14px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
}
.tray-head { display: none; }
.tray-hint { margin: 0 0 14px; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { touch-action: pan-y; cursor: grab; box-shadow: 0 2px 0 var(--navy-deep); }
.card:active { cursor: grabbing; }
.card.is-dragging { opacity: .35; }
.card { transition: transform .1s ease, background-color .1s ease; }
/* wybrany element: cały kafelek żółty („w ręku", jak element przeciągany po mapie) i wciśnięty */
.card.is-selected {
  background: var(--yellow);
  color: var(--navy-deep);
  transform: translateY(2px);
  box-shadow: inset 0 3px 0 rgba(14,31,71,.28);
}
.dock-pick.is-selected { background: var(--yellow); color: var(--navy-deep); }
.card.is-selected .plate-band, .dock-pick.is-selected .plate-band { background: var(--navy-deep); color: var(--yellow); }
.card.is-selected .thumb, .card.is-selected .thumb-peak,
.dock-pick.is-selected .thumb, .dock-pick.is-selected .thumb-peak { fill: rgba(14,31,71,.14); stroke: var(--navy-deep); }
.card.is-done { cursor: default; background: #8794b3; box-shadow: none; }
.card.is-done .plate-band { background: var(--ok); }
.card.is-done.is-miss .plate-band { background: #6d7892; }

.summary {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--r-plate);
  background: var(--yellow);
  font-size: 15px;
  line-height: 1.4;
}
.summary strong { display: block; font-family: var(--sign); font-size: 26px; line-height: 1.1; margin-bottom: 4px; }
.summary div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.summary button {
  border: 0;
  border-radius: var(--r-ui);
  padding: 8px 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.drag-chip {
  position: fixed;
  left: 0; top: 0;
  z-index: 40;
  padding: 6px 12px;
  border-radius: var(--r-plate);
  border-top: 5px solid var(--red);
  background: var(--navy);
  color: #fff;
  font-family: var(--sign);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(14,31,71,.3);
  transform: translate(-50%, -140%);
}

.dock, .backdrop { display: none; }

/* ---------- telefon: mapa na cały ekran, lista wysuwana z prawej, pasek na dole ---------- */
@media (max-width: 760px) {
  .bar { gap: 8px; padding: 6px 10px; }
  .back { padding: 0 6px 0 2px; }
  .back span { display: none; }
  .bar h2 { font-size: 21px; overflow: hidden; text-overflow: ellipsis; }
  .modes button { padding: 6px 10px; font-size: 14px; }
  .score span { display: none; }
  #restart { display: none; }

  .tray {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 30;
    width: min(86vw, 340px);
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    border-left: 0;
    box-shadow: -14px 0 34px rgba(14,31,71,.25);
    transform: translateX(105%);
    transition: transform .22s ease;
    overscroll-behavior: contain;
  }
  body.drawer-open .tray { transform: none; }
  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(14,31,71,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
  }
  body.drawer-open .backdrop { opacity: 1; pointer-events: auto; }
  .tray-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .tray-head strong { margin-right: auto; font-family: var(--sign); font-size: 26px; color: var(--navy); }
  .tray .summary { display: none; }
  .card { cursor: pointer; }

  .dock {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex: none;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
  .dock-pick { flex: 1; min-width: 0; width: auto; }
  .dock-pick .plate-band { padding: 2px 10px 3px; font-size: 12.5px; }
  .dock-pick .plate-body { padding: 5px 10px 6px; min-height: 40px; gap: 8px; }
  .dock-pick .plate-body b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dock-pick .plate-art { width: 34px; }
  .dock-pick .plate-art svg { width: 34px; height: 30px; }
  .dock-btn {
    flex: none;
    min-width: 50px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-ui);
    background: var(--panel);
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
  }
  .dock-btn i { font-style: normal; display: block; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
  .dock-btn.is-primary { border-color: var(--red); background: var(--red); color: #fff; padding: 0 16px; }
  .dock-btn.is-nudge { font-size: 24px; font-weight: 500; padding: 0; }
  .dock-btn:active { filter: brightness(.93); }
  .dock-final { flex: 1; min-width: 0; align-self: center; font-size: 13.5px; line-height: 1.25; color: var(--ink-soft); }
  .dock-final b { display: block; font-family: var(--sign); font-size: 22px; color: var(--navy); }

  .zoom { bottom: 22px; right: 10px; }
  .zoom button { width: 40px; height: 40px; }
  .legend { bottom: 22px; left: 10px; }
  .msg { top: 10px; font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
