:root {
  --bg: #070605;
  --wood: #1a120c;
  --wood-lit: #2c1c12;
  --amber: #d4923a;
  --amber-hot: #f0b45a;
  --blood: #b01c14;
  --cream: #efe4d4;
  --muted: #7a6a58;
  --good: #5aaf66;
  --warn: #c49220;
  --font-display: "Bebas Neue", sans-serif;
  --font-scene: "Special Elite", cursive;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-mono);
  color: var(--cream);
  background: var(--bg);
  overflow: hidden;
}

.letterbox {
  position: fixed;
  left: 0;
  right: 0;
  height: clamp(18px, 4vh, 42px);
  background: #000;
  z-index: 60;
  pointer-events: none;
}

.letterbox.top {
  top: 0;
}

.letterbox.bottom {
  bottom: 0;
}

.audio-dock {
  position: fixed;
  right: 1rem;
  bottom: calc(clamp(18px, 4vh, 42px) + 0.75rem);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  background: rgba(10, 8, 6, 0.72);
  border: 1px solid rgba(239, 228, 212, 0.15);
  backdrop-filter: blur(8px);
}

.mute-btn {
  margin: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(239, 228, 212, 0.25);
  box-shadow: none;
  font-size: 0.95rem;
  line-height: 1;
}

.mute-btn:hover {
  transform: none;
  background: rgba(212, 146, 58, 0.15);
}

.mute-btn.muted {
  color: var(--muted);
  border-color: rgba(239, 228, 212, 0.12);
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 96px;
  height: 4px;
  background: rgba(239, 228, 212, 0.2);
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
}

.vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
}

.hint.sub {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  opacity: 0.75;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.11;
  z-index: 55;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 54;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.72) 100%);
}

.room-tint {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.room-tint.warm {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 30%, rgba(180, 100, 20, 0.18), transparent 60%);
}

.room-tint.rage {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 25%, rgba(160, 20, 12, 0.4), transparent 55%);
  animation: rage-flicker 0.35s steps(2) infinite;
}

.flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 58;
  background: rgba(239, 228, 212, 0.35);
  opacity: 0;
}

.flash.pop {
  animation: flash-pop 0.12s ease-out;
}

@keyframes rage-flicker {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@keyframes flash-pop {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 0;
  }
}

#app {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vh, 48px) 1.25rem;
}

.screen {
  display: none;
  width: min(640px, 100%);
  text-align: center;
}

