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

html, body {
  height: 100%;
  background: #1a1208;
  color: #f4e3b5;
  font-family: "Trajan Pro", "Cinzel", "Times New Roman", Georgia, serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 540px;
  height: 960px;
  background:
    /* warm sandy haze near the top, like sunlight on the arena floor */
    radial-gradient(ellipse at 50% 0%, rgba(255, 200, 120, 0.32), transparent 62%),
    /* faint amber dust pooling along the bottom */
    radial-gradient(ellipse at 50% 100%, rgba(180, 110, 40, 0.4), transparent 65%),
    /* main warm stone gradient */
    linear-gradient(180deg, #b38a4a 0%, #7a5224 45%, #4a2f12 100%);
  border: 2px solid #6d4a1c;
  border-radius: 12px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    inset 0 0 80px rgba(40, 20, 8, 0.65),
    inset 0 0 24px rgba(255, 200, 120, 0.15);
  overflow: hidden;
}

/* Subtle stone-block texture overlay */
#stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(60, 40, 20, 0.18) 0,
      rgba(60, 40, 20, 0.18) 1px,
      transparent 1px,
      transparent 64px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(60, 40, 20, 0.18) 0,
      rgba(60, 40, 20, 0.18) 1px,
      transparent 1px,
      transparent 48px
    );
  mix-blend-mode: multiply;
  opacity: 0.45;
}

#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(20, 10, 4, 0.7), rgba(20, 10, 4, 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: 900;
  letter-spacing: 5px;
  opacity: 0.95;
  font-variant: small-caps;
}

.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: #d62a2a;
  text-shadow:
    0 0 14px rgba(214, 42, 42, 0.75),
    0 0 2px rgba(255, 200, 100, 0.9),
    0 1px 0 rgba(50, 10, 0, 0.9);
}

.team.blue .label, .team.blue .score {
  color: #3b6fb5;
  text-shadow:
    0 0 14px rgba(59, 111, 181, 0.65),
    0 0 2px rgba(255, 220, 160, 0.7),
    0 1px 0 rgba(10, 20, 50, 0.9);
}

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

.meta {
  text-align: center;
}

.meta .title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #f8d77a;
  text-shadow:
    0 0 10px rgba(248, 215, 122, 0.55),
    0 1px 0 rgba(40, 20, 0, 0.9);
}

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

/* Crowd Favor meter sits below scoreboard, above canvas */
#favor-bar {
  position: absolute;
  top: 84px;
  left: 24px;
  right: 24px;
  height: 28px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  font-family: "SF Mono", "Menlo", monospace;
}

.favor-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: #f8d77a;
  text-shadow: 0 0 6px rgba(248, 215, 122, 0.6);
  flex-shrink: 0;
  font-weight: 800;
}

.favor-track {
  flex: 1;
  height: 10px;
  background:
    linear-gradient(180deg, rgba(20, 10, 4, 0.85), rgba(40, 22, 10, 0.85));
  border: 1px solid rgba(180, 130, 60, 0.6);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.favor-fill {
  height: 100%;
  width: 0%;
  background:
    linear-gradient(90deg,
      #c4361d 0%,
      #e07a1a 45%,
      #f8d77a 80%,
      #fff4c0 100%);
  box-shadow:
    0 0 12px rgba(255, 200, 80, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.25s ease-out;
}

.favor-status {
  font-size: 9px;
  letter-spacing: 2px;
  color: #e6c98a;
  flex-shrink: 0;
  font-weight: 800;
  min-width: 110px;
  text-align: right;
}

.favor-status.champion {
  color: #fff4c0;
  text-shadow: 0 0 12px rgba(255, 230, 120, 0.95);
  animation: champion-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes champion-pulse {
  from { opacity: 0.85; }
  to   { opacity: 1; text-shadow: 0 0 18px rgba(255, 230, 120, 1); }
}

#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.7;
  pointer-events: none;
  color: #f4e3b5;
  z-index: 11;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

@keyframes quake {
  0%   { transform: translate(0, 0) rotate(0); }
  10%  { transform: translate(-3px, 2px) rotate(0.25deg); }
  20%  { transform: translate(4px, -3px) rotate(-0.3deg); }
  30%  { transform: translate(-4px, 1px) rotate(0.2deg); }
  40%  { transform: translate(3px, -2px) rotate(-0.25deg); }
  50%  { transform: translate(-2px, 3px) rotate(0.3deg); }
  60%  { transform: translate(3px, -1px) rotate(-0.2deg); }
  70%  { transform: translate(-3px, -2px) rotate(0.15deg); }
  80%  { transform: translate(4px, 2px) rotate(-0.15deg); }
  90%  { transform: translate(-2px, -1px) rotate(0.2deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

#stage.shaking {
  animation: quake 0.32s linear infinite;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    inset 0 0 80px rgba(40, 20, 8, 0.65),
    0 0 50px rgba(220, 90, 30, 0.7);
}

#stage.champion {
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    inset 0 0 100px rgba(60, 30, 12, 0.7),
    inset 0 0 40px rgba(255, 215, 100, 0.5),
    0 0 50px rgba(255, 215, 100, 0.65);
}
