/* ============================================================================
   TRIVIA CLASH: OMNI-ARENA — RESPONSIVE STYLESHEET
   Mobile First (320px) to Ultra-Wide 4K TV Displays
   ============================================================================ */

:root {
  --bg-deep: #050811;
  --bg-card: #0c1427;
  --bg-card-hover: #13203c;
  --border-subtle: #1e293b;
  --border-focus: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Kahoot-Style Signature Colors */
  --btn-red: #e11d48;
  --btn-red-glow: rgba(225, 29, 72, 0.4);
  --btn-blue: #0284c7;
  --btn-blue-glow: rgba(2, 132, 199, 0.4);
  --btn-yellow: #d97706;
  --btn-yellow-glow: rgba(217, 119, 6, 0.4);
  --btn-green: #059669;
  --btn-green-glow: rgba(5, 150, 105, 0.4);

  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-gold: #fbbf24;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.15), transparent),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.08), transparent);
}

/* ==================== TOP NAVIGATION BAR ==================== */
.top-nav {
  height: 60px;
  background: rgba(12, 20, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-badge .logo-bolt {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 8px var(--accent-cyan));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.lang-switch {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent-cyan);
  color: #000;
}

/* ==================== AUDIO MIXER & SOUND WAVES ==================== */
.audio-control-wrap {
  position: relative;
}

.audio-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-pill-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.audio-pill-btn.muted {
  opacity: 0.6;
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: none;
}

.audio-waves {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  padding-bottom: 1px;
}

.audio-wave-bar {
  width: 2.5px;
  height: 3px;
  background: var(--accent-cyan);
  border-radius: 1.5px;
  transition: height 0.12s ease;
}

.audio-waves.audio-playing .audio-wave-bar:nth-child(1) {
  animation: audioWaveBounce 0.65s ease-in-out infinite 0.05s;
}
.audio-waves.audio-playing .audio-wave-bar:nth-child(2) {
  animation: audioWaveBounce 0.65s ease-in-out infinite 0.2s;
}
.audio-waves.audio-playing .audio-wave-bar:nth-child(3) {
  animation: audioWaveBounce 0.65s ease-in-out infinite 0.1s;
}
.audio-waves.audio-playing .audio-wave-bar:nth-child(4) {
  animation: audioWaveBounce 0.65s ease-in-out infinite 0.28s;
}

@keyframes audioWaveBounce {
  0%, 100% { height: 3px; }
  50% { height: 13px; }
}

/* Audio Popover Card */
.audio-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: rgba(12, 20, 39, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 18px rgba(56, 189, 248, 0.2);
  z-index: 100;
  padding: 0.85rem;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.audio-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.audio-popover-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--accent-cyan);
}

.audio-slider-row {
  margin-bottom: 0.65rem;
}

.audio-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 0.25rem;
}

.audio-vol-txt {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.78rem;
}

.audio-range-slider {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  accent-color: var(--accent-cyan);
}

.audio-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  cursor: pointer;
}

.audio-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
}

.audio-popover-footer {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==================== 3-2-1 STARTING COUNTDOWN OVERLAY ==================== */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, rgba(12, 20, 39, 0.95), rgba(5, 8, 17, 0.98));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: countdownBackdrop 0.3s ease;
}

.countdown-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.countdown-ring-pulse {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 4px solid var(--accent-cyan);
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.5), inset 0 0 50px rgba(56, 189, 248, 0.3);
  animation: countdownPulseRing 1s infinite ease-out;
  pointer-events: none;
}

@keyframes countdownPulseRing {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.countdown-number {
  font-size: clamp(5rem, 16vw, 10rem);
  font-weight: 900;
  line-height: 1;
  font-family: var(--font-mono, sans-serif);
  background: linear-gradient(135deg, #38bdf8, #a855f7, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 35px rgba(56, 189, 248, 0.7));
  animation: countdownPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.countdown-label {
  margin-top: 1rem;
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.8);
}

@keyframes countdownPop {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes countdownBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==================== MAIN VIEW CONTAINER ==================== */
.main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
  flex: 1;
  flex-direction: column;
  animation: fadeIn 0.3s ease forwards;
}

.view-section.active,
#lobby-view.active,
#host-view.active,
#player-view.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== LOBBY & MATCHMAKER VIEW ==================== */
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 900px) {
  .lobby-grid {
    grid-template-columns: 1.1fr 1fr;
  }
}

.lobby-hero {
  text-align: center;
  padding: 1.5rem 1rem;
}

/* Hero Live Badge */
.hero-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #34d399; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Nickname Randomizer Button & Animation */
#btn-random-nickname.spinning #dice-icon {
  display: inline-block;
  animation: diceSpin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes diceSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}

