/* SongDrivr. Every colour in the game is defined here, once. js/game.js reads the
   same variables at load (see PAL), so tuning the look means editing this block. */
:root {
  /* surfaces */
  --bg: #0a0b0e;            /* page and canvas background */
  --floor: #0b0e09;         /* ground under the horizon */
  --panel: #11150d;         /* HUD panels, cards */
  --border: #2a3a17;
  /* brand colours, sampled from the logo */
  --lime: #c2f517;
  --green: #48f071;
  --amber: #f8be0f;
  --orange: #ef6103;
  --cyan: #04d4e4;          /* accent only */
  --purple: #b44dff;        /* the purple coin */
  --bonus: #2f8bff;         /* the blue bonus pick */
  /* text and neutrals */
  --cream: #f6f3e4;
  --muted: #a3b08f;
  --ink: #0a0d08;           /* silhouettes, dark text on bright buttons */
  --glint: #ffe9a8;         /* phone lights in the crowd */
  --danger: #ff3355;        /* misses and wall hits: deliberately off-palette so it reads as a warning */
  /* road */
  --asphalt: #16181c;
  --asphalt-far: #2a2218;   /* warm at the horizon: sunset in the wet surface */
  --asphalt-near: #0d0f12;
  --concrete: #2b3034;      /* barrier walls */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body { position: fixed; inset: 0; }

#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* intro video: full screen, first thing on load */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  transition: opacity .35s ease;
}
.intro[hidden] { display: none; }
.intro video { width: 100%; height: 100%; object-fit: contain; display: block; }
/* when the video ends it stays on screen, frozen on its last frame, as the backdrop of the
   start screen: the logo is exactly the one in the video. The start screen (z-index 40) sits on top. */
.intro.held { z-index: 30; }
.intro.held .intro-skip, .intro.held .intro-sound { display: none; }
/* on the start screen the whole group (logo in the video + song + Start) is lifted 119px and shrunk to 85% so it sits centred on the screen.
   The video is 9:16, shown whole (contain): --vh is its on-screen height; its logo spans 31% to 70% of that height. */
.intro video { transition: transform .5s ease; }
.intro.held video { transform: translateY(-119px) scale(.85); }
.intro.failed video { display: none; }
.intro-sound {
  position: absolute;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  white-space: nowrap;
  min-height: 40px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .04em;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(246, 243, 228, .6);
  border-radius: 999px;
  cursor: pointer;
}
.intro-sound[hidden] { display: none; }
.intro-skip {
  position: absolute;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-height: 48px;
  padding: 12px 30px;
  font: inherit;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .06em;
  white-space: nowrap;
  color: var(--ink);
  background: linear-gradient(90deg, var(--lime), var(--amber));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, .6);
  cursor: pointer;
}

/* header */
.hdr {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px 6px;
  gap: 12px;
}
.brand-logo { display: block; height: 34px; width: auto; }
.brand-top {
  font-weight: 900;
  letter-spacing: .12em;
  font-size: 16px;
  background: linear-gradient(90deg, var(--lime), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--cyan);
  font-weight: 700;
}
.song { text-align: right; min-width: 0; }
.song-title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { font-size: 11px; color: var(--muted); }

/* stats */
.stats {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 0 12px 8px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px 6px;
  flex: 1;
  min-width: 0;
}
.stat.mult-cell { text-align: center; }
.lbl { font-size: 9px; letter-spacing: .15em; color: var(--muted); font-weight: 700; white-space: nowrap; }
.val { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.15; }
.val.gold { color: var(--amber); }
.val.mult { color: var(--lime); }

/* full-width crowd energy bar: the gradient is always there, the dark cover
   slides in from the right as energy drops */
