/*
 * Quiz App - Gamified Arcade Design
 * Features: XP bars, streaks, achievements, vibrant neon arcade style
 */

/* ======> Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@400;500;600;700&display=swap');

/* ======> CSS Variables */
:root {
  /* Arcade Colors */
  --neon-pink: #ff2d95;
  --neon-cyan: #00f5ff;
  --neon-yellow: #ffea00;
  --neon-green: #39ff14;
  --neon-purple: #bf00ff;
  --neon-orange: #ff6b00;

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
  --gradient-card: linear-gradient(145deg, rgba(26, 10, 46, 0.9), rgba(15, 52, 96, 0.9));
  --gradient-button: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  --gradient-success: linear-gradient(135deg, var(--neon-green), #00cc6a);
  --gradient-danger: linear-gradient(135deg, #ff4757, var(--neon-orange));

  /* Background */
  --bg-dark: #0a0a1f;
  --bg-card: rgba(20, 10, 40, 0.85);

  /* Text */
  --text-white: #ffffff;
  --text-light: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.5);

  /* Effects - Minimal shadows */
  --glow-pink: none;
  --glow-cyan: none;
  --glow-green: none;

  /* Spacing */
  --radius: 16px;
  --radius-full: 50px;
}

/* ======> Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ======> Body & Background */
body {
  min-height: 100vh;
  font-family: 'Rajdhani', sans-serif;
  background: var(--gradient-main);
  color: var(--text-white);
  overflow-x: hidden;
  position: relative;
}

/* Geometric Pattern Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L55 20V40L30 55L5 40V20L30 5Z' fill='none' stroke='rgba(0,245,255,0.06)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  z-index: -2;
}

/* Gradient Orbs */
body::after {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background:
    radial-gradient(ellipse 600px 600px at 10% 90%, rgba(255, 45, 149, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 500px 500px at 90% 10%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 400px 400px at 50% 50%, rgba(191, 0, 255, 0.08) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* ======> Main Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: 90px;
  gap: 30px;
}

/* ======> Header */
.logo-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 25px;
  background: linear-gradient(180deg, rgba(10, 10, 31, 0.95) 0%, rgba(10, 10, 31, 0.85) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.logo-container::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  -webkit-text-fill-color: var(--neon-cyan);
  font-size: 1.2rem;
}

.logo-tagline {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: none;
}

@media (min-width: 600px) {
  .logo-tagline {
    display: block;
  }

  .logo {
    font-size: 1.7rem;
  }
}

/* ======> Game Card */
.game-card {
  background: var(--bg-card);
  border: 2px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  display: block;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  animation: borderScan 3s linear infinite;
}

@keyframes borderScan {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* ======> Setup Form */
.quiz-setup {
  width: 100%;
  max-width: 450px;
  padding: 40px;
}

.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.form-control,
.form-select {
  width: 100%;
  padding: 15px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-white);
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.3s ease;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--neon-cyan);
  background: rgba(0, 245, 255, 0.05);
}

/* Number Input Spinner Styling */
.form-control[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
  padding-right: 50px;
}

.form-control[type="number"]::-webkit-outer-spin-button,
.form-control[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Custom Number Input Wrapper */
.number-input-wrapper {
  position: relative;
  width: 100%;
}

.number-input-wrapper .form-control {
  padding-right: 55px;
}

.number-controls {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  display: flex;
  flex-direction: column;
  width: 40px;
  border-left: 1px solid rgba(0, 245, 255, 0.2);
}

.number-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--neon-cyan);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.number-btn:hover {
  background: rgba(0, 245, 255, 0.15);
  color: var(--text-white);
}

.number-btn:active {
  background: rgba(0, 245, 255, 0.25);
}

.number-btn:first-child {
  border-radius: 0 12px 0 0;
  border-bottom: 1px solid rgba(0, 245, 255, 0.15);
}

.number-btn:last-child {
  border-radius: 0 0 12px 0;
}

/* Custom Select Dropdown */
.custom-select {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
}

.custom-select-trigger:hover {
  border-color: var(--neon-pink);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--neon-cyan);
  border-radius: var(--radius) var(--radius) 0 0;
}

.custom-select-icon {
  width: 24px;
  color: var(--neon-cyan);
  font-size: 1rem;
}

.custom-select-text {
  flex: 1;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-white);
}

.custom-select-arrow {
  color: var(--neon-cyan);
  transition: transform 0.3s ease;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(20, 10, 40, 0.98);
  border: 2px solid var(--neon-cyan);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 100;
}

