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

html, body {
  height: 100%;
  background: #05060a;
  color: #f4e6c8;
  font-family: "Georgia", "Times New Roman", -apple-system, serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 540px;
  height: 960px;
  /* deep charcoal cabin with a warm amber lantern glow up top and furnace ember at bottom edge */
  background:
    radial-gradient(ellipse at 50% 4%, rgba(255, 176, 82, 0.16), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 96, 26, 0.28), transparent 42%),
    linear-gradient(180deg, #16130e 0%, #0b0906 62%, #17100a 100%);
  border: 1px solid #2a2118;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 80px rgba(0,0,0,0.55);
  overflow: hidden;
}

/* Frosted-window vignette overlay */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background: radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(6, 8, 12, 0.72) 100%);
  box-shadow: inset 0 0 90px rgba(180, 200, 220, 0.05);
}

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

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

.team .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.85;
  font-family: "SF Mono", Menlo, monospace;
}

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

.team.red .label, .team.red .score {
  color: #ff7a5c;
  text-shadow: 0 0 14px rgba(255, 122, 92, 0.6), 0 0 2px rgba(255, 122, 92, 0.9);
}

.team.blue .label, .team.blue .score {
  color: #7fb9e6;
  text-shadow: 0 0 14px rgba(127, 185, 230, 0.55), 0 0 2px rgba(127, 185, 230, 0.9);
}

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

.meta { text-align: center; }

.meta .title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #f6d79a;
  opacity: 0.92;
  text-shadow: 0 0 12px rgba(255, 176, 82, 0.4);
  font-family: "SF Mono", Menlo, monospace;
}

.meta .subtitle {
  font-size: 10px;
  letter-spacing: 3px;
  opacity: 0.5;
  margin-top: 4px;
  font-family: "SF Mono", Menlo, monospace;
}

#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;
  color: #f4d9a0;
  opacity: 0.5;
  pointer-events: none;
  z-index: 9;
}

/* Track-switch lurch shake — a heavier, lateral carriage jolt */
@keyframes lurch {
  0%   { transform: translate(0, 0) rotate(0); }
  12%  { transform: translate(-7px, 1px) rotate(0.35deg); }
  26%  { transform: translate(6px, -2px) rotate(-0.4deg); }
  40%  { transform: translate(-5px, 2px) rotate(0.3deg); }
  55%  { transform: translate(5px, -1px) rotate(-0.28deg); }
  70%  { transform: translate(-4px, 1px) rotate(0.22deg); }
  85%  { transform: translate(3px, -1px) rotate(-0.18deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

#stage.lurching {
  animation: lurch 0.30s linear infinite;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7),
              inset 0 0 80px rgba(0,0,0,0.55),
              0 0 44px rgba(255, 176, 82, 0.5);
}

/* Warning pre-lurch: gentle amber pulse on the frame */
@keyframes warnpulse {
  0%, 100% { box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 80px rgba(0,0,0,0.55), 0 0 12px rgba(255, 210, 90, 0.25); }
  50%      { box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 80px rgba(0,0,0,0.55), 0 0 34px rgba(255, 210, 90, 0.7); }
}

#stage.warning {
  animation: warnpulse 0.5s ease-in-out infinite;
}
