/* ==========================================================================
   MAB QUIZ BATTLE - PLAYER INTERFACE STYLES (MOBILE-FIRST)
   ========================================================================== */

/* Player Screen Layout Container */
.player-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem 1.25rem;
}

.player-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  font-weight: 600;
}

.player-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* ==========================================================================
   1. LANDING & JOIN PAGE (index.html)
   ========================================================================== */
.hero-branding {
  text-align: center;
  margin: 2rem 0 2rem;
}

.hero-tagline {
  color: var(--accent-orange-bright);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.85rem;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: var(--radius-full);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 20%, #fdba74 60%, #86efac 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
}

.join-card {
  background: rgba(19, 27, 46, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(249, 115, 22, 0.12);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.pin-input-wrap {
  position: relative;
}

.pin-input {
  width: 100%;
  height: 64px;
  background: rgba(11, 15, 25, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.25em;
  transition: all 0.2s ease;
  outline: none;
}

.pin-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.45);
  background: rgba(11, 15, 25, 0.95);
}

.text-input {
  width: 100%;
  height: 54px;
  background: rgba(11, 15, 25, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0 1.25rem;
  outline: none;
  transition: all 0.2s ease;
}

.text-input:focus {
  border-color: var(--accent-green-bright);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.35);
}

/* Avatar Selection Row */
.avatar-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.6rem;
  padding: 0.5rem 0.25rem;
}

.avatar-chip {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.2s ease,
              border-color 0.2s ease;
  will-change: transform, box-shadow;
}

/* Interactive Hover: Scale up, illuminate, and intense vibrant glow */
.avatar-chip:hover {
  transform: translateY(-4px) scale(1.18);
  background: radial-gradient(circle at center, rgba(249, 115, 22, 0.3) 0%, rgba(255, 255, 255, 0.12) 100%);
  border-color: rgba(251, 146, 60, 0.85);
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.6),
              0 0 32px rgba(249, 115, 22, 0.35),
              0 8px 16px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* Interactive Press Feedback */
.avatar-chip:active {
  transform: translateY(-1px) scale(1.04);
  transition-duration: 0.1s;
}

/* Keyboard Focus Indicator */
.avatar-chip:focus-visible {
  border-color: var(--accent-orange-bright);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.5), 0 0 20px rgba(249, 115, 22, 0.7);
}

/* Selected State with Pop Animation and Glowing Aura */
.avatar-chip.active {
  border-color: #fb923c;
  background: radial-gradient(circle at 45% 40%, rgba(249, 115, 22, 0.42) 0%, rgba(234, 88, 12, 0.25) 75%, rgba(255, 255, 255, 0.12) 100%);
  z-index: 3;
  animation: avatarSelectPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             avatarActiveGlow 2.4s ease-in-out infinite alternate 0.38s;
}

/* Selected State on Hover */
.avatar-chip.active:hover {
  transform: translateY(-5px) scale(1.24);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.75),
              0 0 30px rgba(249, 115, 22, 0.95),
              0 0 45px rgba(249, 115, 22, 0.4),
              0 10px 22px rgba(0, 0, 0, 0.45);
}

/* Animated Checkmark Badge on Selected Avatar */
.avatar-chip.active::after {
  content: "✓";
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 17px;
  height: 17px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #0b0f19;
  font-size: 10px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0b0f19;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.85);
  animation: avatarBadgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
}

@keyframes avatarSelectPop {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.8);
  }
  45% {
    transform: translateY(-6px) scale(1.3);
    box-shadow: 0 0 28px rgba(249, 115, 22, 0.95), 0 0 45px rgba(249, 115, 22, 0.5);
  }
  75% {
    transform: translateY(-1px) scale(1.14);
  }
  100% {
    transform: translateY(-2px) scale(1.18);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.55),
                0 0 22px rgba(249, 115, 22, 0.8),
                inset 0 0 10px rgba(254, 215, 170, 0.35);
  }
}

@keyframes avatarActiveGlow {
  0% {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.5),
                0 0 20px rgba(249, 115, 22, 0.75),
                inset 0 0 8px rgba(254, 215, 170, 0.25);
  }
  100% {
    box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.75),
                0 0 30px rgba(249, 115, 22, 0.95),
                inset 0 0 14px rgba(254, 215, 170, 0.45);
  }
}

