/* Roast Radio
   Bone hardware on a black viewfinder. One accent, "heat", follows the roast level. */

:root {
  color-scheme: dark;

  --ink: #000;
  --ink-soft: #14130f;
  --char: #181714;
  --bone: #f3efe6;
  --bone-2: rgba(243, 239, 230, 0.66);
  --bone-3: rgba(243, 239, 230, 0.4);
  --hair: rgba(243, 239, 230, 0.13);
  --glass: rgba(24, 23, 20, 0.46);
  --heat: #ff9a2e;
  --rec: #ff3b30;

  --font-display: "Unbounded", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-body: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --gutter: 16px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --on-video: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 0, 0, 0.4);
  --blur: blur(22px) saturate(1.5);
}

:root[data-heat="playful"] { --heat: #ffd84a; }
:root[data-heat="medium"] { --heat: #ff9a2e; }
:root[data-heat="savage"] { --heat: #ff4b33; }

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

[hidden] { display: none !important; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button,
select {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 3px;
}

.sprite { position: absolute; }

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Stage ---------- */
.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--ink);
}

.camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink);
}

.camera.mirrored { transform: scaleX(-1); }

.photo-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink);
  z-index: 1;
}

.scrim {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.scrim-top {
  top: 0;
  height: 22%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent);
}

.scrim-bottom {
  bottom: 0;
  height: 56%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.3) 52%, transparent);
}

/* ---------- Top HUD ---------- */
.hud-top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--sat) + 14px) calc(var(--sar) + var(--gutter)) 0 calc(var(--sal) + var(--gutter));
  pointer-events: none;
}

.hud-top > * { pointer-events: auto; }

.status {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-top: 9px;
  text-shadow: var(--on-video);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 600 13px/1 var(--font-display);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bone-3);
  transition: background 0.2s, box-shadow 0.2s;
}

.dot.live { background: var(--bone); }

.dot.busy {
  background: var(--heat);
  animation: breathe 0.7s ease-in-out infinite alternate;
}

.dot.playing {
  background: var(--heat);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--heat) 30%, transparent);
}

@keyframes breathe {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  padding-left: 17px;
  font: 500 11px/1.35 var(--font-mono);
  color: var(--bone-2);
}

.rail {
  display: grid;
  justify-items: center;
  gap: 16px;
  flex: none;
}

.rec {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  min-width: 68px;
  padding: 0 13px 0 11px;
  border-radius: 17px;
  border: 1px solid var(--hair);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font: 600 12px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}

.rec:active { transform: scale(0.95); }

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--bone);
  transition: background 0.2s, border-color 0.2s;
}

.rec.recording {
  background: rgba(255, 59, 48, 0.24);
  border-color: rgba(255, 59, 48, 0.62);
}

.rec.recording .rec-dot {
  background: var(--rec);
  border-color: var(--rec);
  animation: breathe 0.6s ease-in-out infinite alternate;
}

.rail-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 52px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
  transition: transform 0.12s;
}

.rail-btn .icon { width: 26px; height: 26px; }

.rail-btn span {
  font: 600 10px/1 var(--font-body);
  letter-spacing: 0.01em;
}

.rail-btn:active { transform: scale(0.88); }

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  top: calc(var(--sat) + 64px);
  left: calc(var(--sal) + var(--gutter));
  right: calc(var(--sar) + 84px);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--hair);
  background: rgba(24, 23, 20, 0.82);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font: 500 13.5px/1.35 var(--font-body);
  animation: drop 0.28s var(--ease);
}

.toast::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--rec);
}

.toast.info::before { background: var(--bone); }

@keyframes drop {
  from { opacity: 0; transform: translateY(-8px); }
}

/* ---------- Bottom HUD ---------- */
.hud-bottom {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 0 calc(var(--sar) + var(--gutter)) calc(max(var(--sab), 14px) + 8px) calc(var(--sal) + var(--gutter));
}

.hud-main { min-width: 0; }

