/* ==========================================================================
   QuizWager - Game Stylesheet (Kahoot-Inspired Multiplayer & Solo)
   ========================================================================== */

:root {
  --bg-dark: #0f0d23;
  --bg-gradient: radial-gradient(circle at 50% 10%, #291654 0%, #100e26 60%, #080614 100%);
  --panel-bg: rgba(22, 19, 48, 0.78);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(168, 85, 247, 0.6);

  /* Kahoot Theme Colors */
  --kahoot-red: #e21b3c;
  --kahoot-red-glow: rgba(226, 27, 60, 0.45);
  --kahoot-blue: #1368ce;
  --kahoot-blue-glow: rgba(19, 104, 206, 0.45);
  --kahoot-yellow: #d89e00;
  --kahoot-yellow-glow: rgba(216, 158, 0, 0.45);
  --kahoot-green: #26890c;
  --kahoot-green-glow: rgba(38, 137, 12, 0.45);
  --kahoot-purple: #7925c7;
  --kahoot-purple-glow: rgba(121, 37, 199, 0.45);

  --text-white: #ffffff;
  --text-muted: #b3b0d6;
  --text-dim: #7975a8;
  --gold: #f59e0b;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --trans-fast: 0.15s ease;
  --trans-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-white);
  font-family: var(--font-main);
  user-select: none;
  -webkit-user-select: none;
}

/* Confetti Canvas */
#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Floating Shapes Background */
.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.18;
}

.shape {
  position: absolute;
  animation: floatShape 20s infinite linear;
}

.shape-triangle {
  top: 15%;
  left: 8%;
  width: 0;
  height: 0;
  border-left: 45px solid transparent;
  border-right: 45px solid transparent;
  border-bottom: 75px solid var(--kahoot-red);
}

.shape-diamond {
  top: 65%;
  right: 12%;
  width: 60px;
  height: 60px;
  background: var(--kahoot-blue);
  transform: rotate(45deg);
}

.shape-circle {
  bottom: 12%;
  left: 15%;
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: var(--kahoot-yellow);
}

.shape-square {
  top: 25%;
  right: 20%;
  width: 65px;
  height: 65px;
  background: var(--kahoot-green);
  transform: rotate(20deg);
}

@keyframes floatShape {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-40px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

/* Glass Panel Utility */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.app-header {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.4rem;
  border-bottom: 1px solid var(--border-light);
  background: rgba(15, 13, 35, 0.7);
  backdrop-filter: blur(14px);
}

.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  transition: all var(--trans-fast);
}

.back-home-link:hover {
  color: #fff;
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.2);
  transform: translateX(-2px);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-badge {
  font-size: 1.1rem;
}

