/* Boombox — monochrome, one job per screen. Color only carries meaning (sync status). */
:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --surface-2: #e8e8ea;
  --line: rgba(0, 0, 0, 0.08);
  --text: #0a0a0a;
  --muted: #71717a;
  --primary: #0a0a0a;
  --on-primary: #ffffff;
  --scrim: rgba(0, 0, 0, 0.35);
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #121214;
    --surface-2: #1d1d20;
    --line: rgba(255, 255, 255, 0.08);
    --text: #fafafa;
    --muted: #8b8b93;
    --primary: #fafafa;
    --on-primary: #000000;
    --scrim: rgba(0, 0, 0, 0.6);
    --good: #22c55e;
    --warn: #f59e0b;
    --bad: #f43f5e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: 0.35; cursor: default; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

h1, h2, h3, p { margin: 0; }

.icon { width: 22px; height: 22px; flex: none; }
.icon.lg { width: 32px; height: 32px; }

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

.view {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 8px;
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { color: var(--muted); font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; }

/* ---- Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.1s, opacity 0.15s;
}
.btn.primary { background: var(--primary); color: var(--on-primary); }
a.btn { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn .icon { width: 20px; height: 20px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
}
.icon-btn:active:not(:disabled) { background: var(--surface); }
.icon-btn.lg .icon { width: 30px; height: 30px; }

.chip {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}

.stack { display: grid; gap: 10px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }

/* ---- Home ---------------------------------------------------------------------- */

.wordmark { font-weight: 700; letter-spacing: -0.02em; font-size: 17px; padding: 12px 0; }
.home { min-height: auto; }
.home-top { display: flex; align-items: center; justify-content: space-between; }
.home-link { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 12px 0; }

.hero { display: grid; gap: 40px; padding: 8vh 0 48px; }
.hero-copy { display: flex; flex-direction: column; gap: 14px; }
.home h1 { font-size: 44px; line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.home .lede { max-width: 520px; }

/* The two ways in: start (primary) and join with a code (right beside it). */
.cta { display: grid; gap: 10px; margin-top: 14px; }
.join-inline { display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: var(--surface); }
.join-inline input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 0 14px;
  font: 600 17px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  outline: none;
}
.join-inline input::placeholder { font-family: var(--font); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.join-inline:focus-within { outline: 2px solid var(--text); outline-offset: 1px; }
.join-inline .btn { width: auto; min-height: 44px; padding: 0 22px; background: var(--primary); color: var(--on-primary); }
.text-link { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 0; }
.text-link .icon { width: 18px; height: 18px; }
.devices-note { color: var(--muted); font-size: 13px; }

/* Hero picture: a laptop, a tablet and a phone showing the same beat, in step. */
.hero-visual { position: relative; height: 200px; display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.device { position: relative; border: 2px solid color-mix(in srgb, var(--text) 22%, transparent); background: var(--surface); }
.device .screen { position: absolute; inset: 8px; border-radius: 6px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.laptop { width: 170px; height: 110px; border-radius: 12px 12px 4px 4px; margin-bottom: 10px; }
.laptop .base { position: absolute; left: -14px; right: -14px; bottom: -12px; height: 10px; border-radius: 0 0 10px 10px; background: color-mix(in srgb, var(--text) 22%, transparent); }
.tablet { width: 80px; height: 104px; border-radius: 14px; }
.phone { width: 46px; height: 90px; border-radius: 12px; }
.phone .screen, .tablet .screen { inset: 6px; border-radius: 9px; }
.eq { display: flex; align-items: center; gap: 4px; height: 56%; }
.eq i { display: block; width: 5px; height: 100%; border-radius: 3px; background: var(--text); transform-origin: center; animation: eq 1.1s ease-in-out infinite; }
.phone .eq, .tablet .eq { gap: 3px; }
.phone .eq i { width: 3px; }
.tablet .eq i { width: 4px; }
/* Same delays on every device, so the bars move together: that's the point. */
.eq i:nth-child(1) { animation-delay: -0.1s; }
.eq i:nth-child(2) { animation-delay: -0.5s; }
.eq i:nth-child(3) { animation-delay: -0.3s; }
.eq i:nth-child(4) { animation-delay: -0.8s; }
.eq i:nth-child(5) { animation-delay: -0.2s; }
.eq i:nth-child(6) { animation-delay: -0.6s; }
.eq i:nth-child(7) { animation-delay: -0.4s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; transform: scaleY(0.6); } }
.visual-pill { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: max-content; height: auto; margin: 0; white-space: nowrap; cursor: default; }

/* How it works + good to know */
.how, .know { padding: 40px 0; border-top: 1px solid var(--line); }
.how h2 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 10px 0 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.step-n { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 700; }
.steps h3, .facts h3 { font-size: 17px; margin: 6px 0 4px; }
.steps p, .facts p { color: var(--muted); }
.facts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 22px; }
.facts h3 { margin-top: 0; }
.cta-again { margin-top: 32px; }
.home-foot { color: var(--muted); font-size: 13px; padding: 24px 0 8px; border-top: 1px solid var(--line); }

/* ---- Join ------------------------------------------------------------------------ */

.viewfinder {
  position: relative;
  flex: 1;
  min-height: 300px;
  margin: 8px 0 24px;
  border-radius: 24px;
  background: var(--surface);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder .frame {
  position: relative;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 28px;
  border: 2px dashed color-mix(in srgb, var(--text) 40%, transparent);
}
.viewfinder.live .frame { border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.viewfinder-note {
  position: absolute;
  bottom: 18px;
  left: 20px;
  right: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.viewfinder.live .viewfinder-note { color: #fff; }
.scan-tap {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  z-index: 1;
}
.scan-tap .icon.lg { width: 40px; height: 40px; }
.viewfinder.live .scan-tap { display: none; }
.viewfinder.busy .scan-tap { opacity: 0.4; pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

.join-form { display: grid; gap: 12px; }
.code-input {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  font: 600 28px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding-left: 0.35em;
}
.code-input::placeholder { color: color-mix(in srgb, var(--muted) 45%, transparent); }

/* ---- Gate ---------------------------------------------------------------------- */

.gate-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding-bottom: 8vh; }
.gate-code { font: 700 56px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.12em; margin: 4px 0 2px; }
.gate-body .lede { margin-bottom: 20px; white-space: pre-line; }

.field {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
}

/* ---- Room ------------------------------------------------------------------------ */

.room { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.code-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  font: 600 14px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.12em;
}

.people-btn { display: flex; align-items: center; min-height: 44px; padding: 0 4px; }
.avatars { display: flex; }
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 2px solid var(--bg);
  font-size: 12px;
  font-weight: 700;
  margin-left: -8px;
  text-transform: uppercase;
}
.avatars .avatar:first-child { margin-left: 0; }
.avatar.count { background: var(--surface); color: var(--muted); }
.avatar.host { background: var(--primary); color: var(--on-primary); }

.now { display: flex; flex-direction: column; padding-top: 12px; }

.art {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.art iframe, #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.art-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
}
.art.audio iframe, .art.audio #player { visibility: hidden; }
.art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }

/* Shown while the room (or this device) is getting in step. Nothing plays underneath. */
.sync-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 14px;
  color: var(--muted);
}
.sync-overlay strong { color: var(--text); font-size: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--surface-2); border-top-color: var(--text); animation: spin 0.8s linear infinite; margin-bottom: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* iPhone + YouTube: the tap has to land on YouTube's own play button, so the hint sits below the video. */
.tap-hint {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 16%, var(--surface));
  font-size: 14px;
  color: var(--text);
}
.art:has(+ .tap-hint:not([hidden])) { outline: 2px solid var(--warn); outline-offset: 2px; }
.tap-button {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.meta { margin-top: 20px; min-width: 0; }
.meta .title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .sub { color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress { margin-top: 16px; }
.thin-range {
  --p: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.thin-range:disabled { cursor: default; opacity: 1; }
.thin-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--text) var(--p), var(--surface-2) var(--p));
}
.thin-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--text) var(--p), var(--surface-2) var(--p));
}
.thin-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 999px;
  background: var(--text);
  border: 0;
}
.thin-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 999px; background: var(--text); border: 0; }
.thin-range:disabled::-webkit-slider-thumb { opacity: 0; }
.thin-range:disabled::-moz-range-thumb { opacity: 0; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 36px; margin-top: 12px; }
.play {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  transition: transform 0.1s;
}
.play:active:not(:disabled) { transform: scale(0.95); }
.play .icon { width: 30px; height: 30px; }