/* Lyrics: bare type on the picture. No box. */
.lyrics {
  position: relative;
  height: 128px;
  margin-bottom: 14px;
  overflow: hidden;
  cursor: pointer;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 68%, transparent 97%);
  mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 68%, transparent 97%);
  transition: height 0.4s var(--ease);
}

.lyrics[data-view="full"] { height: min(42dvh, 340px); }
.lyrics.collapsed { display: none; }

.lyrics-inner {
  position: absolute;
  inset: 0 0 auto 0;
  transition: transform 0.5s var(--ease);
  will-change: transform;
}

.ll {
  margin: 0;
  padding: 5px 12% 5px 0;
  font: 700 21px/1.22 var(--font-display);
  letter-spacing: -0.012em;
  text-wrap: balance;
  color: var(--bone);
  opacity: 0.4;
  transform: scale(0.84);
  transform-origin: left center;
  text-shadow: var(--on-video);
  transition: opacity 0.3s, transform 0.4s var(--ease);
}

.ll.is-active {
  opacity: 1;
  transform: none;
}

.ll.is-active .w { color: rgba(243, 239, 230, 0.56); transition: color 0.14s; }
.ll.is-active .w.is-sung { color: var(--bone); }
.ll.is-active .w.is-now { color: var(--heat); }

.ll-tag {
  margin: 0;
  padding: 12px 0 2px;
  font: 500 10.5px/1 var(--font-mono);
  color: var(--bone-3);
  text-shadow: var(--on-video);
}

/* Now playing strip */
.np { text-shadow: var(--on-video); }

.np-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.np-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.np-title {
  font: 600 15px/1.25 var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-scene {
  font: 400 12.5px/1.3 var(--font-body);
  color: var(--bone-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-btns {
  display: flex;
  gap: 8px;
  flex: none;
}

.np-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(243, 239, 230, 0.13);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: transform 0.12s, background 0.2s, color 0.2s;
}

.np-btn .icon { width: 20px; height: 20px; }
.np-btn:active { transform: scale(0.9); }
.np-btn[aria-pressed="false"] { color: var(--bone-3); }
.np-btn-next { background: var(--heat); color: var(--ink-soft); }

.np-progress {
  height: 2px;
  margin-top: 11px;
  border-radius: 2px;
  background: rgba(243, 239, 230, 0.2);
  overflow: hidden;
}

#progressBar,
#stealthProgress {
  width: 100%;
  height: 100%;
  background: var(--bone);
  transform: scaleX(0);
  transform-origin: left center;
}

.np-next {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font: 500 11px/1.2 var(--font-mono);
  color: var(--bone-2);
}

.np-next::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bone-3);
  animation: breathe 0.7s ease-in-out infinite alternate;
}

.np-next.is-ready { color: var(--bone); }

.np-next.is-ready::before {
  background: var(--heat);
  animation: none;
}

/* Control tray */
.tray {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s var(--ease), opacity 0.2s, margin-top 0.3s var(--ease);
}

.tray.open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 14px;
}

.tray-clip {
  min-height: 0;
  overflow: hidden;
  margin: 0 calc(var(--gutter) * -1);
}

