/* ==========================================================================
   Karaoke Night — dark lounge theme
   ========================================================================== */

:root {
  --bg: #0a0a0f;
  --bg-elev: #14141c;
  --bg-elev-2: #1b1b26;
  --border: #262633;
  --text: #f2f2f6;
  --text-dim: #9a9aab;
  --text-dimmer: #6c6c7c;
  --accent: #ff2f9e;
  --accent-dim: #ff2f9e33;
  --accent-glow: 0 0 12px rgba(255, 47, 158, 0.55), 0 0 2px rgba(255, 47, 158, 0.9);
  --cyan: #33e6ff;
  --green: #33d17a;
  --yellow: #f2c94c;
  --red: #f0554a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --nav-height: 64px;
  --header-height: 56px;
  --dock-video-h: min(56.25vw, 38vh, 360px);
  --dock-bar-h: 48px;
  --dock-col-w: min(48vw, 640px);
  --dock-offset: 0px;
  /* Left chrome width: 0 with the bottom tab bar; the phone-landscape icon
     rail and the wide-screen sidebar set it (docked player + fixed bars use it). */
  --nav-rail-w: 0px;
  --radius: 14px;
  --radius-sm: 9px;
}

/* Brand wordmark: Pacifico (SIL OFL 1.1, assets/fonts/OFL-Pacifico.txt),
   Latin subset bundled so it works offline in the iOS app. Only ever
   used for the "Mic Night" name itself. */
