/* PERMASLOP TV — public-access cable. Character-generator type, blue
   bulletin-board slides, and the production values of a channel nobody
   is watching at 3am. */
:root {
  --bb: #0e2196;            /* bulletin-board field */
  --bb-dk: #050c3f;
  --bb-dp: #030720;
  --bb-lt: #2a49d8;
  --bb-edge: #5f7dff;
  --cyan: #37d9ff;
  --yellow: #ffd400;
  --magenta: #ff3fa4;
  --green: #29e07a;
  --red: #e8232b;
  --white: #f2f5ff;
  --dim: #a9b8ee;

  --cg: "Archivo Black", Impact, "Arial Black", sans-serif;
  --dot: DotGothic16, ui-monospace, Menlo, monospace;
  --font: Archivo, ui-sans-serif, -apple-system, system-ui, sans-serif;

  /* the hard offset shadow every cheap character generator baked in */
  --cgshadow: 3px 3px 0 rgba(0,0,0,.62);
  --cgshadow-sm: 2px 2px 0 rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
html, body { height: 100%; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0; color: var(--white); font-family: var(--font);
  display: flex; flex-direction: column; overflow: hidden;
  max-width: 100vw;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.13) 0 2px, transparent 2px 4px),
    radial-gradient(150% 105% at 50% 0%, var(--bb-lt) 0%, var(--bb) 38%, var(--bb-dk) 82%, var(--bb-dp) 100%);
}

/* ------------------------------------------------------------- CG header */
.bar {
  display: flex; align-items: center; gap: 22px; flex: none;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.30));
  border-bottom: 3px solid var(--cyan);
  box-shadow: 0 4px 0 rgba(0,0,0,.42);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 {
  font-family: var(--cg); font-size: 25px; line-height: 1; margin: 0;
  letter-spacing: .01em; text-transform: uppercase; color: var(--white);
  text-shadow: var(--cgshadow);
}
.brand h1 em { font-style: normal; color: var(--yellow); }

/* tally light */
.dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: #2b3a7a; box-shadow: inset 0 0 0 2px rgba(0,0,0,.5);
}
.dot.live { background: var(--red); animation: tally 1.5s steps(1) infinite; }
@keyframes tally {
  0%, 55% { box-shadow: inset 0 0 0 2px rgba(0,0,0,.5), 0 0 12px 3px rgba(232,35,43,.85); }
  56%, 100% { box-shadow: inset 0 0 0 2px rgba(0,0,0,.5), 0 0 3px 0 rgba(232,35,43,.35); }
}

/* the telethon ask */
.donate {
  display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0;
  padding: 5px 9px 5px 12px;
  background: rgba(3,7,32,.55); border: 2px solid var(--bb-edge);
}
.donate-label {
  font-family: var(--cg); font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--yellow);
  text-shadow: var(--cgshadow-sm); margin-right: 3px; white-space: nowrap;
}
.donate-btn {
  font-family: var(--cg); font-size: 12px; letter-spacing: .02em;
  color: #fff; text-decoration: none; padding: 6px 11px;
  background: linear-gradient(180deg, #ff4a52, var(--red) 62%, #a8141b);
  border: 2px solid rgba(0,0,0,.6);
  box-shadow: 2px 2px 0 rgba(0,0,0,.45); text-shadow: var(--cgshadow-sm);
  transition: transform .08s, filter .12s;
}
.donate-btn:hover { filter: brightness(1.14); }
.donate-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 rgba(0,0,0,.45); }

/* dot-matrix readouts, the way a CG rendered them */
.meters { display: flex; gap: 8px; margin-left: 14px; min-width: 0; }
.meter {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  min-width: 76px; padding: 3px 9px 2px;
  background: rgba(3,7,32,.62); border: 2px solid var(--bb-edge); border-radius: 2px;
}
.meter label {
  font-family: var(--font); font-size: 8px; font-weight: 700;
  letter-spacing: .17em; text-transform: uppercase; color: var(--cyan);
}
.meter span {
  font-family: var(--dot); font-size: 19px; line-height: 1.15; color: var(--yellow);
  font-variant-numeric: tabular-nums; text-shadow: var(--cgshadow-sm);
}

