/* ============ Токени и теми ============ */
/*
   Тъмна тема (по подразбиране, без нужда от data-theme атрибут) +
   3 светли теми, превключваеми чрез <html data-theme="...">:
     - daylight  ("Дневна")   - топла хартиено-бежова, амбър напред
     - mint      ("Мента")    - хладна светла, тийл напред
     - sand      ("Пясък")    - топла пясъчна/теракота, за авто режим през деня
   Всеки компонент по-долу чете само семантични променливи
   (--accent, --on-accent, --sunken, --backdrop...), затова темите
   могат напълно да разменят кои цветове са "основни", без да се
   пипа нито един селектор извън този блок.
*/
:root {
  --ink: #12141c;
  --panel: #1b1e29;
  --line: #2c3040;
  --text: #eae7de;
  --text-dim: #9a9aa5;
  --danger: #e2645a;

  --accent: #e8a33d;         /* амбър - основен акцент */
  --accent-glow: #ffcf7d;
  --on-accent: #241a05;      /* текст върху accent фон */
  --accent-2: #3fa9a0;       /* тийл - вторичен акцент */
  --on-accent-2: #06211f;    /* текст върху accent-2 фон */

  --sunken: #10121a;         /* фон на лога/album-art placeholder-и */
  --ad-stripe-a: #191c26;
  --ad-stripe-b: #1d212d;
  --backdrop: rgba(8, 9, 13, 0.7);
  --tuner-glow: rgba(232, 163, 61, 0.13);

  --font-display: 'Fraunces', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 14px;

  /* Височина на фиксирания плейър бар + просвет, за да не покрива
     последното съдържание на страницата. Всички места, зависещи от
     височината му, четат оттук - иначе лесно се разминават. */
  --player-height: 84px;
  --player-gap: 28px;
}

/* ---- "Дневна" - топла хартиена, амбър напред (светла версия на тъмната) ---- */
[data-theme="daylight"] {
  --ink: #f7f2e6;
  --panel: #ffffff;
  --line: #e4dcc7;
  --text: #241f14;
  --text-dim: #8a8168;
  --danger: #c94a3f;

  --accent: #b3701c;
  --accent-glow: #d99b45;
  --on-accent: #fff8ec;
  --accent-2: #1f7d74;
  --on-accent-2: #eafaf7;

  --sunken: #ece4d2;
  --ad-stripe-a: #efe8d8;
  --ad-stripe-b: #e7dec8;
  --backdrop: rgba(40, 32, 15, 0.35);
  --tuner-glow: rgba(179, 112, 28, 0.08);
}

/* ---- "Мента" - хладна светла, тийл напред ---- */
[data-theme="mint"] {
  --ink: #f3f7f6;
  --panel: #ffffff;
  --line: #dbe6e3;
  --text: #14211f;
  --text-dim: #6b7c79;
  --danger: #c94a3f;

  --accent: #1f8f82;
  --accent-glow: #35b0a0;
  --on-accent: #eafaf7;
  --accent-2: #c47f22;
  --on-accent-2: #fff8ec;

  --sunken: #e3ece9;
  --ad-stripe-a: #eef4f2;
  --ad-stripe-b: #e2ece9;
  --backdrop: rgba(10, 24, 21, 0.35);
  --tuner-glow: rgba(31, 143, 130, 0.08);
}

/* ---- "Пясък" - топла пясъчна/теракота, четима на директна светлина (авто) ---- */
[data-theme="sand"] {
  --ink: #f5ece0;
  --panel: #fffaf3;
  --line: #e6d3ba;
  --text: #2a1d12;
  --text-dim: #8a725a;
  --danger: #b8402f;

  --accent: #c1552e;
  --accent-glow: #e07a4c;
  --on-accent: #fff3ea;
  --accent-2: #2f6e5c;
  --on-accent-2: #eafaf5;

  --sunken: #ecdcc6;
  --ad-stripe-a: #f2e4d0;
  --ad-stripe-b: #e9d7bc;
  --backdrop: rgba(42, 29, 18, 0.4);
  --tuner-glow: rgba(193, 85, 46, 0.08);
}

* { box-sizing: border-box; }
/* min-height, а НЕ height: при фиксирана височина 100% отстъпът
   padding-bottom се смества вътре в екрана и не създава място под
   преливащото съдържание - последната секция оставаше под плейъра. */
