/* ============================================================
   ESTILOS DEL CONCURSO: ¿QUIÉN QUIERE SER MILLONARIO DE LAS LETRAS?
   Emilia Pardo Bazán - Especial Bachillerato / PAU
   ============================================================ */

.game-viewport {
  background: radial-gradient(circle at center, #1e293b 0%, #0a0f1d 70%, #020617 100%);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(30, 58, 138, 0.2);
  min-height: 720px;
  position: relative;
  overflow: hidden;
}

/* ==========================================
   PANTALLA DE INICIO DEL JUEGO
   ========================================== */
.game-start-card {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 1.5rem;
}

.game-logo-wrap {
  margin-bottom: 1.5rem;
}

.game-logo-circle {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, #f59e0b 0%, #b45309 60%, #78350f 100%);
  border: 4px solid #fbbf24;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(245, 158, 11, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 45px rgba(245, 158, 11, 0.8); }
}

.game-start-card h2 {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.game-start-card .game-subtitle {
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.game-rules-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  text-align: left;
}

.rule-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.rule-box h4 {
  color: var(--gold);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rule-box p {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.timer-select-group {
  margin-bottom: 2rem;
}

.timer-select-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.timer-buttons {
  display: inline-flex;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 0.25rem;
  gap: 0.25rem;
}

.timer-option-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-option-btn.active {
  background: var(--gold);
  color: #0f172a;
  box-shadow: 0 0 10px var(--gold-glow);
}

.btn-game-giant {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  padding: 1rem 2.8rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 800;
  border: 2px solid #fde68a;
  border-radius: 40px;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-game-giant:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.9);
}

/* ==========================================
   PANTALLA DE JUEGO (PLATO TV & ESCALERA)
   ========================================== */
.game-play-layout {
  display: flex;
  gap: 1.5rem;
}

.game-stage-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Barra Superior: Comodines y Temporizador */
.game-lifelines-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 1rem;
}

.lifelines-group {
  display: flex;
  gap: 0.6rem;
}

.lifeline-btn {
  background: radial-gradient(circle, #1e3a8a 0%, #0f172a 100%);
  border: 2px solid var(--gold);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
  position: relative;
}

.lifeline-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 18px var(--gold);
}

.lifeline-btn.used,
.lifeline-btn:disabled {
  border-color: #475569;
  background: #1e293b;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.lifeline-btn.used::after {
  content: "✕";
  position: absolute;
  color: #ef4444;
  font-size: 1.8rem;
  font-weight: 900;
}

/* Reloj circular */
.game-timer-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timer-svg-wrap {
  position: relative;
  width: 60px;
  height: 60px;
}

.timer-svg-wrap svg {
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: #334155;
  stroke-width: 6;
}

.timer-bar-circle {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 251.2; /* 2 * PI * 40 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-seconds-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.btn-plantar {
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid var(--crimson);
  color: #fda4af;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-plantar:hover {
  background: var(--crimson);
  color: #fff;
}

/* Meta del juego actual */
.game-current-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.meta-level-pill {
  color: var(--text-secondary);
  font-weight: 600;
}

.meta-points-pill {
  color: var(--gold-light);
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 0 10px var(--gold-glow);
}

/* Caja de la Pregunta (Estilo Diamante Televisivo) */
.game-question-box {
  background: radial-gradient(ellipse at center, #1e3a8a 0%, #0f172a 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(30, 58, 138, 0.4), inset 0 0 15px rgba(245, 158, 11, 0.2);
  text-align: center;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-question-box p {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Opciones de Respuesta A, B, C, D */
.game-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.game-option-btn {
  background: linear-gradient(135deg, #172033 0%, #0f172a 100%);
  border: 2px solid #3b82f6;
  border-radius: 35px;
  padding: 1rem 1.4rem;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.game-option-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: linear-gradient(135deg, #1e293b 0%, #1e3a8a 100%);
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-2px);
}

.opt-badge {
  background: #1e3a8a;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.opt-text {
  flex: 1;
  line-height: 1.3;
}

/* Estados de las opciones */
.game-option-btn.opt-selected {
  background: #d97706 !important;
  border-color: #fde68a !important;
  color: #0f172a !important;
  animation: blinkSelect 0.6s infinite alternate;
}

.game-option-btn.opt-selected .opt-badge {
  background: #78350f;
  color: #fff;
}

@keyframes blinkSelect {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

.game-option-btn.opt-correct {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border-color: #6ee7b7 !important;
  color: #fff !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.8) !important;
}

.game-option-btn.opt-correct .opt-badge {
  background: #064e3b;
  border-color: #6ee7b7;
  color: #fff;
}

.game-option-btn.opt-wrong {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  border-color: #fca5a5 !important;
  color: #fff !important;
}

.game-option-btn.opt-wrong .opt-badge {
  background: #7f1d1d;
  color: #fff;
}

/* Escalera Lateral de Premios */
.game-ladder-sidebar {
  width: 250px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  box-shadow: var(--shadow-card);
}

.ladder-header {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--gold);
  text-align: center;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.ladder-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ladder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f59e0b;
  transition: all 0.2s ease;
}

.ladder-item.ladder-safe {
  color: #ffffff;
  font-weight: 700;
}

.ladder-item.ladder-active {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #0f172a !important;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.7);
  transform: scale(1.03);
}

.ladder-item.ladder-passed {
  color: #10b981;
}

.ladder-num {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ==========================================
   MODALES DEL JUEGO (FEEDBACK, EMILIA, PÚBLICO)
   ========================================== */
.game-modal-card {
  max-width: 600px;
  text-align: center;
}

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

.feedback-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.feedback-title.success {
  color: #34d399;
}

.feedback-title.failure {
  color: #f87171;
}

.feedback-points {
  font-size: 1.05rem;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.feedback-explanation {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.wrong-alert {
  background: rgba(225, 29, 72, 0.15);
  color: #fca5a5;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

/* Modal Doña Emilia */
.emilia-portrait-frame {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: radial-gradient(circle, #831843, #1e3a8a);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: 0 0 20px var(--gold-glow);
}

.emilia-quote-box {
  background: #0f172a;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: left;
  margin-bottom: 1.5rem;
}

.emilia-quote-box p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: #fef08a;
  line-height: 1.6;
}

/* Modal Público Ateneo (Gráfico de barras) */
.public-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 200px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1rem 1rem;
  margin-bottom: 1.5rem;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 50px;
}

.chart-bar-wrap {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 2px;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  border-radius: 2px;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 4px;
}

.chart-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.chart-label {
  font-weight: 800;
  color: var(--gold-light);
  font-size: 1.1rem;
}

/* ==========================================
   PANTALLA DE RESULTADOS & DIPLOMA
   ========================================== */
.game-end-card {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1.5rem;
}

.end-score-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  border: 2px solid var(--gold);
  border-radius: 30px;
  padding: 0.5rem 1.5rem;
  margin-bottom: 1.25rem;
}

.end-score-points {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: #fbbf24;
  font-weight: 800;
  text-shadow: 0 0 15px var(--gold-glow);
}

.end-score-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.end-score-reason {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.end-recommendation-box {
  background: #0f172a;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: left;
  margin-bottom: 2rem;
  font-size: 0.92rem;
  color: #cbd5e1;
}

/* ==========================================
   DIPLOMA ACADÉMICO IMPRIMIBLE
   ========================================== */
.diploma-editor-controls {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.diploma-editor-controls input {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  min-width: 280px;
}

.academic-diploma {
  background: #fdfbf7;
  color: #1c1917;
  border: 10px double #78350f;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  font-family: var(--font-serif);
}

.diploma-header h3 {
  font-size: 2rem;
  color: #78350f;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.diploma-header p {
  font-size: 0.95rem;
  color: #92400e;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.diploma-presents {
  font-size: 1rem;
  color: #44403c;
  margin-bottom: 0.5rem;
}

.diploma-student-name {
  font-size: 2.2rem;
  color: #1e3a8a;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #f59e0b;
  margin-bottom: 1rem;
  display: block;
}

.diploma-body {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  color: #292524;
}

.diploma-score-pill {
  display: inline-block;
  background: #fef3c7;
  border: 1px solid #d97706;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-weight: 700;
  color: #92400e;
  margin-top: 0.5rem;
}

.diploma-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #a8a29e;
}

.diploma-seal {
  font-size: 3rem;
  line-height: 1;
}

.diploma-sign {
  font-size: 0.85rem;
  color: #57534e;
}

.sign-line {
  width: 140px;
  height: 1px;
  background: #78350f;
  margin-bottom: 0.25rem;
}

/* Confeti */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 14px;
  top: -20px;
  z-index: 9999;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(105vh) rotate(720deg);
  }
}

/* ==========================================
   ESTILOS DE IMPRESIÓN (DIPLOMA)
   ========================================== */
@media print {
  body * {
    visibility: hidden;
  }
  .academic-diploma,
  .academic-diploma * {
    visibility: visible;
  }
  .academic-diploma {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: 8px double #000;
  }
}

/* Responsive del juego */
@media (max-width: 900px) {
  .game-play-layout {
    flex-direction: column;
  }
  .game-ladder-sidebar {
    width: 100%;
  }
  .ladder-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
  .game-options-grid {
    grid-template-columns: 1fr;
  }
}