@font-face {
  font-family: 'Pacifico';
  src: url('../assets/fonts/pacifico-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.wordmark {
  font-family: 'Pacifico', 'Brush Script MT', cursive;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
  /* the script's descenders sit low; nudge it onto the icon's center line */
  position: relative;
  top: -0.06em;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
}
html {
  /* --kn-text-scale: iOS Dynamic Type, set by the native shell
     (WebViewContainer.swift); 1 everywhere else. */
  font-size: calc(100% * var(--kn-text-scale, 1));
  /* Without this, WebKit auto-inflates text on wide viewports — fonts grew
     ~20% when the phone rotated to landscape. Every font size in this file
     is deliberate; never let the engine second-guess them. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input {
  font-family: inherit;
}

a { color: var(--cyan); }

.hidden { display: none !important; }

/* ---------------- layout shell ---------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: linear-gradient(180deg, #0e0e15 0%, #0a0a0f 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.app-header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.header-mic-icon { width: 1.3rem; height: 1.3rem; object-fit: contain; }

#app-main {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  min-height: 100vh;
  min-height: 100dvh;
}

.tab-panel { display: none; padding: 12px 12px 0; }
.tab-panel.active { display: block; }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  background: rgba(15, 15, 22, 0.92);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-dimmer);
  padding: 8px 2px 6px;
  min-height: var(--nav-height);
  position: relative;
  cursor: pointer;
}

.nav-btn .nav-icon { font-size: 1.3rem; line-height: 1; filter: grayscale(1) opacity(0.7); transition: filter 0.15s; }
.nav-btn .nav-icon img { width: 1.3rem; height: 1.3rem; object-fit: contain; display: block; }
.nav-btn .nav-label { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.01em; }

.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon { filter: none; text-shadow: var(--accent-glow); }

.nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  background: var(--accent);
  color: #12000a;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: var(--accent-glow);
}

/* ---------------- buttons / inputs ---------------- */

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-accent {
  background: var(--accent);
  color: #17010c;
  box-shadow: var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger { color: var(--red); border-color: #4a2320; }

.btn-large { width: 100%; font-size: 1.05rem; }

.text-input, .search-input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 1rem;
  min-height: 48px;
}
.text-input:focus, .search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.settings-select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 1rem;
  min-height: 44px;
  height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
.settings-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ---------------- book toolbar / filters ---------------- */

.book-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 2px 8px;
}

.sort-toggle {
  display: flex;
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.sort-toggle::-webkit-scrollbar { display: none; }

.sort-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.sort-btn.active { background: var(--accent); color: #17010c; }

.filter-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}
.filter-chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------- song list ---------------- */

.book-layout { display: block; }

.book-body {
  display: flex;
  gap: 6px;
  position: relative;
}

.song-list {
  flex: 1;
  min-width: 0;
}

.letter-header {
  position: sticky;
  top: var(--dock-offset);
  z-index: 5;
  background: var(--bg);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 8px;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

.song-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  /* Perf at 6,000+ songs: off-screen rows skip layout & paint entirely.
     The intrinsic-size estimate (~a row with one tag line) keeps the
     scrollbar stable; the `auto` keyword swaps in each row's real height
     once it has been rendered. Older WebKit ignores this harmlessly. */
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}
.song-row:active { background: var(--bg-elev); }

.song-row-main { flex: 1; min-width: 0; }
.song-row-title { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row-artist { color: var(--text-dim); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row-year { color: var(--text-dimmer); }
.song-row-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

.tag-pill {
  background: var(--bg-elev-2);
  color: var(--text-dimmer);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}

.diff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.diff-easy { background: var(--green); box-shadow: 0 0 6px var(--green); }
.diff-medium { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.diff-hard { background: var(--red); box-shadow: 0 0 6px var(--red); }

.fav-mark { color: var(--accent); font-size: 0.9rem; flex: 0 0 auto; }

/* Quiet "came from this pack" tag on Book/Search rows for purchased-pack
   songs — just the pack emoji, dimmed, trailing the artist line. */
.song-pack-mark { font-size: 0.68rem; opacity: 0.5; }

/* Dual-script titles/artists (docs/I18N-SCOPE.md): the reader's-own-script
   half leads (set by augmentSong's formatDualScript), the other half trails
   here, smaller and dimmer, still inline so row height never changes. */
.song-row-title-sub { font-weight: 400; font-size: 0.78em; color: var(--text-dim); }
.song-row-artist-sub { font-size: 0.92em; color: var(--text-dimmer); }

/* Small flag badge on a song whose language doesn't match the UI locale —
   same quiet treatment as .song-pack-mark, trailing the artist line. */
.song-lang-mark { font-size: 0.68rem; opacity: 0.5; }

/* Song action sheet must stack above #pack-browse-overlay (both were
   .overlay z-100, and pack-browse comes later in the DOM — the sheet
   opened from an owned pack's browse list would render underneath).
   Still below #modal-overlay (120) and #lyrics-overlay (150). */
#action-sheet-overlay { z-index: 110; }

.vocal-badge {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
  flex: 0 0 auto;
}
.vb-bar {
  display: block;
  width: 3px;
  background: var(--bg-elev-2);
  border-radius: 1px;
}
.vb-bar-1 { height: 4px; }
.vb-bar-2 { height: 7.5px; }
.vb-bar-3 { height: 11px; }
.vb-bar.lit { background: var(--cyan); box-shadow: 0 0 3px var(--cyan); }

.pop-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.pop-bar-track {
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.pop-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.pop-num {
  font-size: 0.68rem;
  color: var(--text-dimmer);
  font-weight: 700;
  min-width: 16px;
  text-align: right;
}

.alpha-rail {
  flex: 0 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: calc(64px + var(--dock-offset));
  align-self: flex-start;
  height: calc(100vh - 220px);
  height: calc(100dvh - 220px);
  padding: 4px 0;
  /* Scrubbable index (iOS Contacts idiom): the rail owns its touches —
     dragging along it must never scroll the page. */
  touch-action: none;
  /* Rest state is dimmed; scrolling or scrubbing lights it up. */
  opacity: 0.4;
  transition: opacity 0.2s ease;
}
.alpha-rail.active { opacity: 1; }
.alpha-rail button {
  background: none;
  border: none;
  color: var(--text-dimmer);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0;
  width: 100%;
  line-height: 1.35;
  cursor: pointer;
}
.alpha-rail button:active, .alpha-rail button.flash { color: var(--accent); }

/* Letter HUD shown while scrubbing the rail, vertically tracking the finger. */
.alpha-bubble {
  position: fixed;
  right: 44px;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 40;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.alpha-bubble.visible { display: flex; }

/* ---------------- search ---------------- */

.search-box-wrap { padding: 4px 2px 10px; position: sticky; top: var(--dock-offset); background: var(--bg); z-index: 6; }

/* ---------------- empty / loading states ---------------- */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}
.empty-state p { margin: 6px 0; }
.empty-state-icon { width: 64px; height: 64px; object-fit: contain; opacity: 0.85; margin-bottom: 4px; }
.empty-sub { color: var(--text-dimmer); font-size: 0.85rem; }

/* ---------------- locked-pack teasers (free tier) ---------------- */
/* Locked rows keep full song identity readable (temptation via specificity)
   but are visually quiet: dimmed, no play affordance, small lock + pack pill. */

.locked-row { opacity: 0.6; }
.lock-mark { flex: 0 0 auto; font-size: 0.85rem; }
.pack-pill {
  flex: 0 0 auto;
  font-size: 0.62rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teaser-header {
  color: var(--text-dimmer);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 18px 2px 6px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
#search-locked .teaser-header { border-top: none; margin-top: 4px; }
.teaser-band {
  display: block;
  width: 100%;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 12px;
  margin: 10px 0 16px;
  cursor: pointer;
  text-align: center;
}
/* Language-pack spotlight at the top of the Book (js/app.js renderBookSpotlight):
   one card, the device's own language pack, dismissible for two weeks. */
.spotlight {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 10px;
  margin: 8px 0 12px;
}
.spotlight-x {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border-radius: 999px;
  border: none; background: transparent; color: var(--text-dimmer);
  font-size: 0.8rem; cursor: pointer;
}
.spotlight-head { display: flex; align-items: center; gap: 10px; padding-right: 30px; }
.spotlight-emoji { font-size: 1.7rem; line-height: 1; flex: 0 0 auto; }
.spotlight-text { min-width: 0; }
.spotlight-title { font-weight: 800; font-size: 1rem; }
.spotlight-sub { color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }
.spotlight-rows { margin-top: 8px; }
.spotlight-rows .locked-row { opacity: 0.85; }
.spotlight-cta { width: 100%; margin-top: 8px; }

.teaser-more { color: var(--text-dimmer); font-size: 0.75rem; text-align: center; padding: 8px 0 4px; }

/* ---------------- owned-pack chips + purchase celebration ---------------- */

.pack-chip {
  border-color: var(--accent);
  color: var(--text);
}
.pack-chip.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--accent-glow);
}

#celebrate-overlay { z-index: 200; } /* above player (100) and lyrics (150) */
.celebrate-overlay { align-items: center; justify-content: center; }
.celebrate-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 32px 24px;
  text-align: center;
}
.celebrate-burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.celebrate-particle {
  position: absolute;
  bottom: 8%;
  animation: celebrate-float 2.6s ease-out forwards;
  opacity: 0;
}
@keyframes celebrate-float {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translateY(-340px) rotate(24deg); opacity: 0; }
}
.celebrate-emoji {
  font-size: 4.2rem;
  line-height: 1;
  animation: celebrate-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes celebrate-pop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.celebrate-title {
  margin-top: 14px;
  font-size: 1.7rem;
  font-weight: 800;
  text-shadow: var(--accent-glow);
}
.celebrate-sub {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.celebrate-actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------------- queue ---------------- */

.now-singing-card {
  background: radial-gradient(circle at 50% 0%, var(--accent-dim), var(--bg-elev) 70%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  margin: 6px 2px 14px;
  box-shadow: var(--accent-glow);
}
.now-singing-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 6px;
}
.now-singing-singer { font-size: 1.3rem; font-weight: 800; }
.now-singing-song { color: var(--text-dim); margin: 4px 0 14px; font-size: 0.9rem; }

.up-next-line {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: -6px 0 14px;
}

.add-singer-btn { margin: 8px 2px 14px; }

.queue-list { display: flex; flex-direction: column; gap: 8px; }

.queue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 56px;
}
.queue-pos {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.queue-row-main { flex: 1; min-width: 0; }
.queue-row-singer { font-weight: 700; font-size: 0.92rem; }
.queue-row-song { color: var(--text-dim); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row-actions { display: flex; gap: 6px; }
.queue-icon-btn {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------------- for you ---------------- */

.foryou-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 18px 4px 8px;
  color: var(--text);
}
.foryou-section-title:first-child { margin-top: 4px; }

.rec-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.rec-card-title { font-weight: 700; font-size: 0.95rem; }
.rec-card-artist { color: var(--text-dim); font-size: 0.82rem; }
.rec-card-because { color: var(--accent); font-size: 0.75rem; font-weight: 600; margin-top: 4px; }

.artist-scroll-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.artist-scroll-row::-webkit-scrollbar { display: none; }

.artist-card {
  flex: 0 0 auto;
  width: 220px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.artist-card-name {
  font-weight: 800;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}
.artist-genre-pill { cursor: default; margin-bottom: 6px; }
.artist-card-songs { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.artist-song-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: var(--bg-elev-2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
}
.artist-song-row:active { background: var(--border); }
.asr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; min-width: 0; }
.asr-pop { color: var(--text-dimmer); font-size: 0.72rem; flex: 0 0 auto; }

/* ---------------- settings ---------------- */

.settings-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 2px;
}
.settings-section h2 { margin: 0 0 8px; font-size: 1rem; }
.settings-help { color: var(--text-dim); font-size: 0.82rem; margin: 0 0 12px; line-height: 1.4; }
.settings-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.settings-actions .btn { flex: 1; min-width: 120px; }
.key-test-result { margin-top: 10px; font-size: 0.85rem; font-weight: 600; min-height: 1.2em; }
.settings-stats { color: var(--text-dim); font-size: 0.88rem; line-height: 1.6; }

/* ---------------- overlays ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
}
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.action-sheet {
  position: relative;
  margin-top: auto;
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 10px 12px calc(16px + var(--safe-bottom));
  animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.action-sheet-song {
  text-align: center;
  padding: 10px 8px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.action-sheet-song .as-title { font-weight: 800; font-size: 1rem; }
.action-sheet-song .as-artist { color: var(--text-dim); font-size: 0.85rem; margin-top: 2px; }
.action-sheet-song .as-meta { color: var(--text-dimmer); font-size: 0.76rem; margin-top: 4px; }

.sheet-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.sheet-btn:active { background: var(--bg-elev-2); }
.sheet-cancel { text-align: center; color: var(--text-dim); margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0; }

/* #modal-overlay is reused from inside other overlays now (pack detail
   samples, opened from #packs-overlay — Build 2 §B1/B2), so it needs a
   higher stacking context than the plain .overlay default; same DOM-order
   stacking bug would otherwise hide it behind whichever overlay it was
   opened from, since they share the same z-index and modal-overlay sits
   earliest in document order. */
#modal-overlay { z-index: 120; }

.modal-box {
  position: relative;
  margin: auto;
  width: calc(100% - 48px);
  max-width: 420px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-height: 82vh;
  overflow-y: auto;
}
.modal-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; }
.modal-body { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; margin-bottom: 16px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-actions .btn { width: 100%; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

/* ---- add-singer modal variant: keyboard-safe on iOS ---- */
/* Top-aligned (content stays visible above a rising keyboard) with the
   confirm/cancel row sticky at the scrollport's bottom. */
.modal-box.as-modal {
  /* Top-aligned for keyboard safety, but BELOW the status bar/notch — the
     overlay spans the full screen, so plain 10px put the title under the
     iOS clock. */
  margin: calc(var(--safe-top) + 12px) auto auto;
  /* % of the overlay, not vh: the overlay is pinned to the visualViewport
     while the keyboard is up, so 100% = the actually-visible area. */
  max-height: calc(100% - var(--safe-top) - 24px);
  padding-bottom: 0;
}
.as-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg-elev);
  padding: 12px 0 16px;
  margin-top: 14px;
}
.as-avatar-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.as-avatar-row::-webkit-scrollbar { display: none; }
.as-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--bg-elev-2);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.as-avatar.active {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

.now-transport {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.now-transport .btn { flex: 1; }

/* singer avatar in queue rows / cards */
.singer-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.mini-song-result {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  cursor: pointer;
}
.mini-song-result:active { background: var(--bg-elev-2); }
.mini-song-result .mt { font-weight: 700; font-size: 0.88rem; }
.mini-song-result .ma { color: var(--text-dim); font-size: 0.78rem; }

/* ---------------- fullscreen overlays (player / interstitial) ---------------- */

.fullscreen {
  flex-direction: column;
  background: #050508;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.player-top-bar { display: flex; justify-content: space-between; padding: 8px 12px; }
.player-close-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}

.player-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
/* Two stacked .kn-video-layer divs (shared with player.html's TV/pop-out
   crossfade engine — see css/style.css's .kn-video-layer rules below and
   js/youtube.js's dual-slot playVideo()) fill this box; whichever has
   .kn-front is the audible/visible one, the other fades in behind it. */

/* app-branded start curtain — hides YouTube's title/channel/share chrome
   flash during the first seconds of playback (see youtube.js curtainShow) */
.video-curtain {
  position: absolute;
  inset: 0;
  z-index: 1; /* above the iframe, below the dock Full Screen pill (z 2) */
  background: radial-gradient(circle at 50% 40%, #171221 0%, #050508 78%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  transition: opacity 0.65s ease;
}
.video-curtain.fading { opacity: 0; pointer-events: none; }
.vc-title {
  font-weight: 800;
  font-size: 1.35rem;
  text-shadow: var(--accent-glow);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.vc-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  animation: vc-pulse 1.6s ease-in-out infinite;
}
@keyframes vc-pulse { 50% { opacity: 0.35; } }

.player-info { padding: 14px 16px 4px; text-align: center; }
.player-song-title { font-weight: 800; font-size: 1.05rem; }
.player-song-sub { color: var(--text-dim); font-size: 0.85rem; margin-top: 2px; }

.player-alt-label { text-align: center; color: var(--text-dimmer); font-size: 0.75rem; margin: 14px 0 6px; }
/* In the in-app player the label is a TOGGLE BUTTON (thumbnails are
   collapsed until asked for — clutter otherwise). The TV player keeps the
   plain text label above: nothing on a TV is tappable. */
#player-overlay .player-alt-label {
  display: block;
  margin: 14px auto 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
}
.player-alt-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 12px 6px;
}
.alt-thumb {
  flex: 0 0 auto;
  width: 120px;
  cursor: pointer;
}
.alt-thumb img { width: 120px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.alt-thumb.active img { border-color: var(--accent); box-shadow: var(--accent-glow); }
.alt-thumb .at-title { font-size: 0.68rem; color: var(--text-dim); margin-top: 3px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }

.player-actions {
  margin-top: auto;
  padding: 14px 16px calc(10px + var(--safe-bottom));
  display: flex;
  gap: 10px;
}
.player-actions .btn-large { flex: 1; }
/* Full-screen singing view is meant to stay dim/unobtrusive around the
   video — the solid accent-pink + glow of the default .btn-accent reads as
   glaring here, so these recede to the same subtle pill treatment as
   .player-close-btn instead of a loud call-to-action look. */
.player-actions .btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  font-size: 0.92rem;
  padding: 11px 16px;
  min-height: 44px;
}

/* ---------------- docked mini-player (browse while singing) ---------------- */

.player-dock-bar { display: none; }

#player-overlay.docked {
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 640px;
  z-index: 90; /* below .overlay (100) so sheets/modals/interstitial stack above the dock */
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
}
#player-overlay.docked .player-top-bar,
#player-overlay.docked .player-info,
#player-overlay.docked .player-alt-label,
#player-overlay.docked .player-alt-strip,
#player-overlay.docked .player-actions { display: none; }
#player-overlay.docked .player-video-wrap {
  aspect-ratio: auto;
  height: var(--dock-video-h);
}
#player-overlay.docked .player-dock-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--dock-bar-h);
  padding: 0 10px;
}

/* Exit-browsing control: overlaid on the video itself (not buried in the
   thin dock bar) so it reads as an app-level "leave browse mode" action,
   distinct from YouTube's own small native fullscreen icon in the player
   chrome, which singers kept reaching for instead. */
.dock-fullscreen-btn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: var(--accent-glow);
  cursor: pointer;
}
#player-overlay.docked .dock-fullscreen-btn { display: inline-flex; }

/* Casting elsewhere (AirPlay/HDMI — either the custom TV scene or, more
   commonly, WebKit's own native per-video AirPlay for third-party TVs that
   don't support Screen Mirroring): there's no local picture to preview or
   return to, just WebKit's own compact "AirPlay — playing on X" placeholder,
   so the video box only needs to be big enough for that, and "Full Screen"
   is meaningless with nothing local to expand into. */
html.audio-route-external #player-overlay.docked .player-video-wrap {
  height: 110px;
}
html.audio-route-external #player-overlay.docked .dock-fullscreen-btn {
  display: none;
}

.dock-info { flex: 1; min-width: 0; cursor: pointer; }
.dock-title { font-weight: 800; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-sub { color: var(--text-dim); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-done-btn { flex: 0 0 auto; padding: 8px 14px; font-size: 0.82rem; }

body.player-docked {
  /* +1px = the docked overlay's border-bottom */
  --dock-offset: calc(var(--dock-video-h) + var(--dock-bar-h) + var(--safe-top) + 1px);
  padding-top: var(--dock-offset);
}
body.player-docked .app-header { display: none; }

/* Full-screen "sub-page" overlays (Packs tab's Settings-triggered browser,
   the owned/locked pack browse view) must sit BELOW the player in both its
   states — fullscreen (.overlay base z:100) and docked (z:90) — so singing
   from inside one is never invisible behind it (Joseph, 2026-07-29: "the
   in-app video needs to be shown simultaneously with browsing"). Both were
   plain `.overlay` (z:100, tied with the player) and, being LATER in the
   DOM, painted on top of it — the video wasn't hidden only while docked,
   it was hidden outright, even fullscreen. z:80 keeps them above ordinary
   tab content but under the player in either mode; action-sheet (110) and
   modal (120) still stack above everything, unaffected. */
#packs-overlay, #pack-browse-overlay { z-index: 80; }
/* When docked, these sub-pages reflow to make room for the video strip
   instead of sitting under it — position:fixed ignores body's own
   padding-top, so each needs the offset directly (already includes
   --safe-top, see the calc above; overrides .fullscreen's plain
   safe-top-only padding while docked). */
body.player-docked #packs-overlay,
body.player-docked #pack-browse-overlay {
  padding-top: var(--dock-offset);
}

/* ---- Landscape ------------------------------------------------------------
   Sideways phones have abundant width and scarce height, so the portrait
   chrome (top title header, bottom tab bar, top-docked video strip) is
   rearranged edge-wise instead of stacked:
   - the tab bar becomes a slim left rail; the title header is dropped
   - the fullscreen player becomes video-left / controls-right (portrait's
     width:100% + 16:9 video is TALLER than a landscape screen — it
     overflowed and pushed every control off-screen)
   - docked "browse while singing" is a full-height video column between
     the rail and the app, not a strip on top */
/* Phone landscape (short screens only — a laptop browser or a landscape iPad
   is landscape too, but has the height for the wide sidebar layout below). */
@media (orientation: landscape) and (max-height: 540px) {
  :root { --nav-rail-w: calc(64px + var(--safe-left)); }

  .app-header { display: none; }
  body { padding-left: var(--nav-rail-w); }
  .bottom-nav {
    top: 0; bottom: 0; left: 0; right: auto;
    width: var(--nav-rail-w);
    max-width: none;
    flex-direction: column;
    justify-content: center;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 0 0 0 var(--safe-left);
  }
  .nav-btn { flex: 0 1 76px; }

  /* sticky offsets assumed the (now hidden) header above them */
  .alpha-rail { top: var(--dock-offset); height: calc(100vh - 140px); height: calc(100dvh - 140px); }
  .toast { bottom: calc(var(--safe-bottom) + 16px); left: calc(50% + var(--nav-rail-w) / 2); }
  .react-bar { bottom: var(--safe-bottom); left: var(--nav-rail-w); }
}

/* Mid-size landscape window (no rail, no sidebar): the bottom tab bar stops
   at the docked video column instead of running underneath it. */
@media (orientation: landscape) and (min-height: 541px) and (max-width: 899px) {
  body.player-docked .bottom-nav { right: var(--dock-col-w); margin: 0; max-width: none; }
}

@media (orientation: landscape) {
  :root { --dock-col-w: min(44vw, 560px); }

  /* fullscreen player: video fills the ENTIRE area (no reserved side rail —
     a fixed-width control column read as a permanent black bar eating ~20%
     of the screen, field feedback 2026-07-29). Every control instead floats
     directly over the video with a translucent/scrim background, same idiom
     as a native video player's tap-to-reveal chrome. */
  #player-overlay.fullscreen:not(.docked) {
    /* .overlay's own position:fixed; inset:0 already gives this its
       full-viewport size and positioning context — do NOT override position
       here (relative collapsed it to 0-height, since its only children are
       absolutely positioned and contribute no intrinsic size back to it). */
    padding: 0;
  }
  #player-overlay.fullscreen:not(.docked) .player-video-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    /* This box is rarely 16:9 — without this the YouTube iframe letterboxes
       itself inside it instead of filling it. Container query units make
       the iframe rule below size relative to THIS box, not the viewport. */
    container-type: size;
  }
  #player-overlay.fullscreen:not(.docked) .kn-video-layer iframe {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: max(100cqw, 177.78cqh);
    height: max(56.25cqw, 100cqh);
    transform: translate(-50%, -50%);
  }
  /* scrim behind the top-left title and the bottom controls, so floating
     text/buttons stay legible over bright video without darkening the
     whole frame the way a solid side column did */
  #player-overlay.fullscreen:not(.docked)::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 180px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    pointer-events: none;
    z-index: 1;
  }
  #player-overlay.fullscreen:not(.docked)::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 90px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
    pointer-events: none;
    z-index: 1;
  }
  #player-overlay.fullscreen:not(.docked) .player-top-bar {
    position: absolute;
    top: var(--safe-top);
    left: var(--safe-left);
    right: auto;
    z-index: 3;
    width: auto;
    padding: 10px;
  }
  /* song title/artist rides next to the close button up top, out of the
     way of the playback controls anchored to the bottom */
  #player-overlay.fullscreen:not(.docked) .player-info {
    position: absolute;
    z-index: 3;
    top: calc(var(--safe-top) + 8px);
    left: calc(var(--safe-left) + 64px);
    right: calc(var(--safe-right) + 14px);
    padding: 0;
    text-align: left;
  }
  #player-overlay.fullscreen:not(.docked) .player-song-title,
  #player-overlay.fullscreen:not(.docked) .player-song-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #player-overlay.fullscreen:not(.docked) .player-alt-label {
    position: absolute;
    z-index: 3;
    right: calc(var(--safe-right) + 14px);
    bottom: calc(var(--safe-bottom) + 66px);
    margin: 0;
  }
  #player-overlay.fullscreen:not(.docked) .player-alt-strip {
    position: absolute;
    z-index: 3;
    left: calc(var(--safe-left) + 14px);
    right: calc(var(--safe-right) + 14px);
    bottom: calc(var(--safe-bottom) + 66px);
    padding: 0 0 6px;
  }
  #player-overlay.fullscreen:not(.docked) .player-actions {
    position: absolute;
    z-index: 3;
    left: calc(var(--safe-left) + 14px);
    right: calc(var(--safe-right) + 14px);
    bottom: var(--safe-bottom);
    margin-top: 0;
    padding: 10px 0;
  }

  /* docked: nav rail | songbook/app | full-height video column on the right,
     so the browse content sits next to the buttons that drive it */
  #player-overlay.docked {
    top: 0; bottom: 0;
    right: 0;
    left: auto;
    width: var(--dock-col-w);
    max-width: none;
    margin: 0;
    border-bottom: none;
    border-left: 1px solid var(--border);
  }
  #player-overlay.docked .player-video-wrap {
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
  }
  #player-overlay.docked .player-dock-bar { flex: 0 0 auto; }
  body.player-docked {
    --dock-offset: 0px;
    padding-top: var(--safe-top);
    padding-left: var(--nav-rail-w);
    padding-right: var(--dock-col-w);
  }
  /* Popups raised while a song plays docked (action sheet, add-singer /
     replace modals) confine themselves to the browse column — a full-width
     sheet would blanket the video playing on the right. */
  body.player-docked #action-sheet-overlay,
  body.player-docked #modal-overlay {
    left: var(--nav-rail-w);
    right: var(--dock-col-w);
  }
  /* Docked video is a full-height RIGHT column here, not a top strip —
     packs/pack-browse reserve that same width instead of running under it.
     No left/nav-rail offset needed: the nav rail (z:30) already renders
     below these overlays (z:80) whether docked or not, same as today. */
  body.player-docked #packs-overlay,
  body.player-docked #pack-browse-overlay {
    padding-top: var(--safe-top); /* --dock-offset is 0px here (see above) */
    right: var(--dock-col-w);
  }
}

