/* Usínánky: mobilní aplikace pro rodiče a děti.
   Procházení je světlé a přehledné, čtení probíhá v tmavém nočním režimu. */
:root {
  /* Noční, ale hravá paleta: sytě fialové nebe + bonbonové barvy (jako dětské aplikace) */
  --bg: #221a4d;
  --bg-2: #2c2163;
  --surface: #342a74;
  --surface-2: #40348a;
  --surface-3: #5446a8;
  --line: #4a3d95;
  --ink: #fff7ea;
  --ink-dark: #2a1f4f;
  --ink-2: #ddd4fb;
  --muted: #ab9fdc;
  --navy: #2c2163;
  --navy-2: #241a52;
  --sun: #ffc93c;    --sun-d: #e0a10f;
  --pink: #ff6f91;   --pink-d: #d94a6e;
  --mint: #36d39b;   --mint-d: #1fa775;
  --sky: #4cb4ff;    --sky-d: #2589d6;
  --orange: #ff9a3d; --orange-d: #dd7414;
  --lilac: #b48cff;  --lilac-d: #8c62e0;
  --coral: var(--pink);
  --coral-soft: rgba(255, 111, 145, .18);
  --mustard: var(--sun);
  --mustard-soft: rgba(255, 201, 60, .18);
  --sage: var(--mint);
  --night: #1b1540;
  --night-2: #2a2160;
  --night-3: #3a2f80;
  --cream: #fff4e0;
  --night-muted: #b3a8e3;
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --shadow: 0 6px 0 rgba(10, 6, 35, .35), 0 14px 30px rgba(10, 6, 35, .3);
  --font-head: 'Baloo 2', system-ui, sans-serif;
  --font-ui: Nunito, system-ui, sans-serif;
  --font-read: Andika, system-ui, sans-serif;
  --tabbar-h: 74px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); line-height: 1.45; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--font-head); font-weight: 700; }
button { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; border-radius: 10px; }
#dim { position: fixed; inset: 0; background: #000; pointer-events: none; opacity: 0; z-index: 90; transition: opacity .2s; }

/* ---------- Ilustrace (obálky) ---------- */
.art { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--art-bg); }
.art svg { width: 100%; height: 100%; }
.art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27160%27 height=%27160%27%3E%3Cfilter id=%27n%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%27.85%27 numOctaves=%272%27 stitchTiles=%27stitch%27/%3E%3CfeColorMatrix values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0%27/%3E%3C/filter%3E%3Crect width=%27100%25%27 height=%27100%25%27 filter=%27url(%23n)%27/%3E%3C/svg%3E");
}

/* ---------- Kostra aplikace ---------- */
.screen { max-width: 560px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
.appbar { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; }
.appbar .grow { flex: 1; min-width: 0; }
.hello { margin: 0; color: var(--muted); font-weight: 700; font-size: 15px; }
.appbar h1 { font-size: 26px; margin-top: 2px; }
.logo { width: 44px; height: 44px; border-radius: 14px; flex: none; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; color: var(--ink);
}
.round-btn svg { width: 22px; height: 22px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-in { max-width: 560px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(4, 1fr); }
.tab {
  display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted);
  font-size: 12.5px; font-weight: 700; position: relative;
}
.tab svg { width: 25px; height: 25px; }
.tab[aria-current="page"] { color: var(--mustard); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--coral); }
.tab .badge { position: absolute; top: 9px; margin-left: 26px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coral); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ---------- Domů ---------- */
.feature {
  display: grid; grid-template-columns: 118px 1fr; gap: 14px; align-items: center;
  background: var(--navy); color: var(--cream); border-radius: var(--r-xl); padding: 12px 14px 12px 12px;
  box-shadow: inset 0 0 0 1px #34467a, 0 10px 28px rgba(0, 0, 0, .25); margin-bottom: 22px;
}
.feature .art { width: 118px; height: 118px; border-radius: 20px; }
.feature .kicker { font-size: 12.5px; font-weight: 700; color: var(--mustard); display: flex; align-items: center; gap: 6px; }
.feature .kicker svg { width: 15px; height: 15px; }
.feature h2 { font-size: 19px; margin: 4px 0 6px; color: #fff; }
.feature .meta { color: var(--night-muted); font-size: 13px; font-weight: 700; }
.feature .go { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; background: var(--mustard); color: var(--ink-dark); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; }
.feature .go svg { width: 14px; height: 14px; }

.filters { margin-bottom: 18px; }
.filter-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.seg {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px;
  background: var(--surface-2); margin-bottom: 14px;
}
.seg button {
  min-height: 40px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font-weight: 700; font-size: 14px; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.gchip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 700; font-size: 14px; color: var(--ink-2); white-space: nowrap;
}
.gchip .gi { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.gchip .gi svg { width: 15px; height: 15px; }
.gchip[aria-pressed="true"] { background: var(--mustard); border-color: var(--mustard); color: var(--ink-dark); }
.gchip[aria-pressed="true"] .gi { background: rgba(0, 0, 0, .1); }

.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 12px; }
.list-head h2 { font-size: 22px; }
.list-head span { color: var(--muted); font-size: 14px; font-weight: 700; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.card .art { aspect-ratio: 1 / .9; }
.card-body { padding: 10px 12px 13px; display: grid; gap: 6px; }
.card strong { font-family: var(--font-head); font-size: 16px; line-height: 1.2; }
.card .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.pill.age { background: var(--mustard-soft); color: var(--mustard); }
.heart {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(17, 26, 46, .72); color: var(--cream); z-index: 2;
}
.heart svg { width: 19px; height: 19px; }
.heart[aria-pressed="true"] { color: var(--coral); }
.heart[aria-pressed="true"] svg path { fill: currentColor; }

.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .art { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 12px; }
.empty h3 { color: var(--ink); font-size: 19px; margin-bottom: 6px; }
.link-btn { background: none; border: 0; color: var(--coral); font-weight: 700; cursor: pointer; padding: 6px; font-size: 14px; }

.section { margin-bottom: 26px; }
.rows { display: grid; gap: 10px; }
.row-card { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); }
.row-card .art { width: 60px; height: 60px; border-radius: 14px; flex: none; }
.row-card .txt { flex: 1; min-width: 0; }
.row-card strong { display: block; font-family: var(--font-head); font-size: 16px; }
.row-card small { color: var(--muted); font-weight: 700; font-size: 13px; }
.row-card .chev { width: 20px; height: 20px; color: var(--muted); flex: none; }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px; background: var(--coral); color: #fff; font-weight: 700; font-size: 17px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(233, 115, 91, .3); transition: transform .08s;
}
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.light { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.btn.small { min-height: 42px; padding: 0 18px; font-size: 15px; }
.btn svg { width: 20px; height: 20px; }

/* ---------- Formulář na míru ---------- */
.intro-card { display: flex; gap: 14px; align-items: center; background: var(--coral-soft); border-radius: var(--r-lg); padding: 14px; margin-bottom: 16px; }
.intro-card .art { width: 74px; height: 74px; border-radius: 18px; flex: none; }
.intro-card h2 { font-size: 20px; }
.intro-card p { margin: 4px 0 0; color: var(--ink-2); font-size: 14.5px; }
.form { display: grid; gap: 14px; }
.fcard { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); border: 0; margin: 0; min-width: 0; }
.fcard legend, .fcard .label { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.fcard .opt { font-family: var(--font-ui); font-size: 13px; color: var(--muted); font-weight: 700; }
.fcard input[type=text] {
  clear: both; display: block; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 17px; font-weight: 700;
}
.fcard input[type=text]::placeholder { color: #6f7a98; font-weight: 400; }
.fcard input[type=text]:focus { outline: none; border-color: var(--coral); }
.opts { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt-tile { position: relative; }
.opt-tile input { position: absolute; opacity: 0; pointer-events: none; }
.opt-tile > span {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 7px 10px 7px 7px; border-radius: 14px;
  background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; font-weight: 700; font-size: 15px;
}
.opt-tile.text > span { justify-content: center; padding-left: 10px; }
.opt-tile .art { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.opt-tile input:checked + span { background: var(--coral-soft); box-shadow: inset 0 0 0 2px var(--coral); }
.opt-tile input:focus-visible + span { outline: 3px solid var(--mustard); outline-offset: 2px; }
.note { color: var(--muted); font-size: 13.5px; text-align: center; margin: 4px 0 0; }
.error { clear: both; color: var(--coral); font-weight: 700; margin: 10px 0 0; }

/* ---------- Čtečka (noční režim) ---------- */
.reader {
  position: fixed; inset: 0; z-index: 50; background: var(--night); color: var(--cream);
  display: flex; flex-direction: column; color-scheme: dark;
}
.r-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; max-width: 640px; width: 100%; margin: 0 auto; }
.r-top .grow { flex: 1; min-width: 0; text-align: center; }
.r-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sub { font-size: 12.5px; color: var(--night-muted); font-weight: 700; }
.r-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--night-2); color: var(--cream); cursor: pointer; flex: none; }
.r-btn svg { width: 22px; height: 22px; }
.r-btn.on { background: var(--mustard); color: var(--ink-dark); }
.progress { display: flex; gap: 4px; max-width: 612px; width: calc(100% - 28px); margin: 0 auto 10px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--night-3); transition: background .3s; }
.progress i.done { background: var(--mustard); }

.r-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.r-inner { max-width: 640px; margin: 0 auto; padding: 0 16px 20px; }
.stage {
  position: relative; aspect-ratio: 4 / 3; width: min(100%, calc(46dvh * 4 / 3)); margin: 0 auto;
  border-radius: 24px; overflow: hidden; background: var(--night-2);
}
.stage .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video.scene { object-fit: cover; display: block; }
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27160%27 height=%27160%27%3E%3Cfilter id=%27n%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%27.85%27 numOctaves=%272%27 stitchTiles=%27stitch%27/%3E%3CfeColorMatrix values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0%27/%3E%3C/filter%3E%3Crect width=%27100%25%27 height=%27100%25%27 filter=%27url(%23n)%27/%3E%3C/svg%3E");
}
.page-text { font-family: var(--font-read); line-height: 1.7; padding: 18px 4px 6px; margin: 0; }
.fade-in { animation: fadeIn .45s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sfx {
  display: inline; padding: 0 .1em; border: 0; border-radius: 6px; background: none; cursor: pointer;
  color: var(--mustard); font: inherit; line-height: inherit; font-weight: 700;
  text-decoration: underline wavy; text-decoration-thickness: 1.5px; text-underline-offset: .28em;
  text-decoration-color: rgba(242, 181, 68, .7);
}
.sfx.played { color: #ebd29c; text-decoration-style: solid; text-decoration-color: rgba(235, 210, 156, .35); }
.sfx.next { background: var(--night-3); }
.sfx.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); display: inline-block; }
@keyframes pop { 40% { transform: scale(1.18) rotate(-3deg); color: var(--coral); } }