.input-field.flash-glow {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6) !important;
  transition: all 0.2s ease;
}

.lobby-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 80%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.lobby-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-field, .select-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus, .select-field:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.select-field option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: none;
  border-radius: 12px;
  color: #000;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--text-muted);
}

/* Avatar Setup Selector */
.avatar-setup {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.avatar-preview-box {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
  flex-shrink: 0;
}

.avatar-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-modes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.avatar-btn-row {
  display: flex;
  gap: 0.5rem;
}

.emoji-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.35rem;
  max-height: 120px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}

.emoji-opt {
  font-size: 1.4rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: transform 0.15s;
}

.emoji-opt:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.1);
}

/* Active Rooms Directory List */
.room-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
}

.room-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s;
}

.room-card:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
}

.room-code-tag {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.room-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.room-meta-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.room-meta-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
}

/* ==================== TAGS SEARCH INPUT & ACTION BUTTONS ==================== */
.tags-search-input-row {
  display: flex !important;
  align-items: stretch !important;
  gap: 0.5rem !important;
  width: 100% !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.tags-search-input-wrapper {
  position: relative !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.tags-search-icon {
  position: absolute !important;
  left: 0.85rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 0.95rem !important;
  opacity: 0.6 !important;
  pointer-events: none !important;
  z-index: 2 !important;
  user-select: none !important;
  line-height: 1 !important;
}

.tags-search-input-row input.input-field,
.tags-search-input-row input.tags-search-field {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  padding: 0.75rem 1rem 0.75rem 2.45rem !important;
  font-size: 0.95rem !important;
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px !important;
  color: var(--text-main) !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
  box-sizing: border-box !important;
}

.tags-search-input-row input.input-field:focus,
.tags-search-input-row input.tags-search-field:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
  background: rgba(0, 0, 0, 0.65) !important;
}

.tags-search-input-row input.input-field::placeholder,
.tags-search-input-row input.tags-search-field::placeholder {
  color: var(--text-dim) !important;
  opacity: 0.75 !important;
  font-size: 0.88rem !important;
}

.tags-search-input-row button.btn-add-tag,
.tags-search-input-row button.btn-primary,
#btn-add-cfg-tag,
#btn-add-cfg-modal-tag {
  width: auto !important;
  flex: 0 0 auto !important;
  max-width: fit-content !important;
  white-space: nowrap !important;
  padding: 0.72rem 1.25rem !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  cursor: pointer !important;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3) !important;
  transition: all 0.2s ease !important;
}

.tags-search-input-row button.btn-add-tag:hover,
.tags-search-input-row button.btn-primary:hover,
#btn-add-cfg-tag:hover,
#btn-add-cfg-modal-tag:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.45) !important;
}

.tags-search-input-row button.btn-add-tag:active,
.tags-search-input-row button.btn-primary:active,
#btn-add-cfg-tag:active,
#btn-add-cfg-modal-tag:active {
  transform: translateY(0) !important;
}

@media (max-width: 480px) {
  .tags-search-input-row {
    gap: 0.4rem !important;
  }
  .tags-search-icon {
    left: 0.65rem !important;
    font-size: 0.85rem !important;
  }
  .tags-search-input-row input.input-field,
  .tags-search-input-row input.tags-search-field {
    font-size: 0.85rem !important;
    padding: 0.65rem 0.65rem 0.65rem 2rem !important;
  }
  .tags-search-input-row button.btn-add-tag,
  .tags-search-input-row button.btn-primary,
  #btn-add-cfg-tag,
  #btn-add-cfg-modal-tag {
    padding: 0.65rem 0.85rem !important;
    font-size: 0.82rem !important;
  }
}

