/* quiz-duell/game.css — Quiz Duell specific styles */
/* Shared UI (intro, char-select, result, popups) → ../shared/game-ui.css */

/* ─── SCREEN: QUIZ ──────────────────────────────────────────────────────────── */
#screen-quiz {
  justify-content: flex-start;
  background: var(--bg);
  padding: 0;
  gap: 0;
}

/* ─── HUD ────────────────────────────────────────────────────────────────────── */
#quiz-hud {
  display: flex;
  align-items: center;
  width: 100%;
  padding: calc(0.5rem + env(safe-area-inset-top)) 0.8rem 0.5rem;
  background: rgba(0,0,0,0.45);
  border-bottom: 1px solid rgba(255,200,50,0.08);
  gap: 0.5rem;
  flex-shrink: 0;
}

.quiz-hud-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.quiz-hud-side.p2 { align-items: flex-end; }

.quiz-hud-score {
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--left);
}
.quiz-hud-side.p2 .quiz-hud-score { color: var(--right); }

.quiz-hud-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

#quiz-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 0.1rem;
}

#quiz-round-num {
  font-size: 1.5rem;
  line-height: 1;
  color: rgba(255,255,255,0.75);
}

#quiz-round-multiplier {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(245,166,35,0.15);
  border: 1px solid rgba(245,166,35,0.35);
  border-radius: 10px;
  padding: 0.1rem 0.4rem;
  display: none;
}
#quiz-round-multiplier.visible { display: block; }

/* ─── QUESTION CARD ──────────────────────────────────────────────────────────── */
#quiz-card {
  width: 100%;
  padding: 0.9rem 1rem 0.7rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,200,50,0.08);
  flex-shrink: 0;
}

#quiz-cat-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 0.45rem;
  font-weight: 500;
}

#quiz-q-text {
  font-size: clamp(1rem, 4vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #fff;
  min-height: 2.5em;
}

#quiz-timer-wrap {
  margin-top: 0.65rem;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

#quiz-timer-bar {
  height: 100%;
  width: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width linear;
}
#quiz-timer-bar.finale {
  background: linear-gradient(90deg, var(--gold), #fff176);
  box-shadow: 0 0 8px rgba(245,166,35,0.7);
}
#quiz-timer-bar.timer-bar--urgent {
  background: #e03030;
  box-shadow: 0 0 10px rgba(220,50,50,0.8);
  animation: urgent-pulse 0.4s ease-in-out infinite alternate;
}
@keyframes urgent-pulse {
  from { opacity: 1; }
  to   { opacity: 0.6; }
}

/* ─── BUZZ AREA ──────────────────────────────────────────────────────────────── */
#quiz-buzz-area {
  display: flex;
  flex: 1;
  width: 100%;
  gap: 3px;
  padding: 0.5rem;
  min-height: 0;
}

.quiz-buzz-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 3px;
  border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.quiz-buzz-zone:active { transform: scale(0.96); }

.quiz-buzz-zone.p1 {
  border-color: rgba(245,166,35,0.3);
  background: rgba(245,166,35,0.04);
}
.quiz-buzz-zone.p2 {
  border-color: rgba(79,195,247,0.3);
  background: rgba(79,195,247,0.04);
}

.quiz-buzz-zone.buzzed.p1 {
  border-color: rgba(245,166,35,0.9);
  background: rgba(245,166,35,0.18);
  box-shadow: 0 0 30px rgba(245,166,35,0.25);
}
.quiz-buzz-zone.buzzed.p2 {
  border-color: rgba(79,195,247,0.9);
  background: rgba(79,195,247,0.18);
  box-shadow: 0 0 30px rgba(79,195,247,0.25);
}

.quiz-buzz-zone.disabled {
  opacity: 0.2;
  pointer-events: none;
}

.buzz-icon { font-size: 2.4rem; line-height: 1; }
.buzz-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
  font-family: 'DM Mono', monospace;
}
.quiz-buzz-zone.p1 .buzz-label { color: rgba(245,166,35,0.65); }
.quiz-buzz-zone.p2 .buzz-label { color: rgba(79,195,247,0.65); }

/* ─── ANSWER AREA ────────────────────────────────────────────────────────────── */
#quiz-answer-area {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  padding: 0.6rem 0.8rem;
  gap: 0.55rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#quiz-answerer-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-align: center;
  font-weight: 500;
}