@keyframes avatarBadgePop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.3) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* ==========================================================================
   Taken Avatar & Subtle Shake Keyframe Animation
   ========================================================================== */

/* Subtle Shake Animation applied on attempt to select a taken avatar */
@keyframes avatarSubtleShake {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  15% {
    transform: translate3d(-5px, 0, 0) rotate(-4deg) scale(1.08);
  }
  30% {
    transform: translate3d(5px, 0, 0) rotate(4deg) scale(1.08);
  }
  45% {
    transform: translate3d(-4px, 0, 0) rotate(-2.5deg) scale(1.04);
  }
  60% {
    transform: translate3d(3px, 0, 0) rotate(2deg) scale(1.02);
  }
  75% {
    transform: translate3d(-2px, 0, 0) rotate(-1deg);
  }
  90% {
    transform: translate3d(1px, 0, 0) rotate(0.5deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

/* Backwards-compatible keyframe name alias */
@keyframes avatarShake {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  15% {
    transform: translate3d(-5px, 0, 0) rotate(-4deg) scale(1.08);
  }
  30% {
    transform: translate3d(5px, 0, 0) rotate(4deg) scale(1.08);
  }
  45% {
    transform: translate3d(-4px, 0, 0) rotate(-2.5deg) scale(1.04);
  }
  60% {
    transform: translate3d(3px, 0, 0) rotate(2deg) scale(1.02);
  }
  75% {
    transform: translate3d(-2px, 0, 0) rotate(-1deg);
  }
  90% {
    transform: translate3d(1px, 0, 0) rotate(0.5deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

/* Shake trigger on taken avatar selection */
.avatar-chip.shake,
.avatar-chip.avatar-shake,
.avatar-chip.avatar-taken-shake {
  animation: avatarSubtleShake 0.44s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  border-color: #ef4444 !important;
  background: radial-gradient(circle at center, rgba(239, 68, 68, 0.35) 0%, rgba(220, 38, 38, 0.15) 60%, rgba(255, 255, 255, 0.06) 100%) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.6),
              0 0 20px rgba(239, 68, 68, 0.8),
              0 4px 14px rgba(0, 0, 0, 0.45) !important;
  z-index: 10;
}

/* Taken Avatar State (When already chosen by another user in the session) */
.avatar-chip.is-taken,
.avatar-chip.taken {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  opacity: 0.55;
  filter: grayscale(35%);
  cursor: not-allowed;
}

.avatar-chip.is-taken:hover,
.avatar-chip.taken:hover {
  transform: translateY(-2px) scale(1.06);
  opacity: 0.85;
  filter: grayscale(0%);
  border-color: rgba(239, 68, 68, 0.75);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

.avatar-chip.is-taken::after,
.avatar-chip.taken::after {
  content: "🔒";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  font-size: 9px;
  background: #1e1b4b;
  border: 1.5px solid #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Lobby Avatar Customizer Bar in Waiting Room */
.lobby-avatar-bar {
  margin: 1.25rem 0 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.lobby-avatar-bar-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Footer Showcase Badges */
.landing-footer-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   2. WAITING LOBBY (waiting.html)
   ========================================================================== */
.lobby-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(19, 27, 46, 0.85);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.pin-display-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(11, 15, 25, 0.9);
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(249, 115, 22, 0.45);
  box-shadow: 0 4px 22px rgba(249, 115, 22, 0.25);
  margin: 1rem 0 1.5rem;
}

.pin-display-pill .pin-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-orange-bright);
}

.pin-display-pill .pin-number {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #ffffff;
}

.players-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-green-bright);
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green-bright);
  box-shadow: 0 0 12px var(--accent-green-bright);
  animation: pulseDot 1.5s infinite;
}

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

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.5rem;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  animation: playerEnter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes playerEnter {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.player-chip.is-you {
  border-color: var(--accent-green-bright);
  background: rgba(34, 197, 94, 0.16);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.3);
}

.waiting-pulse-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #c7d2fe;
  animation: pulseText 2s ease-in-out infinite;
  margin: 1.5rem 0 0.5rem;
}

@keyframes pulseText {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.host-controls-bar {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(79, 70, 229, 0.12);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}

/* ==========================================================================
   3. QUESTION & GAMEPLAY (game.html)
   ========================================================================== */
.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.question-counter {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-orange-bright);
}

.game-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  color: #86efac;
}

