:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  background: #111827;
  color: #fff;
  --muted: #c3cedf;
  --panel: #1d293b;
  --blue: #1d50b4;
  --green: #176345;
  --red: #a92439;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.radio {
  width: min(100%, 31rem);
  margin-inline: auto;
  display: grid;
  gap: clamp(0.75rem, 2svh, 1.125rem);
}

.heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-block: 0.375rem;
}

.heading img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.9rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.125rem, 8.5vw, 2.875rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 5.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid #3c4d64;
  border-radius: 1.125rem;
  background: var(--panel);
}

.status-light {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #a3b2c8;
  box-shadow: 0 0 0 0.3rem #304056;
}

.status[data-phase="playing"] .status-light { background: #80edb9; }
.status:is([data-phase="loading"], [data-phase="buffering"], [data-phase="retry"], [data-phase="offline"]) .status-light {
  background: #ffd180;
}

.status-copy {
  display: grid;
  gap: 0.15rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.status-copy strong { font-size: 1.375rem; }
.status-copy > span { color: var(--muted); font-size: 1.125rem; }

.stations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.625rem, 2.8vw, 0.875rem);
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font: inherit;
  font-weight: 750;
  border: 1px solid;
  border-radius: 1.125rem;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid #fff4ad;
  outline-offset: 3px;
}

button:active { filter: brightness(1.15); }

.station {
  flex-direction: column;
  gap: 0.625rem;
  min-height: clamp(7rem, 19svh, 10.25rem);
  padding: 0.625rem 0.375rem;
  font-size: clamp(1.125rem, 4.9vw, 1.625rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
  background: var(--blue);
  border-color: #537bc7;
  box-shadow: inset 0 1px 0 #ffffff20;
}

.station img {
  width: 2.875rem;
  height: 2.875rem;
}

.station[aria-pressed="true"] {
  background: var(--green);
  border-color: #85d9b3;
  box-shadow: inset 0 0 0 2px #85d9b3;
}

.stop {
  gap: 0.75rem;
  min-height: 4.25rem;
  padding: 0.625rem;
  font-size: 1.625rem;
  background: var(--red);
  border-color: #df7787;
}

.power {
  position: relative;
  width: 1.4rem;
  height: 1.4rem;
  border: 0.16rem solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
}

.power::before {
  content: "";
  position: absolute;
  top: -0.22rem;
  left: 50%;
  width: 0.16rem;
  height: 0.75rem;
  border-radius: 0.15rem;
  background: currentColor;
  transform: translateX(-50%);
}

@media (max-height: 570px) {
  body {
    padding-block: max(0.625rem, env(safe-area-inset-top)) max(0.625rem, env(safe-area-inset-bottom));
  }

  .radio { gap: 0.625rem; }
  .heading img { width: 2.875rem; height: 2.875rem; }
  .status { min-height: 4.75rem; padding-block: 0.625rem; }
  .station { min-height: 6rem; padding-block: 0.5rem; }
  .station img { width: 2.25rem; height: 2.25rem; }
  .stop { min-height: 4rem; }
}