.logo-name {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.logo-accent {
  color: #c084fc;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-light);
  color: var(--text-white);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all var(--trans-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* ==========================================================================
   Viewport & Screens
   ========================================================================== */
.game-viewport {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.2rem;
  min-height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-screen {
  display: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-giant {
  width: 100%;
  padding: 1.1rem 1.8rem;
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.4);
  transition: transform var(--trans-fast), filter var(--trans-fast), box-shadow var(--trans-fast);
  text-decoration: none;
}

.btn-giant:active {
  transform: scale(0.98);
}

.btn-giant:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-kahoot-green {
  background: linear-gradient(135deg, var(--kahoot-green) 0%, #34a814 100%);
  box-shadow: 0 8px 25px var(--kahoot-green-glow);
}

.btn-kahoot-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  box-shadow: 0 8px 25px var(--kahoot-purple-glow);
}

.btn-kahoot-blue {
  background: linear-gradient(135deg, var(--kahoot-blue) 0%, #2579e3 100%);
  box-shadow: 0 8px 25px var(--kahoot-blue-glow);
}

.btn-outline-white {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: #fff;
}

/* ==========================================================================
   SCREEN 1: LOBBY TABS & CARDS
   ========================================================================== */
.lobby-card {
  padding: 2.2rem 1.8rem;
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
}

.lobby-title {
  font-size: clamp(2.4rem, 6.5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 0.5rem;
}

.highlight-purple {
  background: linear-gradient(135deg, #c084fc, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.lobby-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.5;
  margin-bottom: 1.6rem;
}

.lobby-desc strong {
  color: #fef08a;
}

/* Tabs */
.lobby-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.8rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.7rem 0.4rem;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--trans-fast);
}

.tab-btn.active {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.host-intro-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.4rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.host-intro-text strong {
  color: #c084fc;
}

.input-group {
  text-align: left;
  margin-bottom: 1.3rem;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.input-wrap input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 700;
  outline: none;
  transition: all var(--trans-fast);
}

.input-wrap input:focus {
  border-color: #c084fc;
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.3);
}

.error-banner {
  margin-top: 0.8rem;
  background: rgba(226, 27, 60, 0.2);
  border: 1px solid rgba(226, 27, 60, 0.5);
  color: #fca5a5;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
}

.error-banner.hidden {
  display: none;
}

.mode-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.mode-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  transition: all var(--trans-fast);
}

.mode-card.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: #c084fc;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}

.mode-icon {
  font-size: 1.4rem;
  color: #d8b4fe;
}

.mode-info h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.mode-info p {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.lobby-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-light);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}

/* ==========================================================================
   SCREEN 2: HOST ROOM LOBBY (PIN DISPLAY & CONNECTED PLAYERS)
   ========================================================================== */
.host-lobby-card {
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.pin-display-box {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #a855f7;
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.25);
}

.pin-title {
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: #d8b4fe;
  display: block;
  margin-bottom: 0.4rem;
}

.pin-number {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 10vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.7);
}

.pin-url {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.pin-url strong {
  color: #38bdf8;
}

.players-counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.players-count-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-muted);
}

.players-count-label strong {
  color: #4ade80;
}

.status-pulse-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
}

.players-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  min-height: 110px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.no-players-hint {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-style: italic;
}

