:root {
  --crt: 0.72;
  --accent: #fca311;
  --accent-dim: #b87400;
  --text: #f0e6d0;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Noto Sans TC", sans-serif;
  color: var(--text);
}

/* ── Viewport centering ── */
.tv-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: calc(100vh - 2rem);
  height: calc(100dvh - 2rem);
  background: radial-gradient(ellipse at 50% 45%, #1e1810 0%, #000 70%);
  position: relative;
  z-index: 1;
}

/* ── TV wrapper ── */
.tv-wrapper {
  position: relative;
  aspect-ratio: 1024 / 768;
  height: 100%;
  max-width: 100%;
}

/* ── TV frame photograph ── */
.tv-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 5;
  filter: brightness(0.92) contrast(1.05);
}

/* ── Screen area ── */
.screen {
  position: absolute;
  left: 3.5%;
  top: 7%;
  width: 72%;
  height: 86%;
  z-index: 2;
  overflow: hidden;
  background: #000;
  border-radius: 3% / 4%;
}

/* YouTube player */
#player-host,
#player-host iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  z-index: 1 !important;
}

/* ── CRT scan lines ── */
.crt-scanlines {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: calc(var(--crt) * 0.6);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(0,0,0,0.25) 2px,
      rgba(0,0,0,0.25) 3px
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 3px,
      rgba(0,0,0,0.08) 3px,
      rgba(0,0,0,0.08) 4px
    );
}

/* ── Vignette ── */
.crt-vignette {
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  opacity: calc(var(--crt) * 0.55 + 0.15);
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 42%,
    rgba(0,0,0,0.75) 100%
  );
}

/* ── Snow canvas — fully opaque to cover video ── */
.snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 14;
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-out;
}
.snow.active { opacity: 1; }

/* ── Snow status text ── */
.snow-status {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  font-family: "VT323", monospace;
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  color: #ccc;
  text-shadow: 0 0 6px rgba(255,255,255,0.5);
  letter-spacing: 0.15em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.snow-status.visible { opacity: 1; }

/* ── iOS play CTA button ── */
.ios-play-btn {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  font-family: "VT323", monospace;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  color: #fff;
  background: rgba(252, 163, 17, 0.85);
  border: 2px solid #fca311;
  border-radius: 6px;
  padding: 0.4em 1.2em;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 0 12px rgba(252,163,17,0.4);
  transition: background 0.2s, box-shadow 0.2s;
}
.ios-play-btn:hover,
.ios-play-btn:focus {
  background: rgba(252, 163, 17, 1);
  box-shadow: 0 0 20px rgba(252,163,17,0.6);
}

/* ── CRT power effect overlay ──
   Two-layer approach: .crt-flash = black background,
   ::after = bright phosphor glow line/dot.
   This mimics real CRT: glow on black, not white flash. */
.crt-flash {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #000;
  pointer-events: none;
}
.crt-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #e8eeff;
  box-shadow: 0 0 40px 15px rgba(180, 200, 255, 0.4);
  opacity: 0;
}

/* TV off: solid black, no glow */
.crt-flash.off        { opacity: 1; }
.crt-flash.off::after  { opacity: 0; }

/* TV on (clear): fully transparent */
.crt-flash.clear        { opacity: 0; }
.crt-flash.clear::after  { opacity: 0; }

/* ── Power ON: black → bright line expands → fades ── */
.crt-flash.anim-on {
  animation: crt-on-bg 1.1s ease-out forwards;
}
.crt-flash.anim-on::after {
  animation: crt-on-glow 1.1s ease-out forwards;
}

@keyframes crt-on-bg {
  0%   { opacity: 1; }
  40%  { opacity: 1; }
  70%  { opacity: 0.4; }
  100% { opacity: 0; }
}
@keyframes crt-on-glow {
  0%   { transform: scaleX(0.7) scaleY(0.003); opacity: 1; }
  8%   { transform: scaleX(0.9) scaleY(0.004); opacity: 1; }
  35%  { transform: scaleX(1) scaleY(1); opacity: 0.85; }
  60%  { transform: scaleX(1) scaleY(1); opacity: 0.3; }
  100% { transform: scaleX(1) scaleY(1); opacity: 0; }
}