.tray-panel {
  display: none;
  gap: 8px;
  padding: 2px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tray-panel::-webkit-scrollbar { display: none; }

.tray[data-panel="genre"] .tray-panel[data-panel="genre"],
.tray[data-panel="heat"] .tray-panel[data-panel="heat"],
.tray[data-panel="lang"] .tray-panel[data-panel="lang"] {
  display: flex;
}

.opt {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 42px;
  padding: 0 17px;
  border-radius: 21px;
  border: 1px solid var(--hair);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font: 600 14px/1 var(--font-body);
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, transform 0.12s;
}

.opt:active { transform: scale(0.95); }

.opt.active {
  background: var(--bone);
  border-color: transparent;
  color: var(--ink-soft);
}

.tray-panel-even .opt { flex: 1; padding: 0 8px; }

.opt[data-roast="playful"] { --heat: #ffd84a; }
.opt[data-roast="medium"] { --heat: #ff9a2e; }
.opt[data-roast="savage"] { --heat: #ff4b33; }

/* Three-step heat meter */
.heat-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.heat-meter i {
  width: 3.5px;
  border-radius: 1.5px;
  background: currentColor;
  opacity: 0.28;
}

.heat-meter i:nth-child(1) { height: 6px; }
.heat-meter i:nth-child(2) { height: 10px; }
.heat-meter i:nth-child(3) { height: 14px; }

.heat-meter[data-level="1"] i:nth-child(-n + 1),
.heat-meter[data-level="2"] i:nth-child(-n + 2),
.heat-meter[data-level="3"] i:nth-child(-n + 3) {
  background: var(--heat);
  opacity: 1;
}

/* On the bone "selected" surface the heat tint needs ink behind it to read */
.opt.active .heat-meter i,
.pill[aria-expanded="true"] .heat-meter i {
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35);
}

/* Summary pills */
.pills {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  max-width: 46%;
  padding: 0 14px 0 11px;
  border-radius: 18px;
  border: 1px solid var(--hair);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font: 600 13px/1 var(--font-body);
  transition: background 0.18s, color 0.18s, transform 0.12s;
}

.pill .icon { width: 17px; height: 17px; }

.pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill:active { transform: scale(0.95); }

.pill[aria-expanded="true"] {
  background: var(--bone);
  border-color: transparent;
  color: var(--ink-soft);
}

/* ---------- Action bar ---------- */
.actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px 0 16px;
}

.side {
  position: relative;
  justify-self: center;
  display: grid;
  justify-items: center;
}

.side-face {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: var(--glass) center / cover no-repeat;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: background-color 0.2s, color 0.2s, transform 0.14s var(--ease), border-color 0.2s;
}

.side:active .side-face { transform: scale(0.9); }

.side-label {
  position: absolute;
  top: calc(100% + 7px);
  font: 500 10.5px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--bone-2);
  white-space: nowrap;
  text-shadow: var(--on-video);
}

#autoDjBtn[aria-pressed="true"] .side-face {
  background-color: var(--bone);
  border-color: transparent;
  color: var(--ink-soft);
}

#autoDjBtn[aria-pressed="true"] .side-label { color: var(--bone); }

/* Last clip: a camera-roll style thumbnail */
.side-clip .side-face {
  border-radius: 15px;
  width: 46px;
  height: 58px;
  border-style: dashed;
  border-color: var(--bone-3);
  color: var(--bone-3);
}

.side-clip.has-clip .side-face {
  border: 2px solid var(--bone);
  color: var(--bone);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.side-clip.has-clip .icon { display: none; }
.side-clip.has-clip .side-label { color: var(--bone); }
.side-clip.is-new .side-face { animation: land 0.5s var(--ease); }

@keyframes land {
  from { transform: scale(1.5) translateY(-22px); opacity: 0; }
}

/* The trigger: a bone key cap inside a ring that turns into a live spectrum */
.shutter-wrap {
  position: relative;
  width: 84px;
  height: 84px;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 156px;
  height: 156px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.shutter {
  position: relative;
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 50%;
}

.shutter-cap {
  position: absolute;
  inset: 7px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 32% 20%, #fffdf8 0%, #f3efe6 44%, #d6cfbf 100%);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.95),
    inset 0 -4px 7px rgba(60, 50, 30, 0.22),
    0 6px 18px rgba(0, 0, 0, 0.5);
  color: var(--ink-soft);
  font: 800 12px/1 var(--font-display);
  letter-spacing: 0.01em;
  transition: transform 0.14s var(--ease), box-shadow 0.14s;
}

.shutter-cap::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.5px solid var(--heat);
  opacity: 0.9;
  transition: border-color 0.3s;
}

.shutter:active .shutter-cap,
.shutter.is-busy .shutter-cap {
  transform: scale(0.92);
  box-shadow:
    inset 0 3px 9px rgba(60, 50, 30, 0.42),
    inset 0 -1px 1px rgba(255, 255, 255, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.45);
}

.shutter:disabled { cursor: progress; }

/* ---------- Dial (brand motif: gate + stealth) ---------- */
.dial {
  --pos: 0.5;
  position: relative;
  height: 58px;
  padding: 0 4px;
}

.dial-ticks {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 26px;
}

.dial-ticks i {
  width: 1px;
  height: 9px;
  background: var(--bone-3);
}

.dial-ticks i.major {
  height: 20px;
  width: 1.5px;
  background: var(--bone-2);
}

.dial-labels {
  position: relative;
  height: 16px;
  margin-top: 8px;
  font: 500 10.5px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--bone-3);
}

