/* ==========================================================================
   Guess The Car Brand - Stylesheet
   Design system: Fluid responsive layout stretching to full screen width/height,
   supporting landscape (dual-column) and portrait modes, clean animations,
   and pill design matching the reference guidelines.
   ========================================================================== */

:root {
  /* Fonts */
  --font-family-body: 'Nunito', sans-serif;
  --font-family-title: 'Fredoka', sans-serif;

  /* Colors */
  --color-bg-purple: #7c3aed;
  --color-bg-blue: #3b82f6;
  --color-text-dark: #1e1b4b;
  --color-text-light: #ffffff;
  --color-text-muted: #cbd5e1;
  
  --color-correct: #22c55e;
  --color-wrong: #ef4444;
  --color-warning: #eab308;

  /* Button Gradients */
  --grad-purple: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  --grad-gold: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  --grad-coral: linear-gradient(180deg, #ff7e5f 0%, #feb47b 100%);
  
  /* Borders and Shadows */
  --border-radius-pill: 50px;
  --border-radius-card: 24px;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.06);

  /* Transitions */
  --transition-fast: 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Page Container
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}

body {
  font-family: var(--font-family-body);
  background: linear-gradient(145deg, #7c3aed 0%, #3b82f6 100%);
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.18) 1.5px, transparent 1.5px),
    linear-gradient(145deg, #6d28d9 0%, #1d4ed8 100%);
  background-size: 32px 32px, auto;
  color: var(--color-text-light);
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Full-Screen Fluid Container - stretches to screen orientation */
#game-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Screens & Layout Transitions
   ========================================================================== */
.game-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  z-index: 1;
}

.game-screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 5;
}

/* ==========================================================================
   Typography & Headers
   ========================================================================== */
.game-title {
  font-family: var(--font-family-title);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  color: var(--color-text-light);
  text-shadow: 0 4px 0px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.2);
  margin-top: 20px;
}

.game-title .accent {
  color: #facc15;
  text-shadow: 0 4px 0px #b45309, 0 8px 16px rgba(0, 0, 0, 0.2);
}

.screen-title {
  font-family: var(--font-family-title);
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   1. MAIN MENU SCREEN
   ========================================================================== */
#screen-menu {
  justify-content: space-around;
  align-items: center;
  text-align: center;
  position: relative;
}

/* Floating Logo gutter styles */
.menu-floating-logos {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.floating-logo {
  position: absolute;
  top: -60px;
  pointer-events: none;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.1)) grayscale(20%);
  user-select: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Reduce opacity during active gameplay to avoid distraction */
#screen-game.active ~ #menu-floating-logos .floating-logo {
  opacity: 0.15;
}

/* Slightly dim opacity on other sub-screens for text legibility */
#screen-results.active ~ #menu-floating-logos .floating-logo,
#screen-leaderboard.active ~ #menu-floating-logos .floating-logo,
#screen-how.active ~ #menu-floating-logos .floating-logo,
#screen-settings.active ~ #menu-floating-logos .floating-logo {
  opacity: 0.25;
}

@keyframes rain-down {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(112vh) rotate(360deg);
  }
}

/* Ensure menu elements are layered above the background logos */
.gear-btn, .game-title, .menu-subtitle, .high-score-pill, .menu-buttons, .menu-config {
  position: relative;
  z-index: 10;
}

.menu-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-top: -4px;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gear-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1.5rem;
  padding: 10px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.gear-btn:hover {
  transform: rotate(45deg) scale(1.1);
  background: rgba(255, 255, 255, 0.25);
}

.high-score-pill {
  background: rgba(30, 27, 75, 0.7);
  padding: 8px 24px;
  border-radius: var(--border-radius-pill);
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-block;
  margin: 10px 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
}

.menu-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 340px;
}