.screen.active {
  display: block;
  animation: fade-in 0.5s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ——— Title ——— */
.title-card {
  padding: 2rem 1rem 1.5rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 146, 58, 0.18), transparent 55%),
    linear-gradient(180deg, #120e0a 0%, #0a0806 55%, #0c0907 100%);
  border: 1px solid rgba(212, 146, 58, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(239, 228, 212, 0.06),
    0 24px 60px rgba(0, 0, 0, 0.45);
  animation: title-settle 0.9s ease;
}

@keyframes title-settle {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  font-family: var(--font-scene);
  color: var(--amber);
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  animation: fade-up 0.7s ease 0.1s both;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(5rem, 20vw, 9rem);
  letter-spacing: 0.06em;
  line-height: 0.85;
  color: var(--cream);
  text-shadow:
    0 0 60px rgba(176, 28, 20, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.5);
  animation: title-slam 0.65s cubic-bezier(0.2, 0.9, 0.2, 1) 0.15s both;
}

@keyframes title-slam {
  from {
    opacity: 0;
    letter-spacing: 0.22em;
    transform: scale(1.06);
  }
  to {
    opacity: 1;
    letter-spacing: 0.06em;
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tagline {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  animation: fade-up 0.7s ease 0.28s both;
}

.hint {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  animation: fade-up 0.7s ease 0.4s both;
}

.hint strong {
  color: var(--amber-hot);
  font-weight: 600;
}

kbd {
  display: inline-block;
  padding: 0.05em 0.4em;
  border: 1px solid rgba(239, 228, 212, 0.3);
  font-family: var(--font-mono);
  font-size: 0.8em;
}

button {
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0a0806;
  background: var(--amber);
  border: none;
  padding: 0.95rem 1.7rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  background: var(--amber-hot);
  box-shadow: 0 8px 24px rgba(212, 146, 58, 0.28);
}

button.cta-pulse {
  animation: cta-pulse 2.4s ease-in-out infinite;
}

@keyframes cta-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(212, 146, 58, 0.35);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(212, 146, 58, 0);
  }
}

/* ——— Rehearsal room ——— */
.rehearsal {
  position: relative;
  height: min(70vh, 580px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, transparent 30%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(
      90deg,
      var(--wood) 0 48px,
      var(--wood-lit) 48px 49px
    );
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(212, 146, 58, 0.1);
}

.room-wall {
  position: absolute;
  inset: 0 0 55% 0;
  background:
    radial-gradient(ellipse 40% 60% at 50% 0%, rgba(80, 50, 25, 0.35), transparent 70%),
    linear-gradient(180deg, #0e0b08, transparent);
  pointer-events: none;
}

.overhead {
  position: absolute;
  left: 50%;
  top: -20%;
  width: 55%;
  height: 55%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 210, 140, 0.22), transparent 68%);
  pointer-events: none;
  animation: lamp 4s ease-in-out infinite;
}

@keyframes lamp {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.band-line {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 12%;
  height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  opacity: 0.55;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.05s linear, opacity 0.3s ease, filter 0.3s ease;
}

.band-line.hot {
  opacity: 0.75;
  filter: saturate(1.15) brightness(1.08);
}

.band-line.pulse .horn {
  animation: horn-blip 0.18s ease;
}

@keyframes horn-blip {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
}

.stand {
  position: relative;
  width: 34px;
  height: 78px;
}

.stand::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 52px;
  margin-left: -1px;
  background: #3a3228;
}

.stand::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 28px;
  height: 18px;
  margin-left: -14px;
  background: #cfc3ae;
  clip-path: polygon(0 100%, 100% 100%, 85% 0, 15% 0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.horn {
  position: absolute;
  left: 50%;
  bottom: 38px;
  width: 18px;
  height: 36px;
  margin-left: -9px;
  background: linear-gradient(180deg, #2a241c, #12100c);
  clip-path: polygon(25% 0, 75% 0, 100% 100%, 0 100%);
  transform-origin: bottom center;
}

.horn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #8a6a4a;
}

.horn.sax {
  height: 42px;
  background: linear-gradient(180deg, #3a2e18, #1a140c);
}

.stand.s2,
.stand.s4 {
  height: 86px;
}

.stand.s3 {
  height: 92px;
}

/* Fletcher */
.fletcher {
  position: absolute;
  left: 50%;
  top: 8%;
  transform: translateX(-50%);
  width: 110px;
  height: 190px;
  z-index: 5;
}

.fletcher-shadow {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 70px;
  height: 12px;
  margin-left: -35px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
}

.fletcher-body {
  position: relative;
  width: 100%;
  height: 100%;
}

.fletcher-head {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 40px;
  height: 44px;
  margin-left: -20px;
  border-radius: 46% 46% 42% 42%;
  background: linear-gradient(160deg, #d2b08a, #a88462);
  box-shadow: inset -5px -3px 0 rgba(0, 0, 0, 0.18);
}

.fletcher-brow {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 14px;
  height: 4px;
  background: #1a120c;
  clip-path: polygon(0 100%, 100% 100%, 95% 0, 5% 0);
}

.fletcher-eyes {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 20px;
  height: 6px;
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}

.fletcher-eyes span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0a0604;
  animation: blink 4.8s ease-in-out infinite;
}

.fletcher-eyes span:last-child {
  animation-delay: 0.08s;
}

.fletcher.rage .fletcher-eyes span,
.fletcher.throwing .fletcher-eyes span {
  background: #2a0806;
  box-shadow: 0 0 4px rgba(176, 28, 20, 0.5);
}

@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  94%,
  96% {
    transform: scaleY(0.1);
  }
}

.fletcher-mouth {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 12px;
  height: 3px;
  margin-left: -6px;
  border-radius: 0 0 6px 6px;
  background: #5a4030;
  transform-origin: center top;
}

.fletcher.talking .fletcher-mouth {
  animation: mouth 0.14s steps(2) infinite;
}

@keyframes mouth {
  0%,
  100% {
    height: 3px;
  }
  50% {
    height: 7px;
  }
}

.fletcher-neck {
  position: absolute;
  left: 50%;
  top: 48px;
  width: 14px;
  height: 12px;
  margin-left: -7px;
  background: #a88462;
}

.fletcher-torso {
  position: absolute;
  left: 50%;
  top: 56px;
  width: 62px;
  height: 88px;
  margin-left: -31px;
  background: linear-gradient(180deg, #1a1a1a, #0c0c0c);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 14px 0 #222;
}

.fletcher-arm {
  position: absolute;
  top: 62px;
  width: 15px;
  height: 70px;
  background: #111;
  transform-origin: top center;
}

.fletcher-arm.left {
  left: 12px;
  transform: rotate(16deg);
  will-change: transform;
}

.fletcher-arm.right {
  right: 10px;
  transform: rotate(-18deg);
}

.hand {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #a88462;
  box-shadow: inset -2px -1px 0 rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.baton {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 3px;
  height: 38px;
  margin-left: -1.5px;
  margin-top: -2px;
  background: linear-gradient(180deg, #f5e4d4, #c4b49a);
  border-radius: 1px;
  transform-origin: top center;
  transform: rotate(-42deg);
  box-shadow: 0 0 10px rgba(239, 228, 212, 0.4);
  z-index: 1;
}

.fletcher.calm .fletcher-arm.right,
.fletcher.praise .fletcher-arm.right,
.fletcher.irritation .fletcher-arm.right {
  /* Beat-synced in JS */
  animation: none;
}

.fletcher.praise {
  filter: drop-shadow(0 0 14px rgba(90, 175, 102, 0.35));
}

.fletcher.irritation {
  filter: drop-shadow(0 0 12px rgba(196, 146, 32, 0.45));
}

.fletcher.irritation .fletcher-brow {
  top: 12px;
  height: 5px;
}

.fletcher.rage,
.fletcher.throwing {
  filter: drop-shadow(0 0 18px rgba(176, 28, 20, 0.65));
}

.fletcher.rage {
  animation: shake 0.09s linear infinite;
}

.fletcher.rage .fletcher-brow,
.fletcher.throwing .fletcher-brow {
  top: 11px;
  background: #3a100c;
}

.fletcher.throwing .fletcher-arm.right {
  animation: throw-arm 0.32s ease-out forwards;
}

@keyframes conduct {
  0%,
  100% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(-48deg);
  }
}

@keyframes conduct-sharp {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(-62deg);
  }
}

@keyframes tense {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(1px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(calc(-50% - 3px));
  }
  50% {
    transform: translateX(calc(-50% + 3px));
  }
}

@keyframes throw-arm {
  0% {
    transform: rotate(-12deg);
  }
  60% {
    transform: rotate(-140deg) translateY(-8px);
  }
  100% {
    transform: rotate(-110deg) translateY(-4px);
  }
}

.speech {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 320px;
  padding: 0.7rem 0.9rem;
  background: var(--cream);
  color: #120e0a;
  font-family: var(--font-scene);
  font-size: 0.92rem;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  animation: speech-pop 0.28s ease;
  z-index: 8;
}

.speech::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -7px;
  border: 7px solid transparent;
  border-top-color: var(--cream);
}

.speech.harsh {
  background: var(--blood);
  color: #fff;
  letter-spacing: 0.02em;
}

.speech.harsh::after {
  border-top-color: var(--blood);
}

@keyframes speech-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

/* Folding chair */
.chair {
  position: absolute;
  left: 62%;
  top: 18%;
  width: 44px;
  height: 58px;
  opacity: 0;
  z-index: 7;
  pointer-events: none;
}

.chair::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#5a6a78, #5a6a78) 6px 0 / 6px 34px no-repeat,
    linear-gradient(#5a6a78, #5a6a78) 32px 0 / 6px 34px no-repeat,
    linear-gradient(#6a7a88, #6a7a88) 4px 10px / 36px 5px no-repeat,
    linear-gradient(#4a5460, #4a5460) 2px 32px / 40px 8px no-repeat,
    linear-gradient(#3a424c, #3a424c) 8px 40px / 5px 16px no-repeat,
    linear-gradient(#3a424c, #3a424c) 31px 40px / 5px 16px no-repeat;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.chair.flying {
  opacity: 1;
  animation: chair-fly 0.58s cubic-bezier(0.15, 0.7, 0.25, 1) forwards;
}

@keyframes chair-fly {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  100% {
    transform: translate(-90px, 210px) rotate(-480deg) scale(1.3);
  }
}

/* Taiko lane */
.taiko-zone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.floor-glow {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 220px;
  height: 48px;
  margin-left: -110px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
  pointer-events: none;
  z-index: 4;
}

.count-call.sticks {
  color: var(--cream);
  font-size: 1.55rem;
  text-shadow: 0 0 14px rgba(239, 228, 212, 0.25);
}

.lane-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 2px;
  background: rgba(239, 228, 212, 0.08);
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

#lane-fill {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--amber), var(--blood));
  transition: transform 0.1s linear;
  box-shadow: 0 0 8px rgba(212, 146, 58, 0.45);
}

.rehearsal.punch {
  animation: punch 0.22s ease;
}

.rehearsal.beat-flash {
  animation: beat-flash 0.12s ease-out;
}

@keyframes beat-flash {
  from {
    filter: brightness(1.06);
  }
  to {
    filter: none;
  }
}

@keyframes punch {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.012);
  }
}

#accuracy.bump {
  animation: combo-bump 0.22s ease;
}

.count-call {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.12em;
  color: var(--amber-hot);
  text-shadow: 0 0 20px rgba(240, 180, 90, 0.45);
  z-index: 3;
  pointer-events: none;
}

.count-call.pop {
  animation: count-pop 0.18s ease;
}

@keyframes count-pop {
  from {
    transform: translateX(-50%) scale(1.25);
    opacity: 0.4;
  }
  to {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

.hit-float {
  position: absolute;
  left: 78px;
  top: 4px;
  transform: translate(-50%, 0);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.hit-float.show {
  animation: hit-float-up 0.42s ease-out forwards;
}

.hit-float.perfect {
  color: var(--good);
}

.hit-float.great {
  color: var(--amber);
}

.hit-float.ok {
  color: var(--warn);
}

.hit-float.miss {
  color: var(--blood);
}

@keyframes hit-float-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.9);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -22px) scale(1.05);
  }
}

.taiko-lane {
  position: relative;
  width: min(720px, 100%);
  height: 120px;
}

.taiko-lane.shake {
  animation: lane-shake 0.28s ease;
}

@keyframes lane-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  55% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

#taiko {
  display: block;
  width: 100%;
  height: 120px;
  border-radius: 4px;
}

