/* CINEBOMB 💣 — ESTILOS CINEMATOGRÁFICOS DE ALTO IMPACTO */
:root {
  --bg-primary: #08090d;
  --bg-secondary: #12141c;
  --bg-card: rgba(22, 25, 38, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(245, 158, 11, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-amber: #f59e0b;
  --accent-flame: #ff5e3a;
  --accent-red: #ef4444;
  --accent-glow: rgba(245, 158, 11, 0.25);
  --success: #22c55e;
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(239, 68, 68, 0.05) 0%, transparent 50%);
}

/* Contenedor tipo Aplicación Móvil centrada */
.app-container {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 24px;
  position: relative;
  backdrop-filter: blur(10px);
}

/* Cabecera */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease;
}

.brand-logo-img:hover {
  transform: scale(1.08);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-pill {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.score-pill small {
  font-size: 0.7rem;
  opacity: 0.8;
  font-weight: 600;
}

.streak-pill {
  background: rgba(255, 94, 58, 0.12);
  border: 1px solid rgba(255, 94, 58, 0.35);
  color: var(--accent-flame);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Banner de Desafío de Rival */
.rival-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-top: 10px;
  text-align: center;
  font-size: 0.82rem;
  color: #fef08a;
  animation: slide-up 0.3s ease;
}

/* Área de la Bomba y Mecha Viva */
.bomb-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 14px;
  position: relative;
}

.bomb-wrapper {
  position: relative;
  width: 170px;
  height: 185px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bomb-wrapper.panic {
  animation: bomb-panic-pulse 0.4s infinite alternate ease-in-out;
}

.bomb-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
}

/* Tipografía dentro de la bomba */
.bomb-timer-digits {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 800;
  fill: #ffffff;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
  letter-spacing: -1px;
}

.bomb-wrapper.panic .bomb-timer-digits {
  fill: #ef4444;
  filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.9));
}

.bomb-timer-sub {
  font-family: var(--font-main);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  fill: var(--text-muted);
}

/* Animaciones de la chispa de fuego */
.spark-pulse {
  animation: spark-burn 0.12s infinite alternate;
}

.spark-ray {
  animation: spark-scatter 0.2s infinite ease-out;
}

.ray-1 { animation-delay: 0.05s; }
.ray-2 { animation-delay: 0.1s; }
.ray-3 { animation-delay: 0.15s; }

@keyframes spark-burn {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 1; }
}

@keyframes spark-scatter {
  0% { opacity: 0.3; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes bomb-panic-pulse {
  0% { transform: scale(1) rotate(-1.5deg); }
  100% { transform: scale(1.07) rotate(1.5deg); }
}

/* Tarjeta del Actor Activo */
.active-actor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.active-actor-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-amber), transparent);
}

.actor-photo-wrapper {
  position: relative;
  flex-shrink: 0;
}

.actor-photo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-amber);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

.actor-meta {
  flex: 1;
  min-width: 0;
}

.turn-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-amber);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.actor-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actor-hints {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* Barra de Búsqueda Predictiva */
.search-section {
  position: relative;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 15px 16px 15px 44px;
  font-size: 1rem;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: #151824;
}

.search-icon {
  position: absolute;
  left: 15px;
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Menú Desplegable Predictivo */
.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #141724;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.suggestions-dropdown.open {
  display: block;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

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

.suggestion-item:hover, .suggestion-item:active {
  background: rgba(245, 158, 11, 0.1);
}

.suggestion-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.suggestion-movies {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cadena de Actores Quemados */
.chain-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.chain-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.chain-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding-bottom: 6px;
}

.chain-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chain-chip.burned {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Feedback / Mensaje de Validación */
.feedback-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-size: 0.88rem;
  display: none;
  animation: slide-up 0.25s ease;
}

.feedback-banner.success {
  display: block;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.feedback-banner.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Botón de WhatsApp */
.action-panel {
  margin-top: auto;
  padding-top: 16px;
}

.btn-whatsapp {
  width: 100%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(37, 211, 102, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-whatsapp:hover, .btn-whatsapp:active {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-whatsapp svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Modales Genéricos (Bienvenida Desafío & Resultados) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 13, 0.92);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #141724;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  max-width: 390px;
  width: 100%;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.1);
  animation: pop-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-badge-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
  display: inline-block;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.4));
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 18px;
}

/* Caja de Objetivo en Bienvenida */
.duel-target-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.duel-target-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-amber);
  font-weight: 700;
}

.duel-target-score {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fef08a;
}

.btn-primary-action {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-primary-action:hover, .btn-primary-action:active {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Caja de Puntuación en Resultados */
.score-display-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 14px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-display-label {
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.score-display-number {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fbbf24;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.4));
}

.rank-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fef08a;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 6px;
}

/* Mini Grid de Estadísticas */
.stats-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-mini-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.stat-mini-val {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.stat-mini-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Veredicto del Duelo */
.duel-verdict-box {
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
  animation: slide-up 0.25s ease;
}

.duel-verdict-box.win {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.duel-verdict-box.lose {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-restart {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s ease;
}

.btn-restart:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Animaciones */
@keyframes pulse-bomb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes jitter {
  0%, 100% { transform: rotate(-90deg) translate(0, 0); }
  25% { transform: rotate(-90deg) translate(-1px, 1px); }
  75% { transform: rotate(-90deg) translate(1px, -1px); }
}

@keyframes pop-in {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.camera-shake {
  animation: shake 0.4s ease;
}
