/* ==========================================================================
   ¡ZAS! - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
  /* Colors */
  --bg-primary: #0a0813;
  --bg-secondary: #05040a;
  
  --neon-blue: #00f0ff;
  --neon-magenta: #ff007f;
  --neon-green: #00ff66;
  --neon-orange: #ff7f00;
  --neon-yellow: #ffcc00;
  
  --shadow-blue: 0 0 20px rgba(0, 240, 255, 0.4);
  --shadow-magenta: 0 0 20px rgba(255, 0, 127, 0.4);
  --shadow-green: 0 0 20px rgba(0, 255, 102, 0.4);
  --shadow-orange: 0 0 20px rgba(255, 127, 0, 0.4);
  --shadow-yellow: 0 0 20px rgba(255, 204, 0, 0.4);
  
  --text-white: #ffffff;
  --text-dim: #b3b2c9;
  
  /* Fonts */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   BASE STYLES & BACKGROUNDS
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-white);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Animated radial neon background glow */
.glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(255, 0, 127, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  z-index: -2;
}

/* Glassmorphism utility */
.glass {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24px;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.glass-alert {
  background: rgba(255, 0, 127, 0.1);
  border: 1px solid rgba(255, 0, 127, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
}

/* Buttons */
.btn-primary {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--neon-magenta) 0%, #b30059 100%);
  color: var(--text-white);
  border: none;
  padding: 16px 36px;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--shadow-magenta);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  letter-spacing: 1px;
}

.btn-primary:active {
  transform: scale(0.95);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
}

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

.text-center {
  text-align: center;
}

.pulse {
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.02); filter: brightness(1.2); }
}

/* ==========================================================================
   TV SCREEN SPECIFIC INTERFACE
   ========================================================================== */

.tv-body {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3vw;
}

#game-container {
  width: 100%;
  height: 100%;
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.game-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Confetti Canvas — must be out-of-flow so it doesn't shift the flex layout */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

/* Activation Screen Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background-color: var(--bg-secondary);
}

.activation-card {
  padding: 50px;
  text-align: center;
  max-width: 600px;
  width: 90%;
  border-radius: 30px;
}

/* TV Pause overlay */
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 4, 10, 0.82);
  backdrop-filter: blur(6px);
  animation: fade-in 0.25s ease;
}
.pause-card {
  text-align: center;
  padding: 56px 72px;
  border-radius: 30px;
  border-color: rgba(255,255,255,0.12);
}
.pause-icon {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 18px;
  animation: pause-pulse 1.6s ease-in-out infinite alternate;
}
@keyframes pause-pulse {
  0%   { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 1;   transform: scale(1.05); }
}
.pause-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
  margin: 0 0 12px;
}
.pause-sub {
  font-size: 1.2rem;
  color: var(--text-dim);
  margin: 0;
}

.logo-title {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #fff 30%, var(--neon-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  text-shadow: 0 0 30px rgba(255, 0, 127, 0.4);
}

.subtitle {
  font-size: 1.5rem;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.note {
  font-size: 0.9rem;
  color: #6a6785;
  margin-top: 25px;
}

/* TV Lobby screen layout */
.lobby-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5vw;
  height: 100%;
  align-items: stretch;
}

.lobby-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 3vw;
  text-align: center;
}

.lobby-info h2 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0;
  color: var(--neon-blue);
  text-shadow: var(--shadow-blue);
}

.instruction {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 0;
  max-width: 30ch;
}

.connection-link {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 24px;
  border-radius: 50px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  margin-bottom: 0;
  letter-spacing: 0.5px;
}

.qr-container {
  background: white;
  padding: 16px;
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.25), 0 0 40px rgba(0, 240, 255, 0.18);
  margin-bottom: 0;
}

.qr-container img {
  width: 200px;
  height: 200px;
  display: block;
}

/* Room code: the hero number players type to join — make it loud */
.room-code-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 56px;
  border-radius: 24px;
  background: rgba(255, 204, 0, 0.07);
  border: 2px solid rgba(255, 204, 0, 0.4);
  box-shadow: 0 0 40px rgba(255, 204, 0, 0.15), inset 0 0 30px rgba(255, 204, 0, 0.05);
  min-width: 280px;
}

.room-code-wrapper > span {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.room-code-wrapper.locked {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.07) !important;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.15), inset 0 0 30px rgba(239, 68, 68, 0.05) !important;
}

.room-code-wrapper.locked::after {
  content: '🔒 SALA BLOQUEADA';
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ef4444;
  margin-top: 5px;
  animation: pulse 1.5s infinite ease-in-out;
}

.room-code {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 12px;
  /* nudge to optically center despite right letter-spacing */
  text-indent: 12px;
  color: var(--neon-yellow);
  text-shadow: 0 0 30px rgba(255, 204, 0, 0.7), 0 0 60px rgba(255, 204, 0, 0.3);
}

.lobby-players {
  display: flex;
  flex-direction: column;
  padding: 3vw;
}

.lobby-players h3 {
  font-size: 1.6rem;
  margin-bottom: 30px;
  color: var(--text-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  flex: 1;
  align-content: start;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 20px;
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.player-avatar {
  font-size: 3.5rem;
  margin-bottom: 10px;
  animation: float-avatar 3.5s ease-in-out infinite alternate;
  display: inline-block;
}

@keyframes float-avatar {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-10px) rotate(2deg); }
}

.room-code-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) scale(0.5);
  animation: char-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes char-bounce {
  0% { opacity: 0; transform: translateY(20px) scale(0.5); }
  70% { transform: translateY(-6px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.player-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.player-score {
  font-size: 1rem;
  color: var(--neon-blue);
}

.player-card.disconnected {
  opacity: 0.4;
  filter: grayscale(1);
}

.lobby-footer-msg {
  text-align: center;
  font-size: 1.1rem;
  color: var(--neon-magenta);
  margin-top: 20px;
}

@keyframes pop-in {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Round Intro Layout */
.round-intro-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  text-align: center;
  margin: auto;
  max-width: 1000px;
  min-height: 400px;
}

/* ---------- Category vote screen (TV) ---------- */
#screen-category-vote {
  display: flex;
  flex-direction: column;
  padding: 40px 60px;
  gap: 30px;
}
.vote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vote-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--neon-blue);
  text-shadow: var(--shadow-blue, 0 0 12px rgba(91, 108, 255, 0.6));
  margin: 0;
}
.vote-timer {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--neon-magenta);
  padding: 10px 24px;
  border-radius: 18px;
  border: 2px solid var(--neon-magenta);
  background: rgba(255, 0, 127, 0.12);
  min-width: 110px;
  text-align: center;
}
.vote-timer.danger { color: #ff3366; border-color: #ff3366; background: rgba(255, 51, 102, 0.18); }
.vote-timer small { font-size: 1.1rem; opacity: 0.7; margin-left: 4px; }

.vote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  flex: 1;
}
.vote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 36px 28px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: vote-card-entrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

#screen-category-vote .vote-card:nth-child(1) { animation-delay: 0.08s; }
#screen-category-vote .vote-card:nth-child(2) { animation-delay: 0.18s; }
#screen-category-vote .vote-card:nth-child(3) { animation-delay: 0.28s; }
#screen-category-vote .vote-card:nth-child(4) { animation-delay: 0.38s; }

