/* Red Sea Buddy – vzhled
   Barvy: laguna, hluboká voda, korál, slunce, útes. Písmo: Baloo 2 (nadpisy), Atkinson Hyperlegible (text, čitelné na slunci). */

@font-face { font-family: 'Baloo 2'; font-weight: 600; font-display: swap; src: url(../fonts/baloo-2-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-weight: 600; font-display: swap; src: url(../fonts/baloo-2-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url(../fonts/baloo-2-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url(../fonts/baloo-2-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url(../fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url(../fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url(../fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url(../fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --lagoon: #DDF2F1;      /* pozadí: mělká laguna */
  --lagoon-2: #C6E9E7;
  --deep: #0F4C5C;        /* hluboká voda, lišty */
  --ink: #12324A;         /* text, obrysy */
  --ink-2: #3E5B6E;
  --coral: #FF6F59;       /* hlavní akce */
  --coral-ink: #B83A26;
  --sun: #FFC93C;         /* odznaky, zvýraznění */
  --reef: #138C8C;        /* odkazy, aktivní stav */
  --card: #FFFFFF;
  --line: #A9D3D2;
  --danger: #C2410C;
  --danger-bg: #FFE8DC;
  --ok: #157A4B;
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --tab-h: 68px;
  --display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --text: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--lagoon);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--text);
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
[dir="rtl"] body { direction: rtl; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--reef); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-weight: 800; font-size: clamp(2rem, 7vw, 2.75rem); }
h2 { font-weight: 800; font-size: 1.5rem; }
h3 { font-weight: 600; font-size: 1.2rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- horní lišta ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: var(--lagoon);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 34px; }
.brand-name { font: 800 1.25rem/1 var(--display); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--ink); }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:hover { background: var(--lagoon-2); }

.offline { background: var(--sun); color: var(--ink); padding: 6px 16px; font-size: 0.9rem; text-align: center; }

main { max-width: 760px; margin: 0 auto; padding: 4px 16px 32px; outline: none; }
.view-head { padding: 12px 0 18px; display: grid; gap: 6px; }
.view-head p { color: var(--ink-2); max-width: 36em; }

/* ---------- spodní lišta ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--deep);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  min-height: var(--tab-h);
}
.tab {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  color: #CFE7E8; text-decoration: none; font-size: 0.72rem; line-height: 1.15; text-align: center;
  border-radius: 14px; padding: 4px 2px; min-height: 52px;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--ink); background: var(--sun); }
.tab .tab-label { max-width: 11ch; }

/* ---------- tlačítka, čipy, formuláře ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: 999px; border: 2.5px solid var(--ink);
  background: var(--coral); color: #fff; font: 600 1.1rem/1 var(--display); cursor: pointer; text-decoration: none;
  box-shadow: 0 3px 0 var(--ink);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.secondary { background: var(--card); color: var(--ink); }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--reef); padding-inline: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--card); cursor: pointer; font-size: 0.95rem; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-danger { display: inline-flex; align-items: center; gap: 6px; border-color: var(--danger); color: #6B2408; background: var(--danger-bg); font-weight: 700; }
.chip-danger svg { width: 18px; height: 18px; flex: none; }
.chip-danger[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #fff; }
.chip-endemic { display: inline-flex; align-items: center; gap: 6px; border-color: #1E8A5A; color: #0D4D30; background: #E7F6EE; font-weight: 700; }
.chip-endemic svg { width: 18px; height: 18px; flex: none; }
.chip-endemic[aria-pressed="true"] { background: #1E8A5A; border-color: #1E8A5A; color: #fff; }
.danger-note { margin-top: 0; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-s); border: 2px solid var(--line); background: var(--card);
}
.input:focus { border-color: var(--reef); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--reef); flex: none; }
.error { color: var(--danger); font-size: 0.95rem; }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--ink-2); }
.search .input { padding-left: 44px; }

/* ---------- lexikon ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: grid; align-content: start; gap: 2px; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: var(--radius-m); padding: 8px 10px 12px; border: 2px solid transparent;
}
.tile:hover { border-color: var(--line); }
.tile .art { aspect-ratio: 200 / 140; background: linear-gradient(#EAF7F7, #D4EEEE); border-radius: 12px; display: grid; place-items: center; }
.tile .art svg { width: 92%; }
.tile .name { font: 600 1.05rem/1.15 var(--display); margin-top: 6px; }
.tile .sci { font-size: 0.8rem; color: var(--ink-2); font-style: italic; }
.tile .flags { position: absolute; top: 12px; left: 14px; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 64px); }
.tile .flag { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sun); }
.tile .flag.new { background: var(--coral); color: #fff; }
.tile .seen { position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--reef); display: grid; place-items: center; }
.tile .seen svg { width: 16px; color: #fff; }
.tile .warn { position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--danger); color: #fff; font: 800 1rem/26px var(--display); text-align: center; }
.tile .seen + .warn { right: 42px; }
.empty-note { padding: 28px 8px; text-align: center; color: var(--ink-2); }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 4px -8px; }
.detail-hero { background: linear-gradient(180deg, #BFE8E6 0%, #8ED3D4 100%); border-radius: var(--radius-l); padding: 18px 12px 4px; position: relative; overflow: hidden; }
.detail-hero svg { width: min(100%, 460px); margin: 0 auto; }
.detail-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: #F2E3BE; border-top: 2px solid #E2CD98; }
.detail-title { padding: 16px 2px 4px; display: grid; gap: 2px; }
.detail-title .sci { font-style: italic; color: var(--ink-2); }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-m); margin: 12px 0; }
.callout svg { flex: none; width: 26px; height: 26px; }
.callout.warn { background: var(--danger-bg); color: #6B2408; }
.callout.calm { background: #E7F6EE; color: #0D4D30; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.fact { background: var(--card); border-radius: var(--radius-s); padding: 10px 12px; }
.fact dt { font-size: 0.85rem; color: var(--ink-2); }
.fact dd { margin: 0; font-weight: 700; }
.size-like { display: block; margin-top: 2px; font-size: 0.85rem; font-weight: 400; color: var(--ink-2); }
.prose { display: grid; gap: 12px; margin: 8px 0 16px; }
.didyou { background: var(--card); border-left: 6px solid var(--sun); border-radius: var(--radius-s); padding: 12px 14px; }
.didyou h3 { margin-bottom: 4px; }
.small { font-size: 0.9rem; color: var(--ink-2); }
.sources { margin-top: 16px; font-size: 0.9rem; }
.sources ul { padding-left: 18px; margin: 6px 0 0; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }

/* ---------- průvodce ---------- */
.step-meta { display: flex; justify-content: space-between; align-items: center; color: var(--ink-2); font-size: 0.9rem; }
.progress { height: 8px; background: var(--lagoon-2); border-radius: 99px; overflow: hidden; margin: 8px 0 18px; }
.progress span { display: block; height: 100%; background: var(--reef); border-radius: 99px; transition: width .3s; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  min-height: 60px; padding: 10px 16px; border-radius: var(--radius-m); background: var(--card); border: 2.5px solid var(--card); cursor: pointer;
  font-size: 1.05rem;
}
.option[aria-pressed="true"] { border-color: var(--ink); background: #FFF7DD; }
.option .glyph { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--lagoon); }
.option .glyph svg { width: 38px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; position: relative; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.swatch[aria-pressed="true"]::after { content: ''; position: absolute; inset: 14px; border: 3px solid var(--ink); border-top: 0; border-left: 0; width: 10px; height: 18px; rotate: 45deg; margin: -6px auto 0; background: none; }
.swatch.light[aria-pressed="true"]::after { border-color: var(--ink); }
.guide-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.results { display: grid; gap: 12px; }
.result { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius-m); padding: 10px; text-decoration: none; color: var(--ink); }
.result .art { background: var(--lagoon); border-radius: 12px; }
.result .rank { font: 800 0.85rem/1 var(--display); color: var(--reef); }
.result .name { font: 600 1.15rem/1.15 var(--display); }
.result.top { border: 3px solid var(--ink); }

/* ---------- akvárium ---------- */
.tank-wrap { margin: 0 -16px; }
.tank {
  position: relative; height: clamp(260px, 44dvh, 440px); overflow: hidden; touch-action: none;
  background:
    radial-gradient(120% 60% at 30% -10%, rgba(255,255,255,.45), transparent 60%),
    linear-gradient(180deg, #7FD6E0 0%, #3BA9C2 45%, #1F7FA6 100%);
}
.tank .ray { position: absolute; top: -20%; width: 70px; height: 140%; background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 70%); transform: rotate(14deg); pointer-events: none; }
.tank .sand { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: #F2E3BE; border-top: 3px solid #E2CD98; }
.tank .sand::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(#D9C389 1.4px, transparent 1.6px); background-size: 22px 16px; opacity: .7; }
.tank .deco { position: absolute; bottom: 10%; pointer-events: none; }
.tank .critter { position: absolute; left: 0; top: 0; will-change: transform; cursor: pointer; }
.tank .critter svg { width: 100%; height: auto; overflow: visible; }
.tank .bubble { position: absolute; bottom: 12%; width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); pointer-events: none; animation: rise 7s linear infinite; }
@keyframes rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-60vh); opacity: 0; } }
.tank .tank-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; padding: 24px; text-align: center; color: #fff; font-size: 1.1rem; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tank-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--deep); color: #fff; font-size: 0.95rem; }
.bucket { background: #FFF; border-radius: 0 0 var(--radius-l) var(--radius-l); padding: 12px 16px 16px; }
.bucket h3 { font-size: 1rem; margin-bottom: 8px; }
.bucket-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.bucket-item { flex: none; width: 96px; border-radius: 14px; background: var(--lagoon); padding: 6px; border: 2px dashed var(--reef); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.bucket-item:active { cursor: grabbing; }
.bucket-item .tiny { font-size: 0.75rem; text-align: center; line-height: 1.1; margin-top: 2px; }
.ghost { position: fixed; z-index: 60; width: 110px; pointer-events: none; transform: translate(-50%, -50%) scale(1.1); filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.section { margin-top: 26px; display: grid; gap: 12px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.badge { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 0.82rem; line-height: 1.15; }
.badge .medal { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); border: 3px solid var(--ink); }
.badge .medal svg { width: 36px; }
.badge.locked .medal { background: var(--lagoon-2); border-color: var(--line); filter: grayscale(1); opacity: .6; }
.badge.locked { color: var(--ink-2); }
.diary { display: grid; gap: 8px; }
.diary-row { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; background: var(--card); border-radius: var(--radius-s); padding: 6px 10px 6px 6px; text-decoration: none; color: var(--ink); }
.diary-row .art { background: var(--lagoon); border-radius: 8px; }
.diary-row b { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
/* Moje sbírka: pokrok po skupinách */
.collection { display: grid; gap: 8px; margin-top: 8px; }
.coll-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; background: var(--card); border-radius: var(--radius-s); padding: 6px 12px 6px 6px; text-decoration: none; color: var(--ink); border: 2px solid transparent; }
.coll-row .art { background: var(--lagoon); border-radius: 8px; }
.coll-row.none .art svg { filter: grayscale(1); opacity: .45; }
.coll-row.done { border-color: var(--sun); }
.coll-txt { display: grid; gap: 4px; min-width: 0; }
.coll-txt b { font-family: var(--display); font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.coll-bar { display: block; height: 10px; border-radius: 999px; background: var(--lagoon-2); overflow: hidden; }
.coll-bar > span { display: block; height: 100%; min-width: 0; border-radius: 999px; background: var(--reef); }
.coll-row.done .coll-bar > span { background: var(--sun); }
.coll-go { font-size: 1.6rem; color: var(--reef); font-weight: 700; }

/* ---------- děti ---------- */
.kid-cards { display: grid; gap: 14px; }
.kid-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; padding: 14px; background: var(--card); border-radius: var(--radius-l); text-decoration: none; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.kid-card h2 { font-size: 1.4rem; }
.kid-card .art { background: #FFF2C6; border-radius: 18px; padding: 6px; }
/* hvězdičky za hry */
.stars { display: inline-flex; gap: 2px; line-height: 1; }
.stars span { color: var(--sun); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.stars span.off { color: transparent; opacity: .35; }
.stars.mini { display: flex; margin-top: 6px; font-size: 1.35rem; }
.stars.big { font-size: 3rem; gap: 6px; }
.stars-end { text-align: center; margin-bottom: 6px; }
.stars-end .stars.big span.on { display: inline-block; animation: star-pop .5s cubic-bezier(.3,1.6,.5,1) both; }
.stars-end .stars.big span.on:nth-child(2) { animation-delay: .15s; }
.stars-end .stars.big span.on:nth-child(3) { animation-delay: .3s; }
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .stars-end .stars.big span.on { animation: none; } }
.coloring-canvas { background: #fff; border-radius: var(--radius-l); padding: 10px; border: 3px solid var(--ink); }
.coloring-canvas svg { width: 100%; cursor: pointer; }
.coloring-canvas [data-r] { cursor: pointer; }
.palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0; }
.palette .swatch { width: 48px; height: 48px; }
.pick-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; }
.pick { flex: none; width: 90px; background: var(--card); border-radius: 14px; border: 2.5px solid transparent; padding: 4px; cursor: pointer; }
.pick[aria-pressed="true"] { border-color: var(--ink); }
.reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; margin-top: 10px; }
.reveal figure { margin: 0; background: var(--card); border-radius: var(--radius-m); padding: 8px; text-align: center; font-size: 0.9rem; }
.quiz-card { background: var(--card); border-radius: var(--radius-l); padding: 22px 18px; display: grid; gap: 18px; text-align: center; border: 3px solid var(--ink); }
.quiz-card .statement { font: 600 1.5rem/1.2 var(--display); }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.thumb { min-height: 96px; border-radius: var(--radius-m); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); cursor: pointer; display: grid; place-items: center; gap: 4px; font: 600 1.1rem/1 var(--display); }
.thumb svg { width: 44px; }
.thumb.up { background: #C9F0D8; }
.thumb.down { background: #FFD6CC; }
.memory-grid { display: grid; gap: 10px; margin: 6px 0 16px; }
.memory-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.memory-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.mcard { position: relative; aspect-ratio: 1; border-radius: var(--radius-m); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: var(--deep); cursor: pointer; padding: 0; overflow: hidden; transition: transform .18s; }
.mcard:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.mcard .mface { position: absolute; inset: 0; display: grid; place-items: center; }
.mcard .back { font: 800 2rem/1 var(--display); color: var(--sun); background: radial-gradient(circle at 30% 30%, #1E7A8C, var(--deep)); }
.mcard .front { background: #FFF2C6; padding: 4px; opacity: 0; }
.mcard .front svg { width: 100%; height: auto; }
.mcard.up .back { opacity: 0; }
.mcard.up .front { opacity: 1; }
.mcard.found { border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); cursor: default; }
.mcard.found .front { background: #C9F0D8; }
.memory-win { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .mcard { transition: none; } }
.verdict { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius-m); }
.verdict.good { background: #E7F6EE; }
.verdict.bad { background: var(--danger-bg); }
.verdict b { font: 800 1.3rem/1 var(--display); }

/* ---------- chraň moře ---------- */
.rules { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0; }
.rule { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius-m); padding: 12px; }
.rule .ico { width: 72px; height: 72px; border-radius: 20px; background: #FFF2C6; display: grid; place-items: center; }
.rule .ico svg { width: 52px; }
.rule h3 { margin-bottom: 2px; }

/* ---------- spodní panel (sheet) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(18, 50, 74, .45); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; overflow: auto;
  background: var(--card); border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet-body { display: grid; gap: 14px; }
.sheet-art { background: linear-gradient(#BFE8E6, #8ED3D4); border-radius: var(--radius-m); padding: 8px; }
.stars { display: flex; gap: 6px; justify-content: center; }
.star-btn { width: 54px; height: 54px; border: 0; background: transparent; cursor: pointer; padding: 0; }
.star-btn svg { width: 100%; }
.settings-list { display: grid; gap: 18px; }
.settings-group { display: grid; gap: 10px; background: var(--card); border-radius: var(--radius-m); padding: 14px; }
.lang-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; max-width: calc(100% - 32px); text-align: center;
}

/* ---------- reklama (fáze 2, zatím vypnutá) ---------- */
.ad-slot:empty { display: none; }

@media (min-width: 720px) {
  .tab { font-size: 0.82rem; }
  .tank-wrap { margin: 0; border-radius: var(--radius-l); overflow: hidden; }
  .tank-wrap .tank { border-radius: var(--radius-l) var(--radius-l) 0 0; }
}

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

/* Hra „Čí je to stín?“ */
.shadow-mini svg { filter: brightness(0); opacity: .75; }
.shadow-stage { background: radial-gradient(circle at 50% 40%, #FFF7DA, #FFE7A3); border: 3px solid var(--ink); border-radius: var(--radius-l); box-shadow: 0 4px 0 var(--ink); padding: 12px; margin: 6px 0 10px; }
.shadow-stage svg { width: 100%; height: auto; max-height: 200px; display: block; filter: brightness(0); opacity: .82; transition: filter .45s, opacity .45s; }
.shadow-stage.solved svg { filter: none; opacity: 1; }
.shadow-status { min-height: 1.6em; font: 800 1.15rem/1.3 var(--display); text-align: center; margin: 0 0 8px; }
.shadow-status.good { color: var(--ok); }
.shadow-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.shadow-opt { aspect-ratio: 1; padding: 6px; border-radius: var(--radius-m); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: #FFF2C6; cursor: pointer; display: grid; place-items: center; }
.shadow-opt svg { width: 100%; height: auto; }
.shadow-opt:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.shadow-opt.wrong { opacity: .35; }
.shadow-opt.right { border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); background: #C9F0D8; }
@media (prefers-reduced-motion: reduce) { .shadow-stage svg { transition: none; } }

/* Hra „Kolik jich je?“ */
.count-mini { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; }
.count-mini svg { width: 100%; height: auto; }
.count-stage { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 4px; min-height: 200px; background: linear-gradient(#BFE9F5, #7CCBE3); border: 3px solid var(--ink); border-radius: var(--radius-l); box-shadow: 0 4px 0 var(--ink); padding: 10px; margin: 6px 0 10px; }
.count-pic { width: 30%; max-width: 120px; animation: count-bob 2.6s ease-in-out infinite; animation-delay: calc(var(--d) * -.4s); }
.count-stage.n1 .count-pic { width: 60%; max-width: 220px; }
.count-stage.n2 .count-pic { width: 45%; }
.count-pic svg { width: 100%; height: auto; display: block; }
@keyframes count-bob { 50% { transform: translateY(-5px); } }
.count-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.count-opt { min-height: 96px; border-radius: var(--radius-m); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: #FFF2C6; cursor: pointer; display: grid; place-items: center; gap: 6px; padding: 8px 4px; color: var(--ink); }
.count-opt b { font: 800 2.2rem/1 var(--display); }
.count-opt:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.count-opt.wrong { opacity: .35; }
.count-opt.right { border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); background: #C9F0D8; }
.count-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 64px; }
.count-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .count-pic { animation: none; } }

/* Snadno se splete s… (detail zvířete) */
.alikes { margin: 18px 0 8px; }
.alikes h3 { margin: 0 0 2px; }
.alike-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.tile.alike { padding: 6px; }
.tile.alike .name { font-size: 0.85rem; overflow-wrap: anywhere; }

/* Kdo je větší? */
.size-mini { position: relative; }
.size-mini svg { display: block; height: auto; }
.size-mini .b svg { width: 100%; }
.size-mini .s { position: absolute; right: 0; bottom: 0; width: 30%; }
.size-mini .s svg { width: 100%; }
.size-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.size-opt { padding: 8px 6px 10px; border-radius: var(--radius-m); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: #FFF2C6; cursor: pointer; display: grid; gap: 4px; justify-items: center; color: var(--ink); font: 700 .95rem/1.2 var(--text); }
.size-opt svg { width: 100%; height: auto; }
.size-opt:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.size-opt.wrong, .size-opt.dim { opacity: .4; }
.size-opt.right { border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); background: #C9F0D8; }
.size-bars { display: grid; gap: 8px; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius-m); padding: 10px 12px; margin-bottom: 14px; }
.size-label { font-weight: 700; font-size: .92rem; }
.size-track { display: flex; align-items: center; gap: 8px; }
.size-row { display: grid; grid-template-areas: "l l" "t v"; grid-template-columns: 1fr auto; column-gap: 8px; row-gap: 2px; }
.size-label { grid-area: l; } .size-track { grid-area: t; } .size-val { grid-area: v; font-weight: 700; white-space: nowrap; }
.size-bar { display: block; height: 14px; border-radius: 7px; background: var(--reef); border: 2px solid var(--ink); }
.size-row.kid .size-bar { background: var(--sun); }
.size-row.kid .size-label { color: var(--ink-2); }
/* hra „Kde bydlí?“ */
.home-animal { display: grid; justify-items: center; gap: 2px; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius-m); padding: 6px 10px 10px; margin: 6px 0 10px; font: 700 1.05rem/1.2 var(--text); text-align: center; }
.home-animal svg { width: min(70%, 260px); height: auto; }
.home-animal.solved { padding: 0 0 8px; overflow: hidden; border-color: var(--ok); }
.home-animal.solved svg { width: 100%; }
.home-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.home-opt { padding: 0 0 8px; overflow: hidden; border-radius: var(--radius-m); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: #fff; cursor: pointer; display: grid; gap: 6px; justify-items: center; color: var(--ink); font: 700 .9rem/1.15 var(--text); text-align: center; }
.home-opt .home-scene { width: 100%; height: auto; display: block; }
.home-opt:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.home-opt.wrong, .home-opt.dim { opacity: .4; }
.home-opt.right { border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); background: #C9F0D8; }
.kid-card .home-scene { width: 100%; height: auto; border-radius: 10px; }

/* Zvíře dne (lexikon) */
.today { display: flex; gap: 12px; align-items: center; margin: 12px 0 4px; padding: 12px; border-radius: var(--radius-m); background: linear-gradient(135deg, #E6F4F8, #FFF6E5); color: inherit; text-decoration: none; border: 2px solid #CDE6EE; }
.today .art { flex: none; width: 104px; }
.today .art svg { width: 100%; height: auto; display: block; }
.today-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.today-label { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #B4531A; }
.today-txt strong { font-size: 1.1rem; line-height: 1.2; }
.today-txt .sci { font-style: italic; font-size: .85rem; opacity: .75; }
.today-fact { font-size: .9rem; line-height: 1.35; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.today-more { font-size: .85rem; font-weight: 700; color: #0E6E8C; margin-top: 4px; }
.today-more small { font-weight: 400; color: #5A6B73; margin-left: 6px; }

/* Hra „Najdi barvu“ */
.cg-ask { display: flex; align-items: center; gap: 14px; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius-l); box-shadow: 0 4px 0 var(--ink); padding: 10px 14px; margin: 6px 0 10px; font: 800 1.3rem/1.2 var(--display); }
.cg-blob { width: 76px; height: 76px; flex: none; }
.cg-mini { position: relative; }
.touch-mini, .tg-opt { position: relative; }
.touch-mini span, .tg-badge { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; background: #E8402F; color: #fff; border: 2px solid var(--ink); font-weight: 800; font-size: 17px; line-height: 22px; text-align: center; }
.tg-opt.safe { opacity: .45; }
.tg-opt.right { border-color: #E8402F; box-shadow: 0 4px 0 #E8402F; background: #FFE0D9; }
.cg-mini svg { width: 100%; height: auto; }
.cg-mini span { position: absolute; bottom: 0; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.cg-mini span:nth-of-type(1) { left: 6px; } .cg-mini span:nth-of-type(2) { left: 30px; } .cg-mini span:nth-of-type(3) { left: 54px; }
.verify-note { margin-top: 8px; padding: 6px 10px; border-left: 4px solid #E0B341; background: rgba(224, 179, 65, 0.12); border-radius: 6px; }

/* ---------- skutečné fotky ---------- */
.tile .art, .today .art, .result .art { overflow: hidden; }
.art img.photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.has-photo .art { background: #CFE7EA; }
.today .art { aspect-ratio: 200 / 140; border-radius: 12px; }
.result .art { aspect-ratio: 200 / 140; }
.photo-fallback { display: grid; place-items: center; width: 100%; height: 100%; }
.photo-fallback svg { width: 92%; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius-l); scrollbar-width: none; background: #CFE7EA; }
.gallery::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 16 / 10; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item .photo-fallback { background: linear-gradient(180deg, #BFE8E6 0%, #8ED3D4 100%); }
.photo-credit { font-size: .8rem; color: var(--ink-2); margin: 6px 4px 0; }

/* ---------- filtr podle barvy ---------- */
.color-filter { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 6px; padding: 4px 16px 8px; }
.color-filter::-webkit-scrollbar { display: none; }
.color-label { font-weight: 700; font-size: .9rem; margin-right: 2px; flex: none; }
.swatch.mini { flex: none; width: 36px; height: 36px; border-width: 2px; }
.swatch.mini[aria-pressed="true"]::after { inset: 8px; width: 7px; height: 13px; border-width: 2.5px; margin: -4px auto 0; }
.swatch.mini[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.swatch.light[aria-pressed="true"]::after, .swatch.mini.light::after { border-color: var(--ink); }
.swatch.mini:not(.light)[aria-pressed="true"]::after { border-color: #fff; }
.count-note { font-size: .9rem; color: var(--ink-2); margin: 4px 2px 10px; }
#more-wrap { margin-top: 16px; }

/* ---------- dlaždice pod myší „vystoupí“ ----------
   Na počítači s myší se dlaždice pod kurzorem zvětší, nadzvedne a vrhne stín, aby bylo jasné, že na ni jde kliknout.
   Stejně reaguje i výběr klávesnicí (Tab). Na dotykovém telefonu se nic nemění. */
.tile, .today, .result, .kid-card, .diary-row, .coll-row {
  position: relative;
  transition: transform .2s cubic-bezier(.2, .8, .3, 1.3), box-shadow .2s ease, border-color .2s ease;
  will-change: transform;
}
.tile .art img.photo, .today .art img.photo, .result .art img.photo, .tile .art svg, .kid-card .art svg { transition: transform .35s ease; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover, .today:hover, .result:hover, .kid-card:hover, .diary-row:hover, .coll-row:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 14px 28px rgba(9, 50, 66, .22), 0 4px 8px rgba(9, 50, 66, .12);
    border-color: var(--reef);
    z-index: 2;
    cursor: pointer;
  }
  .kid-card:hover { box-shadow: 0 10px 0 var(--ink), 0 18px 28px rgba(9, 50, 66, .2); }
  .tile:hover .art img.photo, .today:hover .art img.photo, .result:hover .art img.photo { transform: scale(1.08); }
  .tile:hover .art svg, .kid-card:hover .art svg { transform: scale(1.06) rotate(-2deg); }
  .mcard:hover:not(:disabled) { transform: translateY(-4px) scale(1.04); box-shadow: 0 8px 0 var(--ink); }
  .tile:active, .today:active, .result:active, .kid-card:active { transform: translateY(-2px) scale(1.02); transition-duration: .08s; }
}
.tile:focus-visible, .today:focus-visible, .result:focus-visible, .kid-card:focus-visible, .diary-row:focus-visible, .coll-row:focus-visible {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 14px 28px rgba(9, 50, 66, .22);
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .tile, .today, .result, .kid-card, .diary-row, .tile .art img.photo, .tile .art svg { transition: box-shadow .15s ease, border-color .15s ease; }
  .tile:hover, .today:hover, .result:hover, .kid-card:hover, .diary-row:hover,
  .tile:focus-visible, .today:focus-visible, .result:focus-visible, .kid-card:focus-visible { transform: none; }
  .tile:hover .art img.photo, .tile:hover .art svg, .kid-card:hover .art svg { transform: none; }
}

/* Hra „Kdo odplaval?“ */
.gone-mini { position: relative; }
.gone-mini span { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; background: #2D7FD8; color: #fff; border: 2px solid var(--ink); font-weight: 800; font-size: 17px; line-height: 22px; text-align: center; }
.gone-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: linear-gradient(#BFE9F5, #7CCBE3); border: 3px solid var(--ink); border-radius: var(--radius-l); box-shadow: 0 4px 0 var(--ink); padding: 10px; margin: 6px 0 10px; }
.gone-stage.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gone-cell { min-width: 0; display: grid; place-items: center; aspect-ratio: 10 / 7; border-radius: var(--radius-m); background: rgba(255, 255, 255, .35); }
.gone-cell svg { width: 100%; height: auto; }
.gone-cell.away { background: rgba(255, 255, 255, .15); border: 2px dashed rgba(18, 50, 74, .45); }
.gone-bubbles circle { fill: rgba(255, 255, 255, .75); stroke: #12324A; stroke-width: 2.4; }
.gone-cell.back { background: #C9F0D8; outline: 3px solid var(--ok); }
@media (prefers-reduced-motion: no-preference) {
  .gone-bubbles circle { animation: gone-rise 2.4s ease-in-out infinite; }
  .gone-bubbles circle:nth-child(2) { animation-delay: .3s; } .gone-bubbles circle:nth-child(3) { animation-delay: .6s; } .gone-bubbles circle:nth-child(4) { animation-delay: .9s; }
  .gone-cell.back svg { animation: gone-back .5s ease-out; }
}
@keyframes gone-rise { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes gone-back { from { transform: translateX(-40%) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Kdo je jiný? – 4 karty ve dvou řadách, náhled na dětské kartě */
.od-grid { grid-template-columns: repeat(2, 1fr); max-width: 360px; margin-left: auto; margin-right: auto; }
.odd-mini { display: flex; align-items: center; justify-content: center; gap: 2px; }
.odd-mini svg { width: 33%; height: auto; }
