/* Experimental theme: a familiar music-app feel — near-black canvas, lighter card surfaces,
   rounded pills, an on-air orange play accent (from the logo) and a floating, colour-tinted mini player.
   Deliberately dark-only. Loaded after styles.css; remove its <link> in index.html to revert. */

:root, :root[data-theme="light"], :root[data-theme="dark"] {
  --bg: #121212; --surface: #181818; --surface-2: #282828; --hover: #2a2a2a;
  --ink: #ffffff; --muted: #b3b3b3; --faint: #727272; --line: #2a2a2a;
  --green: #ff5a36; --green-ink: #000000; --green-soft: #ff7a5c;
  --accent: #ff5a36; --accent-ink: #000000; --shadow: none; --tint: 18%; --radius: 8px;
  --font: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { color-scheme: dark; } }

body { font-weight: 500; }
.title, .sheet h2, .li-title, .blk .b-title, .sb-text b, .brand h1, .card-head .st-name, .add h3, .sort-set h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; }
.brand h1 { font-size: 24px; }
.brand h1 span { color: var(--muted); font-weight: 700; }
.title { font-size: 18px; }
.sub, .time, .next time, .card-head .st-city, .meta { color: var(--muted); font-weight: 500; }
.clock span { font-family: var(--display); font-weight: 800; }
.clock small { color: var(--muted); }
.icon-btn { background: var(--surface-2); border: 0; border-radius: 50%; }