/* Tag Chips */
.tag-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 160px;
  overflow-y: auto;
  padding: 0.35rem 0.15rem;
}

.selected-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
  padding-bottom: 0.3rem;
}

.tags-palette-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0.2rem 0 0.15rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 0.3rem;
}

/* Multi-Topic Categories Grid */
.topics-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.35rem 0.15rem;
}

.topic-badge-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  text-align: left;
}

.topic-badge-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.topic-badge-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.topic-badge-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  width: 100%;
}

.topic-badge-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
}

.topic-badge-btn.active .topic-badge-count {
  color: #7dd3fc;
}

.topic-btn-icon {
  font-size: 1.2rem;
  line-height: 1;
  margin-bottom: 0.1rem;
}

.topic-btn-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.topic-btn-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 0.1rem;
}

.topic-badge-btn.active .topic-btn-count {
  color: #7dd3fc;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-micro:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-micro.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}


.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tag-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--text-main);
  transform: translateY(-1px);
}

.tag-chip.active {
  background: var(--accent-cyan);
  color: #030712;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
  font-weight: 800;
}

.tag-chip.active:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
  color: #030712;
}

.tag-chip .chip-remove-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  margin-left: 0.15rem;
  opacity: 0.8;
  font-weight: 900;
}

.tag-chip.active:hover .chip-remove-icon {
  opacity: 1;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
}

/* ==================== BIG SCREEN TV / HOST VIEW ==================== */
#host-view {
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 80px);
}

.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.tv-room-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tv-code-badge {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 2.5vw, 2.2rem);
  font-weight: 900;
  background: rgba(56, 189, 248, 0.15);
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.3rem 1rem;
  border-radius: 12px;
  letter-spacing: 0.1em;
}

.tv-meta-info {
  display: flex;
  flex-direction: column;
}

.tv-q-counter {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--text-muted);
}

/* Big Circular SVG Timer */
.tv-timer-container {
  position: relative;
  width: clamp(80px, 12vw, 130px);
  height: clamp(80px, 12vw, 130px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 8;
}

.timer-progress-circle {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.tv-timer-num {
  position: absolute;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 900;
}

.timer-urgent {
  animation: pulseUrgent 0.5s infinite alternate;
}

.timer-urgent .timer-progress-circle {
  stroke: var(--btn-red) !important;
  filter: drop-shadow(0 0 12px var(--btn-red));
}

@keyframes pulseUrgent {
  from { transform: scale(1); }
  to { transform: scale(1.08); filter: drop-shadow(0 0 16px rgba(225, 29, 72, 0.8)); }
}

/* TV Question Card */
.tv-question-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: clamp(1rem, 3vw, 2.5rem);
  text-align: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.tv-question-text {
  font-size: clamp(1.3rem, 2.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.3;
  max-width: 1100px;
}

.tv-question-image-wrap {
  width: 100%;
  max-width: 700px;
  max-height: 380px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-question-image-wrap img, .tv-question-image-wrap svg {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}

/* TV Answer Display Grid */
.tv-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .tv-options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tv-opt-card {
  padding: clamp(1rem, 2.5vw, 1.8rem);
  border-radius: 16px;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tv-opt-card.opt-red { background: var(--btn-red); box-shadow: 0 6px 20px var(--btn-red-glow); }
.tv-opt-card.opt-blue { background: var(--btn-blue); box-shadow: 0 6px 20px var(--btn-blue-glow); }
.tv-opt-card.opt-yellow { background: var(--btn-yellow); box-shadow: 0 6px 20px var(--btn-yellow-glow); }
.tv-opt-card.opt-green { background: var(--btn-green); box-shadow: 0 6px 20px var(--btn-green-glow); }

.tv-opt-symbol {
  font-size: 1.8rem;
  line-height: 1;
}

.tv-opt-text {
  flex: 1;
}

/* Reveal State Highlights */
.tv-opt-card.is-correct {
  transform: scale(1.02);
  border: 3px solid #fff;
  box-shadow: 0 0 30px rgba(5, 150, 105, 0.8);
}

.tv-opt-card.is-wrong {
  opacity: 0.35;
  filter: grayscale(60%);
}

.vote-stat-pill {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 1rem;
  font-family: var(--font-mono);
}

/* TV Lobby Invitation Hub */
.tv-invitation-hub {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem auto;
  max-width: 720px;
  width: 100%;
  flex-wrap: wrap;
}

.tv-invite-card {
  flex: 1;
  min-width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.tv-invite-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.tv-big-code {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.1);
  border: 2px dashed rgba(56, 189, 248, 0.5);
  padding: 0.35rem 1.25rem;
  border-radius: 12px;
  margin: 0.25rem 0;
}

.tv-qr-card {
  border-color: rgba(56, 189, 248, 0.4);
}

.tv-qr-box {
  width: 140px;
  height: 140px;
  background: #0c1427;
  border: 2px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  overflow: hidden;
}

.tv-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  image-rendering: pixelated;
}

/* TV Footer & Player Response Progress */
.tv-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-subtle);
  gap: 1rem;
}

.tv-response-meter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 200px;
}

.tv-response-progress-wrap {
  width: 100%;
  max-width: 260px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-response-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tv-answered-counter {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* TV Lobby Joined Players Screen */
.tv-lobby-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  padding: 2rem 0;
}

.tv-player-badge {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tv-player-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(56, 189, 248, 0.1);
}

.tv-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tv-player-name {
  font-weight: 800;
  font-size: 1.05rem;
}

/* ==================== MOBILE PLAYER CONTROLLER VIEW ==================== */
#player-view {
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 75px);
  min-height: calc(100dvh - 75px);
}

