@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800&display=swap');

:root {
  --primary: #8a2be2;
  --primary-glow: rgba(138, 43, 226, 0.4);
  --secondary: #00f2fe;
  --secondary-glow: rgba(0, 242, 254, 0.4);
  --success: #2ed573;
  --success-glow: rgba(46, 213, 115, 0.4);
  --error: #ff4757;
  --error-glow: rgba(255, 71, 87, 0.4);
  --bg-dark: #080710;
  --text-light: #ffffff;
  --text-muted: #a0a0c0;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  user-select: none;
}

body {
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background animated gradient blobs */
body::before, body::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.5;
  will-change: transform;
}

body::before {
  background: var(--primary);
  top: 15%;
  left: 15%;
  animation: float-slow 15s ease-in-out infinite alternate;
}

body::after {
  background: var(--secondary);
  bottom: 15%;
  right: 15%;
  animation: float-slow 18s ease-in-out infinite alternate-reverse;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.2); }
}

/* Main Container */
.app-container {
  width: 100%;
  max-width: 580px;
  padding: 20px;
  perspective: 1000px;
}

/* Glassmorphism Card Base */
.card {
  background: rgba(15, 12, 30, 0.75); /* Fallback y fondo estable para evitar parpadeos de backdrop-filter */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 35px 30px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 
              inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: 0.75s;
}

.card:hover::before {
  left: 150%;
}

/* Screen visibility states */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeInSlide 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(20px) rotateX(-5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

/* Typography & Titles */
h1 {
  font-size: 2.8rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 30%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 30px;
  font-weight: 300;
}

/* Button & Checkbox styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #6f1ab6 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px var(--primary-glow);
  outline: none;
  text-decoration: none;
  gap: 10px;
}

.btn:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Utility class for accessibility (screen readers only) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Continent Selector Grid */
.continents-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.continent-option {
  position: relative;
}

.continent-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.continent-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  gap: 8px;
}

.continent-label .icon {
  font-size: 1.8rem;
  transition: transform 0.3s ease;
}

.continent-label span {
  font-size: 0.95rem;
  font-weight: 500;
}

.continent-option input:checked + .continent-label {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary-glow);
  color: var(--secondary);
}

.continent-option input:checked + .continent-label .icon {
  transform: scale(1.15) rotate(5deg);
}

.continent-option input:focus-visible + .continent-label {
  outline: 3px solid var(--secondary);
  outline-offset: -3px;
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary-glow);
}

.continent-option:hover .continent-label {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Game Interface Details */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.score-badge, .timer-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.timer-badge {
  color: var(--secondary);
}

.timer-badge.warning {
  color: var(--error);
  animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 71, 87, 0); }
  100% { transform: scale(1.05); box-shadow: 0 0 8px rgba(255, 71, 87, 0.4); }
}

.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 30px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.game-progress-container {
  margin-bottom: 8px;
  margin-top: -8px;
}

/* Question Section */
.question-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}

.flag-wrapper {
  width: 120px;
  height: 80px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.question-text {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-muted);
}

.country-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-top: 5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.country-name:focus {
  outline: none;
}

/* Options list */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.option-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 20px;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(4px);
}

.option-btn:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: -3px;
  border-color: var(--secondary);
  background: rgba(255, 255, 255, 0.06);
}

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

/* Correct/Incorrect Classes */
.option-btn.correct {
  background: rgba(46, 213, 115, 0.15) !important;
  border-color: var(--success) !important;
  box-shadow: 0 0 15px var(--success-glow);
  color: #fff;
  font-weight: 700;
}

.option-btn.incorrect {
  background: rgba(255, 71, 87, 0.15) !important;
  border-color: var(--error) !important;
  box-shadow: 0 0 15px var(--error-glow);
  color: #fff;
  animation: shake 0.4s ease;
}

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

/* Feedbacks details */
.feedback-badge {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 10px;
  min-height: 24px;
  transition: all 0.3s;
}

