* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; touch-action: pan-x pan-y; } /* stránku nejde zoomovat prsty */
body {
  display: flex; flex-direction: column;
  height: 100dvh;
  font-family: system-ui, sans-serif;
  background: #20303c; color: #1d2b36;
}

/* ---------- horní lišta ---------- */
header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 8px 12px; background: #fff; border-bottom: 1px solid #d8dde2;
}
header h1 { margin: 0; font-size: 1.05rem; }
.zpet { text-decoration: none; font-size: 1.3rem; color: #1d2b36; padding: 0 4px; }
.seg { display: inline-flex; border: 1px solid #b9c2ca; border-radius: 8px; overflow: hidden; }
.seg button {
  border: 0; background: #fff; padding: 6px 10px; font: inherit; font-size: .9rem; cursor: pointer;
}
.seg button + button { border-left: 1px solid #b9c2ca; }
.seg button.on { background: #1d6fb8; color: #fff; }
@media (max-width: 520px) { .seg button { padding: 6px 5px; font-size: .74rem; } } /* na telefonu se vejde sedm tlačítek typu */
.hint { font-size: .85rem; display: flex; align-items: center; gap: 4px; }
#skore { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- otázka ---------- */
#otazka {
  padding: 10px 14px; background: #fff7e0; border-bottom: 1px solid #ecd9a0;
  font-size: 1.25rem; text-align: center;
}
#otazka .druh { color: #8a6d1a; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-right: 8px; }

/* ---------- mapa ---------- */
#mapa-wrap { flex: 1; min-height: 0; position: relative; }
.zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoom button {
  width: 40px; height: 40px; border: 1px solid #b9c2ca; border-radius: 8px; background: rgba(255,255,255,.92);
  font-size: 1.3rem; line-height: 1; cursor: pointer; color: #1d2b36;
}
#mapa { position: absolute; inset: 0; width: 100%; height: 100%; background: #cfe4f3; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
#mapa.tahne { cursor: grabbing; }
#mapa * { vector-effect: non-scaling-stroke; } /* čáry mají stejnou tloušťku při každém přiblížení */

.land   { fill: #f6f1e4; stroke: #7a705b; stroke-width: 1.2px; stroke-linejoin: round; }
/* režim "bez hranic": země mají jen stejnou barvu, žádný obrys (pobřeží je vidět díky moři) */
#mapa.bez-hranic .land { stroke: none; }
.range  { fill: rgba(176,132,76,.42); stroke: rgba(130,92,45,.65); stroke-width: .8px; }
.river  { fill: none; stroke: #4a90c8; stroke-width: 1.4px; stroke-linecap: round; stroke-linejoin: round; }
.peak   { stroke: #8a5a2b; stroke-width: 8px; stroke-linecap: round; }
.cz-out { fill: none; stroke: #c0392b; stroke-width: 2.4px; stroke-linejoin: round; pointer-events: none; }
#mapa.bez-cz .cz-out { display: none; }

/* na celé Evropě nekreslíme drobná pohoří a vrcholy, byl by z toho chaos */
#mapa[data-level="eu"] .small,
#mapa[data-level="eu"] .peak { display: none; }

/* ---------- zvýraznění správné odpovědi ---------- */
.hl-poly { fill: rgba(255,140,0,.5); stroke: #ff8c00; stroke-width: 3px; animation: blik 1.2s ease-in-out infinite; }
.hl-glow { fill: none; stroke: #ff8c00; stroke-width: 14px; stroke-linecap: round; stroke-linejoin: round; opacity: .35; animation: puls-cara 1.2s ease-in-out infinite; }
.hl-core { fill: none; stroke: #ff6a00; stroke-width: 4px; stroke-linecap: round; stroke-linejoin: round; }
.hl-dot-glow { stroke: #ff8c00; stroke-linecap: round; opacity: .55; animation: puls-bod 1.2s ease-in-out infinite; }
.hl-dot-core { stroke: #ff6a00; stroke-width: 12px; stroke-linecap: round; }
.dotaz-obrys { stroke: #fff; stroke-width: 20px; stroke-linecap: round; }
.dotaz-ok  { stroke: #1e9e4a; stroke-width: 12px; stroke-linecap: round; }
.dotaz-bad { stroke: #d63031; stroke-width: 12px; stroke-linecap: round; }
.spoj { fill: none; stroke: #222; stroke-width: 2px; stroke-dasharray: 6 5; }

@keyframes blik { 0%,100% { fill: rgba(255,140,0,.55); } 50% { fill: rgba(255,140,0,.2); } }
@keyframes puls-cara { 0%,100% { stroke-width: 12px; } 50% { stroke-width: 22px; } }
@keyframes puls-bod { 0%,100% { stroke-width: 28px; } 50% { stroke-width: 48px; opacity: .25; } }

/* ---------- dolní lišta ---------- */
#vysledek {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 62px; padding: 10px 14px; background: #fff; border-top: 1px solid #d8dde2;
}
#vys-text { flex: 1; font-size: 1.05rem; }
#vys-text.ok  { color: #1e8a40; font-weight: 600; }
#vys-text.bad { color: #c0392b; font-weight: 600; }
#vysledek button {
  border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; cursor: pointer;
  background: #1d6fb8; color: #fff;
}
#btn-nevim { background: #e9edf1; color: #1d2b36; }
[hidden] { display: none !important; }

/* ---------- denní série ---------- */
#serie { font-size: .9rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eceff2; color: #6c7a89; white-space: nowrap; }
#serie.hotovo { background: #ffe9cc; color: #c25a00; }
.push { border: 1px solid #b9c2ca; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .85rem; cursor: pointer; background: #fff; color: #1d2b36; white-space: nowrap; }
.push.on { background: #e3f4e8; border-color: #8cc9a0; color: #1e6b3a; }
.push:disabled { opacity: .6; cursor: wait; }
#toast {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20;
  background: #1d2b36; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}

/* ---------- zkouška ---------- */
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.zk { border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; background: #8e44ad; color: #fff; }
body.zkouska .zk { background: #6c7a89; }
body.zkouska #otazka { background: #efe3f7; border-bottom-color: #d3b8e6; }

#zk-vysledek {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.6);
}
.zk-box { width: min(380px, 100%); background: #fff; border-radius: 16px; padding: 24px 20px; text-align: center; }
#zk-znamka { font-size: 5.5rem; font-weight: 800; line-height: 1; }
#zk-znamka.z1, #zk-znamka.z2 { color: #1e9e4a; }
#zk-znamka.z3 { color: #d68910; }
#zk-znamka.z4, #zk-znamka.z5 { color: #c0392b; }
#zk-slovo { font-size: 1.2rem; text-transform: uppercase; letter-spacing: .08em; color: #5c6b78; margin-bottom: 12px; }
#zk-skore { font-size: 1.15rem; font-weight: 600; margin: 8px 0; }
#zk-chyby { font-size: .95rem; color: #555; margin: 8px 0 16px; }
.zk-tl { display: flex; flex-direction: column; gap: 8px; }
.zk-tl button { border: 0; border-radius: 8px; padding: 12px; font: inherit; cursor: pointer; background: #1d6fb8; color: #fff; }
.zk-tl button + button { background: #e9edf1; color: #1d2b36; }
