/* Host screen (TV). Big type, black dominates, yellow = signal. */

body { overflow: hidden; }

#app { height: 100vh; display: flex; flex-direction: column; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4vh 6vw;
  text-align: center;
  gap: 2.5vh;
  min-height: 0;
}

/* ---------- lobby ---------- */

#screen-lobby { justify-content: space-between; padding-bottom: 2vh; }

.lobby-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 4vw;
  width: 100%;
  max-width: 1400px;
}

.lobby-left { text-align: left; display: flex; flex-direction: column; gap: 2vh; align-items: flex-start; }
.lobby-logo { width: 180px; }
/* Event lockup from games/<hra>.json (portrait badge, e.g. ME2026) */
.lobby-logo.lobby-logo-event { width: auto; height: 220px; border-radius: 12px; }
.lobby-left h1 { font-size: 5rem; line-height: 1; }
.lobby-hint { color: var(--text-soft); max-width: 34ch; }
.lobby-actions { display: flex; gap: 1rem; }

.lobby-players { display: flex; flex-wrap: wrap; gap: 0.8rem; min-height: 3.2rem; }
.player-chip {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-card);
  border-radius: 999px;
  padding: 0.5rem 1.1rem 0.5rem 0.6rem;
  font-weight: bold;
}
.player-chip .dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; }
.player-chip.off { opacity: 0.4; }

.lobby-right { display: flex; flex-direction: column; align-items: center; gap: 1.5vh; }
#qr { width: min(34vh, 26vw); border-radius: 12px; }
.room-code { font-size: 4.5rem; font-weight: bold; letter-spacing: 0.18em; color: var(--accent); }
.lobby-footer { padding: 1.5vh 0; }

/* generated categories */
.lobby-categories { display: flex; flex-wrap: wrap; gap: 0.5rem; min-height: 2rem; max-width: 44vw; }
.cat-chip {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 0.9rem;
  font-size: 0.85rem;
}
.cat-chip .regen {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; padding: 0 0.2rem;
  font-family: var(--font);
}
.cat-chip .regen:hover { color: var(--accent); }
.cat-chip.sheet { border-left: 3px solid var(--accent); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.generating { animation: pulse 1.2s ease-in-out infinite; color: var(--accent); }

/* generator */
.gen-panel {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
}
.gen-inner { width: min(640px, 90vw); max-height: 85vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.7rem; text-align: left; }
.gen-actions { display: flex; gap: 0.8rem; margin-top: 0.4rem; }
.gen-preview { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--text-soft); max-height: 30vh; overflow-y: auto; }

/* ---------- intro ---------- */
#screen-intro h1 { font-size: 6rem; }
.intro-subtitle { color: var(--text-soft); font-size: 1.4rem; }