@keyframes vote-card-entrance {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.vote-card.winner {
  opacity: 1;
  transform: scale(1.06);
  border-color: var(--neon-green, #00ff95);
  background: rgba(0, 255, 149, 0.12);
  box-shadow: 0 0 35px rgba(0, 255, 149, 0.45), inset 0 0 20px rgba(0, 255, 149, 0.2);
  animation: winner-pulse 1.2s infinite alternate ease-in-out;
}

@keyframes winner-pulse {
  0% { transform: scale(1.04); box-shadow: 0 0 25px rgba(0, 255, 149, 0.35); }
  100% { transform: scale(1.08); box-shadow: 0 0 45px rgba(0, 255, 149, 0.65); }
}

.vote-card.loser {
  opacity: 0.28;
  filter: grayscale(70%);
  transform: scale(0.97);
  animation: none;
  transition: opacity 0.5s, filter 0.5s, transform 0.5s;
}

.vote-card.tie-highlight {
  opacity: 1;
  border-color: var(--neon-yellow);
  background: rgba(255, 204, 0, 0.15);
  transition: all 0.3s ease;
  animation: tie-suspense 0.6s infinite alternate ease-in-out;
}

@keyframes tie-suspense {
  0%   { transform: scale(1.0);  box-shadow: 0 0 15px rgba(255, 204, 0, 0.3); }
  100% { transform: scale(1.04); box-shadow: 0 0 32px rgba(255, 204, 0, 0.7); }
}

.vote-card-name { z-index: 1; text-align: center; }
.vote-card-count {
  z-index: 1;
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0.75;
}
.vote-card.winner .vote-card-count {
  opacity: 1;
  font-size: 1.5rem;
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 149, 0.6);
}
.vote-card-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.02) 0%, rgba(0, 240, 255, 0.18) 100%);
  border-right: 2px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
  z-index: 0;
}
.vote-hint {
  text-align: center;
  font-size: 1.2rem;
  opacity: 0.7;
  margin: 0;
}

#round-intro-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--neon-magenta);
  text-shadow: var(--shadow-magenta);
  margin-bottom: 25px;
}

.separator {
  width: 100px;
  height: 4px;
  background: var(--neon-blue);
  border: none;
  border-radius: 2px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-blue);
}

.round-desc {
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--text-dim);
}

/* Question Layout */
.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 30px;
}

.category-badge {
  background: linear-gradient(135deg, var(--neon-blue) 0%, #006699 100%);
  padding: 10px 25px;
  border-radius: 50px;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: var(--shadow-blue);
}

.question-counter {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.65);
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

/* -------- Answer toast ("María respondió") -------- */
.answer-toast-stack {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.answer-toast {
  background: linear-gradient(135deg, rgba(0, 255, 149, 0.92), rgba(0, 200, 119, 0.92));
  color: #0a0a14;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 255, 149, 0.35);
  animation: toast-in 0.3s ease-out, toast-out 0.4s ease-in 1.6s forwards;
  display: flex;
  gap: 8px;
  align-items: center;
}
.answer-toast .toast-avatar { font-size: 1.3rem; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(-12px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(-8px) scale(0.96); } }

/* -------- Per-question result summary (on reveal screen) -------- */
.reveal-summary {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1rem;
}
.reveal-summary .summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 700;
  white-space: nowrap;
}
.reveal-summary .summary-pill strong { color: var(--neon-blue); }
.reveal-summary .summary-pill.good { background: rgba(0, 255, 149, 0.14); border-color: rgba(0, 255, 149, 0.35); }
.reveal-summary .summary-pill.bad  { background: rgba(255, 51, 102, 0.14); border-color: rgba(255, 51, 102, 0.35); }
.reveal-summary .summary-pill.fast { background: rgba(255, 215, 0, 0.14); border-color: rgba(255, 215, 0, 0.35); }

/* -------- End-game stats panel (right column) -------- */
.game-stats-panel {
  grid-area: awards;
  margin: 0;
  padding: 24px 30px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.game-stats-title {
  text-align: center;
  font-size: 1.8rem;
  letter-spacing: 4px;
  font-weight: 800;
  color: var(--neon-magenta);
  margin: 0 0 20px 0;
  flex-shrink: 0;
  text-shadow: 0 0 15px rgba(255, 0, 127, 0.35);
}
.game-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

/* Award cards — game-over superlatives */
.award-card {
  --award-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: 18px;
  background: rgba(15, 15, 23, 0.8);
  border: 2px solid var(--award-color);
  box-shadow: 0 0 20px color-mix(in srgb, var(--award-color) 30%, transparent),
              inset 0 0 12px color-mix(in srgb, var(--award-color) 10%, transparent);
  text-align: center;
  animation: award-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  overflow: hidden;
}
@keyframes award-pop {
  from { opacity: 0; transform: scale(0.7) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.award-card:nth-child(1) { animation-delay: 0.1s; }
.award-card:nth-child(2) { animation-delay: 0.2s; }
.award-card:nth-child(3) { animation-delay: 0.3s; }
.award-card:nth-child(4) { animation-delay: 0.4s; }
.award-card:nth-child(5) { animation-delay: 0.5s; }
.award-card:nth-child(6) { animation-delay: 0.6s; }
.award-emoji {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--award-color));
}
.award-title {
  font-size: 0.95rem;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--award-color);
  text-transform: uppercase;
  margin: 4px 0 2px;
}
.award-winner {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}
.award-winner small {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}

.game-over-actions {
  grid-area: actions;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
}
#play-again-btn {
  font-size: 1.8rem;
  padding: 18px 48px;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--neon-magenta), #ff3366);
  border: none;
  color: white;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(255, 0, 127, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
#play-again-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 16px 40px rgba(255, 0, 127, 0.65);
}
#play-again-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.timer-bar-container {
  flex: 1;
  height: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-bar {
  position: relative;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #009944 0%, var(--neon-green) 100%);
  box-shadow: var(--shadow-green);
  transition: width 0.1s linear, background-color 0.5s ease;
}

.timer-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 20px var(--neon-green);
  border-radius: 50%;
  transition: box-shadow 0.5s ease;
}

.timer-bar.timer-danger {
  background: linear-gradient(90deg, #990033 0%, var(--neon-magenta) 100%);
  box-shadow: var(--shadow-magenta);
  animation: timer-panic-pulse 0.4s infinite alternate ease-in-out;
}

.timer-bar.timer-danger::after {
  box-shadow: 0 0 10px #fff, 0 0 20px var(--neon-magenta);
}

@keyframes timer-panic-pulse {
  0% { filter: brightness(0.95); transform: scaleY(1); }
  100% { filter: brightness(1.3); transform: scaleY(1.15); }
}

.question-container {
  padding: 30px 45px;
  text-align: center;
  margin-bottom: 30px;
}

.question-container h1 {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Round 2 Bomb Visuals */
.bomb-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}

.bomb-carrier-banner {
  padding: 10px 30px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 15px;
  text-transform: uppercase;
}

.bomb-visual {
  position: relative;
  width: 160px;
  height: 160px;
}

.bomb-svg {
  width: 100%;
  height: 100%;
}

.bomb-timer-digits {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--neon-magenta);
  text-shadow: var(--shadow-magenta);
}

