/* Rascal Radio — Little Rascal Records. Dark, mobile first, one accent. */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1d1d1d;
  --line: #2a2a2a;
  --text: #f2efe6;
  --muted: #9c978b;
  --accent: #ff4d2e;
  --accent-ink: #0a0a0a;
  --danger: #ff6b6b;
  --ok: #7bd88f;
  --radius: 10px;
  --player-h: 0px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed", ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  padding-bottom: calc(var(--player-h) + 16px);
}
a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-weight: 900; font-size: 14px; }
.brand-name { font-family: var(--display); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-stretch: condensed; }
.brand-sub { display: block; font-size: .7rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.site-foot { color: var(--muted); font-size: .8rem; padding: 32px 0; border-top: 1px solid var(--line); margin-top: 48px; }

h1, h2, h3 { font-family: var(--display); font-stretch: condensed; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; }
h2 { font-size: 1.3rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.1); color: var(--accent-ink); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .9rem; }
.btn-icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Collage */
.collage { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.collage img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.collage.empty { display: grid; place-items: center; color: var(--muted); }

/* Home */
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; margin: 24px 0; }
.show-card { text-decoration: none; display: block; }
.show-card h3 { margin: 10px 0 2px; font-size: 1.05rem; }
.show-card:hover h3 { color: var(--accent); }
.hero { padding: 32px 0 8px; }
.hero p { color: var(--muted); max-width: 40em; margin: 0; }

/* Crate (show) page */
.crate-head { display: grid; gap: 20px; padding: 24px 0; }
.crate-head .collage { width: min(100%, 320px); }
.crate-meta .kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; }
.crate-meta .stats { color: var(--muted); margin: 0 0 16px; }
.crate-notes { color: var(--muted); white-space: pre-line; margin: 0 0 16px; }
@media (min-width: 700px) {
  .crate-head { grid-template-columns: 300px 1fr; align-items: end; }
}

.tracklist { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.track {
  display: grid; grid-template-columns: 28px 52px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.track.now { background: linear-gradient(90deg, rgba(255,77,46,.12), transparent 70%); }
.track .pos { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; }
.track.now .pos { color: var(--accent); font-weight: 700; }
.track .art-btn { position: relative; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.track .art-btn img { width: 100%; height: 100%; object-fit: cover; }
.track .art-btn::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: var(--text); opacity: 0; transition: opacity .15s; font-size: 18px; }
.track .art-btn:hover::after, .track .art-btn:focus-visible::after, .track.now .art-btn::after { opacity: 1; }
.track.now .art-btn::after { content: "♪"; color: var(--accent); }
.track .info { min-width: 0; }
.track .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .artist { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .note { color: var(--accent); font-size: .8rem; margin-top: 2px; }
.track .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.track .dur { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.src-icon { width: 16px; height: 16px; flex: none; color: var(--muted); }
.buy { font-size: .8rem; white-space: nowrap; }

/* Sticky / embedded queue player */
.rp { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(14,14,14,.97); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.rp[hidden] { display: none; }
.rp-inner { max-width: 960px; margin: 0 auto; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); display: grid; gap: 6px; }
.rp-bar { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; }
.rp-art[src=""], .rp-art:not([src]) { visibility: hidden; }
.rp-art { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.rp-meta { min-width: 0; }
.rp-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-artist { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-ctrl { display: flex; gap: 6px; align-items: center; }
.rp-ctrl .btn { min-height: 40px; }
.rp-next.attn { border-color: var(--accent); color: var(--accent); }
.rp-status { font-size: .78rem; color: var(--muted); min-height: 1em; }
.rp-status a { color: var(--accent); }
.rp-bc iframe { display: block; width: 100%; height: 42px; border: 0; }
.rp-yt { position: absolute; right: 16px; bottom: calc(100% + 8px); width: 200px; height: 200px; background: #000; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.6); border: 1px solid var(--line); }
.rp-yt iframe, .rp-yt > div { width: 200px; height: 200px; display: block; }
.rp-yt[hidden], .rp-bc[hidden] { display: none; }

/* Share dialog */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(92vw, 440px); }
dialog::backdrop { background: rgba(0,0,0,.7); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog-head h2 { margin: 0; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 16px; }
.share-grid .btn { border-radius: 10px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; }
.field .seg { justify-self: start; }
.copy-row input, .copy-row textarea { flex: 1; min-width: 0; }
input[type=text], input[type=url], input[type=date], input[type=number], input:not([type]), textarea, select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { resize: vertical; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 14px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--surface-2); color: var(--text); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--player-h) + 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 100; }
.empty-state { padding: 48px 0; color: var(--muted); text-align: center; }