.menu-btn {
  font-family: var(--font-family-body);
  font-size: 1.25rem;
  font-weight: 800;
  padding: 16px 28px;
  border-radius: var(--border-radius-pill);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 6px 0px rgba(0, 0, 0, 0.25), 0 10px 20px rgba(0, 0, 0, 0.15);
  color: white;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}

.menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0px rgba(0, 0, 0, 0.25), 0 12px 24px rgba(0, 0, 0, 0.2);
  filter: brightness(1.05);
}

.menu-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.15);
}

.purple-btn {
  background: var(--grad-purple);
  border: 2px solid #c084fc;
}

.gold-btn {
  background: var(--grad-gold);
  border: 2px solid #fde047;
  color: #78350f;
  text-shadow: none;
}

.coral-btn {
  background: var(--grad-coral);
  border: 2px solid #ffedd5;
}

.btn-emoji {
  font-size: 1.4rem;
}

.menu-config {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: var(--border-radius-card);
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-inner);
  border: 2px solid rgba(255, 255, 255, 0.05);
}

.config-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-item label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.config-item select {
  font-family: var(--font-family-body);
  font-size: 1rem;
  font-weight: 700;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 27, 75, 0.6);
  color: white;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.config-item select:focus {
  border-color: #a855f7;
}

/* ==========================================================================
   2. GAME SCREEN HUD
   ========================================================================== */
#screen-game {
  justify-content: flex-start;
  padding: 20px;
}

.y8-logo {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 126px;
  height: 71px;
  object-fit: contain;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25));
}

.hud {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  background: rgba(30, 27, 75, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 14px 20px;
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-progress-row {
  justify-content: space-between;
}

.hud-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.progress-track {
  flex-grow: 1;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-pill);
  overflow: hidden;
  box-shadow: var(--shadow-inner);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--color-bg-blue);
  border-radius: var(--border-radius-pill);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-count {
  font-weight: 800;
  font-size: 1rem;
  min-width: 48px;
  text-align: right;
}

/* Health Row */
.hud-health-row {
  justify-content: space-between;
}

.health-label {
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 70px;
}

.health-track {
  flex-grow: 1;
  height: 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-pill);
  overflow: hidden;
  box-shadow: var(--shadow-inner);
}

