* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #050001;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #ffffff;
}

/* Canvas de Confeti en todo el fondo/frente */
#celebrationCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Contenedor principal que centra y escala el marcador en cualquier pantalla */
.viewport-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #8b0010 0%, #3a0006 40%, #0a0102 85%, #000000 100%);
  position: relative;
}

/* Patrón de líneas deportivas animadas de fondo */
.viewport-wrapper::before {
  content: "";
  position: absolute;
  inset: -100px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 24px);
  animation: moveBg 25s linear infinite;
  pointer-events: none;
}

/* Resplandor de fondo inferior */
.viewport-wrapper::after {
  content: "";
  position: absolute;
  bottom: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(224, 0, 22, 0.15), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

@keyframes moveBg {
  to {
    transform: translate3d(100px, 100px, 0);
  }
}

/* El Stage (Dimensiones de diseño fijas: 576x864, relación de aspecto 2:3) */
.stage {
  position: relative;
  width: 576px;
  height: 864px;
  min-width: 576px;
  min-height: 864px;
  overflow: hidden;
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
  transition: transform 0.1s ease-out;
}

/* Ribbon superior */
.top-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-pill {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #c40016;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.live-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e00016;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.4);
  }
}

.brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #ffcbd0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
  text-align: center;
  margin-top: 15px;
}

.cup {
  font-size: 64px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hero h1 {
  font-family: 'Syne', sans-serif;
  margin: 6px 0 4px;
  font-size: 36px;
  line-height: 0.95;
  text-transform: uppercase;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 40%, #ffc5c8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.hero p {
  margin: 0 auto;
  max-width: 480px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffb8bd;
}

/* Contenedor Lado a Lado (Marcador + Mascota) */
.middle-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  height: 480px;
  width: 100%;
  position: relative;
}

/* Tarjeta del Marcador (Glassmorphism de alta calidad) */
.score-card {
  width: 375px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #111111;
  border-radius: 36px;
  padding: 24px 16px 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  position: relative;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  z-index: 2;
}

/* Animación de fade para transición de partidos */
.score-card.changing {
  opacity: 0.2;
  transform: scale(0.95);
}

.status-badge {
  display: inline-block;
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #c40016;
  color: #ffffff;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  box-shadow: 0 6px 18px rgba(196, 0, 22, 0.4);
}

.teams-container {
  display: grid;
  grid-template-columns: 1fr 110px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.team-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.name {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  color: #1a1a1a;
  letter-spacing: -0.2px;
}

/* Puntuación */
.score-board {
  height: 96px;
  border-radius: 20px;
  background: #111111;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 48px;
  font-weight: 900;
  box-shadow: inset 0 -6px 0 rgba(255, 255, 255, 0.05), 0 8px 20px rgba(0, 0, 0, 0.15);
  padding: 0 8px;
}

.score-board span {
  font-variant-numeric: tabular-nums;
}

.colon {
  color: #e00016;
  font-size: 36px;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.details {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #555555;
  letter-spacing: 0.1px;
}

/* Zona de la mascota Bomssi al costado */
.bomssi-zone {
  width: 137px;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.bomssi {
  position: absolute;
  bottom: 0px;
  right: -10px;
  width: 250px;
  height: 360px;
  object-fit: contain;
  animation: bomssiDance 2s ease-in-out infinite;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.5));
  z-index: 4;
}

/* Fallback de mascota si no cargan la imagen */
.bomssi-fallback {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 5px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  place-items: center;
  background: #ffffff;
  font-size: 72px;
  animation: bomssiDance 2s ease-in-out infinite;
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
  border: 4px solid #c40016;
  z-index: 4;
}

/* Burbuja de diálogo flotante (arriba de Bomssi) */
.speech-bubble {
  position: absolute;
  bottom: 365px;
  right: 15px;
  width: 160px;
  background: #ffffff;
  color: #c40016;
  padding: 10px 12px;
  border-radius: 20px 20px 4px 20px;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: floatSpeech 2.5s ease-in-out infinite;
  z-index: 5;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 32px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 0 8px;
  border-color: #ffffff transparent transparent transparent;
}

/* Ráfaga de Gol (Efecto visual) */
.goal-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-10deg);
  font-family: 'Syne', sans-serif;
  font-size: 64px;
  font-weight: 900;
  color: #ffd400;
  text-shadow: 
    0 4px 0 #84000d,
    0 8px 0 #4f0006,
    0 0 30px rgba(255, 212, 0, 0.8);
  opacity: 0;
  z-index: 15;
  white-space: nowrap;
  pointer-events: none;
}

.goal-burst.show {
  animation: goalPop 1.8s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

@keyframes bomssiDance {
  0%, 100% {
    transform: translateY(0) rotate(-2deg) scale(1);
  }
  50% {
    transform: translateY(-12px) rotate(3deg) scale(1.03);
  }
}

@keyframes floatSpeech {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes goalPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(-20deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15) rotate(-6deg);
  }
  30% {
    transform: translate(-50%, -50%) scale(1) rotate(-8deg);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(-8deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.3) rotate(-5deg);
  }
}

/* Estilo para Sacudida de Pantalla */
.stage.goal-celebration {
  animation: screenShake 0.5s ease-in-out infinite;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 3px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}

/* Animación de Mascota en GOL */
.bomssi.goal-celebration {
  animation: bomssiGoalCeleb 1.8s ease-in-out !important;
}

@keyframes bomssiGoalCeleb {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  15% { transform: translateY(-40px) scale(1.2) rotate(-15deg); }
  30% { transform: translateY(0) scale(1) rotate(10deg); }
  45% { transform: translateY(-30px) scale(1.15) rotate(-10deg); }
  60% { transform: translateY(0) scale(1) rotate(5deg); }
  75% { transform: translateY(-15px) scale(1.05) rotate(-5deg); }
}

/* Banner de Promoción */
.promo {
  margin-top: 15px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 26px;
  padding: 16px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.promo-header {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #ffd400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.promo-text-carousel {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  transition: opacity 0.3s ease;
}

/* Footer */
footer {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  margin-top: 10px;
}