/* ---------------- lyrics overlay ---------------- */

#lyrics-overlay { z-index: 150; }

.lyrics-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.lyrics-header-text { min-width: 0; }
.lyrics-title { font-weight: 800; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lyrics-artist { color: var(--text-dim); font-size: 0.85rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lyrics-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px calc(24px + var(--safe-bottom));
}
.lyrics-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
}
.lyrics-status {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
}
.lyrics-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: lyrics-spin 0.8s linear infinite;
}
@keyframes lyrics-spin { to { transform: rotate(360deg); } }

.interstitial-content {
  margin: auto;
  text-align: center;
  padding: 24px;
}
.interstitial-emoji { font-size: 3.2rem; text-shadow: var(--accent-glow); margin-bottom: 10px; }
.interstitial-emoji img { width: 3.2rem; height: 3.2rem; object-fit: contain; margin: 0 auto; }
.interstitial-text { font-size: 1.15rem; font-weight: 700; margin-bottom: 24px; line-height: 1.4; }
.interstitial-content .btn { width: 240px; max-width: 80vw; margin: 0 auto 10px; }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------------- settings toggle switch / slider ---------------- */

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.settings-toggle-row + .settings-toggle-row { border-top: 1px solid var(--border); }
.settings-toggle-label { font-weight: 600; font-size: 0.92rem; }
.settings-toggle-sub { color: var(--text-dimmer); font-size: 0.78rem; margin-top: 2px; }

.kn-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.kn-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.kn-switch-track {
  position: absolute;
  inset: 0;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}
.kn-switch-track::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}
.kn-switch input:checked + .kn-switch-track { background: var(--accent-dim); border-color: var(--accent); }
.kn-switch input:checked + .kn-switch-track::before { transform: translateX(20px); background: var(--accent); box-shadow: var(--accent-glow); }

.settings-slider-row { padding: 10px 0 4px; border-top: 1px solid var(--border); }
.settings-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 10px;
}
.settings-slider-value { color: var(--accent); font-weight: 700; }

/* ---------------- pop-out player window (player.html) ---------------- */

body.kn-player-body {
  margin: 0;
  /* The landscape nav-rail rule (`body { padding-left: var(--nav-rail-w) }`)
     matched this page too, leaving a 64px black strip down the left of every
     TV/pop-out — the player has no nav rail. */
  padding: 0;
  background: #000;
  color: var(--text);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.kn-player-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}

.kn-video-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.kn-video-layer.kn-front { opacity: 1; }
.kn-video-layer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.kn-player-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

