/* styles.css — Retro WeatherStar 4000 theme, 9:16 vertical (1080x1920) for TikTok. */

:root {
  --board-w: 1080px;
  --board-h: 1920px;

  --blue-1: #263c9a;   /* panel top */
  --blue-2: #101a52;   /* panel bottom */
  --blue-3: #0a1236;   /* deep bg */
  --bevel-hi: #7f95ff; /* light bevel edge */
  --bevel-lo: #05082a; /* dark bevel edge */

  --yellow: #ffd21a;   /* headings */
  --yellow-2: #ffe873;
  --cream: #f4f1e6;    /* body text */
  --hot: #ff8a1e;      /* orange accents */
  --tealbar: #1b2a7a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  font-family: "VT323", "Courier New", monospace;
  color: var(--cream);
}

/* Stage scales the fixed 1080x1920 board to fit whatever window it's previewed in.
   In OBS you point a 1080x1920 Browser Source here and it renders 1:1. */
#stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
#board {
  position: relative;
  width: var(--board-w);
  height: var(--board-h);
  overflow: hidden;
  /* orange-glow vignette over deep blue, echoing the CRT reference shots */
  background:
    radial-gradient(120% 80% at 50% 115%, rgba(255,138,30,0.55) 0%, rgba(120,40,120,0.25) 32%, rgba(10,18,54,0) 60%),
    radial-gradient(120% 80% at 50% -15%, rgba(120,60,160,0.45) 0%, rgba(10,18,54,0) 55%),
    linear-gradient(180deg, #12205e 0%, var(--blue-3) 55%, #12103a 100%);
  transform-origin: center center;
}

/* --- Top masthead bar --- */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 150px;
  display: flex; align-items: center; gap: 22px;
  padding: 0 34px;
  background: linear-gradient(180deg, #ff9b2e 0%, var(--hot) 45%, #b34a00 100%);
  border-bottom: 5px solid #4a1e00;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35);
  z-index: 30;
}
.logo {
  flex: 0 0 auto;
  width: 150px; height: 96px;
  border-radius: 14px;
  background: linear-gradient(180deg, #eef2ff, #b9c6ff);
  border: 4px solid #fff;
  box-shadow: inset 0 0 0 3px #2b47c8, 0 3px 0 rgba(0,0,0,0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 0.86; text-align: center;
  padding: 4px;
}
#topbar h1 {
  flex: 1 1 auto;
  font-size: 74px; font-weight: normal; line-height: 0.9;
  color: #fff2d6; text-shadow: 3px 3px 0 #6a2a00, 0 0 18px rgba(0,0,0,0.4);
  letter-spacing: 1px;
}
#clock {
  flex: 0 0 auto; text-align: right;
  color: #fff6e6; text-shadow: 2px 2px 0 #6a2a00;
  font-size: 44px; line-height: 1.0;
}
#clock .date { font-size: 40px; color: #ffe1b0; }

/* --- Segment stage (cross-fading screens) --- */
#screens {
  position: absolute; top: 246px; left: 0; right: 0; bottom: 420px;
  z-index: 10;
}
.segment {
  position: absolute; inset: 0;
  padding: 40px 46px 30px;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity 480ms ease;
}
.segment.active { opacity: 1; visibility: visible; }

/* Section title used on most screens */
.screen-title {
  color: var(--yellow);
  font-size: 78px; line-height: 0.95;
  text-shadow: 4px 4px 0 #000a3a, 0 0 22px rgba(255,210,26,0.35);
  letter-spacing: 2px;
  margin-bottom: 26px;
}
.screen-sub { color: var(--yellow-2); font-size: 46px; margin: -14px 0 26px; }

/* Beveled panel (the signature TWC blue box) */
.panel {
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
  border: 5px solid;
  border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.35), 0 6px 0 rgba(0,0,0,0.4);
  border-radius: 8px;
}

