:root {
  font-family: Arial, Helvetica, sans-serif;
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #fff;
  --input: #f3f6fa;
  --text: #101827;
  --muted: #56657a;
  --line: #c9d5e3;
  --blue: #0487e8;
  --tint: #eff8ff;
  --danger: #c71740;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 210px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08111f;
  --surface: #111c2d;
  --input: #182539;
  --text: #f8fafc;
  --muted: #acbbce;
  --line: #34445d;
  --tint: #10243a;
  --danger: #fb718d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #08111f;
    --surface: #111c2d;
    --input: #182539;
    --text: #f8fafc;
    --muted: #acbbce;
    --line: #34445d;
    --tint: #10243a;
    --danger: #fb718d;
  }
}
button,
input,
select,
summary {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
summary {
  cursor: pointer;
}
button,
select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 700;
  min-height: 40px;
}
button:hover,
a:hover {
  color: var(--blue);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
a {
  color: var(--blue);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: -70px;
  left: 15px;
  z-index: 10;
  padding: 12px;
  background: var(--surface);
}
.skip-link:focus {
  top: 12px;
}
.header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1244px;
  margin: auto;
  padding: 20px 32px 16px;
}
.topbar,
.search-row,
.filter-row,
.chips,
.tools,
.brand,
.library,
.section-heading,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 28px;
  font-weight: 800;
  gap: 12px;
}
.brand img {
  border-radius: 14px;
}
.tools button,
.tools a {
  border: 0;
  background: none;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.tools [aria-pressed="true"] {
  color: var(--blue);
  background: var(--tint);
}
.search-row {
  gap: 14px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 160px;
  background: var(--input);
  padding: 0 14px;
  border-radius: 16px;
}
.search-box span {
  font-size: 28px;
  color: var(--muted);
}
input[type="search"] {
  border: 0;
  background: none;
  color: var(--text);
  padding: 16px 0;
  width: 100%;
  min-width: 0;
  font-size: 15px;
  outline-offset: 0;
}
.chips {
  gap: 6px;
}
.chips button {
  border-radius: 22px;
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.chips button[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.library {
  margin-top: 12px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 12px;
  gap: 0;
  overflow: hidden;
}
.library button {
  border: 0;
  border-radius: 0;
  padding: 10px 24px;
  background: none;
}
.library [aria-pressed="true"] {
  background: var(--tint);
  color: var(--blue);
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 22px 32px 32px;
}
h1 {
  font-size: 20px;
  margin: 0 0 5px;
}
h2 {
  font-size: 21px;
}
p {
  line-height: 1.5;
}
.section-heading {
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.actions button {
  font-size: 13px;
}
.station-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.station-card {
  position: relative;
  border: 1.35px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
  min-width: 0;
  min-height: 230px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  content-visibility: auto;
  contain-intrinsic-size: auto 230px;
}
.station-card:after {
  content: "▥";
  position: absolute;
  right: -18px;
  bottom: -45px;
  font-size: 180px;
  font-weight: bold;
  color: var(--blue);
  opacity: 0.065;
  z-index: -1;
  transform: rotate(-8deg);
}
.station-card.active {
  border: 2px solid var(--blue);
  box-shadow: 0 10px 22px #0487e825;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--line);
  color: var(--blue);
  font-size: 28px;
  font-weight: 800;
}
.logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.card-controls {
  text-align: right;
}
.play {
  background: var(--blue);
  color: white !important;
  border: 0;
  border-radius: 50%;
  height: 46px;
  width: 46px;
  font-size: 20px;
  padding: 0;
}
.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.card-actions button {
  border: 0;
  background: none;
  padding: 5px;
  min-width: 34px;
  font-size: 18px;
  color: var(--muted);
}
button.favorite {
  color: var(--danger) !important;
}
.genres {
  display: flex;
  gap: 6px;
  margin: 12px 0 16px;
  min-height: 28px;
  overflow: hidden;
}
.genre {
  display: inline-block;
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 18px;
  padding: 6px 10px;
  background: var(--input);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.station-name {
  display: block;
  font-size: 20px;
  text-align: left;
  font-weight: 900;
  padding: 0;
  border: 0;
  background: none;
  min-height: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: var(--text);
  margin-top: auto;
}
.card-bottom {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 9px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.location {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.votes {
  font-size: 12px;
  white-space: nowrap;
}
.availability {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0284c7;
  flex-shrink: 0;
}
.availability.verified {
  background: #16a34a;
}
.availability.unavailable {
  background: #dc2626;
}
.live {
  color: var(--blue);
  font-weight: 800;
}
.rank {
  font-size: 13px;
  color: var(--blue);
  margin-bottom: 8px;
  font-weight: 800;
}
.group-title {
  grid-column: 1/-1;
  margin: 12px 0 0;
  font-size: 18px;
}
.load-more {
  display: block;
  margin: 24px auto;
}
.empty {
  text-align: center;
  padding: 60px 16px;
  font-weight: 700;
}
footer {
  padding: 28px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
body.has-player main {
  padding-bottom: 180px;
}
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 30px #0000000a;
  padding: 14px max(16px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.player-inner {
  max-width: 1376px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.player-station {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.player .logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  font-size: 22px;
}
.player-copy {
  min-width: 0;
}
.text-button {
  padding: 0;
  min-height: 24px;
  background: none;
  border: 0;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-copy p {
  font-size: 12px;
  margin: 4px 0 0;
  color: var(--muted);
}
#now-playing {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.player-controls > button:not(.play) {
  border: 0;
  padding: 8px;
  background: none;
  font-size: 18px;
}
.volume {
  position: relative;
}
.volume summary {
  list-style: none;
  padding: 10px;
  font-size: 21px;
}
.volume label {
  position: absolute;
  bottom: 50px;
  right: 0;
  background: var(--surface);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px #0002;
  width: 210px;
  font-size: 13px;
}
.volume input {
  width: 100%;
  margin-top: 12px;
  accent-color: var(--blue);
}
select {
  max-width: 165px;
  font-size: 12px;
}
.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 4px 14px #0002;
}
body.has-player .back-top {
  bottom: 160px;
}
dialog {
  max-width: 780px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 190px);
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--text);
  background: var(--surface);
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #08111f99;
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.detail-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0 24px;
}
.detail-hero h3 {
  font-size: 26px;
  margin: 0;
  overflow-wrap: anywhere;
}
.detail-hero p {
  color: var(--muted);
  margin: 8px 0;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-body {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 24px;
}
.detail-body dt {
  font-weight: 700;
  margin-top: 14px;
}
.detail-body dd {
  margin: 5px 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.detail-body a {
  overflow-wrap: anywhere;
}
.related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#toast {
  position: fixed;
  bottom: 175px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--text);
  color: var(--surface);
  padding: 13px 20px;
  border-radius: 12px;
  z-index: 10;
  font-size: 14px;
  box-shadow: 0 5px 20px #0003;
}
@media (min-width: 840px) and (max-width: 1179px) {
  .station-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .search-row {
    flex-wrap: wrap;
  }
  .search-box {
    flex-basis: 100%;
  }
}
@media (max-width: 839px) {
  .header-inner {
    padding: 16px;
  }
  .brand {
    font-size: 24px;
  }
  .tools span {
    display: none;
  }
  .tools button,
  .tools a {
    font-size: 20px;
    padding: 8px;
  }
  .search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .filter-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .chips button {
    padding: 8px 11px;
  }
  .station-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  main {
    padding: 20px 16px;
  }
  .player-inner {
    flex-wrap: wrap;
    gap: 10px;
  }
  .player-station {
    flex-basis: 100%;
  }
  .player-controls {
    width: 100%;
    justify-content: center;
  }
  .player {
    padding-top: 10px;
  }
  .player .logo {
    width: 44px;
    height: 44px;
  }
  .player-copy p {
    margin-top: 1px;
  }
  .station-card {
    padding: 13px;
  }
  .logo {
    width: 68px;
    height: 68px;
  }
  .station-name {
    font-size: 18px;
  }
  .card-actions button {
    min-width: 30px;
  }
  .library {
    width: 100%;
  }
  .library button {
    flex: 1;
    padding: 10px 12px;
  }
  .topbar {
    margin-bottom: 14px;
  }
  .section-heading {
    gap: 12px;
  }
  body.has-player main {
    padding-bottom: 220px;
  }
  body.has-player .back-top {
    bottom: 190px;
  }
  dialog {
    max-height: calc(100dvh - 230px);
  }
}
@media (max-width: 429px) {
  .station-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .station-card {
    min-height: 230px;
  }
  .brand {
    font-size: 22px;
    gap: 8px;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
  .tools {
    gap: 0;
  }
  .tools button,
  .tools a {
    padding: 6px;
    min-width: 32px;
  }
  .filter-row {
    gap: 6px;
  }
  .chips {
    gap: 4px;
  }
  .chips button {
    padding: 8px 9px;
    font-size: 12px;
  }
  .player-controls {
    gap: 1px;
  }
  .player-controls > button:not(.play) {
    padding: 6px;
    font-size: 16px;
  }
  .player-controls .play {
    width: 40px;
    height: 40px;
  }
  .sleep-label select {
    max-width: 113px;
    font-size: 11px;
    padding: 8px 3px;
  }
  .volume summary {
    padding: 6px;
  }
  .detail-hero h3 {
    font-size: 21px;
  }
  dialog {
    padding: 16px;
  }
  .actions button {
    padding: 8px;
  }
  .header-inner {
    padding: 12px 16px;
  }
  .section-heading h1 {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