.floating-score-points {
  position: absolute;
  right: 0;
  top: -1.6rem;
  z-index: 4;
  color: #fef08a;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.75);
  pointer-events: none;
  animation: floatingScorePoints 1.3s ease-out forwards;
}

@keyframes floatingScorePoints {
  0% { opacity: 0; transform: translateY(10px) scale(0.7); }
  18% { opacity: 1; transform: translateY(0) scale(1.12); }
  100% { opacity: 0; transform: translateY(-42px) scale(1); }
}

.powerups-bar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.25rem 0 1rem;
}

.powerup-btn {
  min-width: 82px;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
  color: #e0f2fe;
  flex-direction: column;
  gap: 0.05rem;
}

.powerup-btn span {
  font-family: var(--font-display);
  font-weight: 900;
  color: #67e8f9;
}

.powerup-btn small {
  color: var(--text-muted);
  font-size: 0.62rem;
}

.powerup-btn:hover:not(:disabled) {
  border-color: #67e8f9;
  background: rgba(8, 145, 178, 0.22);
  transform: translateY(-2px);
}

.powerup-btn.powerup-used,
.powerup-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.5);
}

.answer-btn.powerup-removed {
  opacity: 0.2;
  filter: grayscale(1);
  transform: scale(0.97);
}

.streak-milestone {
  animation: streakMilestone 0.75s ease-out;
}

@keyframes streakMilestone {
  0% { transform: scale(1); }
  45% { transform: scale(1.18) rotate(-3deg); box-shadow: 0 0 22px rgba(251, 191, 36, 0.65); }
  100% { transform: scale(1); }
}

/* Visual Countdown Timer */
.countdown-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.5rem 0 1.25rem;
}

.timer-circle-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.timer-circle-progress {
  fill: none;
  stroke: var(--accent-green-bright);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s linear, stroke 0.3s ease;
}

.timer-number {
  position: absolute;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  color: #ffffff;
  transition: all 0.2s ease;
}

/* Timer Warning / Urgent States */
.timer-warning .timer-circle-progress {
  stroke: var(--accent-orange);
}
.timer-warning .timer-number {
  color: var(--accent-orange);
}

.timer-urgent .timer-circle-progress {
  stroke: var(--ans-a);
}
.timer-urgent .timer-number {
  color: var(--ans-a);
  animation: urgentBounce 0.5s infinite alternate;
}

@keyframes urgentBounce {
  from { transform: scale(1); }
  to { transform: scale(1.2); }
}

/* Question Content Card */
.question-card {
  background: rgba(19, 27, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
  text-align: center;
}

.clue-image-container {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  background: #0f172a;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clue-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.clue-image:hover {
  transform: scale(1.03);
}

.clue-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.question-text {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  padding: 0.5rem 0.25rem;
}

/* Answer Quadrant Grid */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

@media (max-width: 540px) {
  .answers-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 78px;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.answer-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.01);
}

.answer-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.answer-btn-a {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  border-color: rgba(239, 68, 68, 0.5);
}
.answer-btn-a:hover:not(:disabled) {
  box-shadow: 0 8px 24px var(--ans-a-glow);
}

.answer-btn-b {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  border-color: rgba(59, 130, 246, 0.5);
}
.answer-btn-b:hover:not(:disabled) {
  box-shadow: 0 8px 24px var(--ans-b-glow);
}

.answer-btn-c {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  border-color: rgba(249, 115, 22, 0.6);
}
.answer-btn-c:hover:not(:disabled) {
  box-shadow: 0 8px 24px var(--ans-c-glow);
}

.answer-btn-d {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  border-color: rgba(34, 197, 94, 0.6);
}
.answer-btn-d:hover:not(:disabled) {
  box-shadow: 0 8px 24px var(--ans-d-glow);
}

.answer-shape-badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.answer-btn-text {
  flex: 1;
  word-break: break-word;
}