.sync-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); flex: none; }
.syncing .dot { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .syncing .dot, .spinner { animation: none; } }
.good .dot, .dot.good { background: var(--good); }
.warn .dot, .dot.warn { background: var(--warn); }
.bad .dot, .dot.bad { background: var(--bad); }

.upnext { margin-top: 36px; }
.upnext .eyebrow { margin-bottom: 8px; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0; }

.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; }
.track img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface); flex: none; }
.track .text { flex: 1; min-width: 0; }
.track .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .icon-btn { margin-right: -10px; color: var(--muted); }
.track .add-btn { width: 36px; height: 36px; border-radius: 999px; background: var(--surface); display: grid; place-items: center; flex: none; }
.tags { display: flex; gap: 6px; margin-top: 4px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.best { background: var(--primary); color: var(--on-primary); }
.source-filter { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.source-filter .chip { background: var(--surface-2); color: var(--muted); }
.source-filter .chip.active { background: var(--primary); color: var(--on-primary); }
.invite-desk { display: none; }
.track .add-btn.done { background: var(--primary); color: var(--on-primary); }
.track .add-btn .icon { width: 18px; height: 18px; }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  display: flex;
  justify-content: center;
}
.dock .btn { max-width: 440px; }

/* ---- Sheets ---------------------------------------------------------------------- */

.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 8px 20px max(24px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
}
@media (prefers-color-scheme: dark) { .sheet { background: var(--surface); } .sheet .search, .sheet .field, .sheet .btn:not(.primary), .sheet .chip { background: var(--surface-2); } }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }

.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; margin-bottom: 8px; }
.sheet-head h3 { font-size: 18px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .icon-btn { margin-right: -10px; }
.sheet > .btn { margin-top: 16px; }

.search { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 8px 0 16px; border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font-size: 16px; outline: none; height: 50px; -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search:focus-within { outline: 2px solid var(--text); outline-offset: -2px; }
#sheet-add { min-height: 70dvh; }
#sheet-add .hint:empty { display: none; }
.sheet .hint { margin: 10px 2px 8px; }

.menu { display: grid; }
.menu button { text-align: left; min-height: 52px; font-size: 16px; font-weight: 500; border-top: 1px solid var(--line); }
.menu button:first-child { border-top: 0; }
.menu .danger { color: var(--bad); }

.people { list-style: none; margin: 0 0 8px; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.person .avatar { margin: 0; width: 36px; height: 36px; font-size: 14px; border: 0; }
.person .text { flex: 1; min-width: 0; }
.person .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .t2 { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.person .chip { background: var(--surface); }
@media (prefers-color-scheme: dark) { .person .chip { background: var(--surface-2); } }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; border-top: 1px solid var(--line); font-weight: 500; }
.toggle small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.toggle input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 48px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-2);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { transform: translateX(20px); background: var(--on-primary); }

.invite { display: grid; justify-items: center; gap: 10px; text-align: center; }
.qr { width: 220px; height: 220px; padding: 14px; border-radius: 20px; background: #fff; }
.qr svg { display: block; width: 100%; height: 100%; }
.invite-code { font: 700 36px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.14em; margin-top: 10px; }
.invite .row { width: 100%; margin-top: 12px; }

.sync-big { display: flex; align-items: baseline; gap: 10px; }
#sync-ms { font-size: 48px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sync-big small { color: var(--muted); }
#sync-ms.good { color: var(--good); }
#sync-ms.warn { color: var(--warn); }
#sync-ms.bad { color: var(--bad); }
#sync-explain { margin: 4px 0 20px; }

.slider { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); font-weight: 500; }
.slider span { display: flex; justify-content: space-between; }
.slider output { color: var(--muted); font-variant-numeric: tabular-nums; }
.slider small { color: var(--muted); font-size: 13px; font-weight: 400; }
.slider input { width: 100%; accent-color: var(--text); }

.details { margin-top: 16px; font-size: 13px; color: var(--muted); }
.details summary { cursor: pointer; padding: 8px 0; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 8px 0; }
.stats dd { margin: 0; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.log { list-style: none; padding: 0; margin: 8px 0 0; font: 12px/1.7 ui-monospace, "SF Mono", Menlo, monospace; }

/* ---- Toast ---------------------------------------------------------------------- */

.toast {
  position: fixed;
  inset: auto 0 calc(96px + env(safe-area-inset-bottom)) 0;
  margin: 0 auto;
  border: 0;
  overflow: visible;
  width: fit-content;
  max-width: calc(100% - 40px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 600;
  z-index: 10;
  text-align: center;
}

/* ---- Volume ---------------------------------------------------------------------- */

.volume { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--muted); }
.volume .thin-range { flex: 1; }
.volume .icon-btn { margin-left: -10px; color: var(--muted); }
.volume .vol-max { width: 20px; height: 20px; }
.vol-note { display: none; font-size: 13px; }
/* iPhone/iPad: pages can only mute, so show a mute button and a hint instead of a slider. */
.volume.mute-only .thin-range, .volume.mute-only .vol-max { display: none; }
.volume.mute-only .vol-note { display: inline; }

.person .thin-range { margin-top: 6px; height: 16px; }
.person .vol-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.person .vol-row .thin-range { flex: 1; margin: 0; }
.person .vol-val { font-size: 12px; color: var(--muted); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ==== Desktop (≥ 1024px) ==========================================================
   Everything above is the phone design and stays as is. On a big screen the same pieces are
   laid out side by side: now playing on the left, the queue on the right, sheets as dialogs. */

@media (min-width: 1024px) {
  .view { max-width: 1120px; padding: 24px 48px 48px; }

  /* Home: copy and actions on the left, the picture on the right; sections in columns. */
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 48px; min-height: min(calc(100dvh - 120px), 760px); padding: 24px 0 56px; }
  .home h1 { font-size: 76px; }
  .home .lede { font-size: 19px; }
  .cta { grid-template-columns: auto minmax(0, 300px); justify-content: start; align-items: center; gap: 12px; }
  .cta .btn.primary { width: auto; padding: 0 28px; min-height: 56px; font-size: 17px; }
  .join-inline { min-height: 56px; }
  .hero-visual { height: 340px; }
  .laptop { width: 330px; height: 210px; }
  .laptop .base { left: -22px; right: -22px; }
  .tablet { width: 140px; height: 184px; }
  .phone { width: 78px; height: 152px; }
  .how, .know { padding: 72px 0; }
  .how h2 { font-size: 40px; margin-bottom: 40px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .steps li { flex-direction: column; gap: 14px; }
  .facts { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .cta-again .btn { width: auto; padding: 0 28px; }

  /* Join & gate: a single centered column. */
  .join, .gate { max-width: 480px; }
  .viewfinder { flex: none; height: 360px; min-height: 0; }

  /* Room: two columns. The "Add a song" button sits on top of the queue instead of floating. */
  .room {
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "top  top"
      "now  dock"
      "now  upnext";
    column-gap: 64px;
    align-content: start;
    padding-bottom: 48px;
  }
  .room .topbar { grid-area: top; margin-bottom: 8px; }
  .room .now { grid-area: now; position: sticky; top: 24px; align-self: start; padding-top: 0; }
  .invite-desk { display: inline-flex; margin-top: 16px; }
  .room .dock { grid-area: dock; position: static; padding: 0; background: none; display: block; }
  .room .dock .btn { max-width: none; }
  .room .upnext { grid-area: upnext; margin-top: 28px; }
  .meta .title { font-size: 26px; }
  .tracks .track { padding: 10px 12px; margin: 0 -12px; border-radius: 12px; }
  .track img { width: 56px; height: 56px; }

  /* Sheets become centered dialogs. */
  .sheet { margin: auto; max-width: 520px; max-height: 80vh; border-radius: 24px; padding-bottom: 24px; }
  #sheet-add { min-height: 60vh; }
  .sheet[open] { animation: pop 0.18s ease-out; }
  @keyframes pop { from { transform: scale(0.97); opacity: 0; } }
  .toast { bottom: 32px; }
}

/* Hover feedback for mouse users only (phones never get stuck hover states). */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { filter: brightness(0.94); }
  .btn.primary:hover:not(:disabled) { filter: brightness(1.12); }
  .icon-btn:hover:not(:disabled), .code-pill:hover, .sync-pill:hover, .chip:hover { background: var(--surface-2); }
  .play:hover:not(:disabled) { transform: scale(1.04); }
  .tracks .track:hover { background: var(--surface); }
  .menu button:hover { color: var(--muted); }
}