.player-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.player-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
}

.player-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-mini-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.player-mini-score {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

/* ==================== ADVANCED MOBILE PLAYER CONTROLLER UX ==================== */
.player-phase-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}

.player-conn-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.player-room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.player-big-code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.player-status-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-align: center;
  margin-bottom: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.player-status-icon {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  display: inline-block;
  animation: floatIcon 2.4s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.player-status-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.3rem;
}

.player-status-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.player-capacity-bar-wrap {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}

.player-capacity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.player-capacity-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.player-capacity-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.player-roster-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.player-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.player-roster-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s;
}

.player-roster-badge.is-me {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
}

.player-roster-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.player-roster-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-tip-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  color: #fde68a;
  line-height: 1.35;
}

.badge-waiting {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.badge-ready {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.player-timer-meter {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.65rem;
}

.player-timer-clock {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.player-timer-clock.timer-urgent {
  color: #ef4444;
  animation: pulseUrgent 0.6s infinite;
}

.player-timer-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.player-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.player-timer-fill.timer-urgent {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.player-locked-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.65rem;
  animation: slideDown 0.25s ease;
}

.locked-pulse-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  animation: pulseIcon 1.5s infinite;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 14px var(--accent-cyan); }
}

.player-reveal-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-bottom: 0.65rem;
  text-align: center;
}

.spin-icon {
  display: inline-block;
  animation: spinIcon 2s linear infinite;
}

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

.player-standing-hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.player-standing-hero.podium-celebration {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(245, 158, 11, 0.4);
}

.player-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0f172a;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
  margin: 0.35rem 0;
}

.player-rank-badge.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; box-shadow: 0 0 24px rgba(251, 191, 36, 0.6); }
.player-rank-badge.rank-2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #000; box-shadow: 0 0 20px rgba(226, 232, 240, 0.5); }
.player-rank-badge.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; box-shadow: 0 0 20px rgba(217, 119, 6, 0.5); }
.player-rank-badge.rank-other { background: rgba(56, 189, 248, 0.2); color: var(--accent-cyan); border: 2px solid var(--accent-cyan); box-shadow: none; }

.player-scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.player-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
}

.player-score-row.is-me {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}

.player-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.25rem 0;
}

.player-banner {
  text-align: center;
  padding: 0.6rem;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
}

/* Player Device Bilingual Question Box */
.player-question-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.65rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: fadeIn 0.2s ease;
}

.player-question-text {
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.player-explanation-box {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
  color: #e0f2fe;
  line-height: 1.35;
  animation: fadeIn 0.2s ease;
}

/* 4 Big Mobile Touch Action Buttons */
.mobile-action-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.75rem;
  flex: 1;
  min-height: 300px;
  margin-bottom: 0.75rem;
}

