/* briandi.to: a dark room lit by old TVs. */
:root {
  color-scheme: dark;
  --room-0: #0b0a0a;
  --room-1: #151312;
  --room-2: #2b2621;
  --ink: #ebe7df;
  --dim: #a39e93;
  --paper: #f3efe6;
  --paper-ink: #1c1a17;
  --legend: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
html, body { margin: 0; height: 100%; }
body {
  background: #030403;
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  overflow: hidden;
}
retro-shelf { height: 100vh; height: 100dvh; }

/* ---- pages shown on the TVs (each is 640 x 480) ---- */
.tv { box-sizing: border-box; min-height: 100%; padding: 34px 38px; background: var(--paper); color: var(--paper-ink); font: 400 24px/1.4 var(--body); }
.tv h1, .tv h2 { margin: 0 0 14px; font-family: var(--legend); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.02; text-wrap: balance; }
.tv h1 { font-size: 68px; }
.tv h2 { font-size: 56px; }
.tv p { margin: 0 0 12px; }
.tv .note { font: 400 16px/1.4 var(--mono); color: #6a655b; }
.tv a { color: inherit; }
.tv-latest { background: #1c3a5e; color: #f3efe6; }

/* a screen saver rests while the camera is in on another TV */
.tv[data-idle], .tv[data-idle] * { animation-play-state: paused !important; }

/* GAME TV: a standby screen on the tube (SMPTE-style colour bars that break up every few seconds under a
   GAME OVER card that stays up); the page itself when it is opened full screen */
.tv-latest:not([slot="reader"]) { padding: 0; height: 100%; background: #131313; }
.tv-latest:not([slot="reader"]) .page-body { display: none; }
.tv-latest[slot="reader"] .game-standby { display: none; }
.game-standby { position: relative; height: 100%; overflow: hidden; }
.game-standby .bars { position: absolute; inset: 0; display: grid;
  grid-template-columns: repeat(84, 1fr); grid-template-rows: 67fr 8fr 25fr; }
.game-standby .bars i { grid-column: span 12; }
.bars i:nth-child(1) { background: #c0c0c0; } .bars i:nth-child(2) { background: #c0c000; }
.bars i:nth-child(3) { background: #00c0c0; } .bars i:nth-child(4) { background: #00c000; }
.bars i:nth-child(5) { background: #c000c0; } .bars i:nth-child(6) { background: #c00000; }
.bars i:nth-child(7) { background: #0000c0; }
.bars i:nth-child(8) { background: #0000c0; } .bars i:nth-child(9) { background: #131313; }
.bars i:nth-child(10) { background: #c000c0; } .bars i:nth-child(11) { background: #131313; }
.bars i:nth-child(12) { background: #00c0c0; } .bars i:nth-child(13) { background: #131313; }
.bars i:nth-child(14) { background: #c0c0c0; }
.game-standby .bars i:nth-child(n+15) { grid-column: span 15; }
.bars i:nth-child(15) { background: #00214c; } .bars i:nth-child(16) { background: #fff; }
.bars i:nth-child(17) { background: #32006a; } .bars i:nth-child(18) { background: #131313; }
.game-standby .bars i:nth-child(n+19):nth-child(-n+21) { grid-column: span 4; }
.bars i:nth-child(19) { background: #090909; } .bars i:nth-child(20) { background: #131313; }
.bars i:nth-child(21) { background: #1d1d1d; }
.game-standby .bars i:nth-child(22) { grid-column: span 12; background: #131313; }
.game-standby .tv-interference { display: none; }
.game-standby.interrupted .bars { animation: tv-shake 0.42s steps(1) infinite;
  filter: contrast(1.7) saturate(1.9) brightness(1.1) drop-shadow(6px 0 0 rgba(255, 0, 60, 0.7)) drop-shadow(-6px 0 0 rgba(0, 255, 230, 0.7)); }
.game-standby.interrupted .tv-interference { display: block; position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.game-standby .tv-interrupt { display: flex; left: 120px; right: 120px; }
.game-standby .interrupt-title { font-size: 40px; padding: 4px 18px; }

/* big TV: a standby screen on the tube (WORK drifting round like an old DVD logo); the page itself when
   it is opened full screen */
.tv-home:not([slot="reader"]) { padding: 0; height: 100%; background: #04050a; }
.tv-home:not([slot="reader"]) .page-body { display: none; }
.tv-home[slot="reader"] .standby { display: none; }
.standby { position: relative; height: 100%; overflow: hidden; }
.standby-logo { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 14px;
  font-family: var(--legend); text-transform: uppercase; will-change: transform; }
.standby-logo b { display: block; font-size: 96px; font-weight: 800; font-style: italic; line-height: 0.9; letter-spacing: 0.04em; filter: drop-shadow(0 0 10px currentColor);
  transform: skewX(-12deg); }   /* about 12 degrees more lean than the font's own italic, like the DVD logo */
/* the subtitle cut out of a solid oval tucked right under WORK, like the disc under the DVD logo */
.standby-disc { display: block; margin-top: -15px; overflow: visible; filter: drop-shadow(0 0 3px currentColor); }
.standby-disc-text { font: italic 700 19px var(--mono); letter-spacing: 0.04em; text-transform: none; }
.standby.corner { animation: standby-corner 0.6s ease-out; }
@keyframes standby-corner { 0% { background: rgba(255, 255, 255, 0.35); } 100% { background: transparent; } }
.tv-latest .note { color: #b9c6d6; }
.tv-about { background: #e9e7e1; }   /* the paper grey the e-ink filter turns white into */
/* CREATE TV: a standby screen on the tube like an old station ident, in black and white (the owner's two
   ASCII pictures taking turns, ON AIR and a clock); the page itself when it is opened full screen */
.tv-about:not([slot="reader"]) { padding: 0; height: 100%; background: #050505; }
.tv-about:not([slot="reader"]) .page-body { display: none; }
.tv-about[slot="reader"] .ident { display: none; }
.ident { position: relative; height: 100%; overflow: hidden; display: flex; flex-direction: column; color: #f2f2f2; background: #050505; }
.ident-bar { display: flex; justify-content: space-between; padding: 16px 26px; font: 500 18px/1 var(--mono); letter-spacing: 0.08em; }
.ident-air { animation: guide-blink 1.2s steps(1) infinite; }
.ident-more { justify-content: center; padding-top: 0; padding-bottom: 20px; }
.ident-frame { position: relative; flex: 1; }
/* the art is set at a normal size and scaled down, so no browser's smallest-font setting gets in the way */
.ident-art { position: absolute; left: 50%; top: 50%; margin: 0; transform-origin: 50% 50%;
  font: 700 10px/12px var(--mono); letter-spacing: 0; color: #f2f2f2; white-space: pre; opacity: 0; }
.ident-figures { transform: translate(-50%, -50%) scale(0.3); }
.ident-logo { transform: translate(-50%, -50%) scale(0.285); }
.ident-art.on { opacity: 1; animation: ident-scan 6s both, ident-flicker 1.7s steps(1) infinite; }
/* each picture scans in from the top and goes the same way, top to bottom, line by line */
@keyframes ident-scan {
  0% { clip-path: inset(0 0 100% 0); animation-timing-function: steps(40); }
  25% { clip-path: inset(0 0 0 0); }
  75% { clip-path: inset(0 0 0 0); animation-timing-function: steps(40); }
  100% { clip-path: inset(100% 0 0 0); }
}
/* a short burst of snow now and then, like an empty channel */
.ident-snow { position: absolute; inset: -160px; z-index: 2; pointer-events: none; display: none; background-size: 160px 160px;
  image-rendering: pixelated; opacity: 0.38; mix-blend-mode: screen; }
.ident-snow.on { display: block; animation: tv-static 0.24s steps(4) infinite; }
/* an uneven tube flicker on the pictures and the grid: brightness dips and the odd soft frame */
@keyframes ident-flicker {
  0% { opacity: 1; filter: none; }
  6% { opacity: 0.72; }
  9% { opacity: 1; }
  23% { opacity: 0.88; filter: blur(0.6px); }
  27% { opacity: 1; filter: none; }
  41% { opacity: 0.55; }
  43% { opacity: 0.95; }
  46% { opacity: 0.7; }
  49% { opacity: 1; }
  64% { opacity: 0.84; filter: brightness(1.4); }
  67% { opacity: 1; filter: none; }
  82% { opacity: 0.62; filter: blur(0.5px); }
  85% { opacity: 1; filter: none; }
  93% { opacity: 0.9; }
  96% { opacity: 1; }
}
/* noughts and crosses: logo on the X squares, figures on the O squares, popping in one after another and out again in the same order */
.ident-grid { position: absolute; inset: 52px 64px 52px; display: none; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 8px; }
.ident-grid.on { display: grid; animation: ident-flicker 1.7s steps(1) infinite; }
.ident-grid i { background: center / contain no-repeat; opacity: 0; }
.ident-grid.on i { animation: ident-pop 2.3s steps(1) both; }
.ident-grid.on i:nth-child(2) { animation-delay: 0.08s; } .ident-grid.on i:nth-child(3) { animation-delay: 0.16s; }
.ident-grid.on i:nth-child(4) { animation-delay: 0.24s; } .ident-grid.on i:nth-child(5) { animation-delay: 0.32s; }
.ident-grid.on i:nth-child(6) { animation-delay: 0.4s; } .ident-grid.on i:nth-child(7) { animation-delay: 0.48s; }
.ident-grid.on i:nth-child(8) { animation-delay: 0.56s; } .ident-grid.on i:nth-child(9) { animation-delay: 0.64s; }
/* each square stays 2.3 s from when it comes on, so they go in the same order: top left to bottom right */
@keyframes ident-pop { 0% { opacity: 0; } 0.1% { opacity: 1; } 99.9% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ident-air, .ident-art.on, .ident-grid.on, .ident-grid.on i { animation: none; } .ident-grid.on i { opacity: 1; } }
/* channel TV, channel 2: the guide. Green phosphor on black, a dashed grid, pixel lettering. */
.tv-guide {
  --phosphor: #8dff9a; --phosphor-dim: #3f8f4a;
  position: relative; height: 100%; padding: 18px 34px; display: flex; flex-direction: column; gap: 8px;
  background-color: #031208; color: var(--phosphor);
  background-image:
    repeating-linear-gradient(90deg, rgba(141, 255, 154, 0.13) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(0deg, rgba(141, 255, 154, 0.13) 0 1px, transparent 1px 40px);
  font: 400 28px/1.2 "DotGothic16", var(--mono);
  text-shadow: 0 0 6px rgba(141, 255, 154, 0.55);
}
.tv-guide .guide-top { display: flex; justify-content: space-between; font-size: 21px; }
.tv-guide .guide-title { margin: 0; text-align: center; font: inherit; font-size: 34px; letter-spacing: 0.04em; }
.tv-guide .guide-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(7, auto); column-gap: 20px; row-gap: 0; }
.tv-guide .guide-list li { display: flex; white-space: nowrap; overflow: hidden; }
.tv-guide .guide-list button { all: unset; box-sizing: border-box; display: flex; gap: 14px; width: 100%; padding: 0 8px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.tv-guide .guide-list button span { overflow: hidden; text-overflow: ellipsis; }
.tv-guide .guide-list button span.rolling { display: flex; text-overflow: clip; }
.tv-guide .guide-list button span.rolling i { flex: none; font-style: normal; padding-right: 48px; }
.tv-guide .guide-list button:hover, .tv-guide .guide-list button:focus-visible { outline: 2px solid var(--phosphor); outline-offset: -2px; }

.tv-guide .guide-list b { font-weight: 400; }
.tv-guide .guide-list li.on { background: var(--phosphor); color: #031208; text-shadow: none; box-shadow: 0 0 10px rgba(141, 255, 154, 0.5); }
.tv-guide .guide-list li.empty { color: var(--phosphor-dim); text-shadow: none; }
.tv-guide .guide-keys { margin: 2px 0 0; padding-top: 8px; border-top: 2px solid var(--phosphor); font-size: 21px; display: grid; gap: 0; }
.tv-guide .guide-keys div { display: flex; }
.tv-guide .guide-keys dt { width: 5.5em; }
.tv-guide .guide-keys dd { margin: 0; }
.tv-guide .guide-blink { margin: auto 0 0; text-align: center; font-size: 26px; animation: guide-blink 1.1s steps(1) infinite; }
.tv-guide .guide-mark { position: absolute; width: 14px; height: 14px; border: 2px solid var(--phosphor); box-shadow: inset 0 0 0 3px #031208, inset 0 0 0 5px var(--phosphor); }
@keyframes guide-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tv-guide .guide-blink { animation: none; } }

/* channel TV, a channel with a bad signal ("interference": true): every few seconds the picture
   breaks up under static and a "broadcast interrupted" card in the guide's style comes up */
.tv-channel.has-interference { position: relative; }
.tv-channel .tv-interference, .tv-channel .tv-interrupt { display: none; }
.tv-channel.interrupted .tv-scroll, .tv-channel.interrupted > img { animation: tv-shake 0.42s steps(1) infinite;
  filter: contrast(1.7) saturate(1.9) brightness(1.1) drop-shadow(6px 0 0 rgba(255, 0, 60, 0.7)) drop-shadow(-6px 0 0 rgba(0, 255, 230, 0.7)); }
@keyframes tv-shake {
  0% { transform: translate(0, 0) skewX(0); }
  15% { transform: translate(-14px, 3px) skewX(6deg); clip-path: inset(10% 0 55% 0); }
  30% { transform: translate(10px, -6px) skewX(-4deg) scaleY(1.04); clip-path: none; }
  45% { transform: translate(-4px, 9px) skewX(12deg); clip-path: inset(48% 0 12% 0); }
  60% { transform: translate(18px, 0) skewX(-9deg); clip-path: none; filter: hue-rotate(90deg) contrast(2) saturate(2.4); }
  75% { transform: translate(-9px, -4px) scaleX(1.06); clip-path: inset(0 0 70% 0); }
  90% { transform: translate(5px, 5px) skewX(3deg); clip-path: none; }
}
.tv-channel.interrupted .tv-interference { display: block; position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.tv-interference .static { position: absolute; inset: -160px; background-size: 160px 160px; image-rendering: pixelated; opacity: 0.42; mix-blend-mode: screen;
  animation: tv-static 0.24s steps(4) infinite; }
@keyframes tv-static { 25% { transform: translate(-53px, 37px); } 50% { transform: translate(41px, -61px); } 75% { transform: translate(-27px, -19px); } }
.tv-interference .tear { position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, 0.16) 22px 26px, transparent 26px 60px, rgba(0, 0, 0, 0.45) 60px 74px);
  animation: tv-roll 0.6s linear infinite; }
@keyframes tv-roll { from { transform: translateY(-80px); } to { transform: translateY(0); } }
.tv-channel.interrupted .tv-interrupt { display: flex; }
.tv-interrupt {
  --phosphor: #8dff9a; --phosphor-dim: #3f8f4a;
  position: absolute; z-index: 3; left: 64px; right: 64px; top: 50%; transform: translateY(-50%);
  flex-direction: column; align-items: center; gap: 10px; padding: 16px 22px 22px;
  background-color: rgba(3, 18, 8, 0.92); color: var(--phosphor); border: 2px solid var(--phosphor);
  box-shadow: 0 0 18px rgba(141, 255, 154, 0.35), inset 0 0 0 4px #031208, inset 0 0 0 6px var(--phosphor-dim);
  background-image:
    repeating-linear-gradient(90deg, rgba(141, 255, 154, 0.13) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(0deg, rgba(141, 255, 154, 0.13) 0 1px, transparent 1px 40px);
  font: 400 30px/1.2 "DotGothic16", var(--mono); text-shadow: 0 0 6px rgba(141, 255, 154, 0.55);
}
.tv-interrupt .interrupt-top { align-self: stretch; display: flex; justify-content: space-between; font-size: 18px; }
.tv-interrupt p { margin: 0; text-align: center; }
.tv-interrupt .interrupt-title { padding: 2px 10px; background: var(--phosphor); color: #031208; text-shadow: none; box-shadow: 0 0 10px rgba(141, 255, 154, 0.5); }
.tv-interrupt .interrupt-sub { font-size: 22px; animation: guide-blink 0.8s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) {
  .tv-channel.interrupted .tv-scroll, .tv-channel.interrupted > img { animation: none; }
  .tv-interference .static, .tv-interference .tear, .tv-interrupt .interrupt-sub { animation: none; }
}

/* a hint over the pager's HELP key (placed on the key by script) */
.key-hint { position: fixed; z-index: 21; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; }
.key-hint.on { opacity: 1; }
/* a small arrow just above the key, bobbing gently */
.key-hint-arrow { position: absolute; left: -7px; top: -34px; color: rgba(141, 255, 154, 0.85); filter: drop-shadow(0 0 3px rgba(141, 255, 154, 0.5));
  animation: key-hint-bob 1.6s ease-in-out infinite; }
@keyframes key-hint-bob { 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .key-hint-arrow { animation: none; } }

/* Help: the assistant (Giant, a hologram robot) projected from the pager (the i key). A dark veil over the
   room, one speech box, and the robot standing on a beam of light that starts right on the pager. */
.giant-overlay { position: fixed; inset: 0; z-index: 19; background: rgba(1, 4, 2, 0.72); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  --phosphor: #8dff9a; --phosphor-dim: #3f8f4a; --dock: calc(128px + env(safe-area-inset-bottom, 0px));
  font: 400 18px/1.35 "DotGothic16", var(--mono); color: var(--phosphor); text-shadow: 0 0 6px rgba(141, 255, 154, 0.5); }
.giant-overlay[hidden] { display: none; }
.giant-stage { position: absolute; left: 0; right: 0; top: 0; bottom: var(--dock); display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 64px 16px 0; }
/* the speech box, its tail pointing down at the robot */
.giant-bubble { position: relative; box-sizing: border-box; flex: none; width: min(100%, 460px); margin-bottom: 14px; padding: 14px 16px 16px; background: rgba(3, 18, 8, 0.94);
  border: 2px solid var(--phosphor); box-shadow: 0 0 18px rgba(141, 255, 154, 0.3), inset 0 0 0 4px #031208, inset 0 0 0 5px var(--phosphor-dim); }
.giant-bubble::after { content: ""; position: absolute; left: 50%; bottom: -12px; margin-left: -10px; border: 10px solid transparent; border-top-color: var(--phosphor); border-bottom: 0; }
.giant-bubble .guide-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--phosphor-dim); margin-bottom: 8px; letter-spacing: 0.06em; }
.giant-text { margin: 0; min-height: 1.35em; }
.giant-text a { color: inherit; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; user-select: text; -webkit-user-select: text; }
.giant-asks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.giant-asks[hidden], .giant-ok[hidden] { display: none; }
.giant-asks button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 6px 8px; cursor: pointer; font-size: 15px; line-height: 1.3; }
.giant-asks button::before { content: "\25B8  "; color: var(--phosphor-dim); }
.giant-asks button:hover, .giant-asks button:focus-visible { background: var(--phosphor); color: #031208; text-shadow: none; }
.giant-asks button:hover::before, .giant-asks button:focus-visible::before { color: #031208; }
.giant-new { display: inline-block; margin-left: 8px; padding: 2px 6px 1px; border: 1px solid var(--phosphor); border-radius: 2px; background: rgba(141, 255, 154, 0.12); color: var(--phosphor);
  font-style: normal; font-size: 11px; line-height: 1; letter-spacing: 0.08em; vertical-align: 2px; text-shadow: 0 0 6px rgba(141, 255, 154, 0.6);
  box-shadow: 0 0 6px rgba(141, 255, 154, 0.35), inset 0 0 6px rgba(141, 255, 154, 0.2); animation: giant-new 1.4s ease-in-out infinite; }
/* the tag stays solid; only its glow pulses */
@keyframes giant-new { 50% { box-shadow: 0 0 12px rgba(141, 255, 154, 0.8), inset 0 0 6px rgba(141, 255, 154, 0.35); } }
.giant-asks button:hover .giant-new, .giant-asks button:focus-visible .giant-new { border-color: #031208; color: #031208; background: transparent; text-shadow: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .giant-new { animation: none; } }
.giant-ok { display: block; margin: 14px 0 0 auto; font: inherit; font-size: 15px; color: #031208; background: var(--phosphor); border: 0; padding: 8px 14px; cursor: pointer; text-shadow: none; }
.giant-ok:hover, .giant-ok:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; }
/* the robot, and the beam under it from the pager */
.giant-figure { position: relative; z-index: 1; flex: 0 1 auto; width: min(100%, 300px); height: min(38vh, 320px); min-height: 150px; }
.giant-figure retro-giant { position: absolute; inset: 0; }
/* a tap tickles Butler (a giggle), lots of taps make him cross (a shake) */
.giant-figure.giggle retro-giant { animation: giant-giggle 0.6s ease-in-out 2; }
.giant-figure.shake retro-giant { animation: giant-shake 0.4s linear 2; }
@keyframes giant-giggle { 25% { transform: translateY(-6px) rotate(-3deg); } 50% { transform: translateY(0); } 75% { transform: translateY(-4px) rotate(3deg); } }
@keyframes giant-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
/* tears when Butler is sad: drops falling from under his eyes */
.giant-tear { position: absolute; top: 22%; width: 5px; height: 9px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #d8ffe0;
  box-shadow: 0 0 8px rgba(141, 255, 154, 0.9); opacity: 0; pointer-events: none; }
.giant-tear:nth-of-type(1) { left: 43%; } .giant-tear:nth-of-type(2) { left: 55%; }
.giant-overlay.crying .giant-tear { animation: giant-tear 0.9s ease-in infinite; }
.giant-overlay.crying .giant-tear:nth-of-type(2) { animation-delay: 0.45s; }
@keyframes giant-tear { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(70px); opacity: 0; } }
.giant-beam { flex: none; width: 220px; height: 64px; margin-top: -40px; pointer-events: none;
  background: linear-gradient(0deg, rgba(141, 255, 154, 0.3), rgba(141, 255, 154, 0)); clip-path: polygon(38% 100%, 62% 100%, 100% 0, 0 0); }
.giant-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; font: inherit; font-size: 15px; color: var(--phosphor); background: transparent;
  border: 1px solid var(--phosphor-dim); padding: 8px 12px; cursor: pointer; text-shadow: inherit; }
.giant-close:hover, .giant-close:focus-visible { color: #031208; background: var(--phosphor); text-shadow: none; outline: none; }
body.giant-on retro-map { visibility: hidden; }
@media (max-width: 559px) {
  .giant-overlay { --dock: calc(176px + env(safe-area-inset-bottom, 0px)); font-size: 16px; }
  .giant-figure { height: min(30vh, 240px); }
  .giant-beam { width: 170px; height: 54px; margin-top: -34px; }
  .giant-asks button { font-size: 14px; padding: 5px 6px; }
}


/* channel TV, channel 2: How to use. The guide's look, one line at a time. */
.tv-howto .howto-list { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; align-items: center; }
.tv-howto .howto-list li { display: none; gap: 18px; font-size: 30px; line-height: 1.3; text-wrap: pretty; }
.tv-howto .howto-list li.on { display: flex; }
.tv-howto .howto-list li::before { content: attr(data-n); flex: none; align-self: flex-start;
  padding: 0 6px; background: var(--phosphor); color: #031208; text-shadow: none; box-shadow: 0 0 10px rgba(141, 255, 154, 0.5); }
.tv-howto .howto-tvs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; }
.tv-howto .howto-tvs > div { display: contents; }
.tv-howto .howto-tvs dt { padding: 0 8px; background: var(--phosphor); color: #031208; text-shadow: none; }
.tv-howto .howto-tvs dd { margin: 0; }
.tv-howto .howto-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tv-howto .howto-pager button { font: inherit; font-size: 22px; line-height: 1; padding: 6px 10px; cursor: pointer;
  color: var(--phosphor); background: transparent; border: 2px solid var(--phosphor); text-shadow: inherit; box-shadow: 0 0 8px rgba(141, 255, 154, 0.3); }
.tv-howto .howto-pager button:hover, .tv-howto .howto-pager button:focus-visible { background: var(--phosphor); color: #031208; text-shadow: none; outline: none; }
.tv-howto .howto-progress { font-size: 22px; letter-spacing: 0.04em; white-space: pre; }

/* channel TV, the other channels: the player or picture fills the tube */
.tv-channel { height: 100%; padding: 0; background: #000; }
.tv-channel iframe, .tv-channel img { display: block; width: 100%; height: 100%; border: 0; }
/* pictures fill the tube at their own shape: never stretched, the edges that do not fit are cut off */
.tv-channel img { object-fit: cover; }
/* a scrolling stack of tall pictures: each the width of the tube, moving slowly up the screen */
.tv-channel .tv-scroll { display: block; width: 100%; height: 100%; }

.panels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 16px; }
.panels i { aspect-ratio: 3 / 4; border: 4px solid #f3efe6; background: rgba(243, 239, 230, 0.14); }

.fallback { max-width: 40ch; margin: 20vh auto; padding: 0 16px; }

/* the card that opens when a game or book is picked can be restyled:
   retro-shelf::part(card) { ... }   retro-shelf::part(back) { ... } */

/* ---- the same pages opened full screen (tap a TV, then tap its screen) ----
   The page fills the window and scrolls. Text is sized for reading, in one
   column, not for a 640 x 480 tube. */
.tv[slot="reader"] {
  padding: clamp(72px, 12vh, 120px) max(24px, calc((100% - 46rem) / 2)) clamp(48px, 10vh, 96px);
  font-size: clamp(18px, 1.1rem + 0.4vw, 22px);
  line-height: 1.6;
}
.tv[slot="reader"] h1 { font-size: clamp(44px, 9vw, 88px); }
.tv[slot="reader"] h2 { font-size: clamp(38px, 7vw, 72px); }
.tv[slot="reader"] .note { font-size: 15px; }


/* WORK page full screen ("How I Lead"): a plain document, like a manual for a tech product. One narrow
   column of text, a table of contents on the left that marks the section you are reading (a bar along the
   top on narrow screens), numbered headings, and each outcome as a quiet note. */
.tv-home[slot="reader"] { --doc-bg: #fbfbfa; --doc-ink: #1b1b1c; --doc-text: #3a3a3c; --doc-dim: #8a8a8e; --doc-line: #e7e7e5; --doc-note: #f3f3f1;
  background: var(--doc-bg); color: var(--doc-text); font: 400 16px/1.7 var(--body);
  padding: 96px max(24px, calc((100% - 64rem) / 2)) 0; }
.doc { display: grid; grid-template-columns: 13rem minmax(0, 40rem); gap: 4rem; justify-content: center; }
.doc-body { min-width: 0; }
.doc p { margin: 0 0 1.1em; }
.doc b { color: var(--doc-ink); font-weight: 600; }
.doc-crumb { margin: 0 0 0.5rem !important; font: 500 13px/1 var(--mono); color: var(--doc-dim); }
.tv-home[slot="reader"] .doc h1 { margin: 0 0 1.5rem; font: 600 32px/1.2 var(--body); letter-spacing: -0.01em; text-transform: none; color: var(--doc-ink); }
.doc-head { scroll-margin-top: 6rem; padding-bottom: 2rem; margin-bottom: 1rem; border-bottom: 1px solid var(--doc-line); }
.doc section { padding-top: 2rem; scroll-margin-top: 2rem; }
/* a rule between sections, like the one under the overview */
.doc section + section { margin-top: 3rem; border-top: 1px solid var(--doc-line); }
.tv-home[slot="reader"] .doc h2 { margin: 1rem 0 1rem; font: 600 21px/1.35 var(--body); letter-spacing: -0.005em; text-transform: none; color: var(--doc-ink); }
.doc h3 { margin: 2.5rem 0 0.75rem; font: 600 17px/1.4 var(--body); color: var(--doc-ink); scroll-margin-top: 2rem; }
.doc h4 { margin: 1.5rem 0 0.5rem; font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--doc-dim); }
.doc h2 span, .doc h3 span { display: inline-block; min-width: 2.2em; font: 400 0.8em/1 var(--mono); color: var(--doc-dim); }
/* the numbered points under "The problem" */
.doc-points { margin: 0 0 1.1em; padding-left: 1.5em; }
.doc-points li { margin: 0 0 1.1em; padding-left: 0.25em; }
.doc-points li::marker { color: var(--doc-ink); font-weight: 600; }
.doc-note { margin: 0 0 1.1em; padding: 1rem 1.25rem; background: var(--doc-note); border-radius: 8px; color: var(--doc-ink); }
.doc-note p:last-child { margin-bottom: 0; }
.doc-list { margin: 0; }
.doc-list dt { margin-top: 1.5rem; font-weight: 600; color: var(--doc-ink); }
.doc-list dd { margin: 0.25rem 0 0; }
/* contents: sticky in the left column */
.doc-toc { position: sticky; top: 96px; align-self: start; font-size: 14px; line-height: 1.4; }
.doc-toc-title { margin: 0 0 0.75rem !important; font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--doc-dim); }
.doc-toc ol { list-style: none; margin: 0; padding: 0; }
.doc-toc ol ol { padding-left: 1.6em; }
.doc-toc a { display: flex; gap: 0.6em; padding: 0.35em 0 0.35em 0.75em; margin-left: -0.75em; border-left: 2px solid transparent; color: var(--doc-dim); text-decoration: none; }
.doc-toc a span { font: 400 12px/1.6 var(--mono); min-width: 1.6em; }
.doc-toc a:hover { color: var(--doc-ink); }
.doc-toc a[aria-current] { color: var(--doc-ink); border-left-color: var(--doc-ink); font-weight: 500; }
.doc-toc a.on-path { color: var(--doc-ink); }
.doc-toc ol ol ol { padding-left: 1.2em; font-size: 13px; }
.doc-toc ol ol ol a { padding-top: 0.25em; padding-bottom: 0.25em; }
/* only the branch you are reading is open */
.doc-toc li > ol { display: none; }
.doc-toc li:has(> a[aria-current]) > ol, .doc-toc li:has(> a.on-path) > ol { display: block; }
.doc-toc a:focus-visible { outline: 2px solid var(--doc-ink); outline-offset: 2px; border-radius: 2px; }
.doc-toc-bar { display: none; }
@media (max-width: 860px) {
  .tv-home[slot="reader"] { padding-top: 0; }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* the contents fold into a bar along the top showing where you are; tapping it opens the same list below it */
  .doc-toc { position: sticky; top: 0; z-index: 2; margin: 0 -24px 2rem; padding: 0 24px; background: color-mix(in srgb, var(--doc-bg) 94%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--doc-line); }
  .doc-toc-title { display: none; }
  .doc-toc-bar { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; cursor: pointer; font: 400 14px/1.3 var(--body); color: var(--doc-dim); }
  .doc-toc-bar:focus-visible { outline: 2px solid var(--doc-ink); outline-offset: -2px; }
  .doc-toc-path { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
  .doc-toc-path span { overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
  .doc-toc-path span:not(.here) { flex-shrink: 3; }
  .doc-toc-path .here { color: var(--doc-ink); font-weight: 500; flex-shrink: 0; max-width: 60%; }
  .doc-toc-path i { font-style: normal; color: var(--doc-dim); }
  .doc-toc-caret { flex: none; width: 8px; height: 8px; border-right: 1.5px solid var(--doc-ink); border-bottom: 1.5px solid var(--doc-ink); transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
  .doc-toc.open .doc-toc-caret { transform: translateY(2px) rotate(-135deg); }
  .doc-toc > ol { display: none; max-height: min(60vh, 460px); overflow-y: auto; padding: 4px 0 16px; font-size: 15px; }
  .doc-toc.open { background: var(--doc-bg); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08); }
  .doc-toc.open > ol { display: block; }
  .doc-toc a { padding-top: 0.5em; padding-bottom: 0.5em; }
  .doc-head { padding-top: 1rem; }
}


/* CREATE page full screen: The Tiny Wisdom desktop (ttw/index.html) in a frame that fills the window above the pager */
.tv-about[slot="reader"] { padding: 0 !important; background: #000; overflow: hidden; }
.ttw-frame iframe { display: block; width: 100%; height: calc(100vh - 96px); height: calc(100dvh - 96px); border: 0; background: #000; }
@media (min-width: 560px) { .ttw-frame iframe { height: calc(100vh - 144px); height: calc(100dvh - 144px); } }

/* GAME page full screen ("Games I Love"): option E of five (owner, 2026-11-16), brutalist red / black / white
   in the spirit of a stylish JRPG menu. A ransom-note title, a slanted menu of game names on the left, and
   the picked game on the right: its cover tilted in a cut-out frame, its name, platforms and texts on torn
   strips. The list items in the markup are the data; the script builds the title, the menu buttons and
   the stage from them. All shapes and type are original; no game logos or menu art are copied. */
.tv-latest[slot="reader"] { --red: #e3001b; --paper: #ffffff; --ink: #0a0a0a;
  position: relative; overflow-x: clip; background: var(--ink); color: var(--paper); font: 400 16px/1.6 var(--body);
  padding: 0 max(20px, calc((100% - 72rem) / 2)) 0; }
.games { position: relative; padding-top: clamp(40px, 8vh, 72px); padding-bottom: 96px; }
/* the room left for the pager is inside the page, so the slash and the dots run down to the bottom; the
   credit line sits in the list's column, so the stage stays centred down to the end of the page */
.tv.tv-latest[slot="reader"] { padding-bottom: 0; }
@media (min-width: 560px) { .games { padding-bottom: 144px; } }
.games-grid { grid-column: 1; grid-row: 1; }
.games-stage { grid-column: 2; grid-row: 1 / span 2; }
.games-credit { grid-column: 1; grid-row: 2; align-self: end; margin-bottom: clamp(48px, 10vh, 96px) !important; }
.games::before { content: ""; position: absolute; inset: 0 auto 0 calc(-1 * max(20px, (100vw - 72rem) / 2)); width: 70%; pointer-events: none;
  background: radial-gradient(circle, rgba(227, 0, 27, 0.5) 1.2px, transparent 1.6px) 0 0 / 9px 9px;
  -webkit-mask: linear-gradient(115deg, #000 0 20%, transparent 55%); mask: linear-gradient(115deg, #000 0 20%, transparent 55%); }
.games-slash { position: absolute; top: -80px; bottom: 0; right: calc(-1 * max(20px, (100vw - 72rem) / 2) - 14vw); width: 46vw; background: var(--red); transform: skewX(-18deg); pointer-events: none; }
.games-slash.thin { right: calc(-1 * max(20px, (100vw - 72rem) / 2) + 34vw); width: 4vw; background: var(--paper); opacity: 0.9; }
.games > :not(.games-slash) { position: relative; }
.games-count { position: absolute !important; top: clamp(40px, 8vh, 72px); right: 0; margin: 0; font: 400 clamp(40px, 6vw, 64px)/1 "Anton", var(--legend); color: var(--paper); }
.games-count small { font-size: 0.38em; }
.games-head { display: grid; justify-items: start; gap: 14px; padding-right: 120px; }
.games-head .doc-crumb { display: none; }
.tv-latest[slot="reader"] .games h1 { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font: inherit; text-transform: none; letter-spacing: 0; color: inherit; }
.ransom-word { --rs: clamp(30px, 4.4vw, 50px); display: inline-flex; gap: 3px; }
.ransom-word span { display: inline-block; padding: 3px 7px; line-height: 1; }
.games-intro { margin: 0; max-width: 54ch; padding: 14px 18px; background: var(--paper); color: var(--ink); font: 500 clamp(14px, 1.3vw, 16px)/1.55 var(--body); clip-path: polygon(0 5%, 100% 0, 98% 100%, 1.5% 95%); transform: rotate(-1.2deg); }
.games-intro b { display: inline; font: 400 1.15em/1.3 "Anton", var(--legend); letter-spacing: 0.03em; text-transform: uppercase; }
.games-filter { display: flex; flex-wrap: wrap; gap: 8px 6px; margin-top: 6px; }
.games-filter button { font: 400 14px/1 "Anton", var(--legend); letter-spacing: 0.06em; text-transform: uppercase; padding: 7px 11px 6px; border: 2px solid var(--paper); background: var(--ink); color: var(--paper); transform: skewX(-12deg); cursor: pointer; }
.games-filter button:hover { background: var(--red); }
.games-filter button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.games-filter button:focus-visible, .game-pick:focus-visible { outline: 2px dashed var(--paper); outline-offset: 3px; }
.games-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(20px, 4vw, 48px); margin-top: clamp(24px, 4vh, 40px); align-items: start; }
.games-grid { list-style: none; margin: 0; padding: 0 28px 0 0; display: grid; gap: 2px; }
.game[hidden] { display: none; }
.game > :not(h3) { display: none; }
.tv-latest[slot="reader"] .game h3 { margin: 0; font: inherit; text-transform: none; letter-spacing: 0; color: inherit; }
.game:nth-child(odd) { margin-left: 10px; }
.game-pick { all: unset; box-sizing: border-box; position: relative; display: block; max-width: 100%; cursor: pointer; padding: 7px 14px 6px;
  font: 400 clamp(18px, 2.1vw, 24px)/1.08 "Anton", var(--legend); letter-spacing: 0.02em; text-transform: uppercase; color: var(--paper);
  transform: skewX(-12deg); transition: transform 0.12s, color 0.12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-pick:hover { color: var(--red); }
.game-pick[aria-current="true"] { color: var(--ink); overflow: visible; transform: skewX(-12deg) rotate(-2deg) translateX(14px) scale(1.06); }
.game-pick[aria-current="true"]::before { content: ""; position: absolute; inset: -3px -14px -3px -10px; z-index: -1; background: var(--paper); clip-path: polygon(0 18%, 100% 0, 96% 100%, 3% 86%); }
.game-pick[aria-current="true"]::after { content: ""; position: absolute; inset: 2px -26px 0 -4px; z-index: -2; background: var(--red); clip-path: polygon(2% 0, 100% 22%, 98% 100%, 0 78%); }
/* the stage is as tall as the window above the pager (128 px) and keeps the picked game centred in it while the list scrolls */
.games-stage { position: sticky; top: 0; box-sizing: border-box; height: calc(100vh - 144px); height: calc(100dvh - 144px); min-height: 520px;
  display: grid; gap: 16px; justify-items: start; align-content: center; padding: 14px 0 20px 18px; scroll-margin-top: 20px; }
.stage-pic { position: relative; width: min(100%, 300px, 34vh); transform: rotate(4deg); }
.stage-pic::before { content: ""; position: absolute; inset: -10px; background: var(--paper); clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 95%); }
.stage-pic::after { content: ""; position: absolute; inset: -18px -14px -6px -22px; z-index: -1; background: var(--ink); clip-path: polygon(0 6%, 96% 0, 100% 92%, 6% 100%); }
.stage-pic img { position: relative; display: block; width: 100%; aspect-ratio: 1; object-fit: cover; clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 95%); }
.tv-latest[slot="reader"] .stage-name { margin: 6px 0 0; max-width: 100%; padding: 6px 12px 4px; background: var(--ink); color: var(--paper);
  font: 400 clamp(26px, 3.4vw, 40px)/1.02 "Anton", var(--legend); letter-spacing: 0.01em; text-transform: uppercase; transform: rotate(-3deg) skewX(-8deg); }
.stage-tags { display: flex; flex-wrap: wrap; gap: 8px; transform: rotate(-2deg); }
.stage-tags span { padding: 6px 12px 5px; background: var(--ink); color: var(--paper); border: 2px solid var(--paper); font: 400 15px/1 "Anton", var(--legend); letter-spacing: 0.08em; transform: skewX(-12deg); }
.stage-about { margin: 0; max-width: 46ch; padding: 14px 18px; background: var(--paper); color: var(--ink); font: 500 15px/1.55 var(--body); clip-path: polygon(0 4%, 100% 0, 98% 100%, 2% 96%); transform: rotate(-1deg); }
.stage-why { margin: -4px 0 0 18px; max-width: 42ch; padding: 9px 14px; background: var(--red); color: var(--paper); font: 500 14px/1.5 var(--body); transform: rotate(1.5deg); }
.stage-why.game-todo { font-style: italic; }
.games-credit { margin: clamp(40px, 8vh, 72px) 0 0; padding: 14px 0 0; border-top: 2px solid var(--paper); font-size: 12px; line-height: 1.5; color: #bdbdbd; max-width: 60%; }
.games-credit a { color: inherit; }
@media (max-width: 760px) {
  .ransom-word { --rs: 26px; } .ransom-word span { padding: 3px 6px; }
  .games-slash { width: 60vw; right: -50vw; } .games-slash.thin { display: none; }
  /* phones: no stage and no counter; every game is shown open in the list, one after another (owner, 2026-11-17) */
  .games-count, .games-stage { display: none; }
  .games-grid, .games-credit { grid-column: 1; grid-row: auto; }
  .games-body { grid-template-columns: 1fr; }
  .games-grid { padding: 0 4px; gap: 44px; }
  .game:nth-child(n) { margin-left: 0; }
  .game:not([hidden]) { display: grid; gap: 14px; justify-items: start; }
  .game > .game-cover, .game > .game-about, .game > .game-why { display: block; }
  .game > .game-plat { display: flex; }
  .game > .game-cover { order: 1; } .game > h3 { order: 2; } .game > .game-plat { order: 3; } .game > .game-about { order: 4; } .game > .game-why { order: 5; }
  .game-cover { position: relative; width: min(72%, 280px); margin: 12px 0 4px 14px; transform: rotate(4deg); }
  .game:nth-child(even) .game-cover { transform: rotate(-3deg); margin-left: 22%; }
  .game-cover::before { content: ""; position: absolute; inset: -10px; background: var(--paper); clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 95%); }
  .game-cover::after { content: ""; position: absolute; inset: -18px -14px -6px -22px; z-index: -1; background: var(--ink); clip-path: polygon(0 6%, 96% 0, 100% 92%, 6% 100%); }
  .game-cover img { position: relative; display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 95%); }
  .game-pick, .game-pick[aria-current="true"] { cursor: default; white-space: normal; overflow: visible; padding: 6px 12px 4px; background: var(--ink); color: var(--paper);
    font-size: 26px; line-height: 1.02; transform: rotate(-3deg) skewX(-8deg); }
  .game-pick::before, .game-pick::after { display: none; }
  .game-pick:hover { color: var(--paper); }
  .game-plat { gap: 8px; transform: rotate(-2deg); margin: 0; }
  .game-plat span { padding: 6px 12px 5px; background: var(--ink); color: var(--paper); border: 2px solid var(--paper); font: 400 15px/1 "Anton", var(--legend); letter-spacing: 0.08em; transform: skewX(-12deg); }
  .game-about { margin: 0; padding: 14px 18px; background: var(--paper); color: var(--ink); font: 500 15px/1.55 var(--body); clip-path: polygon(0 4%, 100% 0, 98% 100%, 2% 96%); transform: rotate(-1deg); }
  .game-why { margin: -4px 0 0 18px; padding: 9px 14px; background: var(--red); color: var(--paper); font: 500 14px/1.5 var(--body); transform: rotate(1.5deg); }
  .games-credit { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .game-pick { transition: none; } }

/* ---- the dock: a 3D pager at the bottom, always on screen ----
   It replaces the scene's own hint and Back / Read buttons. */
/* the hologram map of the stack, on the left, clear of the pager */
retro-map { position: fixed; z-index: 19; width: 200px; left: max(8px, env(safe-area-inset-left, 0px)); top: calc(50% - 64px); transform: translateY(-50%); }
/* on a phone the TV fills the width, so the map goes small in the top corner, over the dark room above */
@media (max-width: 559px) {
  retro-map { width: 64px; height: 170px; top: calc(10px + env(safe-area-inset-top, 0px)); transform: none; font-size: 10px; }
}
body.reading retro-map { display: none; }
retro-pager { position: fixed; z-index: 20; left: 0; right: 0; bottom: env(safe-area-inset-bottom, 0px); }
/* when the camera moves in to a TV, it is framed in the space above the pager (the pager is 128 px tall, 176 px on narrow screens) */
retro-shelf { --focus-inset-bottom: calc(128px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 559px) { retro-shelf { --focus-inset-bottom: calc(176px + env(safe-area-inset-bottom, 0px)); } }
retro-shelf::part(hint), retro-shelf::part(back), retro-shelf::part(fill), retro-shelf::part(reader-close) { display: none; }
/* leave room under the full-screen page so its end clears the dock */
.tv[slot="reader"] { padding-bottom: calc(clamp(48px, 10vh, 96px) + 96px); }   /* the compact pager is 80 px tall on phones */
@media (min-width: 560px) { .tv[slot="reader"] { padding-bottom: calc(clamp(48px, 10vh, 96px) + 144px); } }   /* and 128 px, the homepage size, on wider windows */