.feedback-badge.success { color: var(--success); }
.feedback-badge.error { color: var(--error); }

/* Results & Leaderboard screen */
.results-summary {
  text-align: center;
  margin-bottom: 30px;
}

.score-display {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 15px 0;
  letter-spacing: -2px;
}

.score-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 15px;
  border-radius: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-val {
  font-size: 1.3rem;
  font-weight: 700;
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Form input styling */
.form-group {
  margin-bottom: 25px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.input-name {
  width: 100%;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  outline: none;
  transition: all 0.3s;
}

.input-name:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 10px var(--secondary-glow);
  background: rgba(0, 0, 0, 0.3);
}

/* Leaderboard List */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 30px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar for leaderboard */
.leaderboard-list::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.leaderboard-rank {
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.leaderboard-item.rank-1 .leaderboard-rank {
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  color: #000;
}

.leaderboard-item.rank-2 .leaderboard-rank {
  background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
  color: #000;
}

.leaderboard-item.rank-3 .leaderboard-rank {
  background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
  color: #000;
}

.leaderboard-user {
  flex-grow: 1;
  margin-left: 0;
  display: flex;
  flex-direction: column;
}

.leaderboard-header {
  margin: 0 0 4px 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

.leaderboard-name {
  font-weight: 600;
}

.leaderboard-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
}

.leaderboard-points {
  font-weight: 700;
  color: var(--secondary);
  font-size: 1.1rem;
}

.bottom-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

/* Sound indicator button in preferences */
.sound-toggle-wrapper {
  width: 100%;
}

.sound-toggle-pref {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: none;
}

.sound-toggle-pref:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.sound-toggle-pref[aria-pressed="true"] {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary-glow);
  color: var(--secondary);
}

.sound-toggle-pref:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: -3px;
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary-glow);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .card {
    padding: 25px 20px;
  }
  h1 {
    font-size: 2.2rem;
  }
  .continents-grid {
    grid-template-columns: 1fr;
  }
  /* Reduce GPU-heavy blur on mobile for smoother performance */
  body::before, body::after {
    filter: blur(80px);
    width: 250px;
    height: 250px;
  }
  .card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Transiciones de contenido del juego */
.game-content-wrapper {
  transition: opacity 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), 
              transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 1;
  transform: translateY(0);
}

.game-content-wrapper.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

/* Configuración Form & Controls */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 10px;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.75rem;
  color: var(--text-muted);
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  position: absolute;
  pointer-events: none;
  transition: color 0.3s;
}

.select-wrapper:hover::after {
  color: var(--secondary);
}

.input-select {
  width: 100%;
  padding: 16px 40px 16px 20px; /* Espacio extra a la derecha para la flecha */
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  outline: none;
  transition: all 0.3s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.input-select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 12px var(--secondary-glow);
  background: rgba(0, 0, 0, 0.45);
}

.input-select:disabled {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: not-allowed;
  border-style: dashed;
}

.input-select option {
  background: #121020;
  color: #fff;
  padding: 10px;
}

.setting-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.checkbox-option {
  position: relative;
  display: flex;
  align-items: center;
}

.checkbox-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.checkbox-option input:checked + .checkbox-label {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary-glow);
  color: var(--secondary);
}

.checkbox-option input:focus-visible + .checkbox-label {
  outline: 3px solid var(--secondary);
  outline-offset: -3px;
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary-glow);
}

.checkbox-option:hover .checkbox-label {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.badge-lock {
  display: inline-block;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 8px;
  font-weight: 500;
}

/* Manual Screen Styling */
.manual-content {
  text-align: left;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
}

.manual-content::-webkit-scrollbar {
  width: 6px;
}

.manual-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}

.manual-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.manual-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.manual-content section {
  margin-bottom: 20px;
}

.manual-content section:last-child {
  margin-bottom: 0;
}

