/* Seřaď to! — styly. Mobil první, tokeny nahoře, tmavý režim přes proměnné. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../assets/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../assets/fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2-variations');
  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;
}

:root {
  --paper: #f3f1e6;
  --surface: #fffdf6;
  --ink: #173b32;
  --ink-2: #4c5c53;
  --line: #d9ddca;
  --lime: #cfe97f;
  --lime-ink: #173b32;
  --moss: #426830;
  --ok: #2f7a3a;
  --ok-bg: #e2efcf;
  --near: #8a6408;
  --near-bg: #f9ecc4;
  --far: #b04722;
  --far-bg: #f8e0d4;
  --sq-ok: #5f9a3b;
  --sq-near: #e3b23c;
  --sq-far: #e07a4f;
  --shadow: 0 1px 0 rgb(23 59 50 / .06), 0 6px 18px -10px rgb(23 59 50 / .25);
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f241f;
    --surface: #17322b;
    --ink: #eef2e2;
    --ink-2: #a7b8aa;
    --line: #2b4a40;
    --moss: #9cc77a;
    --ok: #9fd68a;
    --ok-bg: #1d4128;
    --near: #f0cd6a;
    --near-bg: #43391a;
    --far: #f4a07c;
    --far-bg: #4a2a1e;
    --shadow: 0 1px 0 rgb(0 0 0 / .2), 0 8px 20px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 8px var(--gutter) 48px; outline: none; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); font-size: 14px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: var(--lime-ink); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* ---- Tlačítka ---------------------------------------------------------- */
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 12px;
  font-weight: 700; text-decoration: none; text-align: center; border: 0;
}
.primary { background: var(--lime); color: var(--lime-ink); box-shadow: inset 0 -3px 0 rgb(23 59 50 / .18); }
.primary:hover { filter: brightness(.96); }
.primary:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgb(23 59 50 / .18); }
.primary.big { font-size: 18px; min-height: 56px; width: 100%; }
.secondary { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.secondary:hover { border-color: var(--ink-2); }
.wide { width: 100%; }
.link { background: none; border: 0; padding: 8px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.quiet { text-decoration: none; background: none; border: 0; padding: 10px 10px; font-weight: 650; font-size: 14px; border-radius: 10px; }
.quiet:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 18px; font-weight: 700; text-decoration: none;
}

/* ---- Hlavička a patička ------------------------------------------------ */
.site-head {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 1040px; margin: 0 auto; padding: 14px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; padding: 4px 6px; background: var(--ink); border-radius: 8px; }
.brand-mark i { display: block; width: 6px; border-radius: 2px; background: var(--lime); }
.brand-mark i:nth-child(1) { height: 6px; }
.brand-mark i:nth-child(2) { height: 11px; }
.brand-mark i:nth-child(3) { height: 17px; }
@media (prefers-color-scheme: dark) { .brand-mark { background: var(--lime); } .brand-mark i { background: #173b32; } }
.brand-word { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.04em; }
.site-head nav { display: flex; gap: 0; }
.site-head nav .quiet { white-space: nowrap; padding: 10px 8px; font-size: 14px; }
@media (max-width: 380px) { .site-head nav .quiet { font-size: 13px; padding: 10px 6px; } .brand-word { font-size: 21px; } }
.site-foot {
  width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  font-size: 13px; color: var(--ink-2);
}
body.playing .site-head, body.playing .site-foot { display: none; }

/* ---- Karty ------------------------------------------------------------- */
.card {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 12px 8px 8px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); list-style: none;
}
.vis { display: grid; place-items: center; width: 44px; height: 40px; font-size: 28px; line-height: 1; }
.vis-flag img { width: 36px; height: 27px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); }
.vis.big { width: 64px; height: 56px; font-size: 44px; }
.vis-flag.big img { width: 56px; height: 42px; }
.card .name { font-weight: 650; line-height: 1.25; font-size: 15px; }
.card .val { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }

/* ---- Úvod -------------------------------------------------------------- */
.today { padding: 20px 0 8px; display: grid; gap: 14px; }
.today-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.today-meta span:first-child::first-letter { text-transform: uppercase; }
.today h1 { font-size: clamp(40px, 11vw, 76px); font-weight: 780; letter-spacing: -0.045em; text-wrap: balance; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 46ch; }
.teaser { margin: 6px 0 0; padding: 0 0 0 26px; display: grid; gap: 8px; position: relative; max-width: 460px; }
.teaser .card { grid-template-columns: 44px 1fr; }
.teaser .teaser-slot { border: 2px dashed var(--moss); background: color-mix(in srgb, var(--lime) 45%, var(--surface)); box-shadow: none; }
.teaser .teaser-slot .vis { font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--moss); }
.teaser-axis { font-size: 13px; color: var(--ink-2); padding-left: 26px; }
.today .primary.big { max-width: 460px; margin-top: 4px; }
@media (min-width: 900px) {
  .today { grid-template-columns: 1.1fr 1fr; column-gap: 48px; align-items: end; padding-top: 36px; }
  .today > :not(.teaser, .teaser-axis, .primary, .today-result) { grid-column: 1; }
  .today .teaser, .today .teaser-axis, .today .primary.big, .today-result { grid-column: 2; }
  .today .teaser { grid-row: 1 / span 3; align-self: end; }
  .today-result { grid-row: 1 / span 3; align-self: end; }
}
.today-result { display: grid; gap: 12px; justify-items: start; padding: 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); max-width: 460px; }
.today-score { font-size: 18px; }
.today-score b { font-family: var(--display); font-size: 44px; line-height: 1; }

