@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/vendor/vt323-latin.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: 'Fredoka';
  font-style: normal;
  font-weight: 400 600;          /* variable font, used by Fantasy skin only */
  font-display: swap;
  src: url('/vendor/fredoka-latin.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;
}

:root {
  --bg: #0a0a0a;
  --fg: #e8e8e8;
  --dim: #6b6b6b;
  --line: #2a2a2a;
  --accent: #fff205;
  --accent-fg: #0a0a0a;
  --shadow: 4px 4px 0 0 var(--line);
}

/* Skins override the base palette. Station accent is set inline by JS on :root for
   skins flagged mono:false (Dark, Paper). For mono:true skins (Fantasy, Clippy) the
   skin's own --accent wins so the visual identity stays coherent.
   Dark skin is the :root default — declared explicitly only for completeness. */
body[data-skin="dark"] {
  /* same as :root */
}
body[data-skin="paper"] {
  --bg: #f4ecd8;
  --fg: #1c1a14;
  --dim: #7a7363;
  --line: #c8bfa6;
  --accent-fg: #1c1a14;
}
body[data-skin="paper"] .row:hover { background: #e8dfc8; }

/* === Fantasy: light unicorn / hyper-pop disney. Rounded corners, gradient title,
       pastel pink/lavender bg, Fredoka rounded font. */
body[data-skin="fantasy"] {
  --bg: #fff0f7;
  --fg: #5e2ca5;
  --dim: #b07ac6;
  --line: #ffd1e8;
  --accent: #ff4f9a;
  --accent-fg: #ffffff;
  --shadow: 4px 4px 0 0 #ffb0d4;
  font-family: 'Fredoka', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-smooth: always;
  text-rendering: optimizeLegibility;
}
body[data-skin="fantasy"] h1 {
  background: linear-gradient(90deg, #ff4f9a 0%, #b04dff 50%, #00d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0;
}
body[data-skin="fantasy"] .now,
body[data-skin="fantasy"] .btn,
body[data-skin="fantasy"] .icon-btn,
body[data-skin="fantasy"] .skin-btn {
  border-radius: 18px;
  font-family: inherit;
}
body[data-skin="fantasy"] .now { border-width: 3px; }
body[data-skin="fantasy"] .now-station {
  font-weight: 600;
  letter-spacing: 0;
  background: linear-gradient(90deg, #ff4f9a, #b04dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body[data-skin="fantasy"] .row { border-bottom-color: #ffe0ee; }
body[data-skin="fantasy"] .row:hover { background: #ffe6f3; }

/* === Winamp: dark retro media player. LCD green on near-black, Win9x bevel chrome.
       Fixed green accent keeps the classic aesthetic coherent. */
body[data-skin="winamp"] {
  --bg: #1a1a1a;
  --fg: #c0c0c0;
  --dim: #686868;
  --line: #303030;
  --accent: #00e600;
  --accent-fg: #000000;
  --shadow: 2px 2px 0 0 #000000;
}
body[data-skin="winamp"] .bar {
  background: linear-gradient(180deg, #2c2c3a 0%, #1a1a26 100%);
  border-bottom: 2px solid #00e600;
  padding: 6px 8px;
}
body[data-skin="winamp"] h1 {
  color: var(--dim);
  font-size: 22px;
  letter-spacing: 4px;
}
body[data-skin="winamp"] .icon-btn {
  background: #2e2e2e;
  color: #c0c0c0;
  border: 2px solid;
  border-color: #4a4a4a #111111 #111111 #4a4a4a;
  border-radius: 0;
}
body[data-skin="winamp"] .icon-btn:hover,
body[data-skin="winamp"] .icon-btn:focus-visible {
  border-color: #00e600;
  color: #00e600;
}
body[data-skin="winamp"] .now {
  background: #0d0d0d;
  border: 2px solid #303030;
  border-top-color: #4a4a4a;
  border-left-color: #4a4a4a;
  box-shadow: none;
}
body[data-skin="winamp"] .now-station { color: #00e600; }
body[data-skin="winamp"] .btn {
  background: #2e2e2e;
  color: #c0c0c0;
  border: 2px solid;
  border-color: #4a4a4a #111111 #111111 #4a4a4a;
  border-radius: 0;
  box-shadow: none;
  letter-spacing: 1px;
}
body[data-skin="winamp"] .btn:active {
  border-color: #111111 #4a4a4a #4a4a4a #111111;
  box-shadow: none;
  transform: none;
}
body[data-skin="winamp"] .btn-primary {
  background: #003300;
  color: #00e600;
  border-color: #005500 #001500 #001500 #005500;
}
body[data-skin="winamp"] .btn-primary:active {
  border-color: #001500 #005500 #005500 #001500;
  box-shadow: none;
}
body[data-skin="winamp"] .row { border-bottom: 1px solid #252525; }
body[data-skin="winamp"] .row:hover { background: #222222; }
body[data-skin="winamp"] .row.active { color: #00e600; }
body[data-skin="winamp"] .skin-btn {
  background: #2e2e2e;
  color: #c0c0c0;
  border: 2px solid;
  border-color: #4a4a4a #111111 #111111 #4a4a4a;
  border-radius: 0;
}
body[data-skin="winamp"] .skin-btn[aria-pressed="true"] {
  background: #003300;
  color: #00e600;
  border-color: #005500 #001500 #001500 #005500;
}
body[data-skin="winamp"] .list-label { letter-spacing: 2px; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'VT323', ui-monospace, monospace;
  font-size: 22px;
  line-height: 1.15;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: geometricPrecision;
}

body {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
}
.bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 2px;
  color: var(--dim);
}

.icon-btn {
  background: transparent;
  color: var(--fg);
  border: 2px solid var(--line);
  font-family: inherit;
  font-size: 24px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Safari defaults to emoji presentation for ▶ ⏸ ⏭ ⚙; force text style. */
  font-variant-emoji: text;
}
.icon-btn svg { display: block; }
.icon-btn:hover, .icon-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.now {
  border: 3px solid var(--accent);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box;
}

.now-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.now-station {
  font-size: 36px;
  color: var(--accent);
  letter-spacing: 1px;
  word-break: break-word;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.now-station.linkable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.now-station.linkable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.now-channel {
  font-size: 24px;
  color: var(--fg);
  min-height: 1em;
}
.now-city {
  font-size: 18px;
  color: var(--dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.now-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.now-meta-title {
  font-size: 20px;
  color: var(--fg);
  word-break: break-word;
  min-height: 1.15em;
}
.now-meta-sub {
  font-size: 16px;
  color: var(--dim);
  word-break: break-word;
  min-height: 1.15em;
}

.controls {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  background: var(--bg);
  color: var(--fg);
  border: 3px solid var(--fg);
  font-family: inherit;
  font-size: 22px;
  letter-spacing: 0;
  padding: 12px 14px;
  min-height: 52px;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 var(--fg);
  transition: transform 60ms linear, box-shadow 60ms linear;
  font-variant-emoji: text;
}
.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 var(--fg);
}
.btn:focus-visible { outline: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  box-shadow: 4px 4px 0 0 var(--accent);
}
.btn-primary:active {
  box-shadow: 0 0 0 0 var(--accent);
}

.status {
  min-height: 1em;
  font-size: 18px;
  color: var(--dim);
}
.status.error { color: #ff4444; }

.list-wrap { display: flex; flex-direction: column; gap: 8px; }

.list-label {
  font-size: 18px;
  color: var(--dim);
  letter-spacing: 2px;
  border-bottom: 2px dashed var(--line);
  padding-bottom: 4px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.row:hover { background: #141414; }
.row.active {
  color: var(--accent);
}
.row.active .row-dot { background: var(--accent); }
.row-dot {
  width: 10px;
  height: 10px;
  background: var(--line);
  flex: 0 0 10px;
}
.row-name { flex: 1; font-size: 22px; }
.row-channel { color: var(--dim); font-size: 18px; }
.row-city { color: var(--dim); font-size: 16px; padding-left: 8px; }

.row-config { padding: 14px 8px; }
.row-config .row-name { color: var(--fg); }
.row-check {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: var(--dim);
  flex: 0 0 22px;
}
.row-check.on { color: var(--accent); }
.row.empty {
  color: var(--dim);
  cursor: default;
  justify-content: center;
  padding: 24px 8px;
  font-size: 18px;
}

.config-mode .controls { opacity: 0.4; pointer-events: none; }

.skin-section {
  display: none;
  flex-direction: column;
  gap: 8px;
}
.config-mode .skin-section { display: flex; }
.skin-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.skin-btn {
  flex: 1 1 0;
  min-width: 64px;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--line);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 1px;
  padding: 10px 8px;
  cursor: pointer;
  text-transform: uppercase;
}
.skin-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.skin-btn:focus-visible { outline: none; }

/* === About modal === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow);
  padding: 20px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.modal-title {
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 2px;
}
.modal-desc {
  font-size: 20px;
  color: var(--fg);
  line-height: 1.4;
}
.modal-em {
  color: var(--accent);
}
.modal-contact {
  font-size: 18px;
  color: var(--dim);
  line-height: 1.4;
}
.modal-link {
  color: var(--accent);
  text-decoration: none;
}
.modal-link:hover { text-decoration: underline; }
.modal-footer {
  font-size: 16px;
  color: var(--dim);
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

body[data-skin="fantasy"] .modal { border-radius: 18px; }
body[data-skin="fantasy"] .modal-title {
  background: linear-gradient(90deg, #ff4f9a, #b04dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}
body[data-skin="winamp"] .modal {
  border-width: 2px;
  border-color: #00e600;
  box-shadow: none;
}
body[data-skin="paper"] .modal-backdrop { background: rgba(0, 0, 0, 0.5); }
