/* Special pieces written on the writing desk: VN scenes, pictures, author's notes, and the
   beta readers' marks. Loaded by every chapter page the desk draws (server/writing.py) and by
   the desk itself. Keep this file ASCII. */

/* ---- author's notes */
aside.anote { margin: 0 0 1.6em; padding: 10px 14px; border: 1px dashed #c98fa6; background: #1d1420; font-size: 16px; line-height: 1.55; }
aside.anote.after { margin: 1.8em 0 0; }
aside.anote p { margin: 0 0 0.6em; }
aside.anote > :last-child { margin-bottom: 0; }
p.anote-h { font: 12px/1.4 Consolas, "Courier New", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #c98fa6; }

/* ---- pictures */
figure.pic { margin: 1.6em 0; text-align: center; }
figure.pic img { max-width: 100%; height: auto; border: 3px solid #c98fa6; }
figure.pic.bare img { border: 0; }
figure.pic.small img { max-width: 45%; }
figure.pic figcaption { margin-top: 6px; font: 14px/1.5 Consolas, "Courier New", monospace; color: #bda3b6; }

/* ---- VN scenes. Without JavaScript (and in "read as text") they read as a script. */
.vn { margin: 1.6em 0; padding: 12px 16px; border: 1px solid #4a3346; background: #120c16; }
.vn::before { content: attr(data-title); display: block; font: 12px/1.4 Consolas, "Courier New", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #c98fa6; margin-bottom: 8px; }
.vn .vn-cast { display: none; }
#panel .vn p.vn-line, .vn p.vn-line { margin: 0 0 0.55em; }
.vn p.vn-line[data-who]::before { content: attr(data-who) ": "; font-weight: bold; color: #f0b7c9; }
.vn p.vn-line:not([data-who]) { font-style: italic; color: #d9c6d0; }

.vn.vn-on { padding: 0; border: 0; background: none; }
.vn.vn-on::before { display: none; }
.vn.vn-on > .vn-line { display: none; }
.vn.vn-on.vn-read > .vn-line { display: block; }
.vn.vn-on.vn-read { padding: 12px 16px; border: 1px solid #4a3346; background: #120c16; }
.vn.vn-on.vn-read .vn-stage { display: none; }

.vn-stage { position: relative; aspect-ratio: 16 / 10; max-height: 78vh; width: 100%; overflow: hidden; background: #050307; color: #f2e6ea;
  border: 3px solid #c98fa6; user-select: none; -webkit-user-select: none; cursor: pointer; outline: 0; font-family: Georgia, "Times New Roman", serif; }
.vn-stage:focus-visible { box-shadow: 0 0 0 3px #f0b7c9; }
.vn-stage:fullscreen { border: 0; max-height: none; aspect-ratio: auto; }
.vn-bgl { position: absolute; inset: 0; background: #050307 center / cover no-repeat; opacity: 0; transition: opacity 1.1s ease; }
.vn-bgl.on { opacity: 1; }
.vn-vig { position: absolute; inset: 0; box-shadow: inset 0 0 14vmin rgba(0, 0, 0, 0.85); pointer-events: none; }
/* background presets */
.vn-bg-night { background-image: radial-gradient(ellipse at 50% 120%, #1f2a4a 0%, #0b0e1c 55%, #04050a 100%); }
.vn-bg-sea { background-image: linear-gradient(#0a1020 0%, #13284a 52%, #0d3a4f 53%, #061a24 100%); }
.vn-bg-forest { background-image: radial-gradient(ellipse at 50% 30%, #1d3326 0%, #0c1a12 60%, #050b07 100%); }
.vn-bg-fire { background-image: radial-gradient(ellipse at 50% 100%, #8a3a14 0%, #3a160c 45%, #0e0605 100%); }
.vn-bg-cave { background-image: radial-gradient(ellipse at 50% 50%, #2b2420 0%, #120e0c 65%, #050403 100%); }
.vn-bg-dawn { background-image: linear-gradient(#2b2050 0%, #a35a6b 55%, #f0b07a 100%); }
.vn-bg-day { background-image: linear-gradient(#6f9ccf 0%, #b9d4ea 60%, #d9e6d0 100%); }
.vn-bg-blood { background-image: radial-gradient(ellipse at 50% 50%, #5a0c18 0%, #24050a 70%, #0a0103 100%); }
.vn-bg-void { background-image: none; background-color: #000; }
.vn-bg-white { background-image: none; background-color: #f4f0ea; }
.vn-bg-plum { background-image: radial-gradient(ellipse at 50% 40%, #3a2240 0%, #170f19 70%); }
.vn-bg-stars { background-color: #04040a; background-image:
  radial-gradient(1px 1px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 33% 64%, #cfd8ff, transparent),
  radial-gradient(1.5px 1.5px at 58% 18%, #fff, transparent), radial-gradient(1px 1px at 77% 46%, #ffe9c4, transparent),
  radial-gradient(1px 1px at 88% 80%, #fff, transparent), radial-gradient(1.5px 1.5px at 21% 84%, #e0e6ff, transparent),
  radial-gradient(1px 1px at 46% 40%, #fff, transparent), radial-gradient(1px 1px at 66% 90%, #fff, transparent),
  radial-gradient(ellipse at 50% 120%, #1a1840 0%, #04040a 70%); }

.vn-por { position: absolute; bottom: 0; height: 82%; width: 34%; background: center bottom / contain no-repeat; opacity: 0; filter: brightness(0.45) saturate(0.6);
  transform: translateY(8px); transition: opacity 0.6s, filter 0.4s, transform 0.4s; pointer-events: none; }
.vn-por.left { left: 3%; } .vn-por.right { right: 3%; } .vn-por.center { left: 33%; }
.vn-por.in { opacity: 1; transform: none; }
.vn-por.talk { filter: none; transform: translateY(-4px); }

.vn-box { position: absolute; left: 0; right: 0; bottom: 0; min-height: 30%; padding: 34px 6% 22px; box-sizing: border-box;
  background: linear-gradient(rgba(5, 3, 8, 0), rgba(5, 3, 8, 0.86) 28%, rgba(5, 3, 8, 0.95)); }
.vn-name { position: absolute; top: 8px; left: 6%; font-size: 17px; letter-spacing: 0.05em; }
.vn-rule { position: absolute; top: 32px; left: 6%; right: 6%; height: 1px; background: linear-gradient(90deg, rgba(240, 183, 201, 0.55), rgba(240, 183, 201, 0)); }
.vn-text { font-size: clamp(15px, 2.4vw, 19px); line-height: 1.6; max-width: 44em; min-height: 3.2em; }
.vn-text.n { color: #d9c6d0; font-style: italic; }
.vn-text.big { font-size: clamp(20px, 3.4vw, 28px); }
.vn-text.whisper { font-size: clamp(13px, 2vw, 16px); opacity: 0.75; font-style: italic; }
.vn-text.center { text-align: center; margin: 0 auto; }
.vn-text .ch { opacity: 0; transition: opacity 0.1s linear; }
.vn-text .ch.in { opacity: 1; }
.vn-more { position: absolute; right: 5%; bottom: 14px; font-size: 14px; color: #f0b7c9; opacity: 0; }
.vn-more.on { opacity: 1; animation: vn-bob 1.1s ease-in-out infinite; }
@keyframes vn-bob { 50% { transform: translateY(3px); opacity: 0.5; } }
.vn-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8%; background: #000; color: #f2e6ea;
  font: 800 clamp(20px, 4.6vw, 40px)/1.2 Unbounded, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: 0.02em; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.vn-card.on { opacity: 1; animation: vn-flicker 0.9s steps(6) 1; }
@keyframes vn-flicker { 0%, 40%, 70% { opacity: 1; } 20%, 55% { opacity: 0.35; } 100% { opacity: 1; } }
.vn-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.vn-flash.on { animation: vn-flash 0.7s ease-out 1; }
@keyframes vn-flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.vn-black { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.9s; }
.vn-black.on { opacity: 1; }
.vn-stage.shake { animation: vn-shake 0.5s linear 1; }
@keyframes vn-shake { 10%, 50%, 90% { transform: translate(-6px, 2px); } 30%, 70% { transform: translate(6px, -3px); } 100% { transform: none; } }

.vn-start, .vn-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(5, 3, 8, 0.72); text-align: center; transition: opacity 0.6s; }
.vn-start b { font: 800 clamp(18px, 3.4vw, 28px)/1.2 Unbounded, "Segoe UI", sans-serif; letter-spacing: -0.02em; }
.vn-start span, .vn-end span { font: 13px/1.5 Consolas, "Courier New", monospace; color: #bda3b6; }
.vn-btn { font: 15px/1 Consolas, "Courier New", monospace; color: #2b1a2f; background: #f0b7c9; border: 0; padding: 9px 18px; cursor: pointer; }
.vn-btn.ghost { background: transparent; color: #f0b7c9; border: 1px solid #c98fa6; }
.vn-hidden { opacity: 0; pointer-events: none; }

.vn-chrome { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 3; opacity: 0.55; transition: opacity 0.2s; }
.vn-stage:hover .vn-chrome, .vn-chrome:focus-within { opacity: 1; }
.vn-chrome button { font: 12px/1 Consolas, "Courier New", monospace; color: #f2e6ea; background: rgba(5, 3, 8, 0.7); border: 1px solid rgba(240, 183, 201, 0.4); padding: 5px 7px; cursor: pointer; }
.vn-chrome button[aria-pressed="true"] { background: #f0b7c9; color: #2b1a2f; }
.vn-log { position: absolute; inset: 0; overflow: auto; padding: 46px 8% 30px; background: rgba(5, 3, 8, 0.95); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 2; cursor: default; }
.vn-log.on { opacity: 1; pointer-events: auto; }
.vn-log p { margin: 0 0 0.9em; font-size: 16px; line-height: 1.55; color: #d9c6d0; }
.vn-log b { display: block; font-weight: normal; font-size: 13px; letter-spacing: 0.05em; }
@media (max-width: 560px) { .vn-stage { aspect-ratio: 3 / 4; } .vn-box { min-height: 38%; } .vn-por { width: 48%; height: 62%; bottom: 28%; } }
@media (prefers-reduced-motion: reduce) { .vn-stage.shake, .vn-card.on, .vn-more.on { animation: none; } }

/* ---- beta readers' marks (public/pieces/beta.js) */
::highlight(b-yellow) { background-color: rgba(255, 214, 90, 0.38); }
::highlight(b-pink) { background-color: rgba(255, 140, 190, 0.38); }
::highlight(b-blue) { background-color: rgba(120, 170, 255, 0.38); }
::highlight(b-green) { background-color: rgba(110, 220, 150, 0.35); }
::highlight(b-comment) { text-decoration: underline dotted #f0b7c9 2px; text-underline-offset: 4px; }
::highlight(b-typo) { text-decoration: underline wavy #ff6b6b 1.5px; }
::highlight(b-react) { text-decoration: underline solid rgba(255, 210, 122, 0.7) 2px; text-underline-offset: 4px; }
::highlight(b-flash) { background-color: rgba(240, 183, 201, 0.7); color: #170f19; }
.bpop { position: absolute; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 330px; padding: 6px; background: #170f19;
  border: 2px solid #c98fa6; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); font: 13px/1.3 Consolas, "Courier New", monospace; color: #f2e6ea; }
.bpop button { font: inherit; color: inherit; background: #241828; border: 1px solid #4a3346; padding: 5px 7px; cursor: pointer; }
.bpop button:hover { border-color: #f0b7c9; }
.bpop .dot { width: 20px; height: 20px; padding: 0; border-radius: 50%; }
.bpop .emo { font-size: 17px; padding: 2px 5px; background: transparent; border-color: transparent; }
.bpop textarea, .bpop input[type=text] { width: 100%; box-sizing: border-box; font: 15px/1.45 Georgia, serif; color: inherit; background: #120c16; border: 1px solid #c98fa6; padding: 5px; }
.bpop label { font-size: 12px; color: #bda3b6; }
.bbar { position: fixed; left: 0; top: 0; height: 3px; background: #f0b7c9; z-index: 41; width: 0; transition: width 0.15s; }
.bdock { position: fixed; right: 14px; bottom: 14px; z-index: 43; display: flex; gap: 6px; }
.bdock button { font: 14px/1 Consolas, "Courier New", monospace; color: #2b1a2f; background: #f0b7c9; border: 0; padding: 9px 12px; cursor: pointer; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5); }
.bdock button.ghost { background: #170f19; color: #f0b7c9; border: 1px solid #c98fa6; }
.bdrawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 42; overflow: auto; background: #170f19; border-left: 3px solid #c98fa6;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6); padding: 14px 16px 60px; box-sizing: border-box; transform: translateX(105%); transition: transform 0.25s; font-size: 16px; }
.bdrawer.on { transform: none; }
.bdrawer h3 { margin: 0 0 8px; font: 800 18px/1.2 Unbounded, "Segoe UI", sans-serif; }
.bdrawer .bopts { font: 13px/1.6 Consolas, "Courier New", monospace; color: #bda3b6; margin-bottom: 10px; }
.bnote { margin: 0 0 10px; padding: 8px 10px; background: #241828; border-left: 3px solid #c98fa6; }
.bnote.mine { border-left-color: #f0b7c9; }
.bnote q { display: block; font-style: italic; color: #bda3b6; cursor: pointer; margin-bottom: 4px; }
.bnote q:hover { color: #f0b7c9; }
.bnote .bmeta { font: 12px/1.4 Consolas, "Courier New", monospace; color: #bda3b6; }
.bnote .breply { margin-top: 6px; padding: 6px 8px; border: 1px dashed #c98fa6; font-size: 15px; }
.bnote .breply b { font: 12px Consolas, monospace; color: #f0b7c9; display: block; }
.bnote button { font: 12px Consolas, monospace; color: #bda3b6; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.bresume { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 39; font: 14px Consolas, monospace; color: #2b1a2f; background: #ffd27a; border: 0; padding: 9px 14px; cursor: pointer; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5); }

/* ---- chat screens: phone texts, a forum thread, emails, a terminal. Readable without JavaScript. */
.chat { margin: 1.6em auto; max-width: 480px; font: 15px/1.45 "Segoe UI", system-ui, sans-serif; }
.chat::before { content: attr(data-title); display: block; }
#panel .chat p.msg, .chat p.msg { margin: 0; }
.chat[data-skin="phone"] { background: #0e0e12; border: 2px solid #3a3a44; border-radius: 26px; padding: 0 12px 16px; overflow: hidden; }
.chat[data-skin="phone"]::before { margin: 0 -12px 10px; padding: 12px; text-align: center; font-weight: 600; background: #1b1b22; border-bottom: 1px solid #2c2c36; color: #e8e8ee; }
.chat[data-skin="phone"] .msg { max-width: 78%; width: fit-content; margin: 3px 0; padding: 7px 12px; border-radius: 18px; background: #2a2a33; color: #ececf2; }
.chat[data-skin="phone"] .msg[data-side="right"] { margin-left: auto; background: #3b82f6; color: #fff; }
.chat[data-skin="phone"] .msg[data-who]:not([data-side="right"])::before { content: attr(data-who); display: block; font-size: 11px; color: #9aa0ad; }
.chat[data-skin="phone"] .msg[data-time]::after { content: attr(data-time); display: block; font-size: 10px; opacity: 0.6; text-align: right; }
.chat[data-skin="forum"] { max-width: none; font-family: Verdana, Geneva, sans-serif; font-size: 14px; }
.chat[data-skin="forum"]::before { padding: 8px 12px; background: #2c3e66; color: #fff; font-weight: bold; }
.chat[data-skin="forum"] .msg { padding: 10px 12px; background: #f4f4f0; color: #222; border: 1px solid #c8c8c0; border-top: 0; }
.chat[data-skin="forum"] .msg:nth-child(even) { background: #e9e9e2; }
.chat[data-skin="forum"] .msg::before { content: attr(data-who) "  " attr(data-time); display: block; margin-bottom: 4px; font-weight: bold; color: #2c3e66; white-space: pre; }
.chat[data-skin="email"] { max-width: none; font-family: Arial, Helvetica, sans-serif; }
.chat[data-skin="email"]::before { padding: 8px 0; font-size: 18px; color: #f2e6ea; }
.chat[data-skin="email"] .msg { margin: 0 0 10px; padding: 12px 14px; background: #fff; color: #222; border: 1px solid #ddd; border-left: 4px solid #4a7bd0; }
.chat[data-skin="email"] .msg::before { content: "From: " attr(data-who) "\A" attr(data-time); white-space: pre; display: block; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #eee; color: #666; font-size: 13px; }
.chat[data-skin="terminal"] { max-width: none; padding: 14px 16px; background: #050805; color: #7dff9b; border: 1px solid #1f3a24; font: 14px/1.5 Consolas, "Courier New", monospace; text-shadow: 0 0 4px rgba(125, 255, 155, 0.4); }
.chat[data-skin="terminal"]::before { color: #3f8f53; margin-bottom: 6px; }
.chat[data-skin="terminal"] .msg::before { content: attr(data-who) "> "; color: #b6ffc7; }
.chat[data-skin="terminal"] .msg:not([data-who])::before { content: "> "; }

/* ---- status windows and character cards */
.sysbox { margin: 1.6em auto; max-width: 460px; padding: 14px 18px; border: 1px solid; font: 15px/1.5 Consolas, "Courier New", monospace; position: relative;
  --c: #8fb4ff; color: #e6eeff; border-color: var(--c); background: linear-gradient(rgba(20, 30, 60, 0.92), rgba(8, 12, 28, 0.95)); box-shadow: 0 0 18px rgba(120, 160, 255, 0.25), inset 0 0 18px rgba(120, 160, 255, 0.08); }
.sysbox[data-tone="gold"] { --c: #ffd27a; color: #fff6e0; background: linear-gradient(rgba(50, 36, 10, 0.92), rgba(24, 16, 4, 0.95)); box-shadow: 0 0 18px rgba(255, 200, 100, 0.25); }
.sysbox[data-tone="red"] { --c: #ff6b7d; color: #ffe8eb; background: linear-gradient(rgba(60, 10, 18, 0.92), rgba(26, 4, 8, 0.95)); box-shadow: 0 0 18px rgba(255, 90, 110, 0.3); }
.sysbox[data-tone="green"] { --c: #7dff9b; color: #e8ffee; background: linear-gradient(rgba(10, 40, 20, 0.92), rgba(4, 18, 8, 0.95)); box-shadow: 0 0 18px rgba(110, 255, 150, 0.2); }
.sysbox[data-tone="pink"] { --c: #f0b7c9; color: #fff0f5; background: linear-gradient(rgba(50, 24, 40, 0.92), rgba(23, 15, 25, 0.95)); box-shadow: 0 0 18px rgba(240, 183, 201, 0.25); }
.sysbox[data-tone="plain"] { --c: #c8c8c8; color: #eee; background: #111; box-shadow: none; }
.sysbox::before { content: attr(data-title); display: block; margin: -4px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--c); color: var(--c); letter-spacing: 0.18em; text-align: center; font-weight: bold; }
#panel .sysbox p, .sysbox p { margin: 0 0 4px; text-indent: 0; }
.sysbox .sys-pic { float: right; width: 96px; height: 96px; object-fit: cover; margin: 0 0 8px 12px; border: 1px solid var(--c); }
.sysbox .sys-row { display: flex; gap: 10px; } .sysbox .sys-row .sys-k { flex: 0 0 auto; min-width: 7em; color: var(--c); font-weight: normal; } .sysbox .sys-row .sys-v { flex: 1; }
.sysbox .sys-bar .sys-k { display: inline-block; min-width: 7em; color: var(--c); font-weight: normal; }
.sysbox .sys-meter { display: inline-block; vertical-align: middle; width: calc(100% - 13em); height: 8px; border: 1px solid var(--c); margin: 0 6px; }
.sysbox .sys-meter i { display: block; height: 100%; width: var(--p, 0%); background: var(--c); box-shadow: 0 0 6px var(--c); }
.sysbox .sys-bar::after { content: attr(data-val) " / " attr(data-max); font-size: 12px; opacity: 0.8; }
.sysbox .sys-rule { height: 0; border-top: 1px dashed var(--c); margin: 8px 0; opacity: 0.6; }
.sysbox::after { content: ""; display: block; clear: both; }

/* ---- choices (readers pick; without JavaScript every path shows, labelled) */
.choice { margin: 1.6em 0; padding: 12px 16px; border: 1px solid #c98fa6; background: #1d1420; }
.choice::before { content: attr(data-prompt); display: block; font-style: italic; margin-bottom: 8px; }
.choice > .opt::before { content: "\2192  " attr(data-label); display: block; font: bold 14px/1.6 Consolas, monospace; color: #f0b7c9; }
.choice.on > .opt { display: none; } .choice.on > .opt.picked { display: block; } .choice.on > .opt::before { display: none; }
.choice .choice-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.choice .choice-btns button { font: 14px/1.3 Consolas, monospace; color: #f0b7c9; background: transparent; border: 1px solid #c98fa6; padding: 6px 12px; cursor: pointer; }
.choice .choice-btns button:hover, .choice .choice-btns button[aria-pressed="true"] { background: #f0b7c9; color: #2b1a2f; }
.choice .choice-btns button:disabled:not([aria-pressed="true"]) { opacity: 0.35; cursor: default; }
.choice .opt.picked { animation: piece-in 0.5s ease; }
@keyframes piece-in { from { opacity: 0; transform: translateY(4px); } }

/* ---- locked passages */
.lock { margin: 1.6em 0; }
.lock.locked > :not(.lock-ui) { display: none; }
.lock .lock-ui { padding: 12px 16px; border: 1px dashed #c98fa6; text-align: center; }
.lock .lock-ui p { margin: 0 0 8px; text-indent: 0; font-style: italic; }
.lock .lock-ui input { font: 16px Georgia, serif; color: inherit; background: #120c16; border: 1px solid #c98fa6; padding: 5px 8px; width: min(260px, 70%); }
.lock .lock-ui button { font: 14px Consolas, monospace; color: #2b1a2f; background: #f0b7c9; border: 0; padding: 7px 12px; margin-left: 6px; cursor: pointer; }
.lock .lock-ui .no { color: #ff8f8f; font: 13px Consolas, monospace; min-height: 1.2em; margin: 6px 0 0; }
.lock.opened > :not(.lock-ui) { animation: piece-in 0.6s ease; }
.lock.opened .lock-ui { display: none; }

/* ---- content warnings */
details.cw { margin: 1.4em 0; border: 1px solid #c98fa6; background: #1d1420; }
details.cw > summary { cursor: pointer; padding: 8px 12px; font: 14px/1.5 Consolas, monospace; color: #ffd27a; list-style: none; }
details.cw > summary::-webkit-details-marker { display: none; }
details.cw > summary::before { content: "\25B8  "; } details.cw[open] > summary::before { content: "\25BE  "; }
details.cw > :not(summary) { margin-left: 12px; margin-right: 12px; }

/* ---- footnotes */
.fn { text-decoration: underline dotted #f0b7c9 1.5px; text-underline-offset: 3px; cursor: help; }
.fn sup.fn-n { font: 11px Consolas, monospace; color: #f0b7c9; margin-left: 1px; }
.fn-pop { position: absolute; z-index: 30; max-width: 320px; padding: 8px 11px; background: #170f19; border: 2px solid #c98fa6; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6); font: 15px/1.5 Georgia, serif; color: #f2e6ea; }
.fn-list { margin-top: 2em; padding-top: 0.6em; border-top: 1px dotted #c98fa6; font-size: 14px; }
.fn-list ol { margin: 0; padding-left: 1.4em; } .fn-list li { margin: 0 0 4px; }

/* ---- hover popups (pieces.js tips): words with a note, links with a note, glossary words */
.tip { text-decoration: underline dotted currentColor 1.5px; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); text-underline-offset: 3px; cursor: help; border-radius: 2px; }
.tip.tip-on, .wr[data-note].tip-on { background: rgba(240, 183, 201, 0.16); }
.wr[data-note] { cursor: help; }
.tip:focus-visible, .wr[data-note]:focus-visible { outline: 2px solid #f0b7c9; outline-offset: 2px; }
a[data-note]::after { content: "\2009\25E6"; font-size: 0.8em; opacity: 0.7; }
.tip-pop { position: absolute; z-index: 40; width: max-content; max-width: min(340px, calc(100vw - 16px)); box-sizing: border-box; padding: 9px 12px;
           background: #170f19; border: 2px solid #c98fa6; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6); font: 15px/1.5 Georgia, serif; color: #f2e6ea;
           text-align: left; text-indent: 0; letter-spacing: normal; animation: tip-in 0.12s ease-out; }
.tip-pop[hidden] { display: none; }
.tip-pop .tip-img { display: block; max-width: 100%; max-height: 220px; margin: 0 0 7px; object-fit: contain; }
.tip-pop .tip-title { display: block; font-weight: bold; margin: 0 0 2px; }
.tip-pop a { color: #f0b7c9; }
.tip-pop .tip-go { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dotted #c98fa6; font: 13px Consolas, monospace; }
@keyframes tip-in { from { opacity: 0; transform: translateY(-3px); } }
.tip-pop.up { animation-name: tip-in-up; }
@keyframes tip-in-up { from { opacity: 0; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .tip-pop { animation: none; } }
@media print { .tip-pop { display: none; } }
/* links that leave the site say so, and spots links jump to land below the site's header */
#panel a[target="_blank"]:not(.tip-go)::after, .ed a[target="_blank"]::after { content: "\2009\2197"; font-size: 0.75em; opacity: 0.7; }
#panel a[target="_blank"][data-note]::after { content: "\2009\2197\25E6"; }
[id^="at-"] { scroll-margin-top: 80px; }
[id^="at-"]:target { animation: at-flash 1.6s ease-out; }
@keyframes at-flash { from { background: rgba(240, 183, 201, 0.3); } }

/* ---- letters and documents */
.doc { margin: 1.8em auto; max-width: 520px; padding: 22px 26px; position: relative; }
#panel .doc p, .doc p { margin: 0 0 0.8em; }
.doc[data-skin="letter"] { background: #f3ead8; color: #3a2a1a; font: 17px/1.6 "Palatino Linotype", Palatino, Georgia, serif; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); transform: rotate(-0.4deg); }
.doc[data-skin="note"] { max-width: 360px; background: #fff7a8; color: #333; font: 18px/1.5 "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); transform: rotate(1.2deg); }
.doc[data-skin="typed"] { background: #fbfbf6; color: #1a1a1a; font: 15px/1.6 "Courier New", Courier, monospace; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
.doc[data-skin="newspaper"] { max-width: none; background: #e8e3d6; color: #1c1c1c; font: 15px/1.5 "Times New Roman", serif; column-count: 2; column-gap: 22px; column-rule: 1px solid #bbb; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
.doc[data-skin="newspaper"]::before { content: attr(data-title); column-span: all; display: block; text-align: center; font: bold 26px/1.1 "Times New Roman", serif; text-transform: uppercase; border-bottom: 3px double #1c1c1c; padding-bottom: 6px; margin-bottom: 10px; }
.doc[data-skin="scroll"] { background: linear-gradient(90deg, #c9b38a, #efe2c2 8%, #efe2c2 92%, #c9b38a); color: #3b2a12; font: italic 17px/1.6 "Palatino Linotype", Georgia, serif; border-top: 10px solid #8b6b3a; border-bottom: 10px solid #8b6b3a; border-radius: 4px; }
.doc[data-skin="screen"] { background: #0b1020; color: #cfe0ff; font: 15px/1.6 "Segoe UI", system-ui, sans-serif; border: 1px solid #2c3e66; border-radius: 8px; }
.doc[data-title]:not([data-skin="newspaper"])::before { content: attr(data-title); display: block; margin-bottom: 0.8em; font-weight: bold; }

/* ---- sound and video */
figure.media { margin: 1.6em 0; text-align: center; }
figure.media audio { width: 100%; max-width: 480px; }
figure.media video { max-width: 100%; border: 3px solid #c98fa6; background: #000; }
figure.media figcaption { margin-top: 6px; font: 14px/1.5 Consolas, monospace; color: #bda3b6; }

/* ---- maps with pins */
.pins { position: relative; margin: 1.6em 0; }
.pins img { display: block; width: 100%; height: auto; border: 3px solid #c98fa6; box-sizing: border-box; }
.pins .pin { position: absolute; transform: translate(-50%, -100%); font: 12px/1.2 Consolas, monospace; color: #2b1a2f; background: #f0b7c9; padding: 2px 6px; border-radius: 3px; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.pins .pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #f0b7c9; }
.pins:not(.pins-on) .pin { position: static; display: inline-block; margin: 6px 6px 0 0; transform: none; }
.pins:not(.pins-on) .pin::after { display: none; }

/* ---- text effects (the styles menu) */
.fx-glitch { position: relative; display: inline-block; animation: fx-glitch 2.4s infinite steps(1); }
@keyframes fx-glitch { 0%, 88%, 100% { text-shadow: none; transform: none; } 90% { text-shadow: -2px 0 #ff2a6d, 2px 0 #05d9e8; transform: translateX(1px); } 93% { text-shadow: 2px 0 #ff2a6d, -2px 0 #05d9e8; transform: translateX(-1px) skewX(-6deg); } 96% { text-shadow: -1px 0 #05d9e8; transform: none; } }
.fx-shake { display: inline-block; animation: fx-shake 0.35s infinite linear; }
@keyframes fx-shake { 25% { transform: translate(1px, -1px); } 50% { transform: translate(-1px, 1px); } 75% { transform: translate(1px, 1px); } }
.fx-wave .w { display: inline-block; animation: fx-wave 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * 0.07s); }
@keyframes fx-wave { 50% { transform: translateY(-3px); } }
.fx-flicker { animation: fx-flicker 3s infinite; }
@keyframes fx-flicker { 0%, 19%, 21%, 23%, 54%, 56%, 100% { opacity: 1; } 20%, 22%, 55% { opacity: 0.25; } }
.fx-redacted { background: #000; color: transparent; border-radius: 1px; cursor: pointer; user-select: none; }
.fx-redacted.shown { background: rgba(255, 255, 255, 0.08); color: inherit; }
.fx-spoiler { filter: blur(5px); cursor: pointer; transition: filter 0.3s; }
.fx-spoiler.shown { filter: none; }
.fx-fadein { opacity: 0; transition: opacity 1.6s ease; } .fx-fadein.shown, body.desk .fx-fadein { opacity: 1; }
.fx-hand { font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; }
.fx-whisper { font-size: 0.85em; opacity: 0.65; font-style: italic; letter-spacing: 0.02em; }
.fx-shout { font-weight: bold; text-transform: uppercase; letter-spacing: 0.04em; font-size: 1.08em; }
.fx-rainbow { background: linear-gradient(90deg, #ff6b6b, #ffd27a, #7dff9b, #78aaff, #c38bff, #ff6b6b); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: fx-rainbow 4s linear infinite; }
@keyframes fx-rainbow { to { background-position: 200% 0; } }
/* ---- effects from the style maker (author/write/style-fx.js): --fx-* come from each style */
@keyframes fxs-shake { 25% { transform: translate(var(--fx-shake), calc(var(--fx-shake) * -1)); } 50% { transform: translate(calc(var(--fx-shake) * -1), var(--fx-shake)); } 75% { transform: translate(var(--fx-shake), var(--fx-shake)); } }
@keyframes fxs-tremble { 33% { transform: translate(var(--fx-tremble), 0); } 66% { transform: translate(calc(var(--fx-tremble) * -1), var(--fx-tremble)); } }
@keyframes fxs-sway { from { transform: rotate(calc(var(--fx-sway) * -1)); } to { transform: rotate(var(--fx-sway)); } }
@keyframes fxs-float { from { transform: translateY(0); } to { transform: translateY(calc(var(--fx-float) * -1)); } }
@keyframes fxs-pulse { to { transform: scale(var(--fx-pulse)); } }
@keyframes fxs-drift { from { transform: translateX(calc(var(--fx-drift) * -1)); } to { transform: translateX(var(--fx-drift)); } }
@keyframes fxs-jolt { 0%, 86%, 100% { transform: none; text-shadow: none; } 88% { transform: translateX(var(--fx-jolt)); text-shadow: calc(var(--fx-jolt) * -1) 0 #ff2a6d, var(--fx-jolt) 0 #05d9e8; } 92% { transform: translateX(calc(var(--fx-jolt) * -1)) skewX(8deg); } 96% { transform: none; text-shadow: var(--fx-jolt) 0 #ff2a6d; } }
@keyframes fxs-flicker { 0%, 19%, 21%, 23%, 54%, 56%, 100% { opacity: 1; } 20%, 22%, 55% { opacity: var(--fx-flicker); } }
@keyframes fxs-breathe { from { opacity: 1; } to { opacity: var(--fx-breathe); } }
@keyframes fxs-neon { from { text-shadow: 0 0 calc(var(--fx-neon) / 3) var(--fx-neonc); } to { text-shadow: 0 0 var(--fx-neon) var(--fx-neonc), 0 0 calc(var(--fx-neon) * 2) var(--fx-neonc); } }
@keyframes fxs-focus { from { filter: blur(0); } to { filter: blur(var(--fx-focus)); } }
@keyframes fxs-double { from { text-shadow: 0 0 0 transparent; } to { text-shadow: calc(var(--fx-double) * -1) 0 1px var(--fx-doublec), var(--fx-double) 0 1px var(--fx-doublec); } }
@keyframes fxs-shimmer { to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { [class*="st-"] { animation: none !important; } }
ruby { ruby-align: center; } rt { font-size: 50%; line-height: 1; }

/* ---- bloodstained: the letters keep their colour, with dried blood soaked into them. The stain is
   a texture clipped to the glyphs (background-clip: text), so what's behind the words stays clean.
   --blood-some and --blood-soaked are also used by text styles with a "bloodstain" (desk.js, writing.py).
   Two layers (stain over the text's colour) cut to the letters leave a thin line of the colour round
   each letter, as each layer is cut on its own; so pieces.js bakes the two into one picture per colour
   (--blood-baked), and the two layers are only what shows until it has. --blood names the texture. */
:root {
  --blood-some: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='220'%3E%3Cfilter id='a' x='0' y='0' width='1' height='1' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.017 .025' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.56 0 0 0 0 0.04 0 0 0 0 0.06 18 0 0 0 -10.0'/%3E%3C/filter%3E%3Cfilter id='b' x='0' y='0' width='1' height='1' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.017 .025' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.01 0 0 0 0 0.03 14 0 0 0 -8.6'/%3E%3C/filter%3E%3Cfilter id='c' x='0' y='0' width='1' height='1' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.15' numOctaves='1' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.02 0 0 0 0 0.04 22 0 0 0 -14.7'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23a)'/%3E%3Crect width='100%' height='100%' filter='url(%23b)'/%3E%3Crect width='100%' height='100%' filter='url(%23c)'/%3E%3C/svg%3E");
  --blood-soaked: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='220'%3E%3Cfilter id='a' x='0' y='0' width='1' height='1' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.017 .025' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.56 0 0 0 0 0.04 0 0 0 0 0.06 18 0 0 0 -9.3'/%3E%3C/filter%3E%3Cfilter id='b' x='0' y='0' width='1' height='1' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.017 .025' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.01 0 0 0 0 0.03 14 0 0 0 -8.0'/%3E%3C/filter%3E%3Cfilter id='c' x='0' y='0' width='1' height='1' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.15' numOctaves='1' seed='16' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.02 0 0 0 0 0.04 22 0 0 0 -14.7'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23a)'/%3E%3Crect width='100%' height='100%' filter='url(%23b)'/%3E%3Crect width='100%' height='100%' filter='url(%23c)'/%3E%3C/svg%3E");
}
.fx-blood { --blood-scatter: 1; --blood: some; --blood-baked: initial; background-image: var(--blood-baked, var(--blood-some), linear-gradient(currentColor, currentColor)); background-size: 12em 8.25em, 100% 100%; background-position: calc(var(--bsx, 0) * 12em) calc(var(--bsy, 0) * 12em), 0 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; }
@media (prefers-reduced-motion: reduce) { .fx-glitch, .fx-shake, .fx-wave .w, .fx-flicker, .fx-rainbow, .fx-cutout .c { animation: none !important; } .fx-fadein { opacity: 1; transition: none; } }
body.desk .fx-spoiler { filter: blur(1.5px); } body.desk .fx-redacted { color: #aaa; background: #000; }

/* ---- games (public/pieces/games.js). Before a game loads (or without JavaScript), its fallback text shows. */
.game { margin: 1.8em 0; }
.game:not(.game-on) { padding: 10px 14px; border: 1px dashed #c98fa6; }
.game:not(.game-on)::before { content: "(a game plays here)"; display: block; font: 12px Consolas, monospace; color: #bda3b6; }
.game-box { position: relative; padding: 14px 16px 16px; border: 3px solid #c98fa6; background: #120c16; font-size: 17px; }
.game-title { margin: -2px 0 10px; font: 800 18px/1.2 Unbounded, "Segoe UI", sans-serif; letter-spacing: -0.02em; color: #f0b7c9; }
#panel .game-box p, .game-box p { margin: 0 0 0.7em; text-indent: 0; }
.game-btn { font: 14px/1.3 Consolas, "Courier New", monospace; color: #2b1a2f; background: #f0b7c9; border: 1px solid #f0b7c9; padding: 7px 13px; cursor: pointer; margin: 0 6px 6px 0; }
.game-btn:hover:not(:disabled) { background: #ffd3e1; }
.game-btn.ghost { background: transparent; color: #f0b7c9; border-color: #c98fa6; }
.game-btn:disabled { opacity: 0.4; cursor: default; }
.game-bar { display: flex; justify-content: flex-end; gap: 4px; margin-top: 8px; border-top: 1px dotted #4a3346; padding-top: 8px; }
.game-bar .game-btn { font-size: 12px; padding: 4px 9px; margin: 0; }
.game-end { padding: 12px 14px; margin-top: 10px; border: 1px solid #c98fa6; background: #1d1420; text-align: center; animation: piece-in 0.5s ease; }

/* story */
.story-hud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.story-hud:empty { display: none; }
.story-var { font: 12px Consolas, monospace; padding: 2px 7px; border: 1px solid #c98fa6; color: #ffd27a; }
.story-log { min-height: 3em; }
.story-who { color: #f0b7c9; }
.story-intro { font-style: italic; color: #d9c6d0; }
.story-opts { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.story-opts .choice { margin: 0; text-align: left; }
.skin-chat .story-log { max-height: 460px; overflow-y: auto; padding: 8px; background: #0e0e12; border: 1px solid #2c2c36; border-radius: 14px; font: 15px/1.45 "Segoe UI", system-ui, sans-serif; }
.skin-chat .story-msg { width: fit-content; max-width: 78%; margin: 4px 0; padding: 7px 12px; border-radius: 16px; background: #2a2a33; color: #ececf2; animation: piece-in 0.25s ease; }
.skin-chat .story-msg b { display: block; font-size: 11px; color: #9aa0ad; font-weight: normal; }
.skin-chat .story-msg.me { margin-left: auto; background: #3b82f6; color: #fff; }
.skin-chat .story-msg.typing span { letter-spacing: 3px; opacity: 0.7; animation: fx-flicker 1.2s infinite; }
.skin-chat .story-sys { text-align: center; font: 12px Consolas, monospace; color: #9aa0ad; margin: 8px 0; }
.skin-chat .story-opts { align-items: flex-end; }
.skin-chat .story-opts .choice { border-radius: 16px; font-family: "Segoe UI", system-ui, sans-serif; }
.skin-terminal .story-log { min-height: 8em; max-height: 460px; overflow-y: auto; padding: 10px 12px; background: #050805; color: #7dff9b; font: 14px/1.5 Consolas, monospace; text-shadow: 0 0 4px rgba(125, 255, 155, 0.35); }
.skin-terminal .story-log b { color: #b6ffc7; } .skin-terminal .story-in { color: #e9ffef; }
.skin-terminal .story-opts .choice { background: #050805; color: #7dff9b; border-color: #1f3a24; font-family: Consolas, monospace; }

/* danmaku */
.dm-wrap { position: relative; max-width: 480px; margin: 0 auto; }
.dm-cv { display: block; width: 100%; aspect-ratio: 4 / 5; border: 1px solid #4a3346; touch-action: none; cursor: crosshair; outline: 0; }
.dm-cv:focus-visible { box-shadow: 0 0 0 2px #f0b7c9; }
.dm-ui { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; font: 12px Consolas, monospace; color: #f2e6ea; pointer-events: none; }
.dm-time { flex: 1; height: 4px; background: rgba(240, 183, 201, 0.2); } .dm-time i { display: block; height: 100%; background: #f0b7c9; }
.dm-lives { color: #ff6b7d; letter-spacing: 2px; }
.dm-say { position: absolute; left: 8%; right: 8%; bottom: 12px; padding: 8px 12px; background: rgba(10, 5, 14, 0.85); border: 1px solid #c98fa6; font-size: 15px; opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.dm-say.on { opacity: 1; }
.dm-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(5, 2, 8, 0.72); }
.dm-over[hidden] { display: none; }
.dm-over .game-end { max-width: 360px; }
.dm-help { font: 12px Consolas, monospace; color: #bda3b6; }
.dm-over select { font: 14px Consolas, monospace; background: #120c16; color: #f2e6ea; border: 1px solid #c98fa6; padding: 5px; margin: 0 8px 6px 0; }

/* battle */
.bt-arena { text-align: center; padding: 10px 0 14px; }
.bt-foe b { display: block; margin: 6px 0 4px; font-size: 18px; }
.bt-orb { width: 90px; height: 90px; border-radius: 50%; margin: 0 auto; }
.bt-sprite { max-height: 160px; max-width: 70%; }
.bt-bar { position: relative; display: block; height: 14px; max-width: 260px; margin: 2px auto; background: #2a1d2c; border: 1px solid #4a3346; }
.bt-bar i { display: block; height: 100%; background: #ff6b7d; transition: width 0.5s; } .bt-bar.mp i { background: #78aaff; }
.bt-bar small { position: absolute; inset: 0; font: 10px/14px Consolas, monospace; color: #fff; text-align: center; }
.bt-party { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.bt-card { padding: 8px; border: 1px solid; background: #1d1420; font-size: 15px; text-align: center; }
.bt-card.now { box-shadow: 0 0 0 2px #f0b7c9; } .bt-card.down { opacity: 0.35; }
.bt-log { max-height: 180px; overflow-y: auto; padding: 8px 10px; background: #0b070d; border: 1px solid #4a3346; font-size: 15px; }
.bt-log p { margin: 0 0 4px; } .bt-line { font-style: italic; }
.bt-cmd { margin-top: 10px; }
.bt-who { font: bold 14px Consolas, monospace; margin-right: 8px; }
.bt-move { background: #241828; color: #f2e6ea; border-color: #4a3346; } .bt-move small { color: #78aaff; }
.bt-sys { font-weight: bold; }
.bt-hit { animation: vn-shake 0.4s linear 1; }

/* thread */
.th-prompt { font-style: italic; }
.th-field { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0 70px; }
.th-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.th-line { fill: none; stroke-width: 3; filter: drop-shadow(0 0 4px currentColor); animation: piece-in 0.4s ease; }
.th-line.bad { stroke: #ff6b7d !important; stroke-dasharray: 6 6; }
.th-col { display: flex; flex-direction: column; gap: 8px; }
.th-item { position: relative; z-index: 1; font: 15px/1.35 Georgia, serif; color: #f2e6ea; background: #1d1420; border: 1px solid #4a3346; padding: 8px 10px; cursor: pointer; text-align: left; }
.th-item:hover { border-color: #f0b7c9; } .th-item.sel { border-color: #ffd27a; box-shadow: 0 0 0 2px #ffd27a; }
.th-item.matched { border-color: #ffd27a; color: #ffd27a; cursor: default; } .th-item.wrong { border-color: #ff6b7d; animation: vn-shake 0.4s linear 1; }
.th-status { font: 13px Consolas, monospace; color: #bda3b6; text-align: center; margin-top: 10px; }

/* traits: the Labyrinth Quiz look, playable */
.game-traits.cyoa { background: #000; border-color: #555; text-align: center; font: 15px/1.4 Arial, Helvetica, sans-serif; }
.game-traits .game-title { color: #ffcc33; font: bold 28px/1.2 "Times New Roman", serif; text-transform: none; }
.tr-card { font: inherit; color: #fff; background: #000; cursor: pointer; text-align: center; }
.tr-card:hover { border-color: #ffcc33; } .tr-card.on { border-color: #ffcc33; box-shadow: 0 0 0 2px #ffcc33, 0 0 16px rgba(255, 204, 51, 0.4); }
.tr-no { animation: vn-shake 0.4s linear 1; color: #ff6666 !important; }
.tr-result { margin: 10px 0; } .tr-result ul { list-style: none; padding: 0; }

/* hunt */
.hu-wrap { position: relative; cursor: zoom-in; }
.hu-wrap img { display: block; width: 100%; height: auto; border: 1px solid #4a3346; }
.hu-found, .hu-miss { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.hu-found { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #ffd27a; color: #ffd27a; font: bold 14px/22px Consolas, monospace; text-align: center; background: rgba(0, 0, 0, 0.45); box-shadow: 0 0 10px #ffd27a; }
.hu-miss { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.6); animation: fx-flicker 0.5s 1; }
.hu-note { min-height: 1.5em; margin-top: 8px; font-size: 16px; }

/* ---- more documents: reports, transcripts, telegrams, receipts, polaroids, lined paper... */
.doc[data-skin="report"] { max-width: 560px; background: #f2f2ee; color: #151515; font: 14px/1.5 "Courier New", Courier, monospace; border-top: 26px solid #2d3a4f; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
.doc[data-skin="report"]::before { color: #2d3a4f; text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 1px solid #2d3a4f; padding-bottom: 4px; }
.doc[data-skin="transcript"] { max-width: 600px; background: #fafaf7; color: #111; font: 14px/1.6 "Courier New", Courier, monospace; border-left: 4px solid #888; }
.doc[data-skin="telegram"] { max-width: 460px; background: #efe3b8; color: #222; font: bold 14px/1.6 "Courier New", monospace; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid #b5a76d; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); }
.doc[data-skin="telegram"]::before { text-align: center; border-bottom: 2px solid #8a6d1f; color: #8a6d1f; }
.doc[data-skin="receipt"] { max-width: 260px; background: #fdfdf8; color: #222; font: 13px/1.45 Consolas, "Courier New", monospace; text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 8px repeat-x;
  mask: linear-gradient(#000, #000) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 8px repeat-x; }
.doc[data-skin="polaroid"] { max-width: 300px; background: #fbfbf8; color: #333; padding: 14px 14px 18px; font: 18px/1.4 "Segoe Print", "Ink Free", cursive; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); transform: rotate(-2deg); }
.doc[data-skin="polaroid"] img { width: 100%; display: block; margin-bottom: 10px; filter: sepia(0.25) contrast(1.05); }
.doc[data-skin="lined"] { background: #fdfcf6 repeating-linear-gradient(transparent 0 27px, #a9c3e3 27px 28px); color: #23305a; font: 18px/28px "Segoe Print", "Ink Free", cursive; border-left: 2px solid #e19a9a; padding-top: 28px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
#panel .doc[data-skin="lined"] p { margin: 0 0 28px; }
.doc[data-skin="graph"] { background: #fbfdff; background-image: linear-gradient(#cfe0f3 1px, transparent 1px), linear-gradient(90deg, #cfe0f3 1px, transparent 1px); background-size: 18px 18px; color: #1d2a44; font: 15px/1.6 Consolas, monospace; }
.doc[data-skin="diary"] { background: #f6ecd9; color: #3b2516; font: italic 17px/1.6 Georgia, serif; border-left: 14px solid #6b2b2b; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.doc[data-skin="diary"]::before { font-style: normal; font-size: 13px; letter-spacing: 0.08em; color: #6b2b2b; }
.doc[data-skin="medical"] { background: #fff; color: #102030; font: 14px/1.5 Arial, Helvetica, sans-serif; border: 1px solid #9fb3c8; border-top: 8px solid #3a7ca5; }
.doc[data-skin="burnt"] { background: radial-gradient(ellipse at 80% 90%, #1a0e05 0 6%, #5a3412 12%, #cdb48c 26%, #e8d7b4 60%), #e8d7b4; color: #2a1a0c; font: 16px/1.6 Georgia, serif; clip-path: polygon(0 3%, 6% 0, 18% 2%, 31% 0, 47% 3%, 62% 0, 78% 2%, 92% 0, 100% 4%, 98% 22%, 100% 41%, 97% 63%, 100% 80%, 94% 100%, 72% 97%, 55% 100%, 33% 97%, 14% 100%, 0 95%, 3% 70%, 0 48%, 2% 25%); }
.doc[data-skin="index"] { max-width: 420px; background: #fffef8 repeating-linear-gradient(transparent 0 23px, #bcd2ea 23px 24px); background-position: 0 40px; color: #222; font: 16px/24px "Segoe Print", "Ink Free", cursive; border-top: 40px solid #fffef8; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); }
.doc[data-skin="index"]::before { position: absolute; top: -32px; left: 26px; right: 26px; border-bottom: 2px solid #e88; }
.doc[data-skin="fax"] { background: #e9e9e4; color: #1b1b1b; font: 14px/1.5 "Courier New", monospace; filter: contrast(1.3) grayscale(1); background-image: repeating-linear-gradient(transparent 0 3px, rgba(0, 0, 0, 0.04) 3px 4px); }
.doc[data-skin="sign"] { max-width: 420px; background: #1f3b2b; color: #f2efe2; font: bold 18px/1.4 "Segoe UI", sans-serif; text-align: center; border: 6px solid #c9b77b; border-radius: 6px; }
.doc[data-skin="wanted"] { max-width: 380px; background: #e7d3a5; color: #3a2210; font: 16px/1.5 Georgia, serif; text-align: center; border: 2px solid #6d4a25; box-shadow: inset 0 0 40px rgba(110, 70, 20, 0.5); }
.doc[data-skin="wanted"]::before { font: bold 30px/1.1 "Times New Roman", serif; letter-spacing: 0.1em; text-transform: uppercase; }
.doc[data-skin="tape"] { background: #111; color: #e4e4e4; font: 14px/1.6 Consolas, monospace; border: 2px solid #444; border-radius: 10px; }
.doc[data-skin="tape"]::before { color: #ff5a5a; } .doc[data-skin="tape"]::before { content: "\25CF  REC  " attr(data-title); }
.doc[data-skin="parchment"] { background: radial-gradient(ellipse at center, #f3e3bf 50%, #d8bb83 100%); color: #3b2610; font: 18px/1.6 "Palatino Linotype", "Book Antiqua", Georgia, serif; border-radius: 3px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
.doc[data-skin="stone"] { background: #6d6a66; color: #2a2826; font: bold 17px/1.6 "Times New Roman", serif; text-transform: uppercase; letter-spacing: 0.14em; text-align: center; text-shadow: 1px 1px 0 #8f8b86, -1px -1px 0 #4a4744; border-radius: 40% 40% 4px 4px / 18% 18% 4px 4px; }
.doc[data-skin="manuscript"] { max-width: 600px; background: #fff; color: #111; font: 16px/2 "Courier New", Courier, monospace; padding: 40px 54px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
#panel .doc[data-skin="manuscript"] p { text-indent: 3em; margin: 0; }

/* a reading over a long phrase (pieces.js wideRuby): the phrase wraps, its reading sits under or over it */
ruby.ruby-wide { display: inline-flex; flex-direction: column; max-width: 100%; vertical-align: top; text-align: inherit; }
ruby.ruby-wide > .rb { display: block; }
ruby.ruby-wide > rt { display: block; order: -1; text-align: inherit; line-height: 1.3; }
ruby.ruby-wide.ruby-under > rt { order: 1; }
ruby.ruby-wide > rp { display: none; }

/* ---- newspaper cutout letters (pieces.js splits them): a ransom note, Persona 5-style. Each letter is a
   scrap with its own paper (c-p*), typeface (c-f*) and cut (c-k*), and it snaps between three poses
   (--r/--y 1..3) on the same beat as the rest, a step at a time like stop motion. */
.fx-cutout { font-weight: 700; filter: drop-shadow(0.05em 0.07em 0 rgba(0, 0, 0, 0.6)); }   /* (on the whole word: a cut letter would clip its own shadow) */
.fx-cutout .c-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fx-cutout .c-gap { display: inline-block; width: 0.18em; }
.fx-cutout .c-word { display: inline-block; white-space: nowrap; }
.fx-cutout .c { display: inline-block; margin: 0 0.04em; padding: 0.02em 0.14em 0.06em; line-height: 1.05; font-size: calc(var(--z) * 1em); text-indent: 0;
  background: #f4f1ea; color: #111; text-shadow: none;
  transform: translate(var(--x1), var(--y1)) rotate(var(--r1)); animation: fx-cut 0.72s steps(1) infinite; animation-delay: var(--d); }
@keyframes fx-cut { 0% { transform: translate(var(--x1), var(--y1)) rotate(var(--r1)); } 33.333% { transform: translate(var(--x2), var(--y2)) rotate(var(--r2)); } 66.666% { transform: translate(var(--x3), var(--y3)) rotate(var(--r3)); } }
/* papers: newsprint, black, red, cream, magazine yellow, white on red, grey print */
.fx-cutout .c-p0 { background: #f4f1ea; color: #111; }
.fx-cutout .c-p1 { background: #111; color: #f4f1ea; }
.fx-cutout .c-p2 { background: #d7192b; color: #fff; }
.fx-cutout .c-p3 { background: #e9dfc4; color: #2a2420; }
.fx-cutout .c-p4 { background: #ffe14a; color: #111; }
.fx-cutout .c-p5 { background: #fff; color: #d7192b; }
.fx-cutout .c-p6 { background: #cfcfcf; color: #111; background-image: radial-gradient(rgba(0, 0, 0, 0.18) 0.6px, transparent 0.8px); background-size: 3px 3px; }
/* typefaces */
.fx-cutout .c-f0 { font-family: "Times New Roman", Times, serif; }
.fx-cutout .c-f1 { font-family: Impact, "Arial Black", "Helvetica Neue", sans-serif; font-weight: 400; letter-spacing: 0.02em; }
.fx-cutout .c-f2 { font-family: Georgia, serif; font-style: italic; }
.fx-cutout .c-f3 { font-family: "Courier New", Courier, monospace; }
.fx-cutout .c-f4 { font-family: "Arial Black", Arial, sans-serif; font-weight: 900; }
.fx-cutout .c-f5 { font-family: "Bodoni MT", Didot, "Playfair Display", serif; font-weight: 900; }
/* cuts: rough scissor edges */
.fx-cutout .c-k0 { clip-path: polygon(3% 6%, 97% 0, 100% 92%, 0 100%); }
.fx-cutout .c-k1 { clip-path: polygon(0 0, 100% 8%, 94% 100%, 6% 94%); }
.fx-cutout .c-k2 { clip-path: polygon(8% 0, 100% 3%, 97% 100%, 0 90%); }
.fx-cutout .c-k3 { clip-path: polygon(0 10%, 50% 0, 100% 6%, 96% 96%, 40% 100%, 4% 92%); }
.fx-cutout .c-k4 { clip-path: none; }

/* ---- haunted serif (pieces.js splits it): bone-white serif letters that each slip between three faces and
   poses (Georgia, Times, Palatino; a few degrees, a step at a time), now and then tearing into an echo of the
   glow, on a haze of glowing dust in a different colour (--haunt). The letter's own text is see-through and
   holds the place; what you see is drawn over it (::before), the tear too (::after). */
.fx-haunt { --haunt: 120, 255, 196; --bone: #ece4d4;
  font-family: Georgia, "Times New Roman", serif; color: var(--bone); padding: 0.05em 0.14em; border-radius: 0.3em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  text-shadow: 0 0 0.3em rgba(var(--haunt), 0.55), 0 0 0.9em rgba(var(--haunt), 0.3);
  box-shadow: 0 0 0.6em 0.15em rgba(var(--haunt), 0.12);
  /* dust: noise thresholded into scattered specks, glowing ones and pale ones, over a faint haze; it shifts
     about a step at a time so the specks seem to twinkle and drift */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='97' height='61'%3E%3Cfilter id='n' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='1' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 1 0 0 0 0 .78 0 0 0 11 -7.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 97px 61px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='71' height='83'%3E%3Cfilter id='n' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .9 0 0 0 12 -8.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 71px 83px,
    radial-gradient(ellipse at 50% 55%, rgba(var(--haunt), 0.17), rgba(var(--haunt), 0.06) 60%, rgba(var(--haunt), 0.02));
  animation: fx-haunt-dust 2.4s steps(1) infinite; }
@keyframes fx-haunt-dust {
  0% { background-position: 0 0, 0 0, 0 0; }
  25% { background-position: 13px -4px, -9px 21px, 0 0; }
  50% { background-position: 31px 17px, 22px -13px, 0 0; }
  75% { background-position: -18px 29px, 40px 6px, 0 0; } }
.fx-haunt .h-word { white-space: nowrap; }
/* in furigana: a reading is spread out to the width of the word under it, and split into letters it would
   come apart ("T   RADITIONAL   :"), so there each word holds together and the reading sits centred */
rt:has(.fx-haunt), .fx-haunt rt { ruby-align: center; }
rt .fx-haunt .h-word, .fx-haunt rt .h-word { display: inline-block; }
.fx-haunt .h { position: relative; color: transparent; text-shadow: none; }
.fx-haunt .h::before, .fx-haunt .h::after { content: attr(data-ch); content: attr(data-ch) / ""; position: absolute; left: -0.5em; right: -0.5em; top: 0;
  text-align: center; pointer-events: none; }
.fx-haunt .h::before { color: var(--bone); text-shadow: 0 0 0.3em rgba(var(--haunt), 0.6), 0 0 0.9em rgba(var(--haunt), 0.3);
  transform: translateY(var(--y1)) rotate(var(--r1));
  animation: fx-haunt-pose 2.7s steps(1) infinite var(--d), fx-haunt-jolt var(--t) steps(1) infinite var(--td); }
.fx-haunt .h::after { color: rgb(var(--haunt)); opacity: 0; text-shadow: 0 0 0.25em rgb(var(--haunt));
  clip-path: inset(var(--ta) 0 calc(78% - var(--ta)) 0); animation: fx-haunt-tear var(--t) steps(1) infinite var(--td); }
@keyframes fx-haunt-pose {
  0% { font-family: Georgia, serif; font-weight: 400; font-style: normal; transform: translateY(var(--y1)) rotate(var(--r1)); }
  33.333% { font-family: "Times New Roman", Times, serif; font-weight: 400; font-style: normal; transform: translateY(var(--y2)) rotate(var(--r2)) skewX(-5deg) scaleY(1.05); }
  66.666% { font-family: "Palatino Linotype", "Book Antiqua", Palatino, Baskerville, serif; font-weight: 400; font-style: italic; transform: translateY(var(--y3)) rotate(var(--r3)); } }
@keyframes fx-haunt-jolt { 0% { translate: none; opacity: 1; } 90% { translate: calc(var(--tx) * -0.6) 0; opacity: 0.55; } 93% { translate: calc(var(--tx) * 0.4) 0.02em; opacity: 0.8; } 96% { translate: none; opacity: 1; } }
@keyframes fx-haunt-tear { 0% { opacity: 0; translate: none; } 90% { opacity: 0.95; translate: var(--tx) 0; } 93% { opacity: 0.7; translate: calc(var(--tx) * -1.5) -0.03em; } 96% { opacity: 0; translate: none; } }
@media (prefers-reduced-motion: reduce) { .fx-haunt, .fx-haunt .h::before, .fx-haunt .h::after { animation: none !important; } }

/* ---- a moment (pieces.js playMoment): a name reveal. Black; the words come in like a signal, scrambled,
   stuttering across the screen split into red and cyan, then slam against the right and decode, and
   stay until the reader moves on, glitching now and then */
.moment-veil { position: fixed; inset: 0; z-index: 2147483000; background: #000; opacity: 0; }
.moment-lab { position: fixed; inset: 0; z-index: 2147483001; overflow: hidden; cursor: pointer; touch-action: none;
  background: repeating-linear-gradient(transparent 0 2px, rgba(255, 255, 255, 0.025) 2px 3px); }   /* (faint scanlines) */
.moment-scan { position: absolute; left: 0; right: 0; height: 18vh; top: -20vh; pointer-events: none;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.035) 70%, rgba(255, 255, 255, 0.07) 96%, transparent); animation: moment-scan 5.3s linear infinite 0.8s; }
@keyframes moment-scan { 0% { top: -20vh; } 60%, 100% { top: 105vh; } }
.moment-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.moment-name { position: absolute; white-space: nowrap; line-height: 1.25; max-width: none; }
.moment-name > div { position: relative; }
.moment-name .mn-ghost { position: absolute; inset: 0; mix-blend-mode: screen; opacity: 0.9; }
.mn-red, .mn-red *, .mn-red .h::before { color: #ff1f48 !important; -webkit-text-fill-color: #ff1f48 !important; }
.mn-cyan, .mn-cyan *, .mn-cyan .h::before { color: #00e1ff !important; -webkit-text-fill-color: #00e1ff !important; }
.mn-ghost, .mn-ghost *, .mn-ghost .h::before { text-shadow: none !important; background: none !important; }
.mn-ghost .h { color: transparent !important; -webkit-text-fill-color: transparent !important; }
.mn-ghost .h::after { display: none; }
.moment-name .fx-haunt { background: none; box-shadow: none; }         /* (the dust's box, blown up, is just a box) */
/* texture. Halftone: a field of dots, bigger toward where the name sits and fading out, drifting a step at a time */
.moment-dots { position: absolute; inset: 0; pointer-events: none; opacity: 0.36;
  background: radial-gradient(circle, rgba(239, 230, 214, 0.9) 0.9px, transparent 1.6px) 0 0 / 7px 7px, radial-gradient(circle, rgba(0, 225, 255, 0.5) 1.4px, transparent 2.2px) 3px 4px / 13px 13px;
  -webkit-mask-image: radial-gradient(ellipse 48% 34% at 68% 50%, #000, rgba(0, 0, 0, 0.35) 55%, transparent 100%); mask-image: radial-gradient(ellipse 48% 34% at 68% 50%, #000, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  animation: moment-drift 1.6s steps(4) infinite; }
@keyframes moment-drift { to { background-position: 7px 0, 16px 4px; } }
/* film grain over everything, jumping every frame or two; it flares when the signal breaks up */
.moment-grain { position: absolute; inset: -60px; pointer-events: none; opacity: 0.26; mix-blend-mode: screen;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 2.4 -1.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 180px 180px;
  animation: moment-grain 0.42s steps(1) infinite; }
@keyframes moment-grain { 0% { transform: translate(0, 0); } 17% { transform: translate(-37px, 22px); } 33% { transform: translate(18px, -41px); } 50% { transform: translate(-12px, -9px); } 67% { transform: translate(44px, 31px); } 83% { transform: translate(-29px, 47px); } }
.moment-lab.flick .moment-grain { opacity: 0.38; }
.moment-lab.burst .moment-grain { opacity: 0.55; }
.moment-lab.burst .moment-dots { opacity: 0.6; }
/* dust on the film: specks that blink on and off, a few of them red or cyan */
.moment-dust { position: absolute; inset: 0; pointer-events: none; }
.moment-dust i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: rgba(239, 230, 214, 0.75); box-shadow: 0 0 3px rgba(239, 230, 214, 0.5);
  opacity: 0; animation: moment-speck var(--t) steps(1) infinite var(--d); }
.moment-dust i.r { background: #ff1f48; box-shadow: 0 0 4px #ff1f48; }
.moment-dust i.c { background: #00e1ff; box-shadow: 0 0 4px #00e1ff; }
@keyframes moment-speck { 0%, 62% { opacity: 0; } 64% { opacity: 1; } 71% { opacity: 0.3; } 74% { opacity: 1; } 80%, 100% { opacity: 0; } }
/* a scratch: a hairline down the frame that jumps about and is mostly not there */
.moment-scratch { position: absolute; top: 0; bottom: 0; width: 1px; left: 23%; pointer-events: none; opacity: 0;
  background: linear-gradient(transparent, rgba(239, 230, 214, 0.5) 20%, rgba(239, 230, 214, 0.25) 60%, transparent); animation: moment-scratch 3.7s steps(1) infinite 1.2s; }
.moment-scratch.b { animation-duration: 5.9s; animation-delay: 2.6s; }
@keyframes moment-scratch { 0%, 100% { opacity: 0; } 4% { opacity: 1; left: 23%; } 7% { opacity: 0.6; left: 24%; } 10% { opacity: 0; } 48% { opacity: 0.8; left: 71%; } 50% { opacity: 0; } 51% { opacity: 0.7; left: 70.6%; } 54% { opacity: 0; } 83% { opacity: 0.5; left: 12%; } 86% { opacity: 0; } }
/* back on the page: the words flicker, once or twice */
.moment-echo { animation: moment-echo 0.9s steps(1) forwards; }
@keyframes moment-echo { 0% { opacity: 0; } 12% { opacity: 1; } 24% { opacity: 0.2; } 34%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .moment-echo, .moment-scan, .moment-grain, .moment-dots, .moment-scratch { animation: none; } .moment-dust i { animation: none; opacity: 0.4; } }

/* math (pieces/math.js, KaTeX): a formula on a line of its own scrolls sideways rather than running off the page */
.math .katex { font-size: 1.1em; }
.math-display { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; text-align: center; margin: 0.6em 0; padding: 0.15em 0; }
.math-display .katex-display { margin: 0; }
.math-error { color: #ff8f8f; font-family: monospace; border-bottom: 1px dotted currentColor; }

