/* Afterglow — wedding jukebox design system (trimmed to what the app uses) */

@font-face { font-family: "Geist"; src: url("../fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #FBF7F4; --surface: #FFFFFF; --surface-2: #F5EEEA; --surface-3: #EDE3DD;
  --border: #EADFD8; --border-strong: #D9C9C0;
  --text: #1C1420; --text-2: #5B4E60; --text-3: #8A7C8E;
  --accent: #7C3AED; --accent-soft: #F1EBFF; --accent-text: #6B2FD6; --accent-ring: rgba(124,58,237,.28);
  --primary: #8E2C4E; --primary-hover: #7A2443; --on-primary: #FFF8F2;
  --pos: #0F9F74; --pos-soft: #E6F6F0; --neg: #D93F5A; --neg-soft: #FDECEF;
  --warn: #9A6508; --warn-soft: #FFF4DC; --info: #3563C9; --info-soft: #EAF1FF;
  --glow-peach: #FFB38A; --glow-coral: #FF8FA3; --glow-pink: #F062B8; --glow-violet: #A855F7;
  --grad-afterglow: linear-gradient(100deg, #FFB38A 0%, #FF8FA3 30%, #F062B8 62%, #A855F7 100%);
  --grad-ember: linear-gradient(135deg, #FF8FA3 0%, #F062B8 50%, #A855F7 100%);
  --glow-shadow: 0 10px 34px rgba(240, 98, 184, .30), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(28,20,32,.05); --shadow: 0 4px 16px rgba(28,20,32,.06); --shadow-lg: 0 18px 50px rgba(28,20,32,.14);
  --heart-on: #E0457B;
  --heart-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E");
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0B0810; --surface: #141019; --surface-2: #1B1622; --surface-3: #241D2D;
  --border: #2A2233; --border-strong: #3A3045;
  --text: #F4EFF7; --text-2: #B9AFC4; --text-3: #8E839B;
  --accent: #A77BFF; --accent-soft: rgba(167,123,255,.14); --accent-text: #C9AEFF; --accent-ring: rgba(167,123,255,.35);
  --primary: #F062B8; --primary-hover: #F27CC4; --on-primary: #1A0F24;
  --pos: #3CCF95; --pos-soft: rgba(60,207,149,.12); --neg: #FF6B81; --neg-soft: rgba(255,107,129,.12);
  --warn: #F2B84B; --warn-soft: rgba(242,184,75,.12); --info: #8FB8FF; --info-soft: rgba(143,184,255,.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  --heart-on: #F062B8;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 700 11px/1 var(--font); letter-spacing: .18em; text-transform: uppercase; color: var(--text-3);
}
.eyebrow.rule::before { content: ""; width: 20px; height: 1.5px; background: currentColor; border-radius: 2px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; line-height: 1.45; }
.tiny { font-size: 12px; line-height: 1.4; }
h1, h2, h3 { margin: 0; }
.title { font: 600 1.15rem/1.25 var(--font); letter-spacing: -0.02em; }
.gradient-text { background: var(--grad-afterglow); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (forced-colors: active) { .gradient-text { color: CanvasText; background: none; } }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding-inline: 16px; }
.wrap-wide { max-width: 760px; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: 0 1.1rem; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .15s, box-shadow .15s, opacity .15s;
  touch-action: manipulation; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .icon-btn:focus-visible, .vote:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-ring);
}
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-glow { background: var(--grad-ember); color: #fff; border: 0; border-radius: 99px; box-shadow: var(--glow-shadow); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn-pos { background: var(--pos-soft); border-color: transparent; color: var(--pos); }
.btn-neg { background: transparent; border-color: transparent; color: var(--neg); }
.btn-neg-solid { background: var(--neg-soft); border-color: transparent; color: var(--neg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-sm { min-height: 36px; padding: 0 .8rem; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; font-size: 16px; padding: 0 1.4rem; }
.btn-block { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--r);
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; touch-action: manipulation;
}
.icon-btn:active { background: var(--surface-2); }
svg.i { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i-sm { width: 16px; height: 16px; }
svg.i-lg { width: 26px; height: 26px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card + .card { margin-top: 12px; }
:root[data-theme="dark"] .card { box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px;
  font: 600 11.5px/1 var(--font); letter-spacing: .01em; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.chip-pos { background: var(--pos-soft); color: var(--pos); }
.chip-neg { background: var(--neg-soft); color: var(--neg); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 8px var(--pos); flex: none; }
.dot-warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot-neg { background: var(--neg); box-shadow: 0 0 8px var(--neg); }
.dot-off { background: var(--text-3); box-shadow: none; }

/* ---------- inputs ---------- */
.field { display: block; }
.field > span { display: block; font: 600 12px/1.2 var(--font); color: var(--text-2); margin-bottom: 6px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
.field textarea { padding: 12px 14px; min-height: 90px; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.help { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.search {
  position: relative; display: flex; align-items: center;
}
.search svg.i { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; }
.search input { width: 100%; height: 52px; padding: 0 44px 0 44px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px; box-shadow: var(--shadow); -webkit-appearance: none; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow); }
.search .clear { position: absolute; right: 4px; }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* ---------- segmented + switch ---------- */
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--surface-2); gap: 2px; }
.seg button { flex: 1; min-height: 38px; border: 0; background: transparent; border-radius: 9px; font: 600 13px/1.1 var(--font);
  color: var(--text-2); cursor: pointer; padding: 0 6px; touch-action: manipulation; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--surface-3); }
.seg .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 99px; background: var(--glow-pink); color: #fff; font: 600 11px/1 var(--mono); }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--pos); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---------- art ---------- */
.art { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex: none; background: var(--grad-ember); position: relative; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art .initials { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.95);
  font: 600 16px/1 var(--serif); letter-spacing: .02em; }
.art-lg { width: 64px; height: 64px; border-radius: 12px; box-shadow: var(--shadow); }
.art-xl { width: 100%; height: auto; aspect-ratio: 1; border-radius: 18px; }

/* ---------- song rows ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.song { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 68px; position: relative; background: var(--surface); }
.list .song + .song { border-top: 1px solid var(--border); }
.song .meta { flex: 1; min-width: 0; }
.song .t { font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .a { color: var(--text-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .by { color: var(--text-3); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .rank { width: 22px; text-align: center; font: 500 13px/1 var(--mono); color: var(--text-3); flex: none; }
.song.is-mine { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.song .actions { display: flex; gap: 6px; align-items: center; flex: none; }

.vote {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 54px; height: 54px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; flex: none; touch-action: manipulation; transition: transform .12s, background .15s, border-color .15s;
}
.vote svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.vote b { font: 600 12px/1 var(--mono); }
.vote:active { transform: scale(.92); }
.vote[aria-pressed="true"] { background: var(--grad-ember); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(240,98,184,.28); }
.vote[aria-pressed="true"] svg { fill: currentColor; }
.vote[disabled] { opacity: .5; }
.vote.pop { animation: pop .35s ease-out; }
@keyframes pop { 40% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---------- now playing ---------- */
.np { display: flex; gap: 14px; align-items: center; padding: 14px; }
.np .meta { flex: 1; min-width: 0; }
.np .t { font-weight: 650; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np .a { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np .msg { color: var(--text-2); font-size: 13px; line-height: 1.45; margin-top: 3px; }
.progress { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--grad-afterglow); border-radius: 4px; transition: width .9s linear; }
.times { display: flex; justify-content: space-between; margin-top: 4px; font: 500 11px/1 var(--mono); color: var(--text-3); }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; border-radius: 2px; background: var(--grad-ember); animation: eq 1.1s ease-in-out infinite; height: 40%; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.is-paused .eq i { animation-play-state: paused; height: 35%; }

/* ---------- banners, toasts ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14px; line-height: 1.4; }
.banner svg.i { margin-top: 1px; }
.banner-info { background: var(--info-soft); color: var(--info); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-neg { background: var(--neg-soft); color: var(--neg); }
.banner-pos { background: var(--pos-soft); color: var(--pos); }
.banner b { display: block; }
.banner .muted { color: inherit; opacity: .85; }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none; z-index: 60; padding: 0 16px; }
.has-tabbar .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; max-width: 440px; width: fit-content; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg);
  font: 500 14px/1.35 var(--font); box-shadow: var(--shadow-lg); animation: toast-in .22s ease-out; }
.toast-neg { background: var(--neg); color: #fff; }
.toast-pos { background: var(--pos); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.conn { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 70;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--text); color: var(--bg);
  font: 600 12.5px/1 var(--font); box-shadow: var(--shadow-lg); }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(12, 8, 16, .45); z-index: 80; animation: fade .2s ease-out; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg);
  animation: sheet-in .28s cubic-bezier(.2,.8,.2,1); max-width: 560px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 0 auto 12px; }
.sheet .opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 8px; border: 0; background: none;
  font: 500 16px/1.2 var(--font); color: var(--text); text-align: left; border-radius: 12px; cursor: pointer; }
.sheet .opt:active { background: var(--surface-2); }
.sheet .opt.neg { color: var(--neg); }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- skeleton / empty ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--text-3); }
.empty svg.i { width: 26px; height: 26px; margin: 0 auto 8px; display: block; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: 8px; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- guest page ---------- */
.g-header { padding-block: calc(28px + env(safe-area-inset-top)) 14px; text-align: center; }
.g-header h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 11vw, 3.2rem); line-height: 1.02; letter-spacing: -0.02em; }
/* Upright ampersand: Cormorant's italic '&' is a swash form that looks like a different symbol. */
.amp { font-style: normal; font-weight: 500; padding-inline: .05em; }
.g-header .note { color: var(--text-2); margin-top: 6px; font-size: 14.5px; }
.g-sticky { position: sticky; top: 0; z-index: 20; padding: 10px 0; background: linear-gradient(var(--bg) 75%, transparent); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 4px 8px; }
.section-title h2 { font: 600 15px/1.2 var(--font); letter-spacing: -0.01em; }
.status-line { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.upnext { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Sits directly under the search box: the one place a guest is already looking after requesting. */
.cooldown { display: flex; align-items: center; gap: 11px; margin: 10px 0 2px; padding: 12px 14px;
  border-radius: var(--r); background: var(--primary-soft, var(--accent-soft)); color: var(--primary);
  font-size: 13.5px; line-height: 1.4; animation: fade .3s ease-out; }
.cooldown svg.i { flex: none; }
.cooldown b { display: block; font-size: 14.5px; }
.cooldown .count { font-family: var(--mono); font-weight: 600; }
.mine-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.mine-row::-webkit-scrollbar { display: none; }
.mine-pill { flex: none; max-width: 220px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.mine-pill .t { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Footer: separated, so the tip, the help button and "who you are" don't read as one grey blob. */
.guest-foot { display: grid; justify-items: center; gap: 14px; text-align: center;
  margin-top: 30px; padding: 22px 8px calc(30px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.guest-foot .tip { margin: 0; max-width: 34ch; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.guest-foot .who { margin: 0; font-size: 12.5px; color: var(--text-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 6px 14px; }
.guest-foot .who b { color: var(--primary); font-weight: 600; }
.guest-foot .credit { margin: 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); opacity: .75; }
.heart-glyph { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px;
  background: var(--grad-ember); color: var(--glow-pink);
  -webkit-mask: var(--heart-mask) center / contain no-repeat; mask: var(--heart-mask) center / contain no-repeat; }
@supports not (mask-image: var(--heart-mask)) { .heart-glyph { background: none; } .heart-glyph::before { content: "♥"; } }
/* Colour swatches (host setup) */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 64px; text-align: center; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch > span { display: block; width: 36px; height: 36px; margin: 0 auto 5px; border-radius: 50%;
  background: var(--sw); box-shadow: 0 0 0 1px var(--border); }
.swatch em { font-style: normal; font-size: 11px; color: var(--text-3); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--sw); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.field input[type=color], input[type=color] { width: 58px; min-width: 58px; flex: none; height: 40px; padding: 2px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }

/* Sides: join picker + standings */
.sides-pick { border: 0; padding: 0; margin: 0; }
.sides-pick legend { display: block; float: left; width: 100%; font: 600 12px/1.3 var(--font); color: var(--text-2);
  margin: 10px 0 8px; padding: 0; }
.side-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; clear: both; }
.side-option { position: relative; display: block; cursor: pointer; }
.side-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.side-option span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 56px; padding: 8px 10px;
  border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); font: 600 14px/1.25 var(--font);
  color: var(--text-2); transition: border-color .15s, background .15s, color .15s; }
/* Picking a side shows that side's colour, so the choice matches the scoreboard they'll see later. */
.side-option input:checked + span { border-color: var(--side-a); background: color-mix(in srgb, var(--side-a) 9%, transparent); color: var(--side-a-ink); }
.side-option input[value="b"]:checked + span { border-color: var(--side-b); background: color-mix(in srgb, var(--side-b) 9%, transparent); color: var(--side-b-ink); }
.side-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

.standings { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.standings:active { transform: scale(.995); }
/* Each side sits in its own tinted frame, the way the song cards are framed — so the eye reads
   "two teams" before it reads the numbers. */
.standings .vs-top { display: flex; align-items: flex-start; gap: 10px; }
.standings .vs-block { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.standings .vs-block.vs-b { align-items: flex-end; text-align: right; }
.standings .nm { max-width: 100%; font: 600 13.5px/1.2 var(--font); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standings .nm em { font-style: normal; font-weight: 500; color: var(--text-3); }
/* The frame hugs the score alone, with a floor so a single digit sits in the same box as two. It
   borrows the song cards' neutral surface — the colour belongs to the number, not the box. */
.standings .pts { display: inline-flex; align-items: center; justify-content: center; min-width: 64px;
  padding: 3px 12px 5px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2);
  font: 400 30px/1.15 var(--font); letter-spacing: -0.02em; }
.standings .vs-a .pts { color: var(--side-a); }
.standings .vs-b .pts { color: var(--side-b); }
.standings .bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin: 10px 0; }
.standings .bar i { display: block; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.standings .bar .a { background: var(--side-a); }
.standings .bar .b { background: var(--side-b); }
.standings .lead-a { color: var(--side-a-ink); }
.standings .lead-b { color: var(--side-b-ink); }
.standings .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.standings .foot .say { min-width: 0; }
.standings .foot .eyebrow { display: block; margin-bottom: 4px; }
.standings .foot .quote { display: block; font-family: var(--serif); font-style: italic; font-size: 17.5px; line-height: 1.35; color: var(--text); }
/* Set in from the quote's left edge, the way an epigraph's source line is. */
.standings .foot .by { display: block; margin-top: 4px; padding-left: 16px; font-size: 12.5px; color: var(--text-3); }
.standings .foot .more { flex: none; font-size: 12px; color: var(--text-3); }
/* Side colours are deliberately independent of the couple's accent: a dark accent (Black tie) made
   one side unreadable, and these match the venue screen so the same side is the same colour everywhere.
   The groom's violet is --glow-violet, the colour the music progress bar ends on.
   The -ink pair is the same colour pushed to a readable contrast for small text. */
:root { --side-a: #D6336C; --side-b: #A855F7; --side-a-ink: #D6336C; --side-b-ink: #8B44D6; }
:root[data-theme="dark"] { --side-a: #FF8FA3; --side-b: #A855F7; --side-a-ink: #FF8FA3; --side-b-ink: #C79BFA; }
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-list li { display: flex; align-items: center; gap: 11px; padding: 9px 2px; }
.lead-list li + li { border-top: 1px solid var(--border); }
.lead-list .pos { width: 22px; text-align: center; font: 600 13px/1 var(--mono); color: var(--text-3); }
.lead-list .who { flex: 1; min-width: 0; }
.lead-list .who b { display: block; font-size: 14.5px; }
.lead-list .who span { font-size: 12px; color: var(--text-3); }
.lead-list .score { font: 600 14px/1 var(--mono); }
.lead-list li:first-child .pos { color: var(--glow-pink); }

/* Confirmation popup */
.popup-backdrop { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease-out; }
.popup { position: relative; width: min(340px, 100%); text-align: center; padding: 26px 22px 22px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop-in .26s cubic-bezier(.2,.8,.2,1); }
.popup .art { width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 16px; box-shadow: var(--shadow); }
.popup-glyph { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft, var(--accent-soft)); color: var(--primary); }
.popup b { display: block; font: 650 19px/1.25 var(--font); letter-spacing: -0.02em; }
.popup p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--text-2); }
.popup .popup-note { display: inline-block; margin-top: 12px; padding: 5px 12px; border-radius: 99px;
  background: var(--surface-2); font: 600 12.5px/1 var(--font); color: var(--text-2); }
.popup-good b { color: var(--pos); }
.popup-x { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: none; color: var(--text-3); border-radius: 50%; cursor: pointer; }
.popup-x:active { background: var(--surface-2); }
.popup .count { font-family: var(--mono); font-weight: 600; color: var(--primary); }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }

/* First-time tour */
.intro-backdrop { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px;
  animation: fade .25s ease-out; }
.intro { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 28px 24px 20px; text-align: center; }
.intro .glyph { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft, var(--accent-soft)); color: var(--primary); }
.intro .glyph svg { width: 32px; height: 32px; stroke-width: 1.75; }
.intro h2 { font: 600 21px/1.2 var(--font); letter-spacing: -0.02em; }
.intro p { margin: 10px auto 0; max-width: 32ch; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.intro .step { animation: step-in .28s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
.intro .dots { display: flex; justify-content: center; gap: 7px; margin: 22px 0 18px; }
.intro .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); transition: width .2s, background .2s; }
.intro .dots i.on { width: 20px; background: var(--primary); }
.intro .actions { display: grid; gap: 8px; }
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row svg.i { margin-top: 2px; color: var(--accent-text); }
.info-row b { display: block; font-size: 14.5px; }
.from-playlist .song { background: transparent; }
.from-playlist { background: var(--surface-2); border-style: dashed; }
.join-hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: 32px; }
.join-hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.8rem, 13vw, 4rem); line-height: 1; letter-spacing: -0.02em; }

/* ---------- host app ---------- */
.h-top { display: flex; align-items: center; gap: 10px; padding-block: calc(12px + env(safe-area-inset-top)) 8px; }
.h-top h1 { font: 650 20px/1.2 var(--font); letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-inner { display: flex; width: 100%; max-width: 560px; }
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; border: 0; background: none;
  color: var(--text-3); font: 600 11px/1 var(--font); text-decoration: none; cursor: pointer; position: relative; }
.tabbar [aria-current="page"] { color: var(--text); }
.tabbar [aria-current="page"] svg { stroke: var(--glow-pink); }
.tabbar .badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--glow-pink); color: #fff; font: 600 10.5px/17px var(--mono); text-align: center; }
.host-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.health { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
.health .dot { width: 12px; height: 12px; }
.health.good { border-color: color-mix(in srgb, var(--pos) 35%, var(--border)); }
.health.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: var(--warn-soft); }
.health.bad { border-color: color-mix(in srgb, var(--neg) 50%, var(--border)); background: var(--neg-soft); animation: attention 2.4s ease-in-out infinite; }
.health.info { background: var(--info-soft); border-color: transparent; }
@keyframes attention { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,129,.35); } 50% { box-shadow: 0 0 0 6px rgba(255,107,129,0); } }
.transport { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 4px 0 14px; }
.play-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--grad-ember); color: #fff; display: grid; place-items: center;
  box-shadow: var(--glow-shadow); cursor: pointer; touch-action: manipulation; }