.custom-select.open .custom-select-options {
  max-height: 280px;
  overflow-y: auto;
  opacity: 1;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background: rgba(0, 245, 255, 0.1);
  color: var(--neon-cyan);
}

.custom-select-option.selected {
  background: rgba(255, 45, 149, 0.15);
  color: var(--neon-pink);
}

.custom-select-option i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
}

/* Scrollbar for options */
.custom-select-options::-webkit-scrollbar {
  width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.custom-select-options::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 3px;
}


.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ======> Play Button */
.btn-play {
  width: 100%;
  padding: 18px 40px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-white);
  background: var(--gradient-button);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-play::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-play:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
}

.btn-play:hover::before {
  left: 100%;
}

.btn-play i {
  margin-right: 10px;
  font-size: 1.4rem;
}

/* ======> Form Error */
.form-error {
  background: rgba(255, 71, 87, 0.2);
  border: 1px solid #ff4757;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #ff4757;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: errorShake 0.5s ease;
}

@keyframes errorShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

/* ======> Loading Screen */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(0, 245, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-right-color: var(--neon-pink);
  border-radius: 50%;
  animation: spinGlow 1s linear infinite;
}

@keyframes spinGlow {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: var(--neon-cyan);
  margin-top: 25px;
  text-transform: uppercase;
  letter-spacing: 3px;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ======> Question Card */
.question-card {
  width: 700px;
  max-width: 95vw;
  min-height: 500px;
  padding: 30px;
  animation: cardEnter 0.5s ease;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* XP/Progress Bar */
.xp-bar-container {
  margin-bottom: 25px;
}

.xp-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.xp-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: var(--neon-yellow);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 234, 0, 0.5);
}

.xp-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--neon-cyan);
}

.xp-bar {
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 234, 0, 0.3);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-yellow), var(--neon-orange));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  position: relative;
  box-shadow: 0 0 15px rgba(255, 234, 0, 0.5);
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
  border-radius: var(--radius-full);
}

/* Stats Row */
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-badge i {
  font-size: 1.1rem;
}

.stat-badge.category {
  color: var(--text-white);
  border-color: rgba(0, 245, 255, 0.3);
}

.stat-badge.timer {
  color: var(--neon-cyan);
  border-color: rgba(0, 245, 255, 0.3);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
}

.stat-badge.timer.warning {
  color: var(--neon-orange);
  border-color: var(--neon-orange);
  animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.stat-badge.counter {
  color: var(--neon-pink);
  border-color: rgba(255, 45, 149, 0.3);
  font-family: 'Orbitron', sans-serif;
}

/* Difficulty Badge */
.stat-badge.difficulty {
  text-transform: capitalize;
  font-weight: 600;
}

.stat-badge.difficulty.easy {
  color: var(--neon-green);
  border-color: rgba(57, 255, 20, 0.3);
}

.stat-badge.difficulty.medium {
  color: var(--neon-yellow);
  border-color: rgba(255, 234, 0, 0.3);
}

.stat-badge.difficulty.hard {
  color: #ff4757;
  border-color: rgba(255, 71, 87, 0.3);
}

/* Question Text */
.question-text {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  border-left: 4px solid var(--neon-cyan);
}

/* Answer Grid */
.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.answer-btn {
  padding: 20px 25px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--text-white);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.answer-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.answer-btn:hover {
  border-color: var(--neon-cyan);
  transform: translateX(5px);
  background: rgba(0, 245, 255, 0.1);
}

.answer-btn:hover::before {
  opacity: 1;
}

.answer-key {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-button);
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.answer-text {
  flex: 1;
}

/* Answer States */
.answer-btn.correct {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--neon-green);
  animation: correctPop 0.5s ease;
}

.answer-btn.correct .answer-key {
  background: var(--gradient-success);
}

@keyframes correctPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.answer-btn.wrong {
  background: rgba(255, 71, 87, 0.2);
  border-color: #ff4757;
  animation: wrongShake 0.5s ease;
}

.answer-btn.wrong .answer-key {
  background: var(--gradient-danger);
}

@keyframes wrongShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-10px);
  }

  40%,
  80% {
    transform: translateX(10px);
  }
}

.answer-btn.correct-reveal {
  background: rgba(57, 255, 20, 0.15);
  border-color: var(--neon-green);
}