.dial-labels span {
  position: absolute;
  transform: translateX(-50%);
}

.dial-needle {
  position: absolute;
  top: -8px;
  left: 4px;
  right: 4px;
  height: 40px;
  pointer-events: none;
}

.dial-needle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--pos) * 100%);
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--heat);
  box-shadow: 0 0 14px color-mix(in srgb, var(--heat) 70%, transparent);
  transition: left 1.3s cubic-bezier(0.3, 1.25, 0.4, 1);
}

.dial-lg { height: 96px; }
.dial-lg .dial-ticks { height: 52px; }
.dial-lg .dial-ticks i { height: 18px; }
.dial-lg .dial-ticks i.major { height: 44px; }
.dial-lg .dial-needle { height: 74px; top: -12px; }
.dial-lg .dial-labels { font-size: 11.5px; margin-top: 12px; }

/* ---------- Gate ---------- */
.gate {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: calc(var(--sat) + 28px) calc(var(--sar) + 24px) calc(max(var(--sab), 16px) + 20px) calc(var(--sal) + 24px);
  background: var(--ink);
}

.gate-tuner {
  align-self: center;
  width: 100%;
}

.gate-readout {
  display: flex;
  justify-content: space-between;
  margin-bottom: 26px;
  font: 500 12px/1 var(--font-mono);
  color: var(--bone-2);
}

.gate-mark {
  margin: 0 0 20px -3px;
  font: 800 clamp(52px, 19.5vw, 92px) / 0.9 var(--font-display);
  letter-spacing: -0.035em;
}

.gate-lede {
  max-width: 34ch;
  margin: 0 0 24px;
  font: 400 17px/1.45 var(--font-body);
  color: var(--bone-2);
}

.gate-actions {
  display: grid;
  gap: 10px;
}

.gate-signin {
  margin-top: 4px;
  padding: 8px 4px;
  background: none;
  border: 0;
  font: 500 13px/1.2 var(--font-body);
  color: var(--bone-3);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Teaser cliffhanger sheet ---------- */
.teaser-card {
  margin: 2px 0 16px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(243, 239, 230, 0.14);
  background: rgba(243, 239, 230, 0.06);
}

.teaser-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--heat) 18%, transparent);
  color: var(--heat);
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.teaser-title {
  margin: 12px 0 6px;
  font: 800 22px/1.15 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--bone);
}

.teaser-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font: 500 11.5px/1.3 var(--font-mono);
  color: var(--bone-2);
}

.teaser-lyrics {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  display: grid;
  gap: 6px;
  font: 600 14px/1.35 var(--font-body);
  color: var(--bone);
}

.teaser-lyrics .locked-line {
  color: var(--bone-2);
  filter: blur(5px);
  user-select: none;
}

.unlock-form {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.unlock-form input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(243, 239, 230, 0.18);
  background: rgba(243, 239, 230, 0.08);
  color: var(--bone);
  font: 500 16px/1 var(--font-mono);
  letter-spacing: 0.04em;
  outline: none;
}

.unlock-form input:focus {
  border-color: var(--heat);
}

.unlock-error {
  margin: 0;
  font: 600 12.5px/1.3 var(--font-body);
  color: #ff624c;
}

.credits-pill {
  margin-left: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(243, 239, 230, 0.22);
  background: rgba(20, 19, 15, 0.56);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--bone);
  white-space: nowrap;
}

.credits-pill.is-low {
  border-color: var(--heat);
  color: var(--heat);
}

.btn-google {
  margin-bottom: 8px;
}

.google-g {
  width: 18px;
  height: 18px;
  flex: none;
}

.billing-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(243, 239, 230, 0.06);
  margin-bottom: 16px;
}