html { height: 100%; }
body { min-height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  padding-bottom: calc(var(--player-height) + var(--player-gap)); /* място за плейъра */
  position: relative;
  transition: background-color .2s ease, color .2s ease;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Амбиентно сияние във фона - намек за тунер, което свети зад стрелката */
.tuner-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--tuner-glow) 0%, rgba(0,0,0,0) 65%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

/* ============ Топ бар ============ */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: block; align-self: center; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 0; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.3px;
}
.brand-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.brand-freq {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
}

.search {
  flex: 1 1 240px;
  min-width: 220px;
  max-width: 480px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel);
}
.search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.search button {
  flex-shrink: 0;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  padding: 0 20px;
  cursor: pointer;
  font-family: var(--font-body);
}

.auth-area { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.auth-greeting {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.topbar-controls { display: flex; align-items: center; gap: 10px; }
.theme-select {
  width: auto;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
#btnCarMode.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost:hover { background: var(--panel); }
.btn.solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.solid:hover { background: var(--accent-glow); }
.btn.full { width: 100%; }

/* ============ Реклами ============ */
.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, var(--ad-stripe-a), var(--ad-stripe-a) 10px, var(--ad-stripe-b) 10px, var(--ad-stripe-b) 20px);
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
}
.ad-label { opacity: .6; letter-spacing: 1px; text-transform: uppercase; }
.ad-top { max-width: 1200px; margin: 18px auto 0; height: 90px; }
.ad-side { height: 250px; margin-top: 24px; }

/* Ако AdSense не успее да напълни конкретна реклама, скрива мястото
   автоматично - препоръчаното от Google CSS правило. */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ============ Оформление ============ */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 260px;
  gap: 32px;
  padding: 28px 32px 40px;
}

.sidebar { display: flex; flex-direction: column; }

.loudness-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.loudness-row label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.loudness-row input[type="range"] { flex: 1; max-width: 260px; accent-color: var(--accent); }
.loudness-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  min-width: 48px;
}
.loudness-hint { margin-top: 8px; margin-bottom: 0; font-size: 12px; }

/* ============ Поправка на етикети ============ */
.tag-cover-row { display: flex; align-items: center; gap: 12px; }
.tag-cover-preview {
  width: 64px; height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--sunken);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.tag-cover-btn { cursor: pointer; }
.tag-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.station-card .card-edit {
  position: absolute;
  top: 10px; right: 10px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 14px; cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
}
.station-card .card-edit:hover { color: var(--text); background: var(--ink); }

/* Трета колона с описание на услугата: нужна е на търсачките, но
   стои отстрани, за да не измества съдържанието надолу. */
.side-info { min-width: 0; }

.seo-intro {
  margin: 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: sticky;
  top: 24px;
}
.seo-intro h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 20px 0 6px;
}
.seo-intro h2:first-child { margin-top: 0; }
.seo-intro p { margin: 0 0 10px; }

/* Страница на отделна станция (сервира се от сървъра за търсачките) */
.station-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  line-height: 1.7;
}
.station-page h1 { font-family: var(--font-display); font-size: 30px; margin: 0 0 6px; }
.station-page-meta { color: var(--text-dim); margin: 0 0 22px; }
.station-page-back { margin: 0 0 28px; }
.station-page a { color: var(--accent); }

.country-page-list { list-style: none; padding: 0; margin: 24px 0; }
.country-page-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px;
}
.country-page-tags { color: var(--text-dim); font-size: 12px; }

/* ============ Локална музика ============ */
.local-picker {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.local-hint {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}
.local-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.local-file-label { cursor: pointer; }
.local-status {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  min-height: 16px;
}

/* Записът за локална песен - показва албума вместо държава/жанр */
.track-album { font-size: 12px; color: var(--text-dim); }

/* ============ Обложка на албума ============ */
.album-art {
  /* Ограничена ширина + центриране: в авто режим и на телефон
     страничната колона се разпъва на цялата ширина, а квадратът
     "1:1" би станал огромен, ако беше само width:100%.
     width:100% е задължително - "margin: 0 auto" върху flex елемент
     изключва разтягането и панелът се свива до нищо без него. */
  width: 100%;
  max-width: 240px;
  margin: 0 auto 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Квадратна рамка - вътре стои или истинската обложка, или
   резервният панел; и двете я запълват изцяло. */
.album-art-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--sunken);
  overflow: hidden;
}
.album-art-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Рекламно място вътре в квадрата за обложка */
.album-art-ad {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
}
/* Когато има реклама, надписът "Реклама" се смъква най-долу, за да
   не се застъпва с рекламния блок. */
