/* =========================================================
   RAINOUT FM // the radio
   ========================================================= */
.fm-page { max-width: 900px; padding-top: 30px; padding-bottom: 60px; }
.fm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.fm {
  --fm-body: #151515;
  --fm-body-2: #1e1e1e;
  --fm-edge: #050505;
  --fm-hi: #4a4a4a;
  --fm-lcd: #0b1a0b;
  --fm-lcd-on: #7dff7d;
  --fm-lcd-dim: #2f6a2f;
  --fm-red: #ff3b3b;
  --fm-font: "Courier New", Courier, monospace;
  --fm-ui: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  margin: 50px auto 0;
  color: #ddd;
  font: 12px var(--fm-ui);
  text-align: left;
}
.fm *, .fm *::before, .fm *::after { box-sizing: border-box; }

/* antenna */
.fm-antenna { position: absolute; right: 70px; bottom: 100%; width: 8px; height: 60px; pointer-events: none; }
.fm-antenna i {
  position: absolute; left: 0; bottom: -6px; width: 4px; height: 170px;
  background: linear-gradient(90deg, #888, #eee 40%, #777);
  transform-origin: bottom center; transform: rotate(28deg);
  box-shadow: 1px 0 0 #000;
}
.fm-antenna i::after { content: ""; position: absolute; top: -5px; left: -3px; width: 10px; height: 10px; border-radius: 50%; background: #ccc; box-shadow: inset -2px -2px #666; }

/* body */
.fm-body {
  position: relative;
  padding: 14px 16px 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, var(--fm-body-2), var(--fm-body));
  box-shadow:
    inset -2px -2px var(--fm-edge), inset 2px 2px var(--fm-hi),
    inset -4px -4px #0c0c0c, inset 4px 4px #2c2c2c,
    0 14px 40px rgba(0,0,0,.6);
}
.fm-top { display: flex; align-items: baseline; gap: 14px; margin: 2px 4px 12px; }
.fm-brand { font: bold 20px/1 var(--fm-font); letter-spacing: 6px; color: #eee; }
.fm-model { flex: 1; font: 10px var(--fm-font); letter-spacing: 2px; color: #777; }
.fm-onair {
  padding: 3px 8px; font: bold 10px var(--fm-font); letter-spacing: 3px; color: #3a1010;
  background: #1a0808; box-shadow: inset 1px 1px #000, inset -1px -1px #333;
}
.fm[data-state="on"] .fm-onair { color: #fff; background: var(--fm-red); box-shadow: 0 0 12px rgba(255,59,59,.6), inset 1px 1px #ff8a8a; animation: fm-blink 2.4s steps(1) infinite; }
@keyframes fm-blink { 0%, 92% { opacity: 1; } 93%, 100% { opacity: .55; } }

.fm-main { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; }

/* speaker grille */
.fm-speaker {
  position: relative; min-height: 250px;
  background:
    radial-gradient(circle, #000 1.6px, transparent 2.2px) 0 0 / 8px 8px,
    linear-gradient(180deg, #2a2a2a, #1a1a1a);
  box-shadow: inset 2px 2px #000, inset -2px -2px #3a3a3a;
}
.fm-speaker span {
  position: absolute; inset: 22px; border-radius: 50%;
  background: radial-gradient(circle, #000 1.4px, transparent 2px) 0 0 / 6px 6px;
  box-shadow: inset 0 0 0 3px #0a0a0a, inset 0 0 30px #000;
  transition: transform .08s;
}

.fm-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* LCD */
.fm-lcd {
  display: flex; gap: 12px; padding: 10px; min-height: 128px;
  background: var(--fm-lcd);
  box-shadow: inset 2px 2px #000, inset -2px -2px #2b2b2b, inset 0 0 24px rgba(0,0,0,.8);
  color: var(--fm-lcd-dim); font-family: var(--fm-font);
  position: relative; overflow: hidden;
}
.fm-lcd::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); pointer-events: none; }
.fm[data-state="on"] .fm-lcd { color: var(--fm-lcd-on); text-shadow: 0 0 6px rgba(125,255,125,.45); }
.fm-art { width: 104px; height: 104px; flex: none; display: grid; place-items: center; background: #050c05; box-shadow: inset 1px 1px #000; }
.fm-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.6) contrast(1.1); }
.fm-art-none { font: bold 28px var(--fm-font); opacity: .5; }
.fm-lcd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fm-freq { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; }
.fm-freq b { font: bold 34px/1 var(--fm-font); letter-spacing: 1px; }
.fm-freq small { font-size: 11px; }
.fm-freq span { margin-left: 8px; font-size: 13px; letter-spacing: 2px; overflow: hidden; text-overflow: ellipsis; }
.fm-label { font: bold 12px var(--fm-font); letter-spacing: 3px; }
.fm-marquee { overflow: hidden; white-space: nowrap; font-size: 15px; }
.fm-marquee span { display: inline-block; padding-left: 100%; animation: fm-scroll 16s linear infinite; }
.fm[data-state="off"] .fm-marquee span { padding-left: 0; animation: none; }
@keyframes fm-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.fm-meta { display: flex; gap: 14px; font-size: 11px; letter-spacing: 1px; margin-top: auto; }
.fm-live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.fm[data-state="on"] .fm-live { color: #ff7a7a; text-shadow: 0 0 6px rgba(255,80,80,.6); }
#fmClock { margin-left: auto; }

/* tuning dial */
.fm-dial {
  position: relative; height: 46px; cursor: ew-resize; touch-action: none;
  background: linear-gradient(180deg, #e9dfc2, #d6caa6);
  box-shadow: inset 2px 2px #000, inset -2px -2px #444, inset 0 0 12px rgba(0,0,0,.35);
}
.fm-scale { position: absolute; inset: 4px 10px 0; }
.fm-scale i { position: absolute; bottom: 14px; width: 1px; height: 8px; background: #3b3426; }
.fm-scale i.is-big { height: 14px; width: 2px; }
.fm-scale b { position: absolute; bottom: 0; transform: translateX(-50%); font: bold 10px var(--fm-font); color: #3b3426; }
.fm-scale .fm-mark { position: absolute; top: 0; transform: translateX(-50%); font: bold 9px var(--fm-font); color: #a2321f; letter-spacing: 1px; }
.fm-needle {
  position: absolute; top: 2px; bottom: 2px; width: 3px; margin-left: -1px;
  background: var(--fm-red); box-shadow: 0 0 6px rgba(255,59,59,.7);
  transition: left .6s cubic-bezier(.3,1.6,.5,1);
}
.fm-dial.is-dragging .fm-needle { transition: none; }

/* VU + controls */
.fm-row { display: flex; align-items: center; gap: 14px; }
.fm-vu { flex: 1; min-width: 0; height: 40px; background: #070707; box-shadow: inset 2px 2px #000, inset -2px -2px #2b2b2b; }
.fm-controls { display: flex; align-items: center; gap: 14px; }
.fm-power {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  border: 0; background: #2a2a2a; color: #eee; font: bold 12px var(--fm-font); letter-spacing: 2px; cursor: pointer;
  box-shadow: inset -2px -2px #000, inset 2px 2px #6a6a6a, inset -3px -3px #111, inset 3px 3px #3a3a3a;
}
.fm-power:active, .fm-power[aria-pressed="true"] { box-shadow: inset 2px 2px #000, inset -2px -2px #5a5a5a; }
.fm-led { width: 9px; height: 9px; border-radius: 50%; background: #3a1010; box-shadow: inset 1px 1px #000; }
.fm-power[aria-pressed="true"] .fm-led { background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; }
.fm-knob { display: flex; flex-direction: column; gap: 4px; font: bold 9px var(--fm-font); letter-spacing: 2px; color: #888; }
.fm-knob input { width: 110px; accent-color: #ddd; }

/* recently played */
.fm-log {
  margin-top: 18px; padding: 12px 16px;
  background: #121212; box-shadow: inset -1px -1px #000, inset 1px 1px #3a3a3a;
}
.fm-log h2 { margin: 0 0 8px !important; font: bold 12px var(--fm-font) !important; letter-spacing: 3px !important; color: #aaa; text-transform: uppercase; text-align: left; }
.fm-log ol { list-style: none; margin: 0; padding: 0; }
.fm-log li { display: flex; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid #1f1f1f; color: #ccc; font: 13px var(--fm-font); }
.fm-log li img { width: 32px; height: 32px; object-fit: cover; }
.fm-log li small { color: #777; margin-left: auto; white-space: nowrap; }
.fm-log li.fm-empty { color: #666; }
.fm-note { margin: 10px 0 0; color: #777; font: 11px var(--fm-ui); }
.fm-note a { color: #aaa; }

/* phones */
@media (max-width: 680px) {
  .fm-page { padding-top: 10px; }
  .fm { margin-top: 40px; }
  .fm-antenna { right: 30px; }
  .fm-main { grid-template-columns: 1fr; }
  .fm-speaker { min-height: 70px; }
  .fm-speaker span { inset: 10px 30%; }
  .fm-model { display: none; }
  .fm-art { width: 72px; height: 72px; }
  .fm-freq b { font-size: 26px; }
  .fm-row { flex-direction: column; align-items: stretch; }
  .fm-controls { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .fm-marquee span { animation: none; padding-left: 0; }
  .fm[data-state="on"] .fm-onair { animation: none; }
}
.fm-meta span { white-space: nowrap; }
@media (max-width: 680px) { #fmClock { display: none; } .fm-meta { gap: 10px; } }

/* =========================================================
   POP-OUT (Radio.exe on the desktop: /radio?mini)
   Like the Now Playing window, a bit bigger.
   ========================================================= */
.fm-recent-btn { display: none; }
html.fm-mini, html.fm-mini body { margin: 0 !important; padding: 0 !important; background: #1f1f1f !important; overflow: hidden; min-height: 0 !important; }
html.fm-mini body::before, html.fm-mini body::after,
html.fm-mini #global-nav, html.fm-mini #global-footer,
html.fm-mini .fm-antenna, html.fm-mini .fm-top, html.fm-mini .fm-speaker,
html.fm-mini .fm-note, html.fm-mini .fm-log h2 { display: none !important; }
html.fm-mini .fm-page { max-width: none; margin: 0 !important; padding: 2px !important; }
html.fm-mini .fm { margin: 0; font-size: 11px; }
html.fm-mini .fm-body { padding: 0; background: none; box-shadow: none; }
html.fm-mini .fm-main { display: block; }
html.fm-mini .fm-panel { gap: 5px; }

html.fm-mini .fm-lcd { min-height: 0; padding: 0; gap: 6px; background: none; box-shadow: none; overflow: visible; }
html.fm-mini .fm-lcd::after { display: none; }
html.fm-mini .fm-art { width: 66px; height: 66px; padding: 2px; background: #000; box-shadow: inset 1px 1px #000, inset -1px -1px #5a5a5a; }
html.fm-mini .fm-art-none { font-size: 18px; }
html.fm-mini .fm-lcd-text {
  gap: 2px; padding: 5px 8px; background: #000; overflow: hidden; position: relative;
  box-shadow: inset 1px 1px #000, inset -1px -1px #5a5a5a, inset 2px 2px #2a2a2a;
}
html.fm-mini .fm-freq { gap: 4px; order: 3; }
html.fm-mini .fm-freq b { font-size: 11px; }
html.fm-mini .fm-freq small { font-size: 9px; }
html.fm-mini .fm-freq span { margin-left: 2px; font-size: 10px; letter-spacing: 1px; }
html.fm-mini .fm-label { order: 1; font-size: 9px; letter-spacing: 2px; }
html.fm-mini .fm-marquee { order: 0; font-size: 12px; font-weight: bold; }
html.fm-mini .fm-meta { order: 2; margin: 0; font-size: 10px; gap: 10px; }
html.fm-mini #fmClock { display: none; }

html.fm-mini .fm-dial { height: 22px; box-shadow: inset 1px 1px #000, inset -1px -1px #444; }
html.fm-mini .fm-scale { inset: 2px 10px 0; }
html.fm-mini .fm-scale i { bottom: 10px; height: 4px; }
html.fm-mini .fm-scale i.is-big { height: 7px; }
html.fm-mini .fm-scale b { font-size: 7px; }
html.fm-mini .fm-scale .fm-mark { display: none; }

html.fm-mini .fm-row { flex-direction: column; align-items: stretch; gap: 4px; }
html.fm-mini .fm-vu { height: 18px; flex: none; }
html.fm-mini .fm-controls { gap: 6px; }
html.fm-mini .fm-power { padding: 4px 9px; font-size: 10px; letter-spacing: 1px; gap: 6px; }
html.fm-mini .fm-led { width: 7px; height: 7px; }
html.fm-mini .fm-knob { flex-direction: row; align-items: center; gap: 5px; font-size: 8px; letter-spacing: 1px; }
html.fm-mini .fm-knob input { width: 90px; }
html.fm-mini .fm-recent-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 9px;
  border: 0; background: #2a2a2a; color: #eee; font: 11px var(--fm-ui); cursor: pointer;
  box-shadow: inset -1px -1px #000, inset 1px 1px #8a8a8a, inset -2px -2px #101010, inset 2px 2px #474747;
}
html.fm-mini .fm-recent-btn[aria-expanded="true"] { box-shadow: inset 1px 1px #000, inset -1px -1px #8a8a8a; }

html.fm-mini .fm-log { display: none; margin-top: 5px; padding: 3px 6px; max-height: 170px; overflow-y: auto; box-shadow: inset 1px 1px #000, inset -1px -1px #5a5a5a; background: #000; }
html.fm-mini .fm.show-recent .fm-log { display: block; }
html.fm-mini .fm-log li { padding: 3px 0; gap: 8px; font-size: 11px; border-bottom-color: #151515; }
html.fm-mini .fm-log li img { width: 22px; height: 22px; }