.kn-player-bottombar {
  flex: 0 0 auto;
  background: linear-gradient(180deg, #0a0a0f 0%, #050508 100%);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(8px + var(--safe-bottom));
}
.kn-now-playing-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kn-now-title { font-weight: 800; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-now-sub { color: var(--text-dim); font-size: 0.82rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-up-next-hint { color: var(--text-dimmer); font-size: 0.75rem; flex: 0 0 auto; white-space: nowrap; padding-top: 2px; }

/* the alt strip reuses .player-alt-strip / .alt-thumb / .player-alt-label
   from the in-app overlay styling above, just nested in the bottom bar */
.kn-player-bottombar .player-alt-label { margin: 12px 0 4px; text-align: left; }
.kn-player-bottombar .player-alt-strip { padding: 0 0 2px; }

/* ---------------- wider screens ----------------
   Everything below keys off the WINDOW size, not the device: an iPad in a
   narrow Split View / Stage Manager window gets the phone layout, a laptop
   browser gets the iPad layout. (html.ipad is only the device idiom now.)

   Tiers:
   - < 700px: phone layout (bottom tab bar)
   - landscape + <= 540px tall: phone-landscape icon rail (see above)
   - >= 700px: roomier shell, two-column Book, grids
   - >= 900px wide + >= 541px tall: left sidebar (brand, labeled tabs,
     now-singing card) instead of the header + bottom tab bar
   - >= 1200px landscape: "party control" — the Queue rides along as a right
     column while browsing Book/Search, with the docked video on top of it */

@media (min-width: 700px) {
  .app-header, #app-main, .bottom-nav { max-width: 760px; }
  #player-overlay.docked { max-width: 760px; }
}

@media (min-width: 1000px) {
  .app-header, #app-main, .bottom-nav { max-width: 900px; }
  #player-overlay.docked { max-width: 900px; }
  html { font-size: calc(105% * var(--kn-text-scale, 1)); }
  .song-row { padding: 11px 8px; min-height: 60px; }
  .filter-chip-row { flex-wrap: wrap; overflow-x: visible; }
}

@media (min-width: 700px) and (min-height: 541px) {
  .book-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
  }
  .book-filters-col {
    flex: 0 0 200px;
    position: sticky;
    top: calc(var(--dock-offset) + 8px);
    max-height: calc(100dvh - var(--dock-offset) - 24px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .book-filters-col::-webkit-scrollbar { display: none; }
  .book-body { flex: 1; min-width: 0; }
  .book-filters-col .filter-chip-row { flex-wrap: wrap; overflow-x: visible; }
  .book-filters-col .book-toolbar { flex-wrap: wrap; }
  .book-filters-col .sort-toggle { order: 3; flex: 1 1 100%; }
  .book-filters-col .sort-btn { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; }
  .book-filters-col .legend-btn { margin-left: auto; }
  /* Spotlight / theme-night banner / teaser sit with the list, not under the filters */
  .book-layout > #book-night-banner,
  .book-layout > #book-spotlight { display: none; }
}

@media (min-width: 700px) {
  .queue-list {
    display: grid;
    /* min(300px, 100%) instead of a bare 300px floor: a plain minmax(300px,1fr)
       overflows the container the moment available width drops below 300px.
       Capping the floor at 100% guarantees one column always fits. */
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 10px;
  }
  .queue-row { padding: 14px 16px; min-height: 64px; }
  .queue-row-singer { font-size: 1.05rem; }
  .now-singing-card { padding: 24px; }
  .now-singing-singer { font-size: 1.6rem; }
}

@media (orientation: portrait) and (min-width: 700px) {
  #player-overlay.fullscreen:not(.docked) {
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
  }
  /* The video itself goes full-bleed edge-to-edge — only the text/controls
     below it stay capped for readability at tablet width. */
  #player-overlay.fullscreen:not(.docked) .player-info,
  #player-overlay.fullscreen:not(.docked) .player-actions,
  #player-overlay.fullscreen:not(.docked) .player-alt-strip,
  #player-overlay.fullscreen:not(.docked) .player-alt-label {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
}

/* ---------------- sidebar layout (>= 900 x 541) ---------------- */

.nav-brand, .nav-now-card, .nav-kbd-hint { display: none; }

@media (min-width: 900px) and (min-height: 541px) {
  :root { --nav-rail-w: calc(236px + var(--safe-left)); }

  .app-header { display: none; }
  body { padding-left: var(--nav-rail-w); }

  .bottom-nav {
    top: 0; bottom: 0; left: 0; right: auto;
    width: var(--nav-rail-w);
    max-width: none;
    margin: 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: calc(var(--safe-top) + 22px) 14px calc(var(--safe-bottom) + 16px) calc(var(--safe-left) + 14px);
    border-top: none;
    border-right: 1px solid var(--border);
    background:
      radial-gradient(140% 50% at 0% 0%, rgba(255, 47, 158, 0.14), transparent 70%),
      radial-gradient(120% 40% at 100% 100%, rgba(51, 230, 255, 0.07), transparent 70%),
      #0c0c13;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 22px;
  }
  .nav-brand-icon { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255, 47, 158, 0.6)); }
  .nav-brand-text { display: flex; flex-direction: column; min-width: 0; }
  .nav-brand-name {
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: #fff;
    text-shadow: 0 0 14px rgba(255, 47, 158, 0.75), 0 0 2px rgba(255, 47, 158, 0.9);
    white-space: nowrap;
  }
  .nav-brand-party {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-brand-party:empty { display: none; }

  .nav-btn {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text-dim);
    transition: background 0.15s, color 0.15s;
  }
  .nav-btn .nav-icon img { width: 1.35rem; height: 1.35rem; }
  .nav-btn .nav-label { font-size: 0.95rem; font-weight: 700; }
  .nav-btn.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(255, 47, 158, 0.24), rgba(255, 47, 158, 0.06));
    box-shadow: inset 3px 0 0 var(--accent), 0 0 18px rgba(255, 47, 158, 0.12);
  }
  .nav-btn.active .nav-label { text-shadow: 0 0 10px rgba(255, 47, 158, 0.6); }
  .nav-badge { position: static; margin-left: auto; }

  .nav-now-card:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    width: 100%;
    text-align: left;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    background: radial-gradient(circle at 0% 0%, rgba(255, 47, 158, 0.28), var(--bg-elev) 75%);
    box-shadow: var(--accent-glow);
    color: var(--text);
    font: inherit;
    cursor: pointer;
  }
  .nav-now-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.16em; color: var(--accent); }
  .nav-now-singer { font-size: 1.05rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-now-song { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-now-next { font-size: 0.74rem; color: var(--cyan); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-now-next:empty { display: none; }
  .nav-kbd-hint { display: block; margin-top: 12px; padding: 0 8px; font-size: 0.68rem; color: var(--text-dimmer); }
  .nav-now-card.hidden + .nav-kbd-hint { margin-top: auto; }
  /* touch-only devices (iPad without a keyboard) don't need the hint */
  @media (hover: none) { .nav-kbd-hint { display: none; } }

  #app-main {
    max-width: 1240px;
    padding: 0 20px 32px;
  }
  .tab-panel { padding: calc(var(--safe-top) + 20px) 4px 0; }
  body.player-docked .tab-panel { padding-top: 20px; }

  /* no header above the sticky bits any more */
  .alpha-rail { top: calc(var(--dock-offset) + 12px); height: calc(100vh - 80px); height: calc(100dvh - var(--dock-offset) - 40px); }
  .alpha-bubble { right: 60px; }

  .toast { bottom: calc(var(--safe-bottom) + 24px); left: calc(50% + var(--nav-rail-w) / 2); }
  .react-bar { bottom: var(--safe-bottom); left: var(--nav-rail-w); max-width: none; padding-left: 24px; padding-right: 24px; }
  body.react-bar-on #app-main { padding-bottom: calc(var(--safe-bottom) + 110px); }

  /* portrait wide (12.9" iPad portrait): the docked video strip sits right of the sidebar */
  #player-overlay.docked { left: var(--nav-rail-w); }

  /* Settings: two balanced columns instead of one long stack */
  #tab-settings { columns: 2 340px; column-gap: 16px; }
  #tab-settings .settings-section { break-inside: avoid; margin: 0 0 16px; display: inline-block; width: 100%; }
  #tab-settings .settings-section.hidden { display: none !important; }

  /* Book: song cards in a grid */
  #book-list.song-list,
  #search-results.song-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
    gap: 8px;
    align-content: start;
  }
  #book-list .letter-header,
  #search-results .letter-header,
  #book-list > :not(.song-row),
  #search-results > :not(.song-row) { grid-column: 1 / -1; }
  #book-list .song-row,
  #search-results .song-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elev);
    padding: 10px 12px;
  }
  #book-list .letter-header { border-bottom: none; padding: 14px 4px 4px; background: linear-gradient(var(--bg) 70%, transparent); }
  .search-box-wrap { padding-top: 0; }
}

@media (orientation: landscape) and (min-width: 900px) and (min-height: 541px) {
  #player-overlay.docked { left: auto; }
}

/* ---------------- party control: queue column (>= 1200 landscape) -------- */

.party-col-title { display: none; }

@media (min-width: 1200px) and (min-height: 600px) and (orientation: landscape) {
  :root {
    --party-col-w: clamp(340px, 27vw, 430px);
    /* docked video on top of the queue column */
    --party-dock-h: calc(var(--party-col-w) * 0.5625 + var(--dock-bar-h));
  }

  body[data-tab="book"],
  body[data-tab="search"] { padding-right: var(--party-col-w); --dock-col-w: var(--party-col-w); }

  body[data-tab="book"] #tab-queue,
  body[data-tab="search"] #tab-queue {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    width: var(--party-col-w);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 24px);
    border-left: 1px solid var(--border);
    background:
      radial-gradient(120% 40% at 100% 0%, rgba(255, 47, 158, 0.10), transparent 70%),
      #0c0c13;
    scrollbar-width: thin;
  }
  body[data-tab="book"] #tab-queue .party-col-title,
  body[data-tab="search"] #tab-queue .party-col-title {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dimmer);
    margin: 0 2px 12px;
  }
  body[data-tab="book"] .nav-now-card,
  body[data-tab="search"] .nav-now-card { display: none !important; }
  /* narrow column: compact rows so the song line keeps its room */
  body[data-tab="book"] #tab-queue .queue-row,
  body[data-tab="search"] #tab-queue .queue-row { padding: 10px; gap: 8px; min-height: 56px; }
  body[data-tab="book"] #tab-queue .queue-row-singer,
  body[data-tab="search"] #tab-queue .queue-row-singer { font-size: 0.95rem; }
  body[data-tab="book"] #tab-queue .queue-icon-btn,
  body[data-tab="search"] #tab-queue .queue-icon-btn { width: 32px; height: 32px; font-size: 0.85rem; }
  body[data-tab="book"] #tab-queue .queue-row-actions,
  body[data-tab="search"] #tab-queue .queue-row-actions { gap: 4px; }
  body[data-tab="book"] #tab-queue .add-singer-btn,
  body[data-tab="search"] #tab-queue .add-singer-btn { width: 100%; margin-left: 0; margin-right: 0; }
  body[data-tab="book"] #tab-queue .now-singing-card,
  body[data-tab="search"] #tab-queue .now-singing-card { padding: 18px; }

  /* Song playing (docked) while browsing: video on top of the queue column */
  body.player-docked[data-tab="book"] #player-overlay.docked,
  body.player-docked[data-tab="search"] #player-overlay.docked {
    bottom: auto;
    height: calc(var(--party-dock-h) + var(--safe-top));
    width: var(--party-col-w);
    border-bottom: 1px solid var(--border);
  }
  body.player-docked[data-tab="book"] #tab-queue,
  body.player-docked[data-tab="search"] #tab-queue {
    top: calc(var(--party-dock-h) + var(--safe-top) + 1px);
    padding-top: 14px;
  }

  /* toast / reactions centered over the browse column */
  body[data-tab="book"] .toast,
  body[data-tab="search"] .toast { left: calc(var(--nav-rail-w) + (100% - var(--nav-rail-w) - var(--party-col-w)) / 2); }
  body[data-tab="book"] .react-bar,
  body[data-tab="search"] .react-bar { right: var(--party-col-w); }
}

