/* Station page. A theme = values of the variables below; station.js may override
   --accent / --bg from owner settings and picks --on-accent / --accent-text for contrast. */

:root, [data-theme="rock"] {
  --bg: #111111; --hero: #1a1a1a; --surface: #222222;
  --text: #f2f2f2; --muted: #ababab; --line: #3a3a3a;
  --accent: #e3392a; --on-accent: #ffffff; --accent-text: #ff6a5c;
  --display: 'Oswald', sans-serif;
  color-scheme: dark;
}
[data-theme="pop80"] {
  --bg: #160f2e; --hero: #21184a; --surface: #2c2160;
  --text: #f4f0ff; --muted: #bfb5e6; --line: #4a3d85;
  --accent: #ff5fae; --on-accent: #1a0b1f; --accent-text: #ff5fae;
  --display: 'Russo One', sans-serif;
  color-scheme: dark;
}
[data-theme="zero"] {
  --bg: #f4f2ee; --hero: #e6ecff; --surface: #ffffff;
  --text: #1b1a22; --muted: #57525f; --line: #d3d0da;
  --accent: #1f4fd8; --on-accent: #ffffff; --accent-text: #1f4fd8;
  --display: 'Comfortaa', sans-serif;
  color-scheme: light;
}
[data-theme="light"] {
  --bg: #f6f6f4; --hero: #ececea; --surface: #ffffff;
  --text: #18181b; --muted: #55555c; --line: #d6d6d9;
  --accent: #0b6e4f; --on-accent: #ffffff; --accent-text: #0b6e4f;
  --display: 'Golos Text', sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #121316; --hero: #1b1d21; --surface: #24262b;
  --text: #f1f1f3; --muted: #a9abb3; --line: #383b42;
  --accent: #3fb68b; --on-accent: #0b1a14; --accent-text: #3fb68b;
  --display: 'Golos Text', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-image, none);
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.4 'Golos Text', system-ui, -apple-system, sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
a:hover, .btn-link:hover { opacity: .8; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
svg { display: block; flex-shrink: 0; }

.muted { color: var(--muted); font-size: 13px; }
.hint  { color: var(--muted); font-size: 13px; margin: 0; }
.label {
  margin: 0;
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted);
}
.label-accent { color: var(--accent-text); }

/* ── Buttons ── */
.btn {
  min-height: 44px; padding: 0 16px;
  border-radius: 12px; font-size: 15px; font-weight: 600;
}
.btn-accent  { border: none; background: var(--accent); color: var(--on-accent); }
.btn-outline { border: 1px solid var(--line); background: transparent; }
.btn-link {
  border: none; background: none; padding: 0; min-height: 44px;
  text-decoration: underline; color: inherit; font-size: inherit;
}

/* ── Demo banner ── */
.demo-banner {
  padding: 10px 16px; text-align: center; font-size: 14px; font-weight: 600;
  background: var(--accent); color: var(--on-accent);
}

/* ── Layout: phone first ── */
.page { max-width: 640px; margin: 0 auto; }

.player-col {
  background: var(--hero);
  padding: 20px 20px 24px;
  display: flex; flex-direction: column; gap: 18px;
}