.taiko-drum {
  position: absolute;
  left: 42px;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  background: transparent;
  box-shadow: none;
  border-radius: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
}

.taiko-drum:hover {
  background: transparent;
  transform: translateY(-50%);
  box-shadow: none;
}

.drum-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f2e6d4, #c4b090 55%, #8a7a60);
  box-shadow:
    0 0 0 4px #2a2a2a,
    0 0 0 7px #6a4a2a,
    0 8px 16px rgba(0, 0, 0, 0.45);
}

.drum-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
  opacity: 0;
}

.taiko-drum.playing .drum-ring {
  opacity: 1;
  border-color: rgba(212, 146, 58, 0.35);
  animation: drum-breathe 0.6s ease-in-out infinite;
}

@keyframes drum-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}

.drum-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: rgba(20, 12, 8, 0.55);
  pointer-events: none;
}

.taiko-drum.hit-don .drum-face {
  animation: drum-don 0.12s ease;
  filter: brightness(1.15) saturate(1.2);
  box-shadow:
    0 0 0 4px #2a2a2a,
    0 0 0 7px #c4281c,
    0 0 20px rgba(196, 40, 28, 0.55);
}

.taiko-drum.hit-ka .drum-face {
  animation: drum-don 0.12s ease;
  filter: brightness(1.1);
  box-shadow:
    0 0 0 4px #2a2a2a,
    0 0 0 7px #2a7ab8,
    0 0 20px rgba(42, 122, 184, 0.55);
}