.health-fill {
  width: 100%;
  height: 100%;
  background: var(--color-correct);
  border-radius: var(--border-radius-pill);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.timer-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.timer-badge.warning {
  border-color: var(--color-wrong);
  background: rgba(239, 68, 68, 0.2);
  animation: pulse-timer 0.5s infinite alternate;
}

@keyframes pulse-timer {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Stats Row */
.hud-stats-row {
  justify-content: space-between;
}

.stat-pill {
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 14px;
  border-radius: var(--border-radius-pill);
  font-weight: 800;
  font-size: 0.9rem;
}

.streak-pill {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.streak-pill.active {
  opacity: 1;
  transform: translateY(0);
}

.hint-btn {
  font-family: var(--font-family-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  border: 2px solid #fde047;
  border-radius: var(--border-radius-pill);
  background: var(--grad-gold);
  color: #78350f;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 #92400e;
  transition: transform var(--transition-fast), filter var(--transition-fast), opacity var(--transition-fast);
}

.hint-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.hint-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #92400e;
}

.hint-btn:disabled,
.hint-btn.used {
  cursor: default;
  opacity: 0.72;
  filter: grayscale(0.35);
}

.hint-btn.reward-prompt {
  animation: hint-reward-pulse 2.4s ease-in-out infinite;
}

@keyframes hint-reward-pulse {
  0%, 100% {
    opacity: 0.72;
    box-shadow: 0 3px 0 #92400e, 0 0 0 rgba(250, 204, 21, 0);
  }
  50% {
    opacity: 1;
    box-shadow: 0 3px 0 #92400e, 0 0 18px rgba(250, 204, 21, 0.8);
  }
}

.hint-icon {
  font-size: 1rem;
}

/* ==========================================================================
   LOGO DISPLAY CARD
   ========================================================================== */
.game-main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  width: 100%;
}

.logo-card {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1.5;
  background: white;
  border-radius: var(--border-radius-card);
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  border: 6px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.logo-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: logo-fade-in 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes logo-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.card-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.95);
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(124, 58, 237, 0.15);
  border-top-color: var(--color-bg-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MULTIPLE CHOICE ANSWERS PANEL
   ========================================================================== */
.game-bottom {
  width: 100%;
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 8px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.answer-btn {
  font-family: var(--font-family-body);
  width: 100%;
  background: #ffffff;
  color: var(--color-text-dark);
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-pill);
  padding: 16px 24px;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 0px #cbd5e1;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.answer-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 5px 0px #cbd5e1;
  background: #f8fafc;
}

.answer-btn:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 2px 0px #cbd5e1;
}

.answer-btn:disabled {
  cursor: default;
}

.answer-letter {
  background: #e2e8f0;
  color: #64748b;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 900;
  margin-right: 14px;
  flex-shrink: 0;
}

/* Correct Answer state */
.answer-btn.correct {
  background: var(--color-correct) !important;
  color: white !important;
  border-color: #15803d !important;
  box-shadow: 0 4px 0px #166534 !important;
  animation: correct-pulse 0.3s ease;
}

@keyframes correct-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.answer-btn.correct .answer-letter {
  background: white !important;
  color: var(--color-correct) !important;
}

/* Wrong Answer state */
.answer-btn.wrong {
  background: var(--color-wrong) !important;
  color: white !important;
  border-color: #b91c1c !important;
  box-shadow: 0 4px 0px #991b1b !important;
}

.answer-btn.wrong .answer-letter {
  background: white !important;
  color: var(--color-wrong) !important;
}

/* Choices removed by the hint */
.answer-btn.hint-eliminated {
  background: #cbd5e1 !important;
  color: #64748b !important;
  border-color: #94a3b8 !important;
  box-shadow: none !important;
  opacity: 0.58;
  text-decoration: line-through;
  transform: none !important;
}

.answer-btn.hint-eliminated .answer-letter {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
}

/* ==========================================================================
   FEEDBACK TOAST MODAL
   ========================================================================== */
.feedback-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(30, 27, 75, 0.95);
  border: 4px solid white;
  border-radius: var(--border-radius-card);
  padding: 24px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 100;
}

.feedback-toast.show-toast {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.toast-title {
  font-family: var(--font-family-title);
  font-size: 2.2rem;
  font-weight: 700;
}

.toast-score {
  font-size: 1.15rem;
  font-weight: 800;
  color: #facc15;
}

.correct-toast {
  border-color: var(--color-correct);
}
.correct-toast .toast-title {
  color: var(--color-correct);
}

.wrong-toast {
  border-color: var(--color-wrong);
}
.wrong-toast .toast-title {
  color: var(--color-wrong);
}

/* Screen shake animations */
.shake-animation {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ==========================================================================
   MODAL OVERLAY (Settings & Pauses)
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 12, 41, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 50;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: rgba(30, 27, 75, 0.95);
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-card);
  padding: 32px 24px;
  width: 88%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

/* Small in-game loading card shown before the Y8 start ad appears. */
.ad-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(15, 12, 41, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 120;
}

.ad-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ad-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: min(82%, 270px);
  padding: 22px 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(30, 27, 75, 0.96);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.ad-loading-card strong {
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  color: #facc15;
}

.ad-loading-card span {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.ad-loading-spinner {
  width: 34px;
  height: 34px;
  border-width: 3px;
}

.modal-title {
  font-family: var(--font-family-title);
  font-size: 2rem;
  margin-bottom: 12px;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.modal-status {
  min-height: 1.2em;
  margin: -10px 0 14px;
  color: #facc15;
  font-size: 0.82rem;
  font-weight: 800;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 20px;
}

kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.8rem;
}

/* Save score input */
.text-input {
  font-family: var(--font-family-body);
  width: 100%;
  padding: 14px;
  border-radius: var(--border-radius-pill);
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  margin-bottom: 20px;
  transition: border-color var(--transition-fast);
}

.text-input:focus {
  border-color: #a855f7;
}

/* ==========================================================================
   3. RESULTS SCREEN
   ========================================================================== */
#screen-results {
  justify-content: space-around;
  align-items: center;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 360px;
}

.result-box {
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.result-box.highlight {
  grid-column: span 2;
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(168, 85, 247, 0.4);
}

.result-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-muted);
}

.result-value {
  font-family: var(--font-family-title);
  font-size: 1.8rem;
  font-weight: 700;
}

.result-box.highlight .result-value {
  font-size: 2.8rem;
  color: #facc15;
  text-shadow: 0 2px 8px rgba(250, 204, 21, 0.3);
}

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

.driver-badge {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  padding: 10px 24px;
  border-radius: var(--border-radius-pill);
  font-weight: 800;
  font-size: 1.05rem;
  margin: 10px 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.results-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
}

/* ==========================================================================
   4. LEADERBOARD SCREEN
   ========================================================================== */
#screen-leaderboard {
  justify-content: flex-start;
}

