:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-soft: #0d0d0d;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.3);
  --text: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.63);
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.09), transparent 34%),
    linear-gradient(160deg, #030303 0%, #0a0a0a 48%, #020202 100%);
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI Variable", "Trebuchet MS", sans-serif;
}

button,
input {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  position: relative;
  overflow-x: hidden;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 56%, transparent 100%);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero,
.info-card,
.admin-card,
.admin-header {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  border-radius: 34px;
  padding: 24px;
}

.banner-frame {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 240px;
  background: #111;
}

.banner-image {
  width: 100%;
  height: clamp(220px, 32vw, 320px);
  object-fit: cover;
  filter: grayscale(1) contrast(1.1) brightness(0.88);
}

.hero-grid,
.info-grid,
.admin-layout {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.hero-grid {
  grid-template-columns: 1.05fr 1.4fr;
}

.info-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 24px;
}

.station-panel,
.player-panel,
.info-card,
.admin-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
}

.hero-grid > *,
.info-grid > *,
.admin-layout > *,
.player-body > *,
.next-card > *,
.station-brand > *,
.track-row > * {
  min-width: 0;
}

.station-brand {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
}

.station-logo,
.admin-logo {
  border-radius: 26px;
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.1);
}

.station-logo {
  width: 112px;
  height: 112px;
  object-fit: cover;
}

.admin-logo {
  width: 82px;
  height: 82px;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 11px;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Impact", "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.2rem);
}

h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.6rem);
}

h3 {
  font-size: 1.35rem;
}

.station-copy,
.helper-copy,
.track-meta,
.info-list {
  color: var(--muted);
  line-height: 1.6;
}

.helper-copy:empty {
  display: none;
}

.station-stats {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.stat-label {
  color: var(--muted);
}

.panel-head,
.admin-card-head,
.admin-header,
.stat-row,
.controls-row,
.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.panel-head {
  margin-bottom: 20px;
}

.live-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  letter-spacing: 0.2em;
}

.player-body,
.next-card,
.admin-now-grid {
  display: grid;
  grid-template-columns: minmax(190px, 240px) 1fr;
  gap: 22px;
  align-items: center;
}

.player-controls {
  display: grid;
  gap: 16px;
  min-width: 0;
  align-content: start;
}

.cover-wrap,
.next-cover,
.admin-cover {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111;
}

.cover-image,
.next-cover,
.admin-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(1) contrast(1.07);
}

.progress-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}

.progress-track {
  margin-top: 10px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.35) 100%);
  transition: width 260ms linear;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.primary-button {
  background: #f4f4f4;
  color: #050505;
}

.ghost-button {
  background: transparent;
  color: var(--text);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.6);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.controls-row {
  flex-wrap: wrap;
  align-items: stretch;
}

.controls-row .primary-button,
.controls-row .ghost-button {
  flex: 1 1 180px;
  min-width: 0;
}

#sync-button {
  flex-basis: 220px;
}

.volume-control,
.field,
.search-field {
  display: grid;
  gap: 8px;
}

.volume-control input,
.field input,
.field select,
.search-field input {
  width: 100%;
}

.volume-slider-shell {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.volume-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: transparent;
  cursor: pointer;
}

.volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.22));
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 2px solid rgba(5, 5, 5, 0.9);
  border-radius: 50%;
  background: #f4f4f4;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.volume-control input[type="range"]::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.22));
}

.volume-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(5, 5, 5, 0.9);
  border-radius: 50%;
  background: #f4f4f4;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.field input,
.field select,
.search-field input {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.field select {
  appearance: none;
}

.info-list {
  padding-left: 18px;
}

.tap-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.tap-card {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.98), rgba(8, 8, 8, 0.98));
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.admin-page .shell {
  padding-top: 36px;
}

.admin-header {
  border-radius: 32px;
  padding: 22px 24px;
}

.admin-layout {
  grid-template-columns: 380px minmax(0, 1fr);
  margin-top: 22px;
}

.login-card {
  max-width: 520px;
  margin: 24px auto 0;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.error-copy {
  min-height: 22px;
  margin-top: 12px;
  color: #f0a3a3;
}

.sync-copy {
  min-height: 24px;
  margin-top: 18px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.admin-actions .primary-button,
.admin-actions .ghost-button {
  flex: 1 1 180px;
}

.library-tools {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.selection-toolbar,
.playlist-toolbar,
.track-row-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.selection-toolbar {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.playlist-toolbar {
  align-items: end;
}

.compact-field {
  flex: 1 1 240px;
}

.playlist-select {
  width: 100%;
}

.danger-button {
  border-color: rgba(240, 163, 163, 0.35);
  color: #f7d3d3;
}

.tracks-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 6px;
}

.track-row {
  display: grid;
  grid-template-columns: 28px 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.track-row.current {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.07);
}

.track-row-spacer {
  width: 28px;
}

.track-thumb {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  filter: grayscale(1);
}

.track-row-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.track-row-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.track-row .ghost-button,
.track-row .primary-button {
  min-height: 42px;
}

.track-row-actions {
  justify-content: flex-end;
}

.track-checkbox {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.track-checkbox input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.track-checkbox span {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  transition:
    border-color var(--transition),
    background var(--transition);
}

.track-checkbox input:checked + span {
  border-color: rgba(255, 255, 255, 0.9);
  background: #f4f4f4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

code {
  font-family: "Cascadia Code", "Consolas", monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

@media (max-width: 960px) {
  .hero-grid,
  .info-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .player-body,
  .next-card,
  .admin-now-grid,
  .station-brand {
    grid-template-columns: 1fr;
  }

  .station-logo,
  .cover-wrap,
  .next-cover,
  .admin-cover {
    max-width: 280px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 100%);
    padding: 14px 0 28px;
  }

  .hero,
  .station-panel,
  .player-panel,
  .info-card,
  .admin-card,
  .admin-header,
  .tap-card {
    padding: 18px;
    border-radius: 24px;
  }

  .controls-row,
  .panel-head,
  .admin-card-head,
  .admin-header,
  .stat-row,
  .selection-toolbar,
  .playlist-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls-row {
    align-items: stretch;
    gap: 12px;
  }

  .controls-row .primary-button,
  .controls-row .ghost-button,
  #sync-button {
    flex: none;
    width: 100%;
    min-height: 54px;
  }

  .banner-image {
    height: 180px;
  }

  .track-row {
    grid-template-columns: 28px 58px 1fr;
  }

  .track-row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .track-row-actions .ghost-button,
  .track-row-actions .primary-button,
  .selection-toolbar .ghost-button,
  .selection-toolbar .primary-button,
  .playlist-toolbar .ghost-button,
  .playlist-toolbar .primary-button,
  .admin-actions .ghost-button,
  .admin-actions .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}