/* ------------------------------------------------------------------ main */
main { flex: 1; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 384px; }
.stage { display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 16px; gap: 12px; }

/* ------------------------------------------------------- the feed window */
.screen {
  position: relative; flex: 1; min-height: 0; min-width: 0; overflow: hidden;
  aspect-ratio: 16 / 9; max-width: 100%; margin: 0 auto;
  background: #01030f;
  border: 3px solid var(--cyan);
  box-shadow: 6px 6px 0 rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.8) inset;
}
#tv {
  width: 100%; height: 100%; min-width: 0; max-width: 100%;
  object-fit: contain; display: block; background: #01030f;
}

/* tape artefacts: scanlines, a soft vignette and a slow tracking band */
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(128% 112% at 50% 50%, transparent 62%, rgba(0,0,0,.42) 100%),
    repeating-linear-gradient(to bottom, rgba(0,0,0,.19) 0 1px, transparent 1px 3px);
}
.scanlines::after {
  content: ''; position: absolute; left: 0; right: 0; height: 62px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.055) 45%, transparent);
  animation: tracking 7.5s linear infinite;
}
@keyframes tracking { from { top: -70px; } to { top: 100%; } }

.badge, .feed-badge {
  position: absolute; top: 12px; font-family: var(--cg); font-size: 11px;
  letter-spacing: .05em; padding: 6px 10px; text-transform: uppercase;
  border: 2px solid rgba(0,0,0,.55); z-index: 4; text-shadow: var(--cgshadow-sm);
}
.badge { left: 12px; background: var(--red); color: #fff; box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.feed-badge { left: 84px; background: var(--green); color: #032b15; box-shadow: 3px 3px 0 rgba(0,0,0,.5); text-shadow: none; }
.feed-badge.paid { background: var(--red); color: #fff; text-shadow: var(--cgshadow-sm); }

.viewers {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  display: flex; align-items: center; gap: 6px;
  background: rgba(3,7,32,.82); border: 2px solid var(--bb-edge);
  color: var(--white); font-family: var(--dot); font-size: 15px; line-height: 1;
  padding: 6px 11px; letter-spacing: .04em; white-space: nowrap;
}
.viewers i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px rgba(41,224,122,.9); animation: blip 2.2s ease-in-out infinite;
  flex: none;
}
@keyframes blip { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.viewers b { color: var(--yellow); font-weight: 400; }
.viewers .lbl { margin-left: 2px; }

.sound {
  position: absolute; bottom: 12px; left: 12px; z-index: 4;
  background: rgba(3,7,32,.8); color: var(--white);
  border: 2px solid var(--bb-edge); border-radius: 0;
  font-size: 22px; font-weight: 700; padding: 12px 24px; cursor: pointer;
  display: flex; align-items: center; gap: 9px; line-height: 1;
}
.sound:hover { border-color: var(--yellow); color: var(--yellow); }

/* the please-stand-by slide */
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 26px; z-index: 3;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.13) 0 2px, transparent 2px 4px),
    radial-gradient(120% 100% at 50% 32%, var(--bb-lt), var(--bb) 44%, var(--bb-dk) 100%);
}
.overlay .big {
  font-family: var(--cg); font-size: 46px; line-height: 1.05; letter-spacing: .02em;
  text-transform: uppercase; color: var(--white); text-shadow: 4px 4px 0 rgba(0,0,0,.6);
}
.overlay .sub {
  color: var(--yellow); font-size: 14px; margin: 16px 0 20px; max-width: 470px;
  line-height: 1.6; font-weight: 600; text-shadow: var(--cgshadow-sm);
}