/* Pills: tabs, days, segmented controls, chips */
.tabs { background: transparent; padding: 0; gap: 8px; justify-content: flex-start; max-width: none; width: calc(100% - 2 * var(--gutter)); }
.tabs button { flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--green); color: var(--green-ink); box-shadow: none; }
main { max-width: 1200px; }
.days button { border: 0; border-radius: 999px !important; background: var(--surface-2); flex-direction: row; gap: 6px; padding: 8px 14px; min-width: 0; }
.days button small { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.days button b { font-size: 14px; font-weight: 700; font-family: var(--font); }
.days button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.days button[aria-pressed="true"] small { color: var(--bg); opacity: .7; }
.search { background: var(--surface-2); border: 0; border-radius: 999px; }
.search input::placeholder { color: var(--muted); }
.seg { background: var(--surface-2); border-radius: 999px; }
.seg button { border-radius: 999px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.genres span { border: 0; background: var(--surface-2); color: var(--ink); font-weight: 600; }
.chip { border: 0; background: var(--surface-2); }

/* Cards: flat lighter surfaces that brighten on hover */
.card { background: var(--surface); border: 0; border-radius: 8px; box-shadow: none; transition: background .15s; }
@media (hover: hover) { .card:hover { background: #202020; } }
.card.quiet { background: var(--surface); opacity: .6; }
.next { border-top-color: var(--surface-2); }
.thumb { border-radius: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / .5); }
.logo { border-radius: 4px; box-shadow: none; }
.blurb { color: var(--muted); }

/* Badges */
.badge { background: var(--surface-2); color: var(--muted); border-radius: 4px; font-weight: 700; letter-spacing: .04em; }
.badge.onair { background: rgb(255 90 54 / .14); color: var(--green-soft); }
.badge.live { background: var(--green); color: #000; }

/* Progress: thin white bar on a grey track */
.progress { height: 4px; border-radius: 2px; background: #4d4d4d; }
.progress span { background: var(--ink); border-radius: 2px; }
.card.playing .progress span { background: var(--green); }

/* Play buttons: green pill; "playing" shows green text with the equaliser */
.sonos-play { background: var(--green); color: var(--green-ink); border: 0; border-radius: 999px; font-weight: 700; font-size: 14px; padding: 8px 18px; }
.sonos-play:hover { background: #ff7452; transform: scale(1.03); }
.sonos-play svg { color: var(--green-ink); width: 11px; height: 11px; }
.sonos-play.on { background: transparent; color: var(--green-soft); box-shadow: inset 0 0 0 1px rgb(255 90 54 / .5); }
.sheet .actions .btn { border-radius: 999px !important; box-shadow: inset 0 0 0 1px #727272 !important; color: var(--ink); font-weight: 700; }
.sheet .actions .btn.primary { background: var(--green); color: var(--green-ink); box-shadow: none !important; }
.btn { background: var(--surface-2); color: var(--ink); border-radius: 999px; }
.btn.primary { background: var(--green); color: var(--green-ink); }

/* Guide grid */
.grid-wrap { background: var(--bg); border: 0; }
.g-hours, .g-corner, .g-label { background: var(--bg); border-color: var(--surface-2); }
.g-hours span { color: var(--muted); font-weight: 600; }
.g-label b { overflow-wrap: normal; word-break: normal; font-weight: 700; }
.g-row { border-bottom-color: var(--bg); background-image: repeating-linear-gradient(to right, #1f1f1f 0 1px, transparent 1px var(--pxh)); }
.blk { background: var(--surface-2); border-left: 3px solid var(--c); border-radius: 6px; }
.blk:hover { background: #333; }
.blk .b-time, .blk .b-sub { color: var(--muted); }
.blk.now:not(.filler) { background: #333; box-shadow: none !important; }
.blk.now:not(.filler) .b-title { color: var(--ink); }
.blk.filler, .blk.stream { background: #1c1c1c; border-left-color: #3a3a3a; }
.blk.filler .b-title { color: var(--faint); }
.now-line { background: var(--green); }
.now-line::before { background: var(--green); }
.mini-live { background: var(--green); box-shadow: 0 0 0 0 rgb(255 90 54 / .6); }
.on-sonos { color: var(--green); }

/* List view */
.li { background: transparent; border: 0; border-radius: 6px; }
.li:hover { background: var(--surface-2); }
.list h3 { color: var(--ink); font-weight: 800; font-size: 16px; text-transform: none; letter-spacing: -.01em; }

/* Mini player: floating, rounded, tinted with the playing station's colour */
.sonos-bar {
  --sb-bg: #282828; --sb-ink: #fff; --sb-muted: #b3b3b3; --sb-track: rgb(255 255 255 / .22);
  border-top: 3px solid var(--bar-c, #535353);
  /* Always centred, so collapsing only animates width/padding/radius (cheap and smooth). */
  left: 50%; right: auto; transform: translateX(-50%);
  width: min(640px, calc(100% - 16px));
  bottom: calc(8px + env(safe-area-inset-bottom, 0px)); border-radius: 12px !important;
  padding: 8px 12px 10px; box-shadow: 0 12px 32px rgb(0 0 0 / .6) !important;
  transition: width .3s cubic-bezier(.22,.8,.2,1), padding .3s cubic-bezier(.22,.8,.2,1),
              border-radius .3s cubic-bezier(.22,.8,.2,1), border-top-width .2s ease;
  will-change: width;
}
@media (min-width: 700px) { .sonos-bar { bottom: 16px; } }
/* Contents fade and collapse as the player shrinks; display is animated so it still leaves the layout. */
.sonos-bar > :not(.sb-handle) { transition: opacity .18s ease, transform .22s ease, height .3s cubic-bezier(.22,.8,.2,1); }
.sonos-bar.mini > :not(.sb-handle) { opacity: 0; transform: translateY(6px); }
.sb-handle svg { transition: transform .3s cubic-bezier(.22,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .sonos-bar, .sonos-bar > *, .sb-handle svg { transition: none !important; } }
.sb-handle { height: 16px; }
.sb-art { border-radius: 6px; width: 44px; height: 44px; }
.sb-pp { border: 0; background: #fff; color: #000; width: 40px; height: 40px; }
.sb-spk i { background: var(--green); color: #000; }
.sonos-bar input[type=range] { --fill: #fff; height: 4px; }
.sonos-bar input[type=range]:hover { --fill: var(--green); }
.spk-vol input[type=range] { --fill: var(--ink); --track: #4d4d4d; height: 4px; }
input[type=range]::-webkit-slider-thumb { width: 12px; height: 12px; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; }
.sonos-bar.mini { left: 50%; right: auto; border-radius: 999px !important; --sb-bg: #282828; border-top-width: 2px; }
body.has-bar { padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }

/* Sheets and panels */
.sheet { background: var(--surface-2); }
.sheet::backdrop { background: rgb(0 0 0 / .7); }
.close-x { background: rgb(0 0 0 / .4); color: var(--ink); }
.st-list label { border-bottom-color: #3a3a3a; }
.st-list input, .opt input { accent-color: var(--green); }
.find, .home-net, .spk { background: #333; }
.add input, .add select { background: #3e3e3e; color: var(--ink); border: 0; border-radius: 6px; }
.spk-check input:checked + span { background: var(--green); border-color: var(--green); }
.spk-check input:checked + span::after { border-color: #000; }
.toast { background: var(--ink); color: var(--bg); border-radius: 8px; font-weight: 600; }
.skeleton { background: var(--surface); border: 0; }
.grid-wrap, .li, .card { outline: none; }

/* Phones: keep the header on one line */
@media (max-width: 420px) { .brand h1 { font-size: 20px; } .clock small { white-space: nowrap; } }

/* List view: a subtle rule after each hour heading, with a bit more air between hours */
.list h3 { display: flex; align-items: center; gap: 12px; margin: 26px 0 8px; }
.list h3:first-child, .more-btn + h3 { margin-top: 6px; }
.list h3::after { content: ''; flex: 1; height: 1px; background: #2a2a2a; }

/* Station reorder: lifted row */
.st-row.dragging { background: #3a3a3a; }

/* Track ID */
.id-btn { border: 1px solid #3a3a3a; color: var(--muted); }
.id-btn:hover { border-color: #555; background: #2a2a2a; }
.id-btn.busy { color: var(--green-soft); border-color: rgb(255 90 54 / .45); }
.tid { background: #242424; box-shadow: inset 0 0 0 1px #313131; }
.tid:hover { background: #2a2a2a; }
.sb-id.busy { color: var(--green-soft); }

/* Genre tags read from the description: same shape, quieter, so the station's own tags lead */
.genres.derived span { background: transparent; box-shadow: inset 0 0 0 1px #3a3a3a; color: var(--muted); font-weight: 500; }