.album-art-fallback.behind-ad { align-items: flex-end; padding-bottom: 10px; }
.album-art-fallback.behind-ad .fallback-bars { opacity: 0.06; }
.album-art-fallback.behind-ad .fallback-text { position: relative; z-index: 3; }
.album-art-fallback.behind-ad .fallback-title { display: none; }

/* ---- Резервен панел, когато няма намерена обложка ---- */
.album-art-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 45%, rgba(232, 163, 61, 0.10), transparent 65%),
    var(--panel);
}

/* Еквалайзерният мотив от логото, силно избледнял - разпознаваем е,
   но не се бие с текста отгоре. */
.fallback-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10%;
  opacity: 0.14;
}
.fallback-bars span {
  width: 11%;
  border-radius: 999px;
  background: var(--accent);
}
.fallback-bars span:nth-child(1) { height: 30%; }
.fallback-bars span:nth-child(2) { height: 50%; background: var(--accent-2); }
.fallback-bars span:nth-child(3) { height: 36%; background: var(--accent-glow); }

.fallback-text {
  position: relative;
  text-align: center;
  line-height: 1.35;
  overflow-wrap: anywhere;
  max-height: 100%;
  overflow: hidden;
}
.fallback-artist {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.fallback-title {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 10px;
}

.album-art-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.album-art-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-art-artist {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tabs { display: flex; gap: 6px; margin-bottom: 26px; background: var(--panel); padding: 4px; border-radius: 999px; }
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.tab.active { background: var(--accent); color: var(--on-accent); }

.filter-group { margin-bottom: 26px; }
.filter-group h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.chip.active { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent-2); }

select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
}

/* ============ Съдържание ============ */
.content-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.content-head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  margin: 0;
}
.freq-readout {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
}

.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.station-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
  position: relative;
}
.station-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.station-card.playing { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2) inset; }

.station-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--sunken);
  object-fit: cover;
  flex-shrink: 0;
}
.station-info { min-width: 0; }
.station-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-sub {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-website {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--accent-2);
  text-decoration: none;
}
.station-website:hover { text-decoration: underline; }
.station-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}
.station-fav.active { color: var(--accent); }

.live-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 2px;
}

.empty-state { text-align: center; color: var(--text-dim); padding: 60px 0; }
.hidden { display: none !important; }

.scroll-sentinel { height: 1px; }
.loading-more {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 16px 0;
}

/* In-feed реклама сред станциите */
.ad-infeed {
  grid-column: 1 / -1;
  height: 70px;
}

/* ============ Плейър ============ */
.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 20px;
  height: var(--player-height);
  padding: 0 24px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.dial-indicator {
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: sweep 6s ease-in-out infinite;
  opacity: .5;
}
@keyframes sweep {
  0%, 100% { left: 0%; }
  50% { left: 100%; }
}

.now-playing { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-logo { width: 44px; height: 44px; border-radius: 8px; background: var(--sunken); object-fit: cover; }
.np-text { display: flex; flex-direction: column; min-width: 0; }
.np-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.np-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-website {
  flex-shrink: 0;
  font-size: 12px;
  text-decoration: none;
  opacity: .7;
}
.np-website:hover { opacity: 1; }
.np-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.np-live {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.player-controls { display: flex; align-items: center; gap: 16px; justify-self: center; }
.play-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  cursor: pointer;
}
.play-btn:hover { background: var(--accent-glow); }

.visualizer { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.visualizer span {
  width: 3px;
  background: var(--accent-2);
  border-radius: 2px;
  height: 6px;
}
.visualizer.playing span { animation: bar 900ms ease-in-out infinite; }
.visualizer span:nth-child(1) { animation-delay: 0ms; }
.visualizer span:nth-child(2) { animation-delay: 120ms; }
.visualizer span:nth-child(3) { animation-delay: 240ms; }
.visualizer span:nth-child(4) { animation-delay: 360ms; }
.visualizer span:nth-child(5) { animation-delay: 480ms; }
@keyframes bar {
  0%, 100% { height: 6px; }
  50% { height: 20px; }
}

.player-side { display: flex; align-items: center; gap: 14px; }
.icon-btn { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; }
.icon-btn.active { color: var(--accent); }
#volume { width: 90px; accent-color: var(--accent); }

/* ============ Модал ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--backdrop);
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
}
.modal {
  position: relative;
  width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--text-dim);
  font-size: 16px; cursor: pointer;
}
.modal-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.modal-tab {
  flex: 1;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.modal-tab.active { color: var(--text); border-color: var(--accent); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px; }
.auth-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
.form-error { color: var(--danger); font-size: 12px; min-height: 14px; margin: 0; }

/* ============ Форма за връзка ============ */
.contact-btn { width: 100%; margin-top: 4px; }

.modal-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 6px;
}
.modal-intro {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 18px;
  line-height: 1.5;
}
.auth-form textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  resize: vertical;
  min-height: 110px;
}
.form-success { color: var(--accent-2); font-size: 13px; margin: 0; }

/* Honeypot - скрит за хора, но попълван от ботове. Умишлено НЕ
   ползваме display:none, защото част от ботовете го разпознават и
   прескачат полето; изнасянето извън екрана е по-надеждно. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-size: 13px !important;
  color: var(--text) !important;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ============ История на песните ============ */
.history-panel { margin-top: 36px; }
.history-panel h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 14px;
}
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.history-list li:nth-child(odd) { background: var(--panel); }
.history-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-time { color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; flex-shrink: 0; white-space: nowrap; }

/* ============ Свързани станции ============ */
.related-stations { margin-top: 36px; }
.related-stations h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 14px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.related-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color .15s ease;
}
.related-card:hover { border-color: var(--accent); }
.related-card img {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--sunken);
  object-fit: cover;
  flex-shrink: 0;
}
.related-card span {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ Респонсив: таблет ============ */
/* По-широки таблети/лендскейп екрани в кола запазват страничния
   панел, но с по-едри контроли за пипане с пръст. */
@media (min-width: 601px) and (max-width: 1180px) {
  .btn { padding: 11px 18px; font-size: 14px; }
  .tab { padding: 12px 0; font-size: 14px; }
  .chip { padding: 9px 16px; font-size: 13px; }
  .station-fav { font-size: 20px; }
  .icon-btn { font-size: 22px; }
  .play-btn { width: 52px; height: 52px; font-size: 18px; }
  .stations-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
}

/* Портретни таблети - недостатъчно широко за странична колонка */
@media (max-width: 1024px) and (orientation: portrait) {
  .layout { grid-template-columns: 1fr; }
  /* Под съдържанието, а не над него - това е допълнителен текст. */
  .side-info { order: 3; }
  .seo-intro { position: static; margin-top: 8px; }
  .sidebar { order: 2; }
}

/* ============ Респонсив: телефон ============ */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side-info { order: 3; }
  .seo-intro { position: static; margin-top: 8px; }
  .sidebar { order: 2; }
  .ad-side { display: none; }
  .topbar { gap: 10px 12px; }
  .player { grid-template-columns: auto 1fr auto; }
  .player-side { display: none; }
  .np-live { max-width: 140px; }
}

/* ============ Авто режим ============ */
/* Ръчно превключваем режим за таблет, монтиран като авторадио, или
   за шофиране изобщо: по-едри бутони за пипане без да гледаш,
   по-едър шрифт за четимост от разстояние, и без реклами/филтри,
   които разсейват вниманието. */
body.car-mode { --player-height: 148px; }
body.car-mode .tuner-glow,
body.car-mode .ad-top,
body.car-mode .ad-side,
body.car-mode .ad-infeed,
body.car-mode .filter-group {
  display: none !important;
}

body.car-mode .layout { grid-template-columns: 1fr; padding: 20px 24px 32px; }
body.car-mode .side-info { display: none; }
body.car-mode .sidebar { order: 0; }

/* В авто режим обложката се гледа отдалеч, затова е поне колкото в
   обичайния изглед - по-скоро малко по-голяма. Текстът също расте,
   за да се чете от разстояние. */
body.car-mode .album-art { max-width: 260px; }

/* Само на нисък екран (напр. 1024x600 в кола) обложката се смалява:
   иначе изтласква табовете под плейъра и се налага скролиране, за да
   се стигне до тях - точно каквото не искаш, докато шофираш. */
@media (max-height: 700px) {
  body.car-mode .album-art { max-width: 140px; }
  body.car-mode .fallback-artist { font-size: 14px; }
  body.car-mode .fallback-title { font-size: 12px; margin-top: 8px; }
}
body.car-mode .fallback-artist { font-size: 17px; }
body.car-mode .fallback-title { font-size: 14px; margin-top: 10px; }
body.car-mode .album-art-title { font-size: 15px; }
body.car-mode .album-art-artist { font-size: 14px; }
body.car-mode .tabs { max-width: 520px; margin: 0 auto 22px; }
body.car-mode .tab { padding: 16px 0; font-size: 16px; }

body.car-mode .content-head h1 { font-size: 24px; }
body.car-mode .stations-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
body.car-mode .station-card { padding: 20px; gap: 16px; }
body.car-mode .station-logo { width: 72px; height: 72px; border-radius: 14px; }
body.car-mode .station-name { font-size: 19px; }
body.car-mode .station-sub { font-size: 15px; }
body.car-mode .station-fav { font-size: 26px; top: 16px; right: 16px; }

body.car-mode .player { padding: 0 32px; gap: 28px; }
body.car-mode .player-logo { width: 80px; height: 80px; border-radius: 16px; }
body.car-mode .np-name { font-size: 24px; }
body.car-mode .np-meta { font-size: 15px; }
body.car-mode .np-live { font-size: 16px; max-width: 480px; }
body.car-mode .np-website { font-size: 20px; }
body.car-mode .player-controls { gap: 24px; }
body.car-mode .play-btn { width: 84px; height: 84px; font-size: 30px; }
body.car-mode .visualizer { height: 32px; }
body.car-mode .visualizer span { width: 5px; }
body.car-mode .player-side { display: flex; }
body.car-mode .icon-btn { font-size: 30px; }
body.car-mode #volume { width: 140px; height: 28px; }

/* ============ Back to top ============ */
.back-to-top {
  position: fixed;
  left: 20px;
  bottom: calc(var(--player-height) + 20px);
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, background .15s ease;
  pointer-events: none;
}
.back-to-top:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }



@media (max-width: 860px) {
  .back-to-top { left: 14px; }
  body.car-mode { --player-height: 128px; }
  body.car-mode .player { grid-template-columns: auto 1fr auto; }
}

/* Средни екрани: третата колона не се събира удобно, затова минава
   под съдържанието вместо да стеснява станциите. */
@media (min-width: 861px) and (max-width: 1200px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .side-info { grid-column: 1 / -1; }
  .seo-intro { position: static; }
}

/* ============ Системен панел ============ */
.admin-page { max-width: 940px; margin: 0 auto; padding: 32px 24px 80px; }
.admin-gate { text-align: center; padding: 60px 0; }
.admin-gate h1 { font-family: var(--font-display); font-weight: 500; }

.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.admin-card h2 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 500;
  margin: 0 0 16px;
}
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.admin-card-head h2 { margin: 0; }

.admin-badge {
  font-family: var(--font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ink); color: var(--text-dim);
  border: 1px solid var(--line);
}
.badge-ok { color: var(--accent-2); border-color: var(--accent-2); }
.badge-warn { color: var(--accent); border-color: var(--accent); }
.badge-error { color: var(--danger); border-color: var(--danger); }

.admin-facts { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.admin-facts dt { color: var(--text-dim); }
.admin-facts dd { margin: 0; overflow-wrap: anywhere; }
.admin-facts code { font-family: var(--font-mono); font-size: 12px; }

.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.admin-note { font-size: 12px; color: var(--text-dim); margin: 12px 0 0; line-height: 1.5; }

.admin-output {
  margin: 16px 0 0;
  padding: 14px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left; font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim);
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-table code { font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 640px) {
  .admin-facts { grid-template-columns: 1fr; gap: 2px 0; }
  .admin-facts dd { margin-bottom: 10px; }
}

/* Посещения в админ панела */
.visit-totals { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 20px; }
.visit-total { min-width: 130px; }
.visit-total .value { font-family: var(--font-display); font-size: 26px; display: block; }
.visit-total .label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
}
.admin-subhead {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
  margin: 22px 0 10px; font-weight: 400;
}
.visit-countries { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.visit-country {
  background: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
}
.visit-country b { color: var(--accent); font-weight: 600; }
.report-toggle { margin-top: 22px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.admin-note-inline { color: var(--text-dim); font-size: 12px; }

/* Забравена парола */
.auth-forgot { text-align: center; margin: 14px 0 0; font-size: 13px; }
.auth-forgot a { color: var(--text-dim); }
.auth-forgot a:hover { color: var(--accent); }
.auth-hint { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.form-success { color: var(--accent-2); font-size: 13px; min-height: 0; margin: 4px 0; }
