/* ====== Reset y base ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --celeste: #75AADB;
  --celeste-dark: #4a86c5;
  --blanco: #ffffff;
  --azul: #1d3b6e;
  --dorado: #ffd34e;
}

html, body {
  height: 100%;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  background: radial-gradient(circle at 50% 0%, #0b1f3a 0%, #06101f 70%);
  color: var(--blanco);
  overflow-x: hidden;
}

/* Canvas de efectos a pantalla completa */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hidden { display: none !important; }

/* ====== Pantalla de apertura ====== */
.intro {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.intro-inner {
  animation: floatIn 1.2s ease-out both;
}

.shield {
  margin: 0 auto 24px;
  filter: drop-shadow(0 8px 24px rgba(117, 170, 219, 0.6));
  animation: pulse 2.4s ease-in-out infinite;
}

.intro-title {
  font-size: clamp(2.4rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--celeste), var(--blanco), var(--dorado));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(117, 170, 219, 0.4);
  animation: glow 2s ease-in-out infinite alternate;
}

.intro-sub {
  margin-top: 12px;
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #cfe2f7;
  opacity: 0.9;
}

.start-btn {
  margin-top: 36px;
  padding: 16px 38px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--azul);
  background: linear-gradient(135deg, var(--dorado), #fff3c4);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 211, 78, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.start-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 40px rgba(255, 211, 78, 0.7); }
.start-btn:active { transform: translateY(0) scale(0.98); }

/* ====== Pantalla de festejo ====== */
.fiesta {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  gap: 28px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(117, 170, 219, 0.18);
  border: 1px solid rgba(117, 170, 219, 0.5);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--celeste);
  animation: fadeUp 0.8s ease both;
}

.hero-title {
  font-size: clamp(2rem, 7vw, 4.4rem);
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(90deg, var(--celeste), var(--blanco), var(--dorado), var(--celeste));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite, fadeUp 0.8s ease both;
}

.hero-sub {
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  color: #d7e7f8;
  animation: fadeUp 1s ease both;
}

/* Marcador */
.scoreboard {
  display: flex;
  align-items: center;
  gap: clamp(16px, 5vw, 48px);
  padding: 22px 34px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(117, 170, 219, 0.35);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: fadeUp 1.1s ease both;
}

.team { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.team .flag { font-size: 2.6rem; }
.team-name { font-weight: 800; letter-spacing: 1px; font-size: 0.95rem; }
.team-arg .team-name { color: var(--celeste); }
.team-eng .team-name { color: #ff9a9a; }

.score {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 900;
}
.score-num { min-width: 1.4ch; }
.score-sep { opacity: 0.5; }

.final-result {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: var(--dorado);
  animation: fadeUp 1.3s ease both;
}

/* Zona de juego: contadores + botones */
.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: fadeUp 1.4s ease both;
}

.game-label {
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--dorado);
  text-shadow: 0 0 18px rgba(255, 211, 78, 0.55);
  animation: glow 2s ease-in-out infinite alternate;
}

.counters {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.counter {
  padding: 12px 22px;
  border-radius: 16px;
  font-size: clamp(1.05rem, 3vw, 1.5rem);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(117, 170, 219, 0.5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.counter span {
  display: inline-block;
  min-width: 1.6ch;
  font-size: 1.25em;
  font-weight: 900;
  color: var(--dorado);
  text-shadow: 0 0 14px rgba(255, 211, 78, 0.7);
}
.counter-confeti { border-color: rgba(117, 170, 219, 0.7); }
.counter-fireworks { border-color: rgba(255, 211, 78, 0.7); }

.actions { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.action-btn {
  padding: 20px 40px;
  font-size: clamp(1.1rem, 3.4vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--azul);
  background: linear-gradient(135deg, var(--dorado), #fff3c4);
  border: 3px solid var(--blanco);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(255, 211, 78, 0.55), 0 0 0 0 rgba(255, 211, 78, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: btnPulse 1.6s ease-in-out infinite;
}
.action-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 18px 44px rgba(255, 211, 78, 0.8), 0 0 26px rgba(255, 211, 78, 0.7);
}
.action-btn:active {
  transform: translateY(2px) scale(0.92);
  box-shadow: 0 6px 16px rgba(255, 211, 78, 0.5);
  animation: none;
}

/* Variante celeste para el botón de confeti, manteniendo la paleta albiceleste/dorado */
#confeti-btn {
  color: var(--blanco);
  background: linear-gradient(135deg, var(--celeste), var(--celeste-dark));
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 30px rgba(74, 134, 197, 0.6), 0 0 0 0 rgba(117, 170, 219, 0.6);
}
#confeti-btn:hover {
  box-shadow: 0 18px 44px rgba(74, 134, 197, 0.85), 0 0 26px rgba(117, 170, 219, 0.8);
}
#confeti-btn:active {
  box-shadow: 0 6px 16px rgba(74, 134, 197, 0.6);
}

.foot { margin-top: 12px; font-size: 0.85rem; color: #9fb6d4; opacity: 0.8; }

/* ====== Animaciones ====== */
@keyframes floatIn {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes glow {
  from { filter: drop-shadow(0 0 8px rgba(117,170,219,0.4)); }
  to   { filter: drop-shadow(0 0 22px rgba(255,211,78,0.7)); }
}
@keyframes shimmer {
  from { background-position: 0% 50%; }
  to   { background-position: 300% 50%; }
}
@keyframes btnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 30px rgba(255, 211, 78, 0.55), 0 0 0 0 rgba(255, 211, 78, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 16px 38px rgba(255, 211, 78, 0.75), 0 0 22px 6px rgba(255, 211, 78, 0.45); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