@keyframes drum-don {
  0% { transform: scale(1); }
  40% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.taiko-keys {
  display: flex;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.taiko-keys .key {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: -1px;
}

.taiko-keys .key.don {
  background: #c4281c;
  box-shadow: inset 0 0 0 2px #1a1a1a;
}

.taiko-keys .key.ka {
  background: #2a7ab8;
  box-shadow: inset 0 0 0 2px #1a1a1a;
}

.footer-hud {
  margin-top: 0.65rem;
}

.hud-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.mood {
  text-align: left;
  flex: 1;
}

.stat,
.combo-wrap {
  text-align: right;
  min-width: 3.2rem;
}

.take-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(239, 228, 212, 0.18);
  padding: 0.35rem 0.55rem;
  align-self: center;
  white-space: nowrap;
}

.take-badge[data-take="2"] {
  color: var(--amber);
  border-color: rgba(212, 146, 58, 0.35);
}

.take-badge[data-take="3"] {
  color: var(--blood);
  border-color: rgba(176, 28, 20, 0.45);
  animation: take-pulse 1.2s ease-in-out infinite;
}

.timing-bias {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 72px;
  align-self: center;
}

.bias-label {
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.bias-track {
  position: relative;
  flex: 1;
  height: 3px;
  background: rgba(239, 228, 212, 0.12);
  min-width: 48px;
}

.bias-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--cream);
  transition: left 0.18s ease, background 0.2s ease;
}

