@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;
}

: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;
   monochrome skins (green/amber) signal via .skin-mono so JS skips overriding
   the accent — keeping CRT vibes intact. */
body[data-skin="green"] {
  --bg: #001a05;
  --fg: #4cff7a;
  --dim: #1f7a3a;
  --line: #0e3a1c;
  --accent: #4cff7a;
  --accent-fg: #001a05;
}
body[data-skin="amber"] {
  --bg: #1a0f00;
  --fg: #ffb347;
  --dim: #8a5a1f;
  --line: #3d2a0f;
  --accent: #ffb347;
  --accent-fg: #1a0f00;
}
body[data-skin="paper"] {
  --bg: #f4ecd8;
  --fg: #1c1a14;
  --dim: #7a7363;
  --line: #c8bfa6;
  --accent-fg: #1c1a14;
}

* { 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;
}

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

.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;
}
.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-station {
  font-size: 36px;
  color: var(--accent);
  letter-spacing: 1px;
  word-break: break-word;
}
.now-channel {
  font-size: 24px;
  color: var(--fg);
  min-height: 1em;
}
.now-city {
  font-size: 18px;
  color: var(--dim);
  min-height: 1em;
}

.controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  flex: 1;
  background: var(--bg);
  color: var(--fg);
  border: 3px solid var(--fg);
  font-family: inherit;
  font-size: 22px;
  letter-spacing: 1px;
  padding: 12px 14px;
  min-height: 52px;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 var(--fg);
  transition: transform 60ms linear, box-shadow 60ms linear;
}
.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);
  margin-top: 4px;
}
.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; }
