:root {
  --bg: #1b1033;
  --bg-2: #2a1650;
  --surface: rgba(255, 255, 255, 0.07);
  --surface-2: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.14);
  --text: #fbf7ff;
  --muted: #b9a9d6;
  --accent: #ff4f8b;
  --accent-2: #ffb340;
  --yes: #ff6b8f;
  --no: #6fd6ff;
  --ok: #5ee6a0;
  --danger: #ff7a7a;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(8, 2, 24, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, #5b1d7a 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #7a1d4f 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- horní lišta --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; color: inherit; font: inherit; font-weight: 800; padding: 6px 0; cursor: pointer;
}
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-size: 18px;
}
.lang select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23b9a9d6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 30px 8px 14px; font: inherit; font-size: 14px; cursor: pointer;
}
.lang select option { color: #111; }

/* --- obrazovky --- */
.screen { flex: 1; display: flex; flex-direction: column; gap: 16px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero { text-align: center; padding: 8px 0 0; }
.hero h1 {
  margin: 0; font-size: clamp(34px, 10vw, 48px); line-height: 1.05; letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, #ffd1e2 40%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero.small h1 { font-size: 28px; color: var(--text); background: none; }
.hero p { margin: 6px 0 0; color: var(--muted); }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px;
}
.panel h2, .answer h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.muted { color: var(--muted); }

/* --- tlačítka --- */
.btn {
  border: 0; border-radius: 14px; padding: 15px 18px; font: inherit; font-weight: 700; cursor: pointer;
  color: var(--text); min-height: 52px; transition: transform .08s ease, opacity .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #ff7a59); box-shadow: 0 8px 24px rgba(255, 79, 139, .35); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.wide { width: 100%; }
.grow { flex: 1; }
.link { background: none; border: 0; color: var(--accent-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0; }

.sticky-actions {
  position: sticky; bottom: 0; margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 0 calc(4px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
}
.sticky-actions.row { flex-direction: row; }

/* --- počet hráčů --- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 24px; }
.stepper output { font-size: 44px; font-weight: 800; min-width: 64px; text-align: center; }
.step {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 26px; cursor: pointer;
}
.step:disabled { opacity: .35; }

/* --- režim --- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode-body {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 14px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.mode-icon { font-size: 22px; }
.mode small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.mode input:checked + .mode-body { border-color: var(--accent); background: rgba(255, 79, 139, .14); }
.mode input:focus-visible + .mode-body { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* --- kategorie --- */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; min-height: 60px;
  transition: border-color .15s, background .15s;
}
.cat-emoji { font-size: 24px; line-height: 1; }
.cat-name { font-weight: 650; font-size: 14px; line-height: 1.2; }
.cat-count { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.cat[aria-pressed="true"] { border-color: var(--accent-2); background: rgba(255, 179, 64, .14); }
.cat[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 6px; right: 8px; font-size: 12px; font-weight: 800; color: var(--accent-2);
}
.cat.adult .cat-count::after { content: " · 18+"; color: var(--danger); font-weight: 700; }

/* --- hra --- */
.game-head { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.kicker { font-size: 13px; color: var(--muted); }
.kicker b { color: var(--text); }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; }
.score-pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; font-size: 14px; }

.card {
  min-height: 34vh; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: 24px 20px; border-radius: 24px;
  background: linear-gradient(160deg, #fff 0%, #ffe9f1 100%); color: #2a1240;
  box-shadow: var(--shadow);
}
.card.enter { animation: cardIn .3s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateX(24px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
.card-cat { font-size: 13px; font-weight: 700; color: #8a4a9c; text-transform: uppercase; letter-spacing: .05em; }
.card-text { margin: 0; font-size: clamp(22px, 6.4vw, 30px); font-weight: 800; line-height: 1.22; }

.counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.count {
  min-height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer;
}
.count[aria-pressed="true"] { background: var(--yes); border-color: var(--yes); color: #fff; }
.tally { display: flex; justify-content: center; gap: 22px; margin-top: 12px; font-size: 15px; }
.tally-yes b { color: var(--yes); }
.tally-no b { color: var(--no); }

/* --- výsledky --- */
.big-score { display: flex; flex-direction: column; align-items: center; line-height: 1; margin: 8px 0 6px; }
.big-score span {
  font-size: 96px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.big-score small { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.stats b { font-size: 22px; }
.stats span { font-size: 11px; color: var(--muted); line-height: 1.2; }
.quote { margin: 0; font-size: 17px; font-weight: 650; }
.save-form { display: flex; gap: 8px; }
.save-form input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; font-size: 16px;
}
.save-form input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.error { margin: 8px 0 0; color: var(--danger); font-size: 14px; text-align: center; }
.success { margin: 8px 0 0; color: var(--ok); font-weight: 650; text-align: center; }

/* --- žebříček --- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.month-nav strong { font-size: 18px; text-transform: capitalize; }
.board { display: flex; flex-direction: column; gap: 8px; }
.entry {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.entry.mine { border-color: var(--accent-2); background: rgba(255, 179, 64, .12); }
.entry-rank { font-weight: 800; font-size: 18px; text-align: center; }
.entry-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-meta { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.entry-score { font-size: 22px; font-weight: 900; color: var(--accent-2); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

@media (min-width: 720px) {
  .app { padding-top: 24px; }
  .cats { grid-template-columns: 1fr 1fr 1fr; }
  .card { min-height: 280px; }
}
@media (max-width: 360px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
#resultsBoardBtn { margin-top: 12px; }

/* --- obsah pro vyhledávače pod nastavením hry --- */
.hero-local { color: var(--accent-2); font-weight: 700; }
.seo {
  margin-top: 24px; padding: 24px 4px 8px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 15px; line-height: 1.6;
}
.seo h2 { color: var(--text); font-size: 20px; line-height: 1.3; margin: 28px 0 10px; }
.seo h2:first-child { margin-top: 0; }
.seo h3 { color: var(--text); font-size: 16px; margin: 18px 0 6px; }
.seo p { margin: 0 0 12px; }
.seo ol, .seo ul { margin: 0 0 12px; padding-left: 22px; }
.seo li { margin: 4px 0; }
.seo details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin: 8px 0;
}
.seo summary { color: var(--text); font-weight: 650; cursor: pointer; }
.seo details p { margin: 8px 0 0; }
.seo-langs ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seo-langs a {
  display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px;
}
.seo-langs a[aria-current="page"] { border-color: var(--accent-2); color: var(--accent-2); }

/* --- stránky kategorií --- */
a.brand { text-decoration: none; }
.page { gap: 18px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a, .seo a { color: var(--accent-2); }
.page-title { font-size: clamp(26px, 7vw, 36px) !important; }
.adult-note { color: var(--danger) !important; font-weight: 700; }
.cta { display: block; text-align: center; text-decoration: none; }
.qlist {
  margin: 0; padding: 4px 0 4px 34px; display: flex; flex-direction: column; gap: 8px;
  font-size: 17px; line-height: 1.45;
}
.qlist li {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-left: -6px;
}
.qlist li::marker { color: var(--muted); font-weight: 700; }
.cat-links { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-links a {
  display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px;
}
.cat-links a[aria-current="page"] { border-color: var(--accent-2); color: var(--accent-2); }
.seo h3 a { color: var(--text); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }
#installBtn { min-height: 36px; padding: 6px 12px; }
#shareBtn + .success { margin-top: -8px; }

/* --- jména hráčů --- */
.names { margin-top: 14px; }
.names summary { cursor: pointer; color: var(--accent-2); font-weight: 650; font-size: 14px; }
.names p { font-size: 13px; margin: 8px 0; }
.name-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.name-inputs input {
  min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; font-size: 16px;
}
.name-inputs input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.who-btn {
  min-height: 52px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 650; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.who-btn[aria-pressed="true"] { background: var(--yes); border-color: var(--yes); color: #fff; }
.who-btn[aria-pressed="true"]::before { content: "✋ "; }
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ranking li {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .2);
}
.ranking .rk { text-align: center; font-weight: 800; }
.ranking .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.ranking b { color: var(--yes); }
.foot { margin-top: 24px; font-size: 13px; text-align: center; }

/* --- návrh vlastní otázky --- */
.suggest-form { display: flex; flex-direction: column; gap: 10px; }
.suggest-form textarea, .suggest-form select, .suggest-form input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; font-size: 16px;
}
.suggest-form textarea { resize: vertical; font-size: 18px; font-weight: 650; line-height: 1.35; }
.suggest-form select option { color: #111; }
.suggest-form :focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
#toSuggestBtn { margin-top: -4px; }
