:root {
  --bg: #07040e;
  --accent: #ff2e97;
  --sec: #22d3ee;
  --gold: #fbbf24;
  --red: #ef233c;
  --panel: rgba(10, 6, 22, 0.88);
  --pixel-font: 'Press Start 2P', monospace;
  --mono-font: 'JetBrains Mono', monospace;
  --pads-h: calc(88px + env(safe-area-inset-bottom, 0px));
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #1c0f33 0%, #07040e 75%);
  color: #f4f4f5;
  font-family: var(--mono-font);
  user-select: none;
}

.cabinet-wrap {
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.cabinet {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 460px;
  max-height: 940px;
  background: #080510;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 520px) {
  .cabinet-wrap { padding: 14px; }
  .cabinet {
    aspect-ratio: 9 / 16;
    width: auto;
    height: min(94dvh, 880px);
    max-width: calc(min(94dvh, 880px) * 9 / 16);
    border-radius: 26px;
    border: 3px solid #322b4d;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: border-color 0.25s, box-shadow 0.25s;
  }
}

.cabinet.quilombo-active {
  border-color: #fde047;
  box-shadow: 0 0 38px rgba(239, 35, 60, 0.78), 0 0 14px rgba(250, 204, 21, 0.65);
}

/* Overlays */
.crt-scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
}

.quilombo-aura {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 15;
  opacity: 0;
  box-shadow: inset 0 0 54px rgba(239, 35, 60, 0.85), inset 0 0 22px rgba(250, 204, 21, 0.75);
  transition: opacity 0.22s ease;
}
.cabinet.quilombo-active .quilombo-aura {
  opacity: 1;
  animation: auraPulse 0.65s ease-in-out infinite alternate;
}
.cabinet.reduced-flash .quilombo-aura {
  animation: none;
  opacity: 0.45;
}
@keyframes auraPulse {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

.fx-flash {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.28s ease;
}

/* Stage background media */
.stage-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #080510;
}
.stage-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
  transition: filter 0.35s ease, transform 0.14s ease;
}
.stage-layer.beat-bump {
  transform: scale(1.016);
}
.stage-layer.stage-live-groove {
  animation: bardeGroove 1.9s ease-in-out infinite alternate;
}
@keyframes bardeGroove {
  0% { transform: scale(1.0) translateY(0px); }
  50% { transform: scale(1.013) translateY(-2px); }
  100% { transform: scale(1.004) translateY(1px); }
}
.stage-lights {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse 60% 42% at 22% 14%, color-mix(in srgb, var(--sec) 42%, transparent), transparent 70%),
    radial-gradient(ellipse 60% 42% at 78% 14%, color-mix(in srgb, var(--accent) 44%, transparent), transparent 70%);
  transition: opacity 0.35s ease;
}
.stage-lights.active {
  opacity: 0.52;
  animation: concertLights 2.4s ease-in-out infinite alternate;
}
.cabinet.reduced-flash .stage-lights.active {
  animation: none;
  opacity: 0.22;
}
@keyframes concertLights {
  0% { opacity: 0.28; filter: hue-rotate(-10deg); }
  50% { opacity: 0.58; filter: hue-rotate(8deg); }
  100% { opacity: 0.34; filter: hue-rotate(-4deg); }
}
.stage-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    180deg,
    rgba(8, 5, 16, 0.56) 0%,
    rgba(8, 5, 16, 0.04) 15%,
    rgba(8, 5, 16, 0.02) 50%,
    rgba(8, 5, 16, 0.72) 66%,
    rgba(8, 5, 16, 0.96) 86%
  );
}

.hidden { display: none !important; }
.full-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Generic Overlay Screens */
.overlay-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 14px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(8, 5, 18, 0.74) 0%, rgba(8, 5, 18, 0.36) 44%, rgba(8, 5, 18, 0.94) 100%);
}

/* Wordmark */
.endlands-wordmark {
  font-family: var(--pixel-font);
  font-size: 19px;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 3px 3px 0 #000;
  line-height: 1.2;
}
.endlands-wordmark.small { font-size: 13px; }
.endlands-wordmark .red-a {
  color: #ef233c;
  font-size: 1.32em;
  display: inline-block;
  transform: translateY(1px);
  text-shadow: 2px 2px 0 #000, 0 0 14px rgba(239, 35, 60, 0.8);
}

