/* LongPlays: a record shop at night. Dark first, warm light mode. */
:root {
  --bg: #f5f0e6;
  --bg-glow: #ffd9c7;
  --surface: #fffaf1;
  --surface-2: #ece5d8;
  --fg: #16131a;
  --muted: #6d6575;
  --line: #ddd4c4;
  --accent: #e8471f;
  --accent-2: #6b4dff;
  --accent-fg: #fff;
  --ok: #138a4b;
  --vat: #a39a8c;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 12px 32px -12px rgb(40 20 0 / 0.25);
  --radius: 18px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0c12;
    --bg-glow: #3a1430;
    --surface: #18151f;
    --surface-2: #231f2c;
    --fg: #f4efe7;
    --muted: #a59eb0;
    --line: #2e2939;
    --accent: #ff5a36;
    --accent-2: #a28cff;
    --accent-fg: #160c08;
    --ok: #4ade80;
    --vat: #5d5668;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -16px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0c12; --bg-glow: #3a1430; --surface: #18151f; --surface-2: #231f2c; --fg: #f4efe7; --muted: #a59eb0;
  --line: #2e2939; --accent: #ff5a36; --accent-2: #a28cff; --accent-fg: #160c08; --ok: #4ade80; --vat: #5d5668;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -16px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 var(--font);
  color: var(--fg);
  background:
    radial-gradient(60rem 40rem at 110% -10%, var(--bg-glow), transparent 60%),
    radial-gradient(40rem 30rem at -20% 30%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
main, .top, .tabs, .landing { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
h2 { font-size: 1.6rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

/* Buttons and inputs */
.btn {
  font: 600 0.95rem var(--font); border-radius: 999px; padding: 10px 18px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { border-color: var(--fg); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-block { width: 100%; padding: 14px; font-size: 1rem; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
label { display: block; font-weight: 500; margin-bottom: 14px; font-size: 0.95rem; }
input, textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
textarea { resize: vertical; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h2 { margin-bottom: 16px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.3rem; letter-spacing: -0.04em; color: var(--fg); text-decoration: none; }
.logo-disc {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 22%, #111 23% 30%, #222 31% 33%, #111 34% 56%, #2a2a2a 57% 59%, #111 60%);
  animation: spin 6s linear infinite;
}
#who { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 0.85rem; white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--accent-2); color: #fff; border: 0; cursor: pointer; font-family: var(--font);
}

/* Landing */
.landing { display: grid; gap: 32px; padding-top: 24px; padding-bottom: 40px; }
.landing h1 { font-size: clamp(3rem, 11vw, 6.2rem); margin: 10px 0 18px; }
.hl { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34ch; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.facts li { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts strong { font-family: var(--mono); font-size: 1.6rem; min-width: 4.2ch; color: var(--accent); }
.landing-side { display: grid; gap: 28px; align-content: start; }
.hero-record { position: relative; height: 220px; }
.hero-sleeve {
  position: absolute; z-index: 2; left: 0; top: 0; width: 220px; height: 220px; border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, #ffb199 0 18%, transparent 19%),
    repeating-radial-gradient(circle at 70% 70%, #ff5a36 0 12px, #6b4dff 12px 24px);
  box-shadow: var(--shadow); display: flex; align-items: flex-end; padding: 12px;
}
.hero-sleeve span { font: 700 0.85rem var(--mono); background: #0e0c12; color: #fff; padding: 4px 8px; border-radius: 6px; }
.hero-vinyl {
  position: absolute; z-index: 1; left: 90px; top: 10px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 14%, #0b0b0b 15% 17%, #1a1a1a 18% 40%, #262626 41% 42%, #151515 43% 70%, #262626 71% 72%, #111 73%);
  animation: spin 4s linear infinite;
}
@media (min-width: 880px) {
  .landing { grid-template-columns: 1.2fr 1fr; align-items: center; padding-top: 48px; }
}

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 6px; padding-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; font: 600 0.92rem var(--font); padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
}
.tabs button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Credits banner */
.banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 20px; margin-bottom: 22px; border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 20%, var(--surface)), color-mix(in srgb, var(--accent-2) 22%, var(--surface)));
  border: 1px solid var(--line);
}
.banner h3 { font-size: 1.2rem; }
.tokens { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.token {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 18%, #111 20% 100%); box-shadow: inset 0 0 0 3px #2a2a2a;
}

/* Album grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.album-card { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; color: inherit; font: inherit; width: 100%; }
.album-card h3 { font-size: 1.02rem; margin-top: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-card .muted { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record { position: relative; aspect-ratio: 1; }
.record .vinyl {
  position: absolute; inset: 4% 4% 4% 4%; border-radius: 50%;
  background: radial-gradient(circle, var(--disc, var(--accent)) 0 15%, #0b0b0b 16% 18%, #1a1a1a 19% 40%, #2a2a2a 41% 42%, #151515 43% 70%, #2a2a2a 71% 72%, #111 73%);
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1);
}
.album-card:hover .vinyl, .album-card:focus-visible .vinyl { transform: translateX(22%) rotate(40deg); }
.cover {
  position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow); background: var(--surface-2);
}
.cover img, .cover svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.stamp {
  position: absolute; z-index: 2; top: 8px; right: 8px; font: 700 0.78rem var(--mono); letter-spacing: 0.02em;
  padding: 4px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-fg);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.3); transform: rotate(3deg);
}
.owners { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* Album sheet */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.55); backdrop-filter: blur(4px); animation: fade 0.2s ease; }
.sheet-body {
  position: relative; width: 100%; max-width: 760px; margin-inline: auto; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 22px 18px calc(130px + env(safe-area-inset-bottom));
  animation: rise 0.28s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-body { border-radius: 24px; padding-bottom: 28px; max-height: 86vh; } }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.album-hero { display: grid; gap: 22px; }
@media (min-width: 640px) { .album-hero { grid-template-columns: 240px 1fr; align-items: end; } }
.album-hero .record { width: min(240px, 70vw); }
.album-hero .vinyl { transform: translateX(28%); }
.album-hero.spinning .vinyl { animation: spin-out 2.4s linear infinite; }
.album-hero h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.album-hero .by { font-size: 1.1rem; color: var(--muted); margin-top: 6px; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.owned-badge { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--accent); }
.owned-badge strong { font-family: var(--mono); font-size: 1.3rem; color: var(--accent); }
.tracklist { list-style: none; padding: 0; margin: 24px 0 0; counter-reset: t; }
.tracklist li {
  display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 8px;
  padding: 10px 6px; border-top: 1px solid var(--line); border-radius: 10px;
}
.tracklist li.playing { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tracklist .n { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; text-align: center; }
.tracklist .t { font-weight: 500; }
.tracklist .p { font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.track-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: var(--surface-2); color: var(--fg); font-size: 0.85rem;
}
.track-btn.own { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.credits-note { margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--surface-2); font-size: 0.9rem; color: var(--muted); white-space: pre-line; }
.owner-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.owner-list span { font: 500 0.78rem var(--mono); padding: 4px 8px; border-radius: 6px; background: var(--surface-2); }

/* Collection certificates */
.certs { display: grid; gap: 16px; }
@media (min-width: 800px) { .certs { grid-template-columns: 1fr 1fr; } }
.cert {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 16px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative; overflow: hidden; cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%;
}
.cert::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%;
  border: 14px solid color-mix(in srgb, var(--accent) 12%, transparent);
}
.cert .cover { width: 96px; height: 96px; }
.cert .label { font: 700 0.68rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.cert .num { font: 700 2rem var(--mono); color: var(--accent); line-height: 1.1; letter-spacing: -0.02em; }
.cert .serial { font: 500 0.72rem var(--mono); color: var(--muted); margin-top: 4px; }

/* Plan */
.plan-grid { display: grid; gap: 16px; }
@media (min-width: 800px) { .plan-grid { grid-template-columns: 1.1fr 1fr; } }
.plan-card {
  border-radius: 22px; padding: 26px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #ff5a36, #b4237a 55%, #4a2bd6);
  box-shadow: var(--shadow);
}
.plan-card::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgb(255 255 255 / 0.12) 0 2px, transparent 2px 12px);
}
.plan-card .price { font: 700 3.4rem var(--font); letter-spacing: -0.05em; margin: 10px 0 2px; }
.plan-card .price small { font-size: 1rem; font-weight: 500; opacity: 0.8; letter-spacing: 0; }
.plan-card ul { padding-left: 18px; margin: 14px 0 20px; }
.plan-card .btn { background: #fff; color: #16131a; border-color: #fff; }
.plan-card .btn.ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.6); }
.plan-card .eyebrow { color: rgb(255 255 255 / 0.85); }
.credit-count { font: 700 3.2rem var(--mono); line-height: 1; color: var(--accent); }

/* Tables as lists */
.rows { list-style: none; padding: 0; margin: 12px 0 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.rows .r { text-align: right; font-family: var(--mono); font-size: 0.9rem; white-space: nowrap; }

/* Money split */
.split { margin-top: 18px; }
.split-bar { display: flex; height: 64px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.split-bar > div { display: flex; align-items: flex-end; padding: 8px 10px; font: 700 0.85rem var(--mono); color: #fff; min-width: 0; }
.split-bar .s-artist { background: linear-gradient(135deg, var(--accent), #ff8a4c); color: #1a0a04; }
.split-bar .s-vat { background: var(--vat); }
.split-bar .s-platform { background: var(--accent-2); }
.legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.legend div { font-size: 0.85rem; color: var(--muted); }
.legend strong { display: block; font: 700 1.25rem var(--mono); color: var(--fg); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
@media (min-width: 800px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat strong { display: block; font: 700 1.5rem var(--mono); }
.stat span { color: var(--muted); font-size: 0.85rem; }

/* Artist area */
.stack { display: grid; gap: 16px; }
@media (min-width: 900px) { .stack.two { grid-template-columns: 1fr 1.2fr; align-items: start; } }
.drop {
  display: grid; place-items: center; text-align: center; padding: 22px; border: 2px dashed var(--line); border-radius: 14px;
  color: var(--muted); cursor: pointer; background: var(--bg); transition: border-color 0.2s ease;
}
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop strong { color: var(--fg); }
.cover-pick { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.cover-pick .cover { width: 96px; height: 96px; }
.file-list { font: 500 0.8rem var(--mono); color: var(--muted); margin: 8px 0 0; padding-left: 18px; }
.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status-pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status-pill.wait { background: var(--surface-2); color: var(--muted); }

/* Player */
.player {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 760px; margin-inline: auto; display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 18px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.6); animation: rise 0.3s cubic-bezier(.2,.8,.2,1);
}
.player[hidden] { display: none; }
.player-cover { width: 52px; height: 52px; }
.player-cover .cover { border-radius: 8px; }
.player-meta { min-width: 0; }
.player-title { display: flex; gap: 8px; align-items: center; min-width: 0; }
.player-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-artist { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar { position: relative; height: 4px; margin-top: 8px; border-radius: 99px; background: var(--line); cursor: pointer; }
.player-bar #progress { height: 100%; width: 0; border-radius: 99px; background: var(--accent); }
.player-bar #preview-mark { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--fg); }
.player-time { font: 500 0.8rem var(--mono); color: var(--muted); }
.player-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; font-size: 0.9rem;
  background: var(--fg); color: var(--bg);
}
.badge { font: 700 0.65rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.own { background: var(--accent); color: var(--accent-fg); }

/* Toast */
.toast {
  position: fixed; z-index: 80; left: 50%; top: 16px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 14px; background: var(--fg); color: var(--bg); font-weight: 600; box-shadow: var(--shadow);
  animation: drop 0.3s cubic-bezier(.2,.8,.2,1);
}
.toast[hidden] { display: none; }

section > h2, .section-head { margin-bottom: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 60ch; margin-top: 6px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-out { from { transform: translateX(28%) rotate(0); } to { transform: translateX(28%) rotate(360deg); } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -16px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.drop { position: relative; }
.rows li.payout-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
@media (max-width: 520px) { .rows li.payout-row > :nth-child(4) { grid-column: 1 / -1; text-align: left; } }

/* ---------- Community ---------- */
a.avatar { text-decoration: none; }
.fan-link { color: var(--fg); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.fan-link:hover { border-color: var(--accent); }
.owner-list a { font: 500 0.78rem var(--mono); padding: 4px 8px; border-radius: 6px; background: var(--surface-2); color: var(--fg); text-decoration: none; }
.owner-list a:hover { background: var(--accent); color: var(--accent-fg); }

/* Segmented control in the album sheet */
.seg { display: flex; gap: 4px; padding: 4px; margin-top: 24px; border-radius: 999px; background: var(--surface-2); }
.seg button { flex: 1; white-space: nowrap; font: 600 0.92rem var(--font); padding: 9px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px rgb(0 0 0 / 0.15); }

/* Owners also own */
.also-row { display: grid; grid-auto-flow: column; grid-auto-columns: 120px; gap: 12px; overflow-x: auto; padding: 10px 2px 6px; scrollbar-width: thin; }
.also { display: grid; gap: 2px; text-align: left; border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.also .cover { aspect-ratio: 1; height: auto; margin-bottom: 6px; }
.also strong, .also .muted { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Owners' room */
.room-door { text-align: center; padding: 28px 18px; margin-top: 16px; border-radius: var(--radius); border: 1px dashed var(--line); display: grid; gap: 10px; justify-items: center; }
.room-door .lock { font-size: 2rem; }
.door-stats { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 0.9rem; color: var(--muted); }
.door-stats strong { font-family: var(--mono); color: var(--fg); font-size: 1.1rem; }
.party-teaser { font-weight: 600; }
.composer { margin-top: 16px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); display: grid; gap: 10px; }
.composer textarea { margin: 0; background: var(--surface); }
.composer .btn { justify-self: end; }
.composer label { margin: 0; }
.composer-who { display: flex; gap: 8px; align-items: center; }
.kind-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-pick label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.kind-pick input { width: auto; margin: 0; accent-color: var(--accent); }
.feed { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.post { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.post p { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.92rem; }
.post.perk { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.post.perk .post-head { font-weight: 600; }
.post.perk.locked { border-style: dashed; background: var(--surface); color: var(--muted); }
.post.party { display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: start; border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, var(--surface)); }
.post.party .post-head { font-weight: 600; }
.party-date { display: grid; justify-items: center; padding: 8px 0; border-radius: 12px; background: var(--accent-2); color: #fff; }
.party-date span { font: 700 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.party-date strong { font-size: 1.6rem; line-height: 1; }

/* Community tab */
.shelf-preview { margin-bottom: 8px; }
.shelf-preview h3 { font-size: 1.15rem; margin-top: 4px; }
.room-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.room-row {
  width: 100%; display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; text-align: left;
  padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer;
}
.room-row:hover { border-color: var(--accent); }
.room-row .cover { width: 64px; height: 64px; }
.room-meta { min-width: 0; display: grid; gap: 2px; }
.room-meta > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Record shelf */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font: 700 2rem var(--font); color: #fff;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent));
}
.profile h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.profile-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
@media (min-width: 700px) { .profile { grid-template-columns: auto 1fr auto; } .profile-actions { grid-column: auto; } }
.shelf { margin-top: 26px; }
.shelf-row {
  position: relative; display: grid; grid-template-columns: repeat(var(--per), minmax(0, 1fr)); gap: 12px;
  padding: 18px 14px 0; margin-bottom: 34px;
}
.shelf-row::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -16px; height: 16px; border-radius: 3px;
  background: linear-gradient(#8a5a36, #5e3b20); box-shadow: 0 10px 18px -6px rgb(0 0 0 / 0.5), inset 0 2px 0 rgb(255 255 255 / 0.18);
}
.shelf-row::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60%;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.18)); pointer-events: none; border-radius: 6px 6px 0 0;
}
.shelf-item {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer;
  transform: rotate(var(--tilt)); transform-origin: bottom center; transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}
.shelf-item:hover, .shelf-item:focus-visible { transform: translateY(-10px) rotate(0); z-index: 2; }
.shelf-item .cover { border-radius: 4px; box-shadow: -4px 0 0 rgb(0 0 0 / 0.25) inset, 0 6px 14px -4px rgb(0 0 0 / 0.55); }
.shelf-item .stamp { top: auto; bottom: 6px; right: 6px; font-size: 0.68rem; padding: 2px 6px; }
a.btn { display: inline-block; text-decoration: none; }

/* Installed app: clear the notch and status bar */
.top { padding-top: max(18px, calc(env(safe-area-inset-top) + 8px)); }
main, .top, .tabs, .landing { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }

/* Demo releases */
.demo-tag {
  position: absolute; z-index: 2; top: 8px; left: 8px; font: 700 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px; background: #ffd23f; color: #16131a;
  outline: 2px dashed #16131a; outline-offset: -4px; box-shadow: 0 4px 12px rgb(0 0 0 / 0.3); transform: rotate(-3deg);
}
.shelf-item .demo-tag { top: 6px; left: 6px; font-size: 0.6rem; padding: 2px 6px; }
.demo-note {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 0.85rem; line-height: 1.45;
  background: color-mix(in srgb, #ffd23f 22%, transparent); border: 1px dashed color-mix(in srgb, #ffd23f 70%, var(--fg));
}
.next-steps {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 12px;
  border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.next-steps strong { flex-basis: 100%; }
.btn-play { font-size: 1.05rem; padding: 12px 22px; }
.preview-note { flex-basis: 100%; }

/* Royalty splits */
.split-bar .s-song, .legend .i-song { background: #ffc145; }
@media (max-width: 520px) { .legend { grid-template-columns: repeat(2, 1fr); } }
.rights-note { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); font-size: 0.9rem; }
.rights-note .eyebrow { margin: 0 0 6px; }
.rights-note div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--muted); }
.rights-note strong { font-family: var(--mono); color: var(--fg); }
fieldset.splits { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
fieldset.splits legend { font-weight: 700; padding: 0 6px; }
fieldset.splits p { margin: 0 0 10px; }

/* Full-screen now playing */
.player { cursor: pointer; }
.np { position: fixed; inset: 0; z-index: 70; overflow: hidden; background: var(--bg); color: var(--fg); animation: np-up 0.32s cubic-bezier(.2,.8,.2,1); }
.np[hidden] { display: none; }
@keyframes np-up { from { transform: translateY(100%); } to { transform: none; } }
.np-bg {
  position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--disc, var(--accent)) 55%, transparent), transparent 70%), var(--bg);
}
.np-sheet {
  position: relative; height: 100%; max-width: 520px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px;
  padding: calc(14px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}
.np-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.np-from span { display: block; font: 700 0.68rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.np-from strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-icon { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--fg); font-size: 1.5rem; cursor: pointer; }
.np-icon:disabled { opacity: 0.3; cursor: default; }
.np-art { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
.np-art .cover {
  width: min(100%, 46vh); height: auto; aspect-ratio: 1; border-radius: 14px;
  box-shadow: 0 30px 70px -20px rgb(0 0 0 / 0.6); transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.np.paused .np-art .cover { transform: scale(0.88); }
.np-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.np-names { min-width: 0; }
.np-names h2 { margin: 0; font-size: 1.6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-names p { margin: 4px 0 0; color: var(--muted); font-size: 1.05rem; }
.np-seek { position: relative; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--fg) 18%, transparent); cursor: pointer; touch-action: none; }
.np-seek::before { content: ""; position: absolute; inset: -14px 0; }
#np-progress { position: relative; height: 100%; width: 0; border-radius: 99px; background: var(--fg); }
.np-knob { position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--fg); }
.np-times { display: flex; justify-content: space-between; margin-top: -8px; font: 500 0.8rem var(--mono); color: var(--muted); }
.np-controls { display: flex; align-items: center; justify-content: center; gap: 34px; }
.np-skip { font-size: 1.8rem; }
.np-play { width: 76px; height: 76px; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 1.5rem; cursor: pointer; box-shadow: var(--shadow); }
.np-note { margin: 0; min-height: 1.4em; text-align: center; color: var(--muted); font-size: 0.9rem; }
.np-note .btn { display: block; margin: 10px auto 0; }

/* Trading */
.market-intro { margin: 16px 0; }
.market-mine { margin-bottom: 18px; }
.market-mine-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.big-no { font: 700 1.8rem var(--mono); color: var(--accent); }
.chain-link { display: inline-flex; align-items: center; gap: 4px; font: 700 0.75rem var(--mono); padding: 5px 9px; border-radius: 99px; background: color-mix(in srgb, var(--accent-2) 20%, transparent); color: var(--fg); text-decoration: none; }
.list-form { display: grid; gap: 10px; }
.seg.mini { display: flex; gap: 6px; margin: 0; padding: 4px; }
.seg.mini label { flex: 1; margin: 0; }
.seg.mini input { position: absolute; opacity: 0; }
.seg.mini span { display: block; text-align: center; padding: 8px; border-radius: 99px; cursor: pointer; font-weight: 600; }
.seg.mini input:checked + span { background: var(--surface); box-shadow: var(--shadow); }
.market-h { margin: 8px 0; }
.market-list { list-style: none; padding: 0; margin: 0; }
.market-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.market-no { font: 700 1.15rem var(--mono); }
.market-who { min-width: 0; }
.wallet code { font-family: var(--mono); }
@media (max-width: 420px) { .seg button { font-size: 0.82rem; padding: 9px 6px; } }

/* Artwork package */
.artwork-block { margin-top: 18px; }
.artwork-block:empty { display: none; }
.artwork-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.artwork-head .eyebrow { margin: 0; }
.btn-small { padding: 6px 12px; font-size: 0.82rem; cursor: pointer; }
.artwork-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 10px 0 8px; }
.art-tile { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; display: grid; place-items: center; color: var(--muted); }
.art-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-tile small { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 0.68rem; text-align: left; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 0.65)); }
.art-tile.locked { cursor: default; border-style: dashed; }
.art-tile.locked span { font-size: 1.3rem; }
.art-tile.locked small { color: var(--muted); background: none; }
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: 1fr auto; background: rgb(8 6 10 / 0.94); padding: calc(52px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.lightbox[hidden] { display: none; }
.lightbox img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 760px; width: 100%; margin: 14px auto 0; color: #f4efe7; }
.lb-bar .muted { color: #a59eb0; }
.lb-bar a:not(.btn) { color: #f4efe7; }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(255 255 255 / 0.12); color: #fff; font-size: 1rem; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgb(255 255 255 / 0.1); color: #fff; font-size: 2rem; cursor: pointer; }
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
