/* PANDA TV — live channels + tape + headlines. Not a trading book. */
:root {
  --bg: #050506;
  --bg-2: #0a0a0c;
  --metal: #141417;
  --metal-2: #1b1b20;
  --metal-edge: #2c2c33;
  --steel: #9a9aa4;
  --steel-hi: #d4d4dc;
  --ink: #ececf0;
  --mute: #7c7c86;
  --red: #ff1a1a;
  --red-hot: #ff0030;
  --red-dim: #3a0707;
  --green: #00ff7a;
  --green-dim: #062816;
  --line: rgba(255, 255, 255, 0.07);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-ui: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --wash-top: rgba(180, 0, 12, 0.22);
  --wash-bot: rgba(40, 0, 0, 0.35);
}

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

html, body { min-height: 100%; background: var(--bg); color: var(--ink); }
html { color-scheme: dark; }

body {
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  overflow-x: hidden;
  background-color: var(--bg);
  transition: background-color 8s ease;
  background-image:
    radial-gradient(ellipse 90% 42% at 50% -8%, var(--wash-top), transparent 58%),
    radial-gradient(ellipse 55% 34% at 80% 110%, var(--wash-bot), transparent 52%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 48px);
  background-repeat: no-repeat;
}

img { display: block; max-width: 100%; }
code { font-family: var(--font-mono); color: var(--steel-hi); }

.grit {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/></svg>");
}

.red-wash {
  position: fixed;
  inset: auto 0 0 0;
  height: 28vh;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to top, rgba(255, 20, 20, 0.07), transparent 70%);
}

.kaiju {
  position: fixed;
  right: -2%;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  height: 91vh;
  width: auto;
  max-width: 54vw;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  opacity: 0.82;
  mix-blend-mode: normal;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, rgba(0,0,0,0.45) 6%, #000 16%),
    linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 7%, #000 16%),
    linear-gradient(to top, transparent 0%, #000 10%);
  mask-image:
    linear-gradient(to right, transparent 0%, rgba(0,0,0,0.45) 6%, #000 16%),
    linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 7%, #000 16%),
    linear-gradient(to top, transparent 0%, #000 10%);
  -webkit-mask-composite: source-in, source-in;
  mask-composite: intersect, intersect;
  transition: opacity 8s ease, filter 8s ease;
}
.kaiju img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom right;
  filter: brightness(0.95) saturate(1);
  transition: opacity 8s ease, filter 8s ease;
}
.kaiju::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, var(--bg) 0%, transparent 12%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 12%),
    linear-gradient(to top, rgba(5, 5, 6, 0.28) 0%, transparent 16%);
  transition: background 8s ease, opacity 8s ease;
}

.frame {
  position: relative;
  z-index: 5;
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 0;
}
.frame-lower { padding: 0 0 80px; }


/* —— MAST —— */
.mast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 8px 0 6px;
}

.brand {
  display: flex;
  gap: 22px;
  align-items: center;
  min-width: 0;
}

.logo-plate {
  position: relative;
  flex: 0 0 auto;
  width: min(132px, 32vw);
  aspect-ratio: 1;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 22%),
    linear-gradient(180deg, #1a1a1e, #0c0c0e);
  border: 1px solid var(--metal-edge);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -1px 0 rgba(0,0,0,.7),
    0 0 40px rgba(255, 20, 20, 0.18),
    var(--shadow);
}

.logo-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(1.08);
}

.rivet {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c8c8d0, #5a5a62 55%, #1a1a1c 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.25), inset 0 -1px 1px #000;
  z-index: 2;
}
.rivet.tl { top: 6px; left: 6px; }
.rivet.tr { top: 6px; right: 6px; }
.rivet.bl { bottom: 6px; left: 6px; }
.rivet.br { bottom: 6px; right: 6px; }

.brand-copy { min-width: 0; }

.kicker {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 6px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 9vw, 108px);
  line-height: 0.82;
  letter-spacing: 0.04em;
  font-weight: 400;
  background: linear-gradient(180deg, #f2f2f6 0%, #b8b8c0 42%, #5c5c64 50%, #cfcfd6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 10px 18px rgba(0,0,0,.6));
  margin-bottom: 12px;
}

.cp-plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 22px 4px;
  background: linear-gradient(180deg, #2a2a30, #101014);
  border: 1px solid #3a3a42;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 0 18px rgba(0,0,0,.65),
    0 0 24px rgba(255, 26, 26, 0.35);
}

.cp-glow {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.28em;
  color: var(--red);
  -webkit-text-fill-color: var(--red);
  text-shadow: 0 0 8px var(--red), 0 0 22px var(--red), 0 0 40px rgba(255, 0, 0, 0.7);
}

.desk-meta {
  text-align: right;
  padding: 10px 14px 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 30%),
    var(--metal);
  border: 1px solid var(--metal-edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--shadow);
  min-width: 220px;
}

.lamp-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}

