:root {
    color-scheme: dark;
    --ground: #111310;
    --surface: #1b1e18;
    --line: #373c31;
    --text: #f3f5ec;
    --muted: #b7beaf;
    --accent: #d7fb75;
    font: 16px/1.5 system-ui, sans-serif;
    background: var(--ground);
    color: var(--text);
}
* { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: absolute; top: -5rem; left: 1rem; z-index: 4; background: var(--ground); padding: .8rem; }
.skip:focus { top: .5rem; }
.shell { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.nav, .nav-links, .footer, .actions, .page-heading, .pagination { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav { min-height: 76px; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; font-weight: 850; font-size: 1.4rem; letter-spacing: -.075em; }
.brand > span:last-child { color: var(--accent); }
.mark { padding-right: .55rem; font-size: .85rem; color: var(--accent); letter-spacing: -.12em; }
.nav-links a { color: var(--muted); font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--accent); }
.main { flex: 1; padding-block: 2.5rem 4rem; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 365px; display: flex; align-items: center; border: 1px solid #485633; border-radius: 1rem; background: #222b18; }
.hero-copy { position: relative; z-index: 1; padding: clamp(1.5rem, 6vw, 4.5rem); }
h1, h2, p { margin-top: 0; }
h1, h2 { overflow-wrap: anywhere; letter-spacing: -.055em; line-height: 1.04; }
h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); margin-bottom: 1.3rem; }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.hero em { color: var(--accent); font-style: normal; }
.record { position: absolute; width: clamp(300px, 55vw, 645px); aspect-ratio: 1; right: -9%; top: 50%; transform: translateY(-50%); border-radius: 50%; background: repeating-radial-gradient(circle, #121710 0 4px, #2c3821 5px 6px, #1a2215 7px 9px); border: 1px solid #516141; box-shadow: inset 0 0 0 16px #171d13, 0 0 4rem #1117; }
.record-label { position: absolute; inset: 34%; border-radius: 50%; background: radial-gradient(circle, #181d13 0 5%, #cbe675 6% 40%, #a4ca54 41% 52%, #d7fb75 53%); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .55rem; border: 1px solid transparent; border-radius: .6rem; padding: .7rem 1rem; font: inherit; font-weight: 730; background: var(--accent); color: #141a0c; cursor: pointer; }
.button:hover { background: #e7ffa5; color: #141a0c; }
.button.secondary { border-color: var(--line); color: var(--text); background: var(--surface); }
.button.secondary:hover { border-color: var(--accent); color: var(--accent); }
.button:disabled { opacity: .65; cursor: wait; }
.section { margin-top: 2.5rem; }
.empty { padding: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; color: var(--muted); }
.tracks, .rows { list-style: none; margin: 0; padding: 0; }
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 1rem; }
.track { border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; background: var(--surface); }
.track-info { display: grid; padding: .85rem; overflow-wrap: anywhere; }
.track-name { font-weight: 750; }
.artwork { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: radial-gradient(circle, #394a25, #222b18 60%, #172111); color: var(--accent); font-size: 3rem; }
.artwork img { width: 100%; height: 100%; object-fit: cover; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .9rem; }
.rows a span { overflow-wrap: anywhere; }
.rows small { display: block; }
.muted, small, .back, .footer > a:last-child { color: var(--muted); }
.back { display: inline-block; margin-bottom: 1.1rem; }
.song { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: clamp(1.25rem, 5vw, 4rem); }
.song-art { border-radius: .85rem; }
.song-info h1 { font-size: clamp(2rem, 5.5vw, 4rem); }
.description { white-space: pre-line; overflow-wrap: anywhere; margin-top: 1rem; }
iframe { display: block; border: 0; border-radius: .65rem; margin-top: 1.25rem; }
.panel { max-width: 760px; padding: clamp(1.15rem, 4vw, 2rem); background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; }
.narrow { max-width: 460px; margin-inline: auto; }
.panel h1, .page-heading h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-heading { justify-content: space-between; margin-bottom: 1rem; }
.page-heading h1 { margin: 0; }
.editor, label { display: grid; gap: .55rem; }
.editor { gap: 1rem; }
.editor label { font-weight: 650; }
.editor small { font-weight: 400; }
.editor input, .editor textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: .5rem; padding: .65rem; background: var(--ground); color: var(--text); font: inherit; }
.editor input[type=file] { font-size: .9rem; }
.editor textarea { resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.status { color: var(--accent); }
.status a { text-decoration: underline; }
.errors { margin: 0; color: #ffb8a8; }
.pagination { margin-top: 1.4rem; }
.pagination a { text-decoration: underline; }
.footer { min-height: 80px; justify-content: space-between; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
    .shell { width: calc(100% - 1.5rem); }
    .nav { gap: .6rem; }
    .nav-links { gap: .65rem; }
    .hero { min-height: 290px; }
    .record { right: -42%; opacity: .52; }
    .song, .fields { grid-template-columns: minmax(0, 1fr); }
    .song-art { width: min(100%, 360px); }
}

.source-input { display: flex; align-items: stretch; gap: .55rem; }
.source-input input { flex: 1 1 0; }
.import-notices { margin: 0; color: var(--muted); }
.draft-cover { margin: 0; color: var(--muted); }
.draft-cover img { display: block; object-fit: cover; border-radius: .55rem; margin-bottom: .35rem; }
.release-details { display: flex; flex-wrap: wrap; gap: .75rem 1.4rem; margin: 1rem 0; }
.release-details dt { color: var(--muted); font-size: .8rem; }
.release-details dd { margin: 0; }

.song-player { display: grid; justify-items: start; gap: .85rem; margin-block: 1.25rem; }
.song-player audio { display: block; width: min(100%, 34rem); }

/* Additions for the plain-PHP site */
.search { display: flex; gap: .5rem; align-items: stretch; }
.search input { min-width: 0; width: 15rem; max-width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--ground); color: var(--text); font: inherit; }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.button.danger { color: #ffb8a8; border-color: #7a4035; }
.description { white-space: normal; }

/* ---- Links, articles, ads ---- */
.link { text-decoration: underline; text-underline-offset: 3px; }
.article { max-width: 72ch; font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.article h2 { margin: 2rem 0 .8rem; font-size: clamp(1.3rem, 3vw, 1.6rem); letter-spacing: -.03em; line-height: 1.2; }
.article p { margin: 0 0 1.1rem; }
.article a { text-decoration: underline; }
.page h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.ad { margin-block: 1.5rem; text-align: center; overflow: hidden; max-width: 100%; }
.ad:empty { display: none; }
.admin-note { margin-top: 1rem; padding: .7rem .9rem; border: 1px dashed var(--line); border-radius: .6rem; color: var(--muted); font-size: .92rem; }
.song-actions { margin-block: 1.25rem; }

/* ---- Artist page ---- */
.artist-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.artist-head h1 { margin-bottom: .4rem; }
.artist-photo { border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* ---- Play buttons and track rows ---- */
.track .artwork { position: relative; }
.track .artwork > a { display: grid; place-items: center; width: 100%; height: 100%; }
.play-dot { position: absolute; right: .6rem; bottom: .6rem; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: var(--accent); color: #141a0c; cursor: pointer; display: grid; place-items: center; font-size: 1rem; box-shadow: 0 .3rem 1rem #0008; }
.play-dot::before { content: "▶"; padding-left: .12em; }
.play-dot[aria-pressed="true"]::before { content: "❚❚"; padding-left: 0; font-size: .8rem; }
.play-dot:hover { background: #e7ffa5; }
.play-dot.small { position: static; width: 2.2rem; height: 2.2rem; flex: none; box-shadow: none; font-size: .8rem; }
.tracklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; background: var(--surface); }
.tracklist-row { display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; }
.tracklist-row + .tracklist-row { border-top: 1px solid var(--line); }
.tracklist-row.is-current, .tracklist-row.is-playing { background: #222b18; }
.tracklist-row.is-playing .tracklist-title { color: var(--accent); }
.tracklist-number { width: 1.6rem; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.tracklist-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.tracklist-download { flex: none; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.tracklist-download:hover { border-color: var(--accent); }

/* ---- Player bar ---- */
.player { position: fixed; inset: auto 0 0 0; z-index: 5; background: #171a14f2; border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.player-inner { display: flex; align-items: center; gap: .9rem; padding-block: .6rem; }
.player-cover { border-radius: .4rem; object-fit: cover; flex: none; }
.player-meta { display: grid; min-width: 0; flex: 1 1 8rem; line-height: 1.25; }
.player-meta a, .player-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta a { font-weight: 700; }
.player-controls { display: flex; gap: .35rem; flex: none; }
.player-controls button { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 1rem; cursor: pointer; }
.player-controls button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.player-controls button:disabled { opacity: .4; cursor: default; }
.player audio { flex: 2 1 16rem; min-width: 0; height: 2.5rem; }
body.has-player .footer { margin-bottom: 5rem; }
@media (max-width: 640px) {
    .player-inner { flex-wrap: wrap; gap: .5rem .7rem; }
    .player audio { flex-basis: 100%; }
    body.has-player .footer { margin-bottom: 8rem; }
}

/* ---- Admin area ---- */
.admin { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem; flex: 1; padding-block: 2rem 4rem; align-items: start; }
.admin-menu { position: sticky; top: 1rem; display: grid; gap: .2rem; }
.admin-menu a, .admin-menu button { display: block; width: 100%; text-align: left; padding: .55rem .75rem; border: 0; border-radius: .5rem; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.admin-menu a:hover, .admin-menu button:hover { background: var(--surface); color: var(--text); }
.admin-menu a[aria-current] { background: var(--surface); color: var(--accent); font-weight: 700; }
.admin-main { min-width: 0; }
.admin-main h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.admin-main h2 { font-size: 1.35rem; letter-spacing: -.03em; }
.admin-main h3 { margin: 0; font-size: 1.1rem; }
.panel.wide { max-width: none; }
.panel.section { margin-top: 1.5rem; }
@media (max-width: 800px) {
    .admin { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .admin-menu { position: static; display: flex; flex-wrap: wrap; gap: .25rem; }
    .admin-menu a, .admin-menu button { width: auto; }
}
.editor select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: .5rem; padding: .65rem; background: var(--ground); color: var(--text); font: inherit; }
.editor .code, textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 400; }
.editor label.check input, label.check input { width: auto; flex: none; }
fieldset.ad-slot { margin: 0; min-width: 0; display: grid; gap: .7rem; }
fieldset.ad-slot legend { padding-inline: .4rem; font-weight: 750; }
fieldset.ad-slot p { margin: 0; }
.sticky-actions { position: sticky; bottom: 0; padding-block: .8rem; background: var(--ground); }
.badge { padding: .2rem .65rem; border: 1px solid var(--line); border-radius: 2rem; color: var(--muted); font-size: .85rem; }
.badge.on { border-color: var(--accent); color: var(--accent); }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tabs a { padding: .4rem .8rem; border-radius: 2rem; color: var(--muted); }
.tabs a[aria-current] { background: var(--surface); color: var(--accent); }
.stat-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .8rem; }
.stat-cards a { display: grid; gap: .1rem; padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); }
.stat-cards a:hover { border-color: var(--accent); }
.stat-cards strong { font-size: 1.9rem; letter-spacing: -.04em; line-height: 1.1; }
.stat-cards span { color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .7rem; margin-bottom: .7rem; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .65rem .9rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th:first-child { text-align: left; white-space: normal; font-weight: 650; }
.table thead th { color: var(--muted); font-size: .85rem; font-weight: 500; }
.table tbody tr { border-top: 1px solid var(--line); }
.table small { display: block; font-weight: 400; }
.chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: .35rem; height: 11rem; padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); }
.chart-day { display: grid; grid-template-rows: 1fr auto; gap: .3rem; text-align: center; min-width: 0; }
.chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar { flex: 1; max-width: .7rem; min-height: 2px; border-radius: 2px 2px 0 0; }
.bar.views, .key.views { background: #8fa3ff; }
.bar.plays, .key.plays { background: var(--accent); }
.bar.downloads, .key.downloads { background: #ffb37a; }
.chart-key { margin-top: .6rem; color: var(--muted); font-size: .9rem; }
.key { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-left: .8rem; }
.key:first-child { margin-left: 0; }
.steps { list-style: none; margin: 0 0 1.25rem; padding: 0; border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; }
.steps li { display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; background: var(--ground); }
.steps li + li { border-top: 1px solid var(--line); }
.step-number { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.steps .done .step-number { background: var(--accent); border-color: var(--accent); color: #141a0c; font-weight: 750; }
.step-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.step-title small { display: block; font-weight: 400; }
.next-track { padding: 1.1rem; border: 1px solid #485633; border-radius: .7rem; background: #222b18; }
details summary { cursor: pointer; color: var(--muted); margin-bottom: .8rem; }
.import-notices { padding-left: 1.2rem; }
.button[disabled] { cursor: not-allowed; }
