/* ==========================================================
   FracTravesía - Estilos del Juego de Mesa Tradicional
   Con Mazo de Tarjetas 3D, Recorrido Sinuoso y Fichas Caricatura
   ========================================================== */

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

:root {
  --font-main: 'Fredoka', 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 50%, #fdf4ff 100%);

  /* Paletas de Zonas del Tablero */
  --c-valle: #dcfce7;
  --c-valle-border: #4ade80;
  --c-valle-text: #166534;

  --c-rio: #e0f2fe;
  --c-rio-border: #38bdf8;
  --c-rio-text: #0369a1;

  --c-montana: #f3e8ff;
  --c-montana-border: #c084fc;
  --c-montana-text: #6b21a8;

  --c-castillo: #fef3c7;
  --c-castillo-border: #fbbf24;
  --c-castillo-text: #92400e;

  /* Colores Principales */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(99, 102, 241, 0.12);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.18);
  --radius-xl: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Encabezado */
.app-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #fbcfe8, #f472b6);
  border-radius: 16px;
  padding: 6px 10px;
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.35);
}

.logo-title {
  font-size: 1.7rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.btn-header {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* ==========================================================
   PANTALLA DE CONFIGURACIÓN & SELECCIÓN DE CARICATURAS
   ========================================================== */
.setup-container {
  max-width: 780px;
  margin: 30px auto;
  padding: 32px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 3px solid #e0e7ff;
  text-align: center;
}

.setup-hero-title {
  font-size: 2.3rem;
  color: #312e81;
  margin-bottom: 8px;
}

.setup-hero-desc {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 24px;
}

.mode-selector {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 28px;
}

.mode-tab-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mode-tab-btn.active {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}

.player-config-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .player-config-cards {
    flex-direction: column;
  }
}

.player-config-card {
  flex: 1;
  background: #f8fafc;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  text-align: left;
}

.player-config-card label {
  font-weight: 700;
  color: #334155;
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: block;
}

.player-config-card input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  margin-bottom: 14px;
}

/* Grilla de Caricaturas con Colores Vivos */
.caricature-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.caricature-picker-grid label {
  cursor: pointer;
  position: relative;
  margin-bottom: 0;
}

.caricature-picker-grid input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.caricature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  transition: all 0.2s ease;
}

.caricature-item .c-emoji {
  font-size: 1.8rem;
  line-height: 1.2;
}

.caricature-item .c-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  margin-top: 4px;
}

.caricature-picker-grid input[type="radio"]:checked + .caricature-item {
  transform: scale(1.08);
  border-color: currentColor;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-start-game {
  width: 100%;
  padding: 16px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  transition: all 0.25s ease;
}

.btn-start-game:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.45);
}

/* ==========================================================
   PANTALLA DE JUEGO: LAYOUT Y TABLERO
   ========================================================== */
.game-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 20px;
  padding: 20px 28px;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1080px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

/* Panel Lateral */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.turn-banner-card {
  background: #ffffff;
  padding: 18px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 2px solid #e2e8f0;
  text-align: center;
}

.turn-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  border: 2px solid transparent;
}

.turn-human {
  background: #eff6ff;
  color: #1e3a8a;
}

.turn-bot {
  background: #f5f3ff;
  color: #5b21b6;
}

/* Dado */
.dice-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.dice-face {
  font-size: 4.8rem;
  line-height: 1;
  color: #4f46e5;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 6px 12px rgba(79, 70, 229, 0.25));
}

.dice-face.rolling {
  animation: dice-shake 0.4s infinite ease-in-out;
}

@keyframes dice-shake {
  0% { transform: rotate(0deg) scale(1.1); }
  25% { transform: rotate(-15deg) scale(1.15); }
  50% { transform: rotate(15deg) scale(1.15); }
  75% { transform: rotate(-10deg) scale(1.1); }
  100% { transform: rotate(0deg) scale(1.1); }
}

.dice-result {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 8px;
  min-height: 28px;
}

.btn-roll {
  width: 100%;
  padding: 14px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
}

.btn-roll:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.btn-roll:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Tarjetas de Jugadores */
.players-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-status-card {
  background: #ffffff;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s ease;
}

.player-status-card.active-player-card {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: scale(1.02);
}

