@font-face {
  font-family: "PigeonDisplay";
  src: url("../assets/fonts/anton-latin-400.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #140b12;
  --ink-soft: #24131d;
  --paper: #fff3d8;
  --paper-dim: rgba(255, 243, 216, 0.72);
  --red: #cf122b;
  --red-deep: #8c0b1e;
  --gold: #ffc845;
  --orange: #ff6b35;
  --teal: #7be4c3;
  --display: "PigeonDisplay", Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  --body: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --beat: 0;
  --hp: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #07040c;
  color: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #07040c;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

body[data-mode="playing"] #game {
  cursor: none;
}

.scanlines,
.screen-vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.screen-vignette {
  background:
    radial-gradient(ellipse at 50% 42%, transparent 40%, rgba(5, 2, 8, 0.52) 100%),
    linear-gradient(180deg, rgba(5, 2, 8, 0.5) 0%, transparent 18%, transparent 82%, rgba(5, 2, 8, 0.55) 100%);
}

/* ============================= HUD ============================= */

#hud {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 22px 0;
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

#hud.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: rgba(8, 3, 9, 0.8);
  border-bottom: 1px solid rgba(255, 243, 216, 0.14);
}

#progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8c0b1e, #cf122b 38%, #ff6b35 72%, #ffc845);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.6);
  transition: width 80ms linear;
}

#progress-markers {
  position: absolute;
  inset: 0;
}

.progress-mark {
  position: absolute;
  top: 0;
  width: 2px;
  height: 8px;
  background: rgba(255, 243, 216, 0.55);
  transform: translateX(-50%);
}

#progress-pigeon {
  position: absolute;
  top: -7px;
  left: 0;
  font-size: 11px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 200, 69, 0.9);
  transform: translateX(-50%);
  transition: left 80ms linear;
}

.hud-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
}

.hud-left {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}

.hud-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 243, 216, 0.7);
}

.hearts {
  display: flex;
  gap: 2px;
  margin-left: -3px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.heart {
  display: inline-block;
  color: #ff3d47;
  text-shadow: 0 0 10px rgba(255, 61, 71, 0.55), 2px 2px 0 #4a0710;
  transform-origin: center;
  transition: transform 180ms ease, color 180ms ease, opacity 180ms ease;
}

.heart.is-lost {
  color: rgba(255, 243, 216, 0.16);
  text-shadow: none;
  transform: scale(0.82);
}

.heart.is-low {
  animation: heartBeat 0.9s ease-in-out infinite;
}

.phase-chip {
  margin-top: 4px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 243, 216, 0.8);
  background: rgba(18, 8, 14, 0.65);
  border: 1px solid rgba(255, 243, 216, 0.2);
  border-left: 3px solid var(--gold);
}

.boss-panel {
  flex: 0 1 500px;
  width: clamp(280px, 38vw, 500px);
  margin: 0 auto;
  padding: 8px 12px 10px;
  background:
    linear-gradient(180deg, rgba(255, 243, 216, 0.08), rgba(18, 6, 12, 0.88)),
    repeating-linear-gradient(135deg, rgba(255, 243, 216, 0.025) 0 6px, transparent 6px 12px);
  border: 2px solid rgba(255, 243, 216, 0.72);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.38), 0 0 28px rgba(207, 18, 43, 0.22);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 260ms ease, transform 260ms ease;
  clip-path: polygon(0 9px, 9px 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.boss-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.boss-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.boss-brand {
  display: flex;
  align-items: baseline;
  gap: 1px;
  padding: 1px 8px 3px;
  background: #fff6df;
  color: var(--red);
  border: 2.5px solid var(--red);
  border-radius: 46% 54% 48% 52% / 52% 40% 60% 48%;
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-4deg);
  font-family: var(--display);
  line-height: 0.95;
}

.boss-brand .logo-k {
  font-size: 17px;
  transform: rotate(-10deg) translateY(1px);
}

.boss-brand .logo-f {
  font-size: 24px;
  transform: rotate(7deg) translateY(-2px);
  margin-left: -1px;
}

.boss-brand .logo-c {
  font-size: 16px;
  transform: rotate(11deg) translateY(2px);
  margin-left: -3px;
}