.station { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent) center / cover no-repeat; color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font: 22px var(--display);
}
.station-text { min-width: 0; }
.station-name { margin: 0; font: 22px/1.1 var(--display); }
.station-tagline { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.cover { display: none; }

.now { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.now-title  { font-size: 24px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.now-artist { font-size: 16px; color: var(--muted); }

.player { display: flex; align-items: center; gap: 16px; }
.play {
  width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; border: none;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
}
.volume { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.volume label { font-size: 12px; color: var(--muted); }
.volume input { width: 100%; accent-color: var(--accent); min-height: 24px; }
.listeners { font-size: 12px; color: var(--muted); text-align: right; max-width: 72px; }

.votes { display: flex; flex-direction: column; gap: 8px; }
.vote-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vote {
  min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: transparent;
  font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.vote[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.votes-caption { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

.content {
  padding: 24px 20px 32px;
  display: flex; flex-direction: column; gap: 28px;
}
.block { display: flex; flex-direction: column; gap: 10px; }

.search { display: flex; flex-direction: column; gap: 10px; }
.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-size: 15px;
}
.search-row input::placeholder { color: var(--muted); }
.search-row .btn { height: 48px; }
.search-results { display: flex; flex-direction: column; gap: 4px; }
.search-results .btn-link { align-self: flex-start; font-size: 13px; color: var(--muted); }
.recommend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── Song rows ── */
.list { display: flex; flex-direction: column; gap: 8px; }
.song { display: flex; align-items: center; gap: 12px; min-width: 0; }
.song-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.song-title  { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-artist { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-likes  { font-size: 13px; color: var(--muted); white-space: nowrap; }
.song-rank   { width: 28px; text-align: center; font: 20px var(--display); color: var(--accent-text); flex-shrink: 0; }

.list-lines { gap: 0; }
.list-lines .song { padding: 6px 0; border-bottom: 1px solid var(--line); }
.list-ranked .song { padding: 2px 0; }
.list-ranked .song-title { font-weight: 600; }
.list-cards .song { padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--surface); }
.list-dashed .song { background: transparent; border: 1px dashed var(--line); }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* ── Order button (spec §5) ── */
.order {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--accent-text); background: transparent; color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
}
.order[data-state="now"]:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.order[data-state="paused"]    { border-style: dashed; }
.order[data-state="requested"] { border-color: var(--line); color: var(--muted); cursor: default; }
.order[data-state="limit"]     { border-color: var(--line); color: var(--muted); opacity: .6; cursor: not-allowed; }

/* ── Footer ── */
.footer {
  margin: 0 20px; padding: 12px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  display: flex; flex-direction: column; gap: 4px;
}
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer .btn-link { text-decoration: none; font-size: 13px; color: inherit; }

/* ── Phone sticky mini player ── */
.mini-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 6px 12px; background: var(--hero); border-bottom: 1px solid var(--line);
  transform: translateY(-110%); transition: transform .2s;
}
.mini-bar.shown { transform: none; }
.mini-play, .mini-like {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mini-play { border: none; background: var(--accent); color: var(--on-accent); }
.mini-like { border: 1px solid var(--line); background: transparent; }
.mini-like[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mini-song { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Modal and toast ── */
.modal {
  width: min(420px, calc(100% - 32px)); padding: 24px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text);
}
.modal::backdrop { background: rgba(0, 0, 0, .6); }
.modal h2 { margin: 0 0 16px; font: 20px var(--display); }
.modal form { display: flex; flex-direction: column; gap: 6px; }
.modal label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.modal input, .modal textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); font-size: 15px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

/* ── Tablet: phone layout, wider column ── */
@media (min-width: 768px) {
  .player-col { border-radius: 0 0 20px 20px; }
}

/* ── Desktop: sticky player column + scrolling lists ── */
@media (min-width: 1024px) {
  .page {
    max-width: 1200px; padding: 0 40px;
    display: grid; grid-template-columns: 400px minmax(0, 1fr); column-gap: 40px;
  }
  .mini-bar { display: none; }
  .player-col {
    position: sticky; top: 0; align-self: start;
    max-height: 100vh; overflow-y: auto;
    background: transparent; padding: 32px 0; border-radius: 0;
  }
  .cover {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1; max-height: 300px; border-radius: 16px;
    background: var(--surface) center / cover no-repeat;
    font: 96px var(--display); color: var(--accent-text);
  }
  .votes-caption { text-align: left; }
  .content { padding: 32px 0; }
  .block-order     { order: 1; }
  .block-new       { order: 2; }
  .block-underrated{ order: 3; }
  .block-top       { order: 4; }
  .block-recent    { order: 5; }
  .search { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .search .label { width: 100%; }
  .search-row { flex: 1; }
  .footer { grid-column: 1 / -1; margin: 0; flex-direction: row; justify-content: space-between; align-items: center; }
}