.manual-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.manual-content p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-light);
  margin-bottom: 8px;
}

.manual-content ul {
  margin-left: 20px;
  margin-bottom: 10px;
}

.manual-content li {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.manual-content kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #fff;
}

/* Clases de utilidad y componentes extraídos de estilos inline */
.continents-subtitle {
  margin-bottom: 15px;
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
}

.continent-option.span-full {
  grid-column: span 2;
}

#btn-toggle-all {
  padding: 10px;
  font-size: 0.9rem;
}

.mt-12 {
  margin-top: 12px;
}

.mt-20 {
  margin-top: 20px;
}

#question-counter {
  font-weight: 700;
  font-size: 1.1rem;
}

#btn-save-score {
  margin-top: 12px;
  background: linear-gradient(135deg, var(--secondary) 0%, #0099ff 100%);
  box-shadow: 0 4px 15px var(--secondary-glow);
}

.settings-actions {
  margin-top: 30px;
}

/* Estilos para Modo Aprendizaje y Selectores de Modo */
.mode-selector-wrapper {
  margin-bottom: 20px;
}

.mode-selector-grid {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.mode-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-tab:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.learning-user-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  animation: fadeInSlide 0.3s ease;
}

.learning-stats-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  text-align: center;
}

.learning-stats-info {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--secondary);
}

.learning-mode-indicator {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
  border: 1px solid var(--secondary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: 0 0 10px var(--secondary-glow);
}

.learning-result-info {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--secondary);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.95rem;
  color: var(--text-light);
  text-align: center;
}

.mb-12 {
  margin-bottom: 12px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

/* Estilos para Consulta de Capitales */
.search-form-container {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.search-input-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.search-input-group .form-control {
  flex: 1;
}

.search-input-group .btn {
  width: auto;
  padding: 0 24px;
}

.search-result-container {
  width: 100%;
  max-width: 540px;
  margin: 20px auto 0 auto;
}

.search-loading {
  text-align: center;
  padding: 20px;
  font-size: 1.1rem;
  color: var(--secondary);
}

.search-result-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(8px);
  animation: fadeInSlide 0.3s ease-out;
  text-align: left;
}

.search-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-flag {
  width: 64px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  object-fit: cover;
}

.search-card-titles {
  flex: 1;
}

.search-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--secondary);
  color: #000;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.search-card-main {
  font-size: 1.35rem;
  color: #ffffff;
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

.search-card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  border-radius: 10px;
}

.search-detail-item {
  display: flex;
  flex-direction: column;
}

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

.search-detail-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
}

.search-alert {
  padding: 16px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  font-size: 1.05rem;
  animation: fadeInSlide 0.3s ease-out;
}

.search-alert-warning {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid #ffc107;
  color: #ffda6a;
}

.search-alert-error {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid #dc3545;
  color: #ea868f;
}

@media (max-width: 480px) {
  .search-input-group {
    flex-direction: column;
  }
  .search-input-group .btn {
    width: 100%;
  }
  .search-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === Pantalla de Resultados === */
.final-score {
  text-align: center;
  margin: 16px 0;
}

.score-number {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
}

.score-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  text-transform: uppercase;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: 16px;
  gap: 12px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  text-align: center;
}

.save-score-form {
  margin: 20px 0;
}

.save-score-form label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.input-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.form-control {
  flex: 1;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
  user-select: text;
}

.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 10px var(--secondary-glow);
  background: rgba(0, 0, 0, 0.4);
}

.input-group .btn {
  width: auto;
  padding: 0 20px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary) 0%, #0099ff 100%);
  box-shadow: 0 4px 15px var(--secondary-glow);
  color: #000;
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px var(--secondary-glow);
  filter: brightness(1.1);
}

.status-message {
  margin-top: 8px;
  font-size: 0.9rem;
  min-height: 20px;
  text-align: center;
  color: var(--success);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.9rem;
  width: auto;
}

.game-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.country-flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