.mobile-choice-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.35rem 0.5rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  position: relative;
  will-change: transform, box-shadow;
}

.pad-red {
  background: linear-gradient(145deg, #f43f5e, #e11d48);
  --btn-shadow: #9f1239;
  box-shadow: 0 8px 0 var(--btn-shadow), 0 12px 24px rgba(225, 29, 72, 0.35);
}

.pad-blue {
  background: linear-gradient(145deg, #0284c7, #0369a1);
  --btn-shadow: #075985;
  box-shadow: 0 8px 0 var(--btn-shadow), 0 12px 24px rgba(2, 132, 199, 0.35);
}

.pad-yellow {
  background: linear-gradient(145deg, #f59e0b, #d97706);
  --btn-shadow: #b45309;
  box-shadow: 0 8px 0 var(--btn-shadow), 0 12px 24px rgba(217, 119, 6, 0.35);
}

.pad-green {
  background: linear-gradient(145deg, #10b981, #059669);
  --btn-shadow: #047857;
  box-shadow: 0 8px 0 var(--btn-shadow), 0 12px 24px rgba(5, 150, 105, 0.35);
}

.mobile-choice-btn:active,
.mobile-choice-btn.pressed {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--btn-shadow), 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

.mobile-choice-btn.disabled {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(50%);
  transform: none;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}

.mobile-choice-btn.selected {
  outline: 4px solid #fff;
  transform: translateY(3px) scale(1.02);
  box-shadow: 0 5px 0 var(--btn-shadow), 0 0 32px #fff, 0 0 18px var(--accent-cyan) !important;
  animation: selectedLockPulse 1.2s infinite ease-in-out;
}

@keyframes selectedLockPulse {
  0%, 100% { outline-color: #fff; filter: brightness(1.1); }
  50% { outline-color: var(--accent-cyan); filter: brightness(1.25); }
}

.mobile-choice-btn.dimmed {
  opacity: 0.25 !important;
  filter: grayscale(70%) !important;
  transform: scale(0.96);
  box-shadow: none !important;
}

.mobile-choice-btn.pad-eliminated {
  opacity: 0.2 !important;
  filter: grayscale(100%) brightness(0.6) !important;
  transform: scale(0.94);
  pointer-events: none !important;
  cursor: not-allowed !important;
  position: relative;
  overflow: hidden;
  box-shadow: none !important;
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.25), rgba(0,0,0,0.25) 10px, transparent 10px, transparent 20px) !important;
}

.mobile-choice-btn.pad-eliminated::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 900;
  color: rgba(239, 68, 68, 0.85);
  text-shadow: 0 0 12px rgba(0,0,0,0.8);
  pointer-events: none;
}

.tv-opt-card.tv-opt-eliminated {
  opacity: 0.25 !important;
  filter: grayscale(90%) brightness(0.7) !important;
  text-decoration: line-through;
  transform: scale(0.97);
}

.mobile-choice-btn.pad-correct {
  border: 3px solid #fff !important;
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.95), 0 6px 0 #047857 !important;
  transform: translateY(2px) scale(1.03);
}

.mobile-choice-btn.pad-wrong {
  opacity: 0.3 !important;
  filter: grayscale(80%) !important;
  box-shadow: none !important;
}

/* Fullscreen Confetti Canvas */
.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.btn-symbol {
  font-size: 2.8rem;
  line-height: 1;
}

.btn-caption {
  font-size: 0.95rem;
  text-align: center;
  max-width: 90%;
  line-height: 1.2;
}

/* ==================== PODIUM & VICTORY VIEW ==================== */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem 1rem 1rem;
  min-height: 380px;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: clamp(100px, 22vw, 180px);
  animation: slideUpPodium 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpPodium {
  from { transform: translateY(120px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.podium-pillar {
  width: 100%;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.podium-1st .podium-pillar {
  height: 200px;
  background: linear-gradient(180deg, #f59e0b, #b45309);
  color: #fff;
  border-top: 3px solid #fde68a;
}

.podium-2nd .podium-pillar {
  height: 140px;
  background: linear-gradient(180deg, #94a3b8, #475569);
  color: #fff;
  border-top: 3px solid #cbd5e1;
}

.podium-3rd .podium-pillar {
  height: 100px;
  background: linear-gradient(180deg, #b45309, #78350f);
  color: #fff;
  border-top: 3px solid #fcd34d;
}

.podium-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: #000;
  margin-bottom: 0.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-crown {
  font-size: 2.2rem;
  margin-bottom: -10px;
  filter: drop-shadow(0 0 10px #fbbf24);
  animation: bounceCrown 1.5s infinite alternate ease-in-out;
}

@keyframes bounceCrown {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* ==================== CAMERA SNAPSHOT MODAL ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  padding: 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7);
}

.camera-feed-box {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent-cyan);
  margin: 1.5rem auto;
  position: relative;
  background: #000;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

.camera-feed-box video, .camera-feed-box canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px var(--accent-cyan);
  background: rgba(0, 0, 0, 0.4);
}

/* ==================== ADMIN PANEL MODAL & TABS ==================== */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.admin-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
}

.dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: 14px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Guided Image Upload List */
.image-match-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.image-match-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.img-preview-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
  background: #000;
}

/* History Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.data-table th, .data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 700;
}

/* Notification Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(12, 20, 39, 0.95);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* ==================== COMPACT VERTICAL & MOBILE LANDSCAPE ==================== */
@media (max-height: 520px), (orientation: landscape) and (max-height: 600px) {
  #player-view {
    min-height: calc(100vh - 55px);
    min-height: calc(100dvh - 55px);
    justify-content: flex-start;
    gap: 0.35rem;
  }
  .player-status-bar {
    padding: 0.35rem 0.75rem;
  }
  .player-mini-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }
  .player-mini-name {
    font-size: 0.9rem;
  }
  .player-banner {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
  }
  .player-question-box {
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.35rem;
  }
  .player-question-text {
    font-size: 0.85rem;
    line-height: 1.25;
  }
  .player-explanation-box {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
  }
  .mobile-action-pad {
    min-height: 170px;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
  }
  .mobile-choice-btn {
    padding: 0.4rem;
    border-radius: 10px;
    gap: 0.2rem;
  }
  .btn-symbol {
    font-size: 1.6rem;
  }
  .btn-caption {
    font-size: 0.78rem;
    line-height: 1.1;
  }
}

/* ============================================================
   SUDDEN DEATH (MUERTE SÚBITA) TIEBREAKER STYLES
   ============================================================ */
.sudden-death-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.25) 0%, rgba(245, 158, 11, 0.25) 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
  animation: pulse-border 1.5s infinite alternate ease-in-out;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.4);
    border-color: #e11d48;
  }
  100% {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.7);
    border-color: #f59e0b;
  }
}

