*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #202020;
  --border: #2a2a2a;
  --accent: #e05c2a;
  --accent-dim: #7a2e0e;
  --text: #c8c2b8;
  --text-dim: #6b6560;
  --player-h: 62px;
  --header-h: 50px;
  --filter-h: 42px;
}

html { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  height: 100%;
}

/* ── Promo banner ── */
.promo-banner {
  background: linear-gradient(90deg, #150a02, #241205, #150a02);
  border-bottom: 1px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 12px;
  flex-wrap: wrap;
}
.promo-banner.hidden { display: none; }
.promo-text { color: var(--text-dim); }
.promo-pay-btn {
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.promo-pay-btn:hover { opacity: 0.85; }
.promo-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  margin-left: 4px;
  transition: color 0.15s;
}
.promo-dismiss-btn:hover { color: var(--text); }

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

#searchInput {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
#searchInput:focus { border-color: var(--accent); }
#searchInput::placeholder { color: var(--text-dim); }

nav { display: flex; gap: 4px; flex-shrink: 0; }

.tab {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px 14px;
  font-size: 13px;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab:hover:not(.active) { border-color: var(--text-dim); color: var(--text); }

.support-tab { color: var(--accent); border-color: var(--accent-dim); }
.support-tab:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

.install-tab { color: var(--text); border-color: var(--text-dim); }

.hidden { display: none !important; }

.account-chip {
  color: var(--text);
  border-color: var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.account-chip:hover { border-color: var(--accent); }

.gold-badge {
  display: inline-block;
  background: linear-gradient(160deg, #f5c84c, #d99a1b);
  color: #2a1f04;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ── Filters ── */
.filters {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  display: flex;
  gap: 6px;
  padding: 6px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filters select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  max-width: 180px;
  transition: border-color 0.15s;
}
.filters select:focus { border-color: var(--accent); }

/* ── Station list ── */
main {
  padding: 0 0 calc(var(--player-h) + 8px);
}

.loading, .empty {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  font-size: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: calc(var(--header-h) + var(--filter-h));
  background: var(--surface);
  text-align: left;
  padding: 8px 12px;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 10;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:hover { background: var(--surface2); }
tbody tr.playing { background: #1b1108; }
tbody tr.playing td:first-child { border-left: 2px solid var(--accent); }

td { padding: 9px 12px; vertical-align: middle; }

.td-play { width: 40px; padding-right: 4px; }
.td-fav  { width: 36px; padding-left: 4px; }
.td-info { min-width: 160px; max-width: 280px; }
.td-country { width: 70px; }
.td-format  { width: 110px; }
.td-tags    { max-width: 200px; }
.td-clicks  { width: 70px; text-align: right; }

.station-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.station-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  margin: 1px 2px 1px 0;
  white-space: nowrap;
}
.badge-codec   { background: #0e2228; color: #6bc; border: 1px solid #1a3d4a; }
.badge-bitrate { background: #0e220e; color: #8b8; border: 1px solid #1a3d1a; }
.badge-tag     { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }

.country-text { color: var(--text-dim); font-size: 12px; }
.clicks-text  { color: var(--text-dim); font-size: 12px; }

.play-row-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.play-row-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
tr.playing .play-row-btn { background: var(--accent); border-color: var(--accent); color: #fff; }

.fav-row-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
}
.fav-row-btn:hover { color: var(--accent); }
.fav-row-btn.saved { color: var(--accent); }

.load-more {
  display: block;
  margin: 20px auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 9px 36px;
  font-size: 13px;
  transition: all 0.15s;
}
.load-more:hover { border-color: var(--accent); color: var(--accent); }

/* ── Player ── */
.player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--player-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 200;
}
.player.hidden { display: none; }

.play-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.play-btn:hover { opacity: 0.85; }

.player-info { flex: 1; min-width: 0; overflow: hidden; }

.player-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  min-height: 15px;
  margin-top: 2px;
  width: min(280px, 100%);
}

.player-track span { display: inline-block; }

.player-track.scrolling {
  color: #ffd54a;
}

.player-track.scrolling span {
  padding-left: 100%;
  animation: marquee var(--marquee-dur, 12s) linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

.player-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#volume {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}

.fav-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  transition: color 0.15s;
}
.fav-btn:hover { color: var(--accent); }
.fav-btn.saved { color: var(--accent); }

/* ── Support modal ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
}
.overlay.hidden { display: none; }

.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 26px 24px;
  max-width: 440px;
  width: 100%;
}

.modal h2 {
  font-size: 17px;
  margin-bottom: 14px;
  color: var(--accent);
}

.modal p { line-height: 1.5; margin-bottom: 14px; }

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }

.email-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.email-box span {
  flex: 1;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  color: #ffd54a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: var(--accent);
  border: none;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  padding: 6px 14px;
  font-size: 12px;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.copy-btn:hover { opacity: 0.85; }

.support-note {
  font-size: 12px;
  color: var(--text-dim);
}
.modal p:last-child { margin-bottom: 0; }

/* ── Auth & account ── */
.auth-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text-dim); }

.pw-row { position: relative; }
.pw-row .auth-input { padding-right: 56px; }
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 9px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }

.auth-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.auth-error {
  color: #e06c5c;
  font-size: 12px;
  min-height: 16px;
  margin-bottom: 10px;
}

.auth-submit { width: 100%; padding: 9px 14px; font-size: 13px; }

.auth-switch {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.auth-switch a { color: var(--accent); text-decoration: none; }

.account-actions { display: flex; flex-direction: column; gap: 8px; }
.account-action {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  padding: 9px 14px;
  font-size: 13px;
  text-align: left;
  transition: border-color 0.15s;
  width: 100%;
}
.account-action:hover { border-color: var(--accent); }
.account-action.danger { color: #e06c5c; }
.account-action.danger:hover { border-color: #e06c5c; }
#accountForm .account-action { margin-top: 8px; text-align: center; }

/* ── Toast notification ── */
.toast-bar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a3a1a;
  border: 1px solid #3a6b3a;
  color: #8ecc8e;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 500;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.4s;
}
.toast-bar.hidden { display: none; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .td-country, .td-tags, .td-clicks { display: none; }
  #volume { display: none; }
  .filters select { flex: 1 1 calc(50% - 3px); max-width: none; }
}