.bomb-timer-digits.danger-text {
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
  animation: pulse-glow 0.5s infinite alternate;
}

.pulse-spark {
  animation: spark-flicker 0.2s infinite alternate;
}

@keyframes spark-flicker {
  0% { transform: scale(1) translate(0px, 0px); opacity: 0.8; }
  100% { transform: scale(1.4) translate(-2px, 2px); opacity: 1; }
}

.explosion-splash {
  font-size: 5rem;
  font-weight: 800;
  color: var(--neon-magenta);
  text-shadow: var(--shadow-magenta);
}

.explosion-sub {
  font-size: 1.8rem;
  color: var(--text-white);
}

/* Options Cards Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  flex: 1;
  transition: opacity 0.35s ease, transform 0.35s 0.3s;
}

.options-grid.options-hidden {
  pointer-events: none;
}

.options-grid.options-hidden .option-card {
  opacity: 0;
  transform: translateY(35px) scale(0.92);
}

.option-card {
  display: flex;
  align-items: center;
  padding: 20px 30px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 1.6rem;
  font-weight: 600;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              border-color 0.3s, 
              opacity 0.45s ease, 
              box-shadow 0.3s,
              filter 0.3s;
}

.options-grid:not(.options-hidden) #option-0 { transition-delay: 0.05s; }
.options-grid:not(.options-hidden) #option-1 { transition-delay: 0.18s; }
.options-grid:not(.options-hidden) #option-2 { transition-delay: 0.31s; }
.options-grid:not(.options-hidden) #option-3 { transition-delay: 0.44s; }

.option-symbol {
  font-size: 2rem;
  font-weight: 800;
  margin-right: 25px;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-content {
  flex: 1;
}

.players-who-answered {
  display: flex;
  gap: 8px;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.player-answer-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Option theme assignments */
.opt-blue {
  background: linear-gradient(135deg, rgba(0, 70, 200, 0.45) 0%, rgba(0, 15, 60, 0.7) 100%);
  border-color: rgba(0, 240, 255, 0.3);
}
.opt-blue .option-symbol { background-color: var(--neon-blue); color: var(--bg-primary); }

.opt-orange {
  background: linear-gradient(135deg, rgba(200, 70, 0, 0.45) 0%, rgba(60, 15, 0, 0.7) 100%);
  border-color: rgba(255, 127, 0, 0.3);
}
.opt-orange .option-symbol { background-color: var(--neon-orange); color: var(--bg-primary); }

.opt-green {
  background: linear-gradient(135deg, rgba(0, 150, 60, 0.45) 0%, rgba(0, 40, 10, 0.7) 100%);
  border-color: rgba(0, 255, 102, 0.3);
}
.opt-green .option-symbol { background-color: var(--neon-green); color: var(--bg-primary); }

.opt-yellow {
  background: linear-gradient(135deg, rgba(180, 150, 0, 0.45) 0%, rgba(40, 30, 0, 0.7) 100%);
  border-color: rgba(255, 204, 0, 0.3);
}
.opt-yellow .option-symbol { background-color: var(--neon-yellow); color: var(--bg-primary); }

/* Selection Reveal states */
.option-card.correct {
  border-color: var(--neon-green) !important;
  box-shadow: var(--shadow-green) !important;
  transform: scale(1.03);
  animation: card-correct-pulse 1.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.option-card.wrong {
  border-color: var(--neon-magenta) !important;
  box-shadow: var(--shadow-magenta) !important;
  opacity: 0.6;
}

/* Applied to cards that one or more players actually picked AND were wrong */
.option-card.wrong-picked {
  border-color: #ff3366 !important;
  box-shadow: 0 0 28px rgba(255, 51, 102, 0.55) !important;
  animation: card-wrong-shake 0.55s ease-in-out;
  opacity: 0.85;
}

.option-card.dimmed {
  opacity: 0.25;
  filter: blur(1px);
}

@keyframes card-correct-pulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 rgba(0, 255, 149, 0); }
  35%  { transform: scale(1.08); box-shadow: 0 0 48px rgba(0, 255, 149, 0.7); }
  70%  { transform: scale(1.02); box-shadow: 0 0 22px rgba(0, 255, 149, 0.5); }
  100% { transform: scale(1.03); box-shadow: var(--shadow-green); }
}

@keyframes card-wrong-shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-14px) rotate(-1.5deg); }
  30%  { transform: translateX(12px) rotate(1.5deg); }
  45%  { transform: translateX(-9px) rotate(-1deg); }
  60%  { transform: translateX(7px) rotate(1deg); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* Active Status indicator bar */
.question-status {
  display: flex;
  align-items: center;
  padding: 15px 30px;
  margin-top: 30px;
  gap: 20px;
}

.status-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dim);
}

.player-indicators-row {
  display: flex;
  gap: 15px;
  flex: 1;
}

.player-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 15px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  border-color: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.ind-avatar {
  font-size: 1.4rem;
}

.answered-glow {
  background: rgba(0, 255, 102, 0.15) !important;
  border-color: var(--neon-green) !important;
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
}

/* Round 4 shootout timer metrics */
.shootout-indicator {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 15px !important;
  border-radius: 15px !important;
}

.shootout-bar-bg {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.shootout-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue) 0%, #0066cc 100%);
  width: 100%;
  transition: width 1s linear;
}

.shootout-bar-fill.critical-bar {
  background: linear-gradient(90deg, var(--neon-magenta) 0%, #cc0052 100%);
}

.shootout-percent {
  font-size: 0.9rem;
  font-weight: 800;
  min-width: 40px;
}

.time-boost-flash {
  animation: green-flash 0.5s ease-out;
}

.time-penalty-flash {
  animation: red-flash 0.5s ease-out;
}

@keyframes green-flash {
  0% { box-shadow: 0 0 0 0px var(--neon-green); }
  100% { box-shadow: 0 0 0 15px transparent; }
}

@keyframes red-flash {
  0% { box-shadow: 0 0 0 0px var(--neon-magenta); }
  100% { box-shadow: 0 0 0 15px transparent; }
}

/* Answer Reveal Screen Layout */
.reveal-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 25px;
}

.reveal-top {
  padding: 25px;
  text-align: center;
}

.reveal-correct-header {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--neon-blue);
  margin-bottom: 12px;
}