.overlay-donate { margin-top: 2px; }
.overlay-donate-label {
  font-family: var(--cg); font-size: 15px; line-height: 1.45; color: var(--white);
  text-transform: uppercase; letter-spacing: .02em; margin-bottom: 13px;
  text-shadow: var(--cgshadow);
}
.overlay-donate-row { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.overlay-donate-row .donate-btn { font-size: 16px; padding: 11px 20px; }

/* ------------------------------------------------------- call-in buttons */
.emoji-bar {
  position: absolute; right: 12px; bottom: 12px; z-index: 5;
  display: flex; gap: 6px; padding: 6px 8px;
  background: rgba(3,7,32,.8); border: 2px solid var(--bb-edge);
  box-shadow: 3px 3px 0 rgba(0,0,0,.5);
}
.emoji-btn {
  width: 32px; height: 32px; padding: 0; cursor: pointer;
  border: 2px solid var(--bb-edge); border-radius: 0; font-size: 16px; line-height: 1;
  background: linear-gradient(180deg, var(--bb-lt), var(--bb));
  transition: transform .1s, background .1s;
}
.emoji-btn:hover { background: linear-gradient(180deg, #4a68ff, var(--bb-lt)); border-color: var(--yellow); }
.emoji-btn:active { transform: translate(1px, 2px); }
.emoji-btn.pop { animation: pop .32s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.5) rotate(-10deg); } 100% { transform: scale(1); } }

.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.floater {
  position: absolute; bottom: 58px; font-size: 29px; will-change: transform, opacity;
  animation: rise 3s ease-out forwards;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.55));
}
@keyframes rise {
  0%   { transform: translate(0,0) scale(.5) rotate(0deg); opacity: 0; }
  12%  { transform: translate(0,-26px) scale(1.14) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--drift,0), -76vh) scale(.9) rotate(var(--spin,0deg)); opacity: 0; }
}

/* ------------------------------------------------------ lower-third crawl */
.ticker {
  display: flex; align-items: stretch; flex: none; min-height: 46px;
  background: linear-gradient(180deg, var(--bb-lt), var(--bb) 65%);
  border: 3px solid var(--cyan); box-shadow: 5px 5px 0 rgba(0,0,0,.45);
}
.ticker-label {
  display: flex; align-items: center; flex: none;
  font-family: var(--cg); font-size: 11px; letter-spacing: .06em; color: #fff;
  background: var(--red); padding: 0 13px; text-transform: uppercase;
  border-right: 3px solid var(--cyan); text-shadow: var(--cgshadow-sm);
}
.ticker-text {
  display: block; min-width: 0; flex: 1 1 0; align-self: center; padding: 0 14px;
  font-size: 14.5px; font-weight: 600; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: var(--cgshadow-sm);
}

/* ------------------------------------------------- community bulletin board */
.chat {
  min-width: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.11) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, var(--bb) 0%, var(--bb-dk) 100%);
  border-left: 3px solid var(--cyan);
  display: flex; flex-direction: column; min-height: 0;
}
.chat-head { padding: 13px 16px 12px; flex: none; border-bottom: 2px solid var(--bb-edge); }
.chat-head h2 {
  margin: 0; font-family: var(--cg); font-size: 16px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--yellow); text-shadow: var(--cgshadow-sm);
}
.chat-head p { margin: 7px 0 0; font-size: 11.5px; color: var(--dim); line-height: 1.55; }

.round-bar {
  display: flex; justify-content: space-between; align-items: center; flex: none;
  gap: 10px; min-width: 0;
  padding: 5px 16px; background: rgba(3,7,32,.6);
  border-bottom: 2px solid var(--bb-edge);
  font-family: var(--dot); font-size: 15px; color: var(--cyan);
}
#next-pick { color: var(--yellow); text-shadow: var(--cgshadow-sm); white-space: nowrap; }
#round-count { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.last-pick {
  padding: 11px 16px; flex: none;
  background: linear-gradient(90deg, rgba(255,212,0,.20), rgba(255,212,0,.03));
  border-bottom: 2px solid var(--yellow);
}
.last-pick label {
  display: block; font-family: var(--cg); font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--yellow); margin-bottom: 4px;
}
.last-pick span { font-size: 13px; line-height: 1.5; display: block; overflow-wrap: anywhere; color: var(--white); }
.last-pick i { font-style: normal; font-size: 11px; color: var(--cyan); font-weight: 700; }