.boss-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(255, 243, 216, 0.68);
}

.boss-copy strong {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.boss-bar {
  height: 10px;
  background: rgba(8, 3, 8, 0.9);
  border: 1px solid rgba(255, 243, 216, 0.35);
  overflow: hidden;
}

#boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffc845, #ff6b35 48%, #cf122b);
  box-shadow: 0 0 14px rgba(255, 107, 53, 0.55);
  transition: width 160ms linear;
}

#boss-hp-fill.is-low {
  animation: hpDanger 0.5s ease-in-out infinite;
}

.hud-right {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: right;
}

.score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 82px;
}

.score-box strong {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--paper);
  text-shadow: 2px 2px 0 var(--red-deep);
}

.bpm-box {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: rgba(18, 8, 14, 0.72);
  border: 1px solid rgba(255, 243, 216, 0.2);
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 9px rgba(255, 107, 53, 0.9);
  animation: livePulse 1.2s ease-in-out infinite;
}

.bpm-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.bpm-copy strong {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--paper);
}

.bpm-copy span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: rgba(255, 243, 216, 0.48);
}

.hud-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-btn {
  pointer-events: auto;
  min-width: 82px;
  padding: 5px 8px;
  background: rgba(18, 8, 14, 0.75);
  color: var(--paper-dim);
  border: 1px solid rgba(255, 243, 216, 0.28);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.hud-btn:hover {
  background: var(--red);
  color: var(--paper);
  border-color: var(--paper);
}

#combo {
  position: fixed;
  z-index: 9;
  right: 5%;
  bottom: 23%;
  font-family: var(--display);
  font-size: clamp(28px, 3.8vw, 48px);
  letter-spacing: 0.02em;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--red-deep), 5px 5px 0 rgba(0, 0, 0, 0.55);
  transform: rotate(-3deg);
  opacity: 0;
  pointer-events: none;
}

#combo.is-visible {
  opacity: 1;
}

#combo.pop {
  animation: comboPop 260ms cubic-bezier(0.2, 1.6, 0.4, 1);
}

.time-readout {
  position: fixed;
  left: 22px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255, 243, 216, 0.45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
}

.kbd-hint {
  color: rgba(255, 243, 216, 0.3);
}

/* ============================ LYRICS =========================== */

.lyrics {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: 32px;
  width: min(1040px, 92vw);
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.45));
}

.lyrics.is-visible {
  opacity: 1;
}

.lyrics::before {
  content: "♪ LYRIC · LOCAL WHISPER";
  position: absolute;
  left: 50%;
  top: -25px;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: rgba(12, 5, 10, 0.7);
  border: 1px solid rgba(255, 200, 69, 0.35);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.lyric-line {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
  font-family: var(--display);
  font-size: clamp(30px, 4.8vw, 60px);
  line-height: 0.98;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: rgba(255, 243, 216, 0.26);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.lyric-line.is-visible {
  display: flex;
}

.lyric-word {
  display: inline-block;
  transition: color 90ms ease, transform 90ms ease, text-shadow 90ms ease;
  transform-origin: center;
}

.lyric-word.is-on {
  color: var(--paper);
}

.lyric-word.is-current {
  color: var(--gold);
  transform: scale(1.09) rotate(-1.4deg);
  text-shadow: 0 0 22px rgba(255, 200, 69, 0.55), 3px 3px 0 var(--red);
}

.hint {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: 128px;
  transform: translateX(-50%) translateY(8px);
  width: max-content;
  max-width: 90vw;
  padding: 7px 13px;
  background: rgba(12, 5, 10, 0.82);
  border: 1px solid rgba(255, 243, 216, 0.22);
  border-left: 3px solid var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: rgba(255, 243, 216, 0.84);
  text-align: center;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast {
  position: fixed;
  z-index: 13;
  top: 14%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  padding: 6px 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--red);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================ BANNERS ========================= */

.banner {
  position: fixed;
  z-index: 12;
  top: 17%;
  left: 50%;
  width: min(960px, 92vw);
  transform: translate(-50%, 18px) rotate(-2deg) scale(0.96);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 260ms cubic-bezier(0.2, 1.25, 0.4, 1);
}

.banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-2deg) scale(1);
}

.banner-kicker {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 10px;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  transform: rotate(1.4deg);
}

.banner-title {
  font-family: var(--display);
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.84;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--red), 9px 9px 0 rgba(0, 0, 0, 0.45);
}