/* ── Power OFF: collapse to line → dot → fade on black ── */
.crt-flash.anim-off {
  animation: crt-off-bg 1.3s ease-in forwards;
}
.crt-flash.anim-off::after {
  animation: crt-off-glow 1.3s ease-in forwards;
}

@keyframes crt-off-bg {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes crt-off-glow {
  0%   { transform: scaleX(1) scaleY(1); opacity: 0.7; }
  8%   { transform: scaleX(1) scaleY(1); opacity: 0.9; }
  30%  { transform: scaleX(1) scaleY(0.004); opacity: 1; }
  55%  { transform: scaleX(0.006) scaleY(0.004); opacity: 1; }
  75%  { transform: scaleX(0.006) scaleY(0.004); opacity: 0.5; }
  100% { transform: scaleX(0.006) scaleY(0.004); opacity: 0; }
}

/* ── Click guard ── */
.click-guard {
  position: absolute;
  inset: 0;
  z-index: 18;
  cursor: default;
}

/* ── OSD now-playing ──
   Positioned OUTSIDE .screen to avoid stacking context issues.
   Overlaid on top of TV screen area at bottom-right. */
.osd {
  position: absolute;
  /* Positioned relative to .tv-wrapper, over the screen hole */
  bottom: 10%;
  left: 4%;
  max-width: 68%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.3em 0.7em;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 3px;
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.5vw, 1.05rem);
  color: #fff;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.osd.show { opacity: 1; }
.osd-label {
  color: #fca311;
  flex-shrink: 0;
}
.osd-title {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.osd-title-text {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* is-long: title overflows — stays static (shows front) until triggered */
.osd-title-text.is-long {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
/* marquee-play: one-shot scroll forward to end, pause, scroll back */
.osd-title-text.is-long.marquee-play {
  animation: marquee-once var(--marquee-duration, 6s) ease-in-out 1;
}
@keyframes marquee-once {
  0%,  12% { transform: translateX(0); }
  55%, 78% { transform: translateX(var(--marquee-offset, 0px)); }
  100%     { transform: translateX(0); }
}

/* ── YouTube link in OSD ── */
.osd-yt-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.4em;
  color: #888;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  border-radius: 2px;
  transition: color 0.2s, background 0.2s;
  opacity: 0;
  transition: opacity 0.4s, color 0.2s;
}
.osd-yt-link svg { width: 1.1em; height: 1.1em; }
.osd.show .osd-yt-link { opacity: 1; }
.osd-yt-link:hover {
  color: #ff0000;
  background: rgba(255, 255, 255, 0.12);
}
.osd-yt-link:active { transform: scale(0.9); }

/* ── Power button ── */
.power-btn {
  position: absolute;
  left: 85.5%;
  top: 30%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: clamp(24px, 3.4vw, 50px);
  height: clamp(24px, 3.4vw, 50px);
  border-radius: 4px;
  border: 2px solid #666;
  background: radial-gradient(circle at 40% 35%, #888, #333);
  color: #aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.6),
    inset 0 1px 2px rgba(255,255,255,0.1);
  transition: box-shadow 0.2s, transform 0.1s, color 0.25s, border-color 0.25s;
}
.power-btn svg { width: 55%; height: 55%; }
.power-btn:hover {
  box-shadow:
    0 2px 8px rgba(0,0,0,0.7),
    0 0 12px rgba(252,163,17,0.3);
}
.power-btn:active { transform: translate(-50%, -50%) scale(0.9); }
.power-btn.on {
  color: #4f4;
  border-color: #4a4;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.6),
    0 0 10px rgba(60,220,60,0.4);
}

/* ── Status LED ── */
.led {
  position: absolute;
  left: 93%;
  top: 5.5%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: clamp(5px, 0.55vw, 8px);
  height: clamp(5px, 0.55vw, 8px);
  border-radius: 50%;
  background: #333;
  transition: background 0.3s, box-shadow 0.3s;
}
.led.on {
  background: #d00;
  box-shadow: 0 0 4px #f33, 0 0 10px rgba(220,0,0,0.5);
  animation: blink 1.2s ease-in-out infinite;
}

/* ── Bottom bar ── */
.bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(2rem + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem env(safe-area-inset-bottom);
  background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.6));
  backdrop-filter: blur(4px);
}
.bar-title {
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.6vw, 0.95rem);
  color: var(--accent);
  letter-spacing: 0.12em;
  opacity: 0.85;
}
.bar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bar-controls label,
.bar-controls output {
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: var(--accent-dim);
  letter-spacing: 0.04em;
}
#crt-slider {
  width: min(120px, 20vw);
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}

