/* Spinwall — the backdrop takes its colours from the centred cover,
   so every surface on top of it is dark glass with white text. */

:root {
  --cover: min(62vw, 340px, 46vh);
  --radius-cover: 10px;
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.82);
  --text-3: rgba(255, 255, 255, 0.66);
  --glass: rgba(18, 18, 22, 0.42);
  --glass-strong: rgba(28, 28, 32, 0.94);
  --hairline: rgba(255, 255, 255, 0.14);
  --fill: rgba(255, 255, 255, 0.12);
  --fill-hover: rgba(255, 255, 255, 0.2);
  --accent: #ff375f;
  --star: #ffd60a;
  --danger: #ff6961;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: -apple-system-headline, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
  background: #141418;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; border-radius: 8px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- Backdrop ---------- */

/* The centred cover itself, enlarged and melted into colour, sits behind
   everything: Liquid Glass needs something rich underneath to bend. */
#backdrop { position: fixed; inset: 0; z-index: -1; background: #141418; overflow: hidden; }
#backdrop .layer {
  position: absolute; inset: -15%;
  opacity: 0;
  background-size: cover; background-position: center;
  transition: opacity 1s ease;
  filter: blur(70px) saturate(1.7) brightness(0.62);
  transform: scale(1.1);
}
#backdrop .layer.on { opacity: 1; }
#backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.1) 0%, rgba(8, 8, 12, 0.35) 55%, rgba(8, 8, 12, 0.6) 100%);
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) max(20px, env(safe-area-inset-right)) 6px max(20px, env(safe-area-inset-left));
}
.brand { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn, .pill-btn, .nav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: var(--fill); color: var(--text);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: background 0.2s ease, transform 0.2s var(--ease);
}
.icon-btn:hover, .pill-btn:hover, .nav-btn:hover { background: var(--fill-hover); }
.icon-btn:active, .pill-btn:active, .nav-btn:active { transform: scale(0.96); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; }
.icon-btn .gear { width: 23px; height: 23px; stroke-width: 1.7; }
.pill-btn { min-height: 44px; padding: 0 18px; border-radius: 22px; font-weight: 600; font-size: 16px; white-space: nowrap; }
.pill-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.pill-btn.big { min-height: 52px; padding: 0 28px; font-size: 17px; background: #fff; color: #111; }
.pill-btn.big:hover { background: #f2f2f2; }
.pill-btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 18px; }
.pill-btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hairline); -webkit-backdrop-filter: none; backdrop-filter: none; }
.pill-btn.ghost:hover { background: var(--fill); }
.pill-btn[disabled] { opacity: 0.5; cursor: default; }

.text-btn {
  border: 0; background: none; padding: 10px 6px; min-height: 44px;
  color: var(--text-2); font-weight: 600; text-decoration: none;
}
.text-btn:hover { color: var(--text); }
.text-btn.danger { color: var(--danger); }

/* ---------- Empty state ---------- */

