/* ============================================================
   The Dab Hut — Trivia Capiche shared theme
   Used by both host.html and index.html (player)
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark:    #09000f;
  --bg-mid:     #0d0018;
  --bg-glow:    #080011;
  --purple:     #2e084d;
  --purple-lt:  #3a0a66;
  --gold:       #f6c70a;
  --orange:     #e87d1e;
  --green:      #4ade80;
  --red:        #ef4444;
  --white-pure: #ffffff;
  --white-75:   rgba(255,255,255,.75);
  --white-50:   rgba(255,255,255,.5);
  --white-30:   rgba(255,255,255,.3);
  --white-20:   rgba(255,255,255,.2);
  --white-15:   rgba(255,255,255,.15);
  --white-10:   rgba(255,255,255,.10);
  --white-07:   rgba(255,255,255,.07);
  --white-04:   rgba(255,255,255,.04);
  --white-100:  rgba(255,255,255,1);
  --white-90:   rgba(255,255,255,.9);
  --white-80:   rgba(255,255,255,.8);
  --white-70:   rgba(255,255,255,.7);
  --white-40:   rgba(255,255,255,.4);
  --font-display: 'Black Han Sans', sans-serif;
  --font-body:    'Barlow Condensed', sans-serif;
}

html, body { width: 100%; min-height: 100vh; background: var(--bg-dark); font-family: var(--font-body); color: #fff; overflow-x: hidden; }

body {
  background: linear-gradient(150deg, var(--bg-dark) 0%, var(--bg-mid) 45%, var(--bg-glow) 100%);
  position: relative;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--purple); }

/* ---- animations ---- */
@keyframes revealSlide { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes boardIn    { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes rowIn      { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes blink      { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes timerBeat  { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn      { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* ---- top/bottom color stripes ---- */
.stripe { display: flex; height: 7px; }
.stripe > div { flex: 1; }
.stripe-top > div:nth-child(1) { background: var(--purple); }
.stripe-top > div:nth-child(2) { background: var(--gold); }
.stripe-top > div:nth-child(3) { background: var(--orange); }
.stripe-bottom > div:nth-child(1) { background: var(--orange); }
.stripe-bottom > div:nth-child(2) { background: var(--gold); }
.stripe-bottom > div:nth-child(3) { background: var(--purple); }

/* ---- shared headers ---- */
.brand {
  display: inline-block;
  background: var(--gold);
  color: var(--bg-dark);
  font-family: var(--font-display);
  letter-spacing: 0;
  padding: 4px 12px;
  box-shadow: 3px 3px 0 var(--orange);
}

.brand-lg { padding: 6px 16px; font-size: clamp(16px, 2.2vh, 26px); }
.brand-xl { padding: 10px 24px; font-size: clamp(22px, 4vh, 40px); box-shadow: 5px 5px 0 var(--orange); }

.sub-label {
  color: var(--white-50);
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* ---- generic buttons ---- */
.btn {
  font-family: var(--font-display);
  border: 2px solid var(--white-15);
  background: var(--purple);
  color: #fff;
  padding: 8px 18px;
  font-size: 16px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--purple-lt); border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn:disabled:hover { background: var(--purple); border-color: var(--white-15); color: #fff; }

.btn-gold { border-color: var(--gold); background: var(--purple); color: var(--gold); box-shadow: 4px 4px 0 var(--orange); }
.btn-gold:hover { background: var(--purple-lt); }
.btn-green { border-color: var(--green); background: #1a4d2e; color: var(--green); }
.btn-green:hover { background: #256b3e; }
.btn-red { border-color: var(--red); background: #2d0a0a; color: var(--red); }
.btn-red:hover { background: #4d1515; }
.btn-big { padding: 14px 32px; font-size: 22px; }
.btn-huge { padding: 18px 48px; font-size: clamp(22px, 4vh, 36px); }

/* ---- inputs ---- */
.input {
  width: 100%;
  background: var(--white-07);
  border: 2px solid var(--white-15);
  color: #fff;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.15s;
  letter-spacing: 0.04em;
}
.input:focus { border-color: var(--gold); }
.input::placeholder { color: var(--white-30); }
.input-big { font-size: clamp(20px, 5vw, 28px); padding: 14px 18px; text-align: center; }

/* ============================================================
   PLAYER  (index.html)
   ============================================================ */
.player-wrap {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.player-screen {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  text-align: center;
  animation: fadeIn 0.3s ease both;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.player-screen.no-anim { animation: none; }

.player-screen h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 52px);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(246,199,10,.35);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.player-tag {
  color: var(--white-50);
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 13px;
  margin-bottom: 5px;
}

.pin-hint {
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 12px;
  margin-bottom: 28px;
}

.field-stack { display: flex; flex-direction: column; gap: 14px; width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field-label { color: var(--white-50); font-size: 12px; letter-spacing: 0.18em; font-weight: 700; text-transform: uppercase; }

.join-error {
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 4px;
  min-height: 18px;
}

/* lobby */
.lobby-pin {
  font-family: var(--font-display);
  font-size: clamp(56px, 18vw, 128px);
  color: var(--gold);
  text-shadow: 0 0 50px rgba(246,199,10,.4);
  letter-spacing: 0.18em;
  line-height: 1;
  margin: 16px 0 8px;
}
.lobby-label {
  color: var(--white-50);
  letter-spacing: 0.22em;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
}
.lobby-status {
  display: flex; align-items: center; gap: 10px;
  color: var(--green);
  font-size: 18px; font-weight: 700;
  margin-top: 14px;
}
.lobby-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lobby-count {
  font-family: var(--font-display);
  font-size: clamp(38px, 8vw, 56px);
  color: #fff;
  margin-top: 12px;
}
.lobby-count-label { color: var(--white-50); font-size: 13px; letter-spacing: .18em; font-weight: 700; }
.lobby-myname { color: var(--gold); font-weight: 700; font-size: 18px; letter-spacing: .04em; margin-top: 14px; }

/* question screen (player) */
.q-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.q-diff-tag {
  font-family: var(--font-display);
  font-size: 14px;
  padding: 3px 10px;
  letter-spacing: 0.1em;
  border: 2px solid;
}
.q-diff-tag.EASY   { color: var(--green); border-color: var(--green); background: rgba(74,222,128,.15); }
.q-diff-tag.MEDIUM { color: var(--gold);  border-color: var(--gold);  background: rgba(246,199,10,.15); }
.q-diff-tag.HARD   { color: var(--red);   border-color: var(--red);   background: rgba(239,68,68,.15); }
.q-cat-display { color: var(--orange); font-size: 13px; font-weight: 700; letter-spacing: 0.22em; }
.q-counter { color: var(--white-30); font-family: var(--font-display); font-size: 18px; }

.q-question {
  font-family: var(--font-display);
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1.2;
  color: #fff;
  text-align: center;
  margin-bottom: 22px;
  max-width: 100%;
  letter-spacing: -0.01em;
}

.q-timer-bar {
  width: 100%;
  height: 16px;
  background: var(--white-07);
  border-radius: 8px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.q-timer-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--green);
  transition: width 1s linear, background 0.4s ease;
  border-radius: 8px;
  box-shadow: 0 0 16px currentColor;
}

.q-choices { display: flex; flex-direction: column; gap: 12px; width: 100%; }

.q-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid;
  background: rgba(0,0,0,.25);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(15px, 4.5vw, 19px);
  letter-spacing: 0.02em;
  color: #fff;
}
.q-choice:hover:not(.locked) { transform: translateY(-2px); }
.q-choice .choice-letter {
  font-family: var(--font-display);
  font-size: 22px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid currentColor;
  flex-shrink: 0;
}
.q-choice .choice-text { flex: 1; }

.q-choice[data-color="0"] { border-color: var(--gold);   color: var(--gold); }
.q-choice[data-color="1"] { border-color: var(--green);  color: var(--green); }
.q-choice[data-color="2"] { border-color: var(--purple);  color: #b85ce6; border-color: #6a1a99; }
.q-choice[data-color="3"] { border-color: var(--orange);  color: var(--orange); }

.q-choice.locked { opacity: 0.45; cursor: not-allowed; }
.q-choice.locked:hover { transform: none; }
.q-choice.mine { box-shadow: 0 0 20px currentColor; }
.q-choice.correct { background: rgba(74,222,128,.15); border-color: var(--green); color: var(--green); }
.q-choice.wrong { background: rgba(239,68,68,.12); opacity: 0.6; }

/* waiting / reveal screens (player) */
.waiting-screen { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.waiting-pulse {
  font-family: var(--font-display);
  font-size: clamp(24px, 7vw, 44px);
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.02em;
}
.waiting-sub { color: var(--white-50); font-weight: 700; letter-spacing: 0.18em; font-size: 13px; }
.waiting-dots { font-size: 26px; color: var(--orange); animation: blink 1s ease infinite; }

.reveal-result {
  font-family: var(--font-display);
  font-size: clamp(34px, 12vw, 64px);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.reveal-result.correct { color: var(--green); text-shadow: 0 0 30px rgba(74,222,128,.5); }
.reveal-result.wrong   { color: var(--red);   text-shadow: 0 0 30px rgba(239,68,68,.5); }
.reveal-points {
  font-family: var(--font-display);
  font-size: clamp(36px, 10vw, 64px);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(246,199,10,.5);
}
.reveal-rank { color: var(--white-75); font-weight: 700; letter-spacing: 0.15em; font-size: 14px; }

.time-up-pulse {
  font-family: var(--font-display);
  color: var(--red);
  font-size: clamp(28px, 9vw, 52px);
  letter-spacing: 0.1em;
  animation: blink 0.9s ease infinite;
}

/* mini leaderboard on player reveal/ended */
.mini-leaderboard {
  width: 100%;
  margin-top: 16px;
  text-align: left;
  font-family: var(--font-body);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--white-10);
  padding: 10px;
}
.mini-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  font-weight: 700;
  font-size: clamp(14px, 4vw, 17px);
  animation: rowIn 0.3s ease both;
}
.mini-leaderboard-row.is-me { background: rgba(246,199,10,.1); border-left: 3px solid var(--gold); padding-left: 8px; }
.mini-leaderboard-row .rank { width: 2.5ch; text-align: right; font-family: var(--font-display); color: var(--gold); font-size: 18px; }
.mini-leaderboard-row .name { flex: 1; color: #fff; }
.mini-leaderboard-row .score { color: var(--gold); font-family: var(--font-display); font-size: 20px; }
.mini-leaderboard-row .medal { color: var(--gold); font-size: 22px; }

/* final screen */
.final-rank {
  font-family: var(--font-display);
  font-size: clamp(60px, 22vw, 140px);
  color: var(--gold);
  text-shadow: 0 0 50px rgba(246,199,10,.6);
  line-height: 1;
}
.final-score-display { font-family: var(--font-display); font-size: clamp(28px, 9vw, 56px); color: #fff; }
.final-name { color: var(--orange); font-weight: 700; letter-spacing: 0.18em; font-size: 14px; }

/* footer pin on player */
.player-pin-tag {
  position: fixed;
  bottom: 10px;
  right: 14px;
  color: var(--white-30);
  font-size: 12px;
  letter-spacing: 0.15em;
  font-weight: 700;
}

/* ============================================================
   HOST  (host.html)
   ============================================================ */
.host-wrap { width: 100%; height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; }

.host-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 85%, rgba(46,8,77,.5) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(232,125,30,.12) 0%, transparent 60%);
}

.host-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 12px;
  border-bottom: 1px solid rgba(246,199,10,.18);
  flex-shrink: 0;
}
.host-header-left { display: flex; align-items: center; gap: 16px; }
.host-header-right { display: flex; align-items: baseline; gap: 6px; }

.host-diff-badge {
  font-family: var(--font-display);
  font-size: clamp(13px, 2vh, 22px);
  padding: 6px 18px;
  letter-spacing: 0.1em;
  border: 2px solid;
  box-shadow: 4px 4px 0;
}
.host-diff-badge.EASY   { color: var(--green); border-color: var(--green); background: rgba(26,77,46,.9); box-shadow: 4px 4px 0 rgba(74,222,128,.25); }
.host-diff-badge.MEDIUM { color: var(--gold);  border-color: var(--gold);  background: rgba(77,58,0,.9); }
.host-diff-badge.HARD   { color: var(--red);   border-color: var(--red);   background: rgba(77,15,15,.9); }

.host-q-counter {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vh, 68px);
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 30px rgba(246,199,10,.35);
}
.host-q-total { color: var(--white-30); font-size: clamp(12px, 1.8vh, 20px); font-weight: 600; }

.host-category {
  padding: 16px 28px 4px;
  color: var(--orange);
  font-size: clamp(10px, 1.55vh, 18px);
  font-weight: 700;
  letter-spacing: 0.28em;
}

.host-question-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 5vw;
  position: relative;
  min-height: 0;
}
.host-question {
  font-family: var(--font-display);
  font-size: clamp(20px, 5.2vh, 62px);
  line-height: 1.22;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 40px rgba(246,199,10,.1);
  max-width: 88%;
  letter-spacing: -0.01em;
}

/* corner decorations */
.host-corner {
  position: absolute;
  width: 3.5vw;
  height: 4vh;
  pointer-events: none;
}
.host-corner.tl { top: 2vh; left: 2.5vw; border-top: 3px solid rgba(246,199,10,.25); border-left: 3px solid rgba(246,199,10,.25); }
.host-corner.tr { top: 2vh; right: 2.5vw; border-top: 3px solid rgba(246,199,10,.25); border-right: 3px solid rgba(246,199,10,.25); }
.host-corner.bl { bottom: 2vh; left: 2.5vw; border-bottom: 3px solid rgba(246,199,10,.25); border-left: 3px solid rgba(246,199,10,.25); }
.host-corner.br { bottom: 2vh; right: 2.5vw; border-bottom: 3px solid rgba(246,199,10,.25); border-right: 3px solid rgba(246,199,10,.25); }

/* host answer area */
.host-answer-area {
  min-height: 18vh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 5vw 16px;
  border-top: 1px solid var(--white-07);
  transition: background 0.45s ease, border-color 0.45s ease;
}
.host-answer-area.reveal-bg {
  background: rgba(46,8,77,.55);
  border-top-color: rgba(246,199,10,.2);
}
.host-answer-placeholder {
  color: var(--white-20);
  font-size: clamp(11px, 1.7vh, 18px);
  letter-spacing: 0.22em;
  font-weight: 600;
}
.host-answer-reveal {
  text-align: center;
  animation: revealSlide 0.4s ease forwards;
}
.host-answer-label {
  color: rgba(246,199,10,.55);
  font-size: clamp(9px, 1.25vh, 14px);
  letter-spacing: 0.32em;
  font-weight: 700;
  margin-bottom: 8px;
}
.host-answer-text {
  font-family: var(--font-display);
  font-size: clamp(17px, 3.8vh, 46px);
  color: var(--gold);
  line-height: 1.2;
  text-shadow: 0 0 50px rgba(246,199,10,.45);
  max-width: 85vw;
}
.host-times-up {
  font-family: var(--font-display);
  font-size: clamp(16px, 3.2vh, 38px);
  color: var(--red);
  animation: blink 0.9s ease infinite;
  letter-spacing: 0.12em;
}

/* timer bar */
.host-timer-bar {
  height: 16px;
  background: var(--white-07);
  flex-shrink: 0;
  position: relative;
}
.host-timer-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--green);
  transition: width 1s linear, background 0.5s ease;
  box-shadow: 0 0 16px currentColor;
}

/* host HUD */
.host-hud {
  background: rgba(0,0,0,.65);
  border-top: 1px solid var(--white-07);
  flex-shrink: 0;
  padding: 8px 16px;
}
.host-hud-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }

.host-timer-display {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vh, 54px);
  line-height: 1;
  color: var(--green);
  min-width: 2.5ch;
  text-align: center;
}
.host-timer-display.warn { color: var(--gold); }
.host-timer-display.danger { color: var(--red); animation: timerBeat 0.5s ease infinite; }

/* lobby view */
.host-lobby {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4vh 4vw;
  animation: fadeIn 0.3s ease both;
}
.host-lobby-pin-label {
  color: var(--white-50);
  letter-spacing: 0.3em;
  font-weight: 700;
  font-size: clamp(11px, 2vh, 18px);
  margin-bottom: 16px;
}
.host-lobby-pin {
  font-family: var(--font-display);
  font-size: clamp(80px, 22vw, 220px);
  color: var(--gold);
  text-shadow: 0 0 60px rgba(246,199,10,.5);
  letter-spacing: 0.18em;
  line-height: 1;
  margin-bottom: 6px;
}
.host-lobby-joininstruct {
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: clamp(13px, 2.4vh, 20px);
  margin-bottom: 8px;
}
.host-lobby-url {
  color: var(--white-50);
  font-family: monospace;
  font-size: clamp(13px, 2vh, 18px);
  background: var(--white-07);
  padding: 6px 14px;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.host-lobby-playerlist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  max-width: 80%;
  margin-bottom: 24px;
  max-height: 28vh;
  overflow-y: auto;
  padding: 4px;
}
.host-lobby-chip {
  background: rgba(246,199,10,.1);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 14px;
  font-size: clamp(14px, 2vh, 22px);
  animation: popIn 0.3s ease both;
}
.host-lobby-chip.empty { opacity: 0.3; }
.host-lobby-count {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vh, 50px);
  color: #fff;
}

/* choice distribution bars (reveal phase on host) */
.host-distribution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 5vw 12px;
  flex-shrink: 0;
}
.dist-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 2px solid;
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,.35);
  animation: popIn 0.3s ease both;
}
.dist-row[data-color="0"] { border-color: var(--gold);   color: var(--gold); }
.dist-row[data-color="1"] { border-color: var(--green);  color: var(--green); }
.dist-row[data-color="2"] { border-color: #6a1a99;       color: #b85ce6; }
.dist-row[data-color="3"] { border-color: var(--orange); color: var(--orange); }
.dist-row.correct { box-shadow: 0 0 20px currentColor; }
.dist-row .dist-letter { font-family: var(--font-display); font-size: 26px; }
.dist-row .dist-text { color: #fff; font-weight: 600; font-size: clamp(13px, 1.8vh, 18px); line-height: 1.25; }
.dist-row .dist-bar-bg { background: var(--white-04); height: 8px; position: relative; overflow: hidden; }
.dist-row .dist-bar-fill { background: currentColor; height: 100%; transition: width 0.5s ease; box-shadow: 0 0 10px currentColor; }
.dist-row .dist-count { font-family: var(--font-display); font-size: 22px; color: currentColor; }
.dist-row .dist-correct-tag {
  display: inline-block;
  border: 1px solid currentColor;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
  margin-top: 4px;
}

/* Host end-board (full leaderboard overlay) */
.host-board-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: linear-gradient(160deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-glow) 100%);
  display: flex;
  flex-direction: column;
  animation: boardIn 0.35s ease forwards;
}
.host-board-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 3vh 5vw;
}
.host-board-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vh, 80px);
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 50px rgba(246,199,10,.5);
}
.host-board-sub {
  font-family: var(--font-display);
  font-size: clamp(8px, 1.5vh, 16px);
  color: var(--orange);
  letter-spacing: 0.3em;
  margin-bottom: 4px;
}
.host-board-list { display: flex; flex-direction: column; gap: 14px; flex: 1; overflow-y: auto; margin-top: 24px; }
.host-board-row {
  display: flex;
  align-items: center;
  border: 2px solid;
  padding: 14px 28px;
  background: var(--white-03);
  animation: rowIn 0.3s ease both;
  position: relative;
  overflow: hidden;
}
.host-board-row .rank {
  font-family: var(--font-display);
  font-size: clamp(20px, 4.5vh, 52px);
  min-width: 4ch;
  line-height: 1;
}
.host-board-row .name {
  flex: 1;
  font-family: var(--font-display);
  font-size: clamp(18px, 4.2vh, 50px);
  margin-left: 24px;
  letter-spacing: 0.02em;
}
.host-board-row .score {
  font-family: var(--font-display);
  font-size: clamp(24px, 6vh, 70px);
  line-height: 1;
}
.host-board-row .pts {
  font-size: clamp(10px, 1.5vh, 16px);
  color: var(--white-30);
  letter-spacing: 0.12em;
  margin-left: 12px;
  align-self: flex-end;
  padding-bottom: 2px;
  font-weight: 600;
}
.host-board-row.top1 { background: rgba(246,199,10,.15); border-color: var(--gold); color: var(--gold); }
.host-board-row.top1 .name { color: #fff; }
.host-board-row.top2 { background: rgba(192,192,192,.06); border-color: #c0c0c0; color: #c0c0c0; }
.host-board-row.top2 .name { color: #fff; }
.host-board-row.top3 { background: rgba(205,127,50,.06); border-color: #cd7f32; color: #cd7f32; }
.host-board-row.top3 .name { color: #fff; }
.host-board-row.notop { border-color: rgba(255,255,255,.07); color: var(--white-75); }
.host-board-row .rank-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.host-board-row.top1 .rank-bar { background: var(--gold); }
.host-board-row.top2 .rank-bar { background: #c0c0c0; }
.host-board-row.top3 .rank-bar { background: #cd7f32; }
.host-board-medal {
  font-family: var(--font-display);
  font-size: clamp(20px, 4.5vh, 52px);
  min-width: 2.5ch;
}

.host-board-close {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  position: absolute;
  top: 18px; right: 22px;
  color: var(--white-30);
  background: transparent;
  border: 1px solid var(--white-15);
  font-family: var(--font-display);
  font-size: 14px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 0.1em;
}
.host-board-close:hover { color: #fff; border-color: var(--gold); }

/* helper: hidden */
.hidden { display: none !important; }

/* generic utility */
.spacer-12 { height: 12px; }
.spacer-20 { height: 20px; }
.spacer-40 { height: 40px; }
.text-center { text-align: center; }


.host-board-layer {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9999;
  background: linear-gradient(180deg, #1a0530 0%, #2e084d 100%);
  display: flex; flex-direction: column; align-items: center;
  animation: fadeIn .3s ease;
  overflow-y: auto;
}
.host-board-layer .host-board-body {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 700px; padding: 30px 20px 60px;
}
.host-board-layer .host-board-sub {
  font-family: var(--font-body); font-size: 14px; letter-spacing: .2em;
  color: var(--gold); margin-bottom: 6px; margin-top: 30px;
}
.host-board-layer .host-board-title {
  font-family: var(--font-display); font-size: clamp(28px, 5vw, 48px);
  color: var(--white-100); letter-spacing: .02em; margin-bottom: 24px;
}
.host-board-layer .host-board-list { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.host-board-layer .host-board-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 10px;
  background: rgba(255,255,255,.05);
  animation: rowIn .3s ease both;
}
.host-board-layer .host-board-row.top1 { background: rgba(246,199,10,.15); border: 1px solid rgba(246,199,10,.3); }
.host-board-layer .host-board-row.top2 { background: rgba(255,255,255,.08); }
.host-board-layer .host-board-row.top3 { background: rgba(255,255,255,.06); }
.host-board-layer .host-board-row .name {
  flex: 1; font-family: var(--font-body); font-size: 18px; letter-spacing: .03em; color: var(--white-90);
}
.host-board-layer .host-board-row .score {
  font-family: var(--font-display); font-size: 22px; color: var(--gold);
}
.host-board-layer .host-board-row .pts { font-size: 11px; letter-spacing: .15em; color: var(--white-40); font-family: var(--font-body); }
.host-board-layer .host-board-row .host-board-medal { font-size: 22px; width: 36px; text-align: center; }
.host-board-layer .host-board-row .rank-bar { width: 4px; height: 30px; border-radius: 2px; background: var(--gold); }
.host-board-layer .host-board-row.top2 .rank-bar { background: #c0c0c0; }
.host-board-layer .host-board-row.top3 .rank-bar { background: #cd7f32; }
.host-board-layer .host-board-row.notop .rank-bar { background: var(--white-20); }
.host-board-close {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  position: fixed; top: 20px; right: 24px; z-index: 10000;
  font-family: var(--font-body); font-size: 14px; letter-spacing: .12em;
  padding: 10px 22px; border: 2px solid var(--gold);
  background: rgba(246,199,10,.12); color: var(--gold);
  border-radius: 30px; cursor: pointer; text-transform: uppercase;
  transition: all .2s;
}
.host-board-close:hover { background: var(--gold); color: var(--purple); }

.host-time-presets {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin: 14px 0 6px;
}
.host-time-preset {
  font-family: var(--font-display);
  border: 2px solid var(--white-15);
  background: var(--purple);
  color: #fff;
  padding: 8px 18px;
  font-size: 16px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  border-radius: 6px;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.host-time-preset:hover {
  background: var(--purple-lt);
  border-color: var(--gold);
  color: var(--gold);
}
.host-time-preset.active {
  border-color: var(--gold);
  background: var(--purple);
  color: var(--gold);
  box-shadow: 4px 4px 0 var(--orange);
}

.q-choice.selected {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(246,199,10,.3), 0 0 20px rgba(246,199,10,.15);
  transform: scale(1.02);
}
.q-choice.selected .choice-letter { background: var(--gold); color: var(--purple); }
.q-confirm-wrap {
  display: flex; justify-content: center; margin-top: 18px;
}
.q-confirm-btn {
  font-family: var(--font-display); font-size: 22px; letter-spacing: .05em;
  padding: 16px 48px; border: none; border-radius: 14px; cursor: pointer;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background: var(--green); color: #03210f;
  box-shadow: 0 4px 20px rgba(74,222,128,.3);
  transition: all .2s; text-transform: uppercase;
}
.q-confirm-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(74,222,128,.4); }
.q-confirm-btn:disabled {
  background: rgba(255,255,255,.1); color: var(--white-30);
  box-shadow: none; cursor: not-allowed; transform: none;
}

.player-mute-btn {
  position: absolute; top: 16px; right: 16px; z-index: 100;
  font-size: 22px; cursor: pointer; background: none; border: none;
  padding: 6px 10px; border-radius: 8px; opacity: .7;
  transition: opacity .2s;
}
.player-mute-btn:hover { opacity: 1; }


/* ============================================================
   Host player cards strip (bottom of host screen)
   ============================================================ */
.host-player-cards {
  display: flex; gap: 10px; justify-content: center; align-items: stretch;
  flex-wrap: wrap; padding: 10px 5vw 16px; margin-top: auto;
}
.host-player-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 110px; max-width: 150px; flex: 1 1 120px;
  padding: 10px 12px 8px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.1);
  font-family: var(--font-body); text-align: center;
  transition: all .25s ease; animation: rowIn .3s ease both;
}
.host-player-card.winner {
  border-color: var(--gold); background: rgba(246,199,10,.12);
  box-shadow: 0 0 18px rgba(246,199,10,.25), 4px 4px 0 var(--orange);
}
.host-card-name {
  font-size: 15px; letter-spacing: .04em; color: var(--white-90);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.host-player-card.winner .host-card-name { color: var(--gold); }
.host-card-score {
  font-family: var(--font-display); font-size: 24px; color: var(--white-100);
  line-height: 1;
}
.host-player-card.winner .host-card-score { color: var(--gold); }
.host-card-pts { font-size: 10px; letter-spacing: .15em; color: var(--white-40); }
.host-card-dot {
  width: 10px; height: 10px; border-radius: 50%; margin: 2px 0;
}
.host-player-card.answered .host-card-dot { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,.6); }
.host-player-card.pending .host-card-dot {
  background: var(--white-30); animation: blink 1.5s ease-in-out infinite;
}
.host-card-letter {
  font-family: var(--font-display); font-size: 22px; line-height: 1; margin: 2px 0;
}
.host-player-card.correct .host-card-letter { color: var(--green); }
.host-player-card.wrong .host-card-letter { color: var(--red); }
.host-player-card.noans .host-card-letter { color: var(--white-30); }
.host-card-plus {
  font-family: var(--font-display); font-size: 16px; letter-spacing: .03em; margin-top: 2px;
}
.host-card-plus.gain { color: var(--green); }
.host-card-plus.zero { color: var(--white-30); opacity: .6; }
.host-player-card.correct { border-color: rgba(74,222,128,.45); background: rgba(74,222,128,.08); }
.host-player-card.wrong { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.06); }
.host-player-card.noans { border-color: rgba(255,255,255,.1); opacity: .55; }

/* ---- toast notifications ---- */
.toast-stack {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 10000; display: flex; flex-direction: column; gap: 8px;
  width: min(90vw, 420px); pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(13,0,24,.96);
  border: 2px solid var(--white-15);
  border-left: 4px solid var(--white-30);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.6);
  animation: toastIn 0.25s ease both;
}
.toast.error { border-left-color: var(--red); color: #ffb8b8; }
.toast.success { border-left-color: var(--green); color: #b8ffce; }
.toast.warn { border-left-color: var(--gold); color: var(--gold); }
.toast.leaving { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px); } }

/* ---- button loading state ---- */
.btn.loading, .btn-big.loading, .btn-huge.loading {
  opacity: 0.7; pointer-events: none; position: relative;
}
.btn.loading::after {
  content: ''; position: absolute; right: 14px; top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---- host fullscreen button ---- */
.host-fs-btn {
  position: fixed; top: 14px; right: 18px; z-index: 200;
  font-size: 18px; cursor: pointer;
  background: rgba(0,0,0,.45); border: 1px solid var(--white-15);
  color: var(--white-75);
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.host-fs-btn:hover { color: var(--gold); border-color: var(--gold); }

/* ---- QR code box (host lobby) ---- */
.host-qr-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin: 10px 0 18px;
}
.host-qr-box {
  background: #fff; padding: 10px; border-radius: 8px;
  box-shadow: 0 0 20px rgba(246,199,10,.2);
}
.host-qr-box img, .host-qr-box canvas { display: block; width: 160px; height: 160px; }
.host-qr-label {
  color: var(--white-50); font-size: 11px; letter-spacing: 0.22em;
  font-weight: 700; margin-top: 8px;
}

/* ---- score chip on player question screen ---- */
.q-score-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: rgba(246,199,10,.1); border: 1px solid rgba(246,199,10,.3);
  border-radius: 14px; padding: 3px 12px;
  font-family: var(--font-display); color: var(--gold);
  font-size: 16px; letter-spacing: 0.04em;
}
.q-score-chip .score-label { font-size: 10px; letter-spacing: 0.2em; color: rgba(246,199,10,.6); }

/* ---- prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}