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

html, body {
  height: 100%;
  /* Stark white laboratory backdrop */
  background: #f4f6f9;
  color: #0c2a44;
  font-family: "SF Mono", "Menlo", "Courier New", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 540px;
  height: 960px;
  /* clean lab whitewall with subtle measurement-grid wash */
  background:
    repeating-linear-gradient(0deg,  rgba(20, 80, 180, 0.04) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(20, 80, 180, 0.04) 0 1px, transparent 1px 40px),
    linear-gradient(180deg, #ffffff 0%, #e9eef6 100%);
  border: 1px solid #b9c6db;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(20, 60, 120, 0.20),
              inset 0 0 60px rgba(120, 160, 220, 0.10);
  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(245, 250, 255, 0.92), rgba(245, 250, 255, 0));
  border-bottom: 1px solid rgba(40, 110, 200, 0.18);
  z-index: 10;
  pointer-events: none;
}

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

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

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

/* Treat "red" / "blue" as the two detection channels: |ψ⟩ and |φ⟩.
   Keep the score-element class names so JS doesn't need to relearn them. */
.team.red .label, .team.red .score {
  color: #ff3da6;
  text-shadow: 0 0 10px rgba(255, 61, 166, 0.35);
}

.team.blue .label, .team.blue .score {
  color: #15c8ff;
  text-shadow: 0 0 10px rgba(21, 200, 255, 0.45);
}

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

.meta {
  text-align: center;
}

.meta .title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 5px;
  opacity: 0.85;
  color: #0c2a44;
}

.meta .subtitle {
  font-size: 10px;
  letter-spacing: 3px;
  opacity: 0.6;
  margin-top: 4px;
  color: #2a4e75;
}

#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: 10px;
  letter-spacing: 2px;
  opacity: 0.55;
  color: #15405d;
  pointer-events: none;
}

/* Decoherence event (renamed from "earthquake"): a phase-collapse shake. */
@keyframes quake {
  0%   { transform: translate(0, 0) rotate(0); }
  10%  { transform: translate(-2px, 1px) rotate(0.15deg); }
  20%  { transform: translate(3px, -2px) rotate(-0.2deg); }
  30%  { transform: translate(-3px, 1px) rotate(0.12deg); }
  40%  { transform: translate(2px, -1px) rotate(-0.15deg); }
  50%  { transform: translate(-2px, 2px) rotate(0.2deg); }
  60%  { transform: translate(2px, -1px) rotate(-0.12deg); }
  70%  { transform: translate(-2px, -1px) rotate(0.10deg); }
  80%  { transform: translate(3px, 1px) rotate(-0.10deg); }
  90%  { transform: translate(-1px, -1px) rotate(0.12deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

#stage.shaking {
  animation: quake 0.32s linear infinite;
  box-shadow: 0 30px 80px rgba(20, 60, 120, 0.20),
              inset 0 0 60px rgba(120, 160, 220, 0.10),
              0 0 40px rgba(21, 200, 255, 0.55);
}