.player-card-avatar {
  font-size: 2.2rem;
  background: #f8fafc;
  border-radius: 14px;
  padding: 4px 8px;
  border: 2px solid #cbd5e1;
}

.player-card-info {
  flex: 1;
}

.player-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1e293b;
}

.player-card-pos {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 700;
}

/* Mazo Visual en el Panel Lateral */
.deck-widget-card {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 2px solid #e2e8f0;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.deck-widget-preview {
  width: 90px;
  height: 125px;
  margin: 8px auto;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
  border: 3px solid #ffffff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
}

.deck-widget-preview::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.deck-widget-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  margin-top: 4px;
}

/* ==========================================================
   TABLERO COMO RECORRIDO DE JUEGO DE MESA (70 CASILLAS)
   ========================================================== */
.board-container {
  background: #0284c7; /* Azul clásico de tablero como en Imagen 1 */
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.22) 1.5px, transparent 1.5px),
    linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  background-size: 24px 24px, 100% 100%;
  padding: 16px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 0 10px #1e293b, 0 0 0 14px #fbbf24;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 4px dashed rgba(255, 255, 255, 0.4);
}

/* Tablero de 70 casillas con proporción de juego de mesa */
.winding-track-board {
  position: relative;
  width: 100%;
  aspect-ratio: 10 / 8;
  min-height: 640px;
  max-height: 860px;
}

@media (max-width: 900px) {
  .winding-track-board {
    min-height: 520px;
  }
}