.lb-filters {
  width: 100%;
  margin-bottom: 16px;
}

.filter-select {
  font-family: var(--font-family-body);
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(30, 27, 75, 0.6);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  outline: none;
}

.lb-table-wrap {
  flex-grow: 1;
  width: 100%;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 16px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.lb-table th {
  padding: 14px;
  font-weight: 800;
  color: var(--color-text-muted);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
}

.lb-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-name {
  font-weight: 800;
}

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

.empty-msg {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

.back-btn {
  width: 100%;
}

/* ==========================================================================
   5. HOW TO PLAY SCREEN
   ========================================================================== */
#screen-how {
  justify-content: flex-start;
}

.how-cards {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
  padding-right: 4px;
}

.info-card {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 18px;
}

.info-card h3 {
  font-family: var(--font-family-title);
  color: #facc15;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.info-card p, .info-card li {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.info-card ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.controls-table {
  width: 100%;
  border-collapse: collapse;
}

.controls-table td {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   6. SETTINGS SCREEN
   ========================================================================== */
#screen-settings {
  justify-content: flex-start;
}

.settings-list {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.03);
  padding: 16px 20px;
  border-radius: 16px;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.setting-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Switch styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 34px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

input:checked + .toggle-slider {
  background-color: var(--color-bg-purple);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Danger setting block */
.danger-row {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
}

.danger-row .setting-name {
  color: #f87171;
}

.small-btn {
  padding: 8px 16px;
  font-size: 0.95rem;
  box-shadow: 0 4px 0px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   FX Animations disabled state class
   ========================================================================== */
.no-animations * {
  animation: none !important;
  transition: none !important;
}

/* ==========================================================================
   Responsive Landscape & Wide Screen Orientation Adjustments
   ========================================================================== */
@media (min-width: 768px), (orientation: landscape) {
  /* Keep menu screens centered with constrained content width */
  #screen-menu, #screen-results, #screen-how, #screen-settings, #screen-leaderboard {
    padding: 32px calc(50% - 200px);
  }

  /* 2. Gameplay Screen Layout - Creative Left & Right split */
  #screen-game {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 24px;
    padding: 24px calc(50% - 440px);
    align-items: center;
  }

  .hud {
    grid-column: 1 / span 2;
    grid-row: 1;
    margin-bottom: 0;
    padding: 10px 20px;
  }

  .game-main {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .logo-card {
    height: 90%;
    max-height: 350px;
    width: 100%;
    aspect-ratio: auto;
  }

  .game-bottom {
    grid-column: 2;
    grid-row: 2;
    height: 100%;
    display: flex;
    align-items: center;
  }

  .answers-grid {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }
}

