@font-face {
  font-family: District;
  src: url("/assets/fonts/DistrictTF-Light.ttf") format("truetype");
  font-weight: 300 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: District;
  src: url("/assets/fonts/DistrictTF-Regular.ttf") format("truetype");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #c4122f;
  --on-accent: #111;
  --ink: #111;
  --paper: #fff;
  --font: District, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--on-accent);
  background: var(--accent);
  transition: background-color 1s ease, color 1s ease;
}
.page-radio,
.page-discover,
.page-more {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}
.page-radio #view,
.page-discover #view,
.page-more #view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.radio-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(340px, 440px) minmax(220px, 1fr);
  gap: 56px;
  align-items: start;
  max-width: 1320px;
  margin: 0 auto;
}
@media (min-width: 901px) {
  .cover-stack { min-height: 360px; }
}
.meta-left, .meta-right {
  padding: 12px 8px;
  position: relative;
  z-index: 5;
}
.page-radio .meta-left {
  text-align: center;
}
.cover-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  overflow: visible;
}
.cover-stack {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: visible;
}
.covers { position: relative; width: min(64vw, 340px); height: min(64vw, 340px); }
.covers img.side-left { transform: translate(-16%, 8%) scale(.82); opacity: .55; z-index: 1; cursor: pointer; }
.covers img.side-right { transform: translate(16%, 8%) scale(.82); opacity: .55; z-index: 1; cursor: pointer; }
.covers img.main { z-index: 2; pointer-events: none; }

.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  background: var(--accent);
  border-bottom: 3px solid var(--on-accent);
  color: var(--on-accent);
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  overflow: hidden;
  position: relative;
  flex: 0 0 auto;
  z-index: 20;
  transition: background-color 1s ease, color 1s ease, border-color 1s ease;
}
.brand {
  display: flex;
  align-items: stretch;
  height: 72px;
  max-height: 72px;
  overflow: hidden;
  padding: 0;
}
.brand img {
  height: 72px;
  max-height: 72px;
  width: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
}
.tabs {
  display: flex;
  justify-content: center;
}
.tabs a {
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--on-accent);
  font-weight: 700;
  font-size: 18px;
  border-left: 3px solid var(--on-accent);
}
.tabs a.active {
  background: var(--on-accent);
  color: var(--accent);
}
.top-end {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-left: 3px solid var(--on-accent);
  font-weight: 600;
}

.stage { padding: 28px 24px 24px; }
.clock-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 12px;
}
.clock-block { text-align: center; }
.clock-row time {
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 800;
  letter-spacing: -2px;
  display: block;
  line-height: 1;
}
.clock-caption {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.cal { color: inherit; }
.meta-left .cal {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0 0;
  color: inherit;
}
.meta-left .cal svg {
  width: 30px;
  height: 30px;
}

.covers img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.covers img.main { z-index: 2; pointer-events: none; }
.label { margin: 0; font-weight: 400; opacity: .8; }

.play-btn {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #111;
  padding: 0;
}
.play-btn svg { width: 56px; height: 56px; display: block; }
.play-btn .icon-pause { display: none; }
.play-btn.is-playing .icon-play { display: none; }
.play-btn.is-playing .icon-pause { display: block; }
.nav-skip {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  box-shadow: none;
  width: 56px;
  height: 88px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
  color: var(--on-accent);
  font-family: system-ui, sans-serif;
}
.nav-skip svg {
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 auto;
}
.nav-skip.prev:disabled {
  opacity: .28;
  cursor: default;
}
.nav-skip.next:disabled {
  visibility: hidden;
  pointer-events: none;
}
.nav-skip.prev { left: 0; }
.nav-skip.next { right: 0; }

.vote-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.vote {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--on-accent); background: transparent; cursor: pointer; font-size: 14px;
  color: var(--on-accent);
}
.player-dock {
  position: relative;
  flex: 0 0 auto;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 100;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 18px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 3px solid #111;
}
.volume { position: relative; flex: 0 0 auto; }
.volume-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #111;
  padding: 4px;
  display: grid;
  place-items: center;
}
.volume-btn svg { width: 28px; height: 28px; display: none; }
.volume[data-level="high"] .vol-high,
.volume[data-level="low"] .vol-low,
.volume[data-level="mute"] .vol-mute { display: block; }
.volume-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: 40px;
  height: 132px;
  background: #fff;
  border: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  z-index: 40;
}
.volume-pop[hidden] { display: none; }
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 6px;
  margin: 0;
  transform: rotate(-90deg);
  background: #ddd;
  border: 1px solid #111;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #111;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #111;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