.billing-balance {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.billing-balance strong {
  font: 800 18px/1.15 var(--font-display);
  color: var(--bone);
}

.billing-balance span {
  font: 500 11.5px/1.2 var(--font-mono);
  color: var(--bone-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-mini {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(243, 239, 230, 0.1);
  font: 600 12px/1 var(--font-body);
  color: var(--bone-2);
}

.pack-grid {
  display: grid;
  gap: 10px;
}

.pack-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1.5px solid rgba(243, 239, 230, 0.12);
  background: rgba(243, 239, 230, 0.055);
  text-align: left;
  transition: transform 0.12s, border-color 0.18s;
}

.pack-card:active { transform: scale(0.98); }

.pack-card.is-popular {
  border-color: var(--heat);
  background: color-mix(in srgb, var(--heat) 11%, rgba(243, 239, 230, 0.05));
}

.pack-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pack-info strong {
  font: 700 15.5px/1.2 var(--font-display);
  color: var(--bone);
}

.pack-info small {
  font: 500 11.5px/1.2 var(--font-mono);
  color: var(--bone-2);
}

.pack-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--heat);
  color: var(--ink);
  font: 700 9.5px/1.2 var(--font-mono);
  text-transform: uppercase;
  vertical-align: middle;
}

.pack-price {
  flex: none;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bone);
  color: var(--ink);
  font: 800 14px/1 var(--font-display);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  border-radius: 29px;
  font: 700 15px/1 var(--font-display);
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: transform 0.14s var(--ease), background 0.2s;
}

.btn .icon { width: 21px; height: 21px; }
.btn:active { transform: scale(0.975); }

.btn-primary {
  background: var(--bone);
  color: var(--ink-soft);
}

.btn-ghost {
  background: rgba(243, 239, 230, 0.09);
  color: var(--bone);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(243, 239, 230, 0.1);
  transition: transform 0.12s;
}

.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(0.9); }

/* ---------- Sheets ---------- */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.56);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade 0.2s ease-out;
  transition: opacity 0.2s;
}

.backdrop.closing { opacity: 0; }

@keyframes fade {
  from { opacity: 0; }
}

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px calc(max(var(--sab), 14px) + 16px);
  border-radius: 28px 28px 0 0;
  background: var(--char);
  animation: rise 0.36s var(--ease);
}

@keyframes rise {
  from { transform: translateY(100%); }
}

.sheet-handle {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 8px;
  background: var(--char);
  touch-action: none;
}

.sheet-grab {
  width: 36px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: rgba(243, 239, 230, 0.24);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 12px;
}

.sheet-head h2 {
  margin: 0;
  min-width: 0;
  font: 700 19px/1.2 var(--font-display);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group { margin-top: 22px; }
.sheet-handle + .group { margin-top: 4px; }

.group-title {
  margin: 0 0 10px;
  font: 600 13px/1 var(--font-body);
  color: var(--bone-2);
}

.field + .field { margin-top: 12px; }

.field label {
  display: block;
  margin: 0 0 7px 2px;
  font: 500 13.5px/1.2 var(--font-body);
}

.field-note {
  display: block;
  margin: 8px 2px 0;
  font: 500 11px/1.4 var(--font-mono);
  color: var(--bone-3);
}

.select { position: relative; }

.select select {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 16px;
  border: 0;
  border-radius: 16px;
  background: rgba(243, 239, 230, 0.07);
  font: 500 15px/1 var(--font-body);
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
}

.select .icon {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  color: var(--bone-2);
  pointer-events: none;
}

.rows {
  border-radius: 18px;
  background: rgba(243, 239, 230, 0.055);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
}

.row + .row { border-top: 1px solid var(--hair); }
.row-text { min-width: 0; }

.row-text label {
  display: block;
  font: 500 15px/1.25 var(--font-body);
}

.row-text small {
  display: block;
  margin-top: 4px;
  font: 400 12.5px/1.4 var(--font-body);
  color: var(--bone-2);
}

.switch {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  background: rgba(243, 239, 230, 0.17);
  pointer-events: none;
  transition: background 0.2s;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bone);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.24s var(--ease), background 0.2s;
}

