:root {
  --bg: #0c0d0f; --panel: #111214; --panel-2: #15171a;
  --text: #f5f6f7; --text-dim: #9aa3b2;
  --accent: #c7d2fe; --accent-2: #e0e7ff;
  --btn-bg: #e5e7eb; --btn-bg-hover: #f3f4f6; --btn-text: #111214; --btn-border: #2a2a2a;
  --border: #2a2a2a; --line: #1e1e1e;
  --green: #b0e8c4; --amber: #fbbf24; --red: #f87171;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { scrollbar-gutter: stable both-edges; overflow-y: scroll; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.45;
}

/* ── Topbar ── */
.site-header { position: sticky; top: 0; z-index: 100; }
.topbar {
  background: linear-gradient(180deg, rgba(12,13,15,.97) 0%, rgba(12,13,15,.92) 100%);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.topbar-content {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1.25rem; min-height: 48px;
}
.brand {
  font-family: 'Lilex', monospace; font-weight: 800; font-size: 1.15rem;
  color: var(--accent); text-decoration: none;
}
.brand:hover { color: var(--accent-2); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ── Station Shell ── */
.station-shell {
  max-width: 1400px; margin: 0 auto; padding: 1.25rem;
  display: grid; grid-template-columns: 1fr 340px; gap: 1.25rem;
  min-height: calc(100vh - 50px);
}

/* ── Cards ── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: .35rem; padding: 1.1rem 1.25rem;
}

.section-heading {
  font-family: 'Lilex', monospace; font-size: .85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); margin: 0 0 .75rem;
}
.subsection-heading {
  font-size: .8rem; font-weight: 600; color: var(--text-dim);
  margin: .75rem 0 .5rem; text-transform: uppercase; letter-spacing: .04em;
}

/* ── Now Playing ── */
.now-playing { margin-bottom: 0; }
.now-playing__status {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .75rem; font-size: .85rem; font-weight: 600;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.status-dot--live { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse-dot 2s ease-in-out infinite; }
.status-dot--scheduled { background: var(--amber); }
.status-dot--auto { background: var(--text-dim); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.status-label { color: var(--text-dim); }
.status-label--live { color: var(--green); }

.now-playing__info { margin-bottom: .75rem; }
.now-playing__title {
  font-size: 1.35rem; font-weight: 700; margin: 0; line-height: 1.3;
  color: var(--text);
}
.now-playing__creator {
  font-size: .95rem; color: var(--text-dim); margin: .2rem 0 0;
}

.now-playing__progress {
  display: flex; align-items: center; gap: .6rem;
  font-family: 'Lilex', monospace; font-size: .8rem; color: var(--text-dim);
}
.progress-bar {
  flex: 1; height: 4px; background: var(--border); border-radius: 2px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%; background: var(--accent); border-radius: 2px;
  width: 0%; transition: width .5s linear;
}

.now-playing__controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .75rem; gap: .75rem 1rem; flex-wrap: wrap;
}

/* ── Volume ── */
.volume-control { display: flex; align-items: center; gap: .4rem; }
.volume-slider {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 4px; background: var(--border); border-radius: 2px;
  outline: none; cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%; cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%; border: none; cursor: pointer;
}

/* ── Vote Strip ── */
.vote-strip { display: flex; align-items: center; gap: .35rem; }
.vote-score {
  font-family: 'Lilex', monospace; font-size: .9rem; font-weight: 700;
  min-width: 2ch; text-align: center; color: var(--text);
}
.btn-icon {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: .25rem; border-radius: .2rem;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.btn-icon:hover { color: var(--text); background: var(--panel-2); }
.vote-btn[aria-pressed="true"].vote-btn--up { color: var(--green); }
.vote-btn[aria-pressed="true"].vote-btn--down { color: var(--red); }

/* ── Queue List ── */
.queue-list {
  list-style: none; padding: 0; margin: 0;
}
.queue-list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 0; border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.queue-list li:last-child { border-bottom: none; }
.queue-empty { color: var(--text-dim); font-style: italic; }
.queue-pos {
  font-family: 'Lilex', monospace; font-size: .75rem;
  color: var(--text-dim); min-width: 1.5ch; text-align: right;
}
.queue-title { flex: 1; font-weight: 600; }
.queue-creator { color: var(--text-dim); font-size: .85rem; }
.queue-badge-requested {
  font-size: .7rem; padding: .1rem .4rem; border-radius: .2rem;
  background: rgba(199,210,254,.15); color: var(--accent);
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}

/* ── Request Section ── */
.search-input {
  width: 100%; padding: .6rem .9rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: .3rem;
  font-size: .9rem; outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-results {
  list-style: none; padding: 0; margin: .4rem 0 0;
  max-height: 240px; overflow-y: auto;
}
.search-results:empty { display: none; }
.search-result {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .6rem; border-bottom: 1px solid var(--line);
  font-size: .85rem; cursor: default;
}
.search-result:hover { background: var(--panel-2); }
.search-result__info { flex: 1; min-width: 0; }
.search-result__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result__creator { color: var(--text-dim); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result__btn {
  flex-shrink: 0; padding: .3rem .7rem; font-size: .75rem;
  background: var(--accent); color: var(--btn-text); border: none;
  border-radius: .2rem; font-weight: 700; cursor: pointer;
}
.search-result__btn:hover { background: var(--accent-2); }

.requests-list { list-style: none; padding: 0; margin: 0; }
.requests-list:empty::after {
  content: "No active requests"; color: var(--text-dim);
  font-style: italic; font-size: .85rem;
}
.request-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem 0; border-bottom: 1px solid var(--line);
  font-size: .85rem;
}
.request-item:last-child { border-bottom: none; }
.request-score {
  font-family: 'Lilex', monospace; font-weight: 700;
  color: var(--accent); min-width: 2.5ch; text-align: right;
  cursor: pointer;
}
.request-score:hover { color: var(--accent-2); }
.request-score::before { content: "▲ "; font-size: .7rem; }
.request-info { flex: 1; min-width: 0; }
.request-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-creator { color: var(--text-dim); font-size: .8rem; }

/* ── Sidebar ── */
.station-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.sidebar-chat { display: flex; flex-direction: column; flex: 1; min-height: 300px; }
.chat-channel-name { color: var(--text-dim); font-weight: 400; }
.chat-messages-mini {
  flex: 1; overflow-y: auto; font-size: .85rem;
  padding: .5rem 0; min-height: 0;
}
.chat-msg {
  padding: .15rem 0; line-height: 1.4;
}
.chat-msg__time {
  font-family: 'Lilex', monospace; font-size: .7rem; color: var(--text-dim);
  margin-right: .3rem;
}
.chat-msg__nick { font-weight: 700; margin-right: .3rem; }
.chat-msg__text { color: var(--text); }
.chat-msg--bot .chat-msg__text { color: var(--text-dim); font-style: italic; }

.chat-input-mini {
  display: flex; gap: .4rem; margin-top: .5rem;
  border-top: 1px solid var(--line); padding-top: .5rem;
}
.chat-field {
  flex: 1; padding: .45rem .7rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: .25rem;
  font-size: .85rem; outline: none;
}
.chat-field:focus { border-color: var(--accent); }
.btn {
  padding: .5rem .9rem; border-radius: .25rem;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-text);
  font-weight: 700; cursor: pointer; font-size: .8rem;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn-sm { padding: .4rem .7rem; font-size: .75rem; }

/* ── Show Notes ── */
.show-notes-content {
  font-size: .9rem; line-height: 1.5;
  color: var(--text); white-space: pre-wrap;
}
.show-notes-content .text-dim { color: var(--text-dim); margin: 0; }

/* ── Station Info ── */
.sidebar-info { padding: .75rem 1.25rem; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .25rem 0; font-size: .85rem;
}
.info-label { color: var(--text-dim); }
.info-value { font-weight: 600; font-family: 'Lilex', monospace; }

/* ── Mobile Chat Toggle ── */
.chat-toggle-fab {
  display: none; position: fixed; bottom: 1.25rem; right: 1.25rem;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: var(--btn-text); border: none;
  cursor: pointer; z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  align-items: center; justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .station-shell { grid-template-columns: 1fr; }
  .station-sidebar {
    position: fixed; top: 0; right: -100%; width: 90%; max-width: 380px;
    height: 100vh; z-index: 300; padding: 1.25rem;
    background: var(--bg); border-left: 1px solid var(--border);
    transition: right .25s ease; overflow-y: auto;
  }
  .station-sidebar.is-open { right: 0; }
  .chat-toggle-fab { display: flex; }
}

@media (max-width: 640px) {
  .station-shell { padding: .75rem; }
  .now-playing__title { font-size: 1.1rem; }
}

/* ── Play button overlay for autoplay policy ── */
.play-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,13,15,.85); backdrop-filter: blur(4px);
}
.play-overlay__btn {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent); color: var(--btn-text); border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(199,210,254,.3);
  transition: transform .15s;
}
.play-overlay__btn:hover { transform: scale(1.08); }
.play-overlay__btn svg { margin-left: 4px; }

/* ── Directory ── */
.directory-header {
  max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.directory-title {
  font-family: 'Lilex', monospace; font-size: 1.6rem; font-weight: 800; margin: 0;
}
.directory-grid {
  max-width: 1200px; margin: 0 auto; padding: 0 1.25rem 2rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem;
}
.station-card {
  display: block; text-decoration: none; color: var(--text);
  padding: 1.25rem; border-radius: 8px; transition: border-color .15s, background .15s;
}
.station-card:hover { border-color: var(--accent); background: var(--panel-2); }
.station-card__header { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; min-height: 1.2rem; }
.station-card__live { font-family: 'Lilex', monospace; font-size: .75rem; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .05em; }
.station-card__name { font-size: 1.15rem; font-weight: 700; margin: 0 0 .25rem; }
.station-card__genre { font-size: .85rem; color: var(--text-dim); margin: 0 0 .5rem; }
.station-card__meta { font-size: .8rem; color: var(--text-dim); display: flex; justify-content: space-between; }

/* ── Profile ── */
.profile-card {
  max-width: 600px; margin: 3rem auto; padding: 2rem;
}
.profile-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.profile-name { font-family: 'Lilex', monospace; font-size: 1.8rem; font-weight: 800; margin: 0; }
.profile-description { font-size: 1rem; color: var(--text-dim); margin: 0 0 1rem; }
.profile-meta { display: flex; gap: 1.5rem; font-size: .9rem; color: var(--text-dim); margin-bottom: 1.5rem; }
.profile-genre { font-weight: 600; color: var(--accent); }
.profile-schedule { margin-top: 1.5rem; }
.profile-offline { margin-top: 2rem; text-align: center; padding: 1.5rem; border-top: 1px solid var(--border); }
.profile-offline p:first-child { font-size: 1.05rem; font-weight: 600; }

/* ── Now Playing header (with share button) ── */
.now-playing__header { display: flex; align-items: center; justify-content: space-between; }

/* ── Share toast ── */
.share-toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--btn-text); padding: .5rem 1.25rem;
  border-radius: 6px; font-size: .9rem; font-weight: 600; z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* ── Create Station form ── */
.create-station {
  display: flex; align-items: center; justify-content: center; min-height: 80vh;
  padding: 2rem;
}
.create-station__inner { max-width: 480px; width: 100%; padding: 2rem; }
.create-station__inner h1 { font-family: 'Lilex', monospace; font-weight: 800; margin: 0 0 .25rem; }
.form-label {
  display: block; font-size: .85rem; font-weight: 600; color: var(--text-dim);
  margin-top: 1rem; margin-bottom: .25rem;
}
.form-label input, .form-label textarea { margin-top: .25rem; width: 100%; }
.slug-preview { display: flex; align-items: center; gap: .25rem; }
.slug-input { flex: 1; }
.slug-status { display: block; font-size: .8rem; margin-top: .25rem; color: var(--text-dim); }
.create-actions { margin-top: 1.5rem; text-align: right; }
