@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/noto-sans-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/noto-sans-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/noto-sans-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/noto-sans-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/noto-sans-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/noto-sans-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/noto-sans-hebrew-400.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/noto-sans-hebrew-600.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

:root {
  --bg: #100e0c;
  --ink: #f3efe6;
  --muted: #a79f93;
  --faint: #7d756b;
  --line: rgba(243, 239, 230, 0.1);
  --brass: #c4a36a;
  --brass-soft: #e6d3a6;
  --danger: #d37b66;
  --pad: clamp(1rem, 2.4vw, 2.25rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  background:
    radial-gradient(980px 420px at 50% -12%, rgba(196, 163, 106, 0.07), transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.45;
}

body { min-height: 100dvh; }

button, p, h1, h2, ol, li { margin: 0; }

h1, h2, .program, .current-title, .tagline, .play-label, .onair {
  font-family: "Source Serif 4", "Noto Sans", serif;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand tools";
  align-items: center;
  column-gap: 0.75rem;
  padding: 1.15rem var(--pad) 1rem;
  border-bottom: 1px solid var(--line);
}

.brand { grid-area: brand; min-width: 0; }

.mast-side {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0 0.65rem;
  border-radius: 999px;
}

.lang a[aria-current="page"] {
  color: var(--ink);
  background: rgba(196, 163, 106, 0.16);
}

.lang a:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

h1 {
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.tagline {
  margin-top: 0.4rem;
  color: var(--muted);
  font-family: "Noto Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.onair {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.15rem;
  color: var(--brass-soft);
  font-family: "Noto Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.onair[hidden] { display: none; }

.listeners {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.35rem;
  padding: 0.12rem 0.5rem 0.12rem 0.42rem;
  border: 1px solid rgba(196, 163, 106, 0.32);
  border-radius: 999px;
  color: var(--brass-soft);
  font-family: "Noto Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.listeners svg { width: 0.85rem; height: 0.85rem; display: block; }

.listeners[hidden] { display: none; }

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 0.35rem rgba(196, 163, 106, 0.14);
  animation: ember 2.8s ease-in-out infinite;
}

@keyframes ember {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) minmax(0, 1fr);
  grid-template-areas: "previous current upcoming";
}

.col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1.2rem var(--pad) 1rem;
}

.col-previous { grid-area: previous; }
.col-current { grid-area: current; }
.col-upcoming { grid-area: upcoming; }

.col h2 {
  color: var(--ink);
  font-family: "Noto Sans", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.col-previous h2,
.col-upcoming h2 { margin-bottom: 0.35rem; }

.tracks {
  list-style: none;
  padding: 0;
  overflow: auto;
  min-height: 0;
}

.tracks li {
  padding: 0.78rem 0;
  border-top: 1px solid var(--line);
}

.tracks li:first-child { border-top: 0; }

.tracks li.has-vote {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.song-text {
  flex: 1;
  min-width: 0;
}

.song-title {
  display: block;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.song-artist {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.col-current {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.now {
  width: min(100%, 36rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.now h2 { margin-bottom: 0.85rem; }

.program {
  margin-bottom: 0.85rem;
  color: var(--brass-soft);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.program[hidden] { display: none; }

.program {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.program-kicker {
  font-family: "Noto Sans", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  padding: 0.22rem 0.7rem;
  border: 1px solid rgba(196, 163, 106, 0.45);
  border-radius: 999px;
  background: rgba(196, 163, 106, 0.08);
}

.program-name { display: block; }

.current-title {
  font-size: clamp(1.7rem, 3.1vw, 2.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.current-artist {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.current-artist[hidden] { display: none; }

.play {
  appearance: none;
  margin-top: 1.6rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  cursor: pointer;
}

.play-face {
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 50%;
  border: 1px solid rgba(196, 163, 106, 0.75);
  background: rgba(196, 163, 106, 0.06);
  display: grid;
  place-items: center;
  color: var(--brass-soft);
}

.play:hover .play-face,
.play:focus-visible .play-face {
  background: rgba(196, 163, 106, 0.16);
}

.play:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 6px;
  border-radius: 999px;
}

.play[data-state="playing"] .play-face {
  background: var(--brass);
  color: #14110e;
  border-color: var(--brass);
  animation: play-ring 2.6s ease-out infinite;
}

.play-spinner {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid rgba(196, 163, 106, 0.35);
  border-top-color: var(--brass-soft);
  display: none;
}

.play[data-state="connecting"] .play-spinner,
.play[data-state="buffering"] .play-spinner {
  display: block;
  animation: play-spin 0.8s linear infinite;
}

.play[data-state="connecting"] .icon,
.play[data-state="buffering"] .icon {
  display: none !important;
}

@keyframes play-ring {
  0% { box-shadow: 0 0 0 0 rgba(196, 163, 106, 0.5); }
  100% { box-shadow: 0 0 0 0.7rem rgba(196, 163, 106, 0); }
}

@keyframes play-spin {
  to { transform: rotate(360deg); }
}

.play-label {
  font-family: "Noto Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-soft);
}

.play-face .icon[hidden] { display: none !important; }

.icon-play { margin-left: 0.18rem; }

.player-error {
  margin-top: 0.9rem;
  color: var(--danger);
  font-size: 0.95rem;
}

.player-error[hidden] { display: none; }

.address {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.4rem var(--pad) 0;
  padding: 0.4rem 0.45rem 0.4rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.02);
}

a.url {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  text-decoration: none;
}

a.url:hover { text-decoration: underline; }

a.url:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 4px;
}

.address-actions {
  display: flex;
  gap: 0.35rem;
  flex: none;
}

.address button {
  appearance: none;
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.address button svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.address button:hover { border-color: rgba(196, 163, 106, 0.55); }

.address button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.copy-status {
  min-height: 1.1rem;
  margin: 0.35rem var(--pad) 0;
  text-align: right;
  color: var(--faint);
  font-size: 0.82rem;
}

.copy-fallback {
  position: fixed;
  left: -9999px;
  top: 0;
}

.share-fallback {
  margin: 0.35rem var(--pad) 0;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.share-fallback[hidden] { display: none; }

footer {
  padding: 0.35rem var(--pad) 1rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.78rem;
}

/* --- likes / dislikes ------------------------------------------------------ */

:root {
  --up: #9fc28a;
  --down: #d37b66;
}

.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.vote[hidden] { display: none; }

.vote-buttons {
  display: flex;
  gap: 0.5rem;
}

.vote-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.vote-btn .thumb {
  display: block;
  flex: none;
}

.vote-count:empty { display: none; }

.vote-btn:hover { color: var(--ink); border-color: rgba(196, 163, 106, 0.55); }
.vote-btn:active { transform: scale(0.94); }

.vote-btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.vote-lg { margin-top: 1.15rem; }

.vote-lg .vote-btn {
  min-width: 4.4rem;
  height: 2.9rem;
  padding: 0 1.05rem;
  font-size: 0.95rem;
}

.vote-lg .thumb { width: 1.4rem; height: 1.4rem; }

.vote-sm {
  flex: none;
  gap: 0.2rem;
  align-items: flex-end;
}

.vote-sm .vote-buttons { gap: 0.3rem; }

.vote-sm .vote-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  gap: 0.25rem;
}

/* 44px finger target around the compact buttons, without widening the row */
.vote-sm .vote-btn::after {
  content: "";
  position: absolute;
  inset: -0.25rem -0.12rem;
}

.vote-sm .thumb { width: 1.05rem; height: 1.05rem; }

.vote[data-voted] .vote-btn[aria-disabled="true"] { cursor: default; }

.vote[data-voted="up"] .vote-up {
  color: #14110e;
  background: var(--up);
  border-color: var(--up);
}

.vote[data-voted="down"] .vote-down {
  color: #14110e;
  background: var(--down);
  border-color: var(--down);
}

.vote[data-voted="up"] .vote-up .thumb path,
.vote[data-voted="down"] .vote-down .thumb path { fill: currentColor; }

.vote[data-voted="up"] .vote-down,
.vote[data-voted="down"] .vote-up { opacity: 0.45; }

.vote[data-voted=""] .vote-btn:hover,
.vote:not([data-voted]) .vote-btn:hover { background: rgba(196, 163, 106, 0.1); }

.vote.is-pending .vote-btn { opacity: 0.6; }

.moves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
}

.moves:not(:has(.move:not([hidden]))) { display: none; }

.move {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
  background: rgba(243, 239, 230, 0.06);
}

.move[hidden] { display: none; }

.move-glyph { font-size: 0.62rem; }

.move-pos {
  color: var(--faint);
  font-weight: 400;
}

.move-pos::before {
  content: "·";
  margin-right: 0.28rem;
}

.move[data-move="up"] { color: var(--up); background: rgba(159, 194, 138, 0.12); }
.move[data-move="down"] { color: var(--down); background: rgba(211, 123, 102, 0.12); }
.move[data-move="new"] { color: #14110e; background: var(--brass); }
.move[data-move="new"] .move-pos { color: rgba(20, 17, 14, 0.7); }
.move[data-move="same"] .move-glyph { font-size: 0.72rem; }

.vote-lg .move {
  font-size: 0.8rem;
  padding: 0.22rem 0.75rem;
}

.vote-lg .move-glyph { font-size: 0.7rem; }

.vote-sm .move {
  font-size: 0.64rem;
  padding: 0.08rem 0.42rem;
}

.vote-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 0.6rem);
  max-width: calc(100% - 2rem);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 163, 106, 0.4);
  background: rgba(24, 21, 18, 0.96);
  color: var(--ink);
  font-size: 0.88rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.vote-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  body { overflow-x: hidden; }

  .app { height: auto; }

  main {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .col-current {
    order: 1;
    border: 0;
    padding-top: 1.6rem;
    padding-bottom: 1.4rem;
  }

  .col-upcoming { order: 2; }
  .col-previous { order: 3; }

  .tracks { overflow: visible; }
}

@media (max-width: 640px) {
  .address {
    flex-wrap: wrap;
    border-radius: 1.1rem;
    padding: 0.75rem;
  }

  .url { flex-basis: 100%; }

  .address-actions {
    width: auto;
    margin-left: auto;
  }

  .copy-status { text-align: left; }
}

@media (min-width: 901px) {
  body { overflow: hidden; }
  .app { height: 100dvh; }
  .col-previous, .col-upcoming, .col-current { overflow: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .vote-btn, .vote-toast { transition: none; }
  .dot,
  .play[data-state="playing"] .play-face,
  .play-spinner { animation: none; }
}
