/* Lofi像素電台 — med-study-rpg sub-site styles. Tokens copied from the LocalLLMRPG baseline
   (global.css:20-55); keep in sync with the sister sites rather than editing colours here. */
@font-face {
  font-family: "Cubic 11";
  src: url("../fonts/Cubic_11.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg-cream: #f4ecd8;
  --bg-cream-deep: #eadfc4;
  --bg-dark: #2d1f1a;
  --ink: #1a1410;
  --ink-muted: #5a4a3c;
  --accent-leaf: #6a8c3f;
  --accent-rose: #c44d4d;
  --accent-gold: #d4a04d;
  --accent-sky: #6a9bc4;
  --frame-wood-light: #8c6d4a;
  --frame-wood-dark: #5a3f29;
  --paper: #fbf6ea;
  --on-dark: #f4ecd8;
  --on-dark-muted: #d9caa6;

  --font-pixel-cjk: "Cubic 11", "Noto Sans TC", "PingFang TC", sans-serif;
  --font-pixel-num: "VT323", "Cubic 11", "Courier New", monospace;
  --font-legible: "Noto Serif TC", "Source Han Serif TC", "PingFang TC", "Microsoft JhengHei", Georgia, serif;
  --font-ui: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, system-ui, sans-serif;

  --shadow-px: 2px 2px 0 var(--bg-dark);
  --shadow-px-lg: 4px 4px 0 var(--bg-dark);
  --reading-width: 680px;
  --page-width: 1088px;
  --dither: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23d9caa6'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23d9caa6'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-cream) var(--dither);
  color: var(--ink);
  font-family: var(--font-ui);
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-pixel-cjk); font-weight: normal; -webkit-font-smoothing: none; }

/* ---------- header / footer (LocalLLMRPG global.css:125-205; footer uses #2d1f1a for AA) */
.site-header {
  background: var(--bg-dark);
  color: var(--on-dark);
  border-bottom: 4px solid var(--frame-wood-dark);
  position: sticky; top: 0; z-index: 10;
  font-family: var(--font-pixel-cjk);
  -webkit-font-smoothing: none;
}
.site-header__inner {
  max-width: var(--page-width); margin: 0 auto; padding: 8px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
}
.site-title {
  color: var(--accent-gold); text-decoration: none; font-size: 16px;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}
.site-title:hover { color: var(--on-dark); }
.site-title img { width: 24px; height: 24px; image-rendering: pixelated; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-nav a {
  color: var(--on-dark); text-decoration: none; font-size: 16px;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
}
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--accent-gold); }
.site-nav a[aria-current="page"]::before { content: "▶"; font-size: 12px; margin-right: 4px; }

main { flex: 1; width: 100%; max-width: var(--page-width); margin: 0 auto; padding: 24px 16px 48px; }

.site-footer {
  background: var(--bg-dark);
  color: var(--on-dark);
  border-top: 4px solid var(--frame-wood-dark);
  font-size: 14px;
  line-height: 1.7;
}
.site-footer__inner {
  max-width: var(--page-width); margin: 0 auto; padding: 16px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}
.site-footer a { color: var(--accent-gold); }

/* ---------- shared frames */
.frame {
  background: var(--paper);
  border: 4px solid var(--frame-wood-light);
  outline: 2px solid var(--frame-wood-dark); outline-offset: -2px;
  box-shadow: var(--shadow-px-lg);
  padding: 16px;
}
.dialogue {
  background: var(--bg-dark); color: var(--on-dark);
  border: 4px solid var(--frame-wood-light);
  box-shadow: var(--shadow-px-lg);
  padding: 16px 16px 24px; position: relative; line-height: 1.8;
}

/* ---------- radio page */
.stage {
  border: 4px solid var(--frame-wood-light);
  outline: 2px solid var(--frame-wood-dark); outline-offset: -6px;
  box-shadow: var(--shadow-px-lg);
  background: #000; line-height: 0;
}
.stage canvas { width: 100%; aspect-ratio: 16 / 9; image-rendering: pixelated; display: block; }

.player {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin: 16px 0 24px; padding: 12px 16px;
}
.btn {
  font: inherit; font-family: var(--font-pixel-cjk); -webkit-font-smoothing: none;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 0; cursor: pointer;
  background: #4f6b2e; color: var(--on-dark); box-shadow: var(--shadow-px);
  font-size: 16px;
}
.btn:hover { background: #3f5724; }
.btn:focus-visible, .station:focus-visible { outline: 3px solid var(--accent-gold); outline-offset: 2px; }
.now {
  font-family: var(--font-pixel-cjk); -webkit-font-smoothing: none;
  font-size: 24px; color: var(--accent-gold); letter-spacing: 1px;
  display: inline-flex; align-items: center; gap: 12px; min-width: 0;
}
.live { font-family: var(--font-pixel-num); font-size: 22px; color: #ff8a8a; }
.live[hidden] { display: none; }
.volume { display: inline-flex; align-items: center; gap: 8px; color: var(--on-dark-muted); font-size: 14px; margin-left: auto; }
.volume input { accent-color: var(--accent-gold); width: 120px; }

/* 2 columns on phones, 3 on wider screens (6 stations = 2 tidy rows). Cards in a row share one
   height (stretch + height:100%) so a name that wraps can't make one card taller than the rest. */
.stations {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr;
  gap: 16px; padding: 0; margin: 0; list-style: none;
}
@media (min-width: 720px) {
  .stations { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.stations li { display: flex; }
.station {
  width: 100%; height: 100%; min-height: 44px; text-align: left; cursor: pointer;
  padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--paper); border: 4px solid var(--frame-wood-light); border-radius: 0;
  box-shadow: var(--shadow-px);
}
.station[aria-pressed="true"] { border-color: var(--accent-gold); background: #fff3cf; }
.station .en { font-family: var(--font-pixel-num); font-size: 22px; display: block; }
.station .zh { font-family: var(--font-pixel-cjk); -webkit-font-smoothing: none; font-size: 16px; display: block; }
.station .mood { font-size: 13px; color: var(--ink-muted); display: block; margin-top: 2px; }
.tag {
  font-family: var(--font-pixel-num); font-size: 16px; padding: 0 4px; margin-left: 6px;
  background: var(--bg-dark); color: var(--accent-gold); vertical-align: 2px;
}

/* ---------- prose (about) */
.prose { max-width: var(--reading-width); font-family: var(--font-legible); font-size: 17px; line-height: 1.85; }
.prose h1 { font-size: 24px; }
.prose h2 { font-size: 20px; border-bottom: 4px solid var(--frame-wood-light); padding-bottom: 4px; margin-top: 36px; }
.prose h2::before { content: "◆ "; color: var(--accent-gold); }
@media (min-width: 768px) {
  .prose { font-size: 18px; }
  .prose h1 { font-size: 32px; }
}

@media (max-width: 600px) {
  .now { font-size: 20px; }
  .station .en { font-size: 19px; }
  .volume { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .live { animation: none; }
}
