* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #06080f;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 540px;
  height: 960px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 150, 210, 0.18), transparent 55%),
    linear-gradient(180deg, #141a26 0%, #070a10 100%);
  border: 1px solid #2a3346;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.4);
  overflow: hidden;
}

#scoreboard {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
  z-index: 10;
  pointer-events: none;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
}

.team .label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  opacity: 0.85;
}

.team .score {
  font-family: "SF Mono", "Menlo", "Courier New", monospace;
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  margin-top: 2px;
  transition: transform 0.15s ease;
}

/* CREW = red, STATION AI = blue */
.team.red .label, .team.red .score {
  color: #ff5566;
  text-shadow: 0 0 14px rgba(255, 85, 102, 0.65), 0 0 2px rgba(255, 85, 102, 0.9);
}

.team.blue .label, .team.blue .score {
  color: #5aa8ff;
  text-shadow: 0 0 14px rgba(90, 168, 255, 0.65), 0 0 2px rgba(90, 168, 255, 0.9);
}

.score.bump { transform: scale(1.35); }

.meta {
  text-align: center;
}

.meta .title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 6px;
  opacity: 0.85;
}

.meta .subtitle {
  font-size: 11px;
  letter-spacing: 3px;
  opacity: 0.5;
  margin-top: 4px;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

.ticker {
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  text-align: center;
  font-family: "SF Mono", "Menlo", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 2px;
  opacity: 0.4;
  pointer-events: none;
}

/* Vent flash — brief red strobe when a ball is sucked out the hull vent */
@keyframes ventflash {
  0%   { box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.4), inset 0 0 120px rgba(255,58,74,0.0); }
  15%  { box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.4), inset -120px 0 140px rgba(255,58,74,0.8), 0 0 50px rgba(255,58,74,0.7); }
  50%  { box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.4), inset -90px 0 100px rgba(255,58,74,0.3); }
  100% { box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.4), inset 0 0 120px rgba(255,58,74,0.0); }
}

#stage.vent-flash {
  animation: ventflash 0.6s ease-out;
}

/* EQUALIZED window — subtle green safe-glow (airlock open) */
#stage.equalized {
  box-shadow: 0 30px 80px rgba(0,0,0,0.6),
              inset 0 0 60px rgba(0,0,0,0.4),
              0 0 36px rgba(61, 255, 160, 0.4);
}

/* BREACH window — pulsing red hull-stress glow */
@keyframes breachpulse {
  0%, 100% { box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.4), 0 0 30px rgba(255, 58, 74, 0.35); }
  50%      { box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.4), 0 0 52px rgba(255, 58, 74, 0.7); }
}

#stage.breaching {
  animation: breachpulse 1.4s ease-in-out infinite;
}