/* Submitted State */
.answer-btn.selected-locked {
  border-color: #ffffff !important;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.02);
}

.answer-btn.dimmed {
  opacity: 0.35;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

.locked-feedback-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  color: #a7f3d0;
  font-weight: 700;
  margin-top: 0.5rem;
  animation: fadeIn 0.3s ease;
}

/* ==========================================================================
   4. ANSWER DISTRIBUTION (distribution.html)
   ========================================================================== */
.distribution-card {
  background: rgba(19, 27, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.result-status-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.result-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.result-status-correct {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.25);
}

.result-status-incorrect {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.result-status-timeout {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.5);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.25);
}

.result-question-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Distribution Bars */
.distribution-bars-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.dist-item {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.dist-item.is-correct-answer {
  border-color: var(--accent-green-bright);
  background: rgba(34, 197, 94, 0.14);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.25);
  animation: correctAnswerPulse 1.8s ease-in-out infinite;
}

.dist-item.is-correct-answer::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(74, 222, 128, 0.65);
  border-radius: inherit;
  animation: correctAnswerRing 1.8s ease-out infinite;
  pointer-events: none;
}

.correct-answer-pulse {
  position: absolute;
  left: var(--pulse-x);
  bottom: 0.55rem;
  z-index: 3;
  color: #86efac;
  font-size: 0.9rem;
  font-weight: 900;
  pointer-events: none;
  animation: correctAnswerFloat 1.7s ease-out var(--pulse-delay) both;
}

@keyframes correctAnswerPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(34, 197, 94, 0.25); }
  50% { box-shadow: 0 0 28px rgba(74, 222, 128, 0.48); }
}

@keyframes correctAnswerRing {
  0% { opacity: 0.8; transform: scale(0.98); }
  100% { opacity: 0; transform: scale(1.02); }
}

@keyframes correctAnswerFloat {
  0% { opacity: 0; transform: translateY(8px) scale(0.7) rotate(-8deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px) scale(1.1) rotate(8deg); }
}

.dist-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
  font-weight: 700;
}