/* ---------------- LAN companion mode ---------------- */

.guest-name-chip {
  position: absolute;
  right: 14px;
  top: calc(var(--safe-top) + 8px);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.queue-toolbar { padding: 4px 2px 10px; }
.queue-toolbar .btn { width: 100%; }

.live-from-host-label {
  text-align: center;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

/* Guests get a read-only queue: hide host-only controls */
body.kn-guest-connected #add-singer-btn,
body.kn-guest-connected #now-singing-start-btn,
body.kn-guest-connected .queue-row-actions {
  display: none !important;
}

/* Invite modal: QR needs a light card regardless of app theme, for scan reliability */
.invite-url-box {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cyan);
  word-break: break-all;
  text-align: center;
  margin-bottom: 14px;
}
.invite-qr-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  width: fit-content;
}
.invite-qr-card canvas { display: block; }
.invite-hint { text-align: center; color: var(--text-dim); font-size: 0.8rem; margin-bottom: 4px; }

/* Guest read-only queue rows (no action buttons, just position/singer/song) */
.queue-row.queue-row-readonly .queue-row-actions { display: none; }

.connection-status-ok { color: var(--green); }
.connection-status-bad { color: var(--yellow); }

/* ==========================================================================
   iOS app wrapper only — js/platform.js adds .ios-app to <html> when
   window.KN_PLATFORM === 'ios' (native WKWebView shell). No effect in a
   regular browser. Hides: unlicensed lyrics UI, pop-out settings (no
   multi-window on iOS), and the companion "Invite singers" affordance (app
   runs standalone on iOS). Crossfade settings stay visible on iOS — the
   in-page overlay (js/youtube.js) runs its own dual-slot crossfade engine
   now, not just the pop-out/TV-relay one in js/player.js (2026-07-28: most
   real TVs never touch player.js at all — only genuine Screen-Mirroring
   receivers do — so gating crossfade on that path meant most iOS users
   never even saw the setting). Auto-start is unaffected — it's meaningful
   on every platform. */
.ios-app #sheet-lyrics-btn,
.ios-app #player-lyrics-btn,
.ios-app #settings-popout-row {
  display: none !important;
}

/* iOS Settings > "📺 Play on a TV" how-to disclosures */
.tv-howto { margin-top: 10px; }
.tv-howto summary { cursor: pointer; font-weight: 700; color: var(--text); padding: 4px 0; }
.tv-howto p.settings-help { margin: 6px 0 0; }

/* "Invite singers" is standalone-iOS-inapplicable, but becomes usable the
   moment js/companion.js flips role to host via the native host bridge
   (see the "iOS Host a Party" block below) — hidden unless <html> also
   carries .hosting-active, which companion.js toggles from bridge events. */
.ios-app:not(.hosting-active) #invite-btn {
  display: none !important;
}

/* ==========================================================================
   iOS "Host a Party" — Settings tab section, iOS app only. Talks to the
   native host bridge (js/companion.js) which runs the same server.mjs
   protocol in-process; visibility of #settings-host-section itself is
   toggled in JS (KN.companion.renderHostSection, gated on
   KN.platform.IS_IOS_APP), not CSS — it starts with the "hidden" class in
   index.html so it never flashes on web/Mac before that JS runs.
   ========================================================================== */
.host-active-block { margin-top: 14px; }
.host-active-block .invite-qr-card { margin-bottom: 12px; }
.host-keep-open-note { margin: 0; text-align: center; }

/* Build 2 §B6: non-blocking guest-cap upsell line under the QR/URL box. */
.host-guest-status { margin: 8px 0 0; text-align: center; font-size: 0.82rem; color: var(--text-dim); }
.host-guest-status-upsell { color: var(--accent); font-weight: 700; }