.r-foot { padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; display: grid; gap: 8px; }
.r-nav { display: flex; align-items: center; gap: 12px; }
.r-nav .prev { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--night-2); color: var(--cream); display: grid; place-items: center; cursor: pointer; flex: none; }
.r-nav .prev:disabled { opacity: .35; cursor: default; }
.r-nav .prev svg, .r-nav .next svg { width: 24px; height: 24px; }
.r-nav .next {
  flex: 1; min-height: 54px; border: 0; border-radius: 999px; background: var(--mustard); color: var(--ink-dark);
  font-weight: 700; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.status {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; border-radius: 16px;
  background: var(--night-2); font-size: 14px; font-weight: 700;
}
.status[hidden] { display: none; }
.status .grow { flex: 1; }
.status.warn { background: #4a2f3a; }
.status .btn { box-shadow: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #7bd88f; flex: none; animation: blinkdot 1.4s infinite; }
@keyframes blinkdot { 50% { opacity: .3; } }

/* Závěrečná obrazovka „Dobrou noc“ – scéna v okénku jako ostatní stránky, pod ní text a tlačítka */
.r-foot[hidden] { display: none; }
.end-screen { animation: endIn .8s ease; }
@keyframes endIn { from { opacity: 0; } to { opacity: 1; } }
.end-content {
  width: 100%; max-width: 480px; margin: 0 auto; text-align: center;
  padding: 18px 4px calc(16px + env(safe-area-inset-bottom)); animation: endUp 1s .2s ease both;
}
@keyframes endUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.end-kicker { margin: 0; color: var(--night-muted); font-size: 14px; font-weight: 700; }
.end-content h2 { font-size: 46px; color: #fff; margin: 2px 0 0; letter-spacing: .01em; }
.end-sub { margin: 2px 0 20px; color: var(--mustard); font-family: var(--font-head); font-size: 20px; }
.end-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.end-act {
  display: grid; justify-items: center; gap: 4px; padding: 12px 6px 10px; border: 0; border-radius: 18px;
  background: rgba(255, 255, 255, .09); color: var(--cream); font-weight: 700; font-size: 14px; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.end-act svg { width: 24px; height: 24px; }
.end-act:active { transform: scale(.97); }
.end-act[aria-pressed="true"] { color: var(--coral); }
.end-act[aria-pressed="true"] svg path { fill: currentColor; }
.next-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 18px;
  background: rgba(255, 255, 255, .06); text-align: left; color: var(--cream);
}
.next-card .art { width: 52px; height: 52px; border-radius: 14px; flex: none; }
.next-txt { flex: 1; min-width: 0; display: grid; }
.next-txt small { color: var(--mustard); font-weight: 700; font-size: 12.5px; }
.next-txt strong { font-family: var(--font-head); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-card > svg { width: 20px; height: 20px; color: var(--night-muted); flex: none; }

/* ---------- Spodní panel s nastavením ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(5, 9, 20, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 560px; background: var(--surface); color: var(--ink); border-radius: 26px 26px 0 0; box-shadow: inset 0 1px 0 #34467a;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .25s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font-size: 20px; margin-bottom: 14px; }
.srow { display: grid; gap: 8px; margin-bottom: 16px; }
.srow > span { font-weight: 700; font-size: 14.5px; color: var(--ink-2); }
.srow input[type=range] { width: 100%; accent-color: var(--coral); height: 28px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg2 button { min-height: 42px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg2 button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.seg2 small { color: var(--coral); font-size: 11px; }
.stepper { display: flex; gap: 8px; }
.stepper button { flex: 1; min-height: 42px; border: 0; border-radius: 12px; background: var(--surface-2); font-weight: 700; cursor: pointer; font-family: var(--font-head); font-size: 16px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Dialog ---------- */
dialog { max-width: min(400px, calc(100% - 32px)); border: 0; border-radius: 26px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(13, 20, 38, .6); }
.dlg-art { height: 120px; }
.dlg-body { padding: 18px 20px 20px; }
dialog h3 { font-size: 21px; margin-bottom: 8px; }
dialog p { color: var(--ink-2); margin: 0 0 10px; font-size: 15px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Animace ve scénách ---------- */
.scene .a-twinkle { animation: tw 3.4s ease-in-out infinite; }
@keyframes tw { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.scene .a-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-1.8deg); } 50% { transform: rotate(1.8deg); } }
.scene .a-drift { animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-16px); } to { transform: translateX(16px); } }
.scene .a-float { animation: float 4.5s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, -7px); } }
.scene .a-blink { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.scene .a-breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.03); } }
.scene .a-bob { transform-box: fill-box; transform-origin: 50% 100%; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
.scene .a-rain { animation: rain 1s linear infinite; }
@keyframes rain { from { transform: translateY(-20px); } to { transform: translateY(330px); } }
.scene .a-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame .8s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scale(1, 1); } to { transform: scale(.9, 1.12); } }
.scene .a-steam { animation: steam 3s ease-out infinite; }
@keyframes steam { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
.scene .a-glow { animation: glow 3.2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.scene .a-ripple { transform-box: fill-box; transform-origin: center; animation: ripple 4.2s ease-out infinite; }
@keyframes ripple { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
.scene .a-shimmer { animation: shimmer 2.6s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { opacity: .9; transform: translateX(0); } 50% { opacity: .3; transform: translateX(4px); } }
.scene .a-flow { animation: flow 2.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -40; } }
.scene .a-wave { animation: wave 5s ease-in-out infinite alternate; }
@keyframes wave { from { transform: translateX(-12px); } to { transform: translateX(12px); } }
.scene .a-spin { transform-box: fill-box; transform-origin: center; animation: spin 50s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scene .a-flap-l { transform-box: fill-box; transform-origin: 100% 80%; animation: flapl .6s ease-in-out infinite alternate; }
@keyframes flapl { from { transform: rotate(8deg); } to { transform: rotate(-14deg); } }
.scene .a-flap-r { transform-box: fill-box; transform-origin: 0% 80%; animation: flapr .6s ease-in-out infinite alternate; }
@keyframes flapr { from { transform: rotate(-8deg); } to { transform: rotate(14deg); } }
.scene .a-wing { transform-box: fill-box; transform-origin: center; animation: wing .28s ease-in-out infinite alternate; }
@keyframes wing { to { transform: scaleX(.35); } }
.scene .a-wag { transform-box: fill-box; transform-origin: 100% 100%; animation: wag .5s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
.scene .a-wave-arm { transform-box: fill-box; transform-origin: 50% 10%; animation: wavearm 1s ease-in-out infinite alternate; }
@keyframes wavearm { from { transform: rotate(-10deg); } to { transform: rotate(-150deg); } }
.scene .a-zzz { animation: zzz 3.2s ease-in-out infinite; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -12px); } }
.scene .a-comet { animation: comet 10s linear infinite; }
@keyframes comet { 0% { transform: translate(-90px, 40px); opacity: 0; } 8% { opacity: 1; } 55% { opacity: 1; } 65%, 100% { transform: translate(480px, -150px); opacity: 0; } }
.scene .a-beam { animation: glow 2.8s ease-in-out infinite; }
.scene .a-light { animation: light 1.6s ease-in-out infinite; }
@keyframes light { 50% { opacity: .35; } }
.scene .a-gate { transform-box: fill-box; transform-origin: 0% 50%; animation: gate 6s ease-in-out infinite; }
@keyframes gate { 0%, 70%, 100% { transform: scaleX(1); } 80% { transform: scaleX(.86); } }

@media (prefers-reduced-motion: reduce) {
  .scene *, .sfx.pop, .fade-in, .sheet { animation: none !important; }
}
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Domů v2: hero, rychlé dlaždice, poličky ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; }
.topbar .grow { flex: 1; min-width: 0; }
.topbar .center { text-align: center; }
.brand { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 { font-size: 27px; letter-spacing: .2px; }
.small-title { font-size: 21px; }
.round-btn.ghost { visibility: hidden; }
.learn-logo { display: grid; place-items: center; background: linear-gradient(160deg, #3f8f78, #2a6656); color: #fff; }
.learn-logo svg { width: 24px; height: 24px; }

.hero-card { position: relative; display: block; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 4 / 3.3; background: var(--night-2); box-shadow: var(--shadow); isolation: isolate; }
.hero-card .hero-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-card .art.hero-vid img { width: 100%; height: 100%; object-fit: cover; }
.hero-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,16,32,0) 35%, rgba(10,16,32,.55) 62%, rgba(10,16,32,.94) 100%); }
.hero-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; display: grid; gap: 4px; justify-items: start; }
.hero-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--mustard); background: rgba(17,26,46,.6); padding: 4px 10px 4px 8px; border-radius: 999px; backdrop-filter: blur(6px); }
.hero-tag svg { width: 15px; height: 15px; }
.hero-title { font-family: var(--font-head); font-size: 29px; line-height: 1.1; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero-meta { color: var(--night-muted); font-weight: 700; font-size: 13.5px; }
.hero-play { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; background: var(--mustard); color: var(--ink-dark); border-radius: 999px; padding: 10px 20px 10px 14px; font-weight: 700; font-size: 16px; box-shadow: 0 6px 18px rgba(242,181,68,.3); }
.hero-play svg { width: 20px; height: 20px; }
.hero-card:active .hero-play { transform: scale(.97); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; }
.quick-tile { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-lg); box-shadow: var(--shadow); min-height: 118px; }
.quick-tile strong { display: block; font-family: var(--font-head); font-size: 17px; color: #fff; }
.quick-tile small { display: block; font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,.75); line-height: 1.3; margin-top: 2px; }
.quick-tile .qi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.16); color: #fff; }
.quick-tile .qi svg { width: 23px; height: 23px; }
.quick-tile.learn { background: linear-gradient(150deg, #3f8f78, #285e50); }
.quick-tile.make { background: linear-gradient(150deg, #d9705a, #a24c4a); }

.continue { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 14px 10px 10px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.continue .art { width: 54px; height: 54px; border-radius: 14px; flex: none; }
.continue > span { flex: 1; min-width: 0; display: grid; }
.continue small { color: var(--mustard); font-weight: 700; font-size: 12px; }
.continue strong { font-family: var(--font-head); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue em { font-style: normal; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.continue > svg { width: 22px; height: 22px; color: var(--mustard); flex: none; }

.age-wrap { margin: 22px 0 4px; }
.age-label { margin: 0 0 8px; font-family: var(--font-head); font-size: 19px; }
.age-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.age-pills::-webkit-scrollbar { display: none; }
.age-pills button { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink-2); font-weight: 700; font-size: 14.5px; cursor: pointer; }
.age-pills button[aria-pressed="true"] { background: var(--cream); border-color: var(--cream); color: var(--ink-dark); }

.shelf { margin-top: 24px; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.shelf-head h2 { display: flex; align-items: center; gap: 9px; font-size: 20px; }
.shelf-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--mustard); }
.shelf-ico svg { width: 18px; height: 18px; }
.shelf-all { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-weight: 700; font-size: 14px; padding: 6px 0 6px 8px; }
.shelf-all svg { width: 15px; height: 15px; }
.shelf-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 8px; scroll-padding: 0 16px; }
.shelf-row::-webkit-scrollbar { display: none; }
.pcard { flex: none; width: 142px; scroll-snap-align: start; display: grid; gap: 3px; align-content: start; }
.pcard-img { position: relative; display: block; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.pcard-img .art { aspect-ratio: 3 / 4; width: 100%; }
.pcard-img .art img { width: 100%; height: 100%; object-fit: cover; }
.pbadge { position: absolute; right: 7px; bottom: 7px; background: rgba(12,18,34,.78); color: var(--cream); font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(4px); }
.pstars { position: absolute; left: 7px; top: 7px; display: inline-flex; align-items: center; gap: 3px; background: var(--mustard); color: var(--ink-dark); font-size: 11.5px; font-weight: 700; padding: 3px 8px 3px 6px; border-radius: 999px; }
.pstars svg { width: 12px; height: 12px; }
.pcard strong { font-family: var(--font-head); font-size: 15px; line-height: 1.2; margin-top: 6px; }
.pcard small { color: var(--muted); font-size: 12px; font-weight: 700; }
@media (min-width: 520px) { .pcard { width: 160px; } }

/* ---------- Nauč se číst ---------- */
.learn-intro { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.li-demo { font-size: 22px; font-weight: 700; padding: 10px 12px 14px; color: var(--muted); }
.li-demo .cur { color: var(--ink-dark); background: var(--mustard); border-radius: 10px; padding: 1px 8px; box-shadow: 0 0 18px rgba(242,181,68,.55); }
.li-demo span:first-child, .li-demo span:nth-child(2) { color: #7fc4a4; }
.learn-intro ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.learn-intro li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.learn-intro li svg { width: 20px; height: 20px; flex: none; color: var(--mustard); margin-top: 1px; }
.learn-intro b { color: var(--ink); }

.reader.learn .stage.small { width: min(100%, calc(24dvh * 4 / 3)); border-radius: 18px; }
.learn-text { font-family: var(--font-read); line-height: 1.9; padding: 16px 2px 10px; margin: 0; color: var(--cream); }
.lw { border-radius: 8px; padding: 0 2px; cursor: pointer; transition: color .25s, background .25s, opacity .25s; display: inline-block; line-height: 1.35; }
.lw.read { color: #7fc4a4; }
.lw.cur { background: var(--mustard); color: var(--ink-dark); padding: 0 6px; box-shadow: 0 0 0 3px rgba(242,181,68,.25), 0 0 22px rgba(242,181,68,.55); font-weight: 700; transform: scale(1.12); }
.lw.pop { animation: pop .4s ease; }
.l-next { margin: 8px 0 4px; }
.l-dock { flex: none; background: var(--night-2); border-radius: 24px 24px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.25); }
.l-dock > * { max-width: 612px; margin-left: auto; margin-right: auto; }
.l-status { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; padding: 8px 12px; border-radius: 12px; background: var(--night-3); margin-bottom: 10px; }
.l-status[hidden] { display: none; }
.l-status.warn { background: #4a2f3a; }
.l-status .grow { flex: 1; }
.l-focus { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; width: 100%; min-height: 84px; border: 0; border-radius: 20px; background: var(--night); color: var(--mustard); font-family: var(--font-read); font-weight: 700; font-size: clamp(38px, 11vw, 58px); line-height: 1.1; cursor: pointer; padding: 8px 12px; }
.l-focus i { font-style: normal; color: var(--night-muted); opacity: .6; }
.l-focus.nudge { animation: nudge 1.6s ease-in-out infinite; }
.l-focus.done { color: var(--cream); font-size: 26px; flex-direction: column; font-family: var(--font-head); }
.l-focus .stars { display: flex; gap: 6px; color: var(--mustard); }
.l-focus .stars svg { width: 34px; height: 34px; animation: pop .6s ease both; }
.l-focus .stars svg:nth-child(2) { animation-delay: .15s; }
.l-focus .stars svg:nth-child(3) { animation-delay: .3s; }
@keyframes nudge { 50% { box-shadow: 0 0 0 4px rgba(242,181,68,.35); transform: scale(1.02); } }
.l-acts { display: grid; grid-template-columns: 48px 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.l-act { min-height: 54px; border: 0; border-radius: 16px; background: var(--night-3); color: var(--cream); font-weight: 700; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.l-act svg { width: 22px; height: 22px; }
.l-act.mic[aria-pressed="true"] { background: #3f8f78; color: #fff; }
.l-act.ok { background: var(--mustard); color: var(--ink-dark); }
.l-act:active { transform: scale(.97); }
.l-panel { position: absolute; inset: 0; background: rgba(5,9,20,.6); display: flex; align-items: flex-end; z-index: 5; }
.l-panel[hidden] { display: none; }
.l-panel-in { width: 100%; max-width: 560px; margin: 0 auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 4px; }
.l-panel-in h3 { font-size: 20px; margin-bottom: 10px; }
.l-panel-in .filter-label { margin-top: 10px; }
.l-panel-in .btn { margin-top: 16px; }
.l-panel-in .hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.seg3 { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg3 button { flex: 1; min-height: 42px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg3 button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.lwrap { white-space: nowrap; }
.reader.learn .r-inner { padding-bottom: 28px; }

/* =====================================================================
   Vzhled v3 – dětská aplikace: sytá fialová noc, bonbonové barvy,
   zakulacené písmo Baloo 2, „gumová“ 3D tlačítka, barvy podle druhu pohádky
   ===================================================================== */
body {
  background:
    radial-gradient(1.5px 1.5px at 12% 8%, rgba(255,255,255,.75) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 4%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 18%, rgba(255,240,190,.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 14%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 26%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(120% 60% at 50% -10%, #3a2b86 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-weight: 700;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: .1px; }

/* --- hlavička s maskotem --- */
.topbar { padding: 6px 0 16px; }
.mascot { width: 62px; height: 62px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--sun); }
.bubble { position: relative; background: var(--surface); border-radius: 20px; padding: 9px 14px 10px; min-width: 0; box-shadow: 0 4px 0 rgba(10,6,35,.35); }
.bubble::before { content: ""; position: absolute; left: -8px; top: 22px; border: 9px solid transparent; border-left: 0; border-right-color: var(--surface); }
.bubble .hello { color: var(--sun); font-size: 13.5px; font-weight: 800; }
.bubble h1 { font-size: 20px; line-height: 1.15; }
.brand h1 { letter-spacing: 0; }
.round-btn { width: 48px; height: 48px; background: var(--surface-2); box-shadow: 0 4px 0 rgba(10,6,35,.4); }
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(10,6,35,.4); }

/* --- velká karta „Dnes večer“ --- */
.hero-card { border-radius: 32px; box-shadow: 0 0 0 4px var(--sun), 0 10px 0 var(--sun-d), 0 22px 40px rgba(10,6,35,.45); margin: 4px 4px 0; }
.hero-tag { background: var(--sun); color: var(--ink-dark); font-weight: 800; backdrop-filter: none; padding: 5px 12px 5px 9px; }
.hero-title { font-size: 31px; font-weight: 700; }
.hero-meta { color: #e6defc; }
.hero-play { font-family: var(--font-head); font-weight: 600; font-size: 18px; padding: 11px 22px 11px 16px; box-shadow: 0 5px 0 var(--sun-d); }
.hero-card:active .hero-play { transform: translateY(3px); box-shadow: 0 2px 0 var(--sun-d); }

/* --- rychlé dlaždice --- */
.quick { gap: 14px; margin: 26px 0 4px; }
.quick-tile { position: relative; overflow: hidden; min-height: 132px; border-radius: 26px; padding: 14px; gap: 8px; justify-content: flex-end; }
.quick-tile.learn { background: var(--mint); box-shadow: 0 6px 0 var(--mint-d); }
.quick-tile.make { background: var(--pink); box-shadow: 0 6px 0 var(--pink-d); }
.quick-tile:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.quick-tile .qart { position: absolute; right: -14px; top: -14px; width: 92px; height: 92px; border-radius: 50%; opacity: .95; box-shadow: 0 0 0 5px rgba(255,255,255,.25); }
.quick-tile .qi { position: absolute; left: 14px; top: 14px; background: rgba(255,255,255,.28); border-radius: 14px; }
.quick-tile strong { font-size: 18px; font-weight: 600; text-shadow: 0 1px 0 rgba(0,0,0,.12); }
.quick-tile small { color: rgba(255,255,255,.92); font-weight: 800; }

/* --- pokračovat --- */
.continue { border-radius: 22px; background: var(--surface); box-shadow: 0 5px 0 rgba(10,6,35,.4); margin-top: 18px; }
.continue small { color: var(--sun); font-weight: 800; }

/* --- výběr věku: barevné „bonbony“ --- */
.age-wrap { margin: 28px 0 4px; }
.age-label { font-size: 21px; font-weight: 600; }
.age-pills { gap: 10px; padding: 2px 16px 8px; }
.age-pills button {
  min-height: 46px; padding: 0 18px; border: 0; border-radius: 16px; font-family: var(--font-head); font-weight: 600; font-size: 16px;
  background: var(--surface); color: var(--ink-2); box-shadow: 0 4px 0 rgba(10,6,35,.4); transition: transform .08s;
}
.age-pills button[aria-pressed="true"] { background: var(--g, var(--sun)); color: var(--ink-dark); box-shadow: 0 4px 0 var(--gd, var(--sun-d)); }
.age-pills button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(10,6,35,.4); }

/* --- poličky podle druhu (každý druh má svou barvu) --- */
.shelf { margin-top: 30px; }
.shelf-head h2 { font-size: 22px; font-weight: 600; gap: 10px; }
.shelf-ico { width: 38px; height: 38px; border-radius: 13px; background: var(--g, var(--sun)); color: var(--ink-dark); box-shadow: 0 4px 0 var(--gd, var(--sun-d)); transform: rotate(-6deg); }
.shelf-ico svg { width: 22px; height: 22px; }
.shelf-all { background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 12px 7px 14px; font-weight: 800; font-size: 13.5px; box-shadow: 0 3px 0 rgba(10,6,35,.4); }
.shelf-row { gap: 14px; padding: 6px 16px 14px; }
.pcard { width: 148px; }
.pcard-img { border-radius: 22px; box-shadow: 0 0 0 3px var(--g, var(--surface-3)), 0 7px 0 var(--gd, var(--surface-2)); margin: 3px 3px 0; transition: transform .12s; }
.pcard:active .pcard-img { transform: translateY(4px); }
.pbadge { background: var(--ink); color: var(--ink-dark); font-weight: 800; }
.pstars { background: var(--sun); }
.pcard strong { font-size: 16px; font-weight: 600; margin-top: 10px; }
.pcard small { color: var(--muted); font-weight: 800; }

/* --- mřížka (kategorie, Moje) --- */
.card { border-radius: 24px; background: var(--surface); box-shadow: 0 6px 0 rgba(10,6,35,.4); }
.card strong { font-weight: 600; font-size: 17px; }
.pill.age { background: var(--sun); color: var(--ink-dark); font-weight: 800; }
.heart { background: var(--ink); color: var(--ink-dark); box-shadow: 0 3px 0 rgba(10,6,35,.35); }
.heart[aria-pressed="true"] { color: var(--pink); }
.row-card { border-radius: 20px; box-shadow: 0 5px 0 rgba(10,6,35,.4); }
.row-card strong, .intro-card h2, .fcard legend, .fcard .label { font-weight: 600; }

/* --- tlačítka: gumová 3D --- */
.btn { font-family: var(--font-head); font-weight: 600; font-size: 18px; border-radius: 18px; background: var(--pink); box-shadow: 0 5px 0 var(--pink-d); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--pink-d); }
.btn.light { background: var(--surface-2); box-shadow: 0 4px 0 rgba(10,6,35,.45); }
.fcard, .intro-card { border-radius: 24px; }
.fcard { box-shadow: 0 6px 0 rgba(10,6,35,.4); }
.opt-tile > span { border-radius: 16px; }

/* --- spodní lišta: plovoucí, aktivní záložka v barevné bublině --- */
.tabbar { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 0; border: 0; border-radius: 26px; background: var(--surface); box-shadow: 0 6px 0 rgba(10,6,35,.45), 0 14px 30px rgba(10,6,35,.45); max-width: 540px; margin: 0 auto; }
.tabbar-in { height: var(--tabbar-h); padding: 0 6px; }
.tab { color: var(--muted); font-size: 12px; font-weight: 800; gap: 2px; }
.tab svg { width: 26px; height: 26px; padding: 0; }
.tab[aria-current="page"] { color: var(--ink-dark); }
.tab[aria-current="page"]::before { content: ""; position: absolute; inset: 9px 6px; top: 9px; height: auto; width: auto; border-radius: 18px; background: var(--sun); box-shadow: 0 3px 0 var(--sun-d); z-index: -1; }
.tab { z-index: 0; isolation: isolate; }
.screen { padding-bottom: calc(var(--tabbar-h) + 44px + env(safe-area-inset-bottom)); }

/* --- Nauč se číst: úvod --- */
.learn-logo { width: 62px; height: 62px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--mint); }
.learn-logo svg { width: 32px; height: 32px; }
.learn-intro { border-radius: 26px; box-shadow: 0 6px 0 rgba(10,6,35,.4); }
.li-demo { font-family: var(--font-read); font-size: 26px; text-align: center; }
.li-demo .cur { background: var(--sun); }
.li-demo span:first-child, .li-demo span:nth-child(2) { color: var(--mint); }
.learn-intro li svg { color: var(--sun); }

/* --- čtečka a Nauč se číst: noční fialová --- */
.reader { background: radial-gradient(120% 50% at 50% 0%, #2f2470 0%, var(--night) 70%); }
.r-title { font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.r-btn { background: var(--night-3); box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.progress i { height: 6px; border-radius: 3px; }
.stage { border-radius: 26px; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.r-nav .next { font-family: var(--font-head); font-weight: 600; font-size: 18px; border-radius: 20px; box-shadow: 0 5px 0 var(--sun-d); }
.r-nav .next:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sun-d); }
.r-nav .prev { background: var(--night-3); box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.sfx { color: var(--sun); text-decoration-color: rgba(255,201,60,.7); }

.l-dock { background: var(--night-2); border-radius: 28px 28px 0 0; }
.l-focus { border-radius: 22px; background: var(--night); box-shadow: inset 0 0 0 3px var(--night-3); color: var(--sun); }
.l-act { font-family: var(--font-head); font-weight: 600; font-size: 14px; border-radius: 18px; background: var(--night-3); box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.l-act:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.l-act.mic[aria-pressed="true"] { background: var(--mint); color: var(--ink-dark); box-shadow: 0 4px 0 var(--mint-d); }
.l-act.ok { background: var(--sun); box-shadow: 0 4px 0 var(--sun-d); }
.lw.read { color: var(--mint); }
.lw.cur { background: var(--sun); }
.sheet, dialog, .l-panel-in { background: var(--surface); }
.seg3 button[aria-pressed="true"], .seg2 button[aria-pressed="true"] { background: var(--sun); color: var(--ink-dark); }
.quick-tile { min-height: 150px; }
.quick-tile .qart { width: 78px; height: 78px; right: -10px; top: -10px; }
.quick-tile > span:last-child { position: relative; z-index: 1; }
.page-text, .learn-text { font-weight: 400; }
.lw.cur, .sfx { font-weight: 700; }
.r-nav .narr { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--mint); color: var(--ink-dark); display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 4px 0 var(--mint-d); }
.r-nav .narr[hidden] { display: none; }
.r-nav .narr svg { width: 26px; height: 26px; }
.r-nav .narr.on { background: var(--pink); color: #fff; box-shadow: 0 4px 0 var(--pink-d); animation: narrPulse 2s ease-in-out infinite; }
@keyframes narrPulse { 50% { box-shadow: 0 4px 0 var(--pink-d), 0 0 0 7px rgba(255,111,145,.25); } }

/* ---------- Účet, Premium, zámky ---------- */
.ov { position: fixed; inset: 0; z-index: 95; background: rgba(12, 8, 34, .72); display: flex; align-items: flex-end; justify-content: center; animation: ovIn .22s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ov.out { animation: ovOut .22s ease forwards; }
@keyframes ovIn { from { opacity: 0; } }
@keyframes ovOut { to { opacity: 0; } }
.ov-card {
  position: relative; width: 100%; max-width: 520px; max-height: 94dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(120% 40% at 50% 0%, #3d2f8c 0%, var(--surface) 60%); color: var(--ink);
  border-radius: 30px 30px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); text-align: center;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .4); animation: up .3s cubic-bezier(.2, .9, .3, 1.1);
}
.ov.gate .ov-card, .ov.yay .ov-card { border-radius: 30px; margin: auto 16px; max-width: 400px; }
.ov.gate, .ov.yay { align-items: center; }
.ov-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: var(--ink); display: grid; place-items: center; cursor: pointer; z-index: 2; }
.ov-x svg { width: 20px; height: 20px; }
.ov-card h2 { font-size: 27px; line-height: 1.1; margin: 6px 0 6px; font-weight: 700; }
.ov-sub { color: var(--ink-2); margin: 0 auto 14px; max-width: 380px; font-size: 15.5px; line-height: 1.4; }

.ticks { list-style: none; padding: 0; margin: 0 auto 16px; display: grid; gap: 9px; text-align: left; max-width: 400px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); line-height: 1.35; }
.ticks li b { color: var(--ink); }
.ticks svg { flex: none; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--mint); color: var(--ink-dark); stroke-width: 3; }

.btn.big { min-height: 58px; font-size: 19px; border-radius: 20px; }
.btn.block.big { width: 100%; }

/* registrace */
.auth-hero { position: relative; width: 112px; height: 140px; margin: 4px auto 10px; }
.auth-cover { width: 112px; height: 140px; border-radius: 22px; overflow: hidden; display: block; box-shadow: 0 0 0 4px var(--sun), 0 8px 0 var(--sun-d); transform: rotate(-4deg); }
.auth-cover img { width: 100%; height: 100%; object-fit: cover; }
.auth-badge { position: absolute; right: -26px; bottom: -6px; display: inline-flex; align-items: center; gap: 4px; background: var(--mint); color: var(--ink-dark); font-weight: 800; font-size: 13px; padding: 5px 11px 5px 8px; border-radius: 999px; box-shadow: 0 3px 0 var(--mint-d); transform: rotate(6deg); }
.auth-badge svg { width: 14px; height: 14px; }
.au-form { display: grid; gap: 10px; text-align: left; max-width: 400px; margin: 0 auto; }
.fld { display: grid; gap: 5px; }
.fld[hidden], .chk[hidden], .ticks[hidden] { display: none; }
.fld span { font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.fld input { min-height: 52px; padding: 0 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 17px; font-weight: 700; }
.fld input::placeholder { color: #8a7fc0; font-weight: 600; }
.fld input:focus { outline: none; border-color: var(--sun); }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.chk input { width: 22px; height: 22px; accent-color: var(--sun); flex: none; margin: 0; }
.au-err { color: #ffb3c4; font-weight: 800; font-size: 14px; margin: 0; text-align: center; }
.au-err[hidden] { display: none; }
.au-switch { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; }
.au-switch .link-btn { color: var(--sun); font-weight: 800; font-size: 14.5px; }

/* Premium */
.pw-fan { position: relative; height: 150px; margin: 6px auto 8px; width: 230px; }
.pw-c { position: absolute; top: 10px; width: 96px; height: 128px; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 3px #fff3, 0 10px 24px rgba(0,0,0,.4); }
.pw-c .art, .pw-c img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pw-c.c0 { left: 63px; top: 0; z-index: 3; width: 104px; height: 138px; box-shadow: 0 0 0 4px var(--sun), 0 8px 0 var(--sun-d), 0 16px 30px rgba(0,0,0,.45); }
.pw-c.c1 { left: 0; transform: rotate(-12deg); z-index: 1; }
.pw-c.c2 { right: 0; transform: rotate(12deg); z-index: 2; }
.pw-crown { position: absolute; left: 50%; top: -14px; z-index: 4; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; background: var(--sun); color: var(--ink-dark); display: grid; place-items: center; box-shadow: 0 4px 0 var(--sun-d); animation: bob 3s ease-in-out infinite; }
.pw-crown svg { width: 24px; height: 24px; }
.pw-kicker { margin: 4px 0 0; color: var(--sun); font-weight: 900; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px auto 14px; max-width: 420px; }
.plan {
  position: relative; display: grid; gap: 2px; justify-items: center; padding: 18px 8px 14px; border-radius: 20px; cursor: pointer;
  background: var(--bg); color: var(--ink); border: 3px solid var(--line); font: inherit; transition: transform .1s, border-color .15s;
}
.plan.on { border-color: var(--sun); background: #2f2468; box-shadow: 0 5px 0 var(--sun-d); transform: translateY(-2px); }
.plan-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--pink); color: #fff; font-size: 11.5px; font-weight: 900; padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 0 var(--pink-d); }
.plan-name { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.plan-price { font-family: var(--font-head); font-size: 25px; font-weight: 800; line-height: 1.1; }
.plan-price small { font-size: 13px; color: var(--muted); font-weight: 700; }
.plan-note { font-size: 12.5px; font-weight: 800; color: var(--mint); }
.pw-steps { list-style: none; padding: 0; margin: 0 auto 16px; max-width: 400px; display: grid; gap: 0; text-align: left; position: relative; }
.pw-steps li { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 8px; padding: 6px 0 6px 22px; position: relative; font-size: 14px; color: var(--ink-2); }
.pw-steps li::before { content: ""; position: absolute; left: 4px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(255,201,60,.2); }
.pw-steps li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 50%; height: 100%; width: 2px; background: rgba(255,201,60,.35); }
.pw-steps b { color: var(--ink); font-weight: 900; }
.pw-cta { background: var(--sun); color: var(--ink-dark); box-shadow: 0 6px 0 var(--sun-d), 0 10px 30px rgba(255,201,60,.3); animation: ctaPulse 2.4s ease-in-out infinite; }
.pw-cta:active { box-shadow: 0 2px 0 var(--sun-d); }
@keyframes ctaPulse { 50% { box-shadow: 0 6px 0 var(--sun-d), 0 10px 40px rgba(255,201,60,.55); } }
.pw-fine { font-size: 12.5px; color: var(--muted); margin: 10px auto 2px; max-width: 380px; font-weight: 600; line-height: 1.4; }
.pw-skip { color: var(--ink-2); font-weight: 800; font-size: 14px; margin-top: 4px; }
.pw-demo { font-size: 11.5px; color: #8f84c4; margin: 8px 0 0; font-weight: 600; }

/* rodičovský zámek a oslava */
.gate-q { font-family: var(--font-head); font-size: 40px; font-weight: 800; margin: 4px 0 12px; color: var(--sun); }
.gate-f { display: flex; gap: 10px; justify-content: center; }
.gate-f input { width: 110px; min-height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); text-align: center; font: inherit; font-size: 24px; font-weight: 800; }
.gate-f input:focus { outline: none; border-color: var(--sun); }
.ov.gate .au-err { margin-top: 10px; }
.ov.gate .dlg-actions { justify-content: center; }
.yay-stars { display: flex; justify-content: center; gap: 8px; color: var(--sun); margin: 6px 0 4px; }
.yay-stars svg { width: 44px; height: 44px; animation: pop .6s ease both; }
.yay-stars svg:nth-child(2) { animation-delay: .15s; transform: translateY(-10px); }
.yay-stars svg:nth-child(3) { animation-delay: .3s; }

/* zamčené pohádky */
.plock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%; background: rgba(20, 14, 52, .82); color: var(--sun); display: grid; place-items: center; box-shadow: 0 0 0 3px rgba(255,201,60,.5); }
.plock svg { width: 22px; height: 22px; }
.is-locked .art img, .is-locked > a > .art img { filter: saturate(.55) brightness(.72); }
.card { position: relative; }
.card .plock { top: 38%; }

/* pruh na úvodní stránce */
.acc-banner { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 18px; padding: 12px 14px; border: 0; border-radius: 22px; background: var(--mint); color: var(--ink-dark); text-align: left; font: inherit; cursor: pointer; box-shadow: 0 5px 0 var(--mint-d); }
.acc-banner > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.acc-banner b { font-family: var(--font-head); font-size: 17px; font-weight: 700; line-height: 1.15; }
.acc-banner small { font-size: 13px; font-weight: 800; opacity: .8; }
.acc-banner > svg { width: 22px; height: 22px; flex: none; }
.ab-ico { width: 40px; height: 40px; border-radius: 13px; background: rgba(255,255,255,.35); display: grid; place-items: center; flex: none; }
.ab-ico svg { width: 22px; height: 22px; }
.acc-banner.soft { background: var(--surface); color: var(--ink); box-shadow: 0 5px 0 rgba(10,6,35,.4); cursor: default; }
.acc-banner.soft .ab-ico { background: var(--sun); color: var(--ink-dark); }
.acc-banner.pro { background: var(--sun); box-shadow: 0 5px 0 var(--sun-d); }
.acc-banner:active:not(.soft) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }

/* účet v Moje */
.acc-card { background: var(--surface); border-radius: 24px; padding: 16px; box-shadow: 0 6px 0 rgba(10,6,35,.4); margin-bottom: 26px; display: grid; gap: 12px; }
.acc-top { display: flex; align-items: center; gap: 12px; }
.acc-top > div { display: grid; min-width: 0; }
.acc-top b { font-family: var(--font-head); font-size: 19px; font-weight: 700; }
.acc-top small { color: var(--muted); font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.acc-av { width: 52px; height: 52px; border-radius: 50%; flex: none; overflow: hidden; }
.acc-av.letter { display: grid; place-items: center; background: var(--lilac); color: var(--ink-dark); font-family: var(--font-head); font-size: 24px; font-weight: 800; }
.acc-status { display: grid; gap: 2px; background: var(--bg); border-radius: 16px; padding: 10px 12px; }
.acc-status small { color: var(--muted); font-weight: 700; font-size: 13px; }
.acc-plan { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 15px; }
.acc-plan.pro { color: var(--sun); }
.acc-plan svg { width: 18px; height: 18px; }
.acc-acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.acc-acts .link-btn { color: var(--muted); font-weight: 800; margin-left: auto; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 30px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 120; background: var(--ink); color: var(--ink-dark); font-weight: 800; font-size: 14.5px; padding: 11px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ===== Chytránky: přepínač modulů (vlevo nahoře) a hlavní menu ===== */
.apphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mod-trigger {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-width: 0; max-width: 270px; min-height: 56px; padding: 7px 12px 7px 8px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--surface); border: 0; border-radius: 20px; box-shadow: 0 4px 0 rgba(10, 6, 35, .4);
  transition: background-color .15s ease, transform .1s ease;
}
.mod-trigger:hover, .mod-trigger.is-open { background: var(--surface-2); }
.mod-trigger:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(10, 6, 35, .4); }
.mod-trigger:focus-visible, .mod-opt:focus-visible, .dr-item:focus-visible, .dr-mod:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.mod-av {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px;
  background: var(--g); color: var(--ink-dark); box-shadow: inset 0 -3px 0 var(--gd);
}
.mod-av svg { width: 23px; height: 23px; }
.mod-txt { display: flex; flex-direction: column; min-width: 0; }
.mod-kicker { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.mod-name { font-family: var(--font-head); font-size: 20px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-chev { width: 16px; height: 16px; color: var(--muted); }
.burger { flex: none; }

.mod-pop {
  position: fixed; z-index: 96; max-width: calc(100vw - 24px); padding: 8px;
  background: var(--surface); border-radius: 22px; box-shadow: 0 6px 0 rgba(10, 6, 35, .4), 0 22px 50px rgba(5, 3, 20, .55);
  transform-origin: top left; animation: modIn .18s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes modIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.mod-pop-label { padding: 6px 10px 8px; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mod-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px 8px 8px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; background: transparent; border: 0; border-radius: 16px;
}
.mod-opt + .mod-opt { margin-top: 2px; }
.mod-opt:hover, .mod-opt.is-selected { background: var(--surface-2); }
.mod-opt-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mod-opt-txt b { font-family: var(--font-head); font-size: 17.5px; font-weight: 700; line-height: 1.15; }
.mod-opt-txt small { color: var(--muted); font-size: 13px; font-weight: 700; }
.mod-check { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mint); color: var(--ink-dark); flex: none; }
.mod-check svg { width: 16px; height: 16px; stroke-width: 3; }
.mod-soon { flex: none; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--ink-2); font-size: 11.5px; font-weight: 900; }

/* vysouvací menu zprava */
.drawer-wrap { position: fixed; inset: 0; z-index: 94; background: rgba(8, 5, 26, 0); transition: background-color .22s ease; }
.drawer-wrap.on { background: rgba(8, 5, 26, .62); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(350px, 88vw); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--bg-2); border-radius: 28px 0 0 28px; box-shadow: -12px 0 40px rgba(5, 3, 20, .5);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .9, .3, 1);
}
.drawer-wrap.on .drawer { transform: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; }
.dr-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 24px; }
.dr-brand b { font-weight: 700; }
.dr-owl { width: 46px; height: 46px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--sun); }
.dr-acc { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; background: var(--surface); box-shadow: 0 4px 0 rgba(10, 6, 35, .35); }
.dr-acc .acc-av { width: 46px; height: 46px; font-size: 21px; }
.dr-acc-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dr-acc-txt b { font-family: var(--font-head); font-size: 18px; font-weight: 700; line-height: 1.15; }
.dr-acc-txt small { color: var(--muted); font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.dr-plan { flex: none; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--ink-2); font-size: 12px; font-weight: 900; }
.dr-plan.pro { background: var(--sun); color: var(--ink-dark); }
.dr-acc.guest { flex-direction: column; align-items: stretch; }
.dr-acc.guest small { white-space: normal; margin-top: 2px; }
.dr-acc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dr-acc-btns .btn { padding: 0 10px; }
.dr-list { display: grid; gap: 8px; }
.dr-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px 10px 10px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--surface); border: 0; border-radius: 18px; box-shadow: 0 3px 0 rgba(10, 6, 35, .35);
}
.dr-item:hover { background: var(--surface-2); }
.dr-item:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(10, 6, 35, .35); }
.dr-ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--g); color: var(--ink-dark); box-shadow: inset 0 -3px 0 var(--gd); }
.dr-ico svg { width: 21px; height: 21px; }
.dr-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dr-txt b { font-family: var(--font-head); font-size: 16.5px; font-weight: 700; line-height: 1.2; }
.dr-txt small { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.dr-item > svg:last-child { width: 18px; height: 18px; color: var(--muted); flex: none; }
.dr-mods { display: grid; gap: 6px; }
.dr-mods p { margin: 4px 4px 2px; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dr-mod {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px;
  font: inherit; color: var(--ink); cursor: pointer; background: transparent; border: 0; border-radius: 16px; text-align: left;
}
.dr-mod .mod-av { width: 34px; height: 34px; border-radius: 11px; }
.dr-mod .mod-av svg { width: 19px; height: 19px; }
.dr-mod b { flex: 1; font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.dr-mod:hover { background: var(--surface); }
.dr-mod.on { background: var(--surface); box-shadow: inset 0 0 0 2px var(--g); }
.dr-out { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 10px; font: inherit; font-weight: 800; color: var(--pink); background: none; border: 0; cursor: pointer; border-radius: 14px; }
.dr-out svg { width: 21px; height: 21px; }
.dr-out:hover { background: rgba(255, 111, 145, .12); }
.dr-foot { margin: 0; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }

/* „Připravujeme“ a detail předplatného */
.ov.soon, .ov.sub { align-items: center; }
.ov.soon .ov-card, .ov.sub .ov-card { border-radius: 30px; margin: auto 16px; max-width: 400px; }
.soon-ico { display: grid; place-items: center; width: 78px; height: 78px; margin: 8px auto 8px; border-radius: 26px; background: var(--g); color: var(--ink-dark); box-shadow: inset 0 -5px 0 var(--gd), 0 10px 30px rgba(5, 3, 20, .4); }
.soon-ico svg { width: 42px; height: 42px; }
.sub-rows { list-style: none; margin: 10px 0 16px; padding: 4px 14px; border-radius: 18px; background: rgba(255, 255, 255, .06); text-align: left; }
.sub-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14.5px; }
.sub-rows li + li { border-top: 1px solid rgba(255, 255, 255, .08); }
.sub-rows span { color: var(--muted); font-weight: 700; }
.sub-rows b { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-wrap { transition: none; }
  .mod-pop { animation: none; }
}

/* přepínač modulů je v menu: přes celou šířku */
.drawer .mod-trigger { width: 100%; max-width: none; background: var(--surface); }
.drawer .mod-trigger:hover, .drawer .mod-trigger.is-open { background: var(--surface-2); }
.mod-pop { z-index: 97; }

/* žádné viditelné posuvníky nikde (rolování funguje dál) */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* registrace: Google / Apple / e-mail */
.au-social { display: grid; gap: 10px; max-width: 400px; margin: 4px auto 0; }
.au-social[hidden], .au-form[hidden] { display: none; }
.soc-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 18px;
  font: inherit; font-size: 16.5px; font-weight: 800; cursor: pointer; border: 0; border-radius: 18px;
  transition: transform .1s ease, box-shadow .1s ease;
}
.soc-btn svg { width: 22px; height: 22px; flex: none; }
.soc-btn.google { background: #fff; color: #1f1f1f; box-shadow: 0 4px 0 #c9c3e6; }
.soc-btn.apple { background: #000; color: #fff; box-shadow: 0 4px 0 #2a2350; }
.soc-btn.mail { background: var(--surface-2); color: var(--ink); box-shadow: 0 4px 0 rgba(10, 6, 35, .45); }
.soc-btn:active { transform: translateY(3px); box-shadow: none; }
.soc-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.au-legal { max-width: 360px; margin: 14px auto 0; color: var(--muted); font-size: 12.5px; font-weight: 700; line-height: 1.45; }
.au-legal a { color: var(--ink-2); }

/* ===== Profily dětí (výběr jako na Netflixu) ===== */
body.no-scroll { overflow: hidden; }
.pf-av { display: grid; place-items: end center; width: 46px; height: 46px; flex: none; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--av) 70%, #fff) 0%, var(--av) 70%); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .14); }
.pf-av svg { width: 92%; height: 92%; margin-bottom: -4%; }
.pf-av.big { width: 104px; height: 104px; box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .14), 0 8px 0 rgba(10, 6, 35, .4); }
.pf-av.add { place-items: center; background: rgba(255, 255, 255, .08); border: 3px dashed rgba(255, 255, 255, .25); box-shadow: none; color: var(--muted); }
.pf-av.add svg { width: 40px; height: 40px; margin: 0; }
.pf-av.pop { animation: pfPop .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pfPop { from { transform: scale(.7); } }

.picker { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; overflow-y: auto; padding: calc(24px + env(safe-area-inset-top)) 16px 24px;
  background: radial-gradient(120% 60% at 50% 0%, #3d2f8c 0%, var(--bg) 70%); animation: ovIn .3s ease; }
.picker.out { animation: pkOut .26s ease forwards; }
@keyframes pkOut { to { opacity: 0; transform: scale(1.06); } }
.pk-in { width: 100%; max-width: 460px; text-align: center; }
.pk-owl { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: block; box-shadow: 0 0 0 3px var(--sun); }
.picker h1 { font-size: 28px; margin-bottom: 22px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 10px; justify-items: center; margin-bottom: 26px; }
.pk-item { position: relative; display: grid; justify-items: center; gap: 8px; padding: 0; background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; }
.pk-item b { font-family: var(--font-head); font-size: 19px; font-weight: 700; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-item .pf-av { transition: transform .15s ease, box-shadow .15s ease; }
.pk-item:hover .pf-av, .pk-item:focus-visible .pf-av { transform: translateY(-3px) scale(1.04); box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .14), 0 0 0 4px var(--sun), 0 10px 0 rgba(10, 6, 35, .4); }
.pk-item:focus-visible { outline: none; }
.pk-item.chosen .pf-av { animation: pkChosen .38s ease forwards; }
@keyframes pkChosen { 50% { transform: scale(1.15); } to { transform: scale(1.08); box-shadow: 0 0 0 5px var(--sun), 0 0 40px var(--sun); } }
.pk-edit { position: absolute; top: 0; right: 6px; display: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); color: var(--ink-dark); box-shadow: 0 3px 0 var(--sun-d); }
.pk-edit svg { width: 18px; height: 18px; }
.picker.editing .pk-edit { display: grid; }
.picker.editing .pk-item:not(.add) .pf-av { opacity: .75; }
.pk-lock { display: inline-flex; align-items: center; gap: 4px; margin-top: -4px; color: var(--sun); font-size: 12px; font-weight: 900; }
.pk-lock svg { width: 13px; height: 13px; }
.pk-mode { display: inline-flex; gap: 8px; align-items: center; }
.pk-mode svg { width: 18px; height: 18px; }

/* úprava profilu */
.pe-top { display: grid; place-items: center; margin: 2px 0 6px; }
.pe-avs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pe-av { padding: 3px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.pe-av .pf-av { width: 100%; height: auto; aspect-ratio: 1; }
.pe-av.on { box-shadow: 0 0 0 3px var(--sun); }
.pe-seg.three { grid-template-columns: repeat(4, 1fr); }
.pe-seg.three button { font-size: 13px; padding: 0 2px; }
.fld .opt { color: var(--muted); font-weight: 700; font-size: 12px; }
.pe-del { display: block; margin: 4px auto 0; color: var(--pink); }

/* menu: dítě, skupiny, přepínač */
.dr-kid { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px 10px 10px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 4px 0 rgba(10, 6, 35, .35); }
.dr-kid .dr-acc-txt b { font-size: 19px; }
.dr-kid-sw { flex: none; padding: 5px 11px; border-radius: 999px; background: var(--sun); color: var(--ink-dark); font-size: 12.5px; font-weight: 900; }
.dr-group { margin: 6px 4px -4px; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tgl { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: rgba(255, 255, 255, .14); transition: background-color .2s; }
.tgl i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tgl.on { background: var(--mint); }
.tgl.on i { transform: translateX(18px); }
/* přepínač (checkbox) */
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 50px; height: 30px; margin: 0; border-radius: 999px; background: rgba(255, 255, 255, .16); cursor: pointer; transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--mint); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.srow.sw-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.srow.sw-line small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; }

/* ===== Vlastní hrdina ===== */
.hero-prev { width: 130px; height: 150px; margin: 0 auto 4px; border-radius: 30px; background: radial-gradient(circle at 50% 30%, #4b3d9a, var(--surface-2)); display: grid; place-items: center; }
.hero-prev svg { width: 100%; height: 100%; }
.hero-prev.bump { animation: pfPop .35s cubic-bezier(.2, 1.6, .4, 1); }
.he-rows { display: grid; gap: 12px; max-width: 400px; margin: 4px auto 18px; text-align: left; }
.he-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; }
.he-row > span { font-weight: 800; color: var(--ink-2); font-size: 14.5px; }
.sw-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); transition: transform .12s; }
.sw.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--sun); transform: scale(1.06); }

/* ===== Album nálepek ===== */
.album { position: fixed; inset: 0; z-index: 105; display: flex; flex-direction: column; background: var(--bg); animation: alIn .3s cubic-bezier(.2, .9, .3, 1); padding-top: env(safe-area-inset-top); }
.album.out { animation: alOut .24s ease forwards; }
@keyframes alIn { from { opacity: 0; transform: translateY(24px); } }
@keyframes alOut { to { opacity: 0; transform: translateY(24px); } }
.al-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px 8px; }
.al-top h2 { font-size: 24px; }
.al-top small { color: var(--muted); font-weight: 700; }
.al-count { width: 70px; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.al-count i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--pink)); border-radius: 999px; }
.al-tabs { display: flex; gap: 6px; padding: 0 16px 10px; }
.al-tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 800; cursor: pointer; }
.al-tabs button[aria-selected="true"] { background: var(--sun); color: var(--ink-dark); box-shadow: 0 3px 0 var(--sun-d); }
.al-board { position: relative; flex: 1; min-height: 0; margin: 0 16px; border-radius: 26px; overflow: hidden; box-shadow: 0 0 0 4px #fff3, 0 8px 0 rgba(10, 6, 35, .4); touch-action: none; }
.al-board > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.al-empty { position: absolute; left: 16px; right: 16px; top: 40%; margin: 0; text-align: center; font-family: var(--font-head); font-size: 20px; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.stk { width: 78px; height: 78px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.stk > svg { width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.stk.placed { position: absolute; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); }
.stk.placed.just { animation: stick .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes stick { 0% { transform: translate(-50%, -50%) rotate(var(--r)) scale(1.3); } 60% { transform: translate(-50%, -50%) rotate(var(--r)) scale(.92); } }
.stk.hole { opacity: .25; }
.stk.lifted { position: fixed; z-index: 130; pointer-events: none; cursor: grabbing; transform: rotate(-8deg) scale(1.15); transition: transform .12s; }
.stk.lifted svg { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(6px 16px 10px rgba(0, 0, 0, .45)); }
.stk.ghost { cursor: default; opacity: .28; }
.stk.ghost svg { filter: brightness(0) invert(.75); }
.al-tray { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.al-tray p { margin: 0 0 6px; color: var(--muted); font-weight: 800; font-size: 13.5px; text-align: center; }
.al-tray-row { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px; min-height: 90px; justify-content: safe center; }
.stk.in-tray { flex: none; }
.stk.fresh { animation: fresh 1.6s ease-in-out infinite; }
@keyframes fresh { 50% { transform: translateY(-6px) rotate(4deg); } }

/* ===== Konec pohádky: sovička a nová nálepka ===== */
.end-owl { width: 74px; height: 74px; margin: 2px auto -4px; animation: owlWave 2.4s ease-in-out infinite; }
.end-owl svg { width: 100%; height: 100%; }
@keyframes owlWave { 50% { transform: translateY(-5px) rotate(-4deg); } }
.end-sticker { display: flex; align-items: center; gap: 12px; width: 100%; margin: -6px 0 14px; padding: 10px 14px 10px 10px; border: 0; border-radius: 22px; cursor: pointer; font: inherit; color: var(--ink-dark); text-align: left;
  background: linear-gradient(135deg, #ffe27a, var(--sun)); box-shadow: 0 5px 0 var(--sun-d); animation: esIn .7s 1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes esIn { from { opacity: 0; transform: scale(.6) rotate(-6deg); } }
.es-stk { width: 58px; height: 58px; flex: none; animation: fresh 1.8s 1.8s ease-in-out infinite; }
.es-stk > svg { width: 100%; height: 100%; filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 3px 3px rgba(0, 0, 0, .25)); }
.es-txt { flex: 1; display: grid; }
.es-txt small { font-weight: 900; font-size: 12.5px; opacity: .75; }
.es-txt b { font-family: var(--font-head); font-size: 20px; line-height: 1.1; }
.es-go { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--ink-dark); color: var(--sun); font-weight: 900; font-size: 14px; }

/* ===== Noční režim: teplé, tlumené světlo ===== */
html.night::after { content: ""; position: fixed; inset: 0; z-index: 125; pointer-events: none; background: #ff8a2a; mix-blend-mode: multiply; opacity: .32; }
html.night::before { content: ""; position: fixed; inset: 0; z-index: 124; pointer-events: none; background: #000; opacity: .18; }
.night-sheet .sheet { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.night-sheet.out { animation: ovOut .22s ease forwards; }
.ns-row { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 16px; text-align: left; }
.ns-row h3 { font-size: 21px; margin-bottom: 4px; }
.ns-row p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.4; }
.ns-ico { display: grid; place-items: center; flex: none; width: 50px; height: 50px; border-radius: 16px; background: var(--lilac); color: var(--ink-dark); box-shadow: inset 0 -4px 0 var(--lilac-d); }
.ns-ico svg { width: 28px; height: 28px; }
.night-sheet .btn { display: flex; gap: 8px; justify-content: center; align-items: center; }
.night-sheet .link-btn { display: block; margin: 8px auto 0; color: var(--ink-2); }
.ns-never { justify-content: center; margin-top: 6px; }

/* připomínka */
.rm-box { max-width: 360px; margin: 6px auto 16px; padding: 4px 16px; border-radius: 18px; background: rgba(255, 255, 255, .06); }
.rm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; font-weight: 800; }
.rm-row + .rm-row { border-top: 1px solid rgba(255, 255, 255, .08); }
.rm-row input[type=time] { min-height: 42px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-weight: 800; color-scheme: dark; }
.org-f { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .stk.fresh, .es-stk, .end-owl, .end-sticker, .picker, .album { animation: none; }
}

/* překryvná okna nad výběrem profilu a albem; noční nabídka nad čtečkou */
.ov { z-index: 115; }
.night-sheet { z-index: 116; }

/* ===== Editor hrdiny (záložky) ===== */
.he-stage { position: relative; width: 150px; margin: 0 auto 2px; }
.he-stage .hero-prev { width: 150px; height: 170px; border-radius: 34px; background: radial-gradient(circle at 50% 28%, #5a4bb0, var(--surface-2) 75%); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .12); }
.he-dice { position: absolute; right: -14px; bottom: -6px; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--sun); color: var(--ink-dark); box-shadow: 0 4px 0 var(--sun-d); cursor: pointer; }
.he-dice svg { width: 26px; height: 26px; }
.he-dice:active { transform: translateY(3px) rotate(20deg); box-shadow: 0 1px 0 var(--sun-d); }
.he-g { max-width: 260px; margin: 6px auto 12px; }
.he-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, .06); margin: 0 auto 10px; max-width: 440px; }
.he-tabs button { min-height: 40px; padding: 0 2px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.he-tabs button[aria-selected="true"] { background: var(--sun); color: var(--ink-dark); box-shadow: 0 3px 0 var(--sun-d); }
.he-panel { max-width: 440px; margin: 0 auto 16px; min-height: 250px; text-align: left; }
.he-lbl { margin: 10px 2px 6px; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.he-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.he-tiles.two { grid-template-columns: repeat(2, 1fr); max-width: 220px; }
.he-tiles.three { grid-template-columns: repeat(3, 1fr); }
.he-tile { display: grid; justify-items: center; gap: 2px; padding: 6px 4px 7px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .07); color: var(--ink-2); font: inherit; cursor: pointer; transition: transform .1s; }
.he-tile small { font-size: 12px; font-weight: 800; }
.he-tile.on { background: var(--surface-3); box-shadow: inset 0 0 0 3px var(--sun); color: var(--ink); }
.he-tile:active { transform: scale(.95); }
.he-fig { display: block; width: 100%; aspect-ratio: 1; }
.he-tiles.three .he-fig { aspect-ratio: 5 / 6; }
.he-fig svg { width: 100%; height: 100%; }
.he-panel .sw-row { gap: 7px; flex-wrap: nowrap; }
.he-panel .sw { flex: 1 1 0; width: auto; max-width: 38px; height: auto; aspect-ratio: 1; }

/* album velké jako hlavní obrazovka (na počítači uprostřed, na mobilu přes celý displej) */
.album { left: 0; right: 0; width: 100%; max-width: 560px; margin: 0 auto; }
@media (min-width: 600px) {
  .album { box-shadow: 0 0 0 100vmax rgba(8, 5, 26, .7); }
  .al-board { max-height: 720px; }
}

/* ===== Počítánky: světlý „sešitový“ vzhled pro soustředění =====
   Usínánky jsou noční a fialové; matematika je denní: čtverečkovaný papír, tmavě modrý inkoust, oranžová. */
html.mod-math { color-scheme: light; }
html.mod-math body {
  background-color: #fdfaf3;
  background-image: linear-gradient(#e4ecf6 1px, transparent 1px), linear-gradient(90deg, #e4ecf6 1px, transparent 1px);
  background-size: 24px 24px;
}
html.mod-math.night::before, html.mod-math.night::after { display: none; }
html.mod-math, html.mod-math :is(#app, #tabbar, #math-root, #drawer, .mod-pop) {   /* barvy modulu platí pro celou aplikaci */
  --bg: #fdfaf3; --bg-2: #f5efe2;
  --surface: #ffffff; --surface-2: #eef3fa; --surface-3: #dfe8f5;
  --line: #d5dfec; --ink: #22304f; --ink-2: #3f4d6e; --muted: #7a87a6; --ink-dark: #22304f;
  --navy-2: #c7d3e6; --paper: #fdfaf3;
  --shadow: 0 4px 0 rgba(34, 48, 79, .1), 0 10px 22px rgba(34, 48, 79, .08);
  color: var(--ink);
}
html.mod-math #app .btn, html.mod-math #math-root .btn { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); color: #fff; }
html.mod-math #app .btn:active, html.mod-math #math-root .btn:active { box-shadow: 0 2px 0 var(--orange-d); }
html.mod-math #app .btn.light, html.mod-math #math-root .btn.light { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math #app .round-btn, html.mod-math #math-root .round-btn { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .bubble { background: #fff; box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .bubble::before { border-right-color: #fff; }
html.mod-math .bubble .hello { color: var(--orange-d); }
html.mod-math .tabbar { background: #fff; border-top: 2px solid var(--line); box-shadow: 0 -6px 20px rgba(34, 48, 79, .06); }
html.mod-math .tab { color: var(--muted); }
html.mod-math .tab[aria-current="page"] { color: #fff; }
html.mod-math .tab[aria-current="page"]::before { background: var(--orange); box-shadow: 0 3px 0 var(--orange-d); }
html.mod-math .link-btn { color: var(--orange-d); }
html.mod-math .list-head span, html.mod-math .hello { color: var(--muted); }
.tabbar-in.three { grid-template-columns: repeat(3, 1fr); }

.m-owl { display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff4dc, #ffe1a8); }
.m-owl svg { width: 100%; height: 100%; }
.m-owl.mascot { width: 62px; height: 62px; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--orange); }
.intro-owl, .end-owl, .empty-owl { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 8px; box-shadow: 0 0 0 6px #fff, 0 6px 0 6px var(--navy-2); }

/* statistiky */
.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.m-chip { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 7px; padding: 9px 10px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
.m-chip svg { grid-row: span 2; width: 24px; height: 24px; }
.m-chip b { font-family: var(--font-head); font-size: 20px; line-height: 1; }
.m-chip small { font-size: 11px; font-weight: 800; color: var(--muted); line-height: 1.15; }
.m-chip.sun svg { color: var(--sun-d); } .m-chip.orange svg { color: var(--orange); } .m-chip.mint svg { color: var(--mint-d); }

.m-next { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 22px; border-radius: 26px; background: var(--g); box-shadow: 0 6px 0 var(--gd); color: #fff; }
.m-next:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gd); }
.m-next.off { opacity: .5; pointer-events: none; }
.m-next-ico { flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .28); font-family: var(--font-head); font-weight: 800; font-size: 21px; overflow: hidden; }
.m-next-ico svg { width: 28px; height: 28px; }
.m-next-ico .m-owl { width: 100%; height: 100%; background: none; }
.m-next-ico .m-owl svg { width: 100%; height: 100%; }
.m-next-txt { flex: 1; min-width: 0; }
.m-next-txt small { display: block; font-size: 12.5px; font-weight: 800; opacity: .92; }
.m-next-txt strong { display: block; font-family: var(--font-head); font-size: 20px; line-height: 1.15; }
.m-next-go { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--gd); }
.m-next-go svg { width: 22px; height: 22px; margin-left: 2px; }
.m-intro { text-align: center; padding: 20px 18px 10px; margin-bottom: 22px; border-radius: 26px; background: #fff; box-shadow: 0 5px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
.m-intro h2 { font-size: 24px; }
.m-intro p { color: var(--ink-2); margin: 6px 0 16px; font-size: 15px; }
.m-intro .link-btn { margin-top: 10px; }

/* cesta */
.m-stage { margin-bottom: 8px; }
.m-stage-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--g); box-shadow: 0 4px 0 var(--gd); }
.m-stage-head b { font-family: var(--font-head); font-size: 19px; color: var(--gd); }
.m-stage-head small { flex: 1; color: var(--ink-2); font-weight: 700; font-size: 13px; }
.m-medal { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); color: #8a5a00; box-shadow: 0 3px 0 var(--sun-d); }
.m-medal svg { width: 20px; height: 20px; }
.m-nodes { display: grid; gap: 4px; padding: 16px 0 12px; }
.m-node { position: relative; display: grid; justify-items: center; width: 132px; }
.m-node.l { justify-self: start; margin-left: 6%; }
.m-node.c { justify-self: center; }
.m-node.r { justify-self: end; margin-right: 6%; }
.m-dot { display: grid; place-items: center; width: 76px; height: 76px; border: 0; border-radius: 50%; background: var(--g); box-shadow: 0 7px 0 var(--gd), inset 0 -4px 0 rgba(0, 0, 0, .08); color: #fff; cursor: pointer; overflow: hidden; }
.m-dot:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--gd); }
.m-ico { font-family: var(--font-head); font-weight: 800; font-size: 25px; line-height: 1; }
.m-ico svg { width: 30px; height: 30px; }
.m-node.quiz .m-dot { background: #ffe1a8; box-shadow: 0 7px 0 #e8b765, inset 0 0 0 4px #fff; }
.dot-owl { width: 76px; height: 76px; background: none; }
.m-node.test .m-dot { width: 90px; height: 90px; border-radius: 28px; background: var(--sun); box-shadow: 0 7px 0 var(--sun-d), inset 0 0 0 4px rgba(255, 255, 255, .6); color: #8a5a00; }
.m-node.test .m-ico svg { width: 40px; height: 40px; }
.m-node.locked .m-dot { background: #e9eef6; box-shadow: 0 7px 0 var(--navy-2); color: #a9b5cc; }
.m-node.locked .m-ico svg { width: 24px; height: 24px; }
.m-node.locked .dot-owl, .m-node.locked .m-owl { filter: grayscale(1); opacity: .5; }
.m-node.skip .m-dot { opacity: .7; }
.m-node.cur .m-dot { animation: mPulse 1.8s ease-in-out infinite; }
@keyframes mPulse { 0%, 100% { box-shadow: 0 7px 0 var(--gd), 0 0 0 0 color-mix(in srgb, var(--g) 55%, transparent); } 50% { box-shadow: 0 7px 0 var(--gd), 0 0 0 14px transparent; } }
.m-start { position: absolute; top: -14px; z-index: 1; padding: 3px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 900; font-size: 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.m-name { margin-top: 10px; text-align: center; font-weight: 800; font-size: 13.5px; line-height: 1.2; color: var(--ink); background: rgba(253, 250, 243, .85); border-radius: 8px; padding: 0 4px; }
.m-node.locked .m-name { color: var(--muted); }
.m-stars { display: flex; gap: 2px; margin-top: 3px; }
.m-stars i { color: #c9d3e3; }
.m-stars i.on { color: var(--sun); }
.m-stars svg { width: 16px; height: 16px; }

/* procvičování a pokrok */
.m-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.m-tile { display: grid; gap: 2px; padding: 12px; border-radius: 20px; background: #fff; box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); border-top: 6px solid var(--g); }
.m-tile .m-ico { color: var(--gd); font-size: 22px; margin-bottom: 4px; }
.m-tile b { font-size: 15px; line-height: 1.2; }
.m-tile small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.m-tile-btns { display: flex; gap: 6px; margin-top: 8px; }
.m-tile-btns a { flex: 1; text-align: center; padding: 7px 4px; border-radius: 12px; background: var(--g); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 3px 0 var(--gd); }
.m-tile-btns a.ghost { background: var(--surface-2); color: var(--ink); box-shadow: 0 3px 0 var(--navy-2); }
.m-prog { display: grid; gap: 10px; margin-bottom: 26px; }
.m-prog-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.m-prog-row b { display: block; font-family: var(--font-head); font-size: 17px; color: var(--gd); }
.m-prog-row small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.m-bar { height: 12px; border-radius: 6px; background: #e9eef6; overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: 6px; background: var(--g); }
.m-note { color: var(--muted); font-size: 14px; text-align: center; margin: 10px 0 0; }
.m-switch { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; }
.m-switch span { flex: 1; } .m-switch b { display: block; } .m-switch small { color: var(--muted); font-weight: 700; }
.m-switch input { position: absolute; opacity: 0; }
.m-switch i { width: 50px; height: 30px; border-radius: 15px; background: #d5dfec; position: relative; transition: background .2s; }
.m-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.m-switch input:checked + i { background: var(--mint); }
.m-switch input:checked + i::after { transform: translateX(20px); }

/* ===== celoobrazovková vrstva (výklad, příklady) ===== */
body.m-open { overflow: hidden; }
#math-root:empty { display: none; }
.mx { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background-color: var(--paper); background-image: linear-gradient(#e4ecf6 1px, transparent 1px), linear-gradient(90deg, #e4ecf6 1px, transparent 1px); background-size: 24px 24px; }
.mx > * { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
.mx-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px 6px; flex: none; }
.mx-prog { flex: 1; height: 14px; border-radius: 7px; background: #e3eaf4; overflow: hidden; }
.mx-prog i { display: block; height: 100%; width: 0; border-radius: 7px; background: var(--orange); box-shadow: inset 0 -3px 0 var(--orange-d); transition: width .35s ease; }
.mx-count { min-width: 44px; text-align: right; font-weight: 900; color: var(--muted); font-size: 14px; }
.mx-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mx-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 10px 18px; text-align: center; }
.mx-body.in { animation: mxIn .28s ease; }
@keyframes mxIn { from { opacity: 0; transform: translateX(24px); } }
.mx-q { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1.3; max-width: 470px; }
.mx-vis { max-width: 100%; }
.mx-vis svg, .lv-vis svg { max-width: 100%; height: auto; }
.m-vs { display: flex; align-items: center; gap: 12px; justify-content: center; width: 100%; max-width: 420px; }
/* obě skupiny se vždy vejdou do karty (dřív 34vw podle okna, na širokém displeji přetékaly) */
.m-vs > svg { box-sizing: border-box; padding: 10px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); flex: 0 1 auto; min-width: 0; max-width: calc(50% - 14px); height: auto; }
.m-vs-mid { width: 3px; align-self: stretch; border-radius: 2px; background: var(--line); }
.mx-expr { font-family: var(--font-head); font-weight: 800; font-size: 44px; line-height: 1.1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.mx-expr.l { font-size: 34px; } .mx-expr.xl { font-size: 26px; }
.m-slot { display: inline-grid; place-items: center; min-width: 72px; max-width: 100%; height: 1.5em; padding: 0 12px; border-radius: 16px; border: 3px dashed var(--orange); color: var(--orange-d); background: #fff7ec; white-space: nowrap; }
.m-slot.filled { border-style: solid; color: var(--ink); background: #fff; }
.m-slot.good { border-color: var(--mint); color: var(--mint-d); }
.m-slot.bad { border-color: var(--pink); color: var(--pink-d); text-decoration: line-through; text-decoration-thickness: 3px; }
.mx-expr.solo .m-slot { min-width: 150px; }
.frac { display: inline-grid; text-align: center; line-height: 1; vertical-align: middle; margin: 0 2px; }
.frac i { font-style: normal; padding: 0 4px; }
.frac i:first-child { border-bottom: 3px solid currentColor; padding-bottom: 2px; }
.frac i:last-child { padding-top: 3px; }
.mx-expr .frac { font-size: .72em; }
.mx-q .frac { font-size: .8em; }
/* písemně pod sebou */
.mx-expr.col { font-size: 36px; }
.m-col { display: grid; justify-items: end; gap: 2px; font-family: var(--font-head); font-weight: 800; font-variant-numeric: tabular-nums; }
.m-col > span { display: grid; grid-template-columns: repeat(var(--w), 1.1ch); justify-items: center; }
.m-col i { font-style: normal; }
.m-col .m-col-op i:first-child { color: var(--orange); }
.m-col-line { width: 100%; height: 4px; border-radius: 2px; background: var(--ink); display: block !important; }
.m-col-carry { font-size: .5em; color: var(--pink-d); grid-template-columns: repeat(var(--w), 2.2ch) !important; }
.m-col-res { color: var(--mint-d); }
.m-col .m-col-ans { display: block; }
.m-col .m-slot { height: 1.4em; font-size: .9em; }

.mx-foot { flex: none; padding: 8px 16px 14px; display: grid; gap: 10px; }
.mx-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mx-opt { min-height: 70px; padding: 4px 8px; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 6px 0 var(--navy-2), inset 0 0 0 2px var(--line); font-family: var(--font-head); font-weight: 800; font-size: 28px; color: var(--ink); cursor: pointer; transition: transform .08s; white-space: nowrap; overflow: hidden; }
.mx-foot.l .mx-opt { font-size: 22px; } .mx-foot.xl .mx-opt { font-size: 18px; }
.mx-opt .frac { font-size: .8em; }
.mx-opt:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--navy-2); }
.mx-opt.right { background: var(--mint); box-shadow: 0 6px 0 var(--mint-d); color: #fff; }
.mx-opt.wrong { background: var(--pink); box-shadow: 0 6px 0 var(--pink-d); color: #fff; animation: mxShake .35s; }
.mx-opt:disabled.wrong { opacity: .6; }
@keyframes mxShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.mx-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mx-key { min-height: 54px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); font-family: var(--font-head); font-weight: 800; font-size: 26px; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.mx-key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy-2); }
.mx-key.del { color: var(--muted); }
.mx-key svg { width: 28px; height: 28px; }
.mx-extra { display: flex; gap: 10px; align-items: stretch; }
.mx-extra .mx-ok { flex: 1; }
.mx-ok:disabled { opacity: .45; pointer-events: none; }
.mx-help { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border: 0; border-radius: 20px; background: #fff3dc; box-shadow: 0 4px 0 #ecc98a, inset 0 0 0 2px #f4d79f; font-weight: 900; font-size: 15px; color: #8a5a00; cursor: pointer; }
.mx-foot.is-opts .mx-help { margin: 0 auto; }
.help-owl { width: 48px; height: 48px; border-radius: 16px; background: none; }
.mx-dunno { margin: 0 auto; padding: 10px 26px; border: 0; border-radius: 16px; background: #eef3fa; color: var(--ink-2); font-weight: 900; font-size: 16px; box-shadow: 0 4px 0 var(--navy-2); cursor: pointer; }
.mx-foot.pad .mx-dunno { margin: 0; }
@media (max-height: 720px) { .mx-key { min-height: 46px; } .mx-expr { font-size: 36px; } .mx-opt { min-height: 58px; } .mx-q { font-size: 20px; } }

/* zpětná vazba a sovička */
.mx-fb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; display: grid; gap: 12px; justify-items: center; padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; animation: mxUp .22s ease; box-shadow: 0 -10px 30px rgba(34, 48, 79, .15); }
.mx-fb[hidden] { display: none; }
@keyframes mxUp { from { transform: translateY(100%); } }
.mx-fb > * { max-width: 520px; width: 100%; }
.mx-fb.ok { background: var(--mint); color: #fff; text-align: center; }
.mx-fb.ok b { font-family: var(--font-head); font-size: 26px; }
.mx-fb.soft { background: #eef3fa; color: var(--ink); text-align: center; }
.mx-fb.soft b { font-family: var(--font-head); font-size: 22px; }
.mx-fb.help, .mx-fb.bad { background: #fff8ea; color: var(--ink); max-height: 78vh; overflow-y: auto; }
.mx-fb.bad { background: #fff1ec; }
.mx-fb .btn { width: 100%; }
.mx-owlsay { display: flex; gap: 12px; align-items: flex-start; }
.fb-owl { flex: none; width: 64px; height: 64px; border-radius: 50%; }
.mx-owlsay b { display: block; font-family: var(--font-head); font-size: 20px; line-height: 1.2; }
.mx-owlsay p { margin: 4px 0 0; font-size: 16.5px; font-weight: 700; line-height: 1.4; color: var(--ink-2); }
.mx-fb-vis { display: flex; justify-content: center; padding: 10px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); overflow-x: auto; }
.mx-fb-vis svg { max-width: 100%; height: auto; }

/* konec, vysvědčení, kvíz */
.mx-end, .mx-grade { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 20px; overflow-y: auto; }
.mx-end h2, .mx-grade h2 { font-size: 27px; }
.mx-end .btn { max-width: 400px; margin-top: 4px; }
.mx-bigstars { display: flex; gap: 8px; margin: 6px 0; }
.mx-bigstars i { color: #c9d3e3; animation: starPop .5s both cubic-bezier(.3, 1.6, .5, 1); }
.mx-bigstars i.on { color: var(--sun); filter: drop-shadow(0 4px 0 var(--sun-d)); }
.mx-bigstars i:nth-child(2) { transform: translateY(-10px); }
.mx-bigstars svg { width: 54px; height: 54px; }
@keyframes starPop { from { opacity: 0; scale: .3; } }
.m-cert { position: relative; width: 220px; padding: 18px 16px 22px; border-radius: 18px; background: #fff; border: 4px double var(--sun-d); box-shadow: 0 8px 0 var(--navy-2); }
.m-cert small { display: block; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-size: 12px; }
.m-cert b { display: block; font-family: var(--font-head); font-size: 26px; color: var(--ink); }
.m-cert-medal { position: absolute; right: -14px; bottom: -18px; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--sun); color: #8a5a00; box-shadow: 0 4px 0 var(--sun-d), 0 0 0 4px #fff; animation: medal 1s .6s both cubic-bezier(.3, 1.6, .5, 1); }
.m-cert-medal svg { width: 32px; height: 32px; }
@keyframes medal { from { transform: scale(0) rotate(-90deg); } }
.mx-grades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 400px; margin-top: 8px; }
.mx-grades button { min-height: 60px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 var(--navy-2), inset 0 0 0 2px var(--line); font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--ink); cursor: pointer; }
.mx-grades button:first-child { grid-column: span 2; background: var(--mint); box-shadow: 0 5px 0 var(--mint-d); color: #fff; }
.mx-grades button:active { transform: translateY(3px); }

/* ===== výklad se sovičkou ===== */
.lv { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 8px 16px 14px; overflow-y: auto; }
.lv-teacher { display: flex; align-items: flex-end; gap: 10px; }
.lv-owl { flex: none; width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 5px 0 4px var(--navy-2); animation: owlBob 2.4s ease-in-out infinite; }
@keyframes owlBob { 50% { transform: translateY(-4px) rotate(-2deg); } }
.lv-bubble { position: relative; flex: 1; padding: 12px 44px 12px 14px; border-radius: 20px 20px 20px 6px; background: #fff; box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); animation: mxIn .3s ease; }
.lv-bubble p { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.lv-say { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #eef3fa; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.lv-say svg { width: 18px; height: 18px; }
.lv-vis { flex: 1; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px 12px; border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); text-align: center; overflow: hidden; }
.lv-btns { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.lv-btns .btn { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.lv-btns .btn svg { width: 20px; height: 20px; }
.lv-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.lv-op { font-family: var(--font-head); font-size: 34px; color: var(--orange); }
.lv-eq { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 28px; color: var(--ink); }
.lv-eq .frac { font-size: .8em; }
.lv-num { font: 800 13px var(--font-ui); fill: var(--ink-2); }
.lv-tick { font: 800 12px var(--font-ui); fill: var(--ink-2); }
.lv-hop { font: 900 13px var(--font-ui); }
.lv-croc { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 38px; }
.lv-places { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.lv-places > div { display: grid; gap: 4px; min-width: 54px; padding: 8px 6px; border-radius: 14px; background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: inset 0 0 0 2px var(--c); }
.lv-places small { font-size: 10.5px; font-weight: 900; color: var(--ink-2); }
.lv-places b { font-family: var(--font-head); font-size: 32px; line-height: 1; color: var(--ink); }
.lv-house { display: grid; justify-items: center; gap: 0; font-family: var(--font-head); font-weight: 800; }
.lv-house > b { width: 0; height: 0; border-left: 70px solid transparent; border-right: 70px solid transparent; border-bottom: 56px solid var(--orange); position: relative; color: #fff; font-size: 28px; }
.lv-house > b::after { content: "5"; position: absolute; left: -9px; top: 18px; }
.lv-house > span { display: grid; grid-template-columns: 1fr 1fr; width: 120px; border: 3px solid var(--ink); border-top: 0; font-size: 26px; background: #fff; }
.lv-house > b + span { border-top: 3px solid var(--ink); }
.lv-house i { font-style: normal; padding: 4px 0; } .lv-house i:first-child { border-right: 3px solid var(--ink); }
.lv-story { margin: 0; max-width: 340px; font-size: 19px; font-weight: 700; line-height: 1.5; }
.lv-story b { color: var(--orange-d); font-size: 1.15em; }
.lv-words { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lv-words span { padding: 7px 12px; border-radius: 14px; font-weight: 900; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: inset 0 0 0 2px var(--c); }

/* ===== animace (škola hrou) ===== */
.a-pop { animation: aPop .45s both cubic-bezier(.3, 1.5, .5, 1); animation-delay: var(--d, 0s); transform-box: fill-box; transform-origin: center; }
@keyframes aPop { from { opacity: 0; transform: scale(.2); } }
.a-fly { animation: aFly .7s both ease-in; animation-delay: var(--d, 0s); transform-box: fill-box; transform-origin: center; }
@keyframes aFly { to { opacity: 0; transform: translate(30px, -40px) rotate(25deg) scale(.6); } }
.a-left { animation: aLeft .7s both ease-out; } .a-right { animation: aRight .7s .2s both ease-out; }
@keyframes aLeft { from { opacity: 0; transform: translateX(-60px); } }
@keyframes aRight { from { opacity: 0; transform: translateX(60px); } }
.a-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: aDraw .7s forwards ease-out; animation-delay: var(--d, 0s); }
@keyframes aDraw { to { stroke-dashoffset: 0; } }
.a-out { animation: aOut .5s both ease-out; animation-delay: var(--d, 0s); }
@keyframes aOut { from { transform: none; } to { transform: translate(var(--tx), var(--ty)); } }
.a-grow { transform-box: fill-box; transform-origin: bottom; animation: aGrow 1.2s .3s both cubic-bezier(.3, 1.2, .5, 1); }
@keyframes aGrow { from { transform: scaleY(0); } }
.a-chomp { animation: aChomp 1s both; animation-delay: var(--d, 0s); transform-origin: center; }
@keyframes aChomp { 0% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.25); } 70% { transform: scale(.9); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .a-pop, .a-fly, .a-left, .a-right, .a-draw, .a-out, .a-grow, .a-chomp, .lv-owl { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* ===== Počítánky: oranžová obloha nahoře, pevná hlavička a mapa se zastávkami ===== */
html.mod-math body {
  background-image:
    radial-gradient(130% 55% at 50% -12%, rgba(255, 154, 61, .55) 0%, rgba(255, 201, 60, .22) 38%, transparent 65%),
    linear-gradient(#e4ecf6 1px, transparent 1px), linear-gradient(90deg, #e4ecf6 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  background-attachment: fixed;
}
.mx { background-image: radial-gradient(130% 40% at 50% -12%, rgba(255, 154, 61, .35) 0%, transparent 60%), linear-gradient(#e4ecf6 1px, transparent 1px), linear-gradient(90deg, #e4ecf6 1px, transparent 1px); background-size: 100% 100%, 24px 24px, 24px 24px; }
.screen.mhome { height: 100dvh; display: flex; flex-direction: column; padding-bottom: 0; overflow: hidden; }
.m-head { flex: none; }
.m-head .m-next { margin-bottom: 12px; }
.m-head .m-intro { margin-bottom: 12px; }
.m-next.wait { filter: saturate(.55); }
.m-map {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -16px;
  border-radius: 30px 30px 0 0; background: #eaf6e4; box-shadow: inset 0 3px 0 rgba(34, 48, 79, .06), 0 -2px 0 #d5e9cf;
  -webkit-mask-image: linear-gradient(transparent 0, #000 18px); mask-image: linear-gradient(transparent 0, #000 18px);
  overscroll-behavior: contain;
}
.m-path { position: relative; padding: 14px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
.m-road { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; }
/* každý ročník je na mapě jiná krajina */
.m-stage { position: relative; margin: 0 -16px; padding: 14px 16px 10px; background:
  radial-gradient(60% 40% at 0% 30%, color-mix(in srgb, var(--g) 16%, transparent), transparent 70%),
  radial-gradient(50% 35% at 100% 75%, color-mix(in srgb, var(--g) 14%, transparent), transparent 70%); }
.m-stage + .m-stage { border-top: 3px dashed rgba(34, 48, 79, .08); }
.m-stage-head { position: relative; z-index: 2; width: fit-content; max-width: 100%; margin: 0 auto; }
.m-nodes { position: relative; z-index: 1; }
.m-node { z-index: 1; }
.m-deco { position: absolute; width: 58px; height: 58px; top: 6px; z-index: -1; pointer-events: none; filter: drop-shadow(0 3px 0 rgba(34, 48, 79, .08)); }
.m-deco.small { width: 40px; height: 40px; top: 46px; }
.m-deco.d-r { left: calc(100% + 34px); }
.m-deco.d-l { right: calc(100% + 34px); }
.m-node.c .m-deco.d-r { left: calc(100% + 10px); }
.m-node.c .m-deco.d-l { right: calc(100% + 10px); }
.m-deco.v1 { top: 22px; } .m-deco.v2 { top: -6px; transform: scale(.85); }
.m-name { background: rgba(255, 255, 255, .9); box-shadow: 0 2px 0 rgba(34, 48, 79, .06); }
.pw-owl .m-owl { width: 100%; height: 100%; }
.m-road { z-index: 1; }
.m-nodes { z-index: 2; }
.m-stage-head { z-index: 3; }
.m-node.skip .m-dot { opacity: 1; background: color-mix(in srgb, var(--g) 62%, #fff); box-shadow: 0 7px 0 color-mix(in srgb, var(--gd) 60%, #fff); }

/* ===== mapa světa (v2): krajiny, řeky s mosty, silnice přes zastávky ===== */
.m-mapwrap { position: relative; flex: 1; min-height: 0; margin: 0 -16px; }
.m-map { position: absolute; inset: 0; margin: 0; border-radius: 30px 30px 0 0; background: #e3f5d6; overflow-y: auto; overflow-x: hidden;
  -webkit-mask-image: linear-gradient(transparent 0, #000 16px); mask-image: linear-gradient(transparent 0, #000 16px); box-shadow: none; }
.m-world { position: relative; width: 100%; padding-bottom: calc(var(--tabbar-h) + 30px); box-sizing: content-box; }
.m-land { position: absolute; left: 0; top: 0; display: block; }
.m-land .m-decos { pointer-events: auto; }
.m-dc { cursor: pointer; }
.m-dc-in { transform-box: fill-box; transform-origin: 50% 100%; }
.m-dc-in.wiggle { animation: dcWiggle .7s ease; }
@keyframes dcWiggle { 20% { transform: rotate(-9deg) scale(1.08); } 45% { transform: rotate(7deg) scale(1.12); } 70% { transform: rotate(-4deg); } }
.m-water { animation: water 3s linear infinite; }
@keyframes water { to { stroke-dashoffset: -64; } }
.m-trail { animation: trail 1.6s linear infinite; }
@keyframes trail { to { stroke-dashoffset: -28; } }
.m-cloud { position: absolute; left: -120px; width: 96px; height: 34px; border-radius: 20px; background: #fff; opacity: .75; pointer-events: none; animation: cloud 40s linear infinite; filter: drop-shadow(0 4px 0 rgba(34, 48, 79, .05)); }
.m-cloud::before, .m-cloud::after { content: ""; position: absolute; border-radius: 50%; background: #fff; }
.m-cloud::before { width: 44px; height: 44px; left: 14px; top: -22px; }
.m-cloud::after { width: 32px; height: 32px; left: 48px; top: -14px; }
@keyframes cloud { to { transform: translateX(calc(100vw + 260px)); } }
@media (min-width: 600px) { @keyframes cloud { to { transform: translateX(800px); } } }
.m-sign { position: absolute; z-index: 3; display: grid; gap: 1px; padding: 7px 12px 8px; border-radius: 12px; background: #fffaf0; border: 3px solid #b9844e; box-shadow: 0 4px 0 #8f5c2f; transform: translateY(-50%); max-width: 46%; }
.m-sign.l { left: 12px; } .m-sign.r { right: 12px; }
.m-sign::after { content: ""; position: absolute; left: 50%; bottom: -16px; width: 6px; height: 13px; margin-left: -3px; background: #8f5c2f; border-radius: 0 0 3px 3px; }
.m-sign b { font-family: var(--font-head); font-size: 18px; line-height: 1.1; color: var(--gd); }
.m-sign small { font-size: 11.5px; font-weight: 800; color: var(--ink-2); line-height: 1.2; }
.m-sign .m-medal { position: absolute; right: -14px; top: -14px; width: 30px; height: 30px; }
/* zastávky stojí přesně na silnici */
.m-world .m-node { position: absolute; width: 140px; margin: 0; transform: translate(-50%, -38px); display: grid; justify-items: center; z-index: 2; }
.m-world .m-node .m-dot { width: 72px; height: 72px; }
.m-world .m-node.test .m-dot { width: 84px; height: 84px; }
.m-world .m-node.test { transform: translate(-50%, -44px); }
.m-world .m-node .m-name { margin-top: 8px; }
.m-world .m-node.shake .m-dot { animation: mxShake .4s; }
.m-world .m-node:not(.locked) .m-dot:hover { transform: translateY(-2px); }
/* sovička na mapě */
.m-me { position: absolute; z-index: 4; width: 58px; height: 58px; margin: -34px 0 0 -29px; padding: 0; border: 0; background: none; cursor: pointer; animation: meBob 2.2s ease-in-out infinite; }
.me-owl { width: 58px; height: 58px; border-radius: 50%; background: none; filter: drop-shadow(0 5px 0 rgba(34, 48, 79, .15)); }
.m-me.hop { animation: meHop .6s ease; }
@keyframes meBob { 50% { transform: translateY(-5px); } }
@keyframes meHop { 30% { transform: translateY(-22px) rotate(-8deg); } 60% { transform: translateY(0) scale(1.1, .9); } }
.m-say { position: absolute; z-index: 6; transform: translate(-50%, -100%); padding: 8px 12px; border-radius: 14px; background: #fff; font-weight: 900; font-size: 14px; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); width: max-content; max-width: 220px; text-align: center; line-height: 1.3; animation: aPop .35s both; }
.m-say.below { transform: translate(-50%, 0); }
/* karta zastávky */
.m-pop { position: absolute; z-index: 7; width: 270px; transform: translate(-50%, -100%); padding: 14px 16px 16px; border-radius: 22px; background: #fff; box-shadow: 0 8px 0 var(--navy-2), 0 16px 30px rgba(34, 48, 79, .18), inset 0 0 0 2px var(--line); text-align: center; animation: popIn .25s cubic-bezier(.3, 1.4, .5, 1); }
.m-pop.below { transform: translate(-50%, 0); }
@keyframes popIn { from { opacity: 0; scale: .7; } }
.m-pop::after { content: ""; position: absolute; left: calc(50% + var(--ax, 0px)); bottom: -9px; width: 18px; height: 18px; margin-left: -9px; background: #fff; transform: rotate(45deg); box-shadow: 3px 3px 0 var(--line); }
.m-pop.below::after { bottom: auto; top: -9px; box-shadow: -2px -2px 0 var(--line); }
.m-pop small { display: block; font-weight: 900; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gd); }
.m-pop > b { display: block; font-family: var(--font-head); font-size: 21px; line-height: 1.15; margin: 2px 0 4px; }
.m-pop p { margin: 6px 0 12px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); line-height: 1.35; }
.m-pop .m-stars.big { justify-content: center; } .m-pop .m-stars.big svg { width: 24px; height: 24px; }
.m-pop-btns { display: grid; grid-auto-flow: column; gap: 8px; }
.m-pop-btns .btn { min-height: 48px; display: grid; place-items: center; font-size: 17px; }
/* Kde jsem? */
.m-find { position: absolute; z-index: 9; right: 16px; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 4px; border: 0; border-radius: 26px; background: #fff; box-shadow: 0 5px 0 var(--navy-2), 0 10px 20px rgba(34, 48, 79, .15); font-weight: 900; font-size: 14px; color: var(--ink); cursor: pointer; animation: aPop .3s both; }
.m-find[hidden] { display: none; }
.find-owl { width: 40px; height: 40px; border-radius: 50%; }

/* ===== mapa v3: dekorace z Blenderu, most, dřevěná cedule ===== */
.m-dc { position: absolute; height: auto; transform: translate(-50%, -82%); transform-origin: 50% 82%; cursor: pointer; user-select: none; -webkit-user-drag: none; }
.m-dc.wiggle { animation: dcWiggle2 .75s ease; }
@keyframes dcWiggle2 { 20% { transform: translate(-50%, -82%) rotate(-7deg) scale(1.08); } 45% { transform: translate(-50%, -82%) rotate(6deg) scale(1.12); } 70% { transform: translate(-50%, -82%) rotate(-3deg); } }
.m-bridge { position: absolute; width: 66px; height: auto; z-index: 3; pointer-events: none; }
.m-world .m-sign { position: absolute; width: 152px; padding: 0; border: 0; background: none; box-shadow: none; transform: translate(-50%, -78%); max-width: none; z-index: 19000; display: block; }
.m-world .m-sign::after { display: none; }
.m-world .m-sign img { display: block; width: 100%; height: auto; }
.m-world .m-sign b { position: absolute; left: 9.4%; right: 16%; top: 19.5%; height: 19.2%; display: grid; place-items: center; font-family: var(--font-head); font-size: 17px; color: var(--gd); white-space: nowrap; }
.m-world .m-sign .m-medal { position: absolute; right: 2px; top: 6%; }
.m-world .m-node { z-index: 20000; }
.m-world .m-node.cur { z-index: 20002; }
.m-me { z-index: 20003; }
.m-cloud { z-index: 19500; }
.m-pop { z-index: 30000; }
.m-say { z-index: 30001; }
.m-node.quiz .m-dot { display: grid; place-items: center; }
.m-node.quiz .dot-owl { width: 66px; height: 66px; }

.m-ico .m-owl svg, .m-next-ico .m-owl svg { width: 100%; height: 100%; }

.m-world .m-node.locked .m-dot { background: color-mix(in srgb, var(--g) 22%, #f3f6fb); box-shadow: 0 7px 0 color-mix(in srgb, var(--gd) 30%, #c7d3e6), inset 0 0 0 3px rgba(255, 255, 255, .7); color: color-mix(in srgb, var(--gd) 55%, #8a97b0); }
.m-world .m-node.locked .m-name { color: #6f7c97; }
.m-node.quiz .m-ico { display: grid; place-items: center; width: 100%; height: 100%; line-height: 0; }
.m-dot { padding: 0; }

/* ===== výklad krok za krokem: zvýraznění, záře, odhalení ===== */
.lv-vis { position: relative; }
.lv .bi { transition: opacity .35s ease, transform .35s cubic-bezier(.3, 1.5, .5, 1), background-color .3s, box-shadow .3s; transform-box: fill-box; transform-origin: center; }
.lv .bh { opacity: 0; transform: scale(.3); }
.lv .bh.shown { opacity: 1; transform: none; }
.lv svg .bi.hl { transform: scale(1.28); }
.lv .bi.gone { animation: aFly .75s forwards ease-in; }
.lv .drawp { stroke-dasharray: 1; stroke-dashoffset: 1; }
.lv .bh.drawp { opacity: 1; transform: none; }
.lv .drawp.shown { animation: aDraw .65s forwards ease-out; }
.lv .grow { transform-origin: bottom; }
.lv .bh.grow { opacity: 1; transform: scaleY(0); }
.lv .bh.grow.shown { transform: none; transition: transform 1.2s cubic-bezier(.3, 1.2, .5, 1); }
/* HTML prvky (rovnice, řády, písemné počítání, slova) */
.lv .lv-eq.bi, .lv .lv-places > .bi, .lv .lv-story .bi, .lv .lv-words .bi, .lv .lv-house > .bi, .lv .lv-croc .bi { border-radius: 12px; }
.lv .lv-eq.hl, .lv .lv-story .hl, .lv .lv-house > .hl { background: #fff3c4; box-shadow: 0 0 0 6px #fff3c4, 0 0 22px 8px rgba(255, 201, 60, .55); transform: scale(1.06); }
.lv .lv-places > .hl { transform: translateY(-6px) scale(1.08); box-shadow: inset 0 0 0 3px var(--c), 0 0 22px 6px rgba(255, 201, 60, .6); }
.lv .lv-words .hl { transform: scale(1.12); box-shadow: inset 0 0 0 2px var(--c), 0 0 18px 5px rgba(255, 201, 60, .55); }
.lv .lv-croc .hl { transform: scale(1.2); text-shadow: 0 0 14px rgba(255, 190, 40, .9); }
.lv .lv-colb i { border-radius: 8px; transition: background-color .3s, transform .3s; }
.lv .lv-colb i.hl { background: #ffe58a; transform: scale(1.18); box-shadow: 0 0 14px 4px rgba(255, 201, 60, .6); }
.lv .lv-colb .m-col-res i.bh { opacity: 0; transform: scale(.3); }
.lv .lv-colb .m-col-res i.bh.shown, .lv .lv-colb .m-col-carry i.bh.shown { opacity: 1; transform: none; }
.lv .lv-colb .m-col-carry i.bh { opacity: 0; }
.lv .lv-colb .m-col-res i.hl.shown, .lv .lv-colb .m-col-carry i.hl.shown { transform: scale(1.2); }
.lv-num { font: 900 14px var(--font-ui); fill: var(--orange-d); }
.lv-cnum { font: 900 9px var(--font-ui); fill: #22304f; }
/* velký titulek s tím, co sovička právě říká (čísla) */
.lv-cap { position: absolute; top: 10px; left: 50%; z-index: 3; transform: translateX(-50%); padding: 4px 18px; border-radius: 18px; background: var(--orange); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 30px; line-height: 1.2; box-shadow: 0 4px 0 var(--orange-d); white-space: nowrap; }
.lv-cap.pop { animation: aPop .35s both cubic-bezier(.3, 1.6, .5, 1); }
.lv-owl.talk { animation: owlTalk .5s ease; }
@keyframes owlTalk { 30% { transform: scale(1.08) rotate(-4deg); } 60% { transform: scale(.97) rotate(3deg); } }
.lv-vis.tapping .tappable { cursor: pointer; }
.lv-vis.tapping .tappable:not(.tapped) { animation: tapHint 1.4s ease-in-out infinite; }
@keyframes tapHint { 50% { transform: scale(1.1); } }
.lv-vis.tapping .tappable:not(.tapped):nth-child(2n) { animation-delay: .2s; }
#lv-next.ready { animation: readyPulse 1.6s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 5px 0 var(--orange-d), 0 0 0 8px rgba(255, 154, 61, .25); } }

.lv .glow { opacity: 0; transition: opacity .35s; }
.lv .glow { pointer-events: none; }
.lv .glow:has(+ .hl), .lv .glow:has(+ .tapped) { opacity: 1; }   /* záře leží za prvkem, sama se nezvětšuje (žádné ořezávání) */
.lv-vis svg, .lv-vis .m-group { overflow: visible; }

/* ===== výklad: jasné stavy (sovička mluví / tvoje řada / hotovo) ===== */
.lv .bh:not(.shown):not(.ghost) { pointer-events: none; }
.lv-steps { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.lv-steps i { width: 8px; height: 8px; border-radius: 4px; background: #dfe6f1; transition: width .3s, background .3s; }
.lv-steps i.now { width: 22px; background: var(--orange); }
.lv-steps i.on { background: var(--mint); }
.lv-skip { position: absolute; top: 8px; right: 8px; z-index: 4; padding: 5px 10px; border: 0; border-radius: 12px; background: #eef3fa; color: var(--muted); font: 800 13px var(--font-ui); cursor: pointer; }
.lv.done .lv-skip { display: none; }
.lv-dots { display: inline-flex; gap: 4px; margin-right: 8px; }
.lv-dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; animation: lvDot 1.1s infinite; }
.lv-dots i:nth-child(2) { animation-delay: .18s; } .lv-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes lvDot { 30% { transform: translateY(-4px); opacity: 1; } }
#math-root .lv #lv-next:disabled { background: #e3e9f2; color: #7a87a6; box-shadow: 0 5px 0 #cbd5e4; opacity: 1; pointer-events: none; }
#math-root .lv #lv-next { display: flex; align-items: center; justify-content: center; gap: 4px; }
#math-root .lv #lv-next svg { width: 22px; height: 22px; }
#math-root .lv.done #lv-next { animation: readyPulse 1.4s ease-in-out infinite; }
.lv-nextwrap { position: relative; display: grid; }
.lv-tip { position: absolute; bottom: calc(100% + 12px); right: 6px; padding: 7px 12px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 900; font-size: 14px; white-space: nowrap; animation: tipBob 1.4s ease-in-out infinite; }
.lv-tip::after { content: ""; position: absolute; right: 30px; bottom: -6px; border: 7px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
@keyframes tipBob { 50% { transform: translateY(-4px); } }
.lv-turn { position: absolute; top: 8px; left: 50%; z-index: 4; transform: translateX(-50%); padding: 6px 16px; border-radius: 16px; background: var(--mint); color: #fff; font: 800 17px var(--font-head); box-shadow: 0 4px 0 var(--mint-d); animation: turnPulse 1.2s ease-in-out infinite; white-space: nowrap; }
@keyframes turnPulse { 50% { transform: translateX(-50%) scale(1.07); } }
.lv.turn .lv-vis, .mx-lesson-card .lv-vis { box-shadow: inset 0 0 0 3px var(--mint), 0 0 0 5px rgba(54, 211, 155, .18); }
.lv.turn .lv-cap { top: 52px; }
.lv .bi.ghost { opacity: .32; transform: none; }
.lv svg .bi.ghost circle, .lv svg .bi.ghost path, .lv svg .bi.ghost rect { stroke: #7a87a6; stroke-dasharray: 3 3; }
.lv-vis.tapping .tappable { cursor: pointer; }
/* výběr odpovědi */
.lv-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; width: 100%; max-width: 360px; margin-top: 4px; }
.lv-choice button { min-height: 60px; padding: 4px 8px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 5px 0 var(--navy-2), inset 0 0 0 2px var(--line); font: 800 24px var(--font-head); color: var(--ink); cursor: pointer; white-space: nowrap; }
.lv-choice button .frac { font-size: .8em; }
.lv-choice button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--navy-2); }
.lv-choice button.right { background: var(--mint); box-shadow: 0 5px 0 var(--mint-d); color: #fff; }
.lv-choice button.wrong { background: #ffe1e8; box-shadow: 0 5px 0 #f3b7c6; color: var(--pink-d); animation: mxShake .35s; }
.lv-choice.solved button:not(.right) { opacity: .45; }

/* nová témata: obrázkové odpovědi, mince, hodiny, rozměry */
.mx-opt.pic, .lv-choice button.pic { display: grid; place-items: center; padding: 6px; }
.mx-opt.pic svg, .lv-choice button.pic svg { display: block; max-width: 100%; height: auto; }
.mx-ansPic { display: inline-grid; place-items: center; margin: 4px 0; }
.mx-ansPic svg { max-height: 64px; width: auto; }
.lv-q { font: 900 24px var(--font-head); fill: var(--orange-d); }
.lv-coin { font: 900 13px var(--font-head); fill: #22304f; }
.lv-coin2 { font: 800 7px var(--font-ui); fill: #22304f; }
.lv-clk { font: 800 10px var(--font-ui); fill: #22304f; }
.lv-dim { font: 800 12px var(--font-ui); fill: #22304f; }
.mx-vis .m-shape, .mx-vis .m-group { max-width: 100%; height: auto; }
.glow { opacity: 0; pointer-events: none; transition: opacity .35s; }   /* záře jen ve výkladu, když sovička ukazuje */

/* ===== menu (burger) v Počítánkách: stejný světlý sešitový vzhled; v Usínánkách zůstává noční ===== */
html.mod-math .drawer-wrap.on { background: rgba(34, 48, 79, .32); }
html.mod-math .drawer {
  background-color: #fdfaf3;
  background-image: radial-gradient(130% 40% at 50% -8%, rgba(255, 154, 61, .32), transparent 60%), linear-gradient(#e4ecf6 1px, transparent 1px), linear-gradient(90deg, #e4ecf6 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  box-shadow: -12px 0 40px rgba(34, 48, 79, .18);
}
html.mod-math :is(.dr-item, .dr-acc, .dr-kid, .drawer .mod-trigger, .mod-trigger) { background: #fff; box-shadow: 0 3px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math :is(.dr-item, .drawer .mod-trigger):hover { background: #f3f7fc; }
html.mod-math .dr-item:active { box-shadow: 0 1px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .dr-plan { background: #eef3fa; color: var(--ink-2); }
html.mod-math .dr-plan.pro { background: var(--sun); color: #5a3d00; }
html.mod-math .tgl { background: #d5dfec; }
html.mod-math .tgl.on { background: var(--mint); }
html.mod-math .dr-out:hover { background: rgba(255, 111, 145, .1); }
html.mod-math .dr-owl { box-shadow: 0 0 0 3px var(--orange); }
html.mod-math #drawer .round-btn { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math #drawer .btn { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); color: #fff; }
html.mod-math #drawer .btn.light { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .mod-pop { background: #fff; box-shadow: 0 6px 0 var(--navy-2), 0 22px 50px rgba(34, 48, 79, .2), inset 0 0 0 2px var(--line); }
html.mod-math .mod-opt:hover, html.mod-math .mod-opt.is-selected { background: #eef3fa; }
html.mod-math .mod-soon { background: #eef3fa; color: var(--ink-2); }
html.mod-math .mod-check { color: #fff; }

/* ===== celé UI v Počítánkách: dialogy, nastavení, účet, profily, hrdina, album… (v Usínánkách zůstává noční) ===== */
html.mod-math .btn { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); color: #fff; }
html.mod-math .btn:active { box-shadow: 0 2px 0 var(--orange-d); }
html.mod-math .btn.light { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .round-btn { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .link-btn { color: var(--orange-d); }
html.mod-math .ov { background: rgba(34, 48, 79, .34); }
html.mod-math .ov-card { background: radial-gradient(120% 34% at 50% 0%, #ffe9cc 0%, #fff 60%); box-shadow: 0 -10px 40px rgba(34, 48, 79, .16); }
html.mod-math .ov-x { background: #eef3fa; color: var(--ink); }
html.mod-math .pw-kicker, html.mod-math .au-switch .link-btn, html.mod-math .gate-q, html.mod-math .pk-lock { color: var(--orange-d); }
html.mod-math .pw-demo { color: var(--muted); }
html.mod-math .au-err { color: var(--pink-d); }
html.mod-math :is(.fld input, .gate-f input, .rm-row input[type=time]) { background: #f6f9fd; border-color: var(--line); color: var(--ink); }
html.mod-math :is(.fld input, .gate-f input):focus { border-color: var(--orange); }
html.mod-math .fld input::placeholder { color: #9aa6bf; }
html.mod-math .chk input { accent-color: var(--orange); }
html.mod-math .plan { background: #fff; border-color: var(--line); }
html.mod-math .plan.on { background: #fff8ea; border-color: var(--orange); box-shadow: 0 5px 0 var(--orange-d); }
html.mod-math .plan-note { color: var(--mint-d); }
html.mod-math .pw-c { box-shadow: 0 0 0 3px #fff, 0 10px 24px rgba(34, 48, 79, .2); }
html.mod-math .pw-c.c1.pw-owl { left: 63px; top: 0; transform: none; width: 104px; height: 138px; box-shadow: 0 0 0 4px var(--orange), 0 8px 0 var(--orange-d); }
html.mod-math .pw-cta { background: var(--orange); color: #fff; box-shadow: 0 6px 0 var(--orange-d), 0 10px 30px rgba(255, 154, 61, .3); animation: none; }
html.mod-math :is(.sub-rows, .rm-box) { background: #f3f6fb; box-shadow: inset 0 0 0 2px var(--line); }
html.mod-math :is(.sub-rows li + li, .rm-row + .rm-row) { border-top-color: rgba(34, 48, 79, .08); }
html.mod-math .soc-btn.google { box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .soc-btn.apple { box-shadow: 0 4px 0 #555; }
html.mod-math .soc-btn.mail { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .pf-av.big { box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .12), 0 8px 0 var(--navy-2); }
html.mod-math .pf-av.add { background: #eef3fa; border-color: #c7d3e6; }
html.mod-math .pk-item:hover .pf-av, html.mod-math .pk-item:focus-visible .pf-av { box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .12), 0 0 0 4px var(--orange), 0 10px 0 var(--navy-2); }
html.mod-math .picker { background-color: #fdfaf3; background-image: radial-gradient(130% 45% at 50% -10%, rgba(255, 154, 61, .4), transparent 62%), linear-gradient(#e4ecf6 1px, transparent 1px), linear-gradient(90deg, #e4ecf6 1px, transparent 1px); background-size: 100% 100%, 24px 24px, 24px 24px; }
html.mod-math :is(.pk-owl, .pe-av.on) { box-shadow: 0 0 0 3px var(--orange); }
html.mod-math :is(.tgl, .switch) { background: #d5dfec; }
html.mod-math :is(.tgl.on, .switch:checked) { background: var(--mint); }
html.mod-math .seg2 { background: #eef3fa; }
html.mod-math .seg2 button[aria-pressed="true"] { background: #fff; box-shadow: 0 2px 0 var(--navy-2), inset 0 0 0 2px var(--line); }
html.mod-math .srow input[type=range] { accent-color: var(--orange); }
html.mod-math .toast { background: var(--ink); color: #fff; }
/* hrdina */
html.mod-math :is(.hero-prev, .he-stage .hero-prev) { background: radial-gradient(circle at 50% 28%, #fff, #e3ebf6 75%); box-shadow: inset 0 -8px 0 rgba(34, 48, 79, .08), inset 0 0 0 2px var(--line); }
html.mod-math .he-tabs { background: #eef3fa; }
html.mod-math .he-tabs button[aria-selected="true"] { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-d); }
html.mod-math .he-tile { background: #f3f6fb; box-shadow: inset 0 0 0 2px var(--line); }
html.mod-math .he-tile.on { background: #fff; box-shadow: inset 0 0 0 3px var(--orange); }
html.mod-math .sw.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--orange); }
html.mod-math .he-dice { background: var(--orange); color: #fff; box-shadow: 0 4px 0 var(--orange-d); }
/* album nálepek */
html.mod-math .album { background-color: #fdfaf3; background-image: linear-gradient(#e4ecf6 1px, transparent 1px), linear-gradient(90deg, #e4ecf6 1px, transparent 1px); background-size: 24px 24px; }
html.mod-math .al-count { background: #e3e9f3; }
html.mod-math .al-tabs button { background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
html.mod-math .al-tabs button[aria-selected="true"] { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-d); }
html.mod-math .al-board { box-shadow: 0 0 0 4px #fff, 0 8px 0 var(--navy-2); }
@media (min-width: 600px) { html.mod-math .album { box-shadow: 0 0 0 100vmax rgba(34, 48, 79, .3); } }
html.mod-math .r-btn { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--navy-2), inset 0 0 0 2px var(--line); }

/* ===== posuvníky v nastavení: tlustá barevná dráha, velký úchyt, ikony a hodnota ===== */
.rng-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rng-val { padding: 2px 10px; border-radius: 999px; background: var(--rng-soft, rgba(255, 111, 145, .18)); color: var(--rng-ink, var(--pink)); font-size: 13px; font-weight: 900; min-width: 52px; text-align: center; }
.rng { display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 18px; background: var(--rng-box, rgba(255, 255, 255, .06)); }
.rng > svg { width: 22px; height: 22px; color: var(--muted); }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
.slider:focus-visible { outline: none; }
.slider::-webkit-slider-runnable-track { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--rng, var(--pink)) 0 var(--p), var(--rng-trk, rgba(255, 255, 255, .14)) var(--p) 100%); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .15); }
.slider::-moz-range-track { height: 14px; border-radius: 7px; background: var(--rng-trk, rgba(255, 255, 255, .14)); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .15); }
.slider::-moz-range-progress { height: 14px; border-radius: 7px; background: var(--rng, var(--pink)); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -8px; border-radius: 50%; background: #fff; border: 5px solid var(--rng, var(--pink)); box-shadow: 0 3px 0 var(--rng-d, var(--pink-d)), 0 4px 10px rgba(0, 0, 0, .25); transition: transform .12s; }
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid var(--rng, var(--pink)); box-shadow: 0 3px 0 var(--rng-d, var(--pink-d)), 0 4px 10px rgba(0, 0, 0, .25); transition: transform .12s; }
.slider:active::-webkit-slider-thumb, .slider:focus-visible::-webkit-slider-thumb { transform: scale(1.15); }
.slider:active::-moz-range-thumb, .slider:focus-visible::-moz-range-thumb { transform: scale(1.15); }
html.mod-math .rng { --rng: var(--orange); --rng-d: var(--orange-d); --rng-trk: #dfe6f1; --rng-box: #f3f6fb; --rng-soft: #fff0dd; --rng-ink: var(--orange-d); box-shadow: inset 0 0 0 2px var(--line); }
html.mod-math .rng-val { --rng-soft: #fff0dd; --rng-ink: var(--orange-d); }
html.mod-math .slider::-webkit-slider-runnable-track, html.mod-math .slider::-moz-range-track { box-shadow: inset 0 2px 3px rgba(34, 48, 79, .1); }

/* obtahování prstem */
.tr-pad { display: block; width: min(64vw, 240px); height: auto; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; background: #fff; border-radius: 22px; box-shadow: inset 0 0 0 2px var(--line); cursor: crosshair; }
.tr-guide { fill: none; stroke: #dbe3ef; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.tr-cp { fill: #b9c6da; transition: fill .2s; }
.tr-cp.on { fill: var(--mint); }
.tr-start { fill: var(--mint); stroke: #fff; stroke-width: 2; animation: trStart 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes trStart { 50% { transform: scale(1.35); } }
.tr-ink { fill: none; stroke: var(--orange); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.tr-pad.done .tr-ink { stroke: var(--mint); }
.tr-pad.done .tr-start { animation: none; }
.mx-trace { width: 100%; }
.lv-trace { width: 100%; display: grid; place-items: center; }
.lv-trace-clear { margin-top: 6px; }
.tr-demo .tr-guide { stroke-width: 9; }
.tr-ink-demo { fill: none; stroke: var(--orange); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.lv-mg { font: 800 22px var(--font-head); fill: var(--ink); }
.lv-mg.q { fill: var(--orange-d); }
.lv-tt { margin: 0 auto; border-collapse: separate; border-spacing: 0; min-width: 220px; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; color: var(--ink); }
.lv-tt th { background: #eef3fa; padding: 8px 14px; font-size: 13px; color: var(--ink-2); text-align: left; }
.lv-tt td { padding: 8px 14px; border-top: 1px solid var(--line); }
.lv-tt td + td, .lv-tt th + th { text-align: right; }
.lv .lv-tt tr.hl { background: #fff3c4; }
.lv-combo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lv-combo span { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-weight: 900; }
.lv-combo i { width: 18px; height: 22px; border-radius: 5px 5px 3px 3px; display: inline-block; }
.lv .lv-combo .hl { background: #fff3c4; transform: scale(1.06); }

/* Počítánky Premium: věta o dětských domovech */
.pw-give { white-space: nowrap; text-align: left; display: flex; gap: 7px; align-items: center; justify-content: center; width: fit-content; max-width: 100%; margin: 0 auto 12px; padding: 5px 12px 5px 6px; border-radius: 999px; background: #ffe6ee; font-size: 12.5px; font-weight: 700; line-height: 1.3; color: #9c2c50; }
.pw-give b { color: #c9356a; }
.pw-give-ico { width: 22px; height: 22px; flex: none; border-radius: 50%; background: #ec5f86; color: #fff; display: grid; place-items: center; animation: pw-beat 2.4s ease-in-out infinite; }
.pw-give-ico svg { width: 13px; height: 13px; fill: currentColor; }
@keyframes pw-beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.15); } 24% { transform: scale(1); } 36% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .pw-give-ico { animation: none; } }
.pw-cta small { display: block; font-size: 12.5px; font-weight: 700; opacity: .85; margin-top: 1px; }
.pw-cta:has(small) { flex-direction: column; gap: 0; line-height: 1.15; padding-top: 12px; padding-bottom: 12px; }

/* Počítánky: registrace se sovičkou-učitelkou */
.auth-owl { display: grid; place-items: center; background: linear-gradient(180deg, #fff6e6, #ffe2b8); }
.auth-owl .m-owl { width: 86%; height: 86%; }
.auth-owl .m-owl svg { width: 100%; height: 100%; }
/* výklad: shrnutí „Zapamatuj si“ a zadání ve „Zkusíme to spolu“ */
.lv-sum { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(100%, 340px); padding: 14px 16px; border-radius: 20px; background: #fff8e6; border: 2.5px dashed #ffc36b; }
.lv-sum .lv-eq { font-size: 21px; line-height: 1.3; text-align: center; }
.lv-q2 { font-size: 30px; }
.lv-story + .lv-eq, .lv-places + .lv-eq { margin-top: 4px; }
.lv-croc.long { font-size: 26px; gap: 6px; }
.lv-croc.long svg { width: 46px; height: 48px; }
/* kalendář: dny a měsíce jako štítky, měsíční mřížka */
.lv-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: 340px; }
.lv-chips > span { padding: 7px 12px; border-radius: 999px; background: #fff; border: 2px solid #d5dfec; font-weight: 800; font-size: 15px; color: var(--ink); }
.lv .lv-chips > .hl { background: #fff3c4; border-color: #ffc93c; box-shadow: 0 0 0 5px #fff3c4, 0 0 18px 6px rgba(255, 201, 60, .5); transform: scale(1.08); }
.lv-cal { display: grid; grid-template-columns: repeat(7, 38px); gap: 4px; justify-content: center; font-weight: 800; }
.lv-cal > b { font-size: 12px; text-align: center; color: var(--muted); }
.lv-cal > span, .lv-cal > i { height: 34px; display: grid; place-items: center; border-radius: 9px; font-size: 15px; }
.lv-cal > span { background: #fff; border: 1.5px solid #e1e7f0; color: var(--ink); }
.lv-cal > span.mk { background: #ffe3b8; border-color: #ff9a3d; }
.lv .lv-cal > .hl { background: #fff3c4; border-color: #ffc93c; box-shadow: 0 0 14px 4px rgba(255, 201, 60, .6); transform: scale(1.15); }
.lv .lv-cubes g.hl path { stroke: #e08a00; stroke-width: 2.4; }
.au-forgot { display: block; margin: 10px auto 0; font-size: 14px; }
.acc-del { display: block; margin: 10px auto 0; font-size: 13px; color: #c0392b; opacity: .8; }

/* Premium: koruna nad maskotem v hlavičce */
.pro-mascot { position: relative; display: inline-flex; flex: none; }
.pro-crown { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%) rotate(-8deg); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #ffc93c; color: #7a4a00; box-shadow: 0 2px 0 #e0a10f, 0 0 0 3px #fff; z-index: 2; animation: pro-bob 3.2s ease-in-out infinite; }
.pro-crown svg { width: 17px; height: 17px; }
@keyframes pro-bob { 0%, 100% { transform: translateX(-50%) rotate(-8deg) translateY(0); } 50% { transform: translateX(-50%) rotate(6deg) translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .pro-crown { animation: none; } }

.m-practice-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.m-practice-topic { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 16px; }
.m-practice-topic .m-ico { display: grid; place-items: center; width: 64px; height: 56px; padding: 0; margin: 0; background: var(--surface-2); border-radius: 12px; }
.m-practice-topic .m-ico svg { width: 100%; height: 100%; display: block; }
.m-practice-topic h3 { margin: 2px 0 0; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.m-practice-topic .m-tile-btns { grid-column: 1 / -1; gap: 8px; margin-top: 2px; }
.m-practice-topic .m-tile-btns a { display: grid; place-items: center; min-height: 44px; padding: 6px; line-height: 1.25; }
.m-practice-topic .m-tile-btns a:first-child { background: var(--ink); color: white; }

.m-world .topic .m-dot { position: relative; }
.m-world .topic .m-ico .m-topic-art { display: block; width: 56px; height: 49px; }
.m-next-ico .m-topic-art { width: 50px; height: auto; }
.m-world .topic.locked .m-topic-art { filter: saturate(.45); }
.m-node-badge { position: absolute; right: 7px; bottom: 6px; display: grid; place-items: center; width: 21px; height: 21px; background: #fff; color: #354564; border: 1px solid currentColor; border-radius: 50%; pointer-events: none; }
.m-node-badge svg { width: 14px; height: 14px; }

.mx-body.mx-lesson-card { align-items: stretch; justify-content: flex-start; text-align: left; }
.mx-lesson-card .lv-bubble { padding-right: 14px; }
.mx-lesson-card .lv-vis { flex: 1 0 auto; padding: 54px 14px 20px; }
.mx-lesson-card .lv-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mx-lesson-card .lv-choice button { white-space: normal; overflow-wrap: anywhere; }
.mx-lesson-card .lv-choice.long button { font-size: 18px; }
.mx-lesson-card .mx-vis { overflow-x: auto; }
.mx-lesson-card .mx-trace { text-align: center; }
@media (max-height: 700px) {
  .mx-lesson-card .lv-owl { width: 52px; height: 52px; }
  .mx-lesson-card .lv-vis { min-height: 130px; }
}
.mx-end .end-sticker { max-width: 400px; flex-shrink: 0; margin: 4px 0; }
.al-filter { display: flex; align-items: center; gap: 10px; padding: 2px 16px 10px; font-weight: 700; }
.al-filter select { min-height: 44px; border-radius: 10px; padding: 4px 10px; font: inherit; }
.al-catalog { overflow-y: auto; min-height: 0; padding: 0 14px max(24px, env(safe-area-inset-bottom)); }
.al-world { --wash: #e4f0da; --accent: #385a41; --field: #c6dda9; margin-bottom: 22px; }
.al-entry.al-sea { --wash: #def1f4; --accent: #255c70; --field: #a4d8db; }
.al-entry.al-space { --wash: #ece8fa; --accent: #564576; --field: #c9c1e5; }
.al-world header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; margin-bottom: 9px; background: var(--wash); color: var(--accent); border-radius: 14px; }
.al-world h3 { font: 800 22px var(--font-head); margin: 0; }
.al-world header span { font-size: 14px; font-weight: 800; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 10px; }
.al-entry { min-width: 0; border-radius: 18px; border: 1px solid #d8dfdc; overflow: hidden; background: #fffdf8; color: #283849; box-shadow: 0 2px 0 #26394b18; }
.al-picture { isolation: isolate; display: grid; place-items: center; position: relative; height: 106px; background: radial-gradient(ellipse at 50% 105%, var(--field) 0 39%, transparent 40%), linear-gradient(150deg,#fff9,var(--wash)),var(--wash); }
.al-sea .al-picture { background: radial-gradient(circle at 82% 26%, #fff9 0 4px, transparent 5px), radial-gradient(circle at 74% 40%, #fff9 0 2px, transparent 3px), linear-gradient(165deg,var(--wash),var(--field)); }
.al-space .al-picture { background: radial-gradient(circle at 18% 25%,#fff 0 1px,transparent 2px), radial-gradient(circle at 80% 60%,#fff 0 2px,transparent 3px), linear-gradient(145deg,var(--wash),var(--field)); }
.al-picture > svg { width: 98px; height: 98px; filter: drop-shadow(1px 0 0 white) drop-shadow(-1px 1px 0 white) drop-shadow(0 2px 1px #39465138); }
.al-entry.missing .al-picture > svg { filter: grayscale(1); opacity: .65; }
.al-picture span { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #fff; color: #445368; }
.al-picture span svg { width: 14px; height: 14px; }
.al-caption { padding: 9px 11px 12px; }
.al-caption small { display: inline-block; margin-bottom: 4px; border-radius: 8px; padding: 2px 7px; color: var(--accent); background: var(--wash); font-size: 11px; font-weight: 800; }
.al-caption b { display: block; font: 800 16px/1.2 var(--font-head); }
.al-caption p { margin: 5px 0 0; font-size: 12px; line-height: 1.35; color: #505d69; }
.al-source { display: flex; align-items: center; min-height: 44px; margin-top: 3px; color: var(--accent); font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.install-guide { width: min(calc(100% - 40px), 440px); margin: clamp(28px, 8vh, 80px) auto; color: var(--ink); overflow-wrap: anywhere; }
.install-guide .topbar { padding: 0 4px 22px; }
.install-owl { flex: none; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--sun); }
.install-panel { padding: clamp(20px,5vw,32px); background: #e2f2df; color: #193f3e; border-radius: 27px; box-shadow: 0 5px 0 #83b3a7; text-align: center; }
.install-panel figure { margin: 0 auto 18px; width: fit-content; padding: 5px; background: white; border-radius: 18px; box-shadow: 0 3px 0 #b7d4be; }
.install-panel figure img { display: block; max-width: 100%; height: auto; }
.install-panel h2 { font-size: clamp(23px,5vw,29px); color: inherit; }
.install-panel p { margin: 8px auto 18px; max-width: 33ch; font-size: 16px; line-height: 1.45; }
.install-panel .btn { width: 100%; background: #174f4d; color: white; box-shadow: 0 4px 0 #102f36; }
#install-status { margin: 14px 0; text-align: center; }
#install-status:empty { display: none; }
.install-guide details { margin-top: 18px; padding: 0 16px; border-radius: 16px; background: var(--surface); }
.install-guide summary { padding: 14px 0; cursor: pointer; font-weight: 800; }
.install-guide details section { padding: 0 4px 12px; }
.install-guide details h2 { font-size: 18px; }
.install-guide ol { margin: 6px 0; padding-left: 1.4em; }
.install-guide li { margin: 6px 0; }
body:has(.launch-home) { padding-bottom: 0; }
#app:has(.launch-home) { padding: 0; max-width: none; }
.launch-home { color: var(--ink); min-height: 100svh; }
.launch-inner { max-width: 480px; margin: auto; padding: max(28px,env(safe-area-inset-top)) 20px 32px; }
.launch-card { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: end; min-height: clamp(128px,21svh,178px); margin: 0 0 15px; border-radius: 26px; padding: 20px; text-decoration: none; }
.launch-card:focus-visible { outline: 4px solid #c85b27; outline-offset: 3px; }
.launch-stories { background: radial-gradient(circle at 53% 17%,#fff3ba 0 2px,transparent 3px),radial-gradient(circle at 82% 11%,#fff3ba 0 2px,transparent 3px),radial-gradient(circle at 12% 24%,#fff3ba 0 2px,transparent 3px),linear-gradient(120deg,#353458,#565183); color: #fff7e1; box-shadow: 0 4px 0 #282c47; }
.launch-math { background: linear-gradient(125deg,#bce8c9,#86d4c2); color: #174842; box-shadow: 0 4px 0 #71b6a7; }
.launch-card::before { content: ""; position: absolute; z-index: -1; right: -10%; bottom: -47%; width: 65%; height: 100%; transform: rotate(-14deg); background: #ffffff25; border-radius: 50%; }
.launch-art { position: absolute; right: 7px; top: 0; width: 42%; height: 83%; pointer-events: none; }
.launch-art > svg, .launch-art .launch-owl { position: absolute; width: 86%; height: 96%; right: 0; bottom: -8%; }
.launch-art .launch-owl { background: transparent; }
.launch-art .launch-owl svg { width: 100%; height: 100%; }
.launch-moon { position: absolute; width: 25px; height: 25px; border-radius: 50%; box-shadow: -7px 5px 0 #ffe592; top: 13%; left: 0; transform: rotate(-16deg); }
.launch-number { position: absolute; left: 0; top: 14%; color: #377b6d; background: #fff2b7; border-radius: 8px; padding: 0 7px; font: 800 23px var(--font-head); transform: rotate(-14deg); }
.launch-copy { position: relative; display: grid; justify-items: start; }
.launch-copy strong { font: 600 clamp(26px,7vw,33px)/1.1 var(--font-head); }
.launch-copy small { font-size: 14px; font-weight: 700; margin-top: 3px; }
.launch-arrow { position: absolute; bottom: 13px; right: 15px; width: 31px; height: 31px; border-radius: 50%; background: #ffffff40; display: grid; place-items: center; }
.launch-arrow svg { width: 17px; height: 17px; }

.launch-english { color: #453759; background: linear-gradient(120deg,#e9dbf7,#cbc2ed); box-shadow: 0 4px 0 #a491cd; }
.launch-status { display: inline-block; margin-top: 7px; padding: 2px 10px; border-radius: 999px; background: #fff9; color: #59476e; font: 800 12px var(--font-ui); }
.launch-word { position: absolute; left: 0; top: 14%; border-radius: 12px 12px 3px 12px; background: #fff9ee; color: #68518d; padding: 2px 7px; font: 800 15px var(--font-head); transform: rotate(-8deg); }
.launch-card[href]:active { transform: translateY(3px); }
.module-welcome { width: min(calc(100% - 32px), 380px); max-height: 90svh; margin: auto; border: 0; border-radius: 26px; padding: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 0 #14152640; }
.module-welcome::backdrop { background: #17152bb8; }
.welcome-head, .welcome-actions { display: flex; align-items: center; gap: 14px; }
.welcome-head { margin: 0 6px 22px; font: 700 21px var(--font-head); }
.module-welcome small { color: var(--muted); }
.module-welcome h2 { margin: 5px 0; }
.module-welcome p { margin: 0; line-height: 1.45; }
.welcome-actions { margin-top: 20px; justify-content: space-between; }

/* průvodce pro děti: ztmavená obrazovka, svítící „okénko“ kolem místa, o kterém sovička mluví */
.tour { position: fixed; inset: 0; z-index: 400; }
.tour-hole { position: fixed; border-radius: 22px; outline: 4px solid #ffc93c; outline-offset: 2px; transition: all .35s cubic-bezier(.3, 1.2, .5, 1); pointer-events: none; animation: tour-pulse 1.6s ease-in-out infinite; }
.tour-dim { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .8; }
.tour-dim path { fill: #17152b; }
.tour.free .tour-hole { display: none; }
@keyframes tour-pulse { 50% { outline-color: #fff3c4; outline-offset: 7px; } }
.tour-card { position: fixed; left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 380px); padding: 18px 20px 16px; border-radius: 26px; background: #fff; color: #22304f; box-shadow: 0 6px 0 rgba(0, 0, 0, .15), 0 18px 40px rgba(0, 0, 0, .3); transition: top .35s, bottom .35s; }
.tour.free .tour-card { top: 50%; transform: translate(-50%, -50%); }
.tour-card::before { content: ''; position: absolute; left: 50%; width: 22px; height: 22px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 4px; }
.tour-card[data-arrow=up]::before { top: -9px; }
.tour-card[data-arrow=down]::before { bottom: -9px; }
.tour.free .tour-card::before { display: none; }
.tour-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tour-owl { width: 56px; height: 56px; flex: none; }
.tour-owl svg { width: 100%; height: 100%; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 10px; height: 10px; border-radius: 50%; background: #e3e9f3; }
.tour-dots i.on { background: #ff9a3d; }
.tour-card h2 { margin: 2px 0 4px; font: 800 24px var(--font-head); line-height: 1.15; }
.tour-text { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.4; color: #3b4a69; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tour-actions .btn:not(.block) { min-width: 130px; font-size: 18px; }
.tour-actions .btn.block { width: 100%; }
.tour-actions .link-btn[data-go] { width: 100%; text-align: center; }
@media (prefers-reduced-motion: reduce) { .tour-hole { animation: none; transition: none; } .tour-card { transition: none; } }
