:root {
  --bg1: #0b1e4a; --bg2: #123a8c; --biela: #fff; --cervena: #ee1c25;
  --c0: #e63946; --c1: #1d7bd8; --c2: #f4a61c; --c3: #2a9d5c;
  --sklo: rgba(255, 255, 255, .1);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--biela);
  background: radial-gradient(circle at 20% 0%, var(--bg2), var(--bg1) 70%) fixed;
  overflow-x: hidden;
}
h1, h2, h3 { font-weight: 900; line-height: 1.15; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }

/* ---------- spoločné ---------- */
.btn {
  background: var(--cervena); color: #fff; font-weight: 800; border-radius: 999px;
  padding: .7em 1.4em; box-shadow: 0 .25em 0 rgba(0, 0, 0, .3); transition: transform .1s;
}
.btn:active { transform: translateY(.2em); box-shadow: none; }
.btn.ghost { background: var(--sklo); box-shadow: none; }
.btn.velke { font-size: 1.3em; }
.t0 { background: var(--c0); } .t1 { background: var(--c1); }
.t2 { background: var(--c2); } .t3 { background: var(--c3); }
.tile {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: .6em;
  border-radius: .6em; padding: .7em .9em; font-weight: 800; text-align: left;
  box-shadow: 0 .25em 0 rgba(0, 0, 0, .28);
}
.tile .tvar { font-size: 1.2em; opacity: .9; flex: none; }
.tile .txt { flex: 1; }
.timer { height: .8em; background: var(--sklo); border-radius: 999px; overflow: hidden; }
.timer-bar { display: block; height: 100%; width: 100%; background: #fff; border-radius: 999px; transition: width .1s linear; }
.timer.horí .timer-bar { background: var(--cervena); }
.timer.tenky { height: .35em; }
.chyba { color: #ffd23f; font-weight: 700; }
.bubble {
  display: inline-block; background: var(--sklo); border-radius: 999px;
  padding: .35em .9em; font-weight: 700; backdrop-filter: blur(4px);
}

/* ---------- MOBIL ---------- */
.mobil #screen { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 16px; max-width: 520px; margin: 0 auto; }
.karta { background: var(--sklo); border-radius: 24px; padding: 28px 20px; text-align: center; display: grid; gap: 14px; }
.karta input {
  font: inherit; font-size: 1.3em; font-weight: 700; text-align: center; padding: .6em;
  border-radius: 14px; border: 3px solid transparent; outline: 0; width: 100%;
}
.karta input:focus { border-color: #ffd23f; }
.velke-emoji { font-size: 4.5rem; line-height: 1; }
.skace { animation: skok .9s ease-in-out infinite alternate; }
.toci { animation: toc 2s linear infinite; display: inline-block; }
.vysledok.ok { background: #1f8f4e; } .vysledok.zle { background: #b3262f; }
.zisk { font-size: 1.5em; font-weight: 900; }
.stav { font-size: 1.15em; }
.m-q { display: grid; gap: 12px; }
.m-cislo { opacity: .75; font-weight: 700; text-align: center; }
.m-otazka { font-size: 1.35rem; text-align: center; }
.m-tiles { display: grid; gap: 12px; margin-top: 4px; }
.m-tiles .tile { min-height: 15vh; font-size: 1.2rem; width: 100%; }
.m-tiles .tile:active { transform: scale(.97); }
.m-tiles .tile.htmx-request { opacity: .6; }

/* ---------- TABUĽA ---------- */
.tabula { font-size: clamp(14px, 1.6vw, 30px); }
.tabula #board { min-height: 100%; padding: 2.2vh 3vw; display: flex; flex-direction: column; }
.tabula #board > section { flex: 1; display: flex; flex-direction: column; gap: 2vh; }
#fs { position: fixed; right: 10px; bottom: 10px; z-index: 5; background: var(--sklo); border-radius: 10px; padding: 6px 12px; font-size: 18px; opacity: .5; }
#fs:hover { opacity: 1; }
#konfety { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.ctrl { margin-top: auto; display: flex; gap: 1em; justify-content: flex-end; font-size: .7em; }
.top { display: flex; justify-content: space-between; align-items: center; }
.pill { background: var(--sklo); border-radius: 999px; padding: .3em 1em; font-weight: 800; }
.clock {
  width: 3.2em; height: 3.2em; border-radius: 50%; background: #fff; color: var(--bg1);
  display: grid; place-items: center; font-size: 1.5em; font-weight: 900;
}
.clock.horí { background: var(--cervena); color: #fff; animation: pulz .5s ease-in-out infinite alternate; }
.otazka { font-size: 2.6em; text-align: center; margin: 1vh 0; text-wrap: balance; }
.otazka.mensia { font-size: 1.7em; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vw; flex: 1; }
.tabula .tile { font-size: 1.7em; padding: .6em 1em; }
.tabula .tile .tvar { font-size: 1.4em; }
.fresh .otazka { animation: zhora .5s ease-out both; }
.fresh .tile { animation: vyskoc .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.fresh .tile:nth-child(2) { animation-delay: .1s; } .fresh .tile:nth-child(3) { animation-delay: .2s; }
.fresh .tile:nth-child(4) { animation-delay: .3s; }

/* lobby */
.b-lobby h1 { font-size: 3.4em; text-align: center; }
.vlajka { display: inline-block; animation: mav 1.6s ease-in-out infinite alternate; }
.join { display: flex; gap: 3vw; justify-content: center; align-items: center; }
#qr { background: #fff; padding: 14px; border-radius: 20px; width: min(30vh, 26vw); flex: none; }
#qr img, #qr canvas { width: 100% !important; height: auto !important; display: block; }
.join-text { display: grid; gap: .5em; justify-items: start; }
.maly { opacity: .75; font-size: .8em; }
.url { font-size: 1.7em; font-weight: 900; color: #ffd23f; word-break: break-all; }
.pocet { font-size: 1.3em; }
.bubbles { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; align-content: flex-start; flex: 1; }
.bubble.new { animation: vyskoc .6s cubic-bezier(.2, 1.6, .4, 1) both; background: var(--cervena); }
button.bubble:hover { background: #b3262f; text-decoration: line-through; }

/* vyhodnotenie */
.reveal-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2.5vw; flex: 1; }
.tiles.stlpec { grid-template-columns: 1fr; align-content: start; gap: 1.4vh; flex: none; }
.tiles.stlpec .tile { font-size: 1.25em; }
.tile.zle { opacity: .38; filter: saturate(.5); }
.tile.ok { outline: .18em solid #fff; }
.fresh .tile.ok { animation: vyhra .7s ease-out .2s both; }
.tile .cnt { font-size: 1.2em; font-weight: 900; z-index: 1; }
.tile .bar { position: absolute; left: 0; bottom: 0; height: .3em; width: var(--w); background: rgba(255, 255, 255, .85); }
.fresh .bar { animation: rast .9s ease-out .3s both; }
.fakt { background: var(--sklo); border-radius: .6em; padding: .6em .9em; font-size: .95em; }
.rebricek { background: var(--sklo); border-radius: 1em; padding: 1em 1.2em; display: grid; gap: .7em; align-content: start; }
.rebricek h3 { font-size: 1.4em; }
.riadok { position: relative; display: flex; gap: .6em; align-items: baseline; padding-bottom: .45em; font-weight: 800; font-size: 1.15em; }
.fresh .riadok { animation: zprava .5s ease-out var(--d) both; }
.riadok .kto { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.riadok em { font-style: normal; font-size: .8em; }
.riadok small { color: #7dffa8; font-size: .7em; }
.riadok .bar { position: absolute; left: 0; bottom: 0; height: .22em; border-radius: 999px; width: var(--w); background: linear-gradient(90deg, #ffd23f, var(--cervena)); }

/* finále */
.b-f h1 { font-size: 3em; text-align: center; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 2vw; flex: 1; min-height: 45vh; }
.stupen { width: 20vw; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .2em; }
.stupen .av { font-size: 3.5em; line-height: 1; animation: skok .8s ease-in-out infinite alternate; }
.stupen .meno { font-size: 1.5em; font-weight: 900; }
.stupen .body { opacity: .85; font-weight: 700; }
.stupen .blok {
  width: 100%; border-radius: .8em .8em 0 0; font-size: 3em; display: grid; place-items: start center; padding-top: .2em;
  transform-origin: bottom; animation: stupaj 1s cubic-bezier(.2, 1.2, .4, 1) both;
}
.s1 .blok { height: 32vh; background: linear-gradient(#ffd23f, #e09b00); animation-delay: 1.6s; }
.s2 .blok { height: 23vh; background: linear-gradient(#dfe6ee, #9aa7b5); animation-delay: .9s; }
.s3 .blok { height: 16vh; background: linear-gradient(#e0a070, #a8642f); animation-delay: .2s; }
.s1 > :not(.blok) { animation: objav .5s ease-out 2.2s both; }
.s2 > :not(.blok) { animation: objav .5s ease-out 1.5s both; }
.s3 > :not(.blok) { animation: objav .5s ease-out .8s both; }
.s1 .av { animation: objav .5s ease-out 2.2s both, skok .8s ease-in-out 2.7s infinite alternate; }
.ostatni { display: flex; flex-wrap: wrap; gap: .5em; justify-content: center; font-size: .8em; }

@keyframes skok { to { transform: translateY(-12%); } }
@keyframes toc { to { transform: rotate(360deg); } }
@keyframes pulz { to { transform: scale(1.12); } }
@keyframes mav { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
@keyframes zhora { from { opacity: 0; transform: translateY(-40px); } }
@keyframes zprava { from { opacity: 0; transform: translateX(60px); } }
@keyframes vyskoc { from { opacity: 0; transform: scale(.4); } }
@keyframes vyhra { 40% { transform: scale(1.06); } }
@keyframes rast { from { width: 0; } }
@keyframes stupaj { from { transform: scaleY(0); } }
@keyframes objav { from { opacity: 0; transform: translateY(30px); } }

@media (max-width: 800px) {
  .reveal-grid, .tiles { grid-template-columns: 1fr; }
  .join { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