/* TV setup visual guide (Settings › Play on a TV) */
.tv-guide { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 4px 4px; }
.tv-guide-step { flex: 1 1 130px; max-width: 180px; text-align: center; }
.tv-guide-step p { font-size: 0.8rem; color: var(--text-dim, #9a9aa8); margin: 8px 0 0; line-height: 1.35; }
.tv-guide-step b { color: var(--text, #f2f2f7); }
.tv-guide-fine { font-size: 0.7rem; opacity: 0.75; }
.tv-guide-svg { width: 100%; max-width: 120px; height: auto; }
.tv-guide > .settings-help { flex-basis: 100%; margin: 2px 0 0; }

/* ==========================================================================
   Build 2 — Packs & Pro overlay (js/packs.js). Reuses the .overlay/.fullscreen/
   .player-top-bar/.player-close-btn/.modal-box idiom already established by
   the player/lyrics overlays and the invite modal.
   ========================================================================== */
.packs-top-bar { justify-content: space-between; }
.packs-top-title { flex: 1; display: flex; align-items: center; padding-left: 16px; font-weight: 800; font-size: 1.05rem; }
.packs-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(24px + var(--safe-bottom)); }

/* End-of-night recap overlay (js/recap.js) — reuses .packs-top-bar/.packs-body. */
.recap-hero { display: flex; gap: 12px; margin: 12px 0 16px; }
.recap-stat {
  flex: 1;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.recap-num { display: block; font-size: 1.8rem; font-weight: 800; }
.recap-label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
.recap-line { font-size: 0.92rem; margin: 6px 0; }
.recap-singer-list { margin-top: 14px; border-top: 1px solid var(--border); }
.recap-singer-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.recap-empty { color: var(--text-dim); text-align: center; margin-top: 40px; }

.packs-web-banner {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 10px 0;
}

.pro-card {
  background: linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.pro-card-owned { border-color: var(--green); }
.pro-card-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.pro-card-sub { color: var(--text-dim); font-size: 0.85rem; line-height: 1.4; margin-bottom: 12px; }
.pack-owned-badge {
  display: inline-block;
  color: var(--green);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
}

.packs-list-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dimmer); margin: 18px 2px 8px; }
.packs-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

/* ---------------- pack-browse overlay (full locked-pack song list) -------- */
.pack-browse-search-wrap { padding: 4px 16px 8px; position: static; }
#pack-browse-genre-row { padding-left: 16px; padding-right: 16px; }
.pack-browse-list { flex: 1; min-width: 0; overflow-y: auto; padding: 0 16px; }
.pack-browse-buy-bar { padding: 12px 16px calc(10px + var(--safe-bottom)); }
.pack-browse-buy-bar .pack-buy-btn,
.pack-browse-buy-bar .pack-web-note { width: 100%; }

.pack-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.pack-row-locked { cursor: pointer; }
.pack-row-locked:active { background: var(--bg-elev-2); }
.pack-row-owned { border-color: var(--green); }
.pack-row-emoji { font-size: 1.6rem; line-height: 1; }
.pack-row-main { flex: 1; min-width: 0; }
.pack-row-name { font-weight: 700; font-size: 0.95rem; }
.pack-owned-tag { color: var(--green); font-size: 0.78rem; font-weight: 700; }
.pack-included-tag { color: var(--accent); }

/* Timed access card (docs/ACCESS-MODEL-SPEC.md) */
.access-card-trial { border-color: var(--accent); box-shadow: var(--accent-glow); }
.access-card-active { border-color: var(--green); }
.access-offer + .access-offer { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.access-offer-title { font-weight: 700; margin-bottom: 2px; }
.access-terms { color: var(--text-dim); font-size: 0.72rem; line-height: 1.4; margin-top: 8px; }
.access-terms a { color: var(--text-dim); text-decoration: underline; }
#pack-browse-buy-bar .pack-buy-btn + .pack-buy-btn { margin-top: 8px; }
.pack-row-blurb { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; line-height: 1.35; }
.pack-row-count { color: var(--text-dimmer); font-size: 0.74rem; margin-top: 4px; }
.pack-row-lock { font-size: 1.1rem; opacity: 0.7; }

/* On-demand pack download states (Build 2 catalog-sync refinement): shown
   only for an OWNED pack whose file is being fetched/verified, or whose
   fetch failed — the purchase itself is never at risk, this is purely a
   "content isn't on-device yet" indicator with a retry path. */
.pack-row-downloading { border-color: var(--accent-dim); }
.pack-row-failed { border-color: var(--red); }
.pack-row-status { color: var(--text-dimmer); font-size: 0.74rem; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.pack-row-status.is-failed { color: var(--red); }
.pack-row-retry-btn {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
}
.pack-row-retry-btn:active { background: var(--red); color: var(--bg); }

.pack-buy-btn { width: 100%; }
.pack-web-note { color: var(--text-dimmer); font-size: 0.8rem; font-style: italic; }

/* DEBUG-only entitlement override modal (docs/BUILD2-SPEC.md §8) */
.debug-ent-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; padding: 6px 0; word-break: break-all; }

/* ---------------- wider screens: overlays & Packs grid ---------------- */
@media (min-width: 700px) {

/* Interstitial ("you're up"): deliberately full-bleed backdrop is fine — cap
   only the inner content so text/emoji stay comfortable at iPad width. */
.interstitial-content { max-width: 480px; margin: auto; }

/* Lyrics panel: no existing width cap at all — long line lengths at iPad
   width need a real column, matching the app's existing 640px content
   width convention used elsewhere. */
#lyrics-overlay .lyrics-top-bar,
#lyrics-overlay .lyrics-body {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Packs & Pro: single scrolling column today — grid lets multiple packs
   show at once on a 12.9" iPad, matching the free-tier teaser's "go
   deeper" promise with an actually spacious browse experience. */
.packs-body { max-width: 900px; margin: 0 auto; }
.packs-list {
  display: grid;
  /* min(280px, 100%) guards the same overflow risk as the Queue grid above —
     fits with zero margin at the narrowest Split View width today, which is
     fragile, not safe. */
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 12px;
  align-items: start;
}

/* #pack-browse-overlay (full locked-pack song list) — same width discipline
   as .packs-body above; a plain scrolling list (not a grid — these are
   simple song rows, not self-contained cards) stays centered instead of
   stretching full-bleed on a wide iPad while its sibling Settings overlay
   stays capped. */
.pack-browse-search-wrap,
#pack-browse-genre-row,
.pack-browse-list,
.pack-browse-buy-bar {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
}

/* Reviewed, no change needed on iPad (already properly capped/centered
   independent of any breakpoint):
   - .action-sheet (max-width: 640px, bottom sheet)
   - .modal-box (max-width: 420px, centered — covers the generic modal,
     add-singer, guest-name, and locked-pack-teaser variants, which all
     render into this same shared element)
   - .celebrate-stage (max-width: 420px, centered inside the full-bleed
     purchase-celebration overlay) */

/* ---- pack browse: locked-row tap -> buy bar pulse + "what you get" sheet ---- */
.pack-browse-list .locked-row { cursor: pointer; }
.pack-browse-list .locked-row:active { background: var(--bg-elev-2); }
@keyframes buybar-pulse {
  0%   { transform: scale(1); filter: none; }
  30%  { transform: scale(1.035); filter: drop-shadow(0 0 14px rgba(255, 47, 158, 0.75)); }
  60%  { transform: scale(0.99); }
  100% { transform: scale(1); filter: none; }
}
.pack-browse-buy-bar.pulse .pack-buy-btn { animation: buybar-pulse 0.7s ease-out 2; }
.lock-sheet-artist { color: var(--text-dim); font-size: 0.85rem; margin: -2px 0 10px; }
.lock-sheet-body { margin-bottom: 14px; }
.lock-sheet-line { padding: 6px 0; border-top: 1px solid var(--border); color: var(--text); font-size: 0.9rem; }
.lock-sheet-line:first-child { border-top: none; }
.lock-sheet-lead { font-weight: 700; }

/* ---- Mic Night Pro: Party Host ------------------------------------------ */
.pro-badge {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1a1206;
  background: linear-gradient(135deg, var(--yellow), #ff9f2f);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 4px;
}
.pro-feature-list { list-style: none; padding: 0; margin: 4px 0 12px; }
.pro-feature-list li {
  position: relative;
  padding: 5px 0 5px 22px;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.35;
}
.pro-feature-list li::before { content: '✓'; position: absolute; left: 2px; top: 5px; color: var(--accent); font-weight: 800; }
.pro-feature-list li.hl { color: var(--accent); font-weight: 700; }
.pro-upsell-lead { color: var(--text); font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; }
.pro-upsell-note { color: var(--text-dimmer); font-size: 0.75rem; margin-top: 8px; text-align: center; }
.pro-card .pro-card-title { margin-bottom: 8px; }

.queue-rotation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0 0 12px;
}
body.kn-guest-connected #queue-rotation-row,
body.kn-guest-connected #settings-party-section { display: none !important; }

.party-theme-label { color: var(--text-dim); font-size: 0.8rem; margin: 14px 0 8px; }
.party-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.party-swatch {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--border);
}
.party-swatch.active { border-color: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, 0.35); }

.recap-party-title { text-align: center; font-weight: 800; font-size: 1.15rem; margin: 10px 0 0; text-shadow: var(--accent-glow); }
.recap-section-title { margin: 28px 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dimmer); border-top: 1px solid var(--border); padding-top: 18px; }
.recap-subtitle { margin: 18px 0 4px; font-weight: 700; font-size: 0.9rem; }
.recap-hero-alltime { margin-top: 4px; }
.recap-locked { background: var(--bg-elev); border: 1px dashed var(--accent-dim); border-radius: var(--radius); padding: 14px; text-align: center; }
.recap-locked-text { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 10px; line-height: 1.4; }
.recap-locked .btn { width: 100%; }
.recap-party-list { margin-top: 6px; }
.recap-party-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.recap-party-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.recap-party-name { font-weight: 700; font-size: 0.92rem; }
.recap-party-date { color: var(--text-dimmer); font-size: 0.75rem; white-space: nowrap; }
.recap-party-meta { color: var(--text-dim); font-size: 0.8rem; margin-top: 3px; }

/* ---- TV between-songs screen (player.html #kn-idle, js/player.js) ------- */
.kn-idle {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 5vh 6vw 4vh;
  color: #fff;
  background: #07070c; /* fallback: color-mix() needs iOS 16.2+ */
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 60%),
    radial-gradient(110% 90% at 100% 100%, color-mix(in srgb, var(--party-accent2, #7b2fff) 34%, transparent) 0%, transparent 62%),
    #07070c;
}
body.kn-idle-active .kn-player-bottombar { display: none; }
.kn-idle-party {
  font-size: 3.2vh;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow: 0 0 2.2vh color-mix(in srgb, var(--accent) 70%, transparent);
  min-height: 3.6vh;
}
.kn-idle-body { flex: 1; display: flex; align-items: center; gap: 5vw; min-height: 0; }
.kn-idle-main { flex: 1; min-width: 0; }
.kn-idle-label {
  font-size: 3vh;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.kn-idle-singer {
  font-size: 11vh;
  font-weight: 900;
  line-height: 1.02;
  margin-top: 1.2vh;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kn-idle-song { font-size: 4.2vh; color: rgba(255, 255, 255, 0.78); margin-top: 2vh; line-height: 1.25; }
.kn-idle-qr-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
.kn-idle-qr {
  background: #fff;
  border-radius: 2.4vh;
  padding: 1.2vh;
  box-shadow: 0 0 0 0.6vh var(--accent), 0 0 6vh color-mix(in srgb, var(--accent) 55%, transparent);
}
.kn-idle-qr canvas { display: block; width: 42vh; height: 42vh; image-rendering: pixelated; }
.kn-idle-qr-caption { margin-top: 2.6vh; font-size: 3.4vh; font-weight: 800; }
.kn-idle-url { margin-top: 0.8vh; font-size: 2.2vh; color: rgba(255, 255, 255, 0.6); }
.kn-idle-brand { display: flex; align-items: center; gap: 1vh; font-size: 2.4vh; font-weight: 800; color: rgba(255, 255, 255, 0.55); }
.kn-idle-brand img { width: 3vh; height: 3vh; object-fit: contain; }
.kn-party-badge {
  position: absolute;
  top: 2.4vh;
  left: 2.4vh;
  z-index: 4;
  padding: 0.8vh 1.8vh;
  border-radius: 999px;
  font-size: 2.2vh;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  background: color-mix(in srgb, var(--accent) 70%, rgba(0, 0, 0, 0.4));
  box-shadow: 0 0 2vh color-mix(in srgb, var(--accent) 50%, transparent);
  pointer-events: none;
}
body.kn-idle-active .kn-party-badge { display: none; }

/* Guest phone: "you're up next" banner (js/app.js onGuestQueueState) */
.guest-up-next-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(var(--safe-top) + 10px);
  z-index: 300;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), #7b2fff);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--accent-glow);
  animation: sheet-up 0.25s ease-out;
  cursor: pointer;
}
.guest-up-next-banner .sub { display: block; font-weight: 600; font-size: 0.82rem; opacity: 0.9; margin-top: 3px; }
.queue-row.queue-row-me { border-color: var(--accent); box-shadow: var(--accent-glow); }

/* ---- host's empty Queue: TV + guest phones lead (js/app.js renderQueueStart) ---- */
.queue-start { padding: 6px 2px 4px; }
.queue-start-title { font-size: 1.15rem; font-weight: 800; text-align: center; margin: 4px 0 14px; }
.queue-start-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.queue-start-card:active { transform: scale(0.985); }
.queue-start-card .qs-icon { flex: 0 0 auto; width: 44px; height: 44px; color: var(--accent); }
#queue-start-tv .qs-icon { color: var(--cyan); }
.queue-start-card.done { border-color: var(--green); }
.queue-start-card.done .qs-icon { color: var(--green); }
.qs-text { display: flex; flex-direction: column; min-width: 0; }
.qs-title { font-weight: 800; font-size: 1.02rem; }
.qs-sub { color: var(--text-dim); font-size: 0.84rem; margin-top: 3px; line-height: 1.35; }
.qs-cta {
  align-self: flex-start;
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 7px 14px;
  box-shadow: var(--accent-glow);
}
.queue-start-card.done .qs-cta { background: transparent; color: var(--green); box-shadow: none; padding-left: 0; }
.queue-start-qr { text-align: center; margin: -2px 0 14px; }
.queue-start-qr .invite-qr-card { margin-bottom: 8px; }
.queue-start-qr-url { color: var(--cyan); font-weight: 800; font-size: 0.95rem; word-break: break-all; }
.queue-start-qr-hint { color: var(--text-dim); font-size: 0.8rem; margin-top: 4px; }
.queue-start-or { color: var(--text-dimmer); font-size: 0.8rem; text-align: center; margin: 6px 0 8px; }
body.kn-guest-connected #queue-start { display: none !important; }

/* ---- first-run intro ---- */
#intro-overlay { z-index: 210; background: radial-gradient(120% 80% at 50% 0%, #2a1030 0%, var(--bg) 60%); align-items: center; justify-content: center; }
.intro-stage { width: 100%; max-width: 420px; padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 24px); text-align: center; }
.intro-brand { font-size: 2.1rem; color: #fff; text-shadow: var(--accent-glow); margin-bottom: 28px; }
.intro-slide { display: none; animation: sheet-up 0.25s ease-out; }
.intro-slide.active { display: block; }
.intro-art { height: 150px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.intro-art img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 0 22px rgba(255, 47, 158, 0.45)); }
.intro-icon { width: 120px; height: 120px; color: var(--accent); filter: drop-shadow(0 0 18px rgba(255, 47, 158, 0.5)); }
.intro-slide[data-slide="1"] .intro-icon { color: var(--cyan); filter: drop-shadow(0 0 18px rgba(51, 230, 255, 0.5)); }
.intro-title { font-size: 1.6rem; font-weight: 900; text-shadow: var(--accent-glow); }
.intro-text { color: var(--text-dim); font-size: 1rem; line-height: 1.45; margin-top: 10px; min-height: 4.4em; }
.intro-dots { display: flex; gap: 8px; justify-content: center; margin: 22px 0; }
.intro-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: all 0.2s; }
.intro-dots span.active { width: 22px; border-radius: 4px; background: var(--accent); }
.intro-actions { display: flex; flex-direction: column; gap: 10px; }

/* ==========================================================================
   Party games (js/fun.js, js/soundboard.js, js/player.js) —
   docs/PARTY-FEATURES-SCOPE.md
   ========================================================================== */

/* ---- Spin ---------------------------------------------------------------- */
.book-toolbar { align-items: center; gap: 8px; }
.spin-btn {
  order: -1;
  margin-right: auto;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), #7b2fff);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--accent-glow);
}
.spin-night { color: var(--accent); font-weight: 700; font-size: 0.85rem; margin: -4px 0 6px; }
.spin-range { margin: 6px 0 4px; }
.spin-hint { color: var(--text-dimmer); font-size: 0.75rem; margin-bottom: 6px; }
.spin-reel {
  margin: 10px 0 4px;
  min-height: 118px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 0%, var(--accent-dim), var(--bg-elev-2) 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  gap: 4px;
  overflow: hidden;
}
.spin-reel-title { font-size: 1.3rem; font-weight: 900; line-height: 1.15; }
.spin-reel-artist { color: var(--text-dim); font-size: 0.88rem; }
.spin-reel.spinning .spin-reel-title,
.spin-reel.spinning .spin-reel-artist { filter: blur(0.6px); opacity: 0.85; }
.spin-reel.landed { border-color: var(--accent); box-shadow: var(--accent-glow); animation: spin-land 0.45s ease-out; }
.spin-reel .as-fit { margin-top: 6px; }
@keyframes spin-land { 0% { transform: scale(0.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ---- "Can I sing this?" -------------------------------------------------- */
.as-fit { margin-top: 6px; font-size: 0.8rem; font-weight: 700; }
.as-fit-fit { color: var(--green); }
.as-fit-higher, .as-fit-lower { color: var(--yellow); }

/* ---- theme nights -------------------------------------------------------- */
.night-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--night-a, var(--accent));
  background: linear-gradient(135deg, color-mix(in srgb, var(--night-a, var(--accent)) 22%, var(--bg-elev)), color-mix(in srgb, var(--night-b, #7b2fff) 18%, var(--bg-elev)));
}
.night-emoji { font-size: 1.6rem; line-height: 1; }
.night-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.92rem; }
.night-sub { color: var(--text-dim); font-size: 0.75rem; }
.party-theme-help { color: var(--text-dimmer); font-size: 0.78rem; margin: -2px 0 2px; }
.party-nights { max-height: 170px; overflow-y: auto; }

/* ---- duets --------------------------------------------------------------- */
.as-duet { margin-top: 12px; }
.as-duet-label { font-size: 0.8rem; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.as-duet-ask { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.85rem; color: var(--text-dim); }
.queue-row-partner { color: var(--accent); }
.duet-chip {
  margin-top: 5px;
  background: var(--bg-elev-2);
  border: 1px dashed var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.duet-chip.open { border-color: var(--accent); color: var(--accent); animation: duet-pulse 1.8s ease-in-out infinite; }
@keyframes duet-pulse { 50% { box-shadow: 0 0 10px var(--accent-dim); } }
.via-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--yellow);
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: 1px;
}

/* ---- dares (host card + guest card share .dare-*) ------------------------ */
.dare-host-card, .live-card {
  margin: 6px 2px 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: radial-gradient(circle at 0% 0%, var(--accent-dim), var(--bg-elev) 70%);
  box-shadow: var(--accent-glow);
}
.dare-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dare-title, .live-card-title { font-weight: 800; font-size: 0.98rem; }
.dare-count { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--accent); font-size: 1.1rem; }
.dare-options { display: flex; flex-direction: column; gap: 8px; }
.dare-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  overflow: hidden;
}
.dare-opt-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent-dim);
  transition: width 0.4s ease;
  pointer-events: none;
}
.dare-opt-text { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dare-opt-votes { position: relative; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.dare-opt.mine { border-color: var(--accent); }
.dare-opt.mine .dare-opt-votes { color: var(--accent); }
.dare-opt.winner { border-color: var(--green); box-shadow: 0 0 12px color-mix(in srgb, var(--green) 45%, transparent); }
.dare-opt.loser { opacity: 0.4; }
.dare-sub { color: var(--text-dim); font-size: 0.78rem; margin-top: 10px; }
.dare-actions, .live-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.dare-actions .btn, .live-card-actions .btn { flex: 1; }

/* ---- guest live cards (dare vote, duet calls) ---------------------------- */
.guest-live-cards { padding: 10px 12px 0; }
.live-card { margin: 0 0 10px; }
.live-card-sub { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }
.duet-card { border-color: var(--cyan); background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--cyan) 18%, transparent), var(--bg-elev) 70%); box-shadow: none; }