.chat-log { flex: 1; overflow-y: auto; padding: 13px 16px; display: flex; flex-direction: column; gap: 9px; }

/* every post is its own little bulletin-board slide */
.msg {
  font-size: 13px; line-height: 1.5; color: var(--white);
  background: linear-gradient(180deg, rgba(95,125,255,.26), rgba(5,12,63,.5));
  border: 2px solid var(--bb-edge); padding: 8px 11px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4);
}
.msg .who {
  display: block; color: var(--yellow); font-family: var(--cg);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px;
}
.msg .txt { overflow-wrap: anywhere; }
.msg.empty {
  color: var(--dim); font-size: 12px; line-height: 1.6; font-style: italic;
  background: none; border: 2px dashed rgba(95,125,255,.5); box-shadow: none;
}

.station {
  padding: 5px 16px; flex: none; min-height: 26px;
  background: var(--bb-dp); color: var(--green);
  font-family: var(--dot); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.chat-form {
  border-top: 2px solid var(--bb-edge); padding: 11px 16px 14px; flex: none;
  background: rgba(3,7,32,.45);
}
.chat-row { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; }
.chat-form textarea, input {
  background: rgba(3,7,32,.75); border: 2px solid var(--bb-edge); color: var(--white);
  border-radius: 0; padding: 9px 11px; font-family: var(--font); font-size: 13px;
  width: 100%; resize: none; outline: none;
}
.chat-form textarea:focus, input:focus { border-color: var(--yellow); }
.chat-form textarea::placeholder, input::placeholder { color: #7285c9; }

/* ----------------------------------------------------------- CG buttons */
button { font-family: var(--font); cursor: pointer; }
.primary {
  background: linear-gradient(180deg, #ff4a52, var(--red) 60%, #a8141b);
  color: #fff; border: 2px solid rgba(0,0,0,.6); border-radius: 0;
  padding: 10px 18px; font-family: var(--cg); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
  box-shadow: 3px 3px 0 rgba(0,0,0,.45); text-shadow: var(--cgshadow-sm);
}
.primary:hover { filter: brightness(1.1); }
.primary:active { transform: translate(2px, 3px); box-shadow: 0 0 0 rgba(0,0,0,.45); }
.primary:disabled { background: #4a548f; color: #98a3d4; box-shadow: 3px 3px 0 rgba(0,0,0,.3); cursor: not-allowed; filter: none; }
.hidden { display: none !important; }

/* ------------------------------------------------- off-air replay page */
.notice { padding: 22px 20px; display: flex; flex-direction: column; gap: 0; }
.notice h2 {
  margin: 0; font-family: var(--cg); font-size: 26px; line-height: 1.1;
  text-transform: uppercase; color: var(--yellow); text-shadow: var(--cgshadow);
}
.notice-lede {
  margin: 12px 0 22px; font-size: 15px; line-height: 1.5; color: var(--white); font-weight: 600;
}
.explainer { margin: 16px 0 14px; }
.explainer p { margin: 0 0 11px; font-size: 14px; line-height: 1.6; color: var(--dim); }
.explainer p b { color: var(--white); font-weight: 700; }
.explainer .explainer-now {
  margin-top: 14px; padding-top: 13px; border-top: 2px solid var(--bb-edge);
  color: var(--cyan); font-weight: 600;
}
.notice-lede { margin: 0 0 20px; }

.waitlist label {
  display: block; font-family: var(--cg); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 8px;
}
.waitlist-row { display: flex; gap: 8px; }
.waitlist-row input { flex: 1 1 auto; min-width: 0; }
.waitlist-msg { margin: 10px 0 0; font-family: var(--dot); font-size: 14px; min-height: 18px; color: var(--dim); }
.waitlist-msg.ok { color: var(--green); }
.waitlist-msg.bad { color: #ff8a8a; }

.notice-donate { margin-top: 26px; padding-top: 20px; border-top: 2px solid var(--bb-edge); }
.notice-donate-label {
  font-family: var(--cg); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 11px;
}
.notice-donate .overlay-donate-row { justify-content: flex-start; }
.notice-donate .donate-btn { font-size: 14px; padding: 9px 15px; }

/* the replay reel has no live chrome, so the panel is free to breathe */
body.replay .chat { justify-content: flex-start; }
/* Size the reel from its width so the frame hugs the 16:9 picture instead of
   stretching tall and letterboxing it. */
body.replay .stage { justify-content: center; }
body.replay .screen { flex: 0 1 auto; width: 100%; height: auto; }

@media (max-width: 1000px) {
  main { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  .chat { border-left: none; border-top: 3px solid var(--cyan); }
  .stage { flex: none; }
  .screen { flex: none; height: auto; width: 100%; }
}

/* phones: the header has to wrap instead of running off the screen, and the
   writers' room gets whatever height is left rather than a fixed sliver. */
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 11px; }
  .brand { flex: 1 1 auto; gap: 9px; }
  .brand h1 { font-size: 17px; }
  .dot { width: 12px; height: 12px; }

  .meters { order: 2; margin-left: auto; gap: 5px; }
  .meter.hide-sm { display: none; }
  .meter { min-width: 0; padding: 3px 8px; }
  .meter label { font-size: 7.5px; letter-spacing: .1em; }
  .meter span { font-size: 16px; }

  .donate { order: 3; width: 100%; margin-left: 0; gap: 5px; padding: 5px 7px; }
  .donate-label { display: inline; font-size: 9px; margin-right: 1px; flex: 0 1 auto; overflow: hidden; }
  .donate-btn { flex: 1 1 0; text-align: center; font-size: 12px; padding: 8px 4px; }

  .stage { padding: 9px; gap: 8px; }
  .screen { border-width: 3px; }
  .badge, .feed-badge, .viewers { top: 8px; font-size: 10px; padding: 4px 7px; }
  .badge { left: 8px; }
  .feed-badge { left: 68px; }
  .viewers { right: 8px; font-size: 13px; }
  /* icon only on a phone: still a big tap target, but it stops the controls
     from covering the whole bottom of the picture. */
  .sound { bottom: 7px; left: 7px; font-size: 21px; padding: 9px 11px; gap: 0; }
  .sound .lbl { display: none; }
  .viewers .lbl { display: none; }
  .viewers b { margin-left: 1px; }
  .emoji-bar { right: 7px; bottom: 7px; gap: 2px; padding: 4px 5px; }
  .emoji-btn { width: 21px; height: 21px; font-size: 11px; border-width: 1px; }
  .floater { bottom: 46px; font-size: 22px; }

  .ticker { min-height: 40px; border-width: 2px; }
  .ticker-label { font-size: 10px; padding: 12px 9px; border-right-width: 2px; }
  .ticker-text { font-size: 12.5px; padding: 0 10px; }

  /* Simple on a phone: no panel title, no station ticker - just who's on air,
     the board, and somewhere to type. */
  .chat-head { display: none; }
  .station { display: none; }
  .round-bar { padding: 6px 13px; font-size: 13px; border-top: 2px solid var(--bb-edge); }
  .last-pick { padding: 9px 13px; }
  .chat-log { padding: 10px 13px; gap: 8px; }
  .chat-form { padding: 9px 13px 11px; }

  .notice { padding: 16px 14px 22px; }
  .notice h2 { font-size: 21px; }
  .notice-lede { font-size: 14px; margin: 10px 0 18px; }
  .explainer { margin: 13px 0 16px; }
  .explainer p { font-size: 13.5px; margin-bottom: 10px; }
  .notice-donate { margin-top: 20px; padding-top: 16px; }
  .notice-donate .donate-btn { font-size: 13px; padding: 8px 12px; }
}