.correct-answer-show {
  font-size: 2.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.correct-symbol {
  color: var(--neon-green);
  text-shadow: var(--shadow-green);
}

.reveal-middle {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 25px;
  flex: 1;
}

.fun-fact-box {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fun-fact-box h4 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.fun-fact-box p {
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--text-white);
}

.players-reveal-results {
  padding: 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.players-reveal-results h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.players-reveal-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  overflow-y: auto;
}

.reveal-player-row {
  display: grid;
  grid-template-columns: 2.2rem 2.2rem 1.2fr 0.8fr 0.8fr 1fr;
  align-items: center;
  gap: 15px;
  padding: 12px 25px;
  border-radius: 16px;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}

.reveal-player-row.is-leader {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.row-rank {
  font-weight: 800;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.reveal-player-row.is-leader .row-rank {
  color: #ffd700;
}

.row-rank.has-crown::before {
  content: '👑';
  font-size: 1.15rem;
}

.row-rank.has-crown {
  font-size: 0 !important;
}

.row-avatar {
  font-size: 1.8rem;
  text-align: center;
}

.row-name {
  font-size: 1.2rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-col {
  display: flex;
  justify-content: center;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 800;
  width: 100%;
  text-align: center;
}

.res-correct { background-color: rgba(0, 255, 102, 0.15); color: var(--neon-green); border: 1px solid var(--neon-green); }
.res-wrong { background-color: rgba(255, 0, 127, 0.15); color: var(--neon-magenta); border: 1px solid var(--neon-magenta); }

.change-col {
  text-align: center;
}

.score-added { color: var(--neon-green); font-weight: 800; font-size: 1.15rem; }
.score-deducted { color: var(--neon-magenta); font-weight: 800; font-size: 1.15rem; }
.score-neutral { color: var(--text-dim); }

.score-col {
  text-align: right;
  font-weight: 800;
  color: #ffd166;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.steal-banner-alert {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  box-shadow: var(--shadow-magenta);
}

/* Scoreboard Layout */
.scoreboard-layout {
  display: flex;
  flex-direction: column;
  padding: 40px 60px;
  max-width: 900px;
  width: 100%;
  margin: auto;
}

.scoreboard-layout h1 {
  font-size: 2.5rem;
  text-align: center;
  color: var(--neon-magenta);
  text-shadow: var(--shadow-magenta);
  margin-bottom: 40px;
}

.scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.scoreboard-item {
  display: flex;
  align-items: center;
  padding: 15px 30px;
  border-radius: 18px;
  font-size: 1.5rem;
  font-weight: 800;
  animation: slide-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.scoreboard-item:nth-child(1) {
  border-color: rgba(255, 204, 0, 0.45);
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.15);
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.12) 0%, rgba(5, 4, 10, 0.7) 100%);
}
.scoreboard-item:nth-child(2) {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.1);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(5, 4, 10, 0.7) 100%);
}
.scoreboard-item:nth-child(3) {
  border-color: rgba(255, 127, 0, 0.3);
  box-shadow: 0 0 10px rgba(255, 127, 0, 0.08);
  background: linear-gradient(135deg, rgba(255, 127, 0, 0.06) 0%, rgba(5, 4, 10, 0.7) 100%);
}

.sb-rank {
  font-size: 2rem;
  color: var(--neon-blue);
  width: 50px;
  transition: font-size 0.3s, text-shadow 0.3s;
}

.scoreboard-item:nth-child(1) .sb-rank {
  color: var(--neon-yellow);
  font-size: 2.3rem;
  text-shadow: var(--shadow-yellow);
}
.scoreboard-item:nth-child(2) .sb-rank {
  color: var(--neon-blue);
  font-size: 2.1rem;
  text-shadow: var(--shadow-blue);
}
.scoreboard-item:nth-child(3) .sb-rank {
  color: var(--neon-orange);
  font-size: 1.9rem;
  text-shadow: var(--shadow-orange);
}

.sb-avatar {
  font-size: 2.2rem;
  margin-right: 20px;
}

.sb-name {
  flex: 1;
}

.sb-score {
  color: var(--neon-yellow);
}

@keyframes slide-in {
  0% { transform: translateX(-40px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Podium End of Game layout — 2-column grid, fits 100 vh */
#screen-game-over {
  overflow: hidden;
  height: 100%;
}

.podium-container {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "title   title"
    "podium  awards"
    "banner  actions";
  column-gap: 50px;
  row-gap: 28px;
  height: 100%;
  padding: 40px 60px;
  box-sizing: border-box;
  overflow: hidden;
  align-items: stretch;
}

.game-over-title {
  grid-area: title;
  font-size: 4rem;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
  margin: 0 0 10px 0;
  text-align: center;
  letter-spacing: 2px;
}

.podium-layout {
  grid-area: podium;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 32px;
  height: 480px;
  width: 100%;
  margin: 0;
  padding-bottom: 10px;
}

.podium-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 190px;
  opacity: 0;
}

#screen-game-over:not(.hidden) .spot-third {
  animation: podium-rise 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
  animation-delay: 0.5s;
}

#screen-game-over:not(.hidden) .spot-second {
  animation: podium-rise 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
  animation-delay: 1.0s;
}

#screen-game-over:not(.hidden) .spot-first {
  animation: podium-rise 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
  animation-delay: 1.5s;
}

@keyframes podium-rise {
  0% { transform: translateY(400px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.podium-block {
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  border: 2px solid rgba(255,255,255,0.12);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.35);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.spot-first .podium-block {
  height: 220px;
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.45), inset 0 0 20px rgba(255, 215, 0, 0.15);
}
.spot-second .podium-block {
  height: 150px;
  border-color: #e0e0e0;
  color: #e0e0e0;
  box-shadow: 0 0 25px rgba(224, 224, 224, 0.3), inset 0 0 15px rgba(224, 224, 224, 0.1);
}
.spot-third .podium-block {
  height: 100px;
  border-color: #cd7f32;
  color: #cd7f32;
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.25), inset 0 0 10px rgba(205, 127, 50, 0.08);
}

.podium-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  text-align: center;
}

.podium-avatar {
  font-size: 5.5rem;
  margin-bottom: 8px;
  position: relative;
}

.crown {
  font-size: 3rem;
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%) rotate(-10deg);
  animation: crown-float 2s infinite ease-in-out;
}

@keyframes crown-float {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-10deg); }
  50% { transform: translateX(-50%) translateY(-6px) rotate(5deg); }
}