.answer-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Keyboard Hint */
.keyboard-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Score Panel */
.score-panel {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.score-item-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.score-item-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Time Up Message */
.time-up-message {
  text-align: center;
  padding: 15px;
  background: rgba(255, 107, 0, 0.2);
  border: 1px solid var(--neon-orange);
  border-radius: var(--radius);
  color: var(--neon-orange);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======> Results Screen */
.results-card {
  text-align: center;
  padding: 50px 40px;
  width: 700px;
  max-width: 95vw;
}

.results-trophy {
  font-size: 6rem;
  margin-bottom: 20px;
  animation: trophyBounce 1s ease infinite;
}

@keyframes trophyBounce {

  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }

  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

.results-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink), var(--neon-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.results-score-display {
  font-family: 'Orbitron', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--neon-cyan);
  margin-bottom: 10px;
}

.results-percentage {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.new-record-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 25px;
  background: linear-gradient(135deg, var(--neon-yellow), var(--neon-orange));
  border-radius: var(--radius-full);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bg-dark);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 25px;
  animation: recordPulse 1s ease infinite;
}

@keyframes recordPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

/* Leaderboard */
.leaderboard {
  margin-top: 25px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 234, 0, 0.2);
}

.leaderboard-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: var(--neon-yellow);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.leaderboard-list {
  list-style: none;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Leaderboard Scrollbar */
.leaderboard-list::-webkit-scrollbar {
  width: 5px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: var(--neon-yellow);
  border-radius: 3px;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  border-left: 3px solid transparent;
}

.leaderboard-item.gold {
  border-left-color: var(--neon-yellow);
  background: rgba(255, 234, 0, 0.1);
}

.leaderboard-item.silver {
  border-left-color: #c0c0c0;
}

.leaderboard-item.bronze {
  border-left-color: #cd7f32;
}

.leaderboard-rank {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  width: 30px;
}

.leaderboard-name {
  flex: 1;
  text-align: left;
  color: var(--text-white);
  margin-left: 10px;
  font-weight: 600;
}

.leaderboard-score {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--neon-cyan);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: center;
}

.btn-restart {
  padding: 15px 35px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-white);
  background: var(--gradient-button);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-restart:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-restart.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-restart.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ======> Error Card */
.error-card {
  text-align: center;
  padding: 50px 40px;
  max-width: 500px;
  width: 100%;
}

.error-icon {
  font-size: 5rem;
  color: #ff4757;
  margin-bottom: 20px;
  animation: errorPulse 1s ease infinite;
}

@keyframes errorPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.error-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: #ff4757;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.error-message {
  color: var(--text-light);
  margin-bottom: 25px;
}

/* ======> Responsive */
@media (max-width: 768px) {
  .logo {
    font-size: 2.5rem;
  }

  .quiz-setup,
  .question-card,
  .results-card {
    padding: 25px 20px;
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }

  .question-text {
    font-size: 1.2rem;
  }

  .stats-row {
    justify-content: center;
  }

  .keyboard-hint {
    display: none;
  }

  .results-title {
    font-size: 1.8rem;
  }

  .results-score-display {
    font-size: 2.5rem;
  }
}

/* ======> Accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.answer-btn:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

/* ======> Exit Animation */
.question-card.exit {
  animation: cardExit 0.4s ease forwards;
}

@keyframes cardExit {
  to {
    opacity: 0;
    transform: translateX(-100px) scale(0.9);
  }
}

/* ======> Utility */
.hidden {
  display: none !important;
}


.rounds-hint {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.7;
}

.stat-badge.timer.danger {
  border-color: red;
  color: red;
  animation: pulseDanger 0.4s infinite;
}

@keyframes pulseDanger {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 380px) {

  /* Main Container */
  .app-container {
    padding: 10px;
  }

  /* Logo Title */
  .logo {
    font-size: 20px;
  }

  .logo i {
    font-size: 18px;
  }

  .logo-tagline {
    font-size: 12px;
  }

  /* Card Size */
  .game-card {
    padding: 15px;
    border-radius: 16px;
  }

  /* Form Labels */
  .form-label {
    font-size: 13px;
  }

  /* Inputs */
  .form-control {
    font-size: 13px;
    padding: 10px;
  }

  /* Custom Select */
  .custom-select-trigger {
    font-size: 13px;
    padding: 10px;
  }

  .custom-select-icon i {
    font-size: 14px;
  }

  /* Start Button */
  .btn-play {
    font-size: 14px;
    padding: 10px;
  }

  /* Question Text */
  .question-text {
    font-size: 16px;
    line-height: 1.4;
  }

  /* Stats Badges */
  .stat-badge {
    font-size: 11px;
    padding: 6px 8px;
    gap: 4px;
  }

  .stat-badge i {
    font-size: 12px;
  }

  /* Answers Grid */
  .answers-grid {
    gap: 8px;
  }

  /* Answer Buttons */
  .answer-btn {
    font-size: 13px;
    padding: 10px;
  }

  .answer-key {
    font-size: 12px;
    width: 22px;
    height: 22px;
  }

  /* Keyboard Hint */
  .keyboard-hint {
    font-size: 11px;
  }

  /* Score Panel */
  .score-item-label {
    font-size: 11px;
  }

  .score-item-value {
    font-size: 14px;
  }

  /* Results Screen */
  .results-title {
    font-size: 18px;
  }

  .results-score-display {
    font-size: 22px;
  }

  .results-percentage {
    font-size: 13px;
  }

  /* Leaderboard */
  .leaderboard-title {
    font-size: 14px;
  }

  .leaderboard-item {
    font-size: 12px;
    padding: 8px;
  }

  /* Restart Button */
  .btn-restart {
    font-size: 13px;
    padding: 10px;
  }
}