.sd-icon {
  font-size: 1.8rem;
  animation: sd-bounce 1.2s infinite ease-in-out;
}

@keyframes sd-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.sd-content {
  flex: 1;
}

.sd-title {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: #fef08a;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  text-transform: uppercase;
}

.sd-desc {
  font-size: 0.85rem;
  color: #fed7aa;
  margin-top: 0.15rem;
}

/* ============================================================
   DUAL SCOREBOARDS: ROUND WINNERS & ROOM CUMULATIVE
   ============================================================ */
.scoreboard-tabs-bar {
  display: flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.35rem;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.scoreboard-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.scoreboard-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.scoreboard-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #04101e;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

.scoreboard-spotlight-card {
  width: 100%;
  max-width: 720px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid var(--accent-cyan);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: spotlight-glow 2s infinite alternate ease-in-out;
}

@keyframes spotlight-glow {
  0% { box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2); }
  100% { box-shadow: 0 8px 28px rgba(56, 189, 248, 0.45); }
}

.player-scoreboard-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.25rem;
  gap: 0.35rem;
  margin-top: 0.75rem;
  width: 100%;
}

.player-tab-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-tab-pill.active {
  background: var(--accent-cyan);
  color: #04101e;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.round-pts-highlight {
  font-family: var(--font-mono);
  font-weight: 900;
  color: #10b981;
}

.round-speed-tag {
  font-size: 0.78rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-family: var(--font-mono);
}