/* ---- guest queue extras + wait time -------------------------------------- */
.guest-queue-extras { margin: 0 2px 12px; }
.guest-wait {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.guest-again-title { font-size: 0.78rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.guest-again .chip-row { margin: 6px 0 0; }
.queue-row-wait { flex: 0 0 auto; color: var(--text-dim); font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.queue-row-me .queue-row-wait { color: var(--accent); }

/* ---- reactions ----------------------------------------------------------- */
.react-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  z-index: 29;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 12px 10px;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.97) 60%, rgba(10, 10, 15, 0));
  animation: sheet-up 0.25s ease-out;
}
body.react-bar-on #app-main { padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 96px); }
.react-bar-label { text-align: center; color: var(--text-dim); font-size: 0.75rem; font-weight: 700; margin-bottom: 6px; }
.react-bar-btns { display: flex; justify-content: space-between; gap: 8px; }
.react-btn {
  flex: 1;
  height: 52px;
  font-size: 1.7rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.react-btn:active { background: var(--bg-elev-2); }
.react-btn.pop, .sound-btn.pop { animation: rx-pop 0.25s ease-out; }
@keyframes rx-pop { 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.rx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.rx-layer-fixed { position: fixed; z-index: 250; }
.rx-float {
  position: absolute;
  bottom: -2em;
  font-size: 2.2rem;
  line-height: 1;
  will-change: transform, opacity;
  animation: rx-rise 3s ease-out forwards;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
@keyframes rx-rise {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  12% { opacity: 1; transform: translate(0, -8vh) scale(1.1); }
  100% { transform: translate(var(--rx-drift, 0px), -78vh) scale(1); opacity: 0; }
}
.now-rx { font-size: 0.95rem; font-weight: 800; margin: -8px 0 12px; letter-spacing: 0.02em; }

/* ---- soundboard ---------------------------------------------------------- */
.soundboard-row { margin: 0 2px 14px; }
.soundboard-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dimmer); margin-bottom: 6px; }
.soundboard-btns { display: flex; gap: 6px; }
.sound-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  cursor: pointer;
  touch-action: manipulation;
}
.sound-emoji { font-size: 1.3rem; line-height: 1.1; white-space: nowrap; }
.sound-name { font-size: 0.64rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ---- hype intro (in-app player + TV) -------------------------------------- */
.hype-card {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5%;
  color: #fff;
  background: rgba(7, 7, 12, 0.94);
  background:
    radial-gradient(90% 80% at 50% 45%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%),
    rgba(7, 7, 12, 0.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.hype-card.show { animation: hype-in 3.4s ease forwards; }
@keyframes hype-in {
  0% { opacity: 0; visibility: visible; transform: scale(1.08); }
  10% { opacity: 1; transform: scale(1); }
  82% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}
.hype-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent); }
.hype-name {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.05;
  margin: 8px 0 6px;
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 80%, transparent);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.hype-song { font-size: 0.95rem; color: rgba(255, 255, 255, 0.8); }
.hype-tag { margin-top: 10px; font-size: 0.8rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.kn-hype .hype-label { font-size: 3.4vh; }
.kn-hype .hype-name { font-size: 14vh; margin: 2vh 0 1.6vh; }
.kn-hype .hype-song { font-size: 4.4vh; }
.kn-hype .hype-tag { font-size: 3vh; padding: 0.8vh 2.6vh; margin-top: 3vh; }

/* ---- TV: dare panel + awards show ---------------------------------------- */
.kn-dare {
  position: absolute;
  right: 2.4vh;
  bottom: 2.4vh;
  z-index: 8;
  width: min(62vh, 46vw);
  padding: 2.2vh;
  border-radius: 2.4vh;
  color: #fff;
  background: rgba(10, 10, 16, 0.9);
  border: 0.3vh solid var(--accent);
  box-shadow: 0 0 4vh color-mix(in srgb, var(--accent) 45%, transparent);
}
.kn-dare-title { font-size: 3vh; font-weight: 900; margin-bottom: 1.4vh; }
.kn-dare-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.4vh;
  padding: 1.3vh 1.6vh;
  margin-top: 1vh;
  border-radius: 1.4vh;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  font-size: 2.3vh;
}
.kn-dare-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 45%, transparent); transition: width 0.5s ease; }
.kn-dare-song { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-dare-votes { position: relative; font-weight: 900; font-size: 2.8vh; }
.kn-dare-opt.winner { outline: 0.4vh solid #33d17a; }
.kn-dare-opt.loser { opacity: 0.35; }
.kn-dare.won { animation: spin-land 0.5s ease-out; }
.kn-dare-hint { margin-top: 1.4vh; font-size: 2vh; color: rgba(255, 255, 255, 0.65); }

.kn-awards {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  color: #fff;
  background: #07070c;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 60%),
    radial-gradient(110% 90% at 100% 100%, color-mix(in srgb, var(--party-accent2, #7b2fff) 34%, transparent) 0%, transparent 62%),
    #07070c;
}
.kn-awards-head { font-size: 4vh; font-weight: 900; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 3vh; text-align: center; }
.kn-awards-head span { display: block; font-size: 2.4vh; color: rgba(255, 255, 255, 0.6); letter-spacing: 0; margin-top: 0.6vh; font-weight: 700; }
.kn-award { text-align: center; }
.kn-award.solo { animation: award-in 0.7s cubic-bezier(0.2, 1.4, 0.4, 1); }
.kn-award.solo .kn-award-emoji { font-size: 20vh; line-height: 1; }
.kn-award.solo .kn-award-title { font-size: 5.4vh; font-weight: 900; margin-top: 2vh; color: var(--accent); }
.kn-award.solo .kn-award-singer { font-size: 11vh; font-weight: 900; line-height: 1.05; margin-top: 1vh; }
.kn-award.solo .kn-award-detail { font-size: 3vh; color: rgba(255, 255, 255, 0.7); margin-top: 1.6vh; }
@keyframes award-in { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.kn-awards-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2vh; width: 100%; }
.kn-award.mini { padding: 2vh 1.4vh; border-radius: 2vh; background: rgba(255, 255, 255, 0.07); }
.kn-award.mini .kn-award-emoji { font-size: 6vh; }
.kn-award.mini .kn-award-title { font-size: 2.2vh; font-weight: 800; color: var(--accent); margin-top: 0.6vh; }
.kn-award.mini .kn-award-singer { font-size: 3.4vh; font-weight: 900; margin-top: 0.4vh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-award.mini .kn-award-detail { font-size: 1.8vh; color: rgba(255, 255, 255, 0.6); margin-top: 0.4vh; }

/* ---- awards on phones (Recap + guest modal) ------------------------------ */
.awards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.award-card {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 0%, var(--accent-dim), var(--bg-elev-2) 75%);
  border: 1px solid var(--border);
  text-align: center;
}
.award-emoji { font-size: 1.9rem; line-height: 1.1; }
.award-title { font-size: 0.74rem; font-weight: 800; color: var(--accent); margin-top: 4px; }
.award-singer { font-size: 1rem; font-weight: 900; margin-top: 2px; overflow-wrap: anywhere; color: var(--text); }
.award-detail { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; }
.awards-actions { display: flex; gap: 8px; margin-top: 12px; }
.awards-actions .btn { flex: 1; }
.modal-body .awards-grid { max-height: 52vh; overflow-y: auto; }

/* ==========================================================================
   UI refresh (2026-10): song tiles, legend, queue hero, store cards,
   hover/keyboard affordances, confetti
   ========================================================================== */

/* ---- song row color tile -------------------------------------------------- */
.song-tile {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  background:
    radial-gradient(120% 120% at 0% 0%, hsl(calc(var(--tile-h, 320) + 30) 90% 62% / 0.9), transparent 60%),
    linear-gradient(135deg, hsl(var(--tile-h, 320) 78% 50%), hsl(calc(var(--tile-h, 320) - 35) 70% 28%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.locked-row .song-tile { filter: saturate(0.4) brightness(0.8); }

/* ---- legend ---------------------------------------------------------------- */
.legend-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}
.legend-group { margin-bottom: 14px; }
.legend-head { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dimmer); margin-bottom: 8px; }
.legend-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: var(--bg-elev-2); color: var(--text); font-size: 0.84rem; font-weight: 600; }
.legend-line { display: flex; align-items: center; gap: 12px; padding: 6px 0; color: var(--text); font-size: 0.86rem; }
.legend-icon { flex: 0 0 40px; display: flex; justify-content: center; font-size: 1rem; }

/* ---- keyboard shortcuts --------------------------------------------------- */
.kbd-list { display: grid; gap: 6px; }
.kbd-row { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 0.88rem; }
.kbd-row kbd {
  flex: 0 0 64px;
  text-align: center;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  color: var(--text);
}

/* ---- queue empty hero ------------------------------------------------------ */
.qs-hero {
  position: relative;
  text-align: center;
  padding: 26px 18px 22px;
  margin: 2px 0 14px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(255, 47, 158, 0.35);
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(255, 47, 158, 0.32), transparent 65%),
    radial-gradient(70% 90% at 100% 110%, rgba(51, 230, 255, 0.14), transparent 70%),
    var(--bg-elev);
  overflow: hidden;
}
.qs-hero-mic {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 47, 158, 0.7));
  animation: qs-bob 3.2s ease-in-out infinite;
}
@keyframes qs-bob { 50% { transform: translateY(-5px) rotate(-4deg); } }
.qs-hero .queue-start-title { font-size: 1.45rem; font-weight: 900; margin: 10px 0 6px; text-shadow: var(--accent-glow); }
.qs-hero-sub { color: var(--text-dim); font-size: 0.9rem; line-height: 1.4; max-width: 34em; margin: 0 auto; }
.qs-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin-bottom: 12px; }
.qs-steps .queue-start-card { margin-bottom: 0; height: 100%; align-items: flex-start; }
.qs-recent { margin: 4px 0 12px; }
.qs-recent-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dimmer); margin: 0 2px 8px; }
.qs-recent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qs-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}
.qs-recent-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-elev-2); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; }
#tab-queue.is-empty .add-singer-btn {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: #17010c;
  box-shadow: var(--accent-glow);
  font-size: 1.02rem;
}
.queue-start-qr .invite-qr-card { box-shadow: 0 0 0 3px var(--accent), 0 0 30px rgba(255, 47, 158, 0.45); }