.player-chip {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(59, 130, 246, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.6);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  animation: popPlayer 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popPlayer {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   SCREEN 3: PLAYER WAITING ON PHONE
   ========================================================================== */
.waiting-card {
  padding: 3rem 1.8rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.waiting-spinner {
  font-size: 3.2rem;
  color: #a855f7;
  margin-bottom: 1.4rem;
}

.waiting-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.8rem;
}

.player-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 1.2rem;
}

.waiting-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.waiting-sub strong {
  color: #fff;
  font-family: var(--font-mono);
}

/* ==========================================================================
   SCREEN 4: WAGER SELECTION
   ========================================================================== */
.wager-card {
  padding: 2.2rem 1.8rem;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.screen-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.step-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  color: #a855f7;
}

.q-counter {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.question-teaser {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.6rem;
}

.teaser-label {
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.teaser-cat {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.4rem;
}

.teaser-difficulty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.diff-badge {
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.diff-easy { background: rgba(38, 137, 12, 0.25); color: #4ade80; border: 1px solid #4ade80; }
.diff-medium { background: rgba(216, 158, 0, 0.25); color: #facc15; border: 1px solid #facc15; }
.diff-hard { background: rgba(226, 27, 60, 0.25); color: #f87171; border: 1px solid #f87171; }
.diff-expert { background: rgba(168, 85, 247, 0.25); color: #c084fc; border: 1px solid #c084fc; }

.wager-prompt {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.wager-subtext {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.8rem;
}

.wager-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.wager-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--trans-fast);
}

.wager-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.wager-btn.active {
  background: rgba(168, 85, 247, 0.25);
  border-color: #c084fc;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.35);
  transform: scale(1.02);
}

.w-chip {
  font-size: 0.75rem;
  font-weight: 700;
  color: #e9d5ff;
}

.w-points {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
}

.w-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.wager-locked-notice {
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.wager-locked-notice.hidden {
  display: none;
}

/* ==========================================================================
   SCREEN 5: QUESTION & KAHOOT 4-COLOR GRID
   ========================================================================== */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.hud-item {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.hud-label {
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 800;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
}

.text-gold {
  color: #fbbf24;
}

.hud-timer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.2);
  border: 3px solid #c084fc;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 900;
  color: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timer-circle.danger {
  border-color: #ef4444;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
  animation: pulseDanger 0.6s infinite alternate;
}

@keyframes pulseDanger {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.question-container {
  padding: 1.8rem;
  margin-bottom: 1.4rem;
  text-align: center;
}

.q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.q-cat-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
}

.streak-badge {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f97316;
  background: rgba(249, 115, 22, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.q-title {
  font-size: clamp(1.2rem, 3.2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.4;
  color: #ffffff;
}

/* 4-Color Kahoot Answers Grid */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ans-card {
  min-height: 105px;
  border: none;
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  color: #fff;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.4);
  transition: transform var(--trans-fast), filter var(--trans-fast), opacity var(--trans-fast);
}

.ans-card:active {
  transform: scale(0.97);
}

.ans-card:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.ans-shape {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  shrink: 0;
}

.ans-text {
  font-family: var(--font-main);
  font-size: clamp(0.95rem, 2.2vw, 1.18rem);
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
}

.ans-red {
  background: linear-gradient(135deg, var(--kahoot-red) 0%, #b91530 100%);
  box-shadow: 0 8px 20px var(--kahoot-red-glow);
}

.ans-blue {
  background: linear-gradient(135deg, var(--kahoot-blue) 0%, #0d51a6 100%);
  box-shadow: 0 8px 20px var(--kahoot-blue-glow);
}

.ans-yellow {
  background: linear-gradient(135deg, var(--kahoot-yellow) 0%, #b58300 100%);
  box-shadow: 0 8px 20px var(--kahoot-yellow-glow);
}

.ans-green {
  background: linear-gradient(135deg, var(--kahoot-green) 0%, #1c6609 100%);
  box-shadow: 0 8px 20px var(--kahoot-green-glow);
}

.ans-card.selected {
  outline: 4px solid #ffffff;
}

.ans-card.correct {
  animation: answerCorrectPulse 0.5s ease;
  filter: brightness(1.2);
}

.ans-card.wrong {
  opacity: 0.35;
  filter: grayscale(0.8);
}

.ans-card.disabled {
  pointer-events: none;
}

.answer-locked-banner {
  margin-top: 1rem;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  text-align: center;
}

.answer-locked-banner.hidden {
  display: none;
}

@keyframes answerCorrectPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   SCREEN 6: ANSWER RESULT & LEADERBOARD
   ========================================================================== */
.result-card {
  padding: 2.5rem 2rem;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.result-badge-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
}

.result-badge-icon.correct {
  background: var(--kahoot-green);
  box-shadow: 0 0 30px var(--kahoot-green-glow);
}

.result-badge-icon.wrong {
  background: var(--kahoot-red);
  box-shadow: 0 0 30px var(--kahoot-red-glow);
}

.result-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  margin-bottom: 0.4rem;
}

.result-points-callout {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 1.2rem;
}

.streak-callout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #fdba74;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.4rem;
}

.streak-callout.hidden {
  display: none;
}

.fact-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: left;
  margin-bottom: 1.6rem;
}

.fact-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #facc15;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.fact-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Leaderboard List */
.round-lb-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.6rem;
  text-align: left;
}

.round-lb-box.hidden {
  display: none;
}

.lb-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #facc15;
  margin-bottom: 0.8rem;
  letter-spacing: 0.5px;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
}

.lb-row.first-place {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fef08a;
}

.lb-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lb-rank {
  font-family: var(--font-mono);
  font-weight: 900;
  color: #a855f7;
}

.lb-score {
  font-family: var(--font-mono);
  color: #fff;
  font-weight: 800;
}

/* ==========================================================================
   SCREEN 7: GAME OVER
   ========================================================================== */
.gameover-card {
  padding: 2.5rem 2rem;
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
}

.podium-trophy {
  font-size: 4rem;
  color: #fbbf24;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 25px rgba(251, 191, 36, 0.5));
}

.gameover-title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.gameover-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.6rem;
}

.final-score-box {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.6rem;
}

.fs-label {
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 800;
  display: block;
  margin-bottom: 0.4rem;
}

.fs-number {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 7vw, 3.8rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 25px rgba(168, 85, 247, 0.6);
}

.high-score-banner {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  display: inline-block;
}

.high-score-banner.hidden {
  display: none;
}

.gameover-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.go-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.gos-icon {
  font-size: 1.25rem;
}

.text-green { color: #4ade80; }
.text-orange { color: #f97316; }

.gos-val {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.gos-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 700;
}

.gameover-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 600px) {
  .app-header {
    padding: 0.7rem 1rem;
  }

  .back-home-link span {
    display: none;
  }

  .game-viewport {
    padding: 0.8rem;
  }

  .lobby-card, .host-lobby-card, .wager-card, .result-card, .gameover-card {
    padding: 1.6rem 1.2rem;
  }

  .answers-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .ans-card {
    min-height: clamp(64px, 11vh, 84px);
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-md);
  }

  .ans-text {
    font-size: clamp(0.85rem, 3.2vw, 1.05rem);
    line-height: 1.25;
  }

  .ans-shape {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .hud-item {
    min-width: 90px;
    padding: 0.5rem 0.8rem;
  }

  .hud-value {
    font-size: 1.15rem;
  }

  .timer-circle {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .mode-select-grid {
    grid-template-columns: 1fr;
  }

  .pin-number {
    letter-spacing: 4px;
  }
}


/* ==========================================================================
   New Polished Vector Elements & Dual Wager System
   ========================================================================== */

/* 1. Header Logo Shapes Badge (Vector geometric shapes) */
.logo-shapes-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  margin-right: 6px;
  vertical-align: middle;
}

.ls-shape {
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}

.ls-red { color: var(--kahoot-red); }
.ls-blue { color: #38bdf8; }
.ls-yellow { color: #fbbf24; }
.ls-green { color: #4ade80; }

/* 2. Sleek Category Pills */
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cat-pill i {
  font-size: 0.88rem;
}

/* 3. Wager Host Display (Room Projector View - No wager buttons) */
.wager-host-display {
  padding: 1.2rem 0.5rem;
  text-align: center;
}

.wager-host-title {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  font-weight: 900;
  margin-bottom: 0.4rem;
  letter-spacing: -0.5px;
}

.wager-host-sub {
  color: var(--text-muted);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  margin-bottom: 1.6rem;
  line-height: 1.5;
}

.wager-status-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.6rem;
}

.ws-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ws-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.ws-count {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: #4ade80;
}

.wager-players-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  min-height: 48px;
  align-items: center;
}

.wager-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 700;
  transition: all var(--trans-fast);
}

.wager-chip.ready {
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: #4ade80;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.2);
}

.wager-chip.waiting {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.wc-icon {
  font-size: 0.95rem;
}

.wc-name {
  color: #fff;
  font-weight: 800;
}

.wc-status {
  font-size: 0.75rem;
  opacity: 0.85;
}

.waiting-players-hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.host-wager-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.auto-start-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* 4. Wager Player Input & Icon Enhancements */
.w-icon {
  font-size: 1.15rem;
  color: #c084fc;
  margin-bottom: 2px;
}

.wager-btn.active .w-icon {
  color: #fff;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
}

.rule-chip.win { color: #4ade80; }
.rule-chip.keep { color: #fbbf24; }

/* 5. Host Answer HUD during Question Screen */
.host-answer-hud {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.55rem 1.4rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.hah-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 800;
  letter-spacing: 0.8px;
}

.hah-counter {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #38bdf8;
}

/* 6. Player Wait Notice in Result Screen */
.player-next-wait {
  margin-top: 1.2rem;
  padding: 0.9rem;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  color: #c084fc;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Helper Colors */
.text-gold { color: #fbbf24 !important; }
.text-silver { color: #cbd5e1 !important; }
.text-bronze { color: #f97316 !important; }
.text-purple { color: #c084fc !important; }
.text-dim { color: #7975a8 !important; }

/* Ultra-Compact adjustments for very small phones */
@media (max-width: 440px) {
  .lobby-card, .host-lobby-card, .wager-card, .result-card, .gameover-card {
    padding: 1.2rem 0.9rem;
  }
  .ans-card {
    min-height: 62px;
    padding: 0.45rem 0.6rem;
  }
  .ans-shape {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }
  .wager-btn {
    padding: 0.65rem 0.4rem;
  }
  .w-points {
    font-size: 1.3rem;
  }
  .w-chip {
    font-size: 0.7rem;
  }
}