.podium-name {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.podium-points {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.game-over-winner-banner {
  grid-area: banner;
  padding: 18px 36px;
  font-size: 1.8rem;
  font-weight: 800;
  border-radius: 50px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  align-self: center;
  background: rgba(255, 204, 0, 0.12);
  border: 2px solid var(--neon-yellow);
  box-shadow: var(--shadow-yellow);
  color: #fff;
  letter-spacing: 0.5px;
}

/* Confetti particles */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.confetti {
  position: absolute;
  top: -20px;
  border-radius: 4px;
  animation: fall linear forwards;
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}


/* ==========================================================================
   MOBILE CONTROLLER SPECIFIC INTERFACE
   ========================================================================== */

.controller-body {
  width: 100vw;
  height: 100dvh;
  /* The global `body { min-height: 100vh }` rule applies here too and, because
     min-height beats max-height, it was forcing the controller to the LARGE
     (URL-bar-hidden) viewport height — overflowing past the bottom whenever the
     address bar is visible. Drop that floor so `height: 100dvh` (which tracks the
     actually-visible area) governs. */
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  padding: 15px;
  padding-bottom: max(15px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.controller-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ctrl-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fade-in-ctrl 0.3s ease-out;
}

@keyframes fade-in-ctrl {
  0% { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* Join Card layout */
.join-card {
  padding: 25px;
  border-radius: 24px;
}

.logo-title-mini {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  background: linear-gradient(135deg, #fff 30%, var(--neon-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 5px;
}

.subtitle-mini {
  font-size: 1.1rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 25px;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
}

.input-group input {
  font-family: var(--font-family);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1.1rem;
  color: var(--text-white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  border-color: var(--neon-magenta);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.25);
}

/* Avatar selection */
.avatar-picker-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avatar-picker-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-item {
  font-size: 2.5rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.avatar-item.selected {
  background: rgba(255, 0, 127, 0.15);
  border-color: var(--neon-magenta);
  transform: scale(1.08);
  box-shadow: var(--shadow-magenta);
}

#screen-join {
  justify-content: flex-start;
  overflow-y: auto;
}

.full-width {
  width: 100%;
}

.error-text {
  color: #ff3366;
  font-size: 0.95rem;
  text-align: center;
  margin-top: 15px;
}

/* Controller Lobby View */
.ctrl-card {
  padding: 30px 20px;
  border-radius: 24px;
}

.ctrl-avatar-display {
  font-size: 5rem;
  margin-bottom: 15px;
}

.ctrl-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.room-indicator {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 25px;
}

.room-indicator span {
  font-weight: 800;
  color: var(--neon-yellow);
}

.status-msg {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.sub-status-msg {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 30px;
}

.host-controls-box {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 25px;
  margin-top: 10px;
}

.host-notice {
  font-size: 0.95rem;
  color: var(--neon-green);
  margin-bottom: 20px;
  font-weight: 600;
}

.wait-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--neon-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Gamepad interface */
.gamepad-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 10px;
}

.gamepad-banner {
  padding: 15px;
  text-align: center;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Player identity strip — big avatar + name at the top of the gamepad screen */
.player-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  flex-shrink: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(91, 108, 255, 0.18), rgba(255, 0, 127, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.player-identity-avatar {
  font-size: 2.4rem;
  line-height: 1;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.player-identity-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.player-identity-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-identity-score {
  font-size: 0.85rem;
  color: #ffd166;
  font-weight: 700;
}

.pause-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: var(--text-white);
  font-size: 1.3rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.pause-btn:active { transform: scale(0.93); }
.pause-btn-active {
  background: rgba(255, 204, 0, 0.18);
  border-color: var(--neon-yellow);
  color: var(--neon-yellow);
}

.gamepad-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  transition: background 0.2s;
}
.gamepad-timer-digit {
  font-weight: 800;
  font-size: 1.6rem;
  min-width: 64px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.gamepad-timer-digit small { font-size: 0.85rem; opacity: 0.7; }
.gamepad-timer-bar {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}
.gamepad-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #5b6cff, #ff007f);
  border-radius: 5px;
  transition: width 0.95s linear, background 0.2s;
}
.gamepad-timer.danger { background: rgba(255, 0, 60, 0.18); border-color: rgba(255, 0, 60, 0.4); }
.gamepad-timer.danger .gamepad-timer-fill { background: linear-gradient(90deg, #ff3366, #ff0033); }
.gamepad-timer.danger .gamepad-timer-digit { color: #ffb3c1; }

/* Category vote buttons on the phone */
.vote-buttons-phone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.vote-btn-phone {
  flex: 1;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f0f0f0;
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.vote-btn-phone:active { transform: scale(0.97); }
.vote-btn-phone.voted {
  background: rgba(91, 108, 255, 0.25);
  border-color: var(--neon-blue);
}
.vote-btn-phone:disabled { opacity: 0.4; cursor: not-allowed; }

.gamepad-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.gamepad-btn {
  border: none;
  border-radius: 20px;
  font-size: clamp(2rem, 9vw, 4rem);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s;
  min-height: 0;
}

.gamepad-btn:active {
  transform: scale(0.92);
}

.gamepad-btn:disabled {
  opacity: 0.3;
  filter: grayscale(0.5);
  transform: none;
}

.btn-blue {
  background: var(--neon-blue);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3), inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}
.btn-orange {
  background: var(--neon-orange);
  box-shadow: 0 4px 15px rgba(255, 127, 0, 0.3), inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}
.btn-green {
  background: var(--neon-green);
  box-shadow: 0 4px 15px rgba(0, 255, 102, 0.3), inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}
.btn-yellow {
  background: var(--neon-yellow);
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3), inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}

.btn-symbol {
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* Bomb carriers panic screen style (Red flashing glow) */
.bomb-active-body {
  animation: flash-red-bg 0.8s infinite alternate;
}

@keyframes flash-red-bg {
  0% { background-color: var(--bg-primary); }
  100% { background-color: #2b0010; }
}

.bomb-active-body .gamepad-banner {
  background-color: var(--neon-magenta);
  box-shadow: var(--shadow-magenta);
  color: white;
}

.bomb-card-pulse {
  animation: border-pulse-red 1s infinite alternate;
}

@keyframes border-pulse-red {
  0% { border-color: rgba(255, 0, 127, 0.2); box-shadow: 0 0 10px rgba(255, 0, 127, 0.1); }
  100% { border-color: var(--neon-magenta); box-shadow: var(--shadow-magenta); }
}

.giant-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

/* Rivals selection for Stealing / Passing Bomb */
.rivals-grid-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 350px;
  overflow-y: auto;
  padding: 5px;
}

.btn-rival {
  font-family: var(--font-family);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 15px 20px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.btn-rival:active {
  transform: scale(0.96);
}

.rival-avatar {
  font-size: 1.8rem;
}

.rival-name {
  flex: 1;
  text-align: left;
}

.btn-rival-bomb {
  border-color: rgba(255, 0, 127, 0.3);
}
.btn-rival-bomb:active {
  background-color: rgba(255, 0, 127, 0.15);
  border-color: var(--neon-magenta);
}

.btn-rival-steal {
  border-color: rgba(255, 204, 0, 0.3);
}
.btn-rival-steal:active {
  background-color: rgba(255, 204, 0, 0.15);
  border-color: var(--neon-yellow);
}

/* Bomb auto-pass countdown */
.bomb-pass-timer-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 6px;
}
.bomb-pass-countdown-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
}
.bomb-pass-countdown-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--neon-yellow);
  min-width: 1.5ch;
  text-align: center;
  text-shadow: 0 0 12px var(--neon-yellow);
}
.bomb-pass-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 2px;
}
.bomb-pass-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: var(--neon-yellow);
  transition: width 0.9s linear, background 0.3s;
}

.font-bold {
  font-weight: 800;
}
.text-yellow {
  color: var(--neon-yellow);
}
.danger-text {
  color: var(--neon-magenta);
}

/* Giant buzzer button option */
.buzzer-btn {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff007f 0%, #b3003b 80%, #66001d 100%);
  border: 8px solid #33000e;
  box-shadow: 0 15px 30px rgba(0,0,0,0.5), inset 0 6px 12px rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  transition: transform 0.1s, box-shadow 0.1s;
}

.buzzer-btn:active {
  transform: scale(0.94) translateY(4px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.6), inset 0 2px 5px rgba(0,0,0,0.6);
}

.buzzer-inner {
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
  letter-spacing: 2px;
  text-shadow: 0 -2px 4px rgba(0,0,0,0.5);
}

/* Connection Error Overlay styling */
#connection-error-overlay {
  background: rgba(5, 4, 10, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ==========================================================================
   ROUND THEMES (TV & CONTROLLER BACKGROUND SHIFTS)
   ========================================================================== */
body {
  transition: background-color 1s ease;
}

.tv-theme-round-0 { background-color: #0a0813; }
.tv-theme-round-1 { background-color: #1a030f; }
.tv-theme-round-2 { background-color: #021a0d; }
.tv-theme-round-3 { background-color: #1a0f02; }
.tv-theme-round-4 { background-color: #0f0224; }

.tv-theme-round-0 .glow-bg {
  background: 
    radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(179, 0, 255, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, #0a0813 0%, #05040a 100%);
  transition: background 1s ease;
}

.tv-theme-round-1 .glow-bg {
  background: 
    radial-gradient(circle at 15% 20%, rgba(255, 0, 127, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(255, 51, 51, 0.18) 0%, transparent 45%),
    linear-gradient(180deg, #1a030f 0%, #080004 100%);
  transition: background 1s ease;
}

.tv-theme-round-2 .glow-bg {
  background: 
    radial-gradient(circle at 20% 20%, rgba(0, 255, 102, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255, 204, 0, 0.18) 0%, transparent 45%),
    linear-gradient(180deg, #021a0d 0%, #000803 100%);
  transition: background 1s ease;
}

.tv-theme-round-3 .glow-bg {
  background: 
    radial-gradient(circle at 10% 25%, rgba(255, 127, 0, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 90% 75%, rgba(255, 0, 85, 0.18) 0%, transparent 45%),
    linear-gradient(180deg, #1a0f02 0%, #080300 100%);
  transition: background 1s ease;
}

.tv-theme-round-4 .glow-bg {
  background:
    radial-gradient(circle at 30% 20%, rgba(127, 0, 255, 0.22) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255, 0, 60, 0.2) 0%, transparent 50%),
    linear-gradient(180deg, #0f0224 0%, #04000b 100%);
  transition: background 1s ease;
}

.tv-theme-round-5 { background-color: #1a1400; }
.tv-theme-round-5 .glow-bg {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 204, 0, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255, 127, 0, 0.2) 0%, transparent 45%),
    linear-gradient(180deg, #1a1400 0%, #080500 100%);
  transition: background 1s ease;
}

/* ==========================================================================
   WAGER SCREEN STYLES (TV)
   ========================================================================== */
#screen-wager {
  display: flex;
  flex-direction: column;
  padding: 40px 60px;
  gap: 30px;
  height: 100%;
}

.wager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wager-header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
  margin: 0;
}

.wager-timer {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--neon-yellow);
  padding: 10px 24px;
  border-radius: 18px;
  border: 2px solid var(--neon-yellow);
  background: rgba(255, 204, 0, 0.1);
  min-width: 110px;
  text-align: center;
  box-shadow: var(--shadow-yellow);
  transition: all 0.3s ease;
}

.wager-timer.danger {
  color: var(--neon-magenta);
  border-color: var(--neon-magenta);
  background: rgba(255, 0, 127, 0.15);
  box-shadow: var(--shadow-magenta);
  animation: pulse-danger-tv 0.5s infinite alternate;
}

@keyframes pulse-danger-tv {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.wager-timer small {
  font-size: 1.1rem;
  opacity: 0.7;
  margin-left: 4px;
}

.wager-content-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
  text-align: center;
  gap: 25px;
  flex: 1;
}

.wager-category-badge {
  background: linear-gradient(135deg, #ffd700 0%, #b39700 100%);
  color: #05040a;
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: var(--shadow-yellow);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.wager-prompt-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 40%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.wager-prompt-desc {
  font-size: 1.35rem;
  color: var(--text-dim);
  max-width: 800px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.wager-players-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin-top: 20px;
}

.wager-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wager-player-avatar {
  font-size: 3.8rem;
  margin-bottom: 12px;
}

.wager-player-name {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.wager-player-state {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wager-player-state.status-betting {
  color: var(--neon-orange);
  background: rgba(255, 127, 0, 0.1);
  border: 1px solid rgba(255, 127, 0, 0.2);
  animation: text-pulse-orange 1s infinite alternate;
}

@keyframes text-pulse-orange {
  0% { opacity: 0.6; box-shadow: 0 0 5px rgba(255, 127, 0, 0.1); }
  100% { opacity: 1; box-shadow: 0 0 15px rgba(255, 127, 0, 0.3); }
}

.wager-player-state.status-ready {
  color: var(--neon-green);
  background: rgba(0, 255, 102, 0.1);
  border: 1px solid rgba(0, 255, 102, 0.3);
  text-shadow: var(--shadow-green);
}

.wager-card-ready {
  border-color: rgba(0, 255, 102, 0.45);
  box-shadow: 0 0 25px rgba(0, 255, 102, 0.25);
  transform: scale(1.06);
}

/* ==========================================================================
   WAGER SCREEN STYLES (CONTROLLER / MOBILE)
   ========================================================================== */
.wager-info {
  width: 100%;
  padding: 24px;
  margin-bottom: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
}

.wager-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.wager-category-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.wager-score-indicator {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-white);
}

.wager-score-indicator span {
  color: var(--neon-blue);
  font-weight: 800;
}

.wager-status-message {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-white);
  margin: 15px 0;
  min-height: 1.5em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.wager-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin-top: 10px;
}

.wager-option-btn {
  font-family: var(--font-family);
  border: none;
  border-radius: 20px;
  padding: 22px 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
  cursor: pointer;
}

.wager-option-btn:active {
  transform: scale(0.94);
}

.wager-option-btn:disabled {
  opacity: 0.2;
  filter: grayscale(0.7);
  transform: none;
  pointer-events: none;
}

#wager-btn-all {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--neon-yellow) 0%, #b39700 100%);
  box-shadow: 0 4px 20px rgba(255, 204, 0, 0.4), inset 0 -6px 0 rgba(0, 0, 0, 0.25);
  color: #05040a;
}

#wager-btn-all:active {
  transform: scale(0.96);
}

/* ==========================================================================
   GAMEPAD EFFECT ANIMATIONS & ALERTS (CONTROLLER)
   ========================================================================== */

/* Glassmorphism Refinements for Premium feel */
.glass {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Screen Shake Effect */
@keyframes shake-anim {
  0%, 100% { transform: translate3d(0, 0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate3d(-8px, 0, 0); }
  20%, 40%, 60%, 80% { transform: translate3d(8px, 0, 0); }
}

.shake-effect {
  animation: shake-anim 0.5s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Correct Answer Success Flash (Green) */
@keyframes green-success-glow {
  0% {
    background-color: rgba(0, 255, 102, 0.45);
    box-shadow: inset 0 0 60px rgba(0, 255, 102, 0.8);
  }
  100% {
    background-color: transparent;
    box-shadow: inset 0 0 0 rgba(0, 255, 102, 0);
  }
}

.success-flash {
  position: relative;
}

.success-flash::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  animation: green-success-glow 0.8s ease-out forwards;
}

/* Incorrect Answer Error Flash (Red) */
@keyframes red-error-glow {
  0% {
    background-color: rgba(255, 0, 127, 0.45);
    box-shadow: inset 0 0 60px rgba(255, 0, 127, 0.8);
  }
  100% {
    background-color: transparent;
    box-shadow: inset 0 0 0 rgba(255, 0, 127, 0);
  }
}

.error-flash {
  position: relative;
}

.error-flash::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  animation: red-error-glow 0.8s ease-out forwards;
}

/* ==========================================================================
   SPOTLIGHT VOTE SCREEN STYLES (TV)
   ========================================================================== */
#screen-spotlight-vote {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.spotlight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.spotlight-header h1 {
  font-size: 3rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-white);
  text-shadow: var(--shadow-magenta);
}

.spotlight-timer {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--neon-magenta);
  border-radius: 50%;
  width: 90px;
  height: 90px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: baseline;
  gap: 2px;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--neon-magenta);
  text-shadow: var(--shadow-magenta);
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.25), inset 0 0 15px rgba(255, 0, 127, 0.15);
  padding-top: 6px;
}

.spotlight-timer.danger {
  border-color: var(--neon-red, #ff3b30);
  color: var(--neon-red, #ff3b30);
  text-shadow: 0 0 10px rgba(255, 59, 48, 0.6);
  animation: pulse-border-red-spotlight 1s infinite alternate;
}

@keyframes pulse-border-red-spotlight {
  0% { box-shadow: 0 0 10px rgba(255, 59, 48, 0.4); }
  100% { box-shadow: 0 0 25px rgba(255, 59, 48, 0.8); }
}

.spotlight-content-layout {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
  justify-content: center;
}

.spotlight-category-badge {
  position: absolute;
  top: -15px;
  left: 40px;
  background: linear-gradient(135deg, var(--neon-magenta) 0%, #a3005b 100%);
  color: var(--text-white);
  padding: 10px 24px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.spotlight-main-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: center;
}

.spotlight-target-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 0, 127, 0.08);
  border: 2px solid var(--neon-magenta);
  box-shadow: 0 10px 30px rgba(255, 0, 127, 0.15);
}

.spotlight-target-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.spotlight-target-avatar-large {
  font-size: 6rem;
  margin: 10px 0;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
  animation: float-avatar 3s ease-in-out infinite alternate;
}

.spotlight-target-name-large {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 25px;
}

.spotlight-target-stake-container {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px 30px;
  border-radius: 20px;
}

.spotlight-target-stake-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.spotlight-target-stake-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
}

.spotlight-voters-panel {
  display: flex;
  flex-direction: column;
}

.spotlight-voters-panel h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-white);
  letter-spacing: 0.5px;
}

.spotlight-voters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.spotlight-status-card {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spotlight-player-avatar {
  font-size: 2rem;
  margin-right: 15px;
}

.spotlight-player-name {
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1;
  color: var(--text-white);
}

.spotlight-player-state {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
}

.spotlight-player-state.status-voting {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.spotlight-player-state.status-ready {
  background: rgba(0, 255, 102, 0.2);
  color: var(--neon-green);
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.2);
}

.spotlight-card-ready {
  border-color: var(--neon-green) !important;
  background: rgba(0, 255, 102, 0.05) !important;
  box-shadow: 0 4px 20px rgba(0, 255, 102, 0.15);
}

@keyframes float-avatar {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(3deg); }
}

/* ==========================================================================
   BOILING POINT SCREEN STYLES (TV)
   ========================================================================== */
.boiling-point-wrapper {
  margin-top: 30px;
  width: 100%;
}

.thermometers-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  width: 100%;
  flex-wrap: wrap;
}

.thermometer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 15px;
  border-radius: 20px;
  width: 130px;
  min-height: 280px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.thermometer-track-wrapper {
  height: 160px;
  width: 32px;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
}

.thermometer-track {
  width: 14px;
  height: 140px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.thermometer-fluid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: linear-gradient(to top, #ff007f 0%, #ff5e3a 100%);
  border-radius: 10px;
  transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 15px rgba(255, 94, 58, 0.6);
}

.thermometer-bulb {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #ff007f 0%, #a3005b 100%);
  border-radius: 50%;
  position: absolute;
  bottom: -12px;
  left: -9px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.6);
}

.thermometer-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.thermometer-bubbles::after {
  content: '';
  position: absolute;
  top: -20px;
  left: 3px;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  box-shadow: 5px 15px rgba(255,255,255,0.4), -2px 30px rgba(255,255,255,0.5), 3px 45px rgba(255,255,255,0.4);
  animation: boiling-bubble 1.5s infinite linear;
}

.thermometer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
}

.thermometer-avatar {
  font-size: 1.8rem;
  margin-bottom: 2px;
}

.thermometer-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 4px;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thermometer-status-wrapper {
  margin-bottom: 4px;
  min-height: 20px;
}

.thermometer-status {
  font-size: 0.9rem;
}

.thermometer-degrees {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: var(--shadow-yellow);
}

/* Boiled state (reaches 6 correct) */
.thermometer-card.boiled {
  border-color: var(--neon-yellow);
  background: rgba(255, 204, 0, 0.08);
  box-shadow: 0 0 25px rgba(255, 204, 0, 0.25);
  animation: shake-anim 0.3s ease-in-out infinite alternate;
}

.thermometer-card.boiled .thermometer-fluid {
  background: linear-gradient(to top, #ffd700 0%, #ff3b30 100%);
  box-shadow: 0 0 25px rgba(255, 59, 48, 0.8);
}

.thermometer-card.boiled .thermometer-bulb {
  background: linear-gradient(135deg, #ffd700 0%, #ff5e3a 100%);
  box-shadow: 0 0 20px rgba(255, 94, 58, 0.8);
}

@keyframes boiling-bubble {
  0% { transform: translateY(120px) scale(0.6); opacity: 0; }
  20% { opacity: 0.8; }
  80% { opacity: 0.8; }
  100% { transform: translateY(0px) scale(1.2); opacity: 0; }
}

/* Card Answered glow effect */
.thermometer-card.answered-glow {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   MULTIMEDIA QUESTION TYPES
   ========================================================================== */

#media-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

/* Image Reveal */
.reveal-image {
  max-height: 300px;
  max-width: 100%;
  width: auto;
  border-radius: 18px;
  object-fit: contain;
  filter: blur(30px) brightness(0.8);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

/* Audio Player Visual */
.audio-player-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 60px;
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 24px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.08);
}

.audio-wave {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
}

.audio-wave span {
  display: inline-block;
  width: 10px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--neon-blue), #0066aa);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  animation: audio-wave-bounce 1.1s ease-in-out infinite;
}

.audio-wave span:nth-child(1) { height: 18px; animation-delay: 0.0s; }
.audio-wave span:nth-child(2) { height: 38px; animation-delay: 0.15s; }
.audio-wave span:nth-child(3) { height: 56px; animation-delay: 0.30s; }
.audio-wave span:nth-child(4) { height: 38px; animation-delay: 0.45s; }
.audio-wave span:nth-child(5) { height: 18px; animation-delay: 0.60s; }

@keyframes audio-wave-bounce {
  0%, 100% { transform: scaleY(0.35); opacity: 0.6; }
  50%       { transform: scaleY(1);    opacity: 1; }
}

.audio-hint {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--neon-blue);
  text-transform: uppercase;
  opacity: 0.75;
}

/* ==========================================================================
   SIDE-BY-SIDE IMAGE REVEAL LAYOUT (TV)
   ========================================================================== */
#screen-question.has-image-side {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-template-rows: auto auto 1fr auto;
  gap: 25px;
  padding: 30px 50px;
  height: 100vh;
  box-sizing: border-box;
}

#screen-question.has-image-side .question-header {
  grid-column: span 2;
  grid-row: 1;
  margin-bottom: 5px;
}

#screen-question.has-image-side #media-container {
  grid-column: 1;
  grid-row: 2 / span 2;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  height: 100%;
}

#screen-question.has-image-side .reveal-image {
  max-height: 60vh;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

#screen-question.has-image-side .question-container {
  grid-column: 2;
  grid-row: 2;
  margin-bottom: 0;
  padding: 24px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen-question.has-image-side .question-container h1 {
  font-size: 2rem;
  line-height: 1.35;
}

#screen-question.has-image-side .options-grid {
  grid-column: 2;
  grid-row: 3;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

#screen-question.has-image-side .option-card {
  padding: 15px 20px;
  font-size: 1.35rem;
}

#screen-question.has-image-side .option-symbol {
  font-size: 1.6rem;
  margin-right: 15px;
  width: 35px;
  height: 35px;
  border-radius: 8px;
}

#screen-question.has-image-side .question-status {
  grid-column: span 2;
  grid-row: 4;
}

/* ==========================================================================
   PREMIUM MOBILE IMPROVEMENTS (SPOTLIGHT & WAGER)
   ========================================================================== */

/* Enhanced glass card styling with neon shadow and gradient borders */
#screen-spotlight-vote .wager-info,
#screen-wager .wager-info {
  background: rgba(15, 14, 28, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 
              inset 0 1px 0 rgba(255, 255, 255, 0.1),
              0 0 20px rgba(0, 240, 255, 0.05); /* Soft cyan aura */
  position: relative;
  overflow: hidden;
}

#screen-spotlight-vote .wager-info::before,
#screen-wager .wager-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-magenta), var(--neon-yellow));
}