/* ============================================================
   QUESTION POOL & 5-QUESTION RESERVE MARGIN INDICATOR
   ============================================================ */
.pool-quantity-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.75) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.pool-quantity-card.pool-warning {
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(135deg, rgba(40, 10, 15, 0.9) 0%, rgba(30, 15, 20, 0.85) 100%);
}

.pool-quantity-card.pool-optimal {
  border-color: rgba(16, 185, 129, 0.5);
}

.pool-quantity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pool-quantity-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.pool-count-num {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent-cyan);
}

.pool-max-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  color: var(--text-muted);
}

.pool-max-badge strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #10b981;
}

.pool-margin-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.pool-status-message {
  font-size: 0.8rem;
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.4;
}

.pool-status-message.msg-error {
  color: #ef4444;
}

.pool-status-message.msg-success {
  color: #10b981;
}

/* ==================== AI PROMPT GENERATOR STYLING ==================== */
.prompt-preview-container {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.prompt-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 0.85rem;
}

.prompt-meta-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.prompt-preview-code {
  margin: 0;
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #cbd5e1;
  max-height: 290px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.48;
  background: transparent;
}

.prompt-preview-code::-webkit-scrollbar {
  width: 6px;
}

.prompt-preview-code::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.prompt-preview-code::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

/* ==================== ROUND CONFIGURATION MODAL & TOPIC CHIPS ==================== */
.topic-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.25rem 0.1rem;
}

.topic-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  user-select: none;
}

.topic-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-main);
  transform: translateY(-1px);
}

.topic-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.topic-chip-icon {
  font-size: 1rem;
  line-height: 1;
}

.topic-chip-name {
  line-height: 1.2;
}

.topic-chip-check {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 900;
}

/* ============================================================
   MODERN GAME MECHANICS: POWER-UPS, STREAKS & FINAL SHOWDOWN
   ============================================================ */

/* Tactical Power-Ups Bar */
.player-powerups-bar {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
  backdrop-filter: blur(8px);
}

.powerups-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.powerups-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.powerup-active-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid #fbbf24;
  border-radius: 9999px;
  padding: 0.1rem 0.5rem;
  animation: pulseGold 1.2s infinite;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 0 10px 2px rgba(251, 191, 36, 0.7); }
}

.powerups-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.powerup-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  padding: 0.45rem 0.3rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  position: relative;
  transition: all 0.18s ease;
  user-select: none;
}

.powerup-btn:hover:not(.used):not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.powerup-btn:active:not(.used):not(:disabled) {
  transform: scale(0.96);
}

.powerup-btn.active {
  background: rgba(56, 189, 248, 0.28) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  transform: scale(1.02);
}

.powerup-btn.used {
  opacity: 0.35;
  filter: grayscale(85%);
  cursor: not-allowed;
  pointer-events: none;
  border-style: dashed;
}

.powerup-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-cyan);
  color: #050b14;
  font-size: 0.62rem;
  font-weight: 900;
  width: 15px;
  height: 15px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.powerup-btn.used .powerup-badge {
  background: #64748b;
  color: #cbd5e1;
}

/* Final Question Showdown Banner */
.final-q-banner {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.45), rgba(234, 179, 8, 0.25));
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  color: #fef08a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-align: center;
  animation: finalQFlash 2s infinite ease-in-out;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
}

@keyframes finalQFlash {
  0%, 100% { border-color: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
  50% { border-color: #fbbf24; box-shadow: 0 0 24px rgba(251, 191, 36, 0.65); }
}

.fq-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px #f59e0b);
}

.fq-title {
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.fq-desc {
  font-size: 0.76rem;
  color: #fef08a;
  font-weight: 600;
}

/* Player Choice Vote Stat Pill */
.player-stat-pill {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  padding: 0.1rem 0.5rem;
  margin-top: 0.25rem;
}

/* Scoreboard Rank Delta Badges */
.rank-delta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  margin-left: 0.4rem;
}

.rank-delta-up {
  color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.rank-delta-down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.rank-delta-same {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Flame & On-Fire Animations */
.streak-on-fire {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #f97316 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.6);
  animation: flamePulse 1s infinite alternate;
}

@keyframes flamePulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.04); filter: brightness(1.25) drop-shadow(0 0 6px #f97316); }
}

/* Low-Time Urgency Alert */
.timer-urgent {
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  animation: urgencyHeartbeat 0.55s infinite ease-in-out !important;
}

@keyframes urgencyHeartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8)); }
}