.empty { max-width: 420px; margin: 9vh auto 0; padding: 0 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty h2 { font-family: var(--font-display); font-size: 28px; margin: 28px 0 0; letter-spacing: -0.01em; }
.empty p { color: var(--text-2); margin: 4px 0 22px; }
.empty-art { position: relative; width: 210px; height: 130px; perspective: 600px; }
.empty-art span {
  position: absolute; top: 10px; left: 50%; width: 110px; height: 110px; margin-left: -55px;
  border-radius: 8px; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
}
.empty-art span:nth-child(1) { background: linear-gradient(135deg, #5e5ce6, #bf5af2); transform: translateX(-62px) rotateY(55deg) translateZ(-40px); }
.empty-art span:nth-child(3) { background: linear-gradient(135deg, #ff9f0a, #ff375f); transform: translateX(62px) rotateY(-55deg) translateZ(-40px); }
.empty-art span:nth-child(2) { background: linear-gradient(135deg, #30d158, #64d2ff); z-index: 1; }

/* ---------- Cover Flow ---------- */

.wall { position: relative; overflow: hidden; padding: 10px 0 6px; }

.stage {
  position: relative;
  height: calc(var(--cover) * 1.08 + 40px);
  perspective: 1100px;
  perspective-origin: 50% 40%;
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
  outline: none;
}
.stage:focus-visible { outline: none; }
.stage:focus-visible .cover.center .front { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 26px 50px rgba(0, 0, 0, 0.45); }

.cover {
  position: absolute;
  top: calc(var(--cover) * 0.04 + 14px);
  left: 50%;
  width: var(--cover); height: var(--cover);
  margin-left: calc(var(--cover) / -2);
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
}
.card {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s var(--ease);
}
.cover.flipped .card { transform: rotateY(180deg) scale(1.14); }

.face {
  position: absolute; inset: 0;
  border-radius: var(--radius-cover);
  overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.front { background: #2a2a2e; box-shadow: 0 26px 50px rgba(0, 0, 0, 0.45); }
.front img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.front .shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }

.back {
  transform: rotateY(180deg);
  background: var(--glass-strong);
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--hairline);
  display: flex; flex-direction: column;
  cursor: default;
  font-size: 13px;
}
.back-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 12px 8px 14px; border: 0; border-bottom: 1px solid var(--hairline);
  background: none; text-align: left; font-size: 13px;
}
.back-head:hover { background: rgba(255, 255, 255, 0.05); }
.back-titles { flex: 1; min-width: 0; }
.back-head strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-titles span { color: var(--text-3); }
.back-head svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.tracks { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.tracks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: baseline; padding: 5px 14px; }
.tracks li:nth-child(odd) { background: rgba(255, 255, 255, 0.04); }
.tracks .n { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.tracks .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .d { color: var(--text-3); font-variant-numeric: tabular-nums; }
.tracks .top .t::after { content: " ★"; color: var(--star); }
.tracks .disc { display: block; padding: 8px 14px 2px; color: var(--text-3); font-weight: 600; background: none !important; }
.back-actions { display: flex; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid var(--hairline); }
.back-actions a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; border-radius: 17px; background: var(--fill);
  font-weight: 600; font-size: 13px; text-decoration: none;
}
.back-actions a:hover { background: var(--fill-hover); }
.back-loading { flex: 1; display: grid; place-items: center; color: var(--text-3); }

.nav-btn {
  position: absolute; top: calc(var(--cover) * 0.54 + 14px); transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; z-index: 2000;
  background: rgba(0, 0, 0, 0.32);
}
.nav-btn:active { transform: translateY(-50%) scale(0.94); }
.nav-btn.prev { left: max(12px, env(safe-area-inset-left)); }
.nav-btn.next { right: max(12px, env(safe-area-inset-right)); }
.nav-btn[disabled] { opacity: 0; pointer-events: none; }

.wall-bar { text-align: center; min-height: 26px; padding: 0 20px; }
.position { margin: 0; color: var(--text-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.hint { margin: 0 0 2px; color: var(--text-2); font-size: 15px; }

/* ---------- Info panel ---------- */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.info {
  max-width: 760px;
  margin: 14px auto calc(env(safe-area-inset-bottom) + 24px);
  margin-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  padding: 20px 22px 10px;
  border-radius: 22px;
}
@media (min-width: 800px) { .info { margin-inline: auto; } }

.info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.info-titles { min-width: 0; }
.info h2 { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 1.15; letter-spacing: -0.015em; }
.artist { margin: 2px 0 0; font-size: 19px; color: var(--text-2); font-weight: 500; }
.meta { margin: 6px 0 0; font-size: 15px; color: var(--text-3); }

.info-grid { display: grid; grid-template-columns: 1fr; gap: 6px 28px; margin-top: 14px; }
@media (min-width: 700px) { .info-grid { grid-template-columns: 1fr 1fr; } }

.section-label { margin: 14px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }

.stars { display: flex; gap: 2px; margin-left: -8px; }
.stars button {
  width: 44px; height: 44px; border: 0; background: none; padding: 0;
  display: grid; place-items: center; color: rgba(255, 255, 255, 0.32);
  transition: transform 0.15s var(--ease), color 0.15s ease;
}
.stars button svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.stars button.on { color: var(--star); }
.stars button:active { transform: scale(0.85); }

.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; color: var(--text-2); }
.field input {
  border: 0; border-radius: 10px; padding: 8px 10px; min-height: 40px;
  background: var(--fill); color: var(--text);
}
.note {
  display: block; width: 100%; margin-top: 8px; resize: vertical;
  border: 0; border-radius: 12px; padding: 12px 14px; min-height: 84px;
  background: var(--fill); color: var(--text); line-height: 1.4;
}
.note::placeholder { color: var(--text-3); }

.stats { color: var(--text-2); font-size: 16px; }
.stats p { margin: 0 0 4px; }
.stats strong { color: var(--text); font-weight: 600; }
.stats .muted { color: var(--text-3); }
.stats button { padding: 0; min-height: 0; }

.blurb p { margin: 0; color: var(--text-2); font-size: 16px; }
.blurb .credit { display: inline-block; margin-top: 6px; font-size: 14px; color: var(--text-3); }
.blurb .muted { color: var(--text-3); }

#i-remove { margin-top: 10px; }

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

.sheet {
  width: min(560px, 100vw); max-width: 100vw;
  max-height: min(86vh, 760px);
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0;
  background: #1c1c20; color: var(--text);
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  flex-direction: column;
}
.sheet[open] { display: flex; animation: sheet-in 0.38s var(--ease); }
.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
@media (min-width: 700px) {
  .sheet { margin: auto; border-radius: 22px; max-height: min(80vh, 720px); }
  .sheet[open] { animation-name: sheet-pop; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes sheet-pop { from { transform: scale(0.96); opacity: 0; } }

.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 6px 22px;
}
.sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.sheet-head .text-btn { color: var(--accent); font-size: 17px; }
.sheet-body, .pane { overflow-y: auto; padding: 0 18px calc(env(safe-area-inset-bottom) + 18px); }
.pane { flex: 1; }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  margin: 6px 18px 12px; padding: 2px; border-radius: 10px; background: rgba(118, 118, 128, 0.24);
}
.segmented button {
  min-height: 36px; border: 0; border-radius: 8px; background: none;
  font-size: 15px; font-weight: 600; color: var(--text-2);
}
.segmented button[aria-selected="true"] { background: #636366; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }

.search-field {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; min-height: 44px; border-radius: 12px; background: rgba(118, 118, 128, 0.24);
  color: var(--text-3);
}
.search-field svg { width: 20px; height: 20px; flex: none; }
.search-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 17px; padding: 10px 0; }
.search-field input::-webkit-search-cancel-button { filter: invert(1); }

.result-list { list-style: none; margin: 8px 0 0; padding: 0; }
.result-list li.row {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.result-list img, .result-list .ph { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: #2c2c30; display: block; }
.result-list .ph { display: grid; place-items: center; color: var(--text-3); }
.result-list .ph svg { width: 24px; height: 24px; }
.result-list .txt { min-width: 0; }
.result-list .txt strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-list .txt span { display: block; font-size: 15px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-list .add-btn { min-height: 36px; padding: 0 14px; border-radius: 18px; font-size: 15px; }
.result-list .add-btn.done { background: none; color: var(--text-3); box-shadow: none; }
.result-list li.message { padding: 26px 8px; text-align: center; color: var(--text-2); }
.result-list li.message strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }
.result-list li.message .pill-btn { margin-top: 14px; }

.group { margin: 6px 0 22px; }
.group-title { margin: 8px 4px 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.group-note { margin: 0 4px 10px; font-size: 15px; color: var(--text-2); }
.card-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-top: 8px; border-radius: 14px; background: #2a2a2e;
}
.card-row-text { display: flex; flex-direction: column; min-width: 0; }
.card-row-text span { font-size: 15px; color: var(--text-3); }
.card-row select { border: 0; border-radius: 10px; padding: 8px 10px; min-height: 40px; background: var(--fill); color: var(--text); font-size: 16px; }
.card-row label.pill-btn, .row-buttons label.pill-btn { cursor: pointer; }
.row-buttons { display: flex; gap: 8px; flex: none; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 12px; padding: 0 14px;
  background: #2a2a2e; color: var(--text); font-size: 17px;
}
.howto { margin: 8px 4px 0; color: var(--text-2); font-size: 15px; }
.howto summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.howto ol { margin: 6px 0 4px; padding-left: 22px; }
.howto li { margin-bottom: 6px; }

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

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 10000;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: 22px;
  background: rgba(40, 40, 44, 0.92); color: #fff; font-weight: 600; font-size: 16px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.3s var(--ease);
}
@keyframes toast-in { from { transform: translate(-50%, 16px); opacity: 0; } }

/* ---------- Liquid Glass ----------
   One material for every floating surface: a bright, saturated blur of
   what's behind, a rim that catches light along the edges, and a specular
   highlight that follows the finger (--mx/--my, set in app.js). */

:root {
  --lg-tint: rgba(255, 255, 255, 0.09);
  --lg-tint-hover: rgba(255, 255, 255, 0.16);
  --lg-blur: blur(22px) saturate(1.9) brightness(1.08);
  --lg-edge:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.5),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.1),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.16),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
  --lg-drop: 0 12px 32px rgba(0, 0, 0, 0.22);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn, .pill-btn, .nav-btn, .glass, .sheet, .segmented, .seg-thumb, .toast, .search-field {
  isolation: isolate;
  background: var(--lg-tint);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  box-shadow: var(--lg-edge), var(--lg-drop);
}
.icon-btn, .pill-btn, .glass, .segmented, .search-field { position: relative; }

/* Specular highlight */
.icon-btn::before, .pill-btn::before, .nav-btn::before, .glass::before, .sheet::before, .toast::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; pointer-events: none;
  background: radial-gradient(140% 90% at var(--mx, 30%) var(--my, -10%), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 55%);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
/* Rim light: a hairline that is bright where light hits the edge */
.icon-btn::after, .pill-btn::after, .nav-btn::after, .glass::after, .sheet::after, .toast::after, .segmented::after, .seg-thumb::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.08) 32%, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, 0.3) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Buttons swell and glow under the finger, then spring back */
.icon-btn, .pill-btn, .nav-btn { transition: background 0.25s ease, transform 0.5s var(--spring); }
.icon-btn:hover, .pill-btn:hover, .nav-btn:hover { background: var(--lg-tint-hover); }
.icon-btn:hover::before, .pill-btn:hover::before, .nav-btn:hover::before { opacity: 1; }
.icon-btn:active, .pill-btn:active { transform: scale(1.07); transition-duration: 0.12s; }
.nav-btn:active { transform: translateY(-50%) scale(1.1); transition-duration: 0.12s; }
.icon-btn:active::before, .pill-btn:active::before, .nav-btn:active::before { opacity: 1; }

.pill-btn.big { background: rgba(255, 255, 255, 0.88); color: #111; }
.pill-btn.big:hover { background: #fff; }
.pill-btn.ghost { background: rgba(255, 255, 255, 0.04); box-shadow: var(--lg-edge); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); }
.pill-btn.ghost:hover { background: var(--lg-tint); }
.nav-btn { background: rgba(255, 255, 255, 0.1); }

.glass { background: rgba(255, 255, 255, 0.07); --lg-blur: blur(34px) saturate(1.9) brightness(1.04); }

/* Fields sit slightly recessed into the glass */
.note, .field input, .card-row select, .inline-form input {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}

/* Covers get a faint glossy edge, like a print under glass */
.front::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 38%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
/* Backdrop blur doesn't survive 3D transforms in Safari, so the back of the
   card is a solid tinted pane with the same edge light. */
.back {
  background: linear-gradient(160deg, rgba(62, 62, 72, 0.96), rgba(26, 26, 32, 0.97));
  box-shadow: var(--lg-edge), 0 26px 50px rgba(0, 0, 0, 0.5);
}
.back-actions a { box-shadow: var(--lg-edge); background: rgba(255, 255, 255, 0.1); }

/* Sheets: thick glass */
.sheet {
  background: rgba(30, 30, 36, 0.58);
  --lg-blur: blur(44px) saturate(1.8);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.3); }
.card-row { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.result-list li.row { border-bottom-color: rgba(255, 255, 255, 0.1); }

/* Segmented control: a glass droplet slides between the two choices */
.segmented { border-radius: 20px; padding: 3px; gap: 0; --lg-drop: none; background: rgba(255, 255, 255, 0.06); }
.segmented button { position: relative; z-index: 1; border-radius: 17px; background: none !important; box-shadow: none !important; transition: color 0.3s ease; }
.segmented button[aria-selected="true"] { color: #fff; }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 17px; z-index: 0;
  background: rgba(255, 255, 255, 0.2);
  --lg-drop: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.55s var(--spring);
}
.segmented[data-tab="recent"] .seg-thumb { transform: translateX(100%); }

.search-field { background: rgba(255, 255, 255, 0.07); --lg-drop: none; border-radius: 14px; }
.toast { background: rgba(255, 255, 255, 0.12); }

/* People who turn on Reduce Transparency get solid, high-contrast surfaces */
@media (prefers-reduced-transparency: reduce) {
  #backdrop .layer { filter: blur(70px) saturate(1.2) brightness(0.4); }
  .icon-btn, .pill-btn:not(.big), .nav-btn, .glass, .sheet, .segmented, .seg-thumb, .toast, .search-field {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #2c2c32;
  }
  .seg-thumb { background: #55555c; }
  .icon-btn::before, .pill-btn::before, .nav-btn::before, .glass::before, .sheet::before, .toast::before { display: none; }
}

/* ---------- Small and short screens ---------- */

@media (max-width: 420px) {
  .brand { font-size: 24px; }
  .topbar-actions .pill-btn span { display: none; }
  .topbar-actions .pill-btn { width: 44px; padding: 0; }
  .info { padding: 18px 18px 8px; }
  .info h2 { font-size: 23px; }
  .artist { font-size: 17px; }
  .info-head { flex-direction: column; }
  .info-head .pill-btn { align-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  #backdrop .layer { transition: none; }
  .sheet[open], .toast { animation: none; }
}
