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

html, body {
  height: 100%;
  background: #e8e4d8;
  color: #2a2a2a;
  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;
  /* Off-white microscope slide background with faint graph-paper grid */
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.5), transparent 70%),
    linear-gradient(0deg, rgba(180, 170, 150, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 170, 150, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(180, 170, 150, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 170, 150, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, #f4f0e2 0%, #e6e0cf 100%);
  background-size:
    auto,
    20px 20px,
    20px 20px,
    100px 100px,
    100px 100px,
    auto;
  border: 2px solid #b8a98a;
  border-radius: 12px;
  box-shadow:
    0 30px 80px rgba(40, 30, 0, 0.35),
    inset 0 0 80px rgba(120, 100, 60, 0.18),
    inset 0 0 6px rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

/* Circular vignette to suggest a microscope viewing field */
#stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 50%, rgba(60, 50, 20, 0.25) 100%);
  z-index: 5;
}

#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(232, 224, 200, 0.85), rgba(232, 224, 200, 0));
  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: 800;
  letter-spacing: 4px;
  opacity: 0.85;
  font-family: "SF Mono", "Menlo", "Courier New", monospace;
}

.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;
}

.team.red .label, .team.red .score {
  color: #c4218a;
  text-shadow: 0 0 10px rgba(196, 33, 138, 0.45);
}

.team.blue .label, .team.blue .score {
  color: #0e8a8a;
  text-shadow: 0 0 10px rgba(14, 138, 138, 0.45);
}

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

.meta {
  text-align: center;
}

.meta .title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 5px;
  opacity: 0.85;
  color: #3a2a4a;
  font-family: "SF Mono", "Menlo", "Courier New", monospace;
}

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

#game {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.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.55;
  color: #4a3a2a;
  pointer-events: none;
  z-index: 11;
}

/* Cell-division event uses a soft "centrifuge" pulse rather than earthquake shake */
@keyframes mitosis-pulse {
  0%   { transform: scale(1) rotate(0); filter: hue-rotate(0deg); }
  20%  { transform: scale(1.005) rotate(0.15deg); filter: hue-rotate(10deg); }
  50%  { transform: scale(1.012) rotate(-0.15deg); filter: hue-rotate(-12deg); }
  80%  { transform: scale(1.005) rotate(0.1deg); filter: hue-rotate(6deg); }
  100% { transform: scale(1) rotate(0); filter: hue-rotate(0deg); }
}

#stage.shaking {
  animation: mitosis-pulse 0.6s ease-in-out infinite;
  box-shadow:
    0 30px 80px rgba(40, 30, 0, 0.35),
    inset 0 0 80px rgba(120, 100, 60, 0.18),
    inset 0 0 6px rgba(255, 255, 255, 0.6),
    0 0 60px rgba(196, 33, 138, 0.45);
}