/* ---------- question ---------- */
#screen-question { justify-content: flex-start; padding-top: 6vh; width: 100%; }
.q-top { display: flex; justify-content: space-between; width: 100%; max-width: 1200px; }
#q-text { font-size: 3.2rem; max-width: 1200px; line-height: 1.2; }
.q-media { max-width: 1000px; }
.q-media img { max-height: 34vh; max-width: 80vw; border-radius: 8px; }
.q-media iframe, .q-media video { width: min(70vw, 900px); aspect-ratio: 16 / 9; border: none; border-radius: 8px; }
.q-media.audio-only { width: 1px; height: 1px; overflow: hidden; opacity: 0.01; position: absolute; }
.q-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  width: 100%; max-width: 1100px;
}
.q-option {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  font-size: 1.6rem;
  font-weight: bold;
  text-align: left;
  display: flex; gap: 1rem; align-items: baseline;
}
.q-option .letter { color: var(--accent); }
.q-option.correct { background: var(--accent); color: var(--accent-text); }
.q-option.correct .letter { color: var(--accent-text); }
.q-status { font-size: 2rem; font-weight: bold; min-height: 2.4rem; }
.q-status .buzzer-name { color: var(--accent); }
.countdown { width: 100%; max-width: 1100px; }
.q-players { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.q-player-dot {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 0.9rem; color: #fff;
  opacity: 0.35;
}
.q-player-dot.answered { opacity: 1; }
.q-player-dot.locked { opacity: 0.15; text-decoration: line-through; }

/* ---------- result ---------- */
#result-correct { font-size: 3rem; color: var(--accent); max-width: 1100px; }
.result-detail { display: flex; flex-direction: column; gap: 0.6rem; font-size: 1.5rem; }
.result-row { display: flex; gap: 1.2rem; align-items: center; justify-content: center; }
.result-row .delta-plus { color: var(--accent); font-weight: bold; }
.result-row .delta-minus { color: var(--text-muted); font-weight: bold; }

/* ---------- learn (reveal & learn) ---------- */
#learn-answer { font-size: 4rem; color: var(--accent); max-width: 1100px; line-height: 1.15; }
.learn-media img { max-height: 30vh; max-width: 70vw; border-radius: 8px; }
.learn-text { font-size: 1.7rem; color: var(--text-soft); max-width: 44ch; line-height: 1.45; }
#learn-hint { min-height: 1.2em; }

/* dynamic question sizing: short = big */
#q-text.q-size-l { font-size: 4rem; }
#q-text.q-size-m { font-size: 3.2rem; }
#q-text.q-size-s { font-size: 2.4rem; }

/* ---------- board ---------- */
#screen-board { width: 100%; justify-content: flex-start; padding-top: 4vh; }
.board-grid {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  max-width: 1400px;
  flex: 1;
  min-height: 0;
}
.board-cat {
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  padding: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.board-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
  font-weight: bold;
  color: var(--accent);
}
.board-cell.used { background: var(--bg-darker); color: transparent; }
.board-picker { font-size: 1.1rem; padding: 1.5vh 0; }
.board-picker b { color: var(--accent); }

/* ---------- final ---------- */
#final-question { font-size: 2.6rem; max-width: 1100px; }
.final-steps { display: flex; flex-direction: column; gap: 1rem; width: 100%; max-width: 900px; }
.final-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1.2rem;
  align-items: center;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.9rem 1.4rem;
  font-size: 1.4rem;
  text-align: left;
}
.final-row .verdict-ok { color: var(--accent); font-weight: bold; }
.final-row .verdict-no { color: var(--text-muted); font-weight: bold; }

/* ---------- podium ---------- */
.podium { display: flex; flex-direction: column; gap: 1.2rem; }
.podium-row { display: flex; align-items: center; gap: 1.5rem; font-size: 2rem; }
.podium-row.first { font-size: 3.2rem; }
.podium-row .rank { color: var(--accent); font-weight: bold; width: 2.2em; text-align: right; }
.podium-row .score { color: var(--text-soft); }
.podium-row .dot { width: 1.2em; height: 1.2em; border-radius: 50%; }

/* ---------- score strip ---------- */
.score-strip {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.2vh 2vw 2vh;
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
}
.score-item { display: flex; align-items: center; gap: 0.7rem; font-size: 1.4rem; font-weight: bold; }
.score-item .dot { width: 1.1em; height: 1.1em; border-radius: 50%; }
.score-item .pts { color: var(--accent); }
.score-item.active { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.score-item.off { opacity: 0.4; }

.flash-correct { animation: flash-y 0.6s ease-out; }
@keyframes flash-y {
  0% { background: var(--accent); }
  100% { background: var(--bg); }
}

/* Zaverecna hlaska pod podiem, text prichazi z games/<hra>.json */
.podium-ending {
  margin-top: 28px;
  text-align: center;
  color: var(--text-soft);
  font-size: 1.35rem;
  line-height: 1.4;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

/* Ztlumeni hlasu. Obsluha na miste to musi umet vypnout bez zasahu do kodu.
   Plati jen na namluvene hlasky, wav efekty hraji dal. */
.btn-hlas {
  position: fixed; right: 16px; bottom: 14px; z-index: 40;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: 17px; line-height: 1; cursor: pointer; opacity: .4;
}
.btn-hlas:hover { opacity: 1; }