@media (max-width: 250px) {

  /* Main Container */
  .app-container {
    padding: 4px;
  }

  /* Logo */
  .logo {
    font-size: 13px;
  }

  .logo i {
    font-size: 12px;
  }

  .logo-tagline {
    font-size: 8px;
  }

  /* Cards */
  .game-card {
    padding: 8px;
    border-radius: 10px;
  }

  /* Form Labels */
  .form-label {
    font-size: 9px;
  }

  .form-label i {
    font-size: 9px;
  }

  /* Inputs */
  .form-control {
    font-size: 9px;
    padding: 6px;
  }

  /* Placeholder Text */
  .form-control::placeholder {
    font-size: 8px;
  }

  /* Custom Select Trigger (Random Category / Easy Mode) */
  .custom-select-trigger {
    font-size: 9px;
    padding: 6px;
  }

  .custom-select-text {
    font-size: 8px;
  }

  .custom-select-icon i {
    font-size: 9px;
  }

  .custom-select-arrow i {
    font-size: 8px;
  }

  /* Dropdown Options */
  .custom-select-option {
    font-size: 8px;
    padding: 5px;
  }

  .custom-select-option i {
    font-size: 8px;
  }

  /* Number Buttons (Up/Down Arrows) */
  .number-btn {
    width: 18px;
    height: 18px;
  }

  .number-btn i {
    font-size: 8px;
  }

  /* Start Button */
  .btn-play {
    font-size: 9px;
    padding: 7px;
  }

  .btn-play i {
    font-size: 8px;
  }

  /* Progress Bar Text */
  .xp-label {
    font-size: 8px;
  }

  .xp-value {
    font-size: 8px;
  }

  /* Question Text */
  .question-text {
    font-size: 10px;
    line-height: 1.2;
  }

  /* Stats Badges */
  .stat-badge {
    font-size: 7px;
    padding: 3px 4px;
    gap: 2px;
  }

  .stat-badge i {
    font-size: 7px;
  }

  /* Timer Value */
  .timer-value {
    font-size: 8px;
  }

  /* Answers Grid */
  .answers-grid {
    gap: 4px;
  }

  /* Answer Buttons */
  .answer-btn {
    font-size: 9px;
    padding: 6px;
  }

  /* Answer Key */
  .answer-key {
    font-size: 8px;
    width: 16px;
    height: 16px;
  }

  /* Keyboard Hint */
  .keyboard-hint {
    font-size: 7px;
  }

  .keyboard-hint i {
    font-size: 7px;
  }

  /* Score Panel */
  .score-item-label {
    font-size: 7px;
  }

  .score-item-value {
    font-size: 9px;
  }

  /* Results Screen */
  .results-title {
    font-size: 11px;
  }

  .results-score-display {
    font-size: 13px;
  }

  .results-percentage {
    font-size: 8px;
  }

  /* Leaderboard */
  .leaderboard-title {
    font-size: 7px;
  }

  .leaderboard-item {
    font-size: 6px;
    padding: 3px;
  }

  .leaderboard-rank {
    font-size: 6px;
  }

  .leaderboard-name {
    font-size: 6px;
  }

  .leaderboard-score {
    font-size: 6px;
  }

  /* New High Score Badge */
  .new-record-badge {
    font-size: 6px;
    padding: 3px 4px;
    gap: 2px;
  }

  .new-record-badge i {
    font-size: 6px;
  }



  /* Restart Button */
  .btn-restart {
    font-size: 8px;
    padding: 6px;
  }

  .btn-restart i {
    font-size: 7px;
  }

  /* Loading Overlay */
  .loading-overlay {
    padding: 10px;
  }

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

  .loading-text {
    font-size: 7px;
    margin-top: 6px;
  }

}