.pixel-badge {
  display: inline-block;
  font-family: var(--pixel-font);
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  box-shadow: 2px 2px 0 #000;
  text-transform: uppercase;
}
.badge-pink { background: #ff2e97; }
.badge-gold { background: linear-gradient(90deg, #b45309, #f59e0b, #b45309); color: #fff; border: 1.5px solid #fef08a; }

/* Buttons */
.arcade-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 99px;
  font-family: var(--pixel-font);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  box-shadow: 0 4px 0 #000;
  transition: transform 0.08s ease;
}
.arcade-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.arcade-btn.primary {
  background: linear-gradient(180deg, #ff3e9d, #d91b76);
  color: #fff;
  border-color: #fde047;
}
.arcade-btn.crown-btn {
  background: linear-gradient(90deg, #b45309, #eab308, #dc2626);
  color: #fff;
  border-color: #fef08a;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.6), 0 4px 0 #000;
}
.arcade-btn.ghost {
  background: rgba(12, 8, 24, 0.85);
  color: #e4e4e7;
  border-color: rgba(255, 255, 255, 0.28);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 6, 22, 0.86);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.small {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

/* ===== SCREEN 1: BIRTHDAY INTRO ===== */
.bday-shell, .sealand-shell {
  position: relative;
  z-index: 4;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 12px 2px 6px;
}
.bday-top, .sealand-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bday-card, .sealand-card {
  width: 100%;
  background: rgba(10, 6, 22, 0.90);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: 0 0 28px rgba(255, 46, 151, 0.35), 4px 4px 0 #000;
}
.bday-title {
  margin: 0 0 10px;
  font-family: var(--pixel-font);
  font-size: 17px;
  line-height: 1.4;
  color: #fde047;
  text-shadow: 3px 3px 0 #000;
}
.bday-copy, .sealand-quote {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #f4f4f5;
}
.bday-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bday-copy-short {
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}
.bday-copy-short strong {
  font-family: var(--pixel-font);
  font-size: 12px;
  color: #fde047;
  text-shadow: 2px 2px 0 #000;
}
.bday-sound {
  margin: 10px auto 0;
  display: block;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1.5px solid #22d3ee;
  background: rgba(8, 20, 32, 0.85);
  color: #a5f3fc;
  font-family: var(--pixel-font);
  font-size: 8px;
  cursor: pointer;
  animation: soundBlink 1.1s ease-in-out infinite alternate;
}
@keyframes soundBlink { from { opacity: 0.55; } to { opacity: 1; } }

/* ===== SCREEN 2: HOME / SONG & DIFFICULTY SELECT ===== */
.home-header {
  text-align: center;
  margin-bottom: 8px;
}
.home-header-row {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
}
.subtitle-chip {
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #22d3ee;
}
.home-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 6px;
}

/* Difficulty Selector */
.diff-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(10, 6, 22, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 5px;
}
.diff-pill {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 7px 4px;
  color: #a1a1aa;
  font-family: var(--pixel-font);
  font-size: 7.5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.12s ease;
}
.diff-pill span {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  opacity: 0.85;
}
.diff-pill.active[data-diff="easy"] {
  background: rgba(34, 197, 94, 0.22);
  border-color: #22c55e;
  color: #86efac;
}
.diff-pill.active[data-diff="normal"] {
  background: rgba(34, 211, 238, 0.22);
  border-color: #22d3ee;
  color: #67e8f9;
}
.diff-pill.active[data-diff="hard"] {
  background: rgba(239, 35, 60, 0.26);
  border-color: #ef233c;
  color: #fde047;
}

.campaign-bar {
  background: rgba(10, 6, 22, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  padding: 8px 11px;
}
.cb-top {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fbbf24;
  margin-bottom: 5px;
}
.cb-track {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.cb-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22d3ee, #ff2e97, #fbbf24);
  transition: width 0.35s ease;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.song-card {
  width: 100%;
  background: rgba(12, 8, 24, 0.88);
  border: 2px solid var(--s-col, #3f3f46);
  border-radius: 12px;
  padding: 7px 10px;
  color: #fff;
  cursor: pointer;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  box-shadow: 0 3px 0 #000;
  transition: transform 0.1s ease, background 0.12s;
}
.song-card:hover, .song-card:active {
  transform: translateY(-1px);
  background: rgba(24, 14, 42, 0.94);
}
.sc-thumb {
  width: 44px;
  height: 54px;
  border-radius: 7px;
  object-fit: cover;
  object-position: 50% 20%;
  image-rendering: pixelated;
  border: 1.5px solid var(--s-col, #fff);
}
.sc-venue {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--s-col, #22d3ee);
  text-transform: uppercase;
}
.sc-title {
  font-family: var(--pixel-font);
  font-size: 10px;
  line-height: 1.35;
  margin: 2px 0;
  color: #fff;
}
.sc-meta {
  font-size: 9.5px;
  color: #a1a1aa;
}
.sc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.sc-diff {
  font-size: 8.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--s-col, #fbbf24);
  border: 1px solid color-mix(in srgb, var(--s-col, #fbbf24) 50%, transparent);
}
.sc-rank {
  font-family: var(--pixel-font);
  font-size: 10.5px;
  color: #fde047;
}

.home-footer-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 2px;
}
.mini-btn {
  background: rgba(12, 8, 24, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  padding: 8px 6px;
  color: #f4f4f5;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.mini-btn.accent { border-color: #ff2e97; color: #f9a8d4; }
.mini-btn.gold { border-color: #fbbf24; color: #fde047; }
.mini-btn.crown {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, #991b1b, #d97706);
  border-color: #fde047;
  color: #fff;
}

/* ===== SCREEN 3: GAMEPLAY ===== */
.game-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 3px;
  z-index: 22;
}
.hud-score-block {
  flex: 1;
  background: rgba(10, 6, 22, 0.84);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 5px 10px;
  text-align: center;
  box-shadow: 2px 2px 0 #000;
}
.hud-venue {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--sec);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-score {
  font-family: var(--pixel-font);
  font-size: 13px;
  color: #fff;
  margin: 2px 0 4px;
}
.hud-progress-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.hud-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sec), var(--accent), var(--gold));
}

/* Live 7-Event Strip right under HUD (face stays 100% clear!) */
.hud-events-strip {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  display: flex;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(8, 5, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.ev-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.07);
  opacity: 0.32;
  filter: grayscale(1);
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.ev-dot.caught {
  opacity: 1;
  filter: none;
  background: rgba(250, 204, 21, 0.25);
  border: 1.5px solid #fde047;
  transform: scale(1.12);
}
.ev-dot.seen {
  opacity: 0.78;
  filter: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Beat Saber Multiplier Ring */
.mult-ring-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: rgba(10, 6, 22, 0.88);
  border-radius: 50%;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.15s ease;
}
.cabinet.quilombo-active .mult-ring-wrap {
  transform: scale(1.12);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.9);
}
.mult-svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.mult-bg { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 5; }
.mult-arc {
  fill: none;
  stroke: #fbbf24;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 144.5;
  stroke-dashoffset: 144.5;
  transition: stroke-dashoffset 0.12s ease, stroke 0.2s ease;
}
.mult-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mult-val { font-family: var(--pixel-font); font-size: 11px; color: #fde047; line-height: 1; }
.mult-lbl { font-size: 6.5px; font-weight: 800; color: #fff; margin-top: 2px; }

.quilombo-banner {
  position: absolute;
  top: 98px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  z-index: 23;
  background: linear-gradient(90deg, #dc2626, #f59e0b, #dc2626);
  border: 2px solid #fef08a;
  border-radius: 99px;
  padding: 4px 12px;
  font-family: var(--pixel-font);
  font-size: 7.5px;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(239, 35, 60, 0.9), 2px 2px 0 #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cabinet.quilombo-active .quilombo-banner {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Bonus Toast — docked cleanly RIGHT ABOVE FRETBOARD (eyes see it immediately, Barde's face stays 100% clear!) */
.bonus-toast {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--pads-h) + 39% + 10px);
  z-index: 27;
  background: rgba(10, 6, 22, 0.95);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 26px rgba(251, 191, 36, 0.55), 3px 3px 0 #000;
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.bonus-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.bt-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.bt-tag { font-size: 8px; font-weight: 800; letter-spacing: 0.1em; color: #22d3ee; text-transform: uppercase; }
.bt-title { font-family: var(--pixel-font); font-size: 9px; color: #fde047; margin: 2px 0; }
.bt-desc { font-size: 10px; color: #f4f4f5; line-height: 1.25; }

/* Live Combo & Breather Pills right above fretboard */
.combo-pill, .breather-pill {
  position: absolute;
  bottom: calc(var(--pads-h) + 39% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  z-index: 23;
  font-family: var(--pixel-font);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  border-radius: 99px;
  padding: 4px 11px;
  text-shadow: 2px 2px 0 #000;
  box-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.14s ease;
}
.combo-pill {
  color: #fde047;
  background: rgba(10, 6, 22, 0.84);
  border: 1.5px solid var(--sec);
}
.combo-pill.show { opacity: 1; transform: translateX(-50%) scale(1); }
.cabinet.quilombo-active .combo-pill {
  border-color: #fde047;
  color: #fff;
  background: rgba(185, 28, 28, 0.9);
}
.breather-pill {
  color: #67e8f9;
  background: rgba(8, 20, 32, 0.88);
  border: 1.5px solid #22d3ee;
  font-size: 8px;
}
.breather-pill.show { opacity: 1; transform: translateX(-50%) scale(1); }

/* Countdown / Finish / Audio Prompt */
.countdown-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 14, 0.56);
  pointer-events: none;
  padding: 20px;
  text-align: center;
}
.countdown-num {
  font-family: var(--pixel-font);
  font-size: 46px;
  line-height: 1.2;
  color: #fde047;
  text-shadow: 4px 4px 0 #000, 0 0 26px rgba(255, 46, 151, 0.85);
}
.countdown-sub {
  margin-top: 12px;
  font-family: var(--pixel-font);
  font-size: 9px;
  line-height: 1.5;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

/* Highway canvas */
.highway-canvas {
  position: absolute;
  left: 0;
  bottom: var(--pads-h);
  width: 100%;
  height: 39%;
  min-height: 200px;
  max-height: 320px;
  z-index: 16;
  pointer-events: none;
}

/* 4 ROUND ARCADE BUTTONS */
.round-pads {
  --beat: 0;
  position: relative;
  z-index: 22;
  height: var(--pads-h);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse 70% 120% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(180deg, #120b20 0%, #07040d 100%);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -2px calc(6px + 22px * var(--beat)) color-mix(in srgb, var(--accent) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  touch-action: none;
}
.round-pads.drop { animation: padsDrop 0.6s ease-out; }
@keyframes padsDrop {
  0% { background-color: rgba(255, 255, 255, 0.35); }
  100% { background-color: transparent; }
}

/* Clean neon-ring buttons: dark glass + glowing ring, they fill with light when struck */
.bass-pad {
  --p-col: #ff2e97;
  --glow: 0.25;
  --bounce: 0;
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--p-col);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: radial-gradient(circle at 50% 35%, #1d1730 0%, #0c0915 72%);
  box-shadow:
    inset 0 0 0 3px var(--p-col),
    inset 0 0 calc(6px + 14px * var(--glow)) color-mix(in srgb, var(--p-col) 45%, transparent),
    0 0 calc(4px + 18px * var(--glow)) color-mix(in srgb, var(--p-col) 55%, transparent),
    0 4px 0 #000;
  translate: 0 calc(-2px * var(--bounce));
  scale: calc(1 + 0.05 * var(--bounce));
  transition: translate 0.05s ease, background 0.06s ease, box-shadow 0.06s ease;
  touch-action: none;
}
.bass-pad::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--p-col) 30%, transparent);
  pointer-events: none;
}
.bass-pad.pressed {
  translate: 0 3px;
  color: #fff;
  background: radial-gradient(circle, #ffffff 0%, color-mix(in srgb, var(--p-col) 70%, white) 30%, var(--p-col) 66%, color-mix(in srgb, var(--p-col) 55%, black) 100%);
  box-shadow:
    inset 0 0 0 3px #fff,
    0 0 24px var(--p-col),
    0 0 46px color-mix(in srgb, var(--p-col) 55%, transparent),
    0 1px 0 #000;
}
.bass-pad.pressed::before { border-color: rgba(255, 255, 255, 0.6); }
.bp-string {
  position: relative;
  font-family: var(--pixel-font);
  font-size: 16px;
  line-height: 1;
  color: var(--p-col);
  text-shadow: 0 0 8px color-mix(in srgb, var(--p-col) 80%, transparent);
}
.bass-pad.pressed .bp-string { color: #120a1c; text-shadow: none; }
.bp-key { position: relative; font-size: 8px; font-weight: 800; color: rgba(255, 255, 255, 0.4); }
.bass-pad.pressed .bp-key { color: rgba(18, 10, 28, 0.75); }
.cabinet.reduced-flash .bass-pad { box-shadow: inset 0 0 0 3px var(--p-col), 0 4px 0 #000; }

/* ===== SCREEN 4: RESULTS ===== */
.result-card {
  margin: auto;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: rgba(10, 6, 22, 0.94);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 16px 14px;
  text-align: center;
  box-shadow: 0 0 32px rgba(255, 46, 151, 0.35), 4px 4px 0 #000;
}
.res-title {
  font-family: var(--pixel-font);
  font-size: 12.5px;
  margin: 8px 0 3px;
  color: #fff;
}
.res-diff-line {
  font-size: 10px;
  font-weight: 800;
  color: #22d3ee;
  letter-spacing: 0.08em;
}
.res-rank {
  font-family: var(--pixel-font);
  font-size: 42px;
  color: #fde047;
  text-shadow: 4px 4px 0 #000, 0 0 26px rgba(250, 204, 21, 0.75);
  margin: 4px 0 10px;
}
.res-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
}
.stat-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-box span { font-size: 8.5px; color: #a1a1aa; font-weight: 800; }
.stat-box strong { font-family: var(--pixel-font); font-size: 10.5px; color: #fff; }
.res-events-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 12px;
}
.res-ev-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #a1a1aa;
}
.res-ev-chip.caught {
  background: rgba(250, 204, 21, 0.18);
  border-color: #fde047;
  color: #fef08a;
}
.res-actions { display: flex; flex-direction: column; gap: 7px; }

/* ===== SCREEN 5: LORD OF SEALAND FINALE ===== */
.sealand-title {
  margin: 4px 0 0;
  font-family: var(--pixel-font);
  font-size: 18px;
  line-height: 1.4;
  color: #fde047;
  text-shadow: 3px 3px 0 #000, 0 0 22px rgba(250, 204, 21, 0.7);
}
.sealand-title span { font-size: 13px; color: #fff; }
.sealand-score-line {
  font-family: var(--pixel-font);
  font-size: 9.5px;
  color: #fde047;
  margin-bottom: 12px;
}

/* ===== SCREEN 6 & 7: HOMAGE & EVENTS COLLECTION ===== */
.homage-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(9, 6, 20, 0.96);
  border: 2px solid #ff2e97;
  border-radius: 16px;
  padding: 14px;
  overflow: hidden;
}
.events-panel { border-color: #fbbf24; }
.homage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.homage-sub {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #22d3ee;
  margin-top: 3px;
}
.events-intro {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: #d4d4d8;
}
.homage-scroll, .events-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.h-card, .event-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
}
.event-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
}
.event-card.unlocked {
  border-color: var(--ev-col, #fbbf24);
  background: rgba(255, 255, 255, 0.07);
}
.ev-badge-big {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid var(--ev-col, #52525b);
}
.ev-c-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.ev-c-tag {
  font-size: 8.5px;
  font-weight: 800;
  color: var(--ev-col, #22d3ee);
  letter-spacing: 0.06em;
}
.ev-c-status {
  font-size: 8px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
}
.event-card.unlocked .ev-c-status {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}
.ev-c-title {
  font-family: var(--pixel-font);
  font-size: 9px;
  color: #fff;
  margin: 3px 0;
  line-height: 1.35;
}
.ev-c-desc {
  font-size: 11px;
  color: #d4d4d8;
  line-height: 1.4;
}
.ev-c-btn {
  margin-top: 6px;
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid #fde047;
  color: #fde047;
  border-radius: 99px;
  padding: 4px 10px;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.h-card h3 { font-family: var(--pixel-font); font-size: 9.5px; color: #fde047; margin: 0 0 7px; }
.h-card p { margin: 0; font-size: 12px; line-height: 1.5; color: #e4e4e7; }
.tracklist-ol { margin: 8px 0 0; padding-left: 18px; font-size: 11.5px; line-height: 1.7; }
.tracklist-ol li span { color: #22d3ee; font-size: 10px; margin-left: 6px; }
.h-links { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }

/* Pause & Calibration Modal */
.pause-modal {
  position: absolute;
  inset: 0;
  z-index: 35;
  background: rgba(6, 4, 14, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.pause-box {
  width: 100%;
  max-width: 320px;
  background: #120b24;
  border: 2px solid #ff2e97;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pause-box h3 {
  font-family: var(--pixel-font);
  font-size: 13px;
  margin: 0 0 4px;
  color: #fde047;
}
.settings-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 800;
  color: #e4e4e7;
}
.offset-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}
.offset-ctrl strong {
  min-width: 44px;
  text-align: center;
  color: #fde047;
  font-size: 10.5px;
}
.tiny-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  color: #fff;
  font-family: var(--mono-font);
  font-size: 9.5px;
  font-weight: 800;
  padding: 4px 7px;
  cursor: pointer;
}
.tiny-btn.toggle.on {
  background: rgba(34, 197, 94, 0.24);
  border-color: #22c55e;
  color: #86efac;
}

/* ===================== WOW PASS: intro card, milestones, results stamp ===================== */
.stage-media { transform-origin: 50% 42%; will-change: transform; }

.countdown-num.pop { animation: cdPop 0.42s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes cdPop {
  0% { transform: scale(2.4); opacity: 0; filter: blur(3px); }
  60% { transform: scale(0.92); opacity: 1; filter: none; }
  100% { transform: scale(1); }
}

.intro-card {
  --ic-col: var(--accent);
  position: relative;
  width: min(330px, 92%);
  margin-bottom: 18px;
  padding: 14px 14px 12px;
  background: rgba(8, 5, 18, 0.9);
  border: 2px solid var(--ic-col);
  border-radius: 12px;
  box-shadow: 0 0 34px color-mix(in srgb, var(--ic-col) 55%, transparent), 4px 4px 0 #000;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-120%) skewX(-8deg);
}
.intro-card.show { animation: icIn 0.5s cubic-bezier(.15, 1.25, .35, 1) forwards; }
@keyframes icIn {
  0% { opacity: 0; transform: translateX(-120%) skewX(-8deg); }
  70% { opacity: 1; transform: translateX(4%) skewX(-8deg); }
  100% { opacity: 1; transform: translateX(0) skewX(-8deg); }
}
.intro-card > * { transform: skewX(8deg); }
.ic-stripe {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 14px, color-mix(in srgb, var(--ic-col) 12%, transparent) 14px 20px);
  animation: icStripes 1.2s linear infinite;
}
@keyframes icStripes { to { background-position: 46px 0; } }
.ic-num {
  position: relative;
  display: inline-block;
  font-family: var(--pixel-font);
  font-size: 8px;
  color: #000;
  background: var(--ic-col);
  padding: 4px 7px;
  border-radius: 4px;
}
.ic-venue {
  position: relative;
  margin-top: 10px;
  font-family: var(--pixel-font);
  font-size: 15px;
  line-height: 1.35;
  color: #fff;
  text-shadow: 3px 3px 0 #000;
}
.ic-title {
  position: relative;
  margin-top: 6px;
  font-family: var(--pixel-font);
  font-size: 10px;
  color: var(--ic-col);
  text-shadow: 2px 2px 0 #000;
}
.ic-meta {
  position: relative;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #e4e4e7;
}

.milestone {
  --ms-col: #fde047;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--pads-h) + 39% + 46px);
  z-index: 26;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.milestone.show { animation: msSlam 1.25s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes msSlam {
  0% { opacity: 0; transform: scale(2.6) rotate(-4deg); }
  14% { opacity: 1; transform: scale(0.94) rotate(-2deg); }
  24% { transform: scale(1.04) rotate(-2deg); }
  78% { opacity: 1; transform: scale(1) rotate(-2deg); }
  100% { opacity: 0; transform: scale(1.12) translateY(-14px) rotate(-2deg); }
}
.ms-big {
  font-family: var(--pixel-font);
  font-size: 22px;
  line-height: 1.2;
  color: var(--ms-col);
  text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 0 0 22px var(--ms-col);
}
.ms-small {
  margin-top: 6px;
  font-family: var(--pixel-font);
  font-size: 8px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}
.cabinet.reduced-flash .milestone.show { animation-duration: 1.4s; }

#screenResults .result-card { position: relative; z-index: 3; }
.res-rank { display: inline-block; opacity: 0; }
.res-rank.stamp { animation: rankStamp 0.55s cubic-bezier(.2, 1.5, .35, 1) forwards; }
@keyframes rankStamp {
  0% { opacity: 0; transform: scale(4) rotate(-18deg); }
  55% { opacity: 1; transform: scale(0.85) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}
.res-rank[data-rank="S"] { color: #fde047; text-shadow: 4px 4px 0 #000, 0 0 34px rgba(250, 204, 21, 0.95); }
.res-rank[data-rank="A"] { color: #22d3ee; text-shadow: 4px 4px 0 #000, 0 0 26px rgba(34, 211, 238, 0.8); }
.res-rank[data-rank="B"] { color: #a3e635; }
.res-rank[data-rank="C"] { color: #fb923c; }
.res-rank[data-rank="D"] { color: #ef4444; text-shadow: 4px 4px 0 #000; }

.res-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 0; margin: -2px 0 10px; }
.res-badges:empty { display: none; }
.res-badge {
  font-family: var(--pixel-font);
  font-size: 8px;
  padding: 5px 9px;
  border-radius: 99px;
  border: 2px solid;
  box-shadow: 2px 2px 0 #000;
  animation: badgeIn 0.5s 0.9s cubic-bezier(.2, 1.6, .4, 1) both;
}
.res-badge.record { color: #fde047; border-color: #fde047; background: rgba(250, 204, 21, 0.14); }
.res-badge.fc { color: #a5f3fc; border-color: #22d3ee; background: rgba(34, 211, 238, 0.14); }
@keyframes badgeIn { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }

.res-breakdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: -2px 0 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.bk-perfect { color: #fde047; }
.bk-good { color: #22d3ee; }
.bk-miss { color: #f87171; }

@media (prefers-reduced-motion: reduce) {
  .intro-card.show, .milestone.show, .res-rank.stamp, .countdown-num.pop, .res-badge, .ic-stripe { animation: none; }
  .intro-card.show { opacity: 1; transform: skewX(-8deg); }
  .milestone.show, .res-rank.stamp { opacity: 1; }
}

/* ===== Event pictures (toast, HUD strip, collection) ===== */
.ev-art { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.ev-dot .ev-art { border-radius: 50%; }
.ev-dot:has(.ev-art) { overflow: hidden; padding: 0; }
.bt-icon.has-art {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #fde047;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.7), 2px 2px 0 #000;
}
.bonus-toast.show .bt-icon.has-art { animation: artPop 0.45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes artPop { from { transform: scale(0.2) rotate(-12deg); } to { transform: scale(1) rotate(0); } }
.event-card:has(.has-art) { grid-template-columns: 76px 1fr; }
.ev-badge-big.has-art {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  border-width: 2.5px;
}
.event-card:not(.unlocked) .ev-art { filter: brightness(0.1) grayscale(1); }
.event-card:not(.unlocked) .ev-badge-big.has-art::after {
  content: '?';
  position: absolute;
  font-family: var(--pixel-font);
  font-size: 22px;
  color: rgba(255, 255, 255, 0.55);
}
.ev-badge-big.has-art { position: relative; }

/* ===== Locked stages ===== */
.song-card.locked { cursor: not-allowed; border-color: #3f3a4f; box-shadow: none; }
.song-card.locked .sc-thumb { filter: grayscale(1) brightness(0.35); }
.song-card.locked .sc-venue, .song-card.locked .sc-title { color: #71717a; }
.song-card.locked .sc-meta { color: #a1a1aa; }
.song-card.locked .sc-rank { font-size: 16px; }
.song-card.deny { animation: denyShake 0.35s ease; }
@keyframes denyShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.res-badge.unlock { color: #bbf7d0; border-color: #22c55e; background: rgba(34, 197, 94, 0.14); }


/* ===== Global ranking ===== */
.mini-btn.rank { border-color: #22d3ee; color: #a5f3fc; }
.ranking-panel { border-color: #22d3ee; }
.rk-diffs { display: flex; gap: 6px; margin-bottom: 8px; }
.rk-diff, .rk-tab {
  flex: 1;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #d4d4d8;
  border-radius: 99px;
  padding: 6px 8px;
  font-family: var(--pixel-font);
  font-size: 7.5px;
  cursor: pointer;
  white-space: nowrap;
}
.rk-diff.active, .rk-tab.active { border-color: #22d3ee; background: rgba(34, 211, 238, 0.16); color: #fff; }
.rk-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; }
.rk-tab { flex: 0 0 auto; font-size: 7px; }
.rk-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.rk-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.rk-row.podium.p1 { border-color: #fde047; background: rgba(250, 204, 21, 0.12); }
.rk-row.podium.p2 { border-color: #d4d4d8; }
.rk-row.podium.p3 { border-color: #f59e0b; }
.rk-row.me { box-shadow: inset 0 0 0 2px #22d3ee; }
.rk-pos { font-family: var(--pixel-font); font-size: 10px; color: #fde047; text-align: center; }
.rk-name { font-weight: 800; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-score { font-family: var(--pixel-font); font-size: 9px; color: #a5f3fc; }
.rk-empty { text-align: center; color: #a1a1aa; font-size: 12px; padding: 24px 0; }
.rk-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: #d4d4d8; }
.res-ranking {
  margin: 0 0 12px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid #22d3ee;
  background: rgba(34, 211, 238, 0.08);
}
.rr-line { font-family: var(--pixel-font); font-size: 8px; line-height: 1.6; color: #a5f3fc; }
.rr-line strong { color: #fde047; font-size: 11px; }
.rr-form { display: flex; gap: 6px; margin-top: 8px; }
.rr-input {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: #0c0915;
  color: #fff;
  padding: 8px 10px;
  font-family: var(--mono-font);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
}
.rr-input.deny { animation: denyShake 0.35s ease; border-color: #ef4444; }
.rr-send {
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #22d3ee;
  color: #04121a;
  font-family: var(--pixel-font);
  font-size: 8px;
  cursor: pointer;
}


/* ===== Show, don't tell: trimmed UI ===== */
.campaign-bar, .hud-venue, .quilombo-banner, .breather-pill, .events-intro, .res-breakdown,
#btnResEvents, .diff-pill span, .bt-tag, .bt-desc, .sc-diff, .ev-c-top { display: none !important; }
.stat-box:has(#resBonus) { display: none; }
.res-stats { grid-template-columns: 1fr 1fr 1fr; }
.stat-box:has(#resScore) { grid-column: 1 / -1; }
.stat-box:has(#resScore) strong { font-size: 18px; color: #fde047; }
.sc-meta:empty { display: none; }
.bt-title { font-size: 10px; }
.ev-dot { animation: dotPop 0.45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes dotPop { from { transform: scale(0.1); } to { transform: scale(1.12); } }
.hud-events-strip:empty { display: none; }
.res-events-row { gap: 8px; }
.res-events-row:empty { display: none; }
.res-secret {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #fde047;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.6);
  animation: badgeIn 0.5s 1.1s cubic-bezier(.2, 1.6, .4, 1) both;
}
.ev-c-title.locked { color: #52525b; letter-spacing: 0.3em; }
.event-card:not(.unlocked) .ev-badge-big:not(.has-art) { filter: brightness(0) opacity(0.4); }

.res-ranking { text-align: center; }
.rr-line strong { font-size: 16px; }
.sealand-quote { text-align: center; font-size: 13px; }
.sealand-score-line { text-align: center; font-size: 14px; }