.e-track {
  flex: none;
  position: relative;
  height: 26px;
  margin: 0 12px 8px;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  background: linear-gradient(90deg, var(--green), var(--lime) 40%, var(--amber) 75%, var(--orange));
}
.e-cover {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 80%;
  background: var(--bg);
  border-left: 2px solid #fff;
  box-shadow: -6px 0 14px rgba(255, 255, 255, .35);
}
.e-ticks { position: absolute; inset: 0; pointer-events: none; }
.e-ticks i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(10, 11, 14, .55); }
.e-ticks i:nth-child(1) { left: 25%; }
.e-ticks i:nth-child(2) { left: 50%; }
.e-ticks i:nth-child(3) { left: 75%; }
.e-label, .e-pct {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
}
.e-label { left: 12px; }
.e-pct { right: 12px; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.e-track.hit { animation: ehit .45s ease-out; }
@keyframes ehit {
  0%   { box-shadow: 0 0 0 3px var(--danger), 0 0 24px var(--danger); transform: translateX(-6px); }
  25%  { transform: translateX(5px); }
  50%  { transform: translateX(-3px); }
  100% { box-shadow: 0 0 0 0 transparent; transform: none; }
}
/* fever: energy has hit 100%, the bar strobes until the next miss */
.e-track.fever { animation: efever .36s steps(1) infinite; }
.e-track.fever .e-cover { width: 0 !important; border-left-color: transparent; box-shadow: none; }
.e-track.fever .e-label { letter-spacing: .3em; }
@keyframes efever {
  0%   { filter: brightness(1.9) saturate(1.4); box-shadow: 0 0 0 2px var(--amber), 0 0 26px var(--orange); }
  50%  { filter: brightness(1.1) saturate(1.2); box-shadow: 0 0 0 2px var(--cyan), 0 0 26px var(--lime); }
}
.val.mult.pop { animation: mpop .25s ease-out; }
@keyframes mpop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* top strip: one line of text, and the song progress bar with a white mark at every gate */
.lyric {
  flex: none;
  background: var(--ink);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 9px 12px 10px;
}
/* only used if a song has timed lyrics; the section names (INTRO, PART 1...) are gone */
.lyric-main {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lyric-main[hidden] { display: none; }
.lyric-next {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .1em;
  line-height: 1.25;
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(255, 255, 255, .35);
}
.lyric-next[hidden] { display: none; }
.progress {
  position: relative;
  height: 12px;
  margin-top: 0;
  background: #0b0e09;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--orange), var(--amber), var(--lime));
}
/* a white line where each gate is; it dims once you have passed it */
.gate-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 255, 255, .8);
  pointer-events: none;
}
.gate-mark.passed { opacity: .35; box-shadow: none; }

/* game view */
.wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* fuel gauge: a vertical bar down the left of the game view, gas can on top; flashes when low */
.fuel {
  position: absolute;
  left: 10px;
  top: 84px;
  z-index: 3;
  pointer-events: none;                         /* touches go through to the steering */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.fuel-icon { width: 34px; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .75)); }