#wave {
  width: 100%;
  height: 56px;
  display: block;
}
.next-track {
  margin-top: 22px;
  font-weight: 700;
  line-height: 1.3;
}
.quality-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.quality-label select {
  font: inherit;
  padding: 8px 12px;
  border: 2px solid #111;
  background: #fff;
  min-width: 120px;
  color: #111;
  cursor: pointer;
}
.next { margin: 0; font-weight: 400; font-size: 14px; }
.lead { font-weight: 400; }
.mixcloud { margin: 0 0 8px; }
.mixcloud a {
  display: inline-block;
  padding: 10px 14px;
  border: 2px solid #111;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.mixcloud a:hover { background: #c4122f; border-color: #c4122f; }
h1, h2, .tabs a, .clock-row time, strong { font-weight: 700; }

.discover { max-width: 900px; margin: 0 auto; padding: 32px 18px 24px; background: #f6f4f1; min-height: 100%; color: #111; }
.page-discover { background: #f6f4f1; color: #111; }
.page-more { background: #f6f4f1; color: #111; }
.more-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 18px 24px;
  min-height: 100%;
  color: #111;
}
.more-page h1 { margin: 0 0 20px; }
.more-page h2 { margin: 28px 0 12px; font-size: 1.15rem; }
.social-links { display: grid; gap: 10px; }
.social-links a {
  display: block;
  padding: 14px 16px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  text-align: center;
}
.social-links a:hover { background: #111; color: #fff; }
.history-text { line-height: 1.5; white-space: pre-wrap; }
.admin-section textarea { width: 100%; min-height: 140px; padding: 10px; font: inherit; }
.search { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin: 20px 0 28px; align-items: end; }
.search label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.results li.around { outline: 3px solid #111; }
.search input, .search button { font: inherit; padding: 10px; border: 2px solid #111; }
.search button { background: #111; color: #fff; cursor: pointer; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.results li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  padding: 10px;
  border: 2px solid #111;
}
.results img { width: 72px; height: 72px; object-fit: cover; background: #ddd; }
.when { font-size: 13px; opacity: .7; }

.login-card, .page-admin { background: #111; color: #eee; min-height: 100vh; }
.login-card { max-width: 360px; margin: 10vh auto; padding: 24px; }
.login-card img { max-width: 200px; }
.login-card form, .admin-section form { display: grid; gap: 12px; }
.login-card input, .admin-section input, .admin-section select {
  width: 100%; padding: 10px; font: inherit;
}
.login-card button, .admin-section button {
  padding: 10px 14px; background: #c4122f; color: #fff; border: 0; cursor: pointer; font: inherit;
}
.error { color: #ffb4b4; }
.page-admin { padding: 24px; }
.admin-section { background: #1c1c1c; padding: 18px; margin: 18px 0; border-radius: 8px; }
.flash { background: #234; padding: 10px 14px; }
.check { display: flex; gap: 8px; align-items: center; }
.admin-section ul { list-style: none; padding: 0; }
.admin-section li { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.inline { display: inline; }
.inline button { padding: 4px 10px; background: #444; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.stats-table th, .stats-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #333; }
.stats-table th { opacity: .7; font-weight: 600; }
.stats-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.stats-actions a {
  display: inline-block;
  padding: 8px 12px;
  background: #c4122f;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.stats-empty { opacity: .7; }

@media (max-width: 900px) {
  .top {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
  .brand {
    grid-column: 1;
    grid-row: 1;
    height: 52px;
    max-height: 52px;
  }
  .brand img { height: 52px; max-height: 52px; }
  .top-end {
    grid-column: 2;
    grid-row: 1;
    border-left: 0;
    padding: 0 12px;
    justify-content: flex-end;
    font-size: 14px;
  }
  .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 3px solid var(--on-accent);
  }
  .tabs a {
    flex: 1;
    min-width: 0;
    border-left: 0;
    border-right: 3px solid var(--on-accent);
    font-size: 16px;
    min-height: 40px;
  }
  .page-radio .stage { padding: 8px 12px 10px; }
  .page-radio .clock-row { margin: 0 0 4px; gap: 8px; align-items: center; }
  .page-radio .clock-row time { font-size: 28px; letter-spacing: -0.5px; }
  .page-radio .clock-caption { font-size: 13px; margin: 0; }
  .page-radio .radio-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 8px;
  }
  .page-radio .meta-left,
  .page-radio .meta-right { padding: 0; }
  .page-radio .meta-left h1 { font-size: 1.2rem; margin: 0; line-height: 1.2; }
  .page-radio .meta-left .cal { margin-top: 8px; }
  .page-radio .meta-right h2 { font-size: 1.1rem; margin: 0 0 4px; line-height: 1.25; }
  .page-radio .label { font-size: 12px; margin: 0; }
  .page-radio .sub,
  .page-radio .times { margin: 3px 0; font-size: 14px; }
  .page-radio .cover-column { gap: 0; }
  .page-radio .cover-stack { min-height: 0 !important; margin: 0; }
  .page-radio .covers {
    width: min(56vw, 240px);
    height: min(56vw, 240px);
  }
  .page-radio .covers img.side-left,
  .page-radio .covers img.side-right { display: none !important; }
  .page-radio .nav-skip { width: 48px; height: 64px; }
  .page-radio .nav-skip svg { width: 36px; height: 36px; }
  .page-radio .vote-row { margin-top: 8px; }
  .page-radio .next-track { margin-top: 6px; font-size: 13px; }
  .search { grid-template-columns: 1fr; }
  .player-dock {
    grid-template-columns: auto auto 1fr auto;
    gap: 8px;
    padding: 6px 10px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
}
