/* ============================================================
   STADIUM FEED — live sports radio for THE SPREAD / THE LINE
   Terra Conflictus 2066

   Floating panel, bottom-right, collapsed to a pill until asked.
   Sits above the fixed bottom ticker on both pages.

   Per-page theming: set --sf-accent on the root element (the JS
   copies it off the <script data-accent="..."> tag).
   ============================================================ */

#tc-stadium {
  --sf-accent: #FF2D8A;
  --sf-ink: #0A0A0A;
  --sf-line: #2A2A2A;
  --sf-dim: #7A7A7A;
  --sf-dimmer: #555;

  position: fixed;
  right: 14px;
  bottom: 44px;                 /* clears the fixed bottom ticker */
  z-index: 600;
  font-family: monospace;
  text-transform: uppercase;
  line-height: 1.2;
  color: #E4E4E4;
}

/* ── collapsed pill ── */
#tc-stadium .sf-toggle {
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--sf-ink);
  color: var(--sf-accent);
  border: 1px solid var(--sf-accent);
  padding: 7px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
#tc-stadium .sf-toggle:hover { background: #141414; }
#tc-stadium.is-open .sf-toggle { display: none; }
#tc-stadium:not(.is-open) .sf-body { display: none; }

/* ── panel ── */
#tc-stadium .sf-body {
  width: 246px;
  background: var(--sf-ink);
  border: 1px solid var(--sf-accent);
  padding: 10px 11px 9px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .7);
}

#tc-stadium .sf-hd {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8.5px;
  letter-spacing: 2.4px;
  color: var(--sf-accent);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sf-line);
}
#tc-stadium .sf-hd .sf-title { flex: 1; }
#tc-stadium .sf-close {
  background: transparent;
  border: 0;
  color: var(--sf-dim);
  font-family: monospace;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
#tc-stadium .sf-close:hover { color: #fff; }

/* ── level meter (decorative; animates only while live) ── */
#tc-stadium .sf-eq { display: flex; align-items: flex-end; gap: 2px; height: 9px; }
#tc-stadium .sf-eq i {
  width: 2px;
  height: 3px;
  background: var(--sf-accent);
  opacity: .35;
}
#tc-stadium.is-live .sf-eq i { opacity: 1; animation: sf-bounce .9s ease-in-out infinite; }
#tc-stadium.is-live .sf-eq i:nth-child(2) { animation-duration: .62s; }
#tc-stadium.is-live .sf-eq i:nth-child(3) { animation-duration: 1.13s; }
#tc-stadium.is-live .sf-eq i:nth-child(4) { animation-duration: .78s; }
@keyframes sf-bounce { 0%, 100% { height: 2px; } 50% { height: 9px; } }
@media (prefers-reduced-motion: reduce) {
  #tc-stadium.is-live .sf-eq i { animation: none; height: 6px; }
}

/* ── now-playing readout ── */
#tc-stadium .sf-now {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--sf-dim);
  padding: 8px 0 2px;
  min-height: 12px;
}
#tc-stadium.is-live .sf-now { color: #fff; }
#tc-stadium .sf-sub {
  font-size: 8.5px;
  letter-spacing: .8px;
  color: var(--sf-dimmer);
  text-transform: none;
  padding-bottom: 8px;
  min-height: 11px;
}

/* ── station list ── */
#tc-stadium .sf-list {
  position: relative;   /* be the offsetParent, so the JS scroll-into-view
                           measures rows against the scroll box, not the panel */
  max-height: 172px;
  overflow-y: auto;
  border-top: 1px solid var(--sf-line);
  border-bottom: 1px solid var(--sf-line);
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--sf-line) transparent;
}
#tc-stadium .sf-list::-webkit-scrollbar { width: 5px; }
#tc-stadium .sf-list::-webkit-scrollbar-thumb { background: var(--sf-line); }

#tc-stadium .sf-stn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--sf-dim);
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  padding: 4px 6px;
  cursor: pointer;
}
#tc-stadium .sf-stn:hover { color: #fff; }
#tc-stadium .sf-stn .sf-sw {
  width: 7px; height: 7px;
  border: 1px solid currentColor;
  flex: 0 0 auto;
}
#tc-stadium .sf-stn.sel { color: #fff; border-color: var(--sf-line); }
#tc-stadium .sf-stn.sel .sf-sw { background: var(--sf-accent); border-color: var(--sf-accent); }
#tc-stadium .sf-stn.dead { color: #3E3E3E; text-decoration: line-through; }
#tc-stadium .sf-stn .sf-flag {
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--sf-dimmer);
}

/* ── transport ── */
#tc-stadium .sf-ctl { display: flex; align-items: center; gap: 8px; padding-top: 9px; }
#tc-stadium .sf-play {
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  background: transparent;
  color: var(--sf-dim);
  border: 1px solid var(--sf-line);
  padding: 4px 9px;
  cursor: pointer;
  white-space: nowrap;
}
#tc-stadium .sf-play:hover { color: #fff; border-color: var(--sf-accent); }
#tc-stadium.is-live .sf-play { color: var(--sf-accent); border-color: var(--sf-accent); }
#tc-stadium .sf-vol { flex: 1; min-width: 0; accent-color: var(--sf-accent); }

#tc-stadium .sf-att {
  font-size: 7.5px;
  letter-spacing: .6px;
  line-height: 1.5;
  color: #4A4A4A;
  text-transform: none;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #171717;
}

@media (max-width: 720px) {
  #tc-stadium { right: 10px; bottom: 40px; }
  #tc-stadium .sf-body { width: min(232px, calc(100vw - 24px)); }
  #tc-stadium .sf-list { max-height: 132px; }
}
