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

html, body {
  height: 100%;
  background: #0a0905;
  color: #d8c8a8;
  font-family: "Courier New", "Courier", "Menlo", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 540px;
  height: 960px;
  background:
    /* diagonal venetian-blind light shafts @ 30deg, opacity 0.08 */
    repeating-linear-gradient(
      30deg,
      rgba(212, 192, 150, 0.08) 0px,
      rgba(212, 192, 150, 0.08) 6px,
      rgba(0, 0, 0, 0) 6px,
      rgba(0, 0, 0, 0) 28px
    ),
    /* rainy-night vignette: cold-blue top, charcoal middle, sepia floor */
    radial-gradient(ellipse at 50% 0%, rgba(40, 48, 70, 0.55), transparent 65%),
    radial-gradient(ellipse at 50% 100%, rgba(82, 60, 28, 0.35), transparent 60%),
    linear-gradient(180deg, #15171e 0%, #0b0a08 60%, #1a140c 100%);
  border: 1px solid #2a2418;
  border-radius: 4px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.85),
    inset 0 0 90px rgba(0,0,0,0.65),
    inset 0 0 18px rgba(212, 192, 150, 0.05);
  overflow: hidden;
}

#scoreboard {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(0,0,0,0.75), rgba(0,0,0,0));
  z-index: 10;
  pointer-events: none;
  font-family: "Courier New", "Courier", "Menlo", monospace;
}

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

.team .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  opacity: 0.95;
  text-transform: uppercase;
}

.team .score {
  font-family: "Courier New", "Courier", "Menlo", monospace;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  margin-top: 4px;
  transition: transform 0.15s ease;
  letter-spacing: 1px;
}

/* DETECTIVE — washed-out sepia / candlelit ivory */
.team.red .label, .team.red .score {
  color: #e8d6a8;
  text-shadow:
    0 0 10px rgba(232, 214, 168, 0.45),
    0 0 2px rgba(232, 214, 168, 0.9),
    0 1px 0 rgba(0, 0, 0, 0.8);
}

/* SUSPECT — cold blue-grey, like a rain-soaked overcoat */
.team.blue .label, .team.blue .score {
  color: #94a8b8;
  text-shadow:
    0 0 10px rgba(148, 168, 184, 0.4),
    0 0 2px rgba(148, 168, 184, 0.9),
    0 1px 0 rgba(0, 0, 0, 0.8);
}

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

.meta {
  text-align: center;
}

.meta .title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #d8c8a8;
  opacity: 0.92;
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(216, 200, 168, 0.25);
}

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

.meta .evidence {
  font-size: 10px;
  letter-spacing: 3px;
  margin-top: 4px;
  color: #d8b85a;
  opacity: 0.85;
  text-shadow: 0 0 6px rgba(216, 184, 90, 0.4);
}

.meta .evidence.crack {
  color: #ff4438;
  text-shadow: 0 0 8px rgba(255, 68, 56, 0.85);
  opacity: 1;
}

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

/* CASE CRACKED splash — typewriter red, slams across the board */
.case-cracked {
  position: absolute;
  left: 0; right: 0;
  top: 38%;
  text-align: center;
  font-family: "Courier New", "Courier", "Menlo", monospace;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #ff3a30;
  text-shadow:
    0 0 18px rgba(255, 58, 48, 0.85),
    0 0 36px rgba(255, 58, 48, 0.55),
    0 3px 0 rgba(0, 0, 0, 0.9);
  pointer-events: none;
  opacity: 0;
  z-index: 11;
  transform: translateY(0) scale(0.92) rotate(-2deg);
}

.case-cracked.flash {
  animation: caseCrackedFlash 1.6s ease-out forwards;
}

@keyframes caseCrackedFlash {
  0%   { opacity: 0; transform: translateY(-30px) scale(0.6) rotate(-6deg); }
  18%  { opacity: 1; transform: translateY(0) scale(1.18) rotate(-2deg); }
  30%  { opacity: 0.4; }
  44%  { opacity: 1; transform: translateY(-3px) scale(1.04) rotate(-1.5deg); }
  60%  { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(6px) scale(0.96) rotate(-1deg); }
}

.ticker {
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  text-align: center;
  font-family: "Courier New", "Courier", "Menlo", monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: #a89880;
  opacity: 0.55;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(0,0,0,0.8);
}

@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.85),
    inset 0 0 90px rgba(0,0,0,0.65),
    0 0 40px rgba(180, 30, 30, 0.55);
}

/* Subtle bonus-window pulse on the stage when CASE CRACKED bonus is active */
#stage.bonus-window {
  box-shadow:
    0 30px 80px rgba(0,0,0,0.85),
    inset 0 0 90px rgba(0,0,0,0.7),
    inset 0 0 36px rgba(255, 60, 50, 0.18),
    0 0 28px rgba(255, 60, 50, 0.35);
}