.bias-needle.early {
  background: var(--amber);
}

.bias-needle.late {
  background: var(--blood);
}

.hit-history {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 0.4rem;
  min-height: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.hit-history .hist {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: rgba(239, 228, 212, 0.15);
}

.hit-history .hist.perfect {
  background: var(--good);
  box-shadow: 0 0 6px rgba(90, 175, 102, 0.45);
}

.hit-history .hist.great {
  background: var(--amber);
}

.hit-history .hist.ok {
  background: var(--warn);
}

.hit-history .hist.miss {
  background: var(--blood);
}

.end-best {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

@keyframes take-pulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

#combo,
#accuracy {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1;
  display: block;
  color: var(--cream);
}

#combo.hot {
  color: var(--good);
  text-shadow: 0 0 12px rgba(90, 175, 102, 0.45);
}

#combo.bump {
  animation: combo-bump 0.22s ease;
}

@keyframes combo-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.28);
  }
  100% {
    transform: scale(1);
  }
}

.combo-label,
.stat-label {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-label {
  display: inline;
  margin-left: 1px;
}

.end-stats {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.fletcher.talking .fletcher-head {
  animation: talk 0.16s steps(2) infinite;
}

@keyframes talk {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(1px);
  }
}

.mood-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.28rem;
}

.mood-bar {
  height: 5px;
  background: rgba(239, 228, 212, 0.08);
  overflow: hidden;
}

#mood-fill {
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, var(--good), var(--warn), var(--blood));
  transition: width 0.28s ease;
}