/* Carretera / Cinta continua en SVG */
.track-road-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.road-ribbon-outer {
  stroke: #fbbf24;
  stroke-width: 52px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.road-ribbon-inner {
  stroke: #dc2626; /* Pista roja viva tradicional */
  stroke-width: 44px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.road-ribbon-dashed {
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-dasharray: 10, 14;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0.85;
}

/* Casillas individuales sobre la pista (70 casillas) */
.board-tile-70 {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}

.board-tile-70:hover {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.tile-70-num {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.tile-70-icon {
  font-size: 0.95rem;
  line-height: 1;
  margin-top: 2px;
}

/* Colores de las 4 Zonas de Fracciones */
.board-tile-70.zone-valle {
  background: #fef08a; /* Amarillo brillante como Imagen 1 */
  border-color: #f59e0b;
  color: #991b1b;
}

.board-tile-70.zone-rio {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

.board-tile-70.zone-montana {
  background: #f3e8ff;
  border-color: #9333ea;
  color: #6b21a8;
}

.board-tile-70.zone-castillo {
  background: #ffedd5;
  border-color: #ea580c;
  color: #9a3412;
}

/* Casillas especiales */
.board-tile-70.tile-type-finish {
  background: linear-gradient(135deg, #fef08a, #f59e0b, #ef4444) !important;
  border-color: #ffffff !important;
  color: #7f1d1d !important;
  width: 52px;
  height: 52px;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.9), 0 6px 14px rgba(0, 0, 0, 0.4) !important;
  animation: pulse-glow 2s infinite ease-in-out;
  z-index: 15;
}

.board-tile-70.tile-type-start {
  background: #22c55e !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  font-weight: 800;
}

/* Insignias de atajo y meta */
.tile-bonus-tag {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tile-finish-tag {
  position: absolute;
  bottom: -9px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid #ffffff;
}

.tile-start-tag {
  position: absolute;
  bottom: -9px;
  background: #15803d;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid #ffffff;
}

.tile-pawns-slot-70 {
  position: absolute;
  top: -24px;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Fichas Caricatura */
.caricature-pawn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

.pawn-pedestal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 1.25rem;
}

.pawn-label-pill {
  position: absolute;
  bottom: -9px;
  background: #1e293b;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  white-space: nowrap;
  border: 1px solid currentColor;
}

.bounce-anim {
  animation: bounce 0.4s ease;
}

@keyframes bounce {
  0% { transform: scale(0.6) translateY(0); }
  50% { transform: scale(1.2) translateY(-8px); }
  100% { transform: scale(1) translateY(0); }
}

/* ==========================================================
   MODAL 1: ORDEN DE LA CASILLA (Antes de sacar la tarjeta)
   ========================================================== */
.order-modal-card {
  text-align: center;
  max-width: 500px;
}

.order-tile-badge-pill {
  display: inline-block;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.order-tile-icon-huge {
  font-size: 4rem;
  margin: 10px 0;
}

.order-tile-heading {
  font-size: 1.6rem;
  color: #1e293b;
  margin-bottom: 12px;
}

.order-box {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 22px;
}

.order-player-greeting {
  font-size: 1.1rem;
  color: #334155;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.order-instruction-text {
  font-size: 1.15rem;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.4;
}

/* ==========================================================
   MODAL 2: TARJETA DE FRACCIONES 3D A EXTRAER DEL MAZO
   ========================================================== */
.card-modal-overlay {
  perspective: 1200px;
}

.flip-card-wrapper {
  width: 100%;
  max-width: 620px;
  min-height: 480px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.flip-card-wrapper.is-flipped {
  transform: rotateY(180deg);
}

/* Caras de la tarjeta */
.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

/* Dorso de la Tarjeta */
.card-back {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  border: 6px solid #ffffff;
  padding: 30px;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  cursor: pointer;
}

.card-back-pattern {
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.card-back-icon {
  font-size: 5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  animation: bounce 1.4s infinite alternate ease-in-out;
}

.card-back-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.card-back-sub {
  font-size: 1rem;
  opacity: 0.9;
}

/* Frente de la Tarjeta */
.card-front {
  background: #ffffff;
  border: 4px solid #e0e7ff;
  padding: 24px 28px;
  transform: rotateY(180deg);
  overflow-y: auto;
}

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

.card-player-pill {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 4px 14px;
  border-radius: 20px;
  border: 2px solid;
}

.card-category-badge {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 20px;
}

.question-prompt {
  font-size: 1.35rem;
  color: #1e293b;
  margin-bottom: 20px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

/* Fracciones */
.math-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 1.15em;
  line-height: 1;
  padding: 0 4px;
}

.math-frac .num {
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
}

.math-frac .bar {
  display: none;
}

.math-frac .den {
  padding-top: 1px;
}

.math-whole {
  font-size: 1.3em;
  font-weight: 700;
  margin-right: 4px;
  vertical-align: middle;
}

.math-mixed {
  display: inline-flex;
  align-items: center;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Opciones */
.modal-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.option-card {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-align: left;
}

.option-card:hover:not(:disabled) {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-2px);
}

.opt-letter {
  background: #e2e8f0;
  color: #475569;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}

.option-card.correct-card {
  border-color: var(--accent-green);
  background: #ecfdf5;
  color: #065f46;
}

.option-card.correct-card .opt-letter {
  background: var(--accent-green);
  color: #fff;
}

.option-card.wrong-card {
  border-color: var(--accent-red);
  background: #fef2f2;
  color: #991b1b;
  opacity: 0.6;
  cursor: not-allowed;
  transform: scale(0.97);
}

/* Pista */
.hint-box {
  background: #fffbeb;
  border: 2px dashed #f59e0b;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: #92400e;
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Alertas */
.alert-success-box {
  background: #ecfdf5;
  border: 2px solid #10b981;
  color: #065f46;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 1.1rem;
}

.alert-oops-box {
  background: #fef2f2;
  border: 2px solid #ef4444;
  color: #991b1b;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 1.1rem;
}

/* Modal de Explicación Paso a Paso */
.explanation-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
}

.explanation-step-item {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.step-text {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.4;
}

.explanation-tip-card {
  background: #fdf2f8;
  border: 2px solid #f472b6;
  border-radius: var(--radius-md);
  padding: 14px;
  color: #831843;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 20px;
}

.btn-primary-action {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* Problemas contextuales */
.problem-context-badge {
  display: inline-block;
  background: #ffedd5;
  color: #c2410c;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.problem-story-text {
  font-size: 1.15rem;
  line-height: 1.45;
  color: #1e293b;
}

/* Modales Genéricos */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 620px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  border: 3px solid #e0e7ff;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

/* Pantalla de Victoria */
.victory-card {
  text-align: center;
  max-width: 520px;
}

.victory-trophy {
  font-size: 5rem;
  margin-bottom: 8px;
  animation: bounce 1s infinite alternate ease-in-out;
}

.victory-winner-avatar {
  font-size: 4rem;
  margin: 10px 0;
}

.victory-title {
  font-size: 2.2rem;
  color: #b45309;
  margin-bottom: 10px;
}

.hidden {
  display: none !important;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