.fuel-track {
  position: relative;
  width: 16px;
  height: 116px;
  background: rgba(10, 11, 14, .8);
  border: 2px solid rgba(246, 243, 228, .75);
  border-radius: 8px;
  overflow: hidden;
}
.fuel-track::after {                            /* the quarter-tank mark */
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 25%;
  height: 2px;
  background: rgba(255, 255, 255, .85);
}
.fuel-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 100%;
  background: linear-gradient(0deg, var(--orange), var(--amber) 45%, var(--lime));
}
.fuel-e { font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px #000; }
.fuel.low .fuel-icon, .fuel.low .fuel-track, .fuel.low .fuel-e { animation: fuelblink .7s steps(1) infinite; }
.fuel.low .fuel-fill { background: var(--danger); }
.fuel.empty .fuel-icon, .fuel.empty .fuel-track, .fuel.empty .fuel-e { animation: fuelblink .32s steps(1) infinite; }
.fuel.empty .fuel-track { border-color: var(--danger); }
@keyframes fuelblink { 0% { opacity: 1; } 50% { opacity: .15; } }

/* band slots: five windows at the top of the game view, over the sky, one per band member */
.slots {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 3;
  pointer-events: none;
  display: flex;
  gap: 5px;
  padding: 6px 8px;
  background: rgba(10, 11, 14, .74);
  border: 2px solid var(--amber);
  border-radius: 12px;
  box-shadow: 0 0 14px rgba(248, 190, 15, .4), inset 0 0 10px rgba(0, 0, 0, .6);
}
.slot {
  flex: 1;
  min-width: 0;
  height: 54px;
  border-radius: 9px;
  background: #0b0e09;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slot img { width: 48px; height: 48px; display: block; opacity: .22; filter: grayscale(1); }      /* not collected yet */
.slot.have img { opacity: 1; filter: none; }
.slot img.land { animation: slotland .38s cubic-bezier(.2, .9, .3, 1.25); }   /* drops in like a reel stopping */
@keyframes slotland { 0% { transform: translateY(-130%); } 70% { transform: translateY(10%); } 100% { transform: none; } }
.slots.win { border-color: #fff; animation: slotwin .3s steps(1) infinite; }
.slots.win .slot img { animation: slotpop .3s ease-in-out infinite alternate; }
@keyframes slotwin { 0% { box-shadow: 0 0 22px var(--lime), 0 0 6px #fff; } 50% { box-shadow: 0 0 22px var(--amber), 0 0 6px #fff; } }
@keyframes slotpop { from { transform: scale(1); } to { transform: scale(1.18); } }
/* banner in the middle of the game view: the band member you just collected, FULL BAND! */
.unlock {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .06em;
  color: #fff;
  text-shadow: 0 0 14px var(--lime), 0 0 30px var(--amber), 0 2px 4px #000;
  animation: unlockflash .5s steps(1) infinite;
}
.unlock[hidden] { display: none; }
.unlock.high { top: 124px; }                    /* just below the band slots */
.unlock.big { font-size: 30px; white-space: pre; text-align: center; line-height: 1.15; }
@keyframes unlockflash { 0% { opacity: 1; color: #fff; } 50% { opacity: .35; color: var(--amber); } }

/* overlays inside the game view (pause, end of song) */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(10, 11, 14, .72);
  padding: 16px;
  z-index: 5;
  overflow-y: auto;                  /* a short phone scrolls the card instead of cutting off its top */
}
.overlay > .card { margin: auto; }
.overlay[hidden] { display: none; }
.card {
  width: 100%;
  max-width: 320px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 0 40px rgba(239, 97, 3, .18), 0 0 60px rgba(194, 245, 23, .12);
}
.card-kicker { font-size: 11px; letter-spacing: .3em; color: var(--cyan); font-weight: 800; }
.card-title { font-size: 26px; font-weight: 900; margin-top: 6px; }
.end-verdict { font-size: 21px; font-weight: 900; line-height: 1.15; letter-spacing: .03em; color: var(--danger); text-shadow: 0 0 12px rgba(255, 60, 60, .45); margin-bottom: 10px; }
.end-verdict.good { color: var(--lime); text-shadow: 0 0 12px rgba(190, 255, 40, .45); }
.end-title { font-size: 22px; font-weight: 900; margin-top: 6px; line-height: 1.15; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-hint { font-size: 13px; line-height: 1.4; color: var(--muted); margin: 14px 0 16px; }
.end-score { font-size: 44px; font-weight: 900; color: var(--amber); margin-top: 6px; font-variant-numeric: tabular-nums; }
.end-stars { font-size: 34px; color: var(--amber); letter-spacing: .1em; margin: 2px 0; }
.end-pb { font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--lime); min-height: 18px; }

/* start screen: transparent, sits over the frozen last frame of the intro video (which holds the
   logo), with the song and the Start button in the lower part of the screen */
.start {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  --vh: min(100vh, 177.78vw);
  align-items: flex-start;
  justify-content: center;
  padding: calc(50vh + 0.17 * var(--vh) - 105px) 20px 20px;     /* just under the logo */
  text-align: center;
}
.start[hidden] { display: none; }
.start-inner { width: 100%; max-width: 320px; }
.start-lead { font-size: 20px; font-weight: 900; line-height: 1.2; color: #fff; text-shadow: 0 2px 8px #000; }
.start-warn { margin-top: 8px; font-size: 16px; font-weight: 800; color: #ff2d95; text-shadow: 0 0 10px rgba(255, 45, 149, .5); }
.start-logo { display: none; width: 78%; max-width: 260px; height: auto; margin: 0 auto 10px; }
/* fallback if the intro video could not play at all: centred, with the logo image */
.start.fallback { align-items: center; padding-bottom: 20px; }
.start.fallback .start-logo { display: block; }

.btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .05em;
  color: #fff;
  background: #1b2213;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.btn.primary {
  background: linear-gradient(90deg, var(--lime), var(--amber));
  border-color: transparent;
  color: var(--ink);
}
.btn.playlist-btn {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-size: 13px;
  white-space: nowrap;
  min-height: 38px;
  padding: 8px 14px;
  margin-top: 10px;
}
.btn:disabled { opacity: .4; cursor: default; }

.pause-btn {
  position: absolute;
  top: 84px;
  right: 8px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(17, 21, 13, .75);
  color: #fff;
  font-size: 13px;
  letter-spacing: -2px;
  cursor: pointer;
}
.pause-btn[hidden] { display: none; }
.play-big {
  display: block;
  margin: 16px auto 10px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 0;
  font-size: 40px;
  padding-left: 8px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--lime), var(--amber));
  box-shadow: 0 0 30px rgba(194, 245, 23, .45);
  cursor: pointer;
}

.load-err { margin-top: 12px; font-size: 12px; line-height: 1.4; color: #ff8aa8; }
.load-err[hidden] { display: none; }

/* steer area */
.steer {
  flex: none;
  height: clamp(84px, 14vh, 130px);
  position: relative;
  background: linear-gradient(180deg, var(--ink), var(--panel));
  border-top: 1px solid var(--border);
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.steer-bar {
  position: relative;
  width: 78%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--orange), var(--border) 50%, var(--lime));
  opacity: .85;
}
.steer-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px rgba(248, 190, 15, .7);
}
.steer-hint { font-size: 12px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; font-weight: 700; }

/* ---------------------------------------------------------------- song picker ("Select Artist") */
.pick {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 50% 0%, #1d2412 0%, var(--bg) 62%);
}
.pick[hidden] { display: none; }
.pick-top { display: flex; align-items: center; gap: 10px; flex: none; }
.pick-logo { flex: none; height: 38px; width: auto; }
.pick-title { flex: none; text-align: left; font-size: 15px; font-weight: 900; letter-spacing: .28em; color: var(--cyan); }
.pick-random {
  flex: none; font: inherit; font-weight: 900; font-size: 16px; letter-spacing: .03em;
  color: var(--ink); background: linear-gradient(90deg, var(--lime), var(--amber));
  border: 0; border-radius: 12px; padding: 14px 16px; cursor: pointer;
}
.pick-random:disabled { opacity: .4; }
.pick-genres { flex: none; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  flex: none; font: inherit; font-weight: 800; font-size: 13px; color: var(--cream);
  background: #1b2213; border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 11px; cursor: pointer; white-space: nowrap;
}
.chip.on { color: var(--ink); background: var(--cream); border-color: var(--cream); }
.pick-search {
  flex: none; width: 100%; font: inherit; font-size: 16px; color: #fff;      /* 16px: iOS zooms the page in on smaller inputs */
  background: #11150d; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; outline: none; -webkit-appearance: none; appearance: none;
}
.pick-search:focus { border-color: var(--cyan); }
.pick-search::placeholder { color: var(--muted); }
.pick-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.pick-empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.artist {
  flex: none; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 70% 36%), hsl(calc(var(--h) + 45) 75% 20%));
  border: 1px solid hsl(var(--h) 80% 55% / .45);
  box-shadow: 0 4px 16px hsl(var(--h) 80% 30% / .35);
}
.artist-head { display: flex; align-items: stretch; }
.artist-main {
  flex: 1; min-width: 0; text-align: left; font: inherit; color: #fff;
  background: none; border: 0; padding: 16px 14px; cursor: pointer;
}
.artist-name { font-size: 20px; font-weight: 900; line-height: 1.15; text-shadow: 0 2px 6px rgba(0, 0, 0, .45); overflow-wrap: anywhere; }
.artist-count { margin-top: 3px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .78); }
.artist-shuffle {
  flex: none; width: 64px; font: inherit; font-size: 26px; font-weight: 900; color: #fff;
  background: rgba(0, 0, 0, .28); border: 0; border-left: 1px solid rgba(255, 255, 255, .18); cursor: pointer;
}
.artist-songs { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 12px; }
.artist-shuffle-all {
  font: inherit; font-weight: 900; font-size: 15px; color: var(--ink); background: #fff;
  border: 0; border-radius: 10px; padding: 11px 12px; cursor: pointer;
}
.song-row { display: flex; align-items: center; gap: 10px; color: #fff; background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 7px 8px; }
.song-play {
  flex: none; width: 40px; height: 40px; border-radius: 50%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--lime); border: 0; cursor: pointer; padding: 0 0 0 2px;
}
.song-name { flex: 1; min-width: 0; }
.song-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.song-genre { margin-top: 2px; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: rgba(255, 255, 255, .7); }
.song-select {
  flex: none; font: inherit; font-size: 13px; font-weight: 900; letter-spacing: .08em; color: var(--ink);
  background: #fff; border: 0; border-radius: 9px; padding: 11px 13px; cursor: pointer;
}
.pick-msg { flex: none; min-height: 18px; text-align: center; font-size: 13px; font-weight: 700; color: var(--lime); }
.pick-msg.err { color: #ff8aa8; }
.pick.busy .pick-list, .pick.busy .pick-random, .pick.busy .pick-genres { opacity: .45; pointer-events: none; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; font-size: 15px; padding-left: 8px; padding-right: 8px; }

/* end of song: covers the whole app (above the steering bar), with a glowing card */
#ovEnd { z-index: 50; background: rgba(10, 11, 14, .82); }
.end-card {
  border-color: rgba(248, 190, 15, .7);
  box-shadow: 0 0 22px 3px rgba(248, 190, 15, .5), 0 0 60px 8px rgba(239, 97, 3, .4);
  animation: endglow 2.4s ease-in-out infinite;
}
#ovEnd.good .end-card {
  border-color: rgba(194, 245, 23, .8);
  box-shadow: 0 0 22px 3px rgba(194, 245, 23, .55), 0 0 60px 8px rgba(72, 240, 113, .4);
  animation-name: endglowgood;
}
@keyframes endglow { 50% { box-shadow: 0 0 34px 6px rgba(248, 190, 15, .65), 0 0 80px 14px rgba(239, 97, 3, .5); } }
@keyframes endglowgood { 50% { box-shadow: 0 0 34px 6px rgba(194, 245, 23, .7), 0 0 80px 14px rgba(72, 240, 113, .5); } }

/* concert poster, shown for 3 seconds at the end of a song */
.poster-ov { position: absolute; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--bg); padding: calc(10px + env(safe-area-inset-top)) 14px calc(10px + env(safe-area-inset-bottom)); }
.poster-fit { flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 0; }
.poster-ov[hidden] { display: none; }
.poster {
  position: relative; container-type: size;
  height: 100%; aspect-ratio: 427 / 640; max-width: 100%;
  filter: drop-shadow(0 0 18px rgba(239, 97, 3, .6));
}
.poster-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.poster-band, .poster-song {
  position: absolute; left: 6%; right: 6%; text-align: center; text-transform: uppercase; font-weight: 900; line-height: 1;
  color: #fff6dc; text-shadow: 0 0 2cqw #000, 0 .6cqw 1.2cqw #000, 0 0 4cqw rgba(0, 0, 0, .9);
  -webkit-text-stroke: .5cqw #12090a; paint-order: stroke fill;
}
.poster-band { top: 14%; font-size: 9cqw; letter-spacing: .04em; }
.poster-band.long { font-size: 7cqw; }
.poster-song { top: 39%; font-size: 9cqw; letter-spacing: .03em; color: var(--amber); }
.poster-song.long { font-size: 6.5cqw; }
.poster-stamp {
  position: absolute; left: 50%; top: 71%; width: 112%; text-align: center; font-weight: 900; line-height: 1.02;
  font-size: 15cqw; letter-spacing: .03em; padding: 2cqw 0; opacity: 0;
  transform: translate(-50%, -50%) rotate(-24deg) scale(1);
}
.poster-stamp.fail {
  color: #ff2a2a; background: rgba(0, 0, 0, .55); border: 1.4cqw solid #ff2a2a; border-left: 0; border-right: 0;
  text-shadow: 0 0 3cqw rgba(255, 30, 30, .7);
}
.poster-stamp.win {
  color: #3dff6e; background: rgba(0, 0, 0, .55); border: 1.4cqw solid #3dff6e; border-left: 0; border-right: 0;
  font-size: 13cqw; text-shadow: 0 0 3cqw rgba(60, 255, 110, .8);
}
.poster-ov.go .poster-stamp.fail { animation: stampslam .35s cubic-bezier(.2, .9, .3, 1.2) .7s forwards; }
.poster-ov.go .poster-stamp.win { animation: stampslam .35s cubic-bezier(.2, .9, .3, 1.2) .7s forwards, stampflash .5s steps(2, jump-none) 1.1s infinite; }
@keyframes stampslam { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-24deg) scale(2.6); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(-24deg) scale(1); } }
@keyframes stampflash { 0% { opacity: 1; } 100% { opacity: .4; } }
.poster-ov.go .poster { animation: posterin .45s ease-out; }
@keyframes posterin { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* the score, stars and buttons that join the poster screen after its 3 seconds (END_STYLE 'poster' in js/game.js) */
.pz-top, .pz-bottom { flex: none; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.poster-ov.stats .pz-top, .poster-ov.stats .pz-bottom { opacity: 1; pointer-events: auto; }
.pz-top { text-align: center; }
.pz-score { font-size: 40px; line-height: 1; font-weight: 900; color: var(--amber); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(248, 190, 15, .5); }
.pz-stars { font-size: 26px; line-height: 1.1; color: var(--amber); letter-spacing: .1em; }
.pz-pb { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--lime); min-height: 16px; }
.pz-stats { display: flex; justify-content: center; gap: 22px; margin-top: 4px; }
.pz-stats div { display: flex; flex-direction: column; align-items: center; }
.pz-stats .k { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.pz-stats .v { font-size: 16px; font-weight: 900; color: #fff; }
.pz-bottom .btn { margin-top: 8px; }
.pz-bottom .btn-row { margin-top: 0; }

/* name box + POST MY SCORE (full-band shows only), between the poster and the buttons */
.pz-post { flex: none; opacity: 0; pointer-events: none; transition: opacity .5s ease; padding-top: 4px; }
.poster-ov.stats .pz-post { opacity: 1; pointer-events: auto; }
.pz-post[hidden] { display: none; }
.pz-post-row { display: flex; gap: 8px; }
.pz-name {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; color: #fff;                 /* 16px: iOS zooms in on smaller inputs */
  background: #11150d; border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.pz-name:focus { border-color: var(--lime); }
.pz-name::placeholder { color: var(--muted); }
.pz-name:disabled { opacity: .7; }
.pz-postbtn {
  flex: none; font: inherit; font-weight: 900; font-size: 13px; letter-spacing: .05em; color: var(--ink);
  background: linear-gradient(90deg, var(--lime), var(--amber)); border: 0; border-radius: 12px; padding: 0 14px; cursor: pointer;
}
.pz-postbtn:disabled { opacity: .55; cursor: default; }
.pz-postmsg { min-height: 16px; margin-top: 4px; text-align: center; font-size: 12px; font-weight: 700; color: var(--lime); }
.pz-postmsg.err { color: #ff8aa8; }
.pz-top { position: relative; }
.pz-boardbtn {
  position: absolute; right: 0; top: 0; font: inherit; font-weight: 800; font-size: 12px; color: var(--cream); white-space: nowrap;
  background: #1b2213; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; cursor: pointer;
}

/* leaderboard */
.board { z-index: 65; }
.board .btn { flex: none; margin-top: 0; }
.board-list { gap: 8px; }
.lb-row { flex: none; display: flex; align-items: center; gap: 10px; background: #11150d; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.lb-rank { flex: none; width: 30px; text-align: center; font-size: 18px; font-weight: 900; color: var(--muted); }
.lb-row.top1 { border-color: #f8be0f; background: linear-gradient(90deg, rgba(248, 190, 15, .18), #11150d); }
.lb-row.top2 { border-color: #c8d0d8; background: linear-gradient(90deg, rgba(200, 208, 216, .14), #11150d); }
.lb-row.top3 { border-color: #d98a4a; background: linear-gradient(90deg, rgba(217, 138, 74, .16), #11150d); }
.lb-row.top1 .lb-rank { color: #f8be0f; } .lb-row.top2 .lb-rank { color: #c8d0d8; } .lb-row.top3 .lb-rank { color: #d98a4a; }
.lb-row.mine { box-shadow: 0 0 0 2px var(--lime), 0 0 18px rgba(194, 245, 23, .35); }
.lb-mid { flex: 1; min-width: 0; }
.lb-name { font-size: 16px; font-weight: 900; color: #fff; overflow-wrap: anywhere; }
.lb-song { margin-top: 2px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.lb-score { flex: none; font-size: 20px; font-weight: 900; color: var(--amber); font-variant-numeric: tabular-nums; }

.pick-top { justify-content: space-between; }
.pick-board {
  flex: none; font: inherit; font-weight: 800; font-size: 13px; color: var(--cream);
  background: #1b2213; border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; cursor: pointer; white-space: nowrap;
}

/* leaderboard rows are tappable: "Race this song?" */
.board-hint { flex: none; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.lb-row.tap { cursor: pointer; }
.lb-row.tap:active { filter: brightness(1.25); }
.race-ov { position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(10, 11, 14, .82); padding: 16px; }
.race-ov[hidden] { display: none; }
.race-card { box-shadow: 0 0 22px 3px rgba(194, 245, 23, .35), 0 0 60px 8px rgba(248, 190, 15, .25); }
.race-q { font-size: 24px; font-weight: 900; color: var(--lime); margin-bottom: 8px; }
.race-card .btn-row { margin-top: 12px; }
.race-card .btn { margin-top: 0; }
.race-play { display: block; width: 56px; height: 56px; margin: 12px auto 0; font-size: 20px; padding-left: 3px; }
