:root {
  --bg: #f3efe6;
  --card: #fffdf8;
  --ink: #1e2b24;
  --muted: #66706a;
  --line: #ddd6c6;
  --accent: #2f6b45;
  --u: #3f8f5a;
  --r: #c9932f;
  --d: #b8452a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  transition: background .4s;
}
h1, h2, h3 { font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
button { font: inherit; color: inherit; }

/* ---------- Hra (telefon) ---------- */
.game { max-width: 520px; margin: 0 auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); }
.screen { display: none; }
.screen.active { display: block; }
.screen.enter { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero-art svg { width: 100%; display: block; margin: 8px 0 20px; }
.kicker { color: var(--muted); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px; }
#s-start h1 { font-size: 52px; font-weight: 600; margin-bottom: 12px; }
.lead { font-size: 18px; margin: 0 0 28px; }
form label { display: block; font-weight: 600; margin-bottom: 6px; }
input {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); margin-bottom: 14px;
}
input:focus { outline: none; border-color: var(--accent); }
.btn {
  display: block; width: 100%; padding: 15px 18px; border-radius: 12px; border: 2px solid var(--ink);
  background: transparent; font-weight: 600; font-size: 17px; cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--bg); }
.btn:disabled { opacity: .6; }

.quiz-head { display: flex; justify-content: space-between; align-items: baseline; }
.year { font-weight: 600; font-size: 28px; }
.count { color: var(--muted); font-weight: 600; }
.progress { height: 6px; background: var(--line); border-radius: 3px; margin: 8px 0 18px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .35s; }
.q-icon { color: var(--accent); display: flex; justify-content: center; margin-bottom: 10px; }
.q-icon svg { width: 110px; height: 88px; }
.q-icon .a { fill: var(--accent); }
.q-icon .b { fill: var(--accent); opacity: .55; }
.q-icon .c { fill: var(--accent); opacity: .25; }
.q-icon .t { fill: var(--card); }
.q-text { font-size: 22px; font-weight: 600; margin-bottom: 18px; }
.answers { display: grid; gap: 10px; }
.answer {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 14px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card);
  font-size: 16px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.answer:active { transform: scale(.985); }