.switch input:checked + i { background: var(--bone); }

.switch input:checked + i::after {
  transform: translateX(20px);
  background: var(--ink-soft);
}

.switch input:focus-visible + i {
  outline: 2px solid var(--heat);
  outline-offset: 3px;
}

.history { display: grid; gap: 2px; }

.empty {
  margin: 0;
  padding: 2px;
  font: 400 13.5px/1.4 var(--font-body);
  color: var(--bone-3);
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
}

.history-item + .history-item { border-top: 1px solid var(--hair); }

.history-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.history-info strong {
  font: 600 14px/1.2 var(--font-display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-info span {
  font: 500 11px/1.2 var(--font-mono);
  color: var(--bone-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Share sheet */
.share-preview {
  display: block;
  height: min(44dvh, 390px);
  aspect-ratio: 9 / 16;
  max-width: 100%;
  margin: 2px auto 0;
  border-radius: 20px;
  background: var(--ink);
  object-fit: cover;
}

.share-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 0 14px;
  font: 500 11px/1.3 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--bone-2);
}

.share-reel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin: 0 -20px 14px;
  padding: 2px 20px;
}

.share-reel::-webkit-scrollbar { display: none; }

.reel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  max-width: 210px;
  padding: 6px 12px 6px 6px;
  border-radius: 16px;
  border: 1.5px solid rgba(243, 239, 230, 0.1);
  background: rgba(243, 239, 230, 0.055);
  text-align: left;
  transition: border-color 0.16s, background 0.16s, transform 0.12s;
}

.reel-item:active { transform: scale(0.97); }

.reel-item.active {
  border-color: var(--heat);
  background: rgba(243, 239, 230, 0.12);
}

.reel-thumb {
  position: relative;
  flex: none;
  width: 34px;
  height: 54px;
  border-radius: 10px;
  background: var(--ink) center / cover no-repeat;
  overflow: hidden;
}

.reel-dur {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  padding: 2px 3px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  font: 600 9px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--bone);
}

