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

:root {
  --font-body: 'Geo', sans-serif;
  --font-pixel: 'Geo', sans-serif;
  --font-cyrillic: 'Pixelify Sans', sans-serif;
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #676767;
  --soft: #9a9a9a;
  --accent-gold: #d4b233;
  --accent-gold-soft: rgba(212, 178, 51, 0.28);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.cyrillic-font {
  font-family: var(--font-cyrillic);
  font-size: calc(1em - 2px);
}

.main {
  padding: 24px;
}

.rank-strip-shell {
  width: 100%;
  margin-bottom: 18px;
  padding-right: 24px;
}

.radio-shell {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 100px;
  align-items: start;
  max-width: 760px;
  margin-left: 50px;
}

.radio-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 40px;
}

.radio-image {
  display: block;
  width: 136px;
  height: auto;
  image-rendering: pixelated;
  transform-origin: center;
  transition: transform 140ms ease, filter 140ms ease;
  will-change: transform;
}

body.is-playing .radio-image {
  animation: radio-pulse 1.35s ease-in-out infinite;
}

@keyframes radio-pulse {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.04);
    filter: brightness(1.05);
  }
}

.radio-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.radio-stage-links {
  display: flex;
  width: 100%;
}

.radio-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.4;
  color: var(--soft);
  text-decoration: none;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 160ms ease, color 160ms ease;
}

.radio-link:hover {
  color: var(--text);
  border-color: var(--accent-gold);
}

.station-source {
  max-width: 140px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.35;
  color: var(--soft);
}

.station-source a {
  color: inherit;
  text-decoration: none;
}

.station-source a:hover {
  color: var(--text);
}

.btn-primary,
.btn-ghost {
  background: none;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 3px 8px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text);
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 160ms ease, color 160ms ease;
}

.btn-primary:hover,
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent-gold);
}

.station-status {
  max-width: 110px;
  text-align: center;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.4;
}

.station-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 40px;
}

.station-heading {
  display: block;
}

.station-heading-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  width: 100%;
}

.station-country {
  font-size: 24px;
  line-height: 1.05;
  font-weight: 600;
}

.station-year {
  font-size: 24px;
  line-height: 1.05;
  color: var(--muted);
  margin-left: auto;
  text-align: right;
}

.station-country,
.station-year {
  cursor: pointer;
}

.station-country:hover,
.station-year:hover {
  color: var(--muted);
}

.station-country:focus-visible,
.station-year:focus-visible {
  outline: 1px solid #d8d8d8;
  outline-offset: 3px;
  border-radius: 4px;
}

.current-track-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.current-track-main,
.playlist-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sort-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.sort-btn {
  background: none;
  border: 1px solid #ffffff;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--soft);
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 160ms ease, color 160ms ease;
}

.sort-btn.active {
  border-color: #d8d8d8;
  color: var(--text);
}

.sort-btn:hover {
  color: var(--text);
  border-color: var(--accent-gold);
}

.btn-primary::before,
.btn-ghost::before,
.radio-link::before,
.sort-btn::before {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -32%;
  width: 164%;
  background: var(--accent-gold);
  transform: translateX(-112%) skewX(-22deg);
  transform-origin: left center;
  transition: transform 220ms ease;
  z-index: -1;
}

.btn-primary:hover::before,
.btn-primary:focus-visible::before,
.btn-ghost:hover::before,
.btn-ghost:focus-visible::before,
.radio-link:hover::before,
.radio-link:focus-visible::before,
.sort-btn:hover::before,
.sort-btn:focus-visible::before {
  transform: translateX(0) skewX(-22deg);
}

.songs-list,
.song-status {
  font-family: var(--font-pixel);
}

.current-track-title {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
}

.current-track-meta {
  font-size: 17px;
  color: var(--muted);
}

.current-track-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.5;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}

.current-track-link:hover {
  color: var(--muted);
}

.rank-strip-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding-top: 2px;
}

.rank-strip-line {
  position: relative;
  width: 100%;
  min-height: 24px;
}

.rank-strip-scale,
.rank-strip-empty {
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.3;
}

