/* ============================================================
   BARVY – všechny na jednom místě. Tmavý režim jen přepíše proměnné.
   ============================================================ */
:root {
  --bg: #efe6da;  --paper: #f8f3ec;  --wall: #ece3d6;  --floor: #e9dcc8;
  --ink: #23263a; --muted: #6c6878;
  --accent: #e8834a; --accent-ink: #fff; --teal: #3fb3d3;
  --portal: #e4ece6; --street: #c9d1cc; --river: #86b6d8;
  --glow: #f7c99a; --chip: #e6dccd;
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1f2e;  --paper: #262a3d;  --wall: #2a2e42;  --floor: #23273a;
    --ink: #f1e9dd; --muted: #aaa5b6;
    --accent: #f0955f; --accent-ink: #1c1f2e;
    --portal: #2f3b45; --street: #3e4a54; --river: #3f6a8a;
    --glow: #8a5a3c; --chip: #33384f;
  }
}

/* ============================================================
   ZÁKLAD
   ============================================================ */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Nunito", system-ui, sans-serif;
}
h1, h2, .big, .btn, .nav-brand { font-family: "Outfit", system-ui, sans-serif; }
h1 { margin: 0; font-size: 32px; font-weight: 800; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.big { font-size: 40px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

/* ============================================================
   ROZVRŽENÍ: navigace + obsah
   Mobil: menu je lišta dole. Od 880 px: menu je sloupec vlevo.
   ============================================================ */
.shell { min-height: 100vh; }
.content { max-width: 1100px; margin: 0 auto; padding: 20px 16px 110px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding: 6px 4px;
}
.nav a {
  display: grid; justify-items: center; gap: 2px;
  color: var(--muted); text-decoration: none;
  font-size: 11px; font-weight: 700;
  padding: 6px 8px; border-radius: 14px;
}
.nav .ico { font-size: 20px; line-height: 1; }
.nav a.active { color: var(--ink); background: var(--chip); }
.nav-brand { display: none; }

@media (min-width: 880px) {
  .shell { display: grid; grid-template-columns: 230px 1fr; }
  .content { padding: 32px 32px 48px; width: 100%; }
  .nav {
    position: sticky; top: 0; height: 100vh;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    border-top: 0; border-right: 2px solid var(--ink);
    padding: 24px 14px;
  }
  .nav a { display: flex; gap: 12px; align-items: center; font-size: 16px; padding: 10px 14px; }
  .nav-brand { display: block; font-size: 22px; font-weight: 800; padding: 0 14px 18px; }
  .nav-brand b { color: var(--accent); }
}

/* ============================================================
   OBRAZOVKY A KARTY
   ============================================================ */
.screen { display: grid; gap: 20px; }
.screen[hidden] { display: none; }   /* jinak by display: grid přebil atribut hidden */
.wide { grid-column: 1 / -1; order: 1; }   /* přes celou šířku a až na konec */
.screen-head { display: grid; gap: 4px; }
.card {
  background: var(--paper);
  border: 2px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: var(--radius);
  padding: 18px;
  display: grid; gap: 12px; align-content: start;
}
.grid-2, .grid-3 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.hero { grid-column: 1 / -1; grid-template-columns: 120px 1fr; align-items: center; gap: 18px; }
.bob-mini svg { width: 120px; display: block; }
.bubble-plain { font-weight: 700; font-size: 18px; margin-bottom: 12px; }

/* Místo pro tvoje úkoly: přerušovaný rámeček */
.todo {
  border: 2px dashed var(--muted); border-radius: 16px;
  padding: 18px; color: var(--muted); text-align: center; font-weight: 600;
}

/* ============================================================
   TLAČÍTKA A OVLÁDÁNÍ
   ============================================================ */
.btn {
  display: inline-block; text-decoration: none; color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 11px 24px; font-weight: 800; font-size: 17px;
  background: var(--paper); box-shadow: 0 3px 0 var(--ink); cursor: pointer;
}
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.sos { background: var(--teal); color: #10222b; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.controls.left { justify-content: flex-start; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip {
  text-align: left; background: var(--chip); border: 2px solid transparent;
  border-radius: 16px; padding: 10px 12px; cursor: pointer; display: grid;
}
.chip b { font-family: "Outfit", sans-serif; font-size: 17px; }
.chip small { color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); box-shadow: 0 3px 0 var(--ink); }
.seg { display: flex; gap: 6px; background: var(--chip); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
button:disabled { opacity: .5; cursor: not-allowed; }

.mood-line { display: flex; gap: 12px; align-items: center; }
.mood-line input { flex: 1; accent-color: var(--accent); }
.mood-line output { font: 800 24px "Outfit", sans-serif; width: 2ch; text-align: right; }
.after { display: grid; gap: 8px; border-top: 2px dashed var(--chip); padding-top: 12px; }
label { font-weight: 700; }
input[type="date"] { font: inherit; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--ink); background: var(--bg); color: var(--ink); max-width: 240px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; color: var(--muted); font-weight: 700; padding: 6px 4px; }
.table td { border-top: 1px solid var(--chip); padding: 8px 4px; font-variant-numeric: tabular-nums; }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.list li { display: flex; justify-content: space-between; gap: 10px; background: var(--chip); border-radius: 12px; padding: 8px 12px; }

/* ============================================================
   CVIČENÍ: scéna s BoBem
   --v je číslo 0 až 1 = jak moc jsou plíce plné. Nastavuje ho JavaScript.
   ============================================================ */
.exercise { display: grid; gap: 24px; }
@media (min-width: 1000px) { .exercise { grid-template-columns: 1.05fr .95fr; align-items: start; } }
.stage-col { display: grid; gap: 14px; justify-items: center; }
.panel { display: grid; gap: 20px; }

.bubble {
  position: relative; width: 100%; max-width: 440px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 20px;
  padding: 12px 16px; font-weight: 600; min-height: 3.2em;
}

.stage {
  --v: 0;
  position: relative; width: 100%; max-width: 440px; aspect-ratio: 400 / 440;
  border: 2.5px solid var(--ink); border-radius: 28px; overflow: hidden;
  container-type: inline-size;
}
.stage > * { position: absolute; }
.scene { inset: 0; width: 100%; height: 100%; }
.scene .wall { fill: var(--wall); }
.scene .floor { fill: var(--floor); }
.scene .portal { fill: var(--portal); }
.scene .street { stroke: var(--street); }
.scene .river { stroke: var(--river); }
.scene .route { stroke: var(--accent); }
.scene .portal-edge { stroke: var(--ink); }

.glow {
  left: 50%; top: 66%; width: 92%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(calc(.5 + var(--v) * .5));
  opacity: calc(.55 + var(--v) * .45);
}
.ringsvg { left: 50%; top: 66%; width: 80%; transform: translate(-50%, -50%) rotate(-90deg); }
.ringsvg circle { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.ringsvg .track { stroke: var(--ink); opacity: .12; }
.ringsvg .prog { stroke: var(--accent); }
.stage:not(.running) .prog { opacity: 0; }

.readout { left: 17%; right: 17%; top: 9%; display: flex; justify-content: space-between; font-family: "Outfit", sans-serif; }
.readout .k { font-size: 3.6cqw; font-weight: 500; }
.readout .v { font-size: 8cqw; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.readout .r { text-align: right; }

.bob-big { left: 50%; bottom: -2px; width: 64%; transform: translateX(-50%); }
.bob-big svg { display: block; width: 100%; }

/* BoB dýchá: hrudník se zvětší, hlava zvedne */
.bob-body { transform-box: view-box; transform-origin: 50% 100%; transform: scale(calc(1 + var(--v) * .03)); }
.bob-head { transform-box: view-box; transform: translateY(calc(var(--v) * -5px)); }

/* Výrazy obličeje podle stavu */
.eyes-closed, .mouth-o, .peace { display: none; }
.stage.running .eyes-open { display: none; }
.stage.running .eyes-closed { display: inline; }
.stage.running[data-kind="out"] .mouth-smile { display: none; }
.stage.running[data-kind="out"] .mouth-o { display: inline; }
.stage.done .peace { display: inline; }

.phase { text-align: center; min-height: 5em; }
.phase .label { font: 800 40px/1.1 "Outfit", sans-serif; display: flex; justify-content: center; gap: 12px; }
.phase .count { color: var(--accent); font-variant-numeric: tabular-nums; }