.reel-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.reel-meta strong {
  font: 600 12.5px/1.2 var(--font-body);
  color: var(--bone);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-meta small {
  font: 500 10.5px/1.2 var(--font-mono);
  color: var(--bone-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-actions {
  display: grid;
  gap: 10px;
}

.btn-subtle {
  height: 46px;
  font: 600 13px/1 var(--font-body);
  color: var(--bone-2);
}

/* ---------- Stealth: car FM radio ---------- */
.stealth {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto auto auto;
  gap: 0;
  padding: calc(var(--sat) + 12px) calc(var(--sar) + 22px) calc(max(var(--sab), 12px) + 6px) calc(var(--sal) + 22px);
  background: linear-gradient(to bottom, #0c0d0f, #000 46%);
  color: #ededeb;
  font-family: var(--font-body);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.st-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 15px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
}

.st-indicators {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 11px/1 var(--font-mono);
  color: rgba(237, 237, 235, 0.6);
}

.st-indicators .icon { width: 18px; height: 18px; }

/* While a clip records, the stereo indicator lights up. Nothing on this screen says "recording". */
.st-indicators .st-stereo { transition: color 0.3s; }
.st-indicators .st-stereo.lit { color: var(--heat); }

.st-tabs {
  display: flex;
  gap: 24px;
  margin-top: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(237, 237, 235, 0.1);
  font: 600 14px/1 var(--font-body);
  color: rgba(237, 237, 235, 0.42);
}

.st-tabs .on {
  position: relative;
  color: #ededeb;
}

.st-tabs .on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 2px;
  background: var(--heat);
}

.st-tuner {
  align-self: center;
  padding: 12px 0;
}

.st-freq {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font: 400 clamp(64px, 23vw, 104px) / 1 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.st-freq small {
  font: 500 15px/1 var(--font-mono);
  letter-spacing: 0;
  color: rgba(237, 237, 235, 0.5);
}

.st-station {
  margin: 10px 0 26px;
  font: 500 15px/1.2 var(--font-body);
  color: rgba(237, 237, 235, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-now { padding-bottom: 18px; }

.st-eq {
  display: block;
  width: 100%;
  height: 44px;
}

.st-title {
  margin-top: 14px;
  font: 600 19px/1.25 var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-progress {
  height: 2px;
  margin-top: 14px;
  border-radius: 2px;
  background: rgba(237, 237, 235, 0.14);
  overflow: hidden;
}

#stealthProgress { background: #ededeb; }

.st-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.st-preset {
  height: 48px;
  border-radius: 14px;
  background: #141517;
  border: 1px solid transparent;
  font: 600 15px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  color: rgba(237, 237, 235, 0.72);
  transition: border-color 0.2s, color 0.2s, transform 0.12s;
}

.st-preset:active { transform: scale(0.96); }

.st-preset.on {
  border-color: var(--heat);
  color: var(--heat);
}

.st-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding: 20px 0 6px;
}

.st-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #ededeb;
  transition: transform 0.12s, background 0.2s;
}

.st-btn .icon { width: 28px; height: 28px; }
.st-btn:active { transform: scale(0.9); }

.st-btn-main {
  width: 68px;
  height: 68px;
  background: #1a1b1e;
}

.st-btn-main .icon { width: 30px; height: 30px; }

.st-hint {
  height: 16px;
  text-align: center;
  font: 500 11px/16px var(--font-mono);
  color: rgba(237, 237, 235, 0.5);
  opacity: 0;
  transition: opacity 0.5s;
}

.stealth.show-hint .st-hint,
.stealth.holding .st-hint { opacity: 1; }

.st-hold {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #ededeb;
  transform: scaleX(0);
  transform-origin: left center;
}

.stealth.holding .st-hold {
  transform: scaleX(1);
  transition: transform 0.7s linear;
}

/* ---------- Layout variants ---------- */

/* Short phones */
@media (max-height: 700px) {
  .lyrics { height: 96px; }
  .ll { font-size: 18px; }
  .actions { padding-top: 22px; }
  .st-station { margin-bottom: 16px; }
  .st-preset { height: 42px; }
  .st-transport { padding-top: 12px; }
  .gate-lede { font-size: 16px; margin-bottom: 22px; }
}

/* Phone on a landscape car mount */
@media (orientation: landscape) and (max-height: 520px) {
  .hud-bottom {
    flex-direction: row;
    align-items: flex-end;
    gap: 28px;
  }

  .hud-main { flex: 1; }
  .lyrics { height: 84px; margin-bottom: 8px; }
  .lyrics[data-view="full"] { height: 46dvh; }
  .ll { font-size: 18px; }
  .actions { flex: none; width: 280px; padding: 0 0 18px; }
  .rail { grid-auto-flow: column; align-items: start; }
  .scrim-bottom { height: 70%; }

  .stealth {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto 1fr auto auto;
    column-gap: 36px;
  }

  .st-bar,
  .st-tabs { grid-column: 1 / -1; }
  .st-tabs { margin-top: 12px; }
  .st-tuner { grid-column: 1; grid-row: 3 / span 2; }
  .st-freq { font-size: clamp(56px, 11vw, 96px); }
  .st-now { grid-column: 2; grid-row: 3; align-self: end; padding-bottom: 12px; }
  .st-presets { grid-column: 2; grid-row: 4; }
  .st-preset { height: 38px; }
  .st-transport { grid-column: 1; grid-row: 5; padding: 6px 0 0; justify-content: flex-start; }
  .st-hint { grid-column: 2; grid-row: 5; align-self: center; text-align: right; }

  .gate {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    column-gap: 40px;
    align-items: center;
  }

  .gate-mark { font-size: clamp(40px, 9vw, 72px); }
}

/* Desktop: keep the phone frame instead of stretching the viewfinder */
@media (min-width: 900px) and (min-height: 600px) {
  body { display: grid; place-items: center; background: #0a0a09; }

  .app {
    width: min(460px, calc(100dvh * 9 / 16));
    height: min(100dvh, 940px);
    border-radius: 34px;
  }
}

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