/* Marble Cascade — Gold Rush Saloon
 * Theme: Wild West saloon, sepia + oak browns, hand-lettered signage, golden nuggets.
 */

@import url('https://fonts.googleapis.com/css2?family=Rye&family=Smokum&family=Special+Elite&display=swap');

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

html, body {
  height: 100%;
  background: #1d1108;
  color: #f4d9a7;
  font-family: "Special Elite", "Courier New", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 540px;
  height: 960px;
  /* Wood-plank framing — outer border evokes saloon wall */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(180, 120, 60, 0.30), transparent 65%),
    repeating-linear-gradient(180deg,
      #3a2410 0px,
      #4a2e15 1px,
      #3a2410 2px,
      #2e1c0b 3px),
    linear-gradient(180deg, #4a2e15 0%, #1d1108 100%);
  border: 14px solid #5a3a1c;
  border-radius: 10px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.7),
    inset 0 0 80px rgba(0,0,0,0.55),
    inset 0 0 0 2px #2a1a09,
    inset 0 0 0 14px #6a4524;
  overflow: hidden;
  /* sepia overlay subtly tints everything warm */
  filter: sepia(0.12) saturate(1.05);
}

/* Wooden plank grain on the inside border */
#stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 80px,
      rgba(0,0,0,0.18) 80px 82px),
    repeating-linear-gradient(0deg,
      transparent 0 60px,
      rgba(0,0,0,0.10) 60px 62px);
  mix-blend-mode: multiply;
  z-index: 1;
}

#scoreboard {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background:
    linear-gradient(180deg, rgba(60, 30, 10, 0.85), rgba(40, 20, 6, 0.0)),
    repeating-linear-gradient(90deg,
      transparent 0 4px,
      rgba(0,0,0,0.06) 4px 5px);
  z-index: 10;
  pointer-events: none;
  border-bottom: 2px solid #6a4524;
}

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

.team .label {
  font-family: "Rye", "Special Elite", serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  opacity: 0.95;
}

.team .score {
  font-family: "Smokum", "Rye", serif;
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
  margin-top: 2px;
  transition: transform 0.15s ease;
}

.team.red .label, .team.red .score {
  color: #c1382c;  /* rust red */
  text-shadow:
    0 0 12px rgba(193, 56, 44, 0.55),
    1px 1px 0 #2a0b06,
    2px 2px 0 rgba(0,0,0,0.5);
}

.team.blue .label, .team.blue .score {
  /* "Blue" reskinned to tan/cream for saloon — keeps the duality but stays in palette */
  color: #e8c474;
  text-shadow:
    0 0 12px rgba(232, 196, 116, 0.55),
    1px 1px 0 #3a2310,
    2px 2px 0 rgba(0,0,0,0.5);
}

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

.meta {
  text-align: center;
}

.meta .title {
  font-family: "Rye", serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #e8c474;
  text-shadow:
    1px 1px 0 #2a1a09,
    0 0 10px rgba(232, 196, 116, 0.4);
}

.meta .subtitle {
  font-family: "Special Elite", monospace;
  font-size: 11px;
  letter-spacing: 3px;
  opacity: 0.65;
  margin-top: 4px;
  color: #d4a574;
}

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

.ticker {
  position: absolute;
  left: 0; right: 0;
  bottom: 8px;
  text-align: center;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.55;
  pointer-events: none;
  color: #e8c474;
  z-index: 5;
}

/* Dynamite TNT plunger HUD — top center under scoreboard */
#tnt-hud {
  position: absolute;
  top: 102px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: linear-gradient(180deg, rgba(80, 40, 12, 0.85), rgba(50, 24, 6, 0.85));
  border: 2px solid #8a4a24;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,200,140,0.18);
  font-family: "Rye", serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: #f4d9a7;
  z-index: 8;
  pointer-events: none;
}

#tnt-hud .label {
  font-family: "Rye", serif;
  color: #e8c474;
  text-shadow: 1px 1px 0 #2a0b06;
}

#tnt-hud .timer {
  font-family: "Smokum", serif;
  font-size: 22px;
  color: #ff6a32;
  text-shadow:
    0 0 10px rgba(255, 106, 50, 0.85),
    1px 1px 0 #2a0b06;
  min-width: 38px;
  text-align: center;
}

#tnt-hud.armed .timer {
  animation: tnt-pulse 0.5s ease-in-out infinite alternate;
}

#tnt-hud.danger .timer {
  color: #ff2818;
  animation: tnt-pulse 0.16s ease-in-out infinite alternate;
}

@keyframes tnt-pulse {
  from { transform: scale(1); text-shadow: 0 0 8px rgba(255, 106, 50, 0.8), 1px 1px 0 #2a0b06; }
  to   { transform: scale(1.18); text-shadow: 0 0 20px rgba(255, 40, 24, 1), 1px 1px 0 #2a0b06; }
}

#tnt-hud .icon {
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(255, 106, 50, 0.6));
}

/* Dynamite boom screen-shake — replaces earthquake quake animation */
@keyframes boom {
  0%   { transform: translate(0, 0) rotate(0); }
  8%   { transform: translate(-7px, 5px) rotate(0.4deg); }
  16%  { transform: translate(8px, -6px) rotate(-0.45deg); }
  24%  { transform: translate(-6px, 3px) rotate(0.35deg); }
  32%  { transform: translate(5px, -4px) rotate(-0.3deg); }
  40%  { transform: translate(-4px, 4px) rotate(0.25deg); }
  50%  { transform: translate(3px, -2px) rotate(-0.2deg); }
  62%  { transform: translate(-3px, 2px) rotate(0.18deg); }
  74%  { transform: translate(2px, -1px) rotate(-0.12deg); }
  88%  { transform: translate(-1px, 1px) rotate(0.08deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

#stage.shaking {
  animation: boom 0.55s linear;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.7),
    inset 0 0 80px rgba(0,0,0,0.55),
    inset 0 0 0 2px #2a1a09,
    inset 0 0 0 14px #6a4524,
    0 0 50px rgba(255, 106, 50, 0.85);
}