/* ── Animations ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.15; }
}

/* ── Sponsor button ── */
.sponsor-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: var(--accent-dim);
  text-decoration: none;
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 0.05em 0.5em;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
  flex-shrink: 0;
  line-height: 1.4;
}
.sponsor-btn svg {
  width: 0.85em;
  height: 0.85em;
  flex-shrink: 0;
}
.sponsor-btn:hover {
  color: #ff6b81;
  border-color: #ff6b81;
  background: rgba(255, 107, 129, 0.1);
}
.sponsor-btn:hover svg { fill: #ff6b81; }
.sponsor-btn:active { transform: scale(0.95); }

/* ── Member button ── */
.member-btn {
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: var(--accent-dim);
  background: none;
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 0.05em 0.5em;
  letter-spacing: 0.06em;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.4;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.member-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.member-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  cursor: default;
  opacity: 0.7;
}

/* ── Ad badge (top-right of screen area) ── */
.ad-badge {
  position: absolute;
  top: 9%;
  left: 60%;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.2em 0.7em;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(252, 163, 17, 0.4);
  border-radius: 3px;
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.4vw, 0.95rem);
  color: var(--accent);
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.ad-badge.show {
  opacity: 1;
  pointer-events: auto;
}
.ad-unlock-btn {
  font-family: "VT323", monospace;
  font-size: inherit;
  color: #888;
  background: none;
  border: 1px solid #555;
  border-radius: 2px;
  padding: 0 0.4em;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: color 0.2s, border-color 0.2s;
}
.ad-unlock-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Unlock modal ── */
.unlock-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.unlock-modal.show {
  opacity: 1;
  pointer-events: auto;
}
.unlock-box {
  position: relative;
  width: min(400px, 90vw);
  padding: 2em 2em 1.6em;
  background: #111;
  border: 2px solid #444;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.8),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}
/* CRT scanlines on the modal */
.unlock-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 2px,
    rgba(0, 0, 0, 0.4) 2px, rgba(0, 0, 0, 0.4) 3px
  );
}
.unlock-title {
  font-family: "VT323", monospace;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.2em;
  margin-bottom: 0.4em;
  text-shadow: 0 0 8px rgba(252, 163, 17, 0.4);
}
.unlock-desc {
  font-family: "VT323", monospace;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: #999;
  text-align: center;
  letter-spacing: 0.1em;
  margin-bottom: 1.2em;
}
.unlock-buy-link {
  color: var(--accent-dim);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-dim);
  transition: color 0.2s, border-color 0.2s;
}
.unlock-buy-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.unlock-input-row {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8em;
}
.unlock-input {
  width: 100%;
  max-width: 300px;
  padding: 0.5em 0.7em;
  font-family: "VT323", monospace;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #0f0;
  background: #0a0a0a;
  border: 1px solid #444;
  border-radius: 3px;
  text-align: center;
  letter-spacing: 0.15em;
  caret-color: #0f0;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.unlock-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(252, 163, 17, 0.2);
}
.unlock-input::placeholder {
  color: #333;
  letter-spacing: 0.1em;
}
.unlock-msg {
  font-family: "VT323", monospace;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  text-align: center;
  letter-spacing: 0.08em;
  min-height: 1.4em;
  margin-bottom: 0.8em;
}
.unlock-msg.success { color: #4f4; text-shadow: 0 0 6px rgba(60, 220, 60, 0.4); }
.unlock-msg.error { color: #f44; text-shadow: 0 0 6px rgba(255, 60, 60, 0.3); }
.unlock-actions {
  display: flex;
  justify-content: center;
  gap: 1em;
}
.unlock-btn {
  font-family: "VT323", monospace;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: #111;
  background: var(--accent);
  border: none;
  border-radius: 3px;
  padding: 0.3em 1.5em;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: background 0.2s, transform 0.1s;
}
.unlock-btn:hover { background: #fdb83d; }
.unlock-btn:active { transform: scale(0.95); }
.unlock-btn-dim {
  color: #aaa;
  background: #333;
  border: 1px solid #555;
}
.unlock-btn-dim:hover { background: #444; }

/* ── Fullscreen button ── */
.fullscreen-btn {
  background: none;
  border: 1px solid var(--accent-dim);
  color: var(--accent-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 3px;
  padding: 2px;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
.fullscreen-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.fullscreen-btn svg { width: 100%; height: 100%; }

/* ── Fullscreen state ── */
:fullscreen .tv-container,
:-webkit-full-screen .tv-container {
  height: 100vh;
  height: 100dvh;
}
:fullscreen .bar,
:-webkit-full-screen .bar {
  display: none;
}

/* ── Portrait / narrow viewports: switch to width-driven sizing ── */
@media (max-aspect-ratio: 1024/768) {
  .tv-wrapper {
    height: auto;
    width: 100%;
  }
}

/* ── Mobile ── */
@media (max-width: 560px) {
  .bar-title { display: none; }
  .bar { justify-content: center; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .crt-flash.anim-on,
  .crt-flash.anim-on::after,
  .crt-flash.anim-off,
  .crt-flash.anim-off::after {
    animation-duration: 0.01ms !important;
  }
  .led.on { animation: none; opacity: 1; }
  .snow { transition-duration: 0.01ms !important; }
  .snow-status { transition-duration: 0.01ms !important; }
  .osd-title-text.is-long.marquee-play { animation: none; }
  .unlock-modal { transition-duration: 0.01ms !important; }
}

/* ── Background button ── */
.bg-btn {
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: var(--accent-dim);
  background: none;
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 0.05em 0.5em;
  letter-spacing: 0.06em;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.4;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.bg-btn:hover, .bg-btn.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Background picker panel ── */
.bg-panel {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(600px, 96vw);
}
.bg-panel[hidden] { display: none; }
.bg-panel-inner {
  background: rgba(10, 10, 10, 0.97);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 0.8em 1em 0.9em;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}
.bg-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6em;
}
.bg-panel-title {
  font-family: "VT323", monospace;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--accent);
  letter-spacing: 0.15em;
}
.bg-panel-close {
  background: none;
  border: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0.2em;
  line-height: 1;
  transition: color 0.2s;
}
.bg-panel-close:hover { color: #fff; }

.bg-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4em;
  margin-bottom: 0.7em;
}
@media (max-width: 480px) {
  .bg-grid { grid-template-columns: repeat(4, 1fr); }
}
.bg-thumb {
  aspect-ratio: 16/10;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  transition: border-color 0.2s, transform 0.15s;
  outline: none;
}
.bg-thumb:hover  { border-color: #888; transform: scale(1.05); }
.bg-thumb.active { border-color: var(--accent); }

.bg-color-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  border-top: 1px solid #2a2a2a;
  padding-top: 0.6em;
}
.bg-color-label {
  font-family: "VT323", monospace;
  font-size: clamp(0.75rem, 1.8vw, 0.95rem);
  color: #aaa;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
#bg-color-picker {
  width: 2.2em;
  height: 1.6em;
  border: 1px solid #555;
  border-radius: 3px;
  background: none;
  cursor: pointer;
  padding: 1px;
}
.bg-color-apply {
  font-family: "VT323", monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  color: var(--accent-dim);
  background: none;
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 0.05em 0.6em;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color 0.2s, border-color 0.2s;
}
.bg-color-apply:hover { color: var(--accent); border-color: var(--accent); }

.bg-member-tag {
  color: var(--accent);
  font-size: 0.85em;
  opacity: 0.8;
}
.bg-upload-locked {
  opacity: 0.5;
  cursor: pointer;
}

/* ── Debug overlay (?debug) ── */
#debug-overlay {
  position: fixed;
  top: 0; left: 0;
  width: min(480px, 100vw);
  max-height: 40vh;
  overflow-y: auto;
  z-index: 9999;
  margin: 0;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #0f0;
  font: 11px/1.4 "VT323", monospace;
  pointer-events: auto;
  white-space: pre;
}