/* Svislá stupnice vlevo od řady: odspodu sílí, šipka ukazuje směr. */
.teaser::before, .row::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 14px; width: 4px; border-radius: 4px;
  background: linear-gradient(var(--lime), var(--moss));
}
.teaser::after, .row::after {
  content: ''; position: absolute; left: 3px; bottom: 4px;
  border: 6px solid transparent; border-top: 9px solid var(--moss); border-bottom: 0;
}

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 36px 0 12px; }
.section-head h2 { font-size: 24px; }
.section-head p { color: var(--ink-2); font-size: 14px; }

.week-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-strip li { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
.week-strip .wd { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.week-strip .ic { font-size: 22px; }
.week-strip .wr { font-size: 12px; font-weight: 700; min-height: 18px; font-variant-numeric: tabular-nums; }
.week-strip .today { border-color: var(--moss); background: color-mix(in srgb, var(--lime) 40%, var(--surface)); }
.week-strip .future { opacity: .55; background: transparent; }
.week-strip .missed .wr { color: var(--ink-2); }

.resume { display: block; margin-bottom: 10px; padding: 14px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; }
.themes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
.themes a {
  display: grid; grid-template-columns: 44px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); text-decoration: none;
}
.themes a:hover { border-color: var(--moss); }
.t-icon { grid-row: 1 / 3; font-size: 30px; text-align: center; }
.t-name { font-family: var(--display); font-weight: 700; font-size: 17px; }
.t-desc { grid-column: 2; font-size: 14px; color: var(--ink-2); }
.t-best { grid-column: 3; grid-row: 1 / 3; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
@media (min-width: 640px) { .themes { grid-template-columns: 1fr 1fr; } }

/* ---- Hra --------------------------------------------------------------- */
.play-bar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px;
  margin: 0 calc(-1 * var(--gutter)); padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px);
}
.play-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.play-title strong { font-family: var(--display); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-title span { font-size: 13px; color: var(--ink-2); }
.play-score { display: grid; justify-items: end; font-size: 13px; font-weight: 700; line-height: 1.3; }
.hearts { letter-spacing: 2px; font-size: 14px; }
.hearts .on { color: var(--far); }
.hearts .off { color: var(--line); }
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.progress span { display: block; height: 100%; background: var(--moss); transition: width .4s; }

.row {
  list-style: none; margin: 0; padding: 0 0 0 26px; position: relative;
  display: grid; gap: 8px; padding-bottom: 18px;
}
.board { padding-bottom: calc(var(--dock-h) + 16px); }
.row .axis { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 4px; }
.row .card { cursor: pointer; user-select: none; -webkit-user-select: none; }
.ghost {
  border: 2px dashed var(--moss); background: color-mix(in srgb, var(--lime) 55%, var(--surface));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 35%, transparent);
  touch-action: none; cursor: grab; scroll-margin: 80px 0 calc(var(--dock-h) + 24px);
}
.ghost .val { font-family: var(--body); font-size: 14px; color: var(--moss); }
.ghost.dragging { cursor: grabbing; transform: scale(1.02); }
.placed { scroll-margin: 80px 0 calc(var(--dock-h) + 24px); animation: pop .5s ease-out .35s both; }
.placed.ok { border-color: var(--ok); background: var(--ok-bg); }
.placed.near { border-color: var(--near); background: var(--near-bg); }
.placed.far { border-color: var(--far); background: var(--far-bg); }
.placed .val { animation: reveal .45s ease-out .35s both; }
@keyframes pop { 40% { transform: scale(1.035); } }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1.5px solid var(--line);
  box-shadow: 0 -10px 30px -18px rgb(23 59 50 / .5);
  border-radius: 20px 20px 0 0; display: grid; gap: 12px;
}
.dock-card { display: flex; align-items: center; gap: 12px; }
.dock-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.dock-card h2 { font-size: 22px; text-wrap: balance; }
.coach { font-size: 14px; color: var(--ink-2); background: var(--paper); border-radius: 10px; padding: 8px 12px; }
.dock-controls { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.step { min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-size: 22px; font-weight: 700; }
.dock-controls .primary { font-size: 17px; }
.verdict { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; border-left: 5px solid; }
.verdict.ok { background: var(--ok-bg); border-color: var(--ok); }
.verdict.near { background: var(--near-bg); border-color: var(--near); }
.verdict.far { background: var(--far-bg); border-color: var(--far); }
.verdict-title { font-family: var(--display); font-weight: 750; font-size: 20px; }
.verdict-value b { font-family: var(--display); font-size: 18px; }
.verdict-fact { font-size: 15px; color: var(--ink-2); }

@media (min-width: 900px) {
  .board { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
  .board { padding-bottom: 0; }
  .dock {
    position: sticky; top: 88px; left: auto; right: auto; bottom: auto; order: 2;
    border: 1.5px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  }
  .ghost, .placed { scroll-margin: 100px 0 40px; }
}

/* ---- Výsledek ---------------------------------------------------------- */
.result { max-width: 560px; margin: 0 auto; padding: 24px 0; display: grid; gap: 16px; justify-items: center; text-align: center; }
.result-kicker { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.result h1 { font-size: clamp(36px, 9vw, 56px); font-weight: 780; letter-spacing: -0.04em; }
.result-score { font-size: 17px; }
.result-score b { font-family: var(--display); font-size: 64px; line-height: 1; display: block; letter-spacing: -0.04em; }
.squares { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 340px; }
.squares.small { justify-content: start; }
.sq { display: inline-block; width: 26px; height: 26px; border-radius: 6px; vertical-align: middle; }
.squares.small .sq { width: 18px; height: 18px; border-radius: 4px; }
.sq.ok { background: var(--sq-ok); }
.sq.near { background: var(--sq-near); }
.sq.far { background: var(--sq-far); }
.sq.unknown { background: var(--line); }
.legend { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: center; }
.legend .sq { width: 12px; height: 12px; border-radius: 3px; }
.result-actions { display: grid; gap: 10px; width: 100%; }
.next-up { display: flex; align-items: baseline; gap: 10px; color: var(--ink-2); font-size: 15px; }
.countdown { font-family: var(--display); font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-block { width: 100%; text-align: left; padding: 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 14px; }
.stat-block h2 { font-size: 20px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.stat-row div { display: grid; }
.stat-row dt { font-size: 12px; color: var(--ink-2); order: 2; }
.stat-row dd { margin: 0; font-family: var(--display); font-weight: 750; font-size: 28px; }
.histogram { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.histogram li { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.h-bar span { display: block; min-width: 26px; padding: 2px 8px; border-radius: 6px; background: var(--line); font-weight: 700; text-align: right; }
.histogram .mine .h-bar span { background: var(--moss); color: var(--paper); }
.back { margin-top: 4px; }

.review { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.review li { display: grid; grid-template-columns: 36px 1fr auto 24px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--paper); font-size: 14px; }
.review .vis { width: 36px; font-size: 22px; }
.review .vis-flag img { width: 28px; height: 21px; }
.review .val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.review .anchor { opacity: .75; }

/* ---- Dialog, toast, chyby --------------------------------------------- */
dialog {
  border: 0; border-radius: 22px; padding: 24px 22px; width: min(520px, calc(100% - 24px)); max-height: 85dvh;
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 60px -20px rgb(0 0 0 / .45);
}
dialog::backdrop { background: rgb(10 30 25 / .55); backdrop-filter: blur(3px); }
dialog h2 { font-size: 24px; margin: 0 40px 12px 0; }
dialog p, dialog li { font-size: 15px; margin: 8px 0; }
.howto { padding-left: 20px; }
.close { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper); font-size: 24px; line-height: 1; }
.copy-box { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); }
#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 12px; align-items: center; max-width: calc(100% - 24px);
  padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: 0 12px 30px -10px rgb(0 0 0 / .5);
}
#toast[hidden] { display: none; }
.toast-action { border: 0; border-radius: 10px; background: var(--lime); color: var(--lime-ink); font-weight: 700; padding: 8px 12px; }
body.playing #toast { bottom: calc(var(--dock-h, 200px) + 16px); }
.loading, .error { padding: 60px 0; display: grid; gap: 16px; justify-items: start; color: var(--ink-2); }
.error h1 { color: var(--ink); font-size: 32px; }
.noscript { padding: 20px; }

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

/* ---- Správné pořadí na konci hry ------------------------------------- */
.percentile { font-size: 16px; font-weight: 650; padding: 8px 14px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.timeline { width: 100%; text-align: left; display: grid; gap: 10px; margin-top: 8px; scroll-margin-top: 16px; }
.timeline h2 { font-size: 26px; }
.timeline-lead { color: var(--ink-2); font-size: 15px; }
.tl { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; display: grid; gap: 10px; }
.tl::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: linear-gradient(var(--lime), var(--moss)); }
.tl-item { position: relative; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 6px; }
.tl-item::before { content: ''; position: absolute; left: -24px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.tl-item.ok::before { border-color: var(--sq-ok); background: var(--sq-ok); }
.tl-item.near::before { border-color: var(--sq-near); background: var(--sq-near); }
.tl-item.far::before { border-color: var(--sq-far); background: var(--sq-far); }
.tl-item.anchor::before { border-color: var(--ink-2); }
.tl-head { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.tl-name { font-size: 15px; line-height: 1.25; }
.tl-val { font-family: var(--display); font-weight: 750; font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-fact { font-size: 15px; color: var(--ink-2); }
.tl-you { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.tl-badge { font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper); }
.tl-item.ok .tl-badge { background: var(--ok-bg); color: var(--ok); }
.tl-item.near .tl-badge { background: var(--near-bg); color: var(--near); }
.tl-item.far .tl-badge { background: var(--far-bg); color: var(--far); }
.tl-global { color: var(--ink-2); }

/* ---- Profil a účet ---------------------------------------------------- */
.profile { max-width: 720px; margin: 0 auto; padding: 16px 0; display: grid; gap: 18px; }
.profile > h1 { font-size: clamp(36px, 9vw, 56px); font-weight: 780; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.account { padding: 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 12px; }
.account h2 { font-size: 22px; }
.account.signed { background: var(--ok-bg); border-color: transparent; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.email-form { display: grid; gap: 6px; }
.email-form label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.email-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.email-row input { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; min-width: 0; }
.email-row input:focus-visible { outline: 3px solid var(--moss); outline-offset: 1px; }
.sent { padding: 10px 14px; border-radius: 12px; background: var(--ok-bg); }
.privacy { font-size: 13px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.tiles div { display: grid; padding: 12px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); }
.tiles dt { order: 2; font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.tiles dd { margin: 0; font-family: var(--display); font-weight: 750; font-size: 30px; line-height: 1.1; }
.panel { padding: 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 12px; }
.panel h2 { font-size: 20px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-template-columns: 22px; grid-auto-columns: minmax(0, 1fr); gap: 4px; max-width: 460px; }
.cal-wd { font-size: 11px; color: var(--ink-2); line-height: 1; align-self: center; }
.cal-day { display: inline-block; aspect-ratio: 1; min-width: 12px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); }
.cal-day.future { background: transparent; border-style: dashed; opacity: .5; }
.cal-day.today { outline: 2px solid var(--ink); outline-offset: 0; }
.cal-day.c0 { background: var(--sq-ok); border-color: transparent; }
.cal-day.c1 { background: color-mix(in srgb, var(--sq-ok) 55%, var(--surface)); border-color: transparent; }
.cal-day.c2 { background: var(--sq-near); border-color: transparent; }
.cal-day.c3 { background: var(--sq-far); border-color: transparent; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--ink-2); }
.cal-legend .cal-day { width: 12px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'label num' 'bar bar'; gap: 4px 8px; font-size: 14px; }
.bar-label { grid-area: label; font-weight: 600; }
.bar-num { grid-area: num; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-num b { color: var(--ink); }
.bar { grid-area: bar; height: 10px; border-radius: 6px; background: var(--paper); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 6px; background: var(--moss); }
.misses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.misses li { display: grid; gap: 4px; padding: 12px; border-radius: 14px; background: var(--paper); }
.nudge { display: block; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 15px; }
.nudge b { color: var(--lime); }
.consent { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); box-shadow: 0 10px 30px -10px rgb(0 0 0 / .35); font-size: 14px; }
.consent p { margin: 0; line-height: 1.45; }
.consent div { display: flex; gap: 8px; justify-content: flex-end; }
.consent button { padding: 9px 16px; min-height: 0; font-size: 15px; }
body.playing .consent { display: none; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.stats-head { font-size: 15px; font-family: var(--body); font-weight: 700; letter-spacing: 0; color: var(--ink-2); text-transform: uppercase; margin: 18px 0 8px; }
.tiles.small dd { font-size: 24px; }

@media (min-width: 640px) { dl.tiles { grid-template-columns: repeat(6, 1fr); } dl.tiles.small { grid-template-columns: repeat(5, 1fr); } }

/* ---- Kdo to byl? (bonus dne, vizuálně podřízený hlavní výzvě) ------------ */
.second { margin-top: 28px; }
.second-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.second-head h2 { font-size: 15px; font-family: var(--body); font-weight: 700; letter-spacing: 0; color: var(--ink-2); text-transform: uppercase; }
.second-head p { margin: 0; font-size: 14px; color: var(--ink-2); }
.kdo-card {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 16px; text-decoration: none;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--line);
}
.kdo-card:hover { border-color: var(--ink-2); }
.kdo-card-emoji { font-size: 34px; text-align: center; }
.kdo-card-body { display: grid; gap: 2px; min-width: 0; }
.kdo-card-kicker { font-size: 13px; color: var(--moss); font-weight: 600; }
.kdo-card-body strong { font-family: var(--display); font-size: 20px; line-height: 1.15; }
.kdo-card-status { font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kdo-card-status .squares { gap: 3px; }
.kdo-card-status .sq { width: 12px; height: 12px; border-radius: 3px; }
.kdo-card-go { padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; font-size: 15px; white-space: nowrap; }
.kdo-card.is-next { border-color: var(--moss); box-shadow: var(--shadow); }
.kdo-card.is-next .kdo-card-go { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }

.kdo { max-width: 720px; margin: 0 auto; display: grid; gap: 14px; padding-bottom: 32px; }
.person { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); }
.person-emoji { font-size: 48px; text-align: center; }
.person h1 { font-size: clamp(26px, 7vw, 38px); font-weight: 780; letter-spacing: -0.03em; }
.person p { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.kdo-task { font-size: 16px; }
ul.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { ul.tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); font-weight: 650; font-size: 15px; line-height: 1.25; text-align: center;
  transition: transform .12s, background .2s;
}
.tile:not(:disabled):hover { border-color: var(--moss); }
.tile:not(:disabled):active { transform: scale(.97); }
.tile:disabled { opacity: 1; cursor: default; }
.tile.hit { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); animation: pop .4s ease-out; }
.tile.miss { background: var(--far-bg); border-color: var(--far); color: var(--far); animation: shake .35s; }
.tile.missed { border: 2px dashed var(--ok); color: var(--ok); }
.tile.rest { opacity: .55; box-shadow: none; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.kdo-note { padding: 12px 14px; border-radius: 12px; font-size: 15px; border-left: 5px solid; }
.kdo-note.ok { background: var(--ok-bg); border-color: var(--ok); }
.kdo-note.bad { background: var(--far-bg); border-color: var(--far); }
.kdo-result { display: grid; gap: 12px; text-align: center; justify-items: center; padding: 8px 0; }
.kdo-result h2 { font-size: clamp(30px, 8vw, 44px); font-weight: 780; letter-spacing: -0.03em; }
.squares-line { font-size: 22px; letter-spacing: 2px; }
.kdo-explain { display: grid; gap: 10px; margin-top: 8px; }
.kdo-explain h2 { font-size: 22px; margin-top: 8px; }
.explain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.explain-list li { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border-left: 5px solid var(--line); }
.explain-list li span { color: var(--ink-2); font-size: 15px; }
.explain-list li em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--near); }
.explain-list .hit { border-color: var(--sq-ok); }
.explain-list .missed { border-color: var(--sq-near); }
.explain-list .miss { border-color: var(--sq-far); }

/* ---- Pro učitele -------------------------------------------------------- */
.teach-cta { margin-top: 28px; }
.teach-cta a { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; border: 1.5px dashed var(--moss); text-decoration: none; background: color-mix(in srgb, var(--lime) 18%, var(--surface)); }
.teach-cta strong { display: block; font-family: var(--display); font-size: 19px; }
.teach-cta a > span:nth-child(2) > span { display: block; color: var(--ink-2); font-size: 15px; }
.teach-icon { font-size: 34px; text-align: center; }
.teach-go { font-size: 22px; font-weight: 700; color: var(--moss); }

.teacher { max-width: 860px; margin: 0 auto; display: grid; gap: 18px; padding: 8px 0 32px; }
.t-hero { display: grid; gap: 8px; }
.t-kicker { color: var(--moss); font-weight: 700; font-size: 14px; }
.t-hero h1 { font-size: clamp(34px, 8vw, 56px); font-weight: 780; letter-spacing: -0.04em; text-wrap: balance; }
.t-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.t-tabs button { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.t-tabs button b { font-family: var(--display); font-size: 17px; }
.t-tabs button span { font-size: 13px; color: var(--ink-2); }
.t-tabs button[aria-selected='true'] { border-color: var(--moss); background: color-mix(in srgb, var(--lime) 35%, var(--surface)); box-shadow: inset 0 0 0 1px var(--moss); }
.t-form { display: grid; gap: 14px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); }
.t-field { display: grid; gap: 4px; }
.t-field > span, .t-units legend { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.t-form input:not([type='radio']), .t-share input, .copy-box {
  min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font: inherit; min-width: 0; width: 100%;
}
.t-form input:focus-visible, .t-share input:focus-visible { outline: 3px solid var(--moss); outline-offset: 1px; }
.t-units { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.t-units label { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.t-grid3 { display: grid; gap: 10px; grid-template-columns: 1fr 1fr 1fr; }
.person-fields { grid-template-columns: 1.4fr 1.6fr 80px; }
.t-sub { font-size: 19px; margin-top: 6px; }
.t-rows { display: grid; gap: 6px; }
.t-row { display: grid; grid-template-columns: 1.6fr 90px 2fr 36px; gap: 6px; align-items: center; }
.t-rows.two .t-row { grid-template-columns: 1.2fr 2fr 36px; }
.t-head { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.t-del { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); font-size: 20px; }
.t-del:hover { background: var(--far-bg); color: var(--far); }
.t-row-actions, .t-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.t-check:empty { display: none; }
.t-check p { padding: 8px 12px; border-radius: 10px; font-size: 14px; margin: 4px 0; }
.t-check .bad, .t-share .warn { background: var(--far-bg); color: var(--far); }
.t-check .warn { background: var(--near-bg); color: var(--near); }
.t-share { padding: 18px; border-radius: 18px; background: var(--surface); border: 2px solid var(--moss); display: grid; gap: 10px; }
.t-share h2 { font-size: 24px; }
.t-share .warn { padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.t-share-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.t-qr { background: #fff; border-radius: 14px; padding: 6px; cursor: zoom-in; line-height: 0; border: 1.5px solid var(--line); }
.t-qr svg { width: 100%; height: auto; display: block; }
.t-share-body { display: grid; gap: 12px; }
.t-qrivo { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; text-decoration: none; background: var(--paper); border: 1.5px solid var(--line); }
.t-qrivo b { color: var(--moss); }
.t-qrivo span { font-size: 14px; color: var(--ink-2); }
.t-qrivo:hover { border-color: var(--moss); }
.t-mine, .t-tips { padding: 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 8px; }
.t-mine h2, .t-tips h2 { font-size: 20px; }
.t-mine ul, .t-tips ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.t-mine li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.t-mine li small { display: block; color: var(--ink-2); font-size: 13px; }
.t-tips li { font-size: 15px; padding-left: 14px; position: relative; }
.t-tips li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--moss); }
dialog.wide { width: min(760px, calc(100% - 24px)); }
.t-projector { display: grid; gap: 10px; justify-items: center; text-align: center; }
.t-qr.big { width: min(520px, 80vw, 62dvh); cursor: default; }
.t-projector-url { font-family: var(--display); font-weight: 700; font-size: clamp(16px, 3vw, 24px); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .t-grid3, .person-fields { grid-template-columns: 1fr; }
  .t-share-grid { grid-template-columns: 1fr; justify-items: stretch; }
  .t-qr { max-width: 260px; justify-self: center; }
  .t-head { display: none; }
  .t-row { grid-template-columns: 1fr 84px 36px; padding: 8px 0; border-top: 1px solid var(--line); }
  .t-row > input[data-col='2'] { grid-column: 1 / 3; grid-row: 2; }
  .t-rows.two .t-row { grid-template-columns: 1fr 36px; }
  .t-rows.two .t-row > input[data-col='1'] { grid-column: 1; grid-row: 2; }
}

/* ---- Souboje 1 na 1 ------------------------------------------------------ */
.duel { max-width: 640px; margin: 0 auto; display: grid; gap: 14px; padding-bottom: 40px; }
.duel .kicker { margin: 0; font-weight: 700; font-size: 14px; color: var(--moss); }
.duel h1 { font-size: clamp(32px, 7vw, 48px); }
.duel-how { margin: 0; padding-left: 22px; display: grid; gap: 4px; color: var(--ink-2); line-height: 1.45; }
.duel-target { margin: 0; font-size: 18px; }
.duel-sub { font-size: 18px; margin-top: 6px; }
.duel-themes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .duel-themes { grid-template-columns: repeat(3, 1fr); } }
.duel-themes button { width: 100%; height: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; text-align: left; padding: 12px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.duel-themes button:hover { border-color: var(--ink-2); }
.duel-themes button span { font-size: 24px; text-align: center; }
.duel-join { display: grid; gap: 10px; }
.duel-join label { font-weight: 700; }
.duel-join input { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.duel-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.duel-board li { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); }
.duel-board li.me { border-color: var(--moss); box-shadow: var(--shadow); }
.duel-board li:first-child .duel-place { color: var(--moss); }
.duel-place { font-family: var(--display); font-weight: 800; font-size: 20px; }
.duel-name { font-weight: 700; overflow-wrap: anywhere; }
.duel-score { white-space: nowrap; color: var(--ink-2); }
.duel-score b { color: var(--ink); font-family: var(--display); font-size: 20px; }
.duel-board .squares { grid-column: 2 / -1; gap: 3px; }
.duel-board .sq { width: 16px; height: 16px; border-radius: 4px; }
.duel-actions { display: grid; gap: 8px; }
@media (min-width: 560px) { .duel-actions { grid-template-columns: 1fr 1fr; } }
.duel-qr { justify-self: center; text-align: center; }
.duel-qr svg { width: 220px; height: 220px; background: #fff; border-radius: 12px; }
.duel-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.duel-list a { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; }
.duel-list a span:first-child { font-size: 22px; text-align: center; }
.duel-list a span:last-child { display: grid; }
.duel-list a span span { font-size: 13px; color: var(--ink-2); }

/* ---- Pozvánka k účtu ----------------------------------------------------- */
.pitch { margin-top: 24px; padding: 18px; border-radius: 18px; background: var(--ok-bg); display: grid; gap: 10px; }
.pitch h2 { font-size: 22px; margin: 0; }
.pitch p { margin: 0; line-height: 1.45; }
.pitch-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; line-height: 1.45; }
.pitch-note { font-size: 13px; color: var(--ink-2); }
.pitch.compact { margin-top: 16px; }
.duel-news { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.duel-news a { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--ok-bg); color: var(--ink); text-decoration: none; border: 1.5px solid var(--moss); }
.duel-news a.lose { background: var(--far-bg); border-color: var(--far); }
.duel-news a > span:first-child { font-size: 22px; }
.duel-news a > span:nth-child(2) { display: grid; gap: 2px; }
.duel-news a > span:nth-child(2) span { font-size: 14px; color: var(--ink-2); }
.duel-news-go { font-weight: 700; font-size: 14px; }
.duel-list a { grid-template-columns: 30px 1fr auto; }
.duel-list a.fresh { border-color: var(--moss); }
.duel-new { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); }
.second-head p a { color: inherit; }