.dist-option-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.dist-stats {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dist-bar-track {
  height: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.dist-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dist-bar-fill-a { background: linear-gradient(90deg, #dc2626, #ef4444); }
.dist-bar-fill-b { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.dist-bar-fill-c { background: linear-gradient(90deg, #ea580c, #f97316); }
.dist-bar-fill-d { background: linear-gradient(90deg, #16a34a, #22c55e); }

.explanation-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-green-bright);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Live Answer Distribution Bar Chart (Shown on Answer Selection in game.html)
   ========================================================================== */
.live-barchart-card {
  margin-top: 1.5rem;
  background: rgba(19, 27, 46, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.5rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(249, 115, 22, 0.12);
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.live-barchart-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: livePulseAnim 1.6s ease-in-out infinite;
}

@keyframes livePulseAnim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

.live-distribution-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.dist-item.is-user-pick {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.dist-item.is-correct-reveal {
  border-color: var(--accent-green-bright);
  background: rgba(34, 197, 94, 0.15);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.opt-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.opt-pill-a { background: linear-gradient(135deg, #dc2626, #ef4444); }
.opt-pill-b { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.opt-pill-c { background: linear-gradient(135deg, #ea580c, #f97316); }
.opt-pill-d { background: linear-gradient(135deg, #16a34a, #22c55e); }

.dist-opt-name {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 600;
}

.your-pick-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.live-barchart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   5. LEADERBOARD (leaderboard.html)
   ========================================================================== */
.leaderboard-card {
  background: rgba(19, 27, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.leaderboard-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.leaderboard-title {
  font-size: 1.85rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #ffffff;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  transition: transform 0.2s ease, background 0.2s ease;
  animation: leaderboardRowIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--leader-delay, 0ms);
}

.leader-row:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.leader-row.rank-1 {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.2) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.15);
}

.leader-row.rank-2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.15) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(148, 163, 184, 0.4);
}

.leader-row.rank-3 {
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(234, 88, 12, 0.45);
}

.leader-row.is-current-user {
  border-color: var(--accent-green-bright);
  background: rgba(34, 197, 94, 0.14);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

.leader-rank-col {
  width: 38px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
}

.leader-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  position: relative;
  animation: avatarFloat 3s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(103, 232, 249, 0.35);
}

.leader-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 50%;
  animation: avatarRing 2.8s ease-out infinite;
  pointer-events: none;
}

.leader-row.rank-1 .leader-avatar {
  animation: avatarChampionFloat 2.4s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.45);
}

.leader-row.rank-1 .leader-avatar::after {
  border-color: rgba(251, 191, 36, 0.6);
}

.leader-row.rank-2 .leader-avatar {
  animation-delay: 180ms;
  box-shadow: 0 0 14px rgba(203, 213, 225, 0.28);
}

.leader-row.rank-3 .leader-avatar {
  animation-delay: 320ms;
  box-shadow: 0 0 14px rgba(251, 146, 60, 0.3);
}

@keyframes leaderboardRowIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes avatarFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes avatarChampionFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  50% { transform: translateY(-7px) rotate(4deg) scale(1.08); }
}

@keyframes avatarRing {
  0% { opacity: 0.75; transform: scale(0.92); }
  70%, 100% { opacity: 0; transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
  .leader-row,
  .leader-avatar,
  .leader-avatar::after {
    animation: none;
  }

  .dist-item.is-correct-answer,
  .dist-item.is-correct-answer::before,
  .correct-answer-pulse,
  .floating-score-points {
    animation: none;
  }
}

.leader-info-col {
  flex: 1;
}

.leader-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.leader-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.leader-delta-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.delta-up { color: #4ade80; background: rgba(34, 197, 94, 0.2); }
.delta-down { color: #f87171; background: rgba(239, 68, 68, 0.15); }
.delta-same { color: #94a3b8; background: rgba(148, 163, 184, 0.15); }

.leader-score-col {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  text-align: right;
}

/* ==========================================================================
   6. FINAL RESULTS & PODIUM (results.html)
   ========================================================================== */
.results-hero-header {
  text-align: center;
  margin: 1.5rem 0 2rem;
}

.results-super-title {
  color: var(--accent-orange-bright);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.results-grand-title {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 0%, #fdba74 60%, #86efac 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Grand 3D Podium */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  height: 290px;
  margin: 2rem 0 2.5rem;
  padding: 0 0.5rem;
}

.podium-pillar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 150px;
}

.podium-avatar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
  text-align: center;
}

.podium-crown {
  font-size: 1.5rem;
  margin-bottom: -6px;
  animation: crownBob 2s infinite ease-in-out;
}

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

.podium-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  border: 3px solid transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.podium-pillar-1 .podium-avatar {
  width: 74px;
  height: 74px;
  border-color: #f97316;
  background: linear-gradient(135deg, #ea580c, #f97316);
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.5);
}

.podium-pillar-2 .podium-avatar {
  border-color: #94a3b8;
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.podium-pillar-3 .podium-avatar {
  border-color: #ea580c;
  background: linear-gradient(135deg, #c2410c, #ea580c);
}

.podium-player-name {
  font-weight: 800;
  font-size: 1rem;
  color: #ffffff;
  margin-top: 0.35rem;
  white-space: nowrap;
}

.podium-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-orange-bright);
}

.podium-block {
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1rem;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.2), 0 8px 30px rgba(0, 0, 0, 0.5);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.25rem;
  color: rgba(255, 255, 255, 0.85);
}

.podium-pillar-1 .podium-block {
  height: 165px;
  background: linear-gradient(180deg, #f97316 0%, #c2410c 100%);
  border-top: 3px solid #fed7aa;
}

.podium-pillar-2 .podium-block {
  height: 125px;
  background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
  border-top: 3px solid #f1f5f9;
}

.podium-pillar-3 .podium-block {
  height: 95px;
  background: linear-gradient(180deg, #ea580c 0%, #9a3412 100%);
  border-top: 3px solid #ffedd5;
}

/* Performance Statistics Grid */
.stats-card {
  background: rgba(19, 27, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.stats-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

@media (max-width: 480px) {
  .stats-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-tile {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
}

.stat-tile-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.stat-tile-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Confetti Canvas Overlay */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}