/* Now-singing card: a touch more stage presence */
.now-singing-card {
  background:
    radial-gradient(90% 120% at 50% -20%, rgba(255, 47, 158, 0.38), transparent 65%),
    radial-gradient(60% 80% at 100% 120%, rgba(123, 47, 255, 0.22), transparent 70%),
    var(--bg-elev);
}

/* ---- soundboard: compact pill bar ---------------------------------------- */
.soundboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.soundboard-row .soundboard-label { margin: 0; flex: 0 0 auto; }
.soundboard-row .soundboard-btns { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; gap: 4px; }
.soundboard-row .soundboard-btns::-webkit-scrollbar { display: none; }
.soundboard-row .sound-btn {
  flex: 1 0 auto;
  flex-direction: row;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: var(--bg-elev-2);
}
.soundboard-row .sound-emoji { font-size: 1.05rem; }
@media (max-width: 480px) {
  .soundboard-row .sound-name { display: none; }
  .soundboard-row .soundboard-label { display: none; }
  .soundboard-row { padding-left: 6px; }
}

/* ---- packs store: cover cards --------------------------------------------- */
.pack-card {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
}
.pack-cover {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 92px;
  padding: 12px 14px;
  background:
    radial-gradient(90% 140% at 0% 0%, hsl(calc(var(--pk-h, 320) + 35) 90% 62% / 0.85), transparent 60%),
    radial-gradient(80% 120% at 100% 100%, hsl(calc(var(--pk-h, 320) - 40) 80% 40% / 0.9), transparent 70%),
    linear-gradient(135deg, hsl(var(--pk-h, 320) 75% 42%), hsl(calc(var(--pk-h, 320) - 25) 65% 20%));
}
.pack-cover::after {
  /* faint vinyl grooves */
  content: '';
  position: absolute;
  right: -34px;
  top: -34px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 6px);
  opacity: 0.55;
  pointer-events: none;
}
.pack-card .pack-row-emoji {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}
.pack-cover-count {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.32);
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 4px;
}
.pack-card .pack-row-lock {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  opacity: 1;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
}
.pack-card .pack-row-main { padding: 12px 14px 14px; }
.pack-card .pack-row-name { font-size: 1.02rem; font-weight: 800; }
.pack-card .pack-row-count { display: none; }
.pack-card.pack-row-downloading .pack-row-count,
.pack-card.pack-row-failed .pack-row-count { display: block; }
.pack-samples { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.pack-sample { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pack-sample::before { content: '♪ '; color: var(--accent); }
.pack-sample-t { color: var(--text); font-weight: 700; }
.pack-sample-a { color: var(--text-dimmer); }
.pack-card.pack-row-owned { border-color: color-mix(in srgb, var(--green) 60%, var(--border)); }
.packs-list { gap: 12px; }

/* ---- packs store: offer comparison grid ---------------------------------- */
.offer-grid {
  display: grid;
  /* at most 3 across (Pass / All Access / Pro) — full-width cards span the row */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(230px, calc((100% - 24px) / 3))), 1fr));
  gap: 12px;
  margin: 12px 0;
  align-items: stretch;
}
.offer-grid > .pro-card { margin: 0; display: flex; flex-direction: column; }
.offer-grid > .pro-card .pack-buy-btn,
.offer-grid > .pro-card .pack-owned-badge { margin-top: auto; }
.offer-grid > .access-card-trial,
.offer-grid > .access-card-active,
.offer-grid > .all-songs-card,
.offer-grid > .offer-heading,
.offer-grid > .btn { grid-column: 1 / -1; }
.offer-heading { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: var(--text-dimmer); margin: 6px 2px -2px; }
.offer-card .access-offer { display: flex; flex-direction: column; flex: 1; }
.offer-card .access-offer .pack-buy-btn { margin-top: auto; }
.offer-card .access-offer-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }
.offer-featured {
  position: relative;
  border-color: var(--accent) !important;
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(255, 47, 158, 0.22), transparent 70%),
    linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev)) !important;
  box-shadow: var(--accent-glow);
}
.offer-ribbon {
  align-self: flex-start;
  margin-bottom: 8px;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #17010c;
  background: linear-gradient(135deg, var(--accent), #ff8ac6);
  border-radius: 999px;
  padding: 3px 10px;
}
.offer-grid .pro-card-title { font-size: 1.05rem; }

/* ---- hover (mouse / trackpad) --------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .song-row, .queue-row, .rec-card, .pack-card, .chip, .sort-btn, .nav-btn, .sheet-btn,
  .queue-start-card, .qs-recent-chip, .sound-btn, .btn, .artist-song-row, .legend-btn, .nav-now-card {
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, color 0.15s;
  }
  .song-row:hover { background: var(--bg-elev); }
  #book-list .song-row:hover, #search-results .song-row:hover { background: var(--bg-elev-2); border-color: #3a3a4a; }
  .song-row:hover .song-tile { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 14px hsl(var(--tile-h, 320) 80% 55% / 0.5); }
  .chip:not(.active):hover, .legend-btn:hover { border-color: #4a4a5c; color: var(--text); }
  .sort-btn:not(.active):hover { color: var(--text); background: var(--bg-elev-2); }
  .nav-btn:not(.active):hover { color: var(--text); }
  .nav-btn:not(.active):hover .nav-icon { filter: none; }
  .btn-outline:hover { border-color: #4a4a5c; background: rgba(255, 255, 255, 0.04); }
  .btn-accent:hover { box-shadow: 0 0 20px rgba(255, 47, 158, 0.75), 0 0 2px rgba(255, 47, 158, 0.9); }
  .pack-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px hsl(var(--pk-h, 320) 70% 55% / 0.5); }
  .queue-start-card:hover, .rec-card:hover, .qs-recent-chip:hover { border-color: #4a4a5c; background-color: var(--bg-elev-2); }
  .sheet-btn:hover, .artist-song-row:hover { background: var(--bg-elev-2); }
  .queue-icon-btn:hover { border-color: #4a4a5c; color: var(--text); }
  .nav-now-card:hover { transform: translateY(-1px); }
  .alpha-rail:hover { opacity: 1; }
  .alpha-rail button:hover { color: var(--accent); }
}
@media (min-width: 900px) and (min-height: 541px) and (hover: hover) {
  .nav-btn:not(.active):hover { background: rgba(255, 255, 255, 0.05); }
}

/* Keyboard focus: visible ring for keyboard users only */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.text-input:focus-visible, .search-input:focus-visible, .settings-select:focus-visible { outline: none; }

/* ---- confetti (song finished) --------------------------------------------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 260; overflow: hidden; }
.confetti-layer i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  opacity: 0;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.25, 0.6, 0.4, 1);
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--cf-x, 0px), 105vh) rotate(var(--cf-r, 360deg)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .qs-hero-mic { animation: none; }
  .pack-card:hover { transform: none; }
}