#quiz-opts {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  gap: 0.4rem;
}

.quiz-opt-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  color: #fff;
  font-family: 'Anton', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, transform 0.08s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.quiz-opt-btn:active:not(:disabled) { transform: scale(0.97); }
.quiz-opt-btn:disabled { cursor: default; }

.quiz-opt-btn.correct {
  background: rgba(76,175,80,0.25);
  border-color: rgba(76,175,80,0.7);
  color: #a5d6a7;
}
.quiz-opt-btn.wrong {
  background: rgba(244,67,54,0.12);
  border-color: rgba(244,67,54,0.3);
  color: rgba(255,255,255,0.3);
}
.quiz-opt-btn.eliminated {
  opacity: 0.2;
  pointer-events: none;
  text-decoration: line-through;
}

.quiz-skip-btn {
  background: rgba(255,255,255,0.02);
  border-color: rgba(245,166,35,0.2);
  color: rgba(245,166,35,0.5);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-align: center;
}

/* ─── ROUND RESULT OVERLAY ────────────────────────────────────────────────────── */
#quiz-round-result {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 0.5rem;
  background: rgba(4,3,0,0.93);
  backdrop-filter: blur(2px);
}

/* Blurred member photo as bg */
#quiz-result-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0;
  filter: blur(14px) saturate(0.7);
  transform: scale(1.06);
  transition: opacity 0.25s ease-out;
}
#quiz-round-result[data-winner] #quiz-result-bg { opacity: 0.22; }

/* Player name — big, colored */
#quiz-result-player {
  font-size: clamp(2.2rem, 10vw, 3.8rem);
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--cream);
  position: relative;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}
#quiz-round-result[data-winner="0"] #quiz-result-player { color: var(--left); }
#quiz-round-result[data-winner="1"] #quiz-result-player { color: var(--right); }

/* Colored top bar when winner is set */
#quiz-round-result[data-winner="0"] { border-top: 4px solid var(--left); }
#quiz-round-result[data-winner="1"] { border-top: 4px solid var(--right); }

/* Main result text (score gain / status) */
#quiz-round-result-text {
  font-size: clamp(1.6rem, 6.5vw, 2.6rem);
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #fff;
  position: relative;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
#quiz-round-result[data-winner="0"] #quiz-round-result-text { color: var(--left); }
#quiz-round-result[data-winner="1"] #quiz-round-result-text { color: var(--right); }

/* Mini scoreboard */
#quiz-result-scoreboard {
  display: none;
  align-items: center;
  gap: 1.2rem;
  margin-top: 0.8rem;
  position: relative;
}
#quiz-round-result[data-winner] #quiz-result-scoreboard { display: flex; }

.qrs-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 80px;
}
.qrs-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: rgba(255,243,208,0.4);
  text-transform: uppercase;
  white-space: nowrap;
}
.qrs-score {
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1;
  color: rgba(255,243,208,0.25);
  transition: color 0.15s ease-out;
}
.qrs-p1 .qrs-score { color: rgba(245,166,35,0.3); }
.qrs-p2 .qrs-score { color: rgba(79,195,247,0.3); }

/* Highlight the player who just scored */
#quiz-round-result[data-winner="0"] .qrs-p1 .qrs-score { color: var(--left);  font-size: clamp(2.6rem, 11vw, 3.8rem); }
#quiz-round-result[data-winner="1"] .qrs-p2 .qrs-score { color: var(--right); font-size: clamp(2.6rem, 11vw, 3.8rem); }
#quiz-round-result[data-winner="0"] .qrs-p1 .qrs-name { color: rgba(245,166,35,0.7); }
#quiz-round-result[data-winner="1"] .qrs-p2 .qrs-name { color: rgba(79,195,247,0.7); }

.qrs-sep {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.15);
}

/* Correct answer label */
#quiz-correct-answer {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: rgba(255,243,208,0.5);
  letter-spacing: 0.1em;
  position: relative;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  width: 100%;
  max-width: 340px;
}

/* ─── EMMY TOAST ─────────────────────────────────────────────────────────────── */
#quiz-emmy-toast {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-110%);
  z-index: 60;
  background: rgba(8,6,0,0.95);
  border: 1px solid rgba(245,166,35,0.45);
  border-radius: 0 0 10px 10px;
  padding: 0.45rem 1.1rem;
  text-align: center;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34,1.4,0.64,1);
  max-width: 92vw;
  border-top: none;
}
#quiz-emmy-toast.visible { transform: translateX(-50%) translateY(0); }
#quiz-emmy-toast-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 500;
}