.banner-sub {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.65); opacity: 0.55; }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

@keyframes hpDanger {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.8); }
}

@keyframes comboPop {
  0% { transform: rotate(-3deg) scale(1); }
  55% { transform: rotate(-5deg) scale(1.18); }
  100% { transform: rotate(-3deg) scale(1); }
}

/* ============================ SCREENS ========================= */

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 42px);
  overflow: auto;
  background:
    radial-gradient(ellipse at 24% 18%, rgba(255, 163, 76, 0.14), transparent 52%),
    radial-gradient(ellipse at 82% 90%, rgba(207, 18, 43, 0.16), transparent 48%),
    rgba(7, 3, 9, 0.66);
  backdrop-filter: blur(5px);
}

#screen-start {
  background:
    linear-gradient(90deg, rgba(7, 3, 10, 0.9) 0%, rgba(7, 3, 10, 0.48) 52%, rgba(7, 3, 10, 0.8) 100%),
    radial-gradient(ellipse at 75% 35%, rgba(255, 148, 61, 0.1), transparent 55%);
}

.start-shell {
  width: min(1220px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
  gap: clamp(20px, 3vw, 42px);
  align-items: center;
  margin: auto;
}

.start-main {
  position: relative;
  padding: clamp(24px, 3.4vw, 46px);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 243, 216, 0.055) 1px, transparent 1.4px) 0 0 / 11px 11px,
    linear-gradient(135deg, rgba(31, 12, 23, 0.95), rgba(13, 6, 11, 0.88));
  border: 2px solid rgba(255, 243, 216, 0.26);
  box-shadow:
    12px 12px 0 rgba(207, 18, 43, 0.16),
    0 30px 90px rgba(0, 0, 0, 0.58);
  clip-path: polygon(0 22px, 22px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.start-main::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 210px;
  height: 210px;
  border: 2px solid rgba(255, 200, 69, 0.09);
  border-radius: 50%;
  pointer-events: none;
}

.sticker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: var(--gold);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.sticker-warning {
  background: var(--red);
  color: var(--paper);
  border-color: var(--ink);
  transform: rotate(1.2deg);
}

.sticker-outline {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
  box-shadow: 2px 2px 0 var(--red-deep);
}

.sticker-mini {
  background: rgba(255, 243, 216, 0.08);
  color: rgba(255, 243, 216, 0.7);
  border-color: rgba(255, 243, 216, 0.28);
  box-shadow: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--gold);
}

.game-title {
  margin: 10px 0 4px;
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.82;
  text-transform: uppercase;
  color: var(--paper);
}

.title-line {
  display: block;
  font-size: clamp(48px, 6.8vw, 98px);
  letter-spacing: 0.008em;
  text-shadow: 3px 3px 0 var(--ink), 7px 7px 0 rgba(207, 18, 43, 0.32);
}

.title-bird {
  margin-left: -0.02em;
  font-size: clamp(74px, 10.6vw, 152px);
  color: var(--gold);
  letter-spacing: 0.02em;
  transform: skew(-4deg) rotate(-0.5deg);
  transform-origin: left center;
  text-shadow: 4px 4px 0 var(--ink), 10px 10px 0 var(--red);
}

.title-small {
  margin-top: 8px;
  font-size: clamp(25px, 3.9vw, 55px);
  letter-spacing: 0.045em;
  color: #ffdfaf;
  text-shadow: 2px 2px 0 var(--ink), 5px 5px 0 rgba(207, 18, 43, 0.42);
}

.tagline {
  margin: 13px 0 0;
  font-family: var(--display);
  font-size: clamp(21px, 2.8vw, 34px);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ff5238;
  transform: rotate(-1deg);
  transform-origin: left center;
}

.tagline strong {
  color: var(--gold);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--red-deep);
}

