/**
 * Estilos centralizados para la aplicación Quiz
 * Reemplaza los estilos inline de los templates
 */

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 2rem; }

/* ========== PROFILE PAGE ========== */
.profile-header {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.profile-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.stat-card {
  border-radius: 16px;
  overflow: hidden;
}

.stat-card-games {
  border: 2px solid #667eea;
}

.stat-card-streak {
  border: 2px solid #f59e0b;
}

.stat-card-score {
  border: 2px solid #10b981;
}

.stat-card-header {
  padding: 1.5rem;
  text-align: center;
  color: white;
}

.stat-card-header-games {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-header-streak {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.stat-card-header-score {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
}

.badge-section-header {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 1.5rem;
}

.badge-section-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.badge-count {
  background: rgba(255,255,255,0.3);
  color: white;
  font-size: 1.125rem;
  padding: 0.5rem 1rem;
}

.progress-container {
  margin-bottom: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.progress-label {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.progress-percent {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 900;
}

.progress-bar-outer {
  height: 20px;
  background: var(--border-color, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.8s ease;
  position: relative;
}

.progress-badge-icon {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.completion-message {
  text-align: center;
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  border: 2px solid #f59e0b;
}

.completion-message-text {
  font-size: 1.125rem;
  font-weight: 800;
  color: #92400e;
}

.featured-badges-section {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #3b82f6;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.featured-badges-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.featured-badges-title {
  margin: 0;
  color: #1e40af;
  font-size: 1.125rem;
  font-weight: 800;
}

.featured-badges-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.875rem;
  color: #3b82f6;
}

.featured-badges-display {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  min-height: 80px;
  align-items: center;
}

.featured-no-selection {
  color: #6b7280;
  font-size: 0.875rem;
}

.featured-message {
  padding: 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1e40af;
  display: none;
}

/* BADGES GRID - Optimizado para PC y Móvil */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 2rem;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}

/* PC: Más badges por fila (5-6 columnas en pantallas grandes) */
@media (min-width: 1400px) {
  .badges-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 2.5rem;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .badges-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .badges-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.badge-card {
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: 16px;
  border: 3px solid;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  min-height: 200px;
  max-height: 200px;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* Estilos para los elementos internos del badge */
.badge-icon-container {
  flex-shrink: 0;
  width: 100%;
  display: inline-block;
  word-spacing: 0.1em;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: break-word;
}

.badge-name-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  flex-shrink: 0;
}

.badge-rarity-tag {
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-card.earned {
  cursor: pointer;
}

.badge-card.earned:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.badge-card.locked {
  background: var(--bg-secondary, #f9fafb);
  border-color: var(--border-color, #e5e7eb);
}

.badge-locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.85);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.badge-locked-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.badge-icon {
  font-size: 4rem;
  margin-bottom: 0.75rem;
}

.badge-icon.locked {
  filter: grayscale(100%) opacity(0.3);
}

.badge-icon.earned {
  animation: badgeFloat 3s ease-in-out infinite;
}

.badge-name {
  font-size: 0.875rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.badge-name.locked {
  color: #9ca3af;
}

.badge-rarity {
  display: inline-block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
}

.badge-rarity.locked {
  background: #d1d5db;
  color: #404040;
}

.badge-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.95);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  white-space: normal;
  width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.badge-card:hover .badge-tooltip {
  opacity: 1;
}

.badge-tooltip-title {
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.badge-tooltip-description {
  opacity: 0.95;
  line-height: 1.4;
}

.badge-tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0,0,0,0.95);
}

.no-badges-message {
  text-align: center;
  padding: 3rem;
  color: #9ca3af;
}

.no-badges-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.no-badges-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.no-badges-subtitle {
  font-size: 0.9375rem;
}

.start-adventure {
  text-align: center;
  padding: 2.5rem;
  margin-top: 2rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 16px;
  border: 2px dashed #3b82f6;
}

.start-adventure-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.start-adventure-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #1e40af;
}

.start-adventure-text {
  font-size: 1rem;
  color: #3b82f6;
  margin-bottom: 1.5rem;
}

/* ========== ANIMATIONS ========== */
@keyframes badgeFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ========== GAME SCREENS ========== */
.question-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  /* Evita bounce scroll no deseado en iOS dentro del juego */
  overscroll-behavior: contain;
}

.timer-circle {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.timer-text {
  font-size: 3rem;
  font-weight: 800;
  color: #1a1a1a;
}

.streak-indicator {
  margin-top: 1rem;
  text-align: center;
  animation: slideInDown 0.5s ease;
}

.streak-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.streak-icon {
  font-size: 1.25rem;
}

.streak-text {
  font-size: 1rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

/* Streak Badges Inline (para scoreboards) */
.streak-badge-inline {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-left: 0.5rem;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

/* Streak Normal (3-4) */
.streak-level-normal {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Streak Alto (5-9) */
.streak-level-high {
  background: linear-gradient(135deg, #ff5252 0%, #ff6b35 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(255, 82, 82, 0.4);
}

/* Streak Épico (10+) */
.streak-level-epic {
  background: linear-gradient(135deg, #ff3838 0%, #ffd700 50%, #ff3838 100%);
  color: white;
  border: 2px solid rgba(255, 215, 0, 0.6);
  animation: glow 1s ease-in-out infinite alternate;
  box-shadow: 0 6px 20px rgba(255, 56, 56, 0.6), 0 0 30px rgba(255, 215, 0, 0.3);
  font-size: 0.85rem;
}

/* Animación de brillo para rachas épicas */
@keyframes glow {
  0% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(255, 56, 56, 0.6), 0 0 30px rgba(255, 215, 0, 0.3);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 56, 56, 0.8), 0 0 40px rgba(255, 215, 0, 0.5);
  }
}

.question-card {
  padding: 2rem;
  margin-bottom: 2rem;
}

.question-title {
  font-size: clamp(1.1rem, 3.5vw, 2rem);
  font-weight: 800;
  color: var(--dark);
  line-height: 1.4;
  margin: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.answer-counter {
  margin-top: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 8px;
  border: 2px solid rgba(102, 126, 234, 0.3);
}

.answer-counter-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.answer-counter-icon {
  font-size: 1.5rem;
}

.answer-counter-text {
  text-align: left;
}

.answer-counter-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.answer-counter-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.answer-progress-bar {
  margin-top: 0.75rem;
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.answer-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success) 0%, var(--info) 100%);
  transition: width 0.3s ease;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.option-btn {
  padding: 2.5rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  border: 3px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
  color: white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  /* Cross-platform touch */
  touch-action: manipulation;         /* elimina delay 300ms en Android/iOS */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.option-btn:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.65);
}

.option-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.option-btn:disabled {
  cursor: not-allowed;
}

/* Answer card states — clear distinction between default/hover/selected/correct/incorrect */
.option-btn.selected {
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35), 0 6px 16px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.option-btn.correct {
  border-color: white;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.55), 0 8px 20px rgba(0,0,0,0.25);
  transform: translateY(-2px);
}

.option-btn.incorrect {
  opacity: 0.38;
  transform: none;
  border-color: rgba(255,255,255,0.1);
}

.option-btn.dimmed {
  opacity: 0.32;
  transform: none;
  border-color: rgba(255,255,255,0.1);
}

.option-danger { background: var(--danger); }
.option-info { background: var(--info); }
.option-warning { background: var(--warning); color: #1a1a1a; }
.option-success { background: var(--success); }

.answered-message {
  background: linear-gradient(135deg, var(--success) 0%, var(--info) 100%);
  color: white;
  padding: 3rem;
  text-align: center;
}

.answered-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.answered-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: white;
}

.answered-text {
  font-size: 1.25rem;
  opacity: 0.9;
}

.time-up-message {
  background: var(--danger);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}

.time-up-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.time-up-title {
  font-size: 1.75rem;
  margin: 0;
  color: white;
}

.time-up-text {
  margin: 0.5rem 0 0;
  opacity: 0.9;
}

.player-info {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ========== EXAM LIST ========== */
.exam-list-header {
  color: var(--primary);
  font-size: 2.5rem;
}

.exam-list-subtitle {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.exam-table-header {
  font-weight: 700;
  padding: 1rem;
}

.exam-table-row {
  transition: all 0.3s ease;
}

.exam-table-row:hover {
  background: rgba(70, 23, 143, 0.05);
  transform: translateX(5px);
}

.exam-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.exam-question-count {
  display: inline-block;
  background: var(--info);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
}

.exam-status-badge {
  display: inline-block;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
}

.exam-status-public {
  background: var(--success);
}

.exam-status-private {
  background: var(--danger);
}

.exam-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  align-items: center;
}

.exam-actions .btn-sm {
  white-space: nowrap;
  min-width: 90px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* Vista de tabla vs cards */
.exam-list-table-view {
  display: block;
  overflow-x: auto;
}

.exam-list-table-view table {
  width: 100%;
  min-width: 900px;
}

.exam-list-table-view td {
  vertical-align: middle;
}

.exam-list-card-view {
  display: none;
}

/* Estilos de cards para móvil */
.exam-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.exam-card-header {
  margin-bottom: 1rem;
}

.exam-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

.exam-card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.exam-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Mejoras de tabla en desktop */
@media (min-width: 769px) {
  .exam-table-row {
    height: 70px;
  }
  
  .exam-table-row td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
  }
  
  .exam-title {
    padding-left: 1rem !important;
  }
}

/* Media query para móvil */
@media (max-width: 768px) {
  /* Ocultar tabla en móvil */
  .exam-list-table-view {
    display: none;
  }
  
  /* Mostrar cards en móvil */
  .exam-list-card-view {
    display: block;
  }
  
  .exam-list-header {
    font-size: 1.75rem !important;
  }
  
  .exam-list-subtitle {
    font-size: 0.95rem;
  }
  
  .exam-card {
    padding: 1rem;
  }
  
  .exam-card-title {
    font-size: 1.15rem;
  }
  
  .btn-block-mobile {
    width: 100%;
    text-align: center;
  }
}

/* ========== HOST SCREENS ========== */
.host-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.host-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.host-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.host-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
}

.host-question-display {
  background: var(--bg-card, white);
  border-radius: 16px;
  padding: 3rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.host-question-text {
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.host-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.host-option {
  padding: 2rem;
  border-radius: 16px;
  border: 4px solid;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: white;
  text-align: center;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.host-option.correct {
  animation: correctPulse 1s ease-in-out infinite;
}

@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.host-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.host-stat-card {
  background: var(--bg-card, white);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.host-stat-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.host-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
}

.host-stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== RESPONSIVE ========== */

/* TABLETS Y MÓVILES HORIZONTALES */
@media (max-width: 991px) {
  .badges-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  
  .badge-card {
    min-height: 170px;
    max-height: 170px;
    height: 170px;
    padding: 0.9rem 0.7rem;
  }
  
  .badge-icon-container {
    font-size: 2.5rem !important;
    margin-bottom: 0.4rem !important;
  }
  
  .badge-name-text {
    font-size: 0.72rem !important;
    margin-bottom: 0.35rem !important;
  }
  
  .badge-rarity-tag {
    font-size: 0.55rem !important;
    padding: 0.2rem 0.5rem !important;
  }
  
  .featured-badges-section {
    margin-top: 2rem !important;
  }
  
  .stat-card {
    margin-bottom: 1rem;
  }
}

/* MÓVILES */
@media (max-width: 768px) {
  .question-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .timer-circle {
    width: 90px;
    height: 90px;
  }

  .timer-text {
    font-size: 2.25rem;
  }

  .question-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .option-btn {
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .host-options-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* PERFIL: 2 badges por fila en móvil con tamaño medio */
  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
  }
  
  .badge-card {
    padding: 0.85rem 0.5rem !important;
    min-height: 150px;
    max-height: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Reducir tamaño del icono del badge en móvil */
  .badge-icon-container {
    font-size: 2.2rem !important;
    margin-bottom: 0.3rem !important;
  }
  
  /* Reducir tamaño del nombre del badge */
  .badge-name-text {
    font-size: 0.7rem !important;
    margin-bottom: 0.35rem !important;
    line-height: 1.1 !important;
  }
  
  /* Reducir tamaño de la rareza */
  .badge-rarity-tag {
    font-size: 0.5rem !important;
    padding: 0.15rem 0.4rem !important;
  }
  
  /* Tooltip ajustado para móvil */
  .badge-tooltip {
    width: 180px !important;
    font-size: 0.7rem !important;
  }
  
  /* Reducir padding del card-body en móvil */
  .card-body {
    padding: 1rem !important;
  }

  .profile-header {
    font-size: 2rem;
  }

  .stat-value {
    font-size: 2rem;
  }
  
  /* Featured badges más compactos */
  .featured-badges-display {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .featured-badge-mini {
    width: 100% !important;
  }
}

/* MÓVILES PEQUEÑOS */
@media (max-width: 480px) {
  .timer-circle {
    width: 70px;
    height: 70px;
    margin-bottom: 1rem;
  }

  .timer-text {
    font-size: 1.75rem;
  }

  .question-card {
    padding: 1rem;
  }

  .question-title {
    font-size: 1.25rem;
    line-height: 1.25;
    word-wrap: break-word;
  }

  .options-grid {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .option-btn {
    padding: 1.25rem 0.75rem;
    font-size: 0.95rem;
    border-width: 3px;
    min-height: 70px;
  }

  .time-up-title {
    font-size: 1.5rem;
  }

  .answered-icon, .time-up-icon {
    font-size: 2rem;
  }

  .answered-title {
    font-size: 1.5rem;
  }

  .answered-text {
    font-size: 1rem;
  }
  
  /* PERFIL: 2 columnas en móvil pequeño con badges aún más compactos */
  .badges-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }
  
  .badge-card {
    padding: 0.7rem 0.4rem !important;
    border-width: 2px !important;
    border-radius: 12px !important;
    min-height: 135px;
    max-height: 135px;
    height: 135px;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Iconos más pequeños */
  .badge-icon-container {
    font-size: 1.85rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  /* Nombres más pequeños */
  .badge-name-text {
    font-size: 0.62rem !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.05 !important;
  }
  
  /* Rareza más pequeña */
  .badge-rarity-tag {
    font-size: 0.45rem !important;
    padding: 0.12rem 0.35rem !important;
  }
  
  /* Tooltip más estrecho en móvil */
  .badge-tooltip {
    width: 160px !important;
    font-size: 0.65rem !important;
    padding: 0.75rem !important;
  }
  
  /* Lock icon más pequeño */
  .badge-lock-icon {
    font-size: 2rem !important;
  }
  
  /* Card body más compacto */
  .card-body {
    padding: 0.75rem !important;
  }
  
  .profile-header {
    font-size: 1.75rem !important;
  }
  
  .stat-value {
    font-size: 1.75rem !important;
  }
  
  .stat-card {
    padding: 1rem !important;
  }
  
  /* Featured badges header stack en móvil */
  .featured-badges-header {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: flex-start !important;
  }
  
  .featured-badges-header button {
    width: 100% !important;
  }
}

@media (max-width: 380px) {
  .option-btn {
    font-size: 0.85rem;
    padding: 1rem 0.5rem;
    line-height: 1.2;
  }
  
  /* Badges aún más compactos en pantallas muy pequeñas */
  .badges-grid {
    gap: 0.4rem;
    width: 100%;
  }
  
  .badge-card {
    padding: 0.6rem 0.3rem !important;
    min-height: 120px;
    max-height: 120px;
    height: 120px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .badge-icon-container {
    font-size: 1.75rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .badge-name-text {
    font-size: 0.58rem !important;
    margin-bottom: 0.2rem !important;
  }
  
  .badge-rarity-tag {
    font-size: 0.42rem !important;
    padding: 0.1rem 0.3rem !important;
  }
  
  .badge-tooltip {
    width: 140px !important;
    font-size: 0.6rem !important;
  }
  
  .badge-lock-icon {
    font-size: 1.75rem !important;
  }
  
  /* Card body aún más compacto */
  .card-body {
    padding: 0.5rem !important;
  }
}

/* ========== DEBUG INFO ========== */
.debug-info {
  background: #f0f0f0;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
}

/* ========== BADGE NOTIFICATION MODAL ========== */
.badge-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.badge-modal-content {
  background: var(--bg-card, white);
  border-radius: 20px;
  padding: 3rem;
  max-width: 500px;
  text-align: center;
  position: relative;
  animation: badgePopIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

.badge-modal-icon {
  font-size: 8rem;
  margin-bottom: 1rem;
  animation: badgeSpin 1s ease-in-out;
}

.badge-modal-text {
  margin-bottom: 1.5rem;
}

.badge-modal-label {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.badge-modal-name {
  font-size: 2rem;
  font-weight: 900;
  margin: 0.5rem 0;
  color: var(--primary);
}

.badge-modal-rarity {
  display: inline-block;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  background: #94a3b8;
  margin-bottom: 1rem;
}

.badge-modal-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 1rem 0;
}

.badge-modal-button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(112, 44, 249, 0.3);
}

.badge-modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(112, 44, 249, 0.4);
}

.badge-modal-button:active {
  transform: translateY(0);
}

@keyframes badgePopIn {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes badgeSpin {
  0% {
    transform: rotate(0deg) scale(0.5);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* ========== AUDIO CONTROLS ========== */
.audio-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.audio-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #333;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.audio-btn:hover {
  transform: scale(1.1);
}

.audio-btn:active {
  transform: scale(0.95) !important;
}

@media (max-width: 768px) {
  .audio-controls {
    top: 70px !important;
    right: 10px !important;
    z-index: 999;
  }
  
  .audio-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 22px !important;
  }
}

/* ========== EXAM LIST ========== */
.exam-list-header {
  color: var(--primary);
  font-size: 2.5rem;
}

.exam-list-subtitle {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.exam-table-header {
  font-weight: 700;
  padding: 1rem;
}

.exam-table-row {
  transition: all 0.3s ease;
}

.exam-table-row:hover {
  background: rgba(70, 23, 143, 0.05);
  transform: translateX(5px);
}

.exam-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.exam-question-count {
  display: inline-block;
  background: var(--info);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
}

.exam-status-badge {
  display: inline-block;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
}

.exam-status-public {
  background: var(--success);
}

.exam-status-private {
  background: var(--danger);
}

.exam-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

/* ========== HOST ROOM ========== */
.host-code {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  margin: 1rem 0;
}

/* ========== SCOREBOARD ========== */
.scoreboard-header {
  margin-bottom: 2rem;
  background: var(--primary-dark);
  color: white;
  text-align: center;
  padding: 1.75rem 2rem;
  border-radius: 14px;
}

.scoreboard-trophy { font-size: 2.25rem; margin-bottom: 0.25rem; }
.scoreboard-title { margin: 0; color: white; font-size: 1.625rem; font-weight: 900; letter-spacing: 1px; }
.scoreboard-subtitle { margin: 0.375rem 0 0; opacity: 0.65; font-size: 0.8125rem; letter-spacing: 0.5px; }

.podium-position { text-align: center; }
.podium-card { padding: 2rem 1rem; border-radius: 14px; margin-bottom: 1rem; position: relative; }
.podium-gold { background: linear-gradient(160deg, #b8860b 0%, #d4a520 100%); padding: 2.75rem 1.25rem 1.75rem; box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.podium-silver { background: linear-gradient(160deg, #787878 0%, #a8a8a8 100%); padding: 2rem 1.25rem 1.5rem; box-shadow: 0 6px 16px rgba(0,0,0,0.14); }
.podium-bronze { background: linear-gradient(160deg, #8b5a2b 0%, #b07038 100%); padding: 1.5rem 1.25rem 1.25rem; box-shadow: 0 6px 16px rgba(0,0,0,0.14); }

.podium-badge { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); color: white; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem; border: 3px solid white; box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
.podium-badge-gold { background: #b8860b; color: #fff8e1; width: 50px; height: 50px; top: -22px; font-size: 1.5rem; }
.podium-badge-silver { background: #787878; color: white; }
.podium-badge-bronze { background: #8b5a2b; color: white; width: 35px; height: 35px; top: -12px; font-size: 1rem; }

.podium-medal { font-size: 3rem; margin-bottom: 0.5rem; }
.podium-medal-first { font-size: 3.5rem; }
.podium-name { font-size: 1.1875rem; font-weight: 800; color: white; margin-bottom: 0.5rem; word-break: break-word; display: block; }
.podium-name-gold { font-size: 1.4375rem; font-weight: 900; color: white; }
.podium-streak { margin: 0.5rem 0; display: flex; justify-content: center; align-items: center; }

/* ========== JOIN INPUT ========== */
.join-icon { font-size: 5rem; margin-bottom: 1rem; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.join-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--primary); animation: titleGlowPulse 2s ease-in-out infinite; }
.join-subtitle { color: var(--text-secondary); font-size: 1.125rem; }
.join-label { display: block; margin-bottom: 1rem; font-weight: 600; color: var(--dark); font-size: 1.125rem; }
.join-code-input { width: 100%; padding: 1.25rem; border: 3px solid var(--light); border-radius: 12px; font-size: 2rem; text-align: center; font-weight: 700; letter-spacing: 0.5rem; text-transform: uppercase; transition: all 0.3s ease; }
.join-info { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--light); }
.join-tip { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.6; }
.join-session-code { font-size: 3rem; font-weight: 800; color: var(--primary); margin: 1rem 0; letter-spacing: 0.25rem; }

/* ========== HOST ROOM ========== */
.participant-item { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; transition: background 0.15s; }
.participant-item:hover { background: rgba(0,0,0,0.025); }
.participant-item:last-child { border-bottom: none; }
.participant-name { font-weight: 600; }
.participant-empty { padding: 2rem; text-align: center; color: var(--text-secondary); }
.participant-empty-hint { font-size: 0.875rem; margin-top: 0.25rem; opacity: 0.75; }
.host-update-bar { padding: 0.5rem; text-align: center; background: var(--bg-secondary, #f8f9fa); border-top: 1px solid var(--border-color); font-size: 0.875rem; color: var(--text-secondary, #666); }
.host-exam-info { margin-top: 1rem; padding: 1rem; background: var(--bg-secondary, #e7f3ff); border-radius: 8px; border-left: 4px solid var(--info); }
.host-waiting-message { text-align: center; padding: 2rem; background: var(--bg-secondary, #fff3cd); }
.host-waiting-text { font-size: 1.25rem; color: #856404; margin: 0; }

/* ========== PUBLIC JOIN ========== */
.participant-info-card { background: var(--primary-dark); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 1.5rem; text-align: center; }
.participant-info-card .playing-as { font-size: 1rem; opacity: 0.85; margin-bottom: 0.5rem; }
.participant-info-card .playing-name { font-size: 2rem; font-weight: 800; margin: 0; }
.auth-user-banner { padding: 1.5rem; background: var(--primary-dark); border-radius: 8px; margin-bottom: 1rem; color: white; text-align: center; }
.instructions-card { background: var(--primary-dark); color: white; }
.promo-banner { background: var(--primary-dark); border: none; }
.promo-banner-body { padding: 2rem; text-align: center; color: white; }
.promo-benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; text-align: left; }
.promo-benefit { background: rgba(255,255,255,0.15); padding: 1rem; border-radius: 8px; }
.promo-benefit-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.promo-benefit-title { font-weight: 700; margin-bottom: 0.25rem; }
.promo-benefit-desc { font-size: 0.875rem; opacity: 0.9; }
.promo-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.promo-note { margin-top: 1.5rem; font-size: 0.875rem; opacity: 0.8; }
.badge-progress-track { height: 12px; background: var(--border-color, #e5e7eb); border-radius: 6px; overflow: hidden; }
.badge-progress-fill { height: 100%; background: var(--primary); transition: width 0.5s ease; }
.badge-locked-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.7); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 2rem; opacity: 0.5; }

/* ========== QUESTION FORM OPTION ROWS ========== */
.option-number-badge { flex-shrink: 0; width: 40px; height: 40px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; }
.option-correct-label { margin: 0; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.5rem 1rem; background: var(--bg-card, white); border: 2px solid var(--success); border-radius: 8px; transition: all 0.2s; }
.option-correct-label:hover { background: rgba(var(--success-rgb, 38,166,154), 0.06); }
.option-correct-text { font-weight: 600; color: var(--success); }
.option-row-inner { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 8px; margin-bottom: 0.5rem; background: var(--bg-secondary, #f8f9fa); }


/* ========== HOST QUESTION ========== */
.session-header {
  margin-bottom: 2rem;
  background: var(--primary-dark);
  color: white;
}

.session-info { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; }
.session-title { margin: 0; color: white; }
.session-code { margin: 0.5rem 0 0; opacity: 0.9; }
.answer-stats { text-align: right; }
.answer-count { font-size: 2rem; font-weight: 800; }
.answer-label { opacity: 0.9; font-size: 0.875rem; }

.question-display { text-align: center; padding: 3rem; }
.question-number { font-size: 1rem; color: var(--text-secondary); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.question-text { font-size: clamp(1.25rem, 4vw, 2.5rem); font-weight: 800; color: var(--dark); margin-bottom: 2rem; line-height: 1.3; overflow-wrap: break-word; word-break: break-word; hyphens: auto; }
.timer-display { display: inline-block; background: var(--warning); color: #1a1a1a; padding: 1rem 2rem; border-radius: 12px; font-size: 3rem; font-weight: 800; margin-bottom: 2rem; }

.stats-container { padding: 2rem; }
.option-stat { margin-bottom: 1.5rem; }
.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; gap: 0.75rem; }
.option-label { font-weight: 600; font-size: 1.125rem; min-width: 0; flex: 1 1 0; overflow-wrap: break-word; word-break: break-word; hyphens: auto; }
.stat-value { font-weight: 700; font-size: 1.25rem; color: var(--primary); flex-shrink: 0; white-space: nowrap; }
.progress-bar { height: 40px; background: var(--light); border-radius: 8px; overflow: hidden; position: relative; }
.progress-fill { height: 100%; transition: width 0.5s ease; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; }

.reveal-controls { margin-top: 2rem; }
.reveal-hint { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.5rem; }

/* ========== RESULTS ========== */
.results-header {
  margin-bottom: 2.5rem;
  color: white;
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--primary-dark);
}

.results-icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.results-title { margin: 0; color: white; font-size: 2.25rem; font-weight: 900; margin-bottom: 0.25rem; letter-spacing: 1px; }
.results-subtitle { margin: 0; opacity: 0.8; font-size: 1.125rem; font-weight: 500; }
.results-meta { margin-top: 1rem; font-size: 0.8125rem; opacity: 0.6; letter-spacing: 0.5px; }

.winners-section { margin-bottom: 2.5rem; }
.winners-title { text-align: center; font-size: 0.6875rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 1.75rem; letter-spacing: 2.5px; text-transform: uppercase; }
.winners-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 1rem; align-items: flex-end; }

/* Podium cards */
.podium-card { border-radius: 14px; position: relative; }
.podium-card-gold { background: linear-gradient(160deg, #b8860b 0%, #d4a520 100%); padding: 2.75rem 1.25rem 1.75rem; box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.podium-card-silver { background: linear-gradient(160deg, #787878 0%, #a8a8a8 100%); padding: 2rem 1.25rem 1.5rem; box-shadow: 0 6px 16px rgba(0,0,0,0.14); }
.podium-card-bronze { background: linear-gradient(160deg, #8b5a2b 0%, #b07038 100%); padding: 1.5rem 1.25rem 1.25rem; box-shadow: 0 6px 16px rgba(0,0,0,0.14); }
.podium-badge { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; border: 3px solid white; box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
.podium-badge-gold { width: 50px; height: 50px; font-size: 1.5rem; top: -22px; background: #b8860b; color: #fff8e1; }
.podium-badge-silver { width: 42px; height: 42px; font-size: 1.25rem; top: -18px; background: #787878; color: white; }
.podium-badge-bronze { width: 38px; height: 38px; font-size: 1.1rem; top: -16px; background: #8b5a2b; color: white; }
.podium-icon { font-size: 3rem; margin-bottom: 0.5rem; display: block; }
.podium-icon-lg { font-size: 3.75rem; margin-bottom: 0.625rem; display: block; }
.podium-name { font-weight: 800; color: white; margin-bottom: 0.5rem; word-break: break-word; display: block; }
.podium-name-lg { font-size: 1.5rem; }
.podium-name-sm { font-size: 1.1875rem; }
.podium-score { font-weight: 900; color: white; margin-bottom: 0.2rem; display: block; }
.podium-score-lg { font-size: 3.25rem; }
.podium-score-sm { font-size: 2rem; }
.podium-label { font-size: 0.8125rem; opacity: 0.75; color: white; display: block; }

.ranking-table { padding: 0; }
.ranking-row { display: flex; justify-content: space-between; align-items: center; padding: 0.875rem 1.5rem; border-bottom: 1px solid var(--border-color); transition: background 0.15s ease; }
.ranking-row:last-child { border-bottom: none; }
.ranking-row:hover { background: rgba(70,23,143,0.04); }
[data-theme="dark"] .ranking-row:hover { background: rgba(255,255,255,0.04); }
.ranking-info { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.ranking-position { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.0625rem; flex-shrink: 0; }
.ranking-name { font-weight: 700; font-size: 1.0625rem; color: var(--text-primary); }
.ranking-score-display { text-align: right; flex-shrink: 0; }
.ranking-score { font-size: 1.625rem; font-weight: 900; color: var(--primary); line-height: 1; }
.ranking-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.game-stats { margin-bottom: 2rem; }
.stat-box { text-align: center; color: white; padding: 1.75rem; }
.stat-box-brand { background: var(--primary); }
.stat-box-info { background: var(--info); }
.stat-box-gold { background: linear-gradient(135deg, #b8860b 0%, #d4a520 100%); }
.stat-number { font-size: 2.5rem; font-weight: 900; margin-bottom: 0.375rem; }
.stat-text { opacity: 0.85; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8125rem; font-weight: 600; }

/* Ranking position color utilities */
.ranking-pos-gold { background: #b8860b; color: #fff8e1; }
.ranking-pos-silver { background: #787878; color: white; }
.ranking-pos-bronze { background: #8b5a2b; color: white; }
.ranking-pos-default { background: var(--light); color: var(--text-secondary); }
.ranking-pos-user { background: var(--primary); color: white; }

/* Participant result card (rank-based background) */
.result-card-gold { background: linear-gradient(160deg, #b8860b 0%, #c9a223 100%); color: white; }
.result-card-silver { background: linear-gradient(160deg, #787878 0%, #a0a0a0 100%); color: white; }
.result-card-bronze { background: linear-gradient(160deg, #8b5a2b 0%, #a96d38 100%); color: white; }
.result-card-default { background: var(--primary); color: white; }

/* Rank title color utilities */
.rank-color-gold { color: #b8860b; }
.rank-color-silver { color: #787878; }
.rank-color-bronze { color: #8b5a2b; }
[data-theme="dark"] .rank-color-gold { color: #d4a520; }
[data-theme="dark"] .rank-color-silver { color: #c0c0c0; }
[data-theme="dark"] .rank-color-bronze { color: #c08040; }

/* Reveal answer card variants */
.reveal-card-correct { background: var(--success); color: white; }
.reveal-card-incorrect { background: var(--danger); color: white; }

/* ========== LANDING PAGE ========== */
.hero-section { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem; }
/* width:100% forces the flex child to fill the available space up to max-width          */
/* (without it, align-items:center on the parent causes the child to shrink to content) */
.hero-container { width: 100%; max-width: 900px; margin: 0 auto; }

@media (min-width: 1100px) {
  .hero-container { max-width: 1200px; }
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1400px) {
  .hero-container { max-width: 1400px; }
}

/* Short / landscape viewports: reduce hero height so page fits without needing to scroll */
@media (max-height: 600px) {
  .hero-section { min-height: unset; padding: 1.5rem 2rem; }
  .hero-icon { font-size: 3rem; margin-bottom: 0.5rem; }
  .hero-actions { margin-bottom: 2rem; }
  .features-grid { margin-top: 2rem; }
}
.hero-icon { font-size: 5rem; margin-bottom: 1rem; }
.hero-title { font-size: 3.5rem; font-weight: 800; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-description { font-size: 1.5rem; color: var(--text-secondary); margin-bottom: 3rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 4rem; }

.features-grid { margin-top: 4rem; text-align: left; }
.feature-card { padding: 2rem; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
.feature-icon { font-size: 3rem; margin-bottom: 1rem; }
.feature-title { margin-bottom: 0.5rem; }
.feature-description { color: var(--text-secondary); }

.user-welcome { margin-top: 3rem; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: white; padding: 2rem; }
.welcome-title { font-size: 1.5rem; margin-bottom: 1rem; color: white; }
.welcome-text { font-size: 1.125rem; opacity: 0.95; }

/* ========== ANIMATIONS ========== */
@keyframes zoomIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes celebrate { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }


/* ========== REVEAL SCREENS ========== */
.reveal-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1rem;
}

.celebration-container,
.wrong-container,
.no-answer-container {
  animation: fadeIn 0.5s ease-out;
}

.reveal-icon {
  font-size: 8rem;
  margin-bottom: 1rem;
}

.reveal-title {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: slideIn 0.5s ease-out;
}

.reveal-title.correct { color: var(--success); }
.reveal-title.incorrect { color: var(--danger); }
.reveal-title.no-answer { color: #c07000; }

.reveal-points {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 2rem;
}

.reveal-answer-card {
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  animation: fadeIn 0.7s ease-out;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.reveal-answer-label {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.reveal-answer-text {
  font-size: 1.75rem;
  font-weight: 800;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.reveal-time-badge {
  background: var(--success);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  display: inline-block;
  font-weight: 700;
  margin-bottom: 1rem;
}

.reveal-wait-message {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--light);
  border-radius: 12px;
}

.reveal-wait-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.reveal-wait-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ========== HOST REVEAL ========== */
.accuracy-display {
  text-align: right;
}

.accuracy-value {
  font-size: 2.5rem;
  font-weight: 800;
}

.accuracy-label {
  opacity: 0.9;
  font-size: 0.875rem;
}

.reveal-stats-grid {
  margin-bottom: 2rem;
}

.stat-card-reveal {
  text-align: center;
  color: white;
  padding: 2rem;
  border-radius: 12px;
}

.reveal-option-item {
  margin-bottom: 2rem;
}

.reveal-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.reveal-option-name {
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 0;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.reveal-option-badge {
  background: var(--success);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.reveal-option-stats {
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-left: 1rem;
  text-align: right;
}

.reveal-option-percentage {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.reveal-progress-bar {
  height: 50px;
  background: var(--light);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.reveal-progress-fill {
  height: 100%;
  transition: width 1s ease;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}

/* ========== SCOREBOARD PARTICIPANT ========== */
.scoreboard-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1rem;
}

.user-rank-display {
  margin-bottom: 3rem;
  animation: zoomIn 0.6s ease-out;
}

.rank-icon {
  font-size: 5rem;
  margin-bottom: 0.75rem;
}

.rank-title {
  font-size: 2.25rem;
  font-weight: 900;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.rank-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.user-score-card {
  padding: 2rem;
  margin: 0 auto;
  max-width: 400px;
  border-radius: 12px;
}

.score-label {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.score-value {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.score-unit {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.streak-display {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
}

.streak-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.streak-value {
  font-size: 1.75rem;
  font-weight: 900;
}

.best-streak {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
}

.nearby-ranking,
.top-ranking {
  margin-bottom: 2rem;
}

.ranking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.ranking-item:last-child { border-bottom: none; }

.ranking-item.current-user {
  background: rgba(70, 23, 143, 0.07);
  border-left: 3px solid var(--primary);
}

[data-theme="dark"] .ranking-item.current-user {
  background: rgba(106, 40, 204, 0.12);
}

.ranking-item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.ranking-item-position {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.ranking-item-name {
  font-weight: 600;
  font-size: 1.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.ranking-item-score {
  font-size: 1.75rem;
  font-weight: 900;
  text-align: right;
}

/* ========== FORMS ========== */
.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-title {
  color: var(--primary);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.form-checkbox-special {
  background: var(--bg-secondary, #f8f9fa);
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid var(--light);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  margin: 0;
}

.checkbox-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--dark);
}

.form-tip-box {
  background: var(--bg-secondary, #e3f2fd);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-tip-text {
  margin: 0;
  color: var(--text-secondary, #0c5460);
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ========== QUESTION LIST ========== */
.question-item {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--light);
  cursor: move;
  transition: all 0.3s;
  background: var(--bg-card, white);
}

.question-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.question-item:active {
  cursor: grabbing;
}

/* Modo solo lectura */
.question-readonly {
  cursor: default !important;
  background: var(--bg-card);
}

.question-readonly:hover {
  background: var(--bg-card) !important;
  transform: none !important;
  cursor: default !important;
}

.question-readonly .drag-handle {
  display: none;
}

.drag-handle {
  margin-right: 1.25rem;
  color: #ccc;
  font-size: 1.25rem;
  cursor: grab;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.question-number {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  font-weight: 900;
  font-size: 1.25rem;
  color: white;
  flex-shrink: 0;
  margin-right: 1.25rem;
}

.question-content {
  flex: 1;
  min-width: 0;
  padding-right: 1rem;
}

.question-text-display {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--dark);
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.question-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.question-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.list-empty-state {
  text-align: center;
  padding: 3rem;
  background: var(--light);
}

.empty-state-title {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.empty-state-text {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ========== RESPONSIVE UTILITIES ========== */
@media (max-width: 768px) {
  .reveal-container,
  .scoreboard-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1.5rem 1rem !important;
  }
  
  .reveal-icon,
  .rank-icon {
    font-size: 5rem !important;
  }
  
  .reveal-title,
  .rank-title {
    font-size: 2rem !important;
    letter-spacing: 1px !important;
  }
  
  .reveal-points {
    font-size: 1.5rem !important;
  }
  
  .reveal-answer-text {
    font-size: 1.25rem !important;
  }
  
  .score-value {
    font-size: 2.5rem !important;
  }
  
  .winners-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .question-item {
    flex-wrap: wrap;
  }
  
  .question-actions {
    width: 100%;
    margin-top: 1rem;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .reveal-icon,
  .rank-icon {
    font-size: 4rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  .reveal-title,
  .rank-title {
    font-size: 1.5rem !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.75rem !important;
  }
  
  .reveal-answer-card {
    padding: 1.25rem 1rem !important;
  }
  
  .score-value {
    font-size: 2rem !important;
  }
  
  .ranking-item {
    padding: 0.75rem 0.5rem !important;
  }
  
  .ranking-item-name {
    font-size: 0.95rem !important;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}


/* ========== ANIMATIONS (COMPLETAS) ========== */
@keyframes celebrate {
  0% { transform: scale(0) rotate(0deg); }
  50% { transform: scale(1.2) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes slideInRight {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ========== EJEMPLO_COMPLETO STYLES ========== */
.ejemplo-code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

@media print {
  .navbar, .nav-buttons, footer {
    display: none;
  }
}

/* ========== ANIMATIONS (COMPLETAS) ========== */
@keyframes celebrate {
  0% { transform: scale(0) rotate(0deg); }
  50% { transform: scale(1.2) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes slideInRight {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ========== EJEMPLO_COMPLETO STYLES ========== */
.ejemplo-code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

@media print {
  .navbar, .nav-buttons, footer {
    display: none;
  }
}

/* ========== PARTICIPANT QUESTION PAGE ========== */
.option-btn {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.option-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.option-btn:active:not(:disabled) {
  transform: scale(0.95) !important;
}

.option-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

/* Responsive para preguntas y opciones */
@media (max-width: 768px) {
  .question-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #timer-circle {
    width: 90px !important;
    height: 90px !important;
  }

  #time-left {
    font-size: 2.25rem !important;
  }

  .card h1 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  #options-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .option-btn {
    padding: 1.5rem 1rem !important;
    font-size: 1.1rem !important;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  #timer-circle {
    width: 70px !important;
    height: 70px !important;
    margin-bottom: 1rem !important;
  }

  #time-left {
    font-size: 1.75rem !important;
  }

  .card {
    padding: 1rem !important;
  }

  .card h1 {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
    word-wrap: break-word;
  }

  #options-grid {
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .option-btn {
    padding: 1.25rem 0.75rem !important;
    font-size: 0.95rem !important;
    border-width: 3px !important;
    min-height: 70px;
    max-height: none;
  }

  #time-up-message h2 {
    font-size: 1.5rem !important;
  }

  #time-up-message div[style*="font-size: 3rem"] {
    font-size: 2rem !important;
  }

  /* Mensaje de respuesta enviada */
  .card div[style*="font-size: 4rem"] {
    font-size: 2.5rem !important;
  }

  .card h2 {
    font-size: 1.5rem !important;
  }

  .card p[style*="font-size: 1.25rem"] {
    font-size: 1rem !important;
  }
}

/* Para n�meros muy largos */
@media (max-width: 380px) {
  .option-btn {
    font-size: 0.85rem !important;
    padding: 1rem 0.5rem !important;
    line-height: 1.2;
  }
}

/* ========== PARTICIPANT SCOREBOARD PAGE ========== */
/* Responsive para scoreboard */
@media (max-width: 768px) {
  .scoreboard-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1.5rem 1rem !important;
  }

  div[style*="font-size: 8rem"] {
    font-size: 5rem !important;
  }

  h1[style*="font-size: 3rem"] {
    font-size: 2rem !important;
    letter-spacing: 1px !important;
  }

  div[style*="font-size: 4rem"] {
    font-size: 2.5rem !important;
  }

  div[style*="font-size: 1.75rem"] {
    font-size: 1.25rem !important;
  }

  div[style*="padding: 1rem 1.5rem"] {
    padding: 0.875rem 1rem !important;
  }

  div[style*="font-size: 1.125rem"] {
    font-size: 1rem !important;
    white-space: normal !important;
  }

  .card {
    padding: 1rem !important;
  }
}

@media (max-width: 480px) {
  .scoreboard-container {
    padding: 1rem 0.5rem !important;
  }

  div[style*="padding: 2rem 1rem"] {
    padding: 1rem 0.5rem !important;
  }

  div[style*="font-size: 8rem"] {
    font-size: 4rem !important;
    margin-bottom: 0.5rem !important;
  }

  h1[style*="font-size: 3rem"], h1[style*="font-size: 2rem"] {
    font-size: 1.5rem !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.75rem !important;
  }

  div[style*="font-size: 1.25rem"] {
    font-size: 1rem !important;
  }

  .card[style*="padding: 2rem"] {
    padding: 1.25rem 1rem !important;
  }

  div[style*="font-size: 4rem"] {
    font-size: 2rem !important;
  }

  div[style*="font-size: 1.75rem"] {
    font-size: 1.1rem !important;
  }

  div[style*="padding: 1rem 1.5rem"] {
    padding: 0.75rem 0.5rem !important;
    gap: 0.5rem !important;
  }

  div[style*="width: 40px; height: 40px"] {
    width: 35px !important;
    height: 35px !important;
    font-size: 0.9rem;
  }

  div[style*="font-size: 1.125rem"] {
    font-size: 0.95rem !important;
    white-space: normal !important;
    word-wrap: break-word;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .card {
    padding: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .card-header {
    font-size: 1rem !important;
    padding: 0.75rem !important;
  }
}

@media (max-width: 380px) {
  div[style*="font-size: 1.75rem"], div[style*="font-size: 1.1rem"] {
    font-size: 0.95rem !important;
  }

  div[style*="font-size: 1.125rem"], div[style*="font-size: 0.95rem"] {
    font-size: 0.85rem !important;
  }

  div[style*="width: 35px"] {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem;
  }
}

/* ========== PARTICIPANT SCOREBOARD PAGE ========== */
/* Responsive para scoreboard */
@media (max-width: 768px) {
  .scoreboard-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1.5rem 1rem !important;
  }

  div[style*="font-size: 8rem"] {
    font-size: 5rem !important;
  }

  h1[style*="font-size: 3rem"] {
    font-size: 2rem !important;
    letter-spacing: 1px !important;
  }

  div[style*="font-size: 4rem"] {
    font-size: 2.5rem !important;
  }

  div[style*="font-size: 1.75rem"] {
    font-size: 1.25rem !important;
  }

  div[style*="padding: 1rem 1.5rem"] {
    padding: 0.875rem 1rem !important;
  }

  div[style*="font-size: 1.125rem"] {
    font-size: 1rem !important;
    white-space: normal !important;
  }

  .card {
    padding: 1rem !important;
  }
}

@media (max-width: 480px) {
  .scoreboard-container {
    padding: 1rem 0.5rem !important;
  }

  div[style*="padding: 2rem 1rem"] {
    padding: 1rem 0.5rem !important;
  }

  div[style*="font-size: 8rem"] {
    font-size: 4rem !important;
    margin-bottom: 0.5rem !important;
  }

  h1[style*="font-size: 3rem"], h1[style*="font-size: 2rem"] {
    font-size: 1.5rem !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.75rem !important;
  }

  div[style*="font-size: 1.25rem"] {
    font-size: 1rem !important;
  }

  .card[style*="padding: 2rem"] {
    padding: 1.25rem 1rem !important;
  }

  div[style*="font-size: 4rem"] {
    font-size: 2rem !important;
  }

  div[style*="font-size: 1.75rem"] {
    font-size: 1.1rem !important;
  }

  div[style*="padding: 1rem 1.5rem"] {
    padding: 0.75rem 0.5rem !important;
    gap: 0.5rem !important;
  }

  div[style*="width: 40px; height: 40px"] {
    width: 35px !important;
    height: 35px !important;
    font-size: 0.9rem;
  }

  div[style*="font-size: 1.125rem"] {
    font-size: 0.95rem !important;
    white-space: normal !important;
    word-wrap: break-word;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .card {
    padding: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .card-header {
    font-size: 1rem !important;
    padding: 0.75rem !important;
  }
}

@media (max-width: 380px) {
  div[style*="font-size: 1.75rem"], div[style*="font-size: 1.1rem"] {
    font-size: 0.95rem !important;
  }

  div[style*="font-size: 1.125rem"], div[style*="font-size: 0.95rem"] {
    font-size: 0.85rem !important;
  }

  div[style*="width: 35px"] {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem;
  }
}

/* ========== QUESTION LIST PAGE ========== */
.question-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.question-item:active {
  cursor: grabbing;
}

.drag-handle:active {
  cursor: grabbing;
}

/* ========== FEATURED EXAMS SECTION ========== */
.section-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.section-header {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.section-divider {
  border: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
  margin: 3rem 0;
}

.featured-exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.featured-exam-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.featured-exam-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.featured-exam-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #26890d;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.featured-questions-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
}

.featured-exam-content {
  padding: 1.25rem;
}

.featured-exam-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #212529);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8em;
}

.featured-exam-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.featured-exam-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary, #6c757d);
  font-size: 0.875rem;
  font-weight: 500;
}

.featured-exam-author i {
  font-size: 1rem;
}

/* Responsive design for featured exams */
@media (min-width: 768px) {
  .featured-exams-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .featured-exams-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .featured-exams-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .exam-list-table-view table { min-width: 1100px; }
  .section-container { padding: 2.5rem 3rem; }
}

@media (max-width: 576px) {
  .featured-exam-image {
    height: 180px;
  }
  
  .featured-exam-title {
    font-size: 1rem;
  }
  
  .featured-exam-content {
    padding: 1rem;
  }
  
  .section-container {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .section-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  
  .section-divider {
    margin: 2rem 0;
  }
}

/* ========== DARK MODE CONTRAST OVERRIDES ========== */
[data-theme="dark"] .host-exam-info { background: rgba(19, 104, 206, 0.15); }
[data-theme="dark"] .host-waiting-message { background: rgba(133, 100, 4, 0.2); }
[data-theme="dark"] .host-waiting-text { color: #f6cc48; }
[data-theme="dark"] .form-tip-box { background: rgba(3, 102, 114, 0.15); }
[data-theme="dark"] .form-tip-text { color: #67e8f9; }
[data-theme="dark"] .badge-modal-content { background: var(--bg-card); color: var(--text-primary); }
[data-theme="dark"] .option-correct-label { background: var(--bg-secondary); }
[data-theme="dark"] .completion-message { background: rgba(245, 158, 11, 0.12); border-color: #c07000; }
[data-theme="dark"] .featured-badges-section { background: rgba(59, 130, 246, 0.1); }
[data-theme="dark"] .start-adventure { background: rgba(59, 130, 246, 0.08); border-color: #3b82f6; }
[data-theme="dark"] .completion-message-text { color: #fcd34d; }
[data-theme="dark"] .featured-badges-title { color: #93c5fd; }
[data-theme="dark"] .start-adventure-title { color: #93c5fd; }
[data-theme="dark"] .start-adventure-text { color: #60a5fa; }

/* Text legibility on gold/silver gradient backgrounds */
.podium-card-gold .podium-name-lg, .podium-card-gold .podium-score-lg,
.podium-card-gold .podium-label,
.podium-gold .podium-name, .podium-gold .podium-score, .podium-gold .podium-label,
.podium-card-silver .podium-name-sm, .podium-card-silver .podium-score-sm,
.podium-card-silver .podium-label,
.podium-silver .podium-name, .podium-silver .podium-score, .podium-silver .podium-label,
.stat-box-gold .stat-number, .stat-box-gold .stat-text,
.result-card-gold .score-value, .result-card-silver .score-value {
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ========== HOST SCOREBOARD PAGE ========== */
@keyframes slideInUp {
  0% { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ========== HOST REVEAL PAGE ========== */
@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 8px 30px rgba(38, 166, 154, 0.3); }
}


/* ========== AUDIO CONTROLS COMPONENT ========== */
.audio-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.audio-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #333;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.audio-btn:active {
  transform: scale(0.95) !important;
}

.audio-settings-panel {
  display: none;
  position: absolute;
  top: 60px;
  right: 0;
  background: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
}

.audio-settings-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #333;
}

.audio-setting-item {
  margin-bottom: 10px;
}

.audio-setting-item:last-child {
  margin-bottom: 0;
}

.audio-setting-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.audio-slider {
  width: 100%;
  margin-top: 5px;
}

.audio-value-label {
  font-size: 11px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .audio-controls {
    top: 70px !important;
    right: 10px !important;
    z-index: 999;
  }
  
  .audio-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 22px !important;
  }
  
  .audio-settings-panel {
    right: -10px !important;
  }
}

/* ========== BADGE NOTIFICATION COMPONENT ========== */
@keyframes badgePopIn {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes badgeSpin {
  0% {
    transform: rotate(0deg) scale(0.5);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========== PAGE-SPECIFIC STYLES ========== */
/* Estilos espec�ficos extra�dos de templates individuales */

/* ========== FROM question_form.html ========== */
/* Estilizar campos del formulario */
  input[type="text"],
  input[type="number"],
  textarea,
  select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
  }

  input:focus,
  textarea:focus,
  select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(70, 23, 143, 0.1);
  }

  textarea {
    resize: vertical;
  }

  /* Estilo para inputs de opciones */
  .option-input {
    font-size: 1.1rem;
    font-weight: 500;
  }

  /* Checkbox personalizado */
  input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
  }

  /* Hover effect en las filas de opciones */
  .option-row:hover {
    transform: translateX(5px);
    transition: transform 0.2s ease;
  }

  /* Ocultar elementos de formset por defecto */
  input[type="hidden"] {
    display: none;
  }

  /* Grid para campos de tiempo y puntos */
  @media (min-width: 768px) {
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
    }
  }

/* ========== FROM profile.html ========== */
.badge-card:hover {
  transform: translateY(-5px);
}

.badge-card:hover .badge-tooltip {
  opacity: 1;
}

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

/* Dark mode adjustments */
body.dark-mode .badge-card {
  background: {% if user.is_authenticated %}var(--bg-secondary){% else %}#1f2937{% endif %} !important;
}

body.dark-mode .card {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

body.dark-mode .card-body {
  color: var(--text-primary);
}

/* Selected badge indicator */
.badge-card.selected {
  box-shadow: 0 0 0 4px #3b82f6 !important;
  transform: scale(1.05);
}

.badge-selected-star {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1rem;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

.badge-card.selected .badge-selected-star {
  display: block;
}

.selectable-badge {
  cursor: pointer !important;
}

.selectable-badge:active {
  transform: scale(0.95);
}

/* ========== FROM exam_form.html ========== */
/* Estilizar los campos del formulario generados por Django */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  textarea,
  select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
  }

  input:focus,
  textarea:focus,
  select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(70, 23, 143, 0.1);
  }

  textarea {
    min-height: 120px;
    resize: vertical;
  }

  /* Checkbox personalizado */
  input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
  }

  /* Animación al hacer hover en el checkbox */
  input[type="checkbox"]:hover {
    transform: scale(1.1);
  }

/* ========== FROM public_join_adapted.html ========== */
.participant-card {
        background: linear-gradient(135deg, #667eea11 0%, #764ba222 100%);
        border-left: 4px solid #667eea;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        transition: transform 0.2s;
    }
    
    .participant-card:hover {
        transform: translateX(5px);
    }
    
    .badge-showcase {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .badge-icon {
        font-size: 1.25rem;
        filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.4));
    }
    
    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }
    
    .ready-pulse {
        animation: pulse 2s infinite;
    }

/* ========== FROM join_input.html ========== */
@keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

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

  /* Auto-focus animation */
  #code:focus {
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% {
      box-shadow: 0 0 0 4px rgba(70, 23, 143, 0.1);
    }
    50% {
      box-shadow: 0 0 0 8px rgba(70, 23, 143, 0.05);
    }
  }

/* ========== FROM join_input_adapted.html ========== */
@keyframes bounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-15px); }
    }
    
    #code:focus {
        border-color: #667eea !important;
        box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25) !important;
    }
    
    @media (max-width: 768px) {
        .card-body {
            padding: 2rem 1.5rem !important;
        }
        
        h1 {
            font-size: 1.75rem !important;
        }
        
        #code {
            font-size: 1.5rem !important;
            letter-spacing: 0.3rem !important;
        }
    }

/* ========== FROM landing.html ========== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .grid > * {
    animation: fadeInUp 0.6s ease-out;
  }

  .grid > *:nth-child(1) { animation-delay: 0.1s; }
  .grid > *:nth-child(2) { animation-delay: 0.2s; }
  .grid > *:nth-child(3) { animation-delay: 0.3s; }

/* ========== FROM exam_list.html ========== */
/* Mejoras para la tabla de exámenes */
  .card .table-responsive table tbody tr:hover {
    background: rgba(70, 23, 143, 0.05);
    transform: translateX(5px);
  }
  
  [data-theme="dark"] .card .table-responsive table tbody tr:hover {
    background: rgba(106, 40, 204, 0.1);
  }

/* ========== FROM public_join.html ========== */
.badge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  }
  
  .badge-card:hover .badge-tooltip {
    opacity: 1;
  }



/* ==========================================================================
   EXAM LIST PAGE
   ========================================================================== */

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 600px) { .mode-cards { grid-template-columns: 1fr; } }
.mode-card {
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
  position: relative;
  overflow: hidden;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.mode-card--game { background: linear-gradient(135deg, #46178f 0%, #7827c8 100%); color: #fff; }
.mode-card--exam { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); color: #fff; }
.mode-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: rgba(255,255,255,.18);
  border-radius: 20px;
  padding: 3px 10px;
  width: fit-content;
}
.mode-card__icon { font-size: 2rem; line-height: 1; }
.mode-card__title { font-size: 1.15rem; font-weight: 800; color: #fff; margin: 0; }
.mode-card__desc { font-size: 0.82rem; color: rgba(255,255,255,.78); line-height: 1.5; margin: 0; }
.mode-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 120ms, transform 80ms;
  white-space: nowrap;
}
.mode-btn:active { transform: scale(0.96); }
.mode-btn--white      { background: #fff; color: #46178f; }
.mode-btn--white-exam { background: #fff; color: #1e40af; }
.mode-btn--outline {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.45);
}
.mode-btn--outline:hover { background: rgba(255,255,255,.25); }
.exam-mode-btn { background: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
.exam-mode-btn:hover { background: #1d4ed8 !important; border-color: #1d4ed8 !important; }

/* ==========================================================================
   PUBLIC JOIN PAGE
   ========================================================================== */

.effect-option {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.effect-option:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}
.effect-option.active {
  background: rgba(255,255,255,0.4);
  border-color: white;
  box-shadow: 0 0 15px rgba(255,255,255,0.5);
}
.effect-option.locked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(80%);
}
.effect-option.locked:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(0);
}

@keyframes titleGlowPulse {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(124,58,237,0.6),
      0 0 20px rgba(124,58,237,0.4),
      0 0 30px rgba(124,58,237,0.2);
    transform: scale(1);
  }
  50% {
    text-shadow:
      0 0 20px rgba(124,58,237,0.8),
      0 0 35px rgba(124,58,237,0.6),
      0 0 50px rgba(124,58,237,0.4),
      0 0 70px rgba(124,58,237,0.2);
    transform: scale(1.02);
  }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  50%  { transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@media (min-width: 992px) {
  .grid { grid-template-columns: 1fr 1fr !important; }
}

/* ==========================================================================
   EXAM LIST PAGE
   ========================================================================== */

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 600px) { .mode-cards { grid-template-columns: 1fr; } }
.mode-card {
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
  position: relative;
  overflow: hidden;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.mode-card--game { background: linear-gradient(135deg, #46178f 0%, #7827c8 100%); color: #fff; }
.mode-card--exam { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); color: #fff; }
.mode-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: rgba(255,255,255,.18);
  border-radius: 20px;
  padding: 3px 10px;
  width: fit-content;
}
.mode-card__icon { font-size: 2rem; line-height: 1; }
.mode-card__title { font-size: 1.15rem; font-weight: 800; color: #fff; margin: 0; }
.mode-card__desc { font-size: 0.82rem; color: rgba(255,255,255,.78); line-height: 1.5; margin: 0; }
.mode-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 120ms, transform 80ms;
  white-space: nowrap;
}
.mode-btn:active { transform: scale(0.96); }
.mode-btn--white      { background: #fff; color: #46178f; }
.mode-btn--white-exam { background: #fff; color: #1e40af; }
.mode-btn--outline {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.45);
}
.mode-btn--outline:hover { background: rgba(255,255,255,.25); }
.exam-mode-btn { background: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
.exam-mode-btn:hover { background: #1d4ed8 !important; border-color: #1d4ed8 !important; }

/* ==========================================================================
   PUBLIC JOIN PAGE
   ========================================================================== */

.effect-option {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.effect-option:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}
.effect-option.active {
  background: rgba(255,255,255,0.4);
  border-color: white;
  box-shadow: 0 0 15px rgba(255,255,255,0.5);
}
.effect-option.locked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(80%);
}
.effect-option.locked:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(0);
}

@keyframes titleGlowPulse {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(124,58,237,0.6),
      0 0 20px rgba(124,58,237,0.4),
      0 0 30px rgba(124,58,237,0.2);
    transform: scale(1);
  }
  50% {
    text-shadow:
      0 0 20px rgba(124,58,237,0.8),
      0 0 35px rgba(124,58,237,0.6),
      0 0 50px rgba(124,58,237,0.4),
      0 0 70px rgba(124,58,237,0.2);
    transform: scale(1.02);
  }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  50%  { transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@media (min-width: 992px) {
  .grid { grid-template-columns: 1fr 1fr !important; }
}

/* ==========================================================================
   QUIZ APP BASE LAYOUT (nav, theme selector, messages)
   ========================================================================== */

/* Nav links */
.qa-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.qa-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
}
.qa-nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.qa-nav-link--danger { color: rgba(255,160,160,0.9); }
.qa-nav-link--danger:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }
.qa-nav-link--outline { border: 1.5px solid rgba(255,255,255,0.35); }
.qa-nav-link--outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
}

/* Theme selector */
.qa-theme-selector { position: relative; margin-left: 6px; }
.qa-theme-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  cursor: pointer;
  font-size: 17px;
  transition: background 150ms, transform 200ms;
}
.qa-theme-trigger:hover { background: rgba(255,255,255,0.18); transform: scale(1.06); }
.qa-theme-trigger[aria-expanded="true"] {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}
.qa-theme-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 214px;
  background: var(--bg-card, #1D2040);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.65), 0 4px 12px rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: qa-pop-in 0.18s cubic-bezier(0.34,1.56,0.64,1) both;
}
.qa-theme-panel[hidden] { display: none !important; }
.qa-theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.78);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  font-family: inherit;
}
.qa-theme-option:hover  { background: rgba(255,255,255,0.08); color: #fff; }
.qa-theme-option.active { background: rgba(255,255,255,0.13); color: #fff; }
.qa-theme-option:focus-visible {
  outline: 2px solid var(--brand-light, #9B6DFF);
  outline-offset: 1px;
}
.qa-theme-option__swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.2);
}
[data-qa-theme="bright-playful"] .qa-theme-panel {
  background: #fff;
  border-color: rgba(124,58,237,0.15);
  box-shadow: 0 16px 48px rgba(100,60,200,0.22);
}
[data-qa-theme="bright-playful"] .qa-theme-option        { color: rgba(26,0,64,0.75); }
[data-qa-theme="bright-playful"] .qa-theme-option:hover  { background: rgba(124,58,237,0.08); color: #1a0040; }
[data-qa-theme="bright-playful"] .qa-theme-option.active { background: rgba(124,58,237,0.13); color: #1a0040; }

/* Django messages */
.messages { list-style: none; margin-bottom: 1rem; }
.message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  border-left: 3px solid rgba(255,255,255,0.25);
  color: var(--text-primary);
}
.message.success { border-left-color: var(--correct); background: var(--correct-bg); color: var(--correct); }
.message.error   { border-left-color: var(--incorrect); background: var(--incorrect-bg); color: var(--incorrect); }
.message.warning {
  border-left-color: var(--gold);
  background: rgba(245,158,11,0.1);
  color: var(--gold);
}

@media (max-width: 640px) {
  .qa-nav-link span { display: none; }
  .qa-header__title { font-size: 1rem; }
  .qa-header__nav { gap: 6px; }
  .qa-nav-link {
    padding: 8px;
    font-size: 1.25rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .qa-theme-selector { margin-left: 2px; }
  .qa-theme-trigger { width: 44px; height: 44px; font-size: 1.25rem; }
}

/* ==========================================================================
   QUIZ APP BASE LAYOUT (nav, theme selector, messages)
   ========================================================================== */

/* Nav links */
.qa-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.qa-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
}
.qa-nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.qa-nav-link--danger { color: rgba(255,160,160,0.9); }
.qa-nav-link--danger:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }
.qa-nav-link--outline { border: 1.5px solid rgba(255,255,255,0.35); }
.qa-nav-link--outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
}

/* Theme selector */
.qa-theme-selector { position: relative; margin-left: 6px; }
.qa-theme-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  cursor: pointer;
  font-size: 17px;
  transition: background 150ms, transform 200ms;
}
.qa-theme-trigger:hover { background: rgba(255,255,255,0.18); transform: scale(1.06); }
.qa-theme-trigger[aria-expanded="true"] {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}
.qa-theme-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 214px;
  background: var(--bg-card, #1D2040);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.65), 0 4px 12px rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: qa-pop-in 0.18s cubic-bezier(0.34,1.56,0.64,1) both;
}
.qa-theme-panel[hidden] { display: none !important; }
.qa-theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.78);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  font-family: inherit;
}
.qa-theme-option:hover  { background: rgba(255,255,255,0.08); color: #fff; }
.qa-theme-option.active { background: rgba(255,255,255,0.13); color: #fff; }
.qa-theme-option:focus-visible {
  outline: 2px solid var(--brand-light, #9B6DFF);
  outline-offset: 1px;
}
.qa-theme-option__swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.2);
}
[data-qa-theme="bright-playful"] .qa-theme-panel {
  background: #fff;
  border-color: rgba(124,58,237,0.15);
  box-shadow: 0 16px 48px rgba(100,60,200,0.22);
}
[data-qa-theme="bright-playful"] .qa-theme-option        { color: rgba(26,0,64,0.75); }
[data-qa-theme="bright-playful"] .qa-theme-option:hover  { background: rgba(124,58,237,0.08); color: #1a0040; }
[data-qa-theme="bright-playful"] .qa-theme-option.active { background: rgba(124,58,237,0.13); color: #1a0040; }

/* Django messages */
.messages { list-style: none; margin-bottom: 1rem; }
.message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  border-left: 3px solid rgba(255,255,255,0.25);
  color: var(--text-primary);
}
.message.success { border-left-color: var(--correct); background: var(--correct-bg); color: var(--correct); }
.message.error   { border-left-color: var(--incorrect); background: var(--incorrect-bg); color: var(--incorrect); }
.message.warning {
  border-left-color: var(--gold);
  background: rgba(245,158,11,0.1);
  color: var(--gold);
}

@media (max-width: 640px) {
  .qa-nav-link span { display: none; }
  .qa-header__title { font-size: 1rem; }
  .qa-header__nav { gap: 6px; }
  .qa-nav-link {
    padding: 8px;
    font-size: 1.25rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .qa-theme-selector { margin-left: 2px; }
  .qa-theme-trigger { width: 44px; height: 44px; font-size: 1.25rem; }
}