.answer .letter {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); font-weight: 700; font-size: 14px;
}
.answer.picked { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.answer.picked .letter { background: var(--bg); color: var(--ink); }
@media (hover: hover) { .answer:not(:disabled):hover { border-color: var(--ink); } }

/* Konec */
body[data-ending="u"] { background: #e6f1e7; }
body[data-ending="r"] { background: #f1ebdc; }
body[data-ending="d"] { background: #f0dfd8; }
.end-art svg { width: 100%; display: block; border-radius: 16px; margin-bottom: 18px; }
.badge {
  display: inline-block; margin: 0 0 8px; padding: 3px 12px; border-radius: 99px; color: #fff;
  font-weight: 600; font-size: 14px; background: var(--r);
}
body[data-ending="u"] .badge { background: var(--u); }
body[data-ending="d"] .badge { background: var(--d); }
#s-end h1 { font-size: 34px; font-weight: 600; margin-bottom: 14px; }
.temp { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--card); margin-bottom: 16px; }
.temp strong { font-size: 30px; white-space: nowrap; }
.temp span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.end-text p { margin: 0 0 12px; }
.facts { padding: 0; margin: 18px 0 26px; list-style: none; display: grid; gap: 8px; }
.facts li { padding: 10px 12px 10px 36px; background: var(--card); border-radius: 10px; position: relative; font-size: 15px; }
.facts li::before { content: ""; position: absolute; left: 14px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; }
#s-end h3 { font-size: 20px; margin-bottom: 10px; }
.meter { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 8px; }
.meter div { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.meter b { text-align: right; }
.index { margin: 10px 0 16px; font-size: 16px; }
.index strong { font-size: 22px; }
.news { background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.news-year { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.news p { margin: 2px 0 0; font-size: 15px; }
.review { background: var(--card); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; }
.review summary { font-weight: 600; cursor: pointer; }
.review ol { padding-left: 20px; margin: 12px 0 0; }
.review li { margin-bottom: 12px; }
.review .rq { margin: 0; font-size: 14px; color: var(--muted); }
.review .ra { margin: 2px 0 0; font-size: 15px; }
.note { font-size: 12px; color: var(--muted); margin: 0 0 18px; }

/* ---------- Projektor (hostitel) ---------- */
.host { min-height: 100vh; padding: 32px 40px; display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 40px; }
.host h1 { font-size: clamp(44px, 6vw, 84px); font-weight: 600; }
.host .lead { font-size: 20px; margin: 10px 0 24px; }
.qr-card { background: #fff; padding: 20px; border-radius: 20px; display: inline-block; box-shadow: 0 2px 0 var(--line); }
.qr-card #qr img, .qr-card #qr canvas { display: block; width: 100%; height: auto; }
.url { font-size: 18px; font-weight: 600; margin: 14px 0 6px; word-break: break-all; }
.host-tools { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.host-tools .btn { width: auto; font-size: 14px; padding: 8px 14px; }
.stats { display: flex; gap: 28px; margin-bottom: 20px; }
.stats div { font-size: 15px; color: var(--muted); }
.stats strong { display: block; font-size: 44px; color: var(--ink); line-height: 1; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.col { background: var(--card); border-radius: 18px; padding: 16px; border-top: 8px solid var(--r); min-height: 160px; }
.col.u { border-color: var(--u); }
.col.d { border-color: var(--d); }
.col h2 { font-size: 22px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: baseline; }
.col h2 span { font-size: 36px; }
.col ul, .playing ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.col li, .playing li { background: var(--bg); padding: 4px 10px; border-radius: 99px; font-size: 15px; animation: rise .4s ease-out; }
.playing { margin-top: 22px; }
.playing h3 { font-size: 18px; }
.playing li { background: transparent; border: 1.5px dashed var(--line); }
.empty { color: var(--muted); font-size: 15px; }
/* Žebříček */
.board { min-height: 100vh; padding: 32px 40px; }
.board header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.board h1 { font-size: clamp(32px, 4vw, 56px); font-weight: 600; }
.board-sub { color: var(--muted); margin: 8px 0 0; }
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rank.two { grid-template-columns: 1fr 1fr; grid-auto-flow: column; column-gap: 24px; gap: 6px 24px; }
.rank.two li { padding: 6px 14px; font-size: 17px; }
.rank.two .top { font-size: 19px; padding: 8px 14px; }
.rank li {
  display: grid; grid-template-columns: 44px 1fr auto 64px 56px; gap: 12px; align-items: center;
  background: var(--card); border-radius: 12px; padding: 10px 16px; font-size: 18px; animation: rise .4s ease-out;
}
.rank .pos { font-weight: 600; font-size: 22px; }
.rank .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .pct { font-weight: 700; text-align: right; }
.rank .time { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rank .tag { font-size: 13px; font-weight: 600; color: #fff; padding: 2px 10px; border-radius: 99px; background: var(--r); white-space: nowrap; }
.tag.u { background: var(--u); } .tag.d { background: var(--d); }
.rank .top { font-size: 22px; padding: 14px 16px; }
.rank .top1 { background: #f6e3a6; }
.rank .top2 { background: #e6e6e6; }
.rank .top3 { background: #efd2b8; }
.board-foot { color: var(--muted); margin-top: 16px; font-size: 16px; }
@media (max-width: 860px) {
  .board { padding: 20px 16px; }
  .board header { flex-direction: column; }
  .rank.two { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none !important; }
  .rank li { grid-template-columns: 32px 1fr 56px 48px; font-size: 16px; }
  .rank .tag { display: none; }
  .host { grid-template-columns: 1fr; padding: 20px 16px; gap: 24px; }
}
