/* Transparent page for an OBS Browser Source (1920x1080 recommended). */

:root {
  --scale: 1;
  --c: #5b8def;
  --margin: 48px;
  --bg: .95;  /* card background opacity; the URL option bg= overrides it */
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #fff;
}

.card {
  position: absolute;
  display: flex;
  align-items: stretch;
  width: 640px;
  min-height: 112px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(14, 18, 24, var(--bg));
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .08);
  opacity: 0;
  transform: translateY(24px) scale(var(--scale));
  transition: opacity .35s ease, transform .35s ease;
}
.card.show { opacity: 1; transform: translateY(0) scale(var(--scale)); }

body.pos-bl .card { left: var(--margin); bottom: var(--margin); transform-origin: bottom left; }
body.pos-br .card { right: var(--margin); bottom: var(--margin); transform-origin: bottom right; }
body.pos-tl .card { left: var(--margin); top: 0; transform-origin: top left; }
body.pos-tr .card { right: var(--margin); top: 0; transform-origin: top right; }
body.pos-tl .card, body.pos-tr .card { border-top: none; border-radius: 0 0 14px 14px; transform: translateY(-24px) scale(var(--scale)); }
body.pos-tl .card.show, body.pos-tr .card.show { transform: translateY(0) scale(var(--scale)); }

.accent { flex: none; width: 8px; background: var(--c); transition: background .3s; }

.content { flex: 1; min-width: 0; padding: 14px 18px 14px 16px; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.top { display: flex; align-items: center; gap: 10px; }
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e5484d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.agency {
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--c);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.meta { margin-left: auto; font-size: 13px; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.channel {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.captions {
  margin-top: 8px;
  max-height: 2.9em;
  overflow: hidden;
  font-size: 19px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .68);
}
.captions:empty { display: none; }
.captions .w.spoken { color: #fff; }
.captions .w.active { color: #fff; text-decoration: underline; text-decoration-color: var(--c); text-underline-offset: 5px; text-decoration-thickness: 3px; }
body.no-captions .captions { display: none; }

.meter {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 18px 0 6px;
}
.meter span {
  display: block;
  width: 5px;
  height: 6px;
  border-radius: 3px;
  background: var(--c);
  transition: height .08s linear;
}

.card.delayed .live-tag { background: #d6912f; }

/* Between calls: "Scanning" (or "Off air" when the curator turns the stream off) */
.card.idle .live-tag { background: rgba(255, 255, 255, .22); }
.card.idle .agency { display: none; }
.card.idle .live-dot { animation-duration: 2s; }
.card.idle .channel { color: rgba(255, 255, 255, .92); }
.card.idle:not(.off) .channel::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.6s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}
.card.off .live-dot { animation: none; opacity: .4; }
.card.off .channel { color: rgba(255, 255, 255, .75); }
.captions .last-heard { font-size: 16px; color: rgba(255, 255, 255, .85); }

.key-error { top: 50%; text-align: center; line-height: 1.4; cursor: default; }
.notice {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #e5484d;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.hidden { display: none; }
