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

html, body {
  height: 100%;
  background: #02080a;
  color: #d8efe8;
  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;
  /* deep ocean teal vertical fade with warm god-ray hint at top */
  background:
    radial-gradient(ellipse at 50% -5%, rgba(255, 220, 150, 0.10), transparent 55%),
    radial-gradient(ellipse at 50% 18%, rgba(120, 220, 200, 0.10), transparent 65%),
    linear-gradient(180deg, #0c3340 0%, #07202a 45%, #03121a 100%);
  border: 1px solid #0e2630;
  border-radius: 12px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    inset 0 0 80px rgba(0, 0, 0, 0.6),
    inset 0 0 160px rgba(0, 0, 0, 0.55);
  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, 15, 20, 0.7), 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;
}

/* Red team becomes WARM REEF (sunset-amber kelp polyps) */
.team.red .label, .team.red .score {
  color: #ffb86b;
  text-shadow: 0 0 14px rgba(255, 184, 107, 0.75), 0 0 2px rgba(255, 184, 107, 0.95);
}

/* Blue team becomes COLD CURRENT (kelp-frond green-cyan) */
.team.blue .label, .team.blue .score {
  color: #5dffc1;
  text-shadow: 0 0 14px rgba(93, 255, 193, 0.65), 0 0 2px rgba(93, 255, 193, 0.95);
}

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

.meta {
  text-align: center;
}

.meta .title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 6px;
  opacity: 0.9;
  color: #c8f0e2;
}

.meta .subtitle {
  font-size: 11px;
  letter-spacing: 3px;
  opacity: 0.55;
  margin-top: 4px;
  color: #9adcc6;
}

#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.5;
  pointer-events: none;
  color: #8fd0c0;
}

/* Tidal reversal screen-flash (replaces the earthquake shake) */
@keyframes tidalFlash {
  0%   { box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 80px rgba(0,0,0,0.6), inset 0 0 80px rgba(255,255,255,0.0); }
  50%  { box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 80px rgba(0,0,0,0.6), inset 0 0 100px rgba(120, 220, 200, 0.35); }
  100% { box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 80px rgba(0,0,0,0.6), inset 0 0 80px rgba(255,255,255,0.0); }
}

#stage.tidal-warning {
  animation: tidalFlash 0.65s ease-in-out infinite;
}

/* Soft drift wobble during a current change */
@keyframes drift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(0.8px, -0.6px); }
  100% { transform: translate(0, 0); }
}

#stage.shaking {
  animation: drift 2.4s ease-in-out infinite;
}