.blurb {
  max-width: 620px;
  margin: 15px 0 0;
  color: rgba(255, 243, 216, 0.74);
  font-size: 14px;
  line-height: 1.55;
}

.blurb em {
  color: var(--gold);
  font-style: italic;
}

.control-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 21px 0 22px;
}

.control-grid > div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  background: rgba(8, 3, 9, 0.5);
  border: 1px solid rgba(255, 243, 216, 0.16);
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255, 243, 216, 0.6);
  letter-spacing: 0.04em;
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 3px 6px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  text-align: center;
}

.start-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  position: relative;
  padding: 0.58em 1.1em;
  border: 3px solid var(--ink);
  font-family: var(--display);
  font-size: clamp(18px, 2.1vw, 27px);
  font-weight: 400;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn-primary {
  background: var(--red);
  color: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  text-shadow: 2px 2px 0 var(--red-deep);
}

.btn-primary:hover:not(:disabled) {
  background: #e81734;
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 var(--ink);
}

.btn-primary:active:not(:disabled) {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary:disabled {
  cursor: progress;
  color: rgba(255, 243, 216, 0.6);
  background: repeating-linear-gradient(45deg, #64101f 0, #64101f 10px, #741626 10px, #741626 20px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  text-shadow: none;
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--red-deep);
}

.btn-secondary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--red-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(255, 243, 216, 0.38);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 243, 216, 0.1);
  border-color: var(--paper);
}

.load-status {
  flex: 1 1 260px;
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: rgba(255, 200, 69, 0.8);
}

.load-error {
  flex: 1 1 100%;
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  color: #ff8b7e;
}

.load-error code {
  padding: 1px 4px;
  background: rgba(255, 243, 216, 0.1);
  border: 1px solid rgba(255, 243, 216, 0.18);
  color: var(--gold);
}

.fineprint {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: rgba(255, 243, 216, 0.32);
}

.start-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  transform: rotate(1.4deg);
}

.cover-card {
  width: min(300px, 100%);
  padding: 10px 10px 14px;
  background: var(--paper);
  border: 2px solid rgba(0, 0, 0, 0.65);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.45), 16px 16px 0 rgba(207, 18, 43, 0.16);
  transform: rotate(-2deg);
  color: var(--ink);
}

.cover-card img {
  display: block;
  width: 100%;
  border: 2px solid var(--ink);
  filter: saturate(1.08) contrast(1.02);
}

.cover-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  font-family: var(--mono);
}

.cover-meta span {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--red);
}

.cover-meta strong {
  font-size: 12px;
  line-height: 1.25;
}

.cover-meta small {
  font-size: 8px;
  color: rgba(20, 11, 18, 0.55);
}

.sticker-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 310px;
}

.rotate-l {
  transform: rotate(-3deg);
}

.rotate-r {
  transform: rotate(3deg);
}

/* ============================ MODALS ========================= */

.modal {
  width: min(680px, 100%);
  margin: auto;
  padding: clamp(24px, 4vw, 50px);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 243, 216, 0.045) 1px, transparent 1.3px) 0 0 / 10px 10px,
    linear-gradient(145deg, rgba(32, 12, 23, 0.98), rgba(12, 5, 10, 0.98));
  border: 2px solid rgba(255, 243, 216, 0.3);
  box-shadow: 12px 12px 0 rgba(207, 18, 43, 0.32), 0 30px 90px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 24px, 24px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.modal h2 {
  margin: 8px 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 6.6vw, 74px);
  line-height: 0.88;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--ink), 7px 7px 0 rgba(207, 18, 43, 0.35);
}

.modal-dead h2 span {
  color: var(--paper);
}

.modal-dead h2 em {
  color: var(--gold);
  font-style: normal;
  text-shadow: 4px 4px 0 var(--ink), 8px 8px 0 var(--red);
}

.modal-win h2 {
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--ink), 9px 9px 0 var(--red);
}

.modal-copy {
  max-width: 520px;
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 243, 216, 0.66);
}

.modal-win .tagline {
  margin: 0 0 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin: 0 0 24px;
  border: 1px solid rgba(255, 243, 216, 0.16);
  background: rgba(255, 243, 216, 0.12);
}

