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

html, body {
  height: 100%;
  /* Parchment-cream wash framing the dark wood stage. */
  background: radial-gradient(ellipse at 50% 35%, #f5ead0 0%, #d8c69a 70%, #a88a55 100%);
  color: #3a2a13;
  font-family: "Cormorant Garamond", "Hoefler Text", "Baskerville", "Georgia", serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 540px;
  height: 960px;
  /* Ebony / dark walnut interior with a warm brass glow descending from the top. */
  background:
    radial-gradient(ellipse at 50% 8%, rgba(212, 158, 84, 0.30), transparent 55%),
    linear-gradient(180deg, #2a1d10 0%, #1a1208 55%, #0d0805 100%);
  /* Gear-tooth decorative border drawn with a repeating conic edge */
  border: 6px solid transparent;
  border-image: repeating-linear-gradient(45deg,
    #b8893f 0px, #b8893f 6px,
    #7a5421 6px, #7a5421 12px,
    #3d2811 12px, #3d2811 18px) 6;
  border-radius: 14px;
  box-shadow:
    0 30px 80px rgba(40, 25, 8, 0.7),
    inset 0 0 80px rgba(0,0,0,0.55),
    inset 0 0 12px rgba(184, 137, 63, 0.25);
  overflow: hidden;
}

/* Decorative gear-tooth interior frame on top of the stage */
#stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    /* horizontal top brass rule */
    linear-gradient(180deg, rgba(184, 137, 63, 0.0) 0%, rgba(184, 137, 63, 0.0) 88px, rgba(184, 137, 63, 0.55) 88px, rgba(184, 137, 63, 0.55) 91px, transparent 91px),
    /* horizontal bottom brass rule */
    linear-gradient(0deg,   rgba(184, 137, 63, 0.0) 0%, rgba(184, 137, 63, 0.0) 86px, rgba(184, 137, 63, 0.45) 86px, rgba(184, 137, 63, 0.45) 89px, transparent 89px);
  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(38, 26, 12, 0.92), rgba(38, 26, 12, 0.55) 70%, rgba(38, 26, 12, 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: 700;
  letter-spacing: 6px;
  font-variant: small-caps;
  color: #f5ead0;
  opacity: 0.85;
  font-family: "Cormorant Garamond", "Hoefler Text", "Baskerville", "Georgia", serif;
}

.team .score {
  font-family: "Cormorant Garamond", "Hoefler Text", "Baskerville", "Georgia", serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
  transition: transform 0.18s ease;
  letter-spacing: 1px;
}

.team.red .label, .team.red .score {
  /* Crimson velvet — palace heraldry */
  color: #d94f5c;
  text-shadow: 0 0 14px rgba(217, 79, 92, 0.50), 0 1px 2px rgba(0,0,0,0.6);
}

.team.blue .label, .team.blue .score {
  /* Royal sapphire */
  color: #6db0e6;
  text-shadow: 0 0 14px rgba(109, 176, 230, 0.55), 0 1px 2px rgba(0,0,0,0.6);
}

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

.meta { text-align: center; }

.meta .title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 6px;
  font-variant: small-caps;
  color: #e8c890;
  text-shadow: 0 0 8px rgba(232, 200, 144, 0.55), 0 1px 2px rgba(0,0,0,0.7);
}

.meta .subtitle {
  font-size: 11px;
  letter-spacing: 4px;
  opacity: 0.65;
  margin-top: 4px;
  color: #f5ead0;
  font-variant: small-caps;
}

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

/* ===== Bell HUD — bottom-right column ===== */
#bell-hud {
  position: absolute;
  right: 12px;
  top: 102px;
  width: 96px;
  z-index: 9;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(26, 18, 8, 0.55);
  border: 1px solid rgba(184, 137, 63, 0.55);
  border-radius: 6px;
  padding: 8px 6px 9px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.55), inset 0 0 18px rgba(184, 137, 63, 0.12);
}

.bell-shell {
  position: relative;
  width: 72px;
  height: 92px;
}

.bell-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(232, 200, 144, 0.35));
}

.bell-numeral {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 18px;
  font-family: "Cormorant Garamond", "Hoefler Text", "Baskerville", "Georgia", serif;
  font-size: 32px;
  font-weight: 700;
  color: #3a2410;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.45);
  letter-spacing: 1px;
  transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}

.bell-numeral.chiming {
  transform: scale(1.32);
  color: #ffe9a8;
  text-shadow: 0 0 18px rgba(255, 233, 168, 0.95), 0 0 6px rgba(255, 200, 80, 0.9);
}

.bell-caption {
  font-size: 8px;
  letter-spacing: 3px;
  font-variant: small-caps;
  color: #e8c890;
  opacity: 0.85;
  text-align: center;
}

.bell-progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bell-progress-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: #f5ead0;
  opacity: 0.75;
  text-align: center;
  font-family: "SF Mono", Menlo, monospace;
}

.bell-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(60, 40, 20, 0.85);
  border: 1px solid rgba(184, 137, 63, 0.55);
  border-radius: 2px;
  overflow: hidden;
}

.bell-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b8893f, #ffe9a8);
  transition: width 0.18s ease;
}

.bell-active {
  font-size: 9px;
  letter-spacing: 2px;
  font-variant: small-caps;
  color: #ffe9a8;
  text-align: center;
  min-height: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
  text-shadow: 0 0 8px rgba(255, 233, 168, 0.8);
}

.bell-active.on { opacity: 1; }

.ticker {
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  text-align: center;
  font-family: "Cormorant Garamond", "Hoefler Text", "Baskerville", "Georgia", serif;
  font-size: 12px;
  letter-spacing: 2px;
  font-variant: small-caps;
  color: #e8c890;
  opacity: 0.55;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* "Earthquake" reused as a clockwork-shudder when a tower-shake event triggers — slower, woody */
@keyframes quake {
  0%   { transform: translate(0, 0) rotate(0); }
  15%  { transform: translate(-2px, 1px) rotate(0.18deg); }
  30%  { transform: translate(3px, -2px) rotate(-0.22deg); }
  45%  { transform: translate(-3px, 1px) rotate(0.15deg); }
  60%  { transform: translate(2px, -1px) rotate(-0.18deg); }
  75%  { transform: translate(-2px, 2px) rotate(0.2deg); }
  90%  { transform: translate(2px, -1px) rotate(-0.1deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

#stage.shaking {
  animation: quake 0.42s linear infinite;
  box-shadow:
    0 30px 80px rgba(40, 25, 8, 0.7),
    inset 0 0 80px rgba(0,0,0,0.55),
    0 0 38px rgba(184, 137, 63, 0.55);
}