.pulse-cue {
  margin-top: 0.55rem;
  color: var(--muted);
  font-family: var(--font-scene);
  font-size: 0.95rem;
  min-height: 1.3em;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.judge {
  height: 1.5em;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  opacity: 0;
}

.judge.show {
  opacity: 1;
  animation: judge-in 0.22s ease;
}

.judge.perfect {
  color: var(--good);
  text-shadow: 0 0 16px rgba(90, 175, 102, 0.35);
}

.judge.great {
  color: var(--amber);
}

.judge.ok {
  color: var(--warn);
}

.judge.miss {
  color: var(--blood);
}

@keyframes judge-in {
  from {
    transform: translateY(6px) scale(1.12);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.choice-card {
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(176, 28, 20, 0.18), transparent 55%),
    linear-gradient(180deg, #120a08, #0a0605);
  border: 1px solid rgba(176, 28, 20, 0.25);
  animation: title-settle 0.55s ease;
}

.choice-prompt {
  font-family: var(--font-scene);
  color: var(--blood);
  margin-bottom: 0.75rem;
}

.choice-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  letter-spacing: 0.04em;
}

.choice-or {
  margin-top: 0.35rem;
  font-family: var(--font-scene);
  color: var(--amber);
  font-size: 1.15rem;
}

.choice-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.choice-row button {
  min-width: 140px;
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(239, 228, 212, 0.35);
  box-shadow: none;
}

.choice-row button:hover {
  background: var(--blood);
  border-color: var(--blood);
  color: #fff;
  box-shadow: 0 8px 28px rgba(176, 28, 20, 0.35);
}

.choice-row button kbd {
  margin-left: 0.45rem;
  opacity: 0.65;
  font-size: 0.72em;
  border-color: rgba(239, 228, 212, 0.35);
  vertical-align: 1px;
}

.choice-row button:hover kbd {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.end-grade {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.end-grade.win {
  color: var(--good);
}

.end-card {
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(212, 146, 58, 0.1), transparent 50%),
    linear-gradient(180deg, #120e0a, #0a0806);
  border: 1px solid rgba(239, 228, 212, 0.12);
  animation: title-settle 0.55s ease;
}

#end-screen h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 4rem);
  letter-spacing: 0.04em;
  color: var(--blood);
  text-shadow: 0 0 40px rgba(176, 28, 20, 0.45);
  animation: end-slam 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

#end-screen h2.win {
  color: var(--good);
  text-shadow: 0 0 40px rgba(90, 175, 102, 0.35);
}

@keyframes end-slam {
  from {
    opacity: 0;
    transform: scale(1.2);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#end-sub {
  margin-top: 1rem;
  font-family: var(--font-scene);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--cream);
}

.rehearsal.impact {
  animation: impact 0.45s ease;
}

@keyframes impact {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: translate(-8px, 4px) rotate(-0.5deg);
  }
  45% {
    transform: translate(7px, -3px) rotate(0.4deg);
  }
  70% {
    transform: translate(-3px, 2px);
  }
}

@media (max-width: 560px) {
  .rehearsal {
    height: min(72vh, 520px);
  }

  .band-line {
    opacity: 0.35;
  }

  .speech {
    min-width: 160px;
    font-size: 0.82rem;
  }

  .hud-row {
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
  }

  .timing-bias {
    order: 5;
    flex: 1 1 100%;
    justify-content: center;
    min-width: 0;
  }

  .bias-track {
    max-width: 120px;
  }

  .taiko-drum {
    width: 80px;
    height: 80px;
    left: 36px;
  }

  .hit-float {
    left: 76px;
  }

  #combo,
  #accuracy {
    font-size: 1.4rem;
  }

  .audio-dock {
    right: 0.5rem;
    padding: 0.35rem 0.5rem;
  }

  .vol-slider {
    width: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ——— Bridges ——— */
.bridge-card {
  padding: 2.2rem 1.4rem;
  background: linear-gradient(180deg, #120e0a, #0a0806);
  border: 1px solid rgba(239, 228, 212, 0.12);
  animation: title-settle 0.55s ease;
}

.bridge-card.practice-bridge {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(60, 100, 140, 0.2), transparent 55%),
    linear-gradient(180deg, #0c1014, #07090c);
  border-color: rgba(120, 160, 200, 0.2);
}

.bridge-card.finale-bridge {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 146, 58, 0.22), transparent 55%),
    linear-gradient(180deg, #140e08, #0a0604);
  border-color: rgba(212, 146, 58, 0.25);
}

.bridge-card h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 3.8rem);
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}

.bridge-sub {
  margin-top: 0.85rem;
  font-family: var(--font-scene);
  color: var(--cream);
  line-height: 1.45;
  font-size: 1.02rem;
}

.bridge-stats {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

/* ——— Practice room mode ——— */
.rehearsal.practice-room {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 35%, rgba(0, 0, 0, 0.7) 100%),
    repeating-linear-gradient(90deg, #0c1016 0 48px, #101820 48px 49px);
  box-shadow:
    inset 0 0 80px rgba(0, 20, 40, 0.55),
    0 0 0 1px rgba(120, 160, 200, 0.12);
}

.rehearsal.practice-room .band-line,
.rehearsal.practice-room .fletcher,
.rehearsal.practice-room .audience,
.rehearsal.practice-room .overhead {
  display: none !important;
}

.rehearsal.practice-room .room-wall {
  background:
    radial-gradient(ellipse 50% 70% at 50% 0%, rgba(40, 70, 100, 0.25), transparent 70%),
    linear-gradient(180deg, #080c12, transparent);
}

.rehearsal.practice-room .floor-glow {
  background: radial-gradient(ellipse, rgba(40, 80, 120, 0.25), transparent 70%);
}

/* ——— Finale stage mode ——— */
.rehearsal.finale-stage {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 40%, rgba(0, 0, 0, 0.75) 100%),
    radial-gradient(ellipse at 50% 20%, rgba(212, 146, 58, 0.18), transparent 50%),
    repeating-linear-gradient(90deg, #120c08 0 48px, #1a120c 48px 49px);
  box-shadow:
    inset 0 0 100px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 146, 58, 0.2);
}

.rehearsal.finale-stage .metronome {
  display: none !important;
}

.rehearsal.finale-stage .audience {
  display: block;
}

.audience {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 38%;
  height: 28%;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 10px,
      rgba(0, 0, 0, 0.35) 10px 14px
    ),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65));
  clip-path: polygon(0 40%, 5% 20%, 12% 45%, 20% 15%, 28% 42%, 38% 10%, 48% 40%, 58% 12%, 68% 44%, 78% 18%, 88% 42%, 95% 22%, 100% 40%, 100% 100%, 0 100%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}