/* ==================== ROUND STEPPER (JACKBOX STYLE) ==================== */
.round-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  backdrop-filter: blur(8px);
}

.round-stepper.player-stepper {
  padding: 0.15rem 0.45rem;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
}

.stepper-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.3);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.round-stepper.player-stepper .stepper-dot {
  width: 7px;
  height: 7px;
}

.stepper-dot.completed {
  background: var(--accent-cyan, #38bdf8);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.stepper-dot.active {
  background: #fff;
  transform: scale(1.35);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 18px var(--accent-cyan, #38bdf8);
  animation: pulse-dot 1.4s infinite alternate;
}

@keyframes pulse-dot {
  0% { transform: scale(1.2); box-shadow: 0 0 6px #fff; }
  100% { transform: scale(1.45); box-shadow: 0 0 14px var(--accent-cyan, #38bdf8); }
}

.stepper-dot.final {
  border: 1.5px solid #fbbf24;
}

.stepper-dot.final.active {
  background: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.9), 0 0 20px #f59e0b;
  animation: pulse-gold 1.2s infinite alternate;
}

@keyframes pulse-gold {
  0% { transform: scale(1.25); box-shadow: 0 0 8px #fbbf24; }
  100% { transform: scale(1.5); box-shadow: 0 0 16px #f59e0b; }
}

/* ==================== EXPLANATION COUNTDOWN PROGRESS ==================== */
.explanation-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.explanation-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 9999px;
  transition: width 0.08s linear;
}

/* ==================== DESKTOP KEY HINT PILLS ==================== */
.btn-symbol-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.key-hint-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.45rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.03em;
  pointer-events: none;
}

.mobile-choice-btn .key-hint-pill {
  position: absolute;
  top: -6px;
  right: 12px;
}

.key-hint-pill-micro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 800;
  color: #bae6fd;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  margin-left: 0.3rem;
}

@media (pointer: coarse) and (hover: none) {
  /* On touch-only devices without physical keyboards, hide desktop key hints */
  .desktop-only {
    display: none !important;
  }
}

/* ==================== SPEED BONUS FLOATING BADGE ==================== */
.speed-bonus-badge {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
  color: #fff;
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  font-weight: 900;
  padding: 0.6rem 1.4rem;
  border-radius: 9999px;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.7), 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 2px solid #6ee7b7;
  pointer-events: none;
  z-index: 100;
  animation: float-up-fade 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
}

.speed-bonus-badge.badge-double {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  border-color: #fde047;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.8), 0 8px 24px rgba(0, 0, 0, 0.4);
}

@keyframes float-up-fade {
  0% {
    opacity: 0;
    transform: translate(-50%, 15px) scale(0.85);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1.08);
  }
  35% {
    transform: translate(-50%, -15px) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -35px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -55px) scale(0.9);
  }
}

/* ==================== POINTS BEHIND LEADER PILL ==================== */
.points-behind-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 9999px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  white-space: nowrap;
}

/* ==================== TV HOST KEYBOARD SHORTCUTS LEGEND ==================== */
.tv-shortcuts-legend {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.shortcut-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.shortcut-item kbd {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  border-radius: 5px;
  padding: 0.08rem 0.4rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ==================== CONNECTION HEALTH & RECONNECTING PILL ==================== */
.player-conn-badge.reconnecting {
  border-color: rgba(245, 158, 11, 0.6) !important;
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

.player-conn-badge.reconnecting .conn-dot {
  background: #f59e0b !important;
  box-shadow: 0 0 8px #f59e0b !important;
}

/* ==================== POST-ANSWER REVEAL BREAKDOWN PILLS ==================== */
.reveal-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.reveal-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
}

.tv-big-code,
.player-big-code,
#tv-header-code-box {
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tv-big-code:hover,
.player-big-code:hover,
#tv-header-code-box:hover {
  transform: scale(1.03);
  filter: brightness(1.15);
}

