/**
 * host.css - Estilos para la Pantalla Principal (Proyector / Smart TV)
 */

.host-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 24px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0b1120 70%, #030712 100%);
}

/* Header Superior */
.host-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #1e293b;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.room-pin-badge {
  background: #1e293b;
  border: 2px solid #3b82f6;
  border-radius: var(--border-radius-md);
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pin-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
}

.pin-code {
  font-family: monospace;
  font-size: 1.8rem;
  font-weight: 900;
  color: #60a5fa;
  letter-spacing: 2px;
}

.host-controls {
  display: flex;
  gap: 12px;
}

/* Cuerpo Principal dividido en 2 columnas: Pista y Escenario */
.host-main {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  flex: 1;
  margin-top: 16px;
  min-height: 0;
}

/* Columna Izquierda: Pista de 42 KM */
.track-panel {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #1e293b;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

.track-title {
  font-size: 1.3rem;
  color: #cbd5e1;
}

.track-lanes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  justify-content: space-around;
}

.lane {
  background: #111c2e;
  border-radius: var(--border-radius-md);
  padding: 10px 14px;
  border: 1px solid #1e293b;
  transition: all 0.3s ease;
}

.lane.active-turn {
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
  background: #17253d;
}

.lane-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}

.team-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-km {
  font-family: monospace;
  font-size: 1.15rem;
  color: #fbbf24;
}

.progress-track {
  position: relative;
  height: 18px;
  background: #090d16;
  border-radius: 9999px;
  overflow: visible;
  border: 1px solid #233554;
}

.progress-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.pawn {
  position: absolute;
  right: -12px;
  top: -8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
  border: 2px solid currentColor;
  transition: transform 0.2s;
}

.pawn:hover {
  transform: scale(1.15);
}

.checkpoints-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
  padding: 0 2px;
}

/* Carril de La Ignorancia */
.lane-ignorancia {
  background: #1c0a0a;
  border: 1px solid #7f1d1d;
}
.lane-ignorancia.active-turn {
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}
.lane-ignorancia .progress-track {
  background: #0d0303;
  border-color: #551414;
}
.lane-ignorancia .progress-bar {
  background: linear-gradient(90deg, #7f1d1d, #ef4444);
}
.lane-ignorancia .pawn {
  background: #000;
  color: #ef4444;
  border-color: #ef4444;
}

/* Columna Derecha: Escenario Activo */
.stage-panel {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #1e293b;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Barra de Turno Activo */
.turn-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #1e293b;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
}

.turn-team-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.6rem;
}

.vocero-tag {
  background: #0f172a;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.95rem;
  color: #38bdf8;
  border: 1px solid #0284c7;
}

/* Dado Animado */
.dice-container {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #111c2e;
  padding: 16px 24px;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
}

.dice-cube {
  width: 70px;
  height: 70px;
  background: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  color: #0b1120;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4), inset 0 -4px 6px rgba(0,0,0,0.2);
  transition: transform 0.5s ease;
}

.dice-rolling {
  animation: diceSpin 0.7s infinite linear;
}

@keyframes diceSpin {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(0.9); }
}

.dice-text {
  flex: 1;
}

.dice-title {
  font-size: 1.25rem;
  color: #cbd5e1;
}
.dice-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
}

/* Tarjeta de Pregunta Gigante */
.question-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0b1324;
  border: 2px solid #233554;
  border-radius: var(--border-radius-md);
  padding: 24px;
  position: relative;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.km-stake-badge {
  background: #d97706;
  color: white;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question-text {
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 700;
  margin-bottom: 24px;
  color: #f8fafc;
  min-height: 90px;
}

/* Barra de Tiempo */
.timer-container {
  margin-bottom: 24px;
}

.timer-bar-track {
  height: 12px;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 9999px;
  transition: width 1s linear, background-color 0.3s;
}

.timer-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.timer-bar-fill.critical {
  background: #ef4444;
  box-shadow: 0 0 15px #ef4444;
  animation: pulseGlow 0.5s infinite;
}

/* Opciones A, B, C, D */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.option-box {
  background: #152238;
  border: 2px solid #283e65;
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.3rem;
  font-weight: 600;
  color: #e2e8f0;
  transition: all 0.25s;
  position: relative;
}

.option-letter {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.option-box.correct {
  background: #064e3b;
  border-color: #10b981;
  color: #ecfdf5;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}
.option-box.correct .option-letter {
  background: #10b981;
  color: #064e3b;
}

.option-box.wrong {
  background: #450a0a;
  border-color: #ef4444;
  color: #fef2f2;
  opacity: 0.7;
}

.option-box.discarded {
  opacity: 0.25;
  text-decoration: line-through;
  filter: grayscale(1);
}

/* Votos de equipo flotantes en la opción */
.voters-container {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}

.voter-tag {
  background: #3b82f6;
  color: white;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 9999px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Overlay de Resolución (Acierto o Ignorancia) */
.resolution-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 17, 32, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  z-index: 50;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.res-banner {
  font-size: 3rem;
  margin-bottom: 12px;
}

.res-subtitle {
  font-size: 1.6rem;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.res-explanation {
  background: #1e293b;
  padding: 18px 28px;
  border-radius: var(--border-radius-md);
  max-width: 700px;
  font-size: 1.25rem;
  color: #94a3b8;
  border-left: 4px solid #3b82f6;
}

/* Modal de QR / Código de Sala */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: #1e293b;
  padding: 32px;
  border-radius: var(--border-radius-lg);
  border: 2px solid #3b82f6;
  text-align: center;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

#qrcode-canvas {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  background: white;
  padding: 16px;
  border-radius: var(--border-radius-md);
}

/* Vista Lobby (Antes de Iniciar Partida) */
.lobby-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.lobby-team-card {
  background: #111c2e;
  border: 2px solid #1e293b;
  border-radius: var(--border-radius-md);
  padding: 16px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.lobby-team-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1e293b;
}

.lobby-members-list {
  list-style: none;
  flex: 1;
}

.lobby-member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #1e293b;
  border-radius: var(--border-radius-sm);
  margin-bottom: 6px;
  font-size: 0.95rem;
}