.play-btn svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.play-btn:active { transform: scale(.95); }
.round-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.round-btn.confirm { background: var(--neg-soft); color: var(--neg); border-color: var(--neg); }
.round-btn svg { width: 22px; height: 22px; }
.tile-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; }
.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-row .meta { flex: 1; min-width: 0; }
.setting-row .meta b { display: block; font-weight: 600; }
.setting-row .meta span { display: block; font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.moments { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.moments::-webkit-scrollbar { display: none; }
.moment { flex: none; min-width: 112px; max-width: 150px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  text-align: left; cursor: pointer; color: var(--text); touch-action: manipulation; }
.moment .e { font-size: 20px; line-height: 1; }
.moment b { display: block; font-size: 13px; margin-top: 6px; line-height: 1.2; }
.moment span { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.moment[aria-pressed="true"] { border-color: var(--glow-pink); box-shadow: 0 0 0 3px rgba(240,98,184,.18); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 16px; font-size: 13px; line-height: 1.4; }
.feed li + li { border-top: 1px solid var(--border); }
.feed time { font: 500 11.5px/1.6 var(--mono); color: var(--text-3); flex: none; width: 62px; white-space: nowrap; }
.feed .warn { color: var(--warn); } .feed .error { color: var(--neg); } .feed .good { color: var(--pos); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.qr-card { background: #fff; border-radius: 16px; padding: 12px; width: min(240px, 70vw); margin: 0 auto; }
.qr-card svg { width: 100%; height: auto; display: block; }
.code-big { font: 600 32px/1 var(--mono); letter-spacing: .12em; text-align: center; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font: 13px/1 var(--mono); color: var(--text-2); }

/* ---------- setup page ---------- */
.setup-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; position: sticky; top: 0; z-index: 10;
  background: var(--bg); }
.setup-nav a { flex: none; padding: 8px 12px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); font: 600 12.5px/1 var(--font); text-decoration: none; }
.setup-section { scroll-margin-top: 60px; }
.setup-section > h2 { font: 650 17px/1.25 var(--font); margin: 28px 4px 10px; letter-spacing: -0.02em; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; padding: 11px 16px; align-items: flex-start; }
.checklist li + li { border-top: 1px solid var(--border); }
.tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-3); margin-top: 1px; }
.tick.ok { background: var(--pos); color: #fff; }
.tick svg { width: 14px; height: 14px; stroke-width: 3; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; }
.pick + .pick { border-top: 1px solid var(--border); }
.pick .meta { flex: 1; min-width: 0; }
.pick .meta b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; gap: 14px; padding: 16px; }
details.card > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "›"; margin-left: auto; font-size: 20px; color: var(--text-3); transition: transform .2s; }
details.card[open] > summary::after { transform: rotate(90deg); }
.messages { list-style: none; padding: 0; margin: 12px 0; }
.messages li + li { margin-top: 8px; }

@media (min-width: 720px) {
  .tile-row { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .eq i { height: 60%; }
}