/* ─── ROUND ANNOUNCEMENT ─────────────────────────────────────────────────────── */
#quiz-round-announce {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0,0,0,0.88);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 0.6rem;
  backdrop-filter: blur(6px);
}
#quiz-round-announce.visible { display: flex; }

#quiz-announce-icon { font-size: 4rem; line-height: 1; }
#quiz-announce-label {
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  letter-spacing: 0.06em;
  color: var(--gold);
  line-height: 1;
}
#quiz-announce-desc {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: rgba(255,200,100,0.65);
  line-height: 1.5;
  max-width: 300px;
}

/* ─── CATEGORY DRAFT ─────────────────────────────────────────────────────────── */
#quiz-cat-draft {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(0,0,0,0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 1rem;
  backdrop-filter: blur(4px);
}
#quiz-cat-draft.visible { display: flex; }

#quiz-cat-draft-leader {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 500;
}

#quiz-cat-draft-btn1,
#quiz-cat-draft-btn2 {
  width: 100%;
  max-width: 340px;
  padding: 1rem 1.2rem;
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(245,166,35,0.4);
  border-radius: 10px;
  color: #fff;
  font-family: 'Anton', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  touch-action: manipulation;
}
#quiz-cat-draft-btn1:active,
#quiz-cat-draft-btn2:active { transform: scale(0.96); background: rgba(245,166,35,0.12); }
.cat-btn--p1 { border-color: rgba(245,166,35,0.55); }
.cat-btn--p2 { border-color: rgba(79,195,247,0.55); }

/* ─── TRINKE FLASH ───────────────────────────────────────────────────────────── */
#quiz-trinke-flash {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(4,3,0,0.78);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#quiz-trinke-flash.visible { display: flex; }

#quiz-trinke-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.4rem 2.4rem 1.6rem;
  background: rgba(15,10,0,0.94);
  border: 2px solid var(--amber);
  border-radius: 1rem;
  box-shadow: 0 0 50px rgba(212,146,10,0.4), inset 0 0 30px rgba(212,146,10,0.06);
  animation: trinke-in 0.22s ease-out;
  text-align: center;
  max-width: 88vw;
}

#quiz-trinke-falsch {
  display: none;
  font-family: Anton, sans-serif;
  font-size: clamp(1.4rem, 6vw, 2rem);
  letter-spacing: 0.12em;
  color: #ff4444;
  text-shadow: 0 0 18px rgba(255,60,60,0.6);
  line-height: 1;
  margin-bottom: 0.1rem;
}
#quiz-trinke-flash[data-reason="wrong"] #quiz-trinke-falsch,
#quiz-trinke-flash[data-reason="timeout"] #quiz-trinke-falsch { display: block; }

#quiz-trinke-beer {
  font-size: 2.6rem;
  line-height: 1;
  animation: trinke-bounce 0.5s ease-out;
  margin-bottom: 0.2rem;
}

#quiz-trinke-name {
  font-family: Anton, sans-serif;
  font-size: clamp(2rem, 9vw, 3.2rem);
  letter-spacing: 0.06em;
  color: var(--amber-hi);
  line-height: 1;
}
#quiz-trinke-flash[data-drinker="0"] #quiz-trinke-name { color: var(--left); }
#quiz-trinke-flash[data-drinker="1"] #quiz-trinke-name { color: var(--right); }

#quiz-trinke-cmd {
  font-family: Anton, sans-serif;
  font-size: clamp(1.1rem, 4.5vw, 1.6rem);
  letter-spacing: 0.08em;
  color: var(--cream);
  margin-top: 0.15rem;
}

#quiz-trinke-quote {
  font-family: 'DM Mono', monospace;
  font-style: italic;
  font-size: clamp(0.65rem, 2.8vw, 0.85rem);
  color: rgba(212,146,10,0.65);
  margin-top: 0.45rem;
}

@keyframes trinke-in {
  from { transform: scale(0.82) translateY(14px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}
@keyframes trinke-bounce {
  0%   { transform: scale(1)   rotate(0);    }
  35%  { transform: scale(1.5) rotate(-10deg); }
  65%  { transform: scale(0.9) rotate(5deg);  }
  100% { transform: scale(1)   rotate(0);    }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