.rehearsal.finale-stage .overhead {
  background: radial-gradient(ellipse at center, rgba(255, 220, 150, 0.35), transparent 65%);
  width: 70%;
  height: 60%;
}

/* ——— Metronome ——— */
.metronome {
  position: absolute;
  right: 8%;
  top: 14%;
  z-index: 6;
  text-align: center;
}

.metro-body {
  position: relative;
  width: 56px;
  height: 90px;
  margin: 0 auto;
}

.metro-arm {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 3px;
  height: 70px;
  margin-left: -1.5px;
  background: linear-gradient(180deg, #c4281c, #efe4d4);
  transform-origin: bottom center;
  transform: rotate(-22deg);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(196, 40, 28, 0.35);
  transition: transform 0.08s ease-out;
}

.metro-arm.tick {
  animation: metro-tick 0.12s ease;
}

@keyframes metro-tick {
  0% {
    transform: rotate(-22deg);
  }
  50% {
    transform: rotate(22deg);
  }
  100% {
    transform: rotate(-22deg);
  }
}

.metro-base {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 42px;
  height: 16px;
  margin-left: -21px;
  background: #2a241c;
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
}

.metro-bpm {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(180, 210, 240, 0.75);
}

/* ——— Pocket meter ——— */
.pocket-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.pocket-wrap[hidden] {
  display: none !important;
}

.pocket-label {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 3.2rem;
}

.pocket-bar {
  flex: 1;
  height: 7px;
  background: rgba(239, 228, 212, 0.08);
  overflow: hidden;
}

#pocket-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blood), var(--warn), var(--good));
  transform-origin: left center;
  transition: width 0.15s ease;
}

#pocket-fill.low {
  animation: pocket-warn 0.45s steps(2) infinite;
}

@keyframes pocket-warn {
  50% {
    filter: brightness(1.35);
  }
}

.pocket-val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  min-width: 1.6rem;
  text-align: right;
  color: var(--cream);
}

.mood.hidden-mood {
  visibility: hidden;
}
