/* VT player of `itemtype: asciiAnimation` records (partials/vt-player.html + js/vtplay.js).
   Loaded only on a page that renders a player, together with the vendored
   vendor/asciinema-player/asciinema-player.css. Everything is scoped under .vt.
   → doc/vt_player.md */

.vt { margin: 0 0 22px; }
/* Before the script mounts it (and with no JS at all) the box keeps a terminal's shape, so the
   page does not jump when the player arrives: 80 columns × 0.6em against 24 rows × 1.2em = 5:3. */
.vt:not(.vt-ready) { aspect-ratio: 5 / 3; background: #0b0b0b; }
.vt-screen { background: #0b0b0b; overflow: hidden; }
.vt-bar {
  display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin-top: 5px;
  font: 13px/1.4 "DejaVu Sans Mono", "Courier New", monospace; color: var(--muted);
}
.vt-title { color: var(--text); flex: 1 1 auto; }
.vt-bar select { font: inherit; }
.vt-notes { font: 12px/1.4 "DejaVu Sans Mono", "Courier New", monospace; color: var(--muted); margin-top: 2px; }
.vt-notes .vt-missing { color: var(--orange-dark); }
.vt-fallback { margin: 0; padding: 12px; color: #dcdcdc; font-size: 13px; }
.vt-fallback a { color: #9cc9ff; }

/* VT100-like: white phosphor on black */
.asciinema-player-theme-vt100 {
  --term-color-foreground: #dcdcdc;
  --term-color-background: #0b0b0b;
  --term-color-0: #000000; --term-color-1: #cd3131; --term-color-2: #0dbc79; --term-color-3: #e5e510;
  --term-color-4: #2472c8; --term-color-5: #bc3fbc; --term-color-6: #11a8cd; --term-color-7: #e5e5e5;
  --term-color-8: #666666; --term-color-9: #f14c4c; --term-color-10: #23d18b; --term-color-11: #f5f543;
  --term-color-12: #3b8eea; --term-color-13: #d670d6; --term-color-14: #29b8db; --term-color-15: #ffffff;
}

/* Amber phosphor, after the amber DEC terminals (VT220/VT320 came in white, green and amber). A
   monochrome tube: every ANSI colour is drawn in the one phosphor, normal or bright, so a colour file
   plays the way it would have looked on such a screen. A faint glow on the text (the canvas-drawn
   block characters do not get it). */
.asciinema-player-theme-vt100-amber {
  --term-color-foreground: #ffb000;
  --term-color-background: #0b0b0b;
  --term-color-0: #0b0b0b; --term-color-1: #ffb000; --term-color-2: #ffb000; --term-color-3: #ffb000;
  --term-color-4: #ffb000; --term-color-5: #ffb000; --term-color-6: #ffb000; --term-color-7: #ffb000;
  --term-color-8: #a87400; --term-color-9: #ffcc55; --term-color-10: #ffcc55; --term-color-11: #ffcc55;
  --term-color-12: #ffcc55; --term-color-13: #ffcc55; --term-color-14: #ffcc55; --term-color-15: #ffd98a;
}
.asciinema-player-theme-vt100-amber .ap-term-text { text-shadow: 0 0 3px rgba(255, 176, 0, 0.45); }

/* DECSCNM (ESC[?5h): the whole screen reversed; the control bar stays as it is. A layer in the
   phosphor colour with mix-blend-mode: difference swaps background and text EXACTLY (black →
   phosphor, phosphor → black), in either theme. Not `filter: invert(1)`, which turned the amber
   screen blue. On .ap-player and not .ap-term: the player is taller than its terminal (it keeps
   room for its control bar), and that strip stayed black. */
.vt-screen .ap-player::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--term-color-foreground); mix-blend-mode: difference; display: none;
}
.vt-screen.vt-reverse .ap-player::after { display: block; }

@media print {
  .vt-bar select, .vt-notes { display: none; }
}
