:root {
  --bg: #101016;
  --surface: #1a1a23;
  --surface-2: #252531;
  --line: #30303e;
  --text: #f3f3f7;
  --muted: #a0a0b4;
  --accent: #ff4d8d;
  --accent-2: #ffb84d;
  --gold: #ffd43b;
  --ok: #4ade80;
  --danger: #ff6b6b;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 600px; margin: 0 auto; padding: 0 16px calc(100px + env(safe-area-inset-bottom)); }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ok { color: var(--ok); font-weight: 650; }
.warn { color: var(--danger); font-weight: 600; }
.h { margin-top: 8px; }

/* hlavička a navigace */
header.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 0 12px;
  background: linear-gradient(var(--bg) 75%, rgba(16, 16, 22, 0));
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.brand b { display: block; font-size: 17px; }
.brand small { color: var(--muted); font-size: 13px; }
.logo {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #101016; font-size: 20px; font-weight: 900;
}
.logo.big { width: 76px; height: 76px; border-radius: 22px; font-size: 42px; }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(16, 16, 22, 0.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
nav.tabs a, nav.tabs button {
  flex: 1; max-width: 110px;
  display: grid; justify-items: center; gap: 2px; padding: 6px 4px;
  color: var(--muted); text-decoration: none;
  font: inherit; font-size: 11px; font-weight: 600;
  background: none; border: 0; cursor: pointer;
}
nav.tabs .on { color: var(--accent); }
nav.tabs svg { width: 24px; height: 24px; }

/* avatary */
.av {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c, #888); color: #15151c; font-weight: 800; font-size: 13px;
}
.av.me { width: 36px; height: 36px; font-size: 16px; }
.av.big { width: 60px; height: 60px; font-size: 28px; }
.u-pepa { --c: #ff8a65; }
.u-petr { --c: #64b5f6; }
.u-olda { --c: #81c784; }
.u-jiri { --c: #ce93d8; }
.u-marketa { --c: #ffd54f; }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }

/* karty */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card.hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 10px 30px -14px rgba(255, 77, 141, 0.6); }
.card.prompt h1 { margin-top: 2px; overflow-wrap: anywhere; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 750; margin-bottom: 6px; }
.cta { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cta.center { justify-content: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.crit { font-size: 14px; color: var(--muted); margin-top: 10px; }
.crit span { margin-right: 6px; color: var(--text); font-weight: 650; }
.meta { margin-top: 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.back { display: inline-block; margin: 4px 0 0; color: var(--muted); text-decoration: none; font-weight: 600; }
.archive { background: rgba(255, 212, 59, 0.12); color: var(--gold); padding: 10px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 8px; }

.banner {
  display: flex; gap: 12px; padding: 14px 16px; margin: 12px 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.24), rgba(255, 184, 77, 0.16));
  border: 1px solid rgba(255, 77, 141, 0.55);
}
.banner-icon { font-size: 26px; line-height: 1; }

/* tlačítka */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 650; padding: 10px 16px; min-height: 44px; border-radius: 12px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.icon { width: 44px; padding: 0; flex: none; }
.btn:disabled { opacity: 0.5; }
.linkbtn { background: none; border: 0; color: var(--gold); font: inherit; font-weight: 700; text-decoration: underline; padding: 0; cursor: pointer; }
@media (hover: hover) { .btn:hover { filter: brightness(1.12); } }

/* stav hráčů */
.progress { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 99px; background: var(--surface-2); font-size: 14px; white-space: nowrap; }
.chip.ok { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.chip.off { opacity: 0.5; }
.list .chip { padding: 3px 10px; font-size: 12px; }
.chip.live { background: rgba(255, 77, 141, 0.16); color: var(--accent); }

/* obrázky */
.shots { display: grid; gap: 14px; margin: 12px 0; }
.shot { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shot.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.shot.adv { border-color: var(--accent); }
.shot.abs { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.shot.vetoed img { filter: grayscale(1) brightness(0.45); }
.imgbtn { display: block; position: relative; width: 100%; padding: 0; border: 0; background: #08080b; cursor: zoom-in; }
.imgbtn img { display: block; width: 100%; max-height: 72vh; object-fit: contain; }
.letter {
  position: absolute; top: 10px; left: 10px;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(16, 16, 22, 0.85); border: 2px solid var(--accent);
  font-weight: 900; font-size: 20px;
}
.shot figcaption { padding: 12px; display: grid; gap: 10px; }
.shot figcaption + figcaption { padding-top: 0; }
.pts { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.badge.pink { background: rgba(255, 77, 141, 0.2); color: #ff9cbf; }
.badge.gold { background: rgba(255, 212, 59, 0.16); color: var(--gold); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 12px 0 0; }
.thumbs .imgbtn, .thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.thumbs img { width: 100%; height: 100%; max-height: none; object-fit: cover; display: block; }
.thumb .x {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.7); color: #fff; cursor: pointer;
}

.drop {
  width: 100%; border: 2px dashed var(--line); background: var(--surface-2); color: var(--text);
  border-radius: var(--radius); padding: 28px 16px; display: grid; gap: 6px; justify-items: center;
  font: inherit; cursor: pointer;
}
.drop .plus { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 34px; display: grid; place-items: center; line-height: 1; }
.drop b { font-size: 18px; }
.drop small { color: var(--muted); max-width: 32ch; text-align: center; font-size: 14px; }

.prompts { display: grid; gap: 10px; margin-top: 12px; }
.prompt-opt { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 8px; }
.prompt-opt.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.votebar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 25;
  bottom: calc(74px + env(safe-area-inset-bottom));
  width: min(568px, calc(100% - 24px));
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px;
  background: var(--surface-2); border: 1px solid var(--accent); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.votebar span { flex: 1; font-weight: 650; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }

/* seznamy a tabulky */
.standings, .list, .plain { list-style: none; padding: 0; margin: 0; }
.standings li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.standings li:first-child { border-top: 0; }
.standings .who { flex: 1; }
.rank { width: 24px; color: var(--muted); font-weight: 700; }
.list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.list .sub { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 14px 0 2px; }
.list .sub:first-child { padding-top: 4px; }
.plain { display: grid; gap: 10px; }
.people li { display: grid; gap: 2px; }
.hl li { line-height: 1.6; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 650; }
th.l, td.l { text-align: left; }
.scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.grid td.t { text-align: left; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.grid td.t a { text-decoration: none; }
.grid td.pink, .sw.pink { background: rgba(255, 77, 141, 0.32); }
.grid td.gold, .legend .gold { color: var(--gold); font-weight: 850; }
.grid td.z, .grid td.dim { color: var(--muted); font-size: 13px; }
.grid td.veto { color: var(--danger); font-weight: 700; }
.grid tr.wk td { background: var(--surface-2); }
.grid tfoot td { font-weight: 850; border-bottom: 0; }
.matrix td.max { color: var(--accent); font-weight: 850; }
.legend { font-size: 13px; color: var(--muted); margin-top: 10px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }

.seg { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 12px 0; overflow-x: auto; }
.seg button { flex: 1; white-space: nowrap; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 650; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--text); }
.locked { text-align: center; padding: 28px 20px; }
.locked .big { font-size: 46px; margin-bottom: 8px; }

/* formuláře */
.form { display: grid; gap: 14px; }
.form label, .label { display: grid; gap: 6px; font-weight: 650; font-size: 14px; }
.label small { color: var(--muted); font-weight: 400; }
input, textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; width: 100%;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* přihlášení */
.splash { min-height: 100vh; display: grid; place-items: center; }
.login { min-height: 100vh; display: grid; align-content: center; gap: 22px; padding: 32px 0; text-align: center; }
.hero { display: grid; justify-items: center; gap: 8px; }
.hero h1 { font-size: 32px; margin: 4px 0 0; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-btn {
  display: grid; justify-items: center; gap: 8px; padding: 20px 12px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 18px; cursor: pointer;
}
.pick-btn span { display: grid; }
.pick-btn small { color: var(--muted); font-size: 13px; }
.pick-btn.judge { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 14px; text-align: left; }
.pick-btn.judge .av.big { width: 44px; height: 44px; font-size: 20px; }
.back-btn { justify-self: start; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 0; }
.dots { display: flex; justify-content: center; gap: 16px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.err { color: var(--danger); min-height: 1.45em; font-weight: 600; }
.pad { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px; justify-content: center; }
.pad button {
  width: 74px; height: 74px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 27px; font-weight: 600; cursor: pointer;
}
.pad button:active { background: var(--surface-2); }

/* překryvy */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.95); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; }
.lightbox .cap { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); left: 16px; right: 16px; text-align: center; color: #fff; font-weight: 700; }
.lightbox .x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 20px; cursor: pointer; }
.toast {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; transition: opacity 0.25s, transform 0.25s;
  background: #fff; color: #101016; padding: 10px 16px; border-radius: 12px; font-weight: 650;
  max-width: calc(100% - 32px); pointer-events: none; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }
.busy { position: fixed; inset: 0; z-index: 70; background: rgba(16, 16, 22, 0.82); display: grid; place-content: center; justify-items: center; gap: 12px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