/* ===== Regional Observations (table) ===== */
.obs-head, .obs-row {
  display: grid; grid-template-columns: 1fr 360px 150px; align-items: center;
  padding: 12px 26px;
}
.obs-head {
  color: var(--yellow); font-size: 44px;
  border-bottom: 4px solid var(--bevel-hi);
}
.obs-head .r { text-align: right; }
.obs-list { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; }
.obs-row { font-size: 60px; text-shadow: 3px 3px 0 #000a3a; padding: 22px 26px; }
.obs-row .cond { display: flex; align-items: center; gap: 16px; }
.obs-row .cond .ic { width: 62px; height: 62px; flex: 0 0 auto; }
.obs-row .temp { text-align: right; color: var(--yellow-2); }
.obs-row .req { font-size: 30px; color: var(--hot); display: block; }

/* ===== Current Conditions ===== */
.cc-wrap { flex: 1 1 auto; display: flex; flex-direction: column; gap: 28px; }
.cc-top { display: flex; align-items: center; gap: 40px; }
.cc-icon { width: 300px; height: 300px; flex: 0 0 auto; }
.cc-tempblock { display: flex; flex-direction: column; }
.cc-temp { font-size: 260px; line-height: 0.82; color: #fff; text-shadow: 6px 6px 0 #000a3a; }
.cc-temp .deg { color: var(--yellow); font-size: 150px; vertical-align: top; }
.cc-cond { font-size: 78px; color: var(--yellow-2); }
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 34px; padding: 30px 40px; }
.cc-grid .row { display: flex; justify-content: space-between; font-size: 54px; border-bottom: 3px dashed rgba(127,149,255,0.35); padding-bottom: 8px; }
.cc-grid .row .k { color: var(--yellow); }
.cc-grid .row .v { color: #fff; }
.cc-req { margin-top: auto; font-size: 48px; color: var(--hot); text-align: center; }
.cc-req b { color: var(--yellow-2); }

/* ===== Extended Forecast (3-day panels) ===== */
.ef-city { font-size: 64px; color: #fff; margin-bottom: 20px; text-shadow: 3px 3px 0 #000a3a; }
.ef-panels { flex: 1 1 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-content: start; align-items: start; }
.ef-day { display: flex; flex-direction: column; align-items: center; padding: 26px 12px 30px; height: fit-content; }
.ef-name { font-size: 62px; color: var(--yellow); }
.ef-ic { width: 200px; height: 200px; margin: 10px 0; }
.ef-cond { font-size: 42px; text-align: center; color: var(--cream); min-height: 96px; }
.ef-lohi { display: flex; gap: 30px; margin-top: 16px; }
.ef-lohi .col { text-align: center; }
.ef-lohi .lbl { font-size: 40px; }
.ef-lohi .lo .lbl { color: #7fd0ff; }
.ef-lohi .hi .lbl { color: var(--yellow); }
.ef-lohi .num { font-size: 78px; color: #fff; }

/* ===== Requested Cities Leaderboard ===== */
.lb-list { flex: 1 1 auto; display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.lb-row { display: grid; grid-template-columns: 110px 1fr 220px; align-items: center; padding: 16px 28px; font-size: 62px; }
.lb-row .rank { color: var(--yellow); font-size: 70px; }
.lb-row .city { color: #fff; text-shadow: 3px 3px 0 #000a3a; }
.lb-row .votes { text-align: right; color: var(--yellow-2); }
.lb-row .votes small { font-size: 34px; color: var(--hot); }
.lb-row:first-child { border-color: var(--yellow) var(--bevel-lo) var(--bevel-lo) var(--yellow); }
.lb-cta { margin-top: 22px; text-align: center; font-size: 54px; color: var(--yellow-2); }
.lb-cta b { color: var(--hot); }

/* ===== National Roundup ===== */
.nr-grid { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.nr-region { padding: 22px 26px; display: flex; flex-direction: column; }
.nr-region .rname { color: var(--yellow); font-size: 52px; border-bottom: 3px solid var(--bevel-hi); margin-bottom: 12px; }
.nr-region .rrow { display: flex; justify-content: space-between; font-size: 46px; padding: 4px 0; }
.nr-region .rrow .t { color: var(--yellow-2); }

/* ===== Almanac ===== */
/* --- Almanac --- */
.al-hero { display: flex; align-items: center; gap: 40px; padding: 10px 0 28px; border-bottom: 4px solid rgba(127,149,255,0.3); margin-bottom: 24px; }
.al-hero-icon { flex: 0 0 280px; height: 280px; }
.al-hero-icon svg { width: 280px; height: 280px; }
.al-hero-right { display: flex; flex-direction: column; gap: 8px; }
.al-hero-temp { font-size: 190px; line-height: 0.85; color: #fff; text-shadow: 6px 6px 0 #000a3a; }
.al-hero-temp .deg { color: var(--yellow); font-size: 110px; vertical-align: top; }
.al-hero-cond { font-size: 68px; color: var(--yellow-2); letter-spacing: 2px; }
.al-solar { padding: 28px 30px; margin-bottom: 20px; }
.al-solar-row { display: flex; align-items: baseline; gap: 20px; font-size: 64px; padding: 10px 0; }
.al-sol-emoji { font-size: 58px; }
.al-sol-label { color: var(--yellow); flex: 1; }
.al-sol-val { color: #fff; }
.al-today { padding: 28px 30px; }
.al-today-lohi { display: flex; gap: 60px; margin-bottom: 22px; }
.al-lh-col { display: flex; flex-direction: column; align-items: center; }
.al-lh-label { font-size: 44px; color: var(--yellow-2); }
.al-lh-num { font-size: 130px; color: #fff; line-height: 1; }
.al-stat { display: flex; justify-content: space-between; font-size: 54px; padding: 8px 0; border-bottom: 2px dashed rgba(127,149,255,0.25); }
.al-stat .k { color: var(--yellow); }
.al-stat .v { color: #fff; }

/* --- Ticker/crawl (sits just under the topbar, clear of TikTok chat overlay) --- */
#ticker {
  position: absolute; left: 0; right: 0; top: 150px; height: 96px;
  background: linear-gradient(180deg, #23349b, #0c1450);
  border-bottom: 5px solid var(--bevel-hi);
  display: flex; align-items: center; overflow: hidden; z-index: 30;
}
#ticker .tag {
  flex: 0 0 auto; height: 100%; display: flex; align-items: center;
  padding: 0 26px; background: var(--hot); color: #2a1000;
  font-size: 46px; border-right: 4px solid #4a1e00;
}
#ticker .track { flex: 1 1 auto; overflow: hidden; white-space: nowrap; position: relative; }
#ticker .crawl {
  display: inline-block; padding-left: 100%;
  font-size: 52px; color: var(--yellow-2); text-shadow: 2px 2px 0 #000a3a;
  animation: crawl 40s linear infinite;
}
#ticker .crawl span { margin: 0 60px; }
#ticker .crawl b { color: #fff; }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* --- Lowell mill skyline silhouette (bottom backdrop) --- */
#cityscape {
  position: absolute; left: 0; right: 0; bottom: 0; height: 420px;
  z-index: 4; /* above board gradient, below #screens (z-index:10) */
  pointer-events: none;
}
#cityscape svg { width: 100%; height: 100%; }

/* --- CRT scanline overlay for retro feel --- */
#board::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 40;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.10) 3px, rgba(0,0,0,0.10) 4px);
  mix-blend-mode: multiply; opacity: 0.6;
}

/* --- Host control panel (hidden from capture until toggled with backtick) --- */
#hostpanel {
  position: fixed; top: 14px; left: 14px; z-index: 100;
  width: 360px; padding: 16px; display: none;
  background: rgba(6,10,34,0.94); border: 2px solid #7f95ff; border-radius: 10px;
  font-family: "VT323", monospace; color: #cfe0ff; font-size: 20px;
}
#hostpanel.open { display: block; }
#hostpanel h3 { color: var(--yellow); font-size: 26px; margin-bottom: 10px; }
#hostpanel .fld { display: flex; gap: 8px; margin-bottom: 10px; }
#hostpanel input[type="text"], #hostpanel input[type="number"] {
  flex: 1; background: #0d1440; color: #fff; border: 1px solid #3a4bb0;
  font-family: inherit; font-size: 20px; padding: 6px 8px; border-radius: 4px;
}
#hostpanel button {
  background: #2b47c8; color: #fff; border: 1px solid #7f95ff; border-radius: 4px;
  font-family: inherit; font-size: 20px; padding: 6px 10px; cursor: pointer;
}
#hostpanel button:hover { background: #3a5be0; }
#hostpanel .muted { color: #8fa2d8; font-size: 17px; }
#hostpanel .queue { max-height: 220px; overflow: auto; margin-top: 8px; border-top: 1px solid #3a4bb0; padding-top: 8px; }
#hostpanel .qrow { display: flex; justify-content: space-between; padding: 3px 0; }
#hostpanel .qrow .x { color: #ff8a8a; cursor: pointer; }
#hostpanel .status { margin-top: 8px; font-size: 17px; }
#hostpanel .status .on { color: #6fe08a; }
#hostpanel .status .off { color: #ff8a8a; }

/* On-screen music controls */
#musicbar {
  position: absolute; right: 30px; bottom: 275px; z-index: 35;
  display: flex; align-items: center; gap: 16px;
  background: rgba(6, 12, 48, 0.88);
  border: 3px solid var(--bevel-hi);
  border-radius: 10px;
  padding: 12px 22px;
}
#music-btn {
  font-family: "VT323", monospace; font-size: 38px;
  color: var(--yellow); background: none; border: none;
  cursor: pointer; padding: 0; line-height: 1; white-space: nowrap;
}
#music-btn:hover { color: #fff; }
#vol-slider {
  width: 220px; cursor: pointer;
  accent-color: var(--yellow);
}

/* ===== Event Screens ===== */

/* Category label chip */
.ev-cat { font-size: 28px; color: var(--hot); letter-spacing: 1px; margin-top: 2px; }

/* --- LOWELL TODAY (day-at-a-glance) --- */
.ev-today-list {
  flex: 1 1 auto; display: flex; flex-direction: column;
  gap: 10px; margin-top: 16px; overflow: hidden;
}
.ev-today-row {
  display: grid; grid-template-columns: 210px 1fr;
  align-items: start; padding: 14px 18px;
  border-bottom: 2px dashed rgba(127,149,255,0.25);
}
.ev-today-row .ev-time { color: var(--yellow-2); font-size: 48px; line-height: 1; }
.ev-today-row .ev-body {}
.ev-today-row .ev-name { color: #fff; font-size: 50px; line-height: 1.1; }
.ev-today-row .ev-venue { color: var(--cream); font-size: 36px; opacity: 0.8; margin-top: 2px; }
.ev-empty {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  font-size: 52px; color: var(--cream); opacity: 0.65; text-align: center;
  line-height: 1.4;
}

/* --- THIS WEEKEND (3-column grid) --- */
.ev-weekend-grid {
  flex: 1 1 auto; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; margin-top: 16px; overflow: hidden;
}
.ev-col {
  display: flex; flex-direction: column; padding: 16px 14px; overflow: hidden;
}
.ev-col-head {
  color: var(--yellow); font-size: 58px; letter-spacing: 2px;
  border-bottom: 3px solid var(--bevel-hi); margin-bottom: 10px;
}
.ev-col-wx {
  display: flex; flex-direction: column; align-items: flex-start;
  font-size: 38px; color: var(--cream); margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 2px solid rgba(127,149,255,0.25);
  gap: 2px;
}
.ev-col-ic { display: inline-block; width: 52px; height: 52px; vertical-align: middle; }
.ev-col-temp { color: var(--yellow-2); font-size: 42px; }
.ev-col-cond { font-size: 34px; color: var(--cream); opacity: 0.9; }
.ev-col-events { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; overflow: hidden; }
.ev-col-row {
  font-size: 28px; padding: 4px 0;
  border-bottom: 1px dashed rgba(127,149,255,0.2);
}
.ev-col-row .ev-col-time { color: var(--yellow-2); font-size: 24px; }
.ev-col-row .ev-col-title {
  color: #fff; display: block; font-size: 28px; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev-col-row .ev-cat { font-size: 20px; }
.ev-col-empty { font-size: 30px; color: var(--cream); opacity: 0.5; }