.lamp {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2a2a2e;
  box-shadow: inset 0 2px 4px #000;
  border: 1px solid #111;
}
.lamp[data-state="live"] {
  background: radial-gradient(circle at 35% 30%, #b6ffd4, var(--green) 45%, #017a3a);
  box-shadow: 0 0 10px var(--green), 0 0 22px rgba(0,255,122,.45), inset 0 1px 0 rgba(255,255,255,.5);
}
.lamp[data-state="down"] {
  background: radial-gradient(circle at 35% 30%, #ffb0b0, var(--red) 45%, #7a0000);
  box-shadow: 0 0 10px var(--red), 0 0 22px rgba(255,26,26,.5), inset 0 1px 0 rgba(255,255,255,.4);
  animation: alarm 0.9s ease-in-out infinite;
}
.lamp[data-state="boot"] {
  background: radial-gradient(circle at 35% 30%, #ffe08a, #c9a227 50%, #4a3808);
  box-shadow: 0 0 8px #c9a227;
}

@keyframes alarm {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.lamp-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--steel);
}

.clock {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.session {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 4px 0 2px;
}

.quotes-asof {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* —— SLASH —— */
.slash-wrap { margin: 18px 0 8px; }
.slash { display: block; width: 100%; height: 56px; filter: drop-shadow(0 0 8px rgba(255,26,26,.65)); }


/* —— TICKER TAPE (full width, under header) —— */
.tape-bleed {
  position: relative;
  z-index: 5;
  width: 100%;
  background: #050506;
  border-top: 1px solid var(--metal-edge);
  border-bottom: 1px solid var(--metal-edge);
  overflow: hidden;
  min-height: 46px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.tape-bleed .tradingview-widget-container {
  width: 100%;
  height: 46px;
}
.tape-bleed .tradingview-widget-container__widget {
  height: 46px;
}
.tape-bleed .tradingview-widget-copyright {
  display: none;
}

/* —— NEXT ON (timed slate) —— */
.next-on {
  margin: 0;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--metal-edge);
  display: grid;
  gap: 4px;
}
.next-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 3px 0;
}
.next-row.is-now {
  background: linear-gradient(90deg, rgba(255, 26, 26, 0.12), transparent 70%);
  box-shadow: inset 2px 0 0 var(--red);
  padding-left: 10px;
  margin-left: -10px;
}
.next-t {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  white-space: nowrap;
}
.next-row.is-now .next-t {
  color: var(--red);
  text-shadow: 0 0 8px rgba(255, 26, 26, 0.45);
}
.next-k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  text-shadow: 0 0 8px rgba(255, 26, 26, 0.45);
  white-space: nowrap;
}
.next-k.is-mute,
.next-t.is-mute,
.next-row.is-mute .next-t,
.next-on.is-dark .next-k,
.next-on.is-dark .next-t {
  color: var(--mute);
  text-shadow: none;
}
.next-v {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink);
  min-width: 0;
}
.next-row.is-mute .next-v,
.next-on.is-dark .next-v {
  color: var(--mute);
}
.next-wait {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

/* —— BLOCKS —— */
.block { margin-top: 8px; min-width: 0; }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--metal-edge);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.12em;
  color: var(--steel-hi);
  font-weight: 400;
}

.block-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}

/* —— STAGE —— */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 22px;
  align-items: start;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tile {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07) 0%, transparent 18%),
    linear-gradient(180deg, #18181c 0%, #101014 100%);
  border: 1px solid var(--metal-edge);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    inset 0 -1px 0 rgba(0,0,0,.65),
    var(--shadow);
}

.tile::before,
.tile::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c8c8d0, #5a5a62 55%, #1a1a1c);
  top: 8px;
  z-index: 2;
  pointer-events: none;
}
.tile::before { left: 8px; }
.tile::after { right: 8px; }

.tile.is-focus {
  border-color: rgba(255, 26, 26, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    inset 0 0 0 1px rgba(255,26,26,.28),
    0 0 28px rgba(255, 26, 26, 0.18),
    var(--shadow);
}

.tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 10px;
}

.tile-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--steel-hi);
  line-height: 1;
}

.tile-off {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--metal-edge);
  padding: 2px 7px 1px;
  background: #0a0a0c;
}

.tile-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 58%;
}
.tile-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  padding: 3px 8px 2px;
  border: 1px solid var(--metal-edge);
  background: #0a0a0c;
  white-space: nowrap;
}
.tile-chip.is-focus-chip {
  color: var(--red);
  border-color: rgba(255,26,26,.45);
  text-shadow: 0 0 8px rgba(255,26,26,.45);
}
.tile-chip.is-live {
  color: var(--green);
  border-color: rgba(0, 255, 122, 0.5);
  text-shadow: 0 0 8px rgba(0, 255, 122, 0.4);
}
.tile-chip.is-slate {
  color: #d4b45a;
  border-color: rgba(201, 162, 39, 0.45);
}

.tile-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050506;
  border-top: 1px solid var(--metal-edge);
}

.tile-player iframe {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050506;
}

.tile-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  background: rgba(5, 5, 6, 0.18);
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.tile-hit:hover { background: rgba(5, 5, 6, 0.08); }
.tile.is-focus .tile-hit { display: none; }