.rank-strip-empty {
  color: var(--soft);
  text-transform: uppercase;
}

.rank-strip-axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #cfcfcf;
  transform: translateY(-50%);
}

.rank-strip-dot {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.28);
  cursor: default;
  appearance: none;
  text-decoration: none;
}

.rank-strip-dot-focal {
  background: rgba(177, 138, 40, 0.82);
  box-shadow: 0 0 0 1px var(--accent-gold-soft);
}

.rank-strip-dot::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 3px 6px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.rank-strip-dot:hover::after,
.rank-strip-dot:focus-visible::after {
  opacity: 1;
}

.rank-strip-scale {
  display: flex;
  justify-content: space-between;
  color: var(--soft);
}

.songs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 15px;
  line-height: 1.45;
}

.song-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid #ffffff;
  border-radius: 6px;
}

.song-item.active {
  color: #000000;
  border-color: #d8d8d8;
}

.song-item.unavailable {
  color: var(--soft);
}

.song-index,
.song-status {
  color: var(--soft);
}

.song-copy {
  min-width: 0;
}

.song-title,
.song-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  color: var(--muted);
}

.song-item.active .song-index,
.song-item.active .song-status,
.song-item.active .song-title {
  color: var(--text);
}

.empty-state {
  color: var(--soft);
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.45;
}

#youtube-player {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

.coverage-body {
  min-height: 100vh;
}

.coverage-main {
  padding: 24px;
}

.coverage-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.coverage-back {
  width: fit-content;
}

.coverage-title {
  font-size: 28px;
  line-height: 1.05;
  font-weight: 600;
}

.coverage-copy {
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.coverage-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.4;
  color: var(--soft);
  flex-wrap: wrap;
}

.coverage-legend-scale {
  display: inline-flex;
  gap: 4px;
}

.coverage-table-shell {
  overflow: auto;
  padding-bottom: 10px;
}

.coverage-sources {
  margin-top: 18px;
}

.coverage-sources-title {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  margin-bottom: 8px;
}

.coverage-sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.4;
  color: var(--soft);
}

.coverage-source-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.coverage-source-country {
  color: var(--text);
}

.coverage-source-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coverage-sources-list a {
  color: inherit;
  text-decoration: none;
}

.coverage-sources-list a:hover {
  color: var(--text);
}

.coverage-table {
  display: grid;
  grid-template-columns: 140px repeat(var(--coverage-columns, 0), 12px);
  gap: 4px;
  align-items: center;
  width: max-content;
  min-width: 100%;
}

.coverage-corner,
.coverage-country,
.coverage-year {
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.2;
}

.coverage-corner,
.coverage-country {
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
}

.coverage-corner {
  top: 0;
  z-index: 3;
  color: var(--soft);
}

.coverage-year {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 44px;
  color: var(--soft);
  text-align: left;
}

.coverage-country {
  padding-right: 10px;
  white-space: nowrap;
  color: var(--text);
}

.coverage-cell {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #f3f3f3;
}

a.coverage-cell {
  transition: transform 120ms ease, border-color 120ms ease;
  border: 1px solid transparent;
}

a.coverage-cell:hover {
  transform: scale(1.14);
  border-color: #b5b5b5;
}

.coverage-cell-empty {
  background: #f3f3f3;
}

.coverage-cell-low {
  background: #e7f1ff;
}

.coverage-cell-mid {
  background: #bfd6ff;
}

.coverage-cell-high {
  background: #7da7ea;
}

.coverage-cell-max {
  background: #3d6fcb;
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .radio-shell {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .radio-stage {
    align-items: flex-start;
  }

  .current-track-card {
    gap: 10px;
  }

  .station-status {
    text-align: left;
    max-width: none;
  }

  .coverage-main {
    padding: 16px;
  }

  .coverage-table {
    grid-template-columns: 110px repeat(var(--coverage-columns, 0), 11px);
  }

  .coverage-country,
  .coverage-corner,
  .coverage-year {
    font-size: 10px;
  }

  .coverage-cell {
    width: 11px;
    height: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .radio-image,
  body.is-playing .radio-image {
    animation: none;
    transition: none;
  }
}