/* Spotlight target Profile theatrical style */
.spotlight-target-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px 24px;
  margin-top: 12px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}

.spotlight-target-avatar {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
  padding: 10px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: spotlight-avatar-pulse 2s infinite alternate ease-in-out;
}

@keyframes spotlight-avatar-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
  }
}

.spotlight-target-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
}

/* Wager Score indicator style */
.wager-score-indicator {
  display: inline-block;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 30px;
  margin-top: 10px;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

/* Glowing option buttons for Wager & Spotlight */
.wager-option-btn {
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wager-option-btn:hover {
  transform: translateY(-2px);
}

.wager-option-btn:active {
  transform: translateY(2px) scale(0.96);
}

/* Spotlight Green "Sí" Button */
#spotlight-btn-right {
  background: linear-gradient(135deg, #00ff66 0%, #00993d 100%) !important;
  color: #05040a !important;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.25), 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Spotlight Orange "No" Button */
#spotlight-btn-wrong {
  background: linear-gradient(135deg, var(--neon-magenta) 0%, #99003c 100%) !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(255, 0, 119, 0.25), 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 100 pts Button */
#wager-btn-100 {
  background: linear-gradient(135deg, #00f0ff 0%, #008fa6 100%) !important;
  color: #05040a !important;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 250 pts Button */
#wager-btn-250 {
  background: linear-gradient(135deg, var(--neon-orange) 0%, #b35900 100%) !important;
  color: #05040a !important;
  box-shadow: 0 0 15px rgba(255, 127, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 500 pts Button */
#wager-btn-500 {
  background: linear-gradient(135deg, #00ff66 0%, #00993d 100%) !important;
  color: #05040a !important;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.2), 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Todo o Nada (pulsing glow) */
#wager-btn-all {
  background: linear-gradient(135deg, var(--neon-yellow) 0%, #ff5500 100%) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.35), 0 6px 15px rgba(0, 0, 0, 0.4);
  animation: wager-all-glow 1.5s infinite alternate ease-in-out;
}

@keyframes wager-all-glow {
  0% {
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.3);
  }
  100% {
    box-shadow: 0 0 25px rgba(255, 102, 0, 0.6), 0 6px 15px rgba(0, 0, 0, 0.4);
  }
}

/* ==========================================================================
   CONTROLLER PER-ROUND COLOUR THEMES
   ========================================================================== */

.ctrl-theme-round-0 .glow-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 240, 255, 0.15) 0%, transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(179, 0, 255, 0.15) 0%, transparent 55%),
    linear-gradient(180deg, #0a0813 0%, #05040a 100%);
}
.ctrl-theme-round-1 .glow-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 0, 127, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(255, 51, 51, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, #1a030f 0%, #080004 100%);
}
.ctrl-theme-round-2 .glow-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 255, 102, 0.18) 0%, transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(255, 204, 0, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, #021a0d 0%, #000803 100%);
}
.ctrl-theme-round-3 .glow-bg {
  background:
    radial-gradient(circle at 15% 25%, rgba(255, 127, 0, 0.2) 0%, transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(255, 0, 85, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, #1a0f02 0%, #080300 100%);
}
.ctrl-theme-round-4 .glow-bg {
  background:
    radial-gradient(circle at 30% 20%, rgba(127, 0, 255, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(255, 0, 60, 0.2) 0%, transparent 55%),
    linear-gradient(180deg, #0f0224 0%, #04000b 100%);
}
.ctrl-theme-round-5 .glow-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 204, 0, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(255, 127, 0, 0.2) 0%, transparent 55%),
    linear-gradient(180deg, #1a1400 0%, #080500 100%);
}

/* ==========================================================================
   RANK DISPLAY IN IDENTITY STRIP
   ========================================================================== */

.player-identity-rank {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 209, 102, 0.7);
  margin-left: 4px;
}

/* ==========================================================================
   EMOJI REACTION STRIP (CONTROLLER)
   ========================================================================== */

.emoji-strip {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 10px 0 4px;
}

.emoji-btn {
  font-size: 1.7rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.emoji-btn:active,
.emoji-btn.emoji-btn-sent {
  transform: scale(0.82);
  background: rgba(255, 255, 255, 0.14);
}

/* ==========================================================================
   EMOJI BURST (TV SCREEN)
   ========================================================================== */

.emoji-burst {
  position: fixed;
  font-size: 3rem;
  pointer-events: none;
  z-index: 9999;
  transform: translateX(-50%);
  animation: emoji-float 1.4s ease-out forwards;
}

@keyframes emoji-float {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(-80px) scale(1.3); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-140px) scale(0.8); }
}

/* ==========================================================================
   PORTRAIT ORIENTATION LOCK OVERLAY (CONTROLLER MOBILE)
   ========================================================================== */
#orientation-overlay {
  display: none;
}

@media (orientation: landscape) and (max-height: 550px) {
  #orientation-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 8, 19, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fade-in-ctrl 0.3s ease-out;
  }
  
  .orientation-box {
    max-width: 380px;
    border: 1px solid rgba(0, 240, 255, 0.25) !important;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.15) !important;
  }
  
  .orientation-icon {
    font-size: 4.5rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: rotatePhone 2.2s ease-in-out infinite;
  }
}

@keyframes rotatePhone {
  0%, 100% { transform: rotate(90deg); }
  50% { transform: rotate(0deg); }
}