.tile-hit span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-hi);
  background: rgba(10, 10, 12, 0.82);
  border: 1px solid var(--metal-edge);
  padding: 4px 8px 3px;
}

.tile-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--mute);
  border: 1px dashed var(--metal-edge);
}

/* —— HEADLINES —— */
.headlines-block {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 18%),
    var(--metal);
  border: 1px solid var(--metal-edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), var(--shadow);
  padding: 14px 14px 10px;
  position: sticky;
  top: 12px;
}

.headlines-block .block-head {
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.headlines {
  display: grid;
  gap: 0;
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.hl {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 11px 4px 11px 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.hl::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--metal-edge);
}
.hl:hover {
  background: rgba(255,255,255,.03);
}
.hl:hover::before {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.hl-title {
  display: block;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.hl-meta {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.hl-wait,
.hl-down {
  padding: 22px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}
.hl-wait { color: var(--steel); }
.hl-down {
  color: var(--red);
  text-shadow: 0 0 10px rgba(255,26,26,.45);
  border: 1px solid rgba(255,26,26,.35);
  background: var(--red-dim);
  padding: 18px 10px;
}

/* —— FOOT —— */
.foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--metal-edge);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--steel);
}
.foot-mute {
  margin-top: 6px;
  color: var(--mute);
  letter-spacing: 0.08em;
  font-size: 11px;
}

.noscript {
  position: relative;
  z-index: 6;
  margin: 16px auto;
  width: min(1320px, calc(100% - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(255,26,26,.4);
  background: var(--red-dim);
  font-family: var(--font-mono);
  color: var(--red);
}

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .headlines-block { position: static; }
  .headlines { max-height: none; }
}

@media (max-width: 720px) {
  .mast { grid-template-columns: 1fr; }
  .desk-meta { text-align: left; }
  .lamp-row { justify-content: flex-start; }
  .frame { width: min(1320px, calc(100% - 18px)); padding-top: 14px; }
  .logo-plate { width: min(96px, 28vw); }
  h1 { font-size: clamp(44px, 14vw, 72px); }
  .tiles { grid-template-columns: 1fr; }
  .next-row { grid-template-columns: 1fr; gap: 2px; }
  .next-row.is-now { margin-left: 0; padding-left: 8px; }
  .kaiju { height: 64vh; max-width: 68vw; right: -8%; }
}

/* —— TIME OF DAY (light plate shift + ape) —— */
body[data-tod="night"] {
  --bg: #040306;
  --wash-top: rgba(200, 8, 28, 0.3);
  --wash-bot: rgba(50, 0, 8, 0.42);
}
body[data-tod="night"] .kaiju { opacity: 0.72; }
body[data-tod="night"] .kaiju img {
  filter: brightness(0.82) saturate(0.95) sepia(0.18) hue-rotate(-16deg);
}
body[data-tod="night"] .kaiju::after {
  background:
    linear-gradient(to right, var(--bg) 0%, transparent 10%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 10%),
    linear-gradient(to top, rgba(30, 0, 4, 0.3) 0%, transparent 16%),
    linear-gradient(180deg, rgba(255, 40, 30, 0.07), transparent 48%);
}

body[data-tod="dawn"] {
  --bg: #08070a;
  --wash-top: rgba(210, 120, 30, 0.28);
  --wash-bot: rgba(80, 30, 0, 0.32);
}
body[data-tod="dawn"] .kaiju { opacity: 0.8; }
body[data-tod="dawn"] .kaiju img {
  filter: brightness(1.04) saturate(1.08) sepia(0.2) hue-rotate(-8deg);
}

body[data-tod="day"] {
  --wash-top: rgba(180, 0, 12, 0.18);
}
body[data-tod="day"] .kaiju { opacity: 0.88; }
body[data-tod="day"] .kaiju img {
  filter: brightness(1) saturate(1);
}

body[data-tod="dusk"] {
  --bg: #080403;
  --wash-top: rgba(220, 40, 10, 0.32);
  --wash-bot: rgba(70, 10, 0, 0.4);
}
body[data-tod="dusk"] .kaiju { opacity: 0.8; }
body[data-tod="dusk"] .kaiju img {
  filter: brightness(0.9) saturate(1.12) sepia(0.26) hue-rotate(-18deg);
}
body[data-tod="dusk"] .kaiju::after {
  background:
    linear-gradient(to right, var(--bg) 0%, transparent 10%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 10%),
    linear-gradient(to top, rgba(40, 8, 0, 0.32) 0%, transparent 16%),
    linear-gradient(180deg, rgba(255, 50, 10, 0.08), transparent 50%);
}

@media (max-width: 720px) {
  body[data-tod="night"] .kaiju { opacity: 0.66; }
  body[data-tod="dawn"] .kaiju { opacity: 0.74; }
  body[data-tod="day"] .kaiju { opacity: 0.78; }
  body[data-tod="dusk"] .kaiju { opacity: 0.74; }
}

@media (prefers-reduced-motion: reduce) {
  .lamp[data-state="down"] { animation: none; }
  body, .kaiju, .kaiju img, .kaiju::after { transition: none; }
}
