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

html, body {
  height: 100%;
  background: #021419;
  color: #ecfeff;
  font-family: "Marker Felt", "Permanent Marker", "Comic Sans MS", -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(180, 240, 255, 0.35), transparent 55%),
    radial-gradient(ellipse at 30% 80%, rgba(64, 200, 220, 0.20), transparent 60%),
    radial-gradient(ellipse at 80% 60%, rgba(120, 255, 220, 0.18), transparent 55%),
    linear-gradient(180deg, #5bd4e0 0%, #1d8aa5 40%, #0a4858 80%, #032634 100%);
  border: 2px solid #2bb3c4;
  border-radius: 14px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    inset 0 0 100px rgba(0, 180, 200, 0.25),
    inset 0 0 30px rgba(0, 50, 80, 0.5);
  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,30,40,0.65), rgba(0,30,40,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.95;
  font-family: "Marker Felt", "Permanent Marker", "Comic Sans MS", sans-serif;
}

.team .score {
  font-family: "Marker Felt", "Permanent Marker", "Comic Sans MS", sans-serif;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  margin-top: 2px;
  transition: transform 0.15s ease;
}

.team.red .label, .team.red .score {
  color: #ff8a3d;
  text-shadow: 0 0 14px rgba(255, 138, 61, 0.85), 0 0 3px rgba(255, 200, 100, 0.9);
}

.team.blue .label, .team.blue .score {
  color: #f55fd0;
  text-shadow: 0 0 14px rgba(245, 95, 208, 0.85), 0 0 3px rgba(255, 180, 255, 0.9);
}

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

.meta {
  text-align: center;
}

.meta .title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #d6fffd;
  text-shadow: 0 0 12px rgba(180, 255, 240, 0.7);
}

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

#reef-meter {
  position: absolute;
  top: 86px;
  left: 20px;
  right: 20px;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9;
  pointer-events: none;
}

.meter-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #ffe9b8;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(255, 200, 100, 0.6);
  flex-shrink: 0;
}

.meter-track {
  flex: 1;
  height: 10px;
  background: rgba(0, 30, 40, 0.55);
  border: 1px solid rgba(120, 230, 240, 0.6);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.45);
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff8a3d 0%, #f55fd0 50%, #a35bff 100%);
  box-shadow: 0 0 12px rgba(245, 95, 208, 0.7);
  transition: width 0.25s ease-out;
}

#meter-pct {
  font-size: 11px;
  font-weight: 800;
  color: #ffe9b8;
  letter-spacing: 1px;
  min-width: 36px;
  text-align: right;
  text-shadow: 0 0 6px rgba(255, 200, 100, 0.6);
}

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

.ticker {
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  text-align: center;
  font-family: "Marker Felt", "Permanent Marker", "Comic Sans MS", sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.65;
  color: #d6fffd;
  text-shadow: 0 0 6px rgba(120, 255, 220, 0.5);
  pointer-events: none;
}

/* Reef "bloom" celebration — pulsing aquamarine glow */
@keyframes bloom {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 1px); }
  50%  { transform: translate(2px, -1px); }
  75%  { transform: translate(-1px, 2px); }
  100% { transform: translate(0, 0); }
}

#stage.shaking {
  animation: bloom 0.6s ease-in-out infinite;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    inset 0 0 120px rgba(255, 180, 80, 0.45),
    inset 0 0 60px rgba(245, 95, 208, 0.4),
    0 0 60px rgba(255, 180, 80, 0.7);
  border-color: #ffd980;
}