.stat-grid div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  background: #12080f;
}

.stat-grid span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(255, 243, 216, 0.42);
}

.stat-grid strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--gold);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.modal-foot {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: rgba(255, 243, 216, 0.32);
}

.fatal {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 32px));
  padding: 16px 18px;
  background: #fff3d8;
  color: #2a0a10;
  border: 3px solid var(--red);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
}

.fatal strong {
  display: block;
  margin-bottom: 5px;
  font-family: var(--display);
  font-size: 22px;
  color: var(--red);
}

.fatal p {
  margin: 0 0 10px;
}

/* ========================== RESPONSIVE ======================== */

@media (max-width: 1020px) {
  .start-shell {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 22px;
  }

  .cover-card {
    width: 230px;
  }

  .boss-panel {
    width: clamp(240px, 42vw, 420px);
  }

  .hud-left {
    flex-basis: 130px;
  }

  .bpm-box {
    display: none;
  }
}

@media (max-width: 860px) {
  .start-shell {
    grid-template-columns: 1fr;
  }

  .start-art {
    display: none;
  }

  .start-main {
    padding: clamp(20px, 5vw, 34px);
  }

  .hud-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .hud-left {
    flex: 1 1 auto;
  }

  .hud-right {
    flex: 0 0 auto;
  }

  .boss-panel {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 4px;
  }

  .score-box {
    min-width: 60px;
  }

  .score-box strong {
    font-size: 21px;
  }

  #combo {
    right: 4%;
    bottom: 30%;
  }

  .lyrics {
    bottom: 24px;
  }

  .hint {
    bottom: 116px;
  }

  .time-readout {
    left: 14px;
    bottom: 8px;
  }

  .kbd-hint {
    display: none;
  }
}

@media (max-width: 620px) {
  #hud {
    padding: 14px 12px 0;
  }

  .hud-row {
    padding-top: 8px;
  }

  .hearts {
    font-size: 23px;
  }

  .hud-right {
    gap: 8px;
  }

  .hud-btn {
    min-width: 64px;
    font-size: 7px;
  }

  .phase-chip {
    font-size: 8px;
  }

  .boss-copy span {
    display: none;
  }

  .boss-brand .logo-k { font-size: 14px; }
  .boss-brand .logo-f { font-size: 20px; }
  .boss-brand .logo-c { font-size: 13px; }

  .title-line {
    font-size: clamp(40px, 11.5vw, 72px);
  }

  .title-bird {
    font-size: clamp(62px, 17.5vw, 112px);
  }

  .title-small {
    font-size: clamp(21px, 6.4vw, 38px);
  }

  .tagline {
    font-size: 22px;
  }

  .blurb {
    font-size: 12px;
  }

  .start-actions {
    align-items: flex-start;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 20px;
  }

  .modal {
    padding: 22px 20px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid div {
    padding: 8px 10px;
  }

  .banner {
    top: 20%;
  }

  .banner-title {
    font-size: clamp(42px, 13vw, 72px);
  }

  .banner-sub {
    font-size: 9px;
  }

  .lyric-line {
    font-size: clamp(27px, 8.4vw, 42px);
    gap: 1px 9px;
  }

  .lyrics::before {
    display: none;
  }

  .lyrics {
    bottom: 26px;
  }

  .hint {
    bottom: 106px;
    font-size: 9px;
    width: calc(100% - 28px);
  }

  #combo {
    bottom: 34%;
    font-size: 30px;
  }

  .modal-actions .btn-primary,
  .modal-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

@media (max-height: 620px) and (min-width: 861px) {
  .start-main {
    padding: 22px 30px;
  }

  .game-title .title-line {
    font-size: clamp(38px, 5.4vw, 72px);
  }

  .title-bird {
    font-size: clamp(58px, 8vw, 110px);
  }

  .title-small {
    font-size: clamp(20px, 3vw, 38px);
  }

  .blurb {
    margin-top: 10px;
  }

  .control-grid {
    margin: 12px 0 14px;
  }

  .fineprint {
    margin-top: 10px;
  }
}

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