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

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top right, #231938, #120f1c 65%);
  color: #f4effc;
}

/* Скроллбар */
body::-webkit-scrollbar { width: 6px; }
body::-webkit-scrollbar-track { background: #120f1c; }
body::-webkit-scrollbar-thumb { background: #4e3a6f; border-radius: 999px; }
body::-webkit-scrollbar-thumb:hover { background: #a366ff; }

/* Основной адаптивный контейнер */
.app {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px;
}

/* Шапка */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-icon {
  width: 28px; height: 28px;
  border-radius: 8px; object-fit: cover;
  image-rendering: pixelated;
  box-shadow: 0 2px 8px rgba(179, 102, 255, 0.3);
}

.brand-name {
  font-weight: 700; font-size: 17px;
  color: #dbb2ff; letter-spacing: 0.3px;
}

.tabs {
  display: flex; background: #1b1529; padding: 3px;
  border-radius: 10px; border: 1px solid #2e2445;
}

.tab-btn {
  background: transparent; border: none; color: #a99bc2;
  padding: 6px 14px; border-radius: 7px; font-size: 13px;
  font-weight: 500; cursor: pointer; transition: 0.2s;
}

.tab-btn:hover { color: #fff; }
.tab-btn.active {
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  color: #fff; box-shadow: 0 2px 8px rgba(142, 68, 173, 0.35);
}

.pwa-install-btn {
  background: #271a3f;
  border: 1px dashed #a855f7;
  color: #e0b0ff;
  font-weight: 600;
}
.pwa-install-btn:hover {
  background: #4a2179;
  border-color: #ffd166;
  color: #fff;
}
.pwa-install-btn.hidden { display: none !important; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Карточка текущего эфира */
.now-playing {
  background: linear-gradient(145deg, #211934, #181326);
  border: 1px solid #352952; border-radius: 16px;
  padding: 16px 18px; margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.now-playing.live {
  border-color: #a855f7;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.22);
}

.now-playing-top {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 10px;
}

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: #bba7db;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #6f5f8a; transition: 0.2s;
}

.now-playing.live .live-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.now-playing.live .live-badge { color: #86efac; }

.volume-percent {
  font-size: 11px; color: #a796c3; font-weight: 600;
}

.station-title {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.station-subtitle {
  font-size: 12px; color: #9f91b8; margin-bottom: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.controls {
  display: flex; align-items: center; gap: 12px;
}

.primary-btn {
  flex: 1; border: none; border-radius: 12px;
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff; box-shadow: 0 3px 14px rgba(124, 58, 237, 0.4);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.primary-btn:hover { filter: brightness(1.1); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn.playing {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 3px 14px rgba(220, 38, 38, 0.4);
}

.volume-box {
  display: flex; align-items: center; gap: 6px;
  background: #191325; border: 1px solid #302449;
  padding: 6px 10px; border-radius: 10px;
}

.icon-btn {
  background: transparent; border: none; font-size: 14px;
  cursor: pointer; color: #d8c8f0; line-height: 1;
}

#volume-slider {
  width: 90px; height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: #2f2547; border-radius: 999px; outline: none; cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px;
  border-radius: 50%; background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Список станций */
.list-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 10px;
}

.list-title {
  font-size: 13px; font-weight: 700; color: #d6c6f0;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.header-actions {
  display: flex; align-items: center; gap: 6px;
}

.icon-action-btn {
  background: #1b1529; border: 1px solid #2e2445;
  color: #dbb2ff; border-radius: 7px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; transition: all 0.2s;
}

.icon-action-btn:hover {
  background: #2e2445; border-color: #a366ff;
  transform: rotate(45deg);
}

.add-toggle-btn {
  background: #241b37; border: 1px solid #3d2f5a;
  color: #c9b4e8; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 8px; cursor: pointer;
  transition: 0.2s;
}

.add-toggle-btn:hover { background: #32254d; color: #fff; }

/* Поиск и страна */
.search-and-filters {
  display: flex; gap: 8px; margin-bottom: 10px;
}

.search-box { flex: 1; }

.search-box input {
  width: 100%; background: #1b1529; border: 1px solid #2e2445;
  color: #f4effc; padding: 8px 12px; border-radius: 9px;
  font-size: 13px; outline: none; transition: border-color 0.2s;
}

.search-box input:focus { border-color: #a366ff; }

.country-dropdown {
  background: #1b1529; border: 1px solid #2e2445;
  color: #dbb2ff; border-radius: 9px; padding: 0 10px;
  font-size: 12px; outline: none; cursor: pointer;
}

.country-dropdown option { background: #120f1c; color: #fff; }

/* Фильтр по категориям */
.categories-bar {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 8px; margin-bottom: 12px;
  scrollbar-width: none;
}
.categories-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0; background: #1b1529; border: 1px solid #2e2445;
  color: #a99bc2; padding: 5px 12px; border-radius: 14px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.2s;
}

.cat-pill:hover { color: #fff; border-color: #553e7d; }
.cat-pill.active {
  background: #6c32a8; color: #fff; border-color: #a366ff;
  box-shadow: 0 2px 8px rgba(108, 50, 168, 0.4);
}
.cat-pill.favorite-pill.active {
  background: #9d4edd; border-color: #ffd166;
}

/* Форма добавления */
.add-form {
  display: flex; flex-direction: column; gap: 8px;
  background: #1c152d; border: 1px solid #3d2f5a;
  border-radius: 12px; padding: 12px; margin-bottom: 12px;
}
.add-form.hidden { display: none; }
.add-form input {
  background: #140e21; border: 1px solid #33274d;
  color: #fff; padding: 7px 10px; border-radius: 7px;
  font-size: 12px; outline: none;
}
.add-form-actions { display: flex; gap: 8px; }
.save-btn {
  flex: 1; background: #8e44ad; border: none; color: #fff;
  padding: 7px; border-radius: 7px; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.cancel-btn {
  background: #2b223f; border: none; color: #bbb;
  padding: 7px 12px; border-radius: 7px; font-size: 12px; cursor: pointer;
}

/* Список станций */
.station-list {
  display: flex; flex-direction: column; gap: 7px;
  max-height: 480px; overflow-y: auto; padding-right: 4px;
}
.station-list::-webkit-scrollbar { width: 5px; }
.station-list::-webkit-scrollbar-thumb { background: #362954; border-radius: 999px; }

.station-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; background: rgba(29, 23, 46, 0.85);
  border: 1px solid #2d2345; border-radius: 12px;
  padding: 10px 14px; cursor: pointer; transition: 0.16s ease;
}

.station-item:hover {
  border-color: #6b4c9a; background: #251d3b;
}

.station-item.selected {
  border-color: #a855f7;
  background: linear-gradient(135deg, rgba(142, 68, 173, 0.22), rgba(40, 29, 66, 0.95));
}

.station-item-info { flex: 1; min-width: 0; }
.station-item-top {
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.station-item-name {
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.station-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 999px;
  background: #2b1f42; color: #caaee8; font-weight: 500; flex-shrink: 0;
}
.station-item-desc {
  font-size: 11px; color: #8e80a9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.station-actions { display: flex; align-items: center; gap: 4px; }

.fav-star-btn {
  background: transparent; border: none; color: #554473;
  font-size: 18px; cursor: pointer; padding: 2px 4px;
  transition: transform 0.15s, color 0.15s;
}
.fav-star-btn:hover { transform: scale(1.2); color: #ffd166; }
.fav-star-btn.active {
  color: #ffd166; text-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
}

.delete-station-btn {
  background: transparent; border: none; color: #8874a6;
  font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.delete-station-btn:hover { background: #3b2853; color: #ff8fab; }

/* Кнопка Загрузить ещё */
.load-more-container {
  display: flex; justify-content: center; padding: 12px 0 20px 0;
}

.load-more-btn {
  width: 100%; background: #1f1730; border: 1px dashed #4e3a6f;
  color: #dbb2ff; padding: 10px 14px; border-radius: 10px;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.load-more-btn:hover { background: #2a1f42; border-color: #a366ff; color: #fff; }
.load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Вкладка О проекте */
.story-card {
  background: linear-gradient(145deg, #1f1731, #151022);
  border: 1px solid #352952; border-radius: 16px;
  padding: 20px; font-size: 13px; line-height: 1.6; color: #dcd0ef;
}
.story-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.story-icon {
  width: 44px; height: 44px; border-radius: 10px;
  image-rendering: pixelated;
}
.story-header h3 { font-size: 16px; color: #fff; }
.story-header span { font-size: 12px; color: #a99bc2; }
.story-card p { margin-bottom: 12px; }

/* ==============================================================
   АДАПТИВНОСТЬ: ПЛАНШЕТЫ И ДЕСКТОПЫ (ПК)
   ============================================================== */

@media (min-width: 820px) {
  .app {
    padding: 24px 30px;
  }

  /* На ПК переключаемся в 2 колонки! */
  .player-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
  }

  .player-left-col {
    position: sticky;
    top: 24px;
  }

  .now-playing {
    margin-bottom: 0;
    padding: 22px;
  }

  .station-title {
    font-size: 20px;
  }

  .station-list {
    max-height: 580px; /* Больше пространства для списка */
  }
}
