/* Layout: the whole site is one terminal session (crawlnet-style). A 1px-gap grid of framed panes on near-black,
   IBM Plex Mono, gold instead of cyan. Pane a holds the hero and the live 3D agent; b thoughts, c games, d wallet log. */
:root {
  color-scheme: dark;
  --page: #050403; --bg: #0a0907; --bar: #110f0b; --line: #2c261c; --line2: #3d3428; --row: #1a160f;
  --fg: #ECE5D6; --dim: #B3A893; --mute: #7d735f;
  --gold: #F5B83A; --gold-hi: #FFD978; --gold-ink: #1c1405; --gold-wash: #2a1f0c;
  --win: #6FE8A8; --loss: #FF6B5E; --burn: #FF8A3D;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fig: clamp(300px, 27vw, 400px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(ellipse 70% 55% at 50% 38%, rgba(245,184,58,.075), transparent 72%) fixed, radial-gradient(rgba(236,229,214,.075) 1px, transparent 1.5px) 0 0 / 18px 18px fixed, var(--page); color: var(--fg); font: 14px/1.55 var(--mono); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-hi); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
code { font: inherit; }

.term { max-width: 1840px; margin: 16px auto; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 90px rgba(0,0,0,.65); border: 1px solid var(--line); background: var(--line); display: grid; gap: 1px; }

/* header */
.hdr { background: var(--bar); display: flex; align-items: center; gap: 22px; padding: 10px 14px; min-height: 52px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: #fff; }
.logo img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--gold-wash); }
.tabs { display: flex; gap: 18px; color: var(--dim); }
.tabs button { white-space: nowrap; }
.tabs b { color: var(--mute); font-weight: 500; margin-right: 6px; }
.tabs button:hover { color: var(--fg); }
.tabs [aria-current] { color: #fff; }
.tabs [aria-current] b { color: var(--gold); }
.hdr-r { margin-left: auto; display: flex; align-items: center; gap: 18px; color: var(--dim); }
.hdr-r .ca:hover, .hdr-r .x:hover { color: var(--fg); }
.hdr-r i { font-style: normal; color: var(--mute); }
.buy { background: var(--gold); color: var(--gold-ink); padding: 6px 14px; font-weight: 600; white-space: nowrap; }
.buy:hover { background: var(--gold-hi); color: var(--gold-ink); }

/* panes */
main { display: grid; background: var(--line); }
.view.grid { display: grid; grid-template-columns: 56fr 44fr; gap: 1px; }
.view.one { display: grid; }
.pane { background: var(--bg); min-width: 0; display: flex; flex-direction: column; }
.pane.act { box-shadow: inset 3px 0 0 var(--gold); }
.pt { height: 34px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--mute); font-size: 13px; white-space: nowrap; overflow: hidden; }
.pt b { color: var(--gold); font-weight: 500; }
.pt a:hover { color: var(--fg); }
.pc { padding: 18px 20px; min-width: 0; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { color: var(--mute); padding: 0 4px; }
.pager button:hover:not(:disabled) { color: var(--fg); }
.pager button:disabled { opacity: .35; cursor: default; }
.live-dot { color: var(--win); }
.live-dot i { font-style: normal; animation: pulse 1.6s ease-in-out infinite; }

/* pane a: hero */
.prm { color: var(--mute); }
.prm i { font-style: normal; color: var(--gold); }
.prm span { color: var(--fg); }
.cur { display: inline-block; width: .55em; height: 1.05em; margin-left: 4px; vertical-align: -2px; background: var(--gold); animation: blink 1.1s steps(1) infinite; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) var(--fig); column-gap: 26px; margin-top: 18px;
  grid-template-areas: "word fig" "tag fig" "sub fig" "loop fig" "ca fig" ". fig"; grid-template-rows: auto auto auto auto auto 1fr; }
.word { grid-area: word; font: 600 clamp(44px, 4.4vw, 66px)/1 var(--mono); letter-spacing: .05em; color: var(--gold); text-shadow: 0 0 26px rgba(255,170,40,.32); margin-top: 22px; }
.tagline { grid-area: tag; font-size: 19px; font-weight: 500; margin-top: 20px; color: #fff; }
.sub { grid-area: sub; color: var(--dim); margin-top: 10px; max-width: 44ch; line-height: 1.65; }
.loop { grid-area: loop; list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 4px; color: var(--dim); font-size: 13px; }
.loop li { display: grid; grid-template-columns: 30px 1fr; }
.loop b { color: var(--mute); font-weight: 500; }
.loop em, .loop i { font-style: normal; }
.loop em { color: var(--fg); }
.ca-line { grid-area: ca; justify-self: start; margin-top: 22px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line2); background: var(--bar); padding: 6px 6px 6px 12px; font-size: 13px; max-width: 100%; }
.ca-line .lb { color: var(--mute); }
.ca-line code { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cp { background: var(--gold-wash); color: var(--gold); padding: 3px 9px; font-size: 12px; }
.ca-line:hover .cp, .ca-inline:hover .cp { background: var(--gold); color: var(--gold-ink); }

/* the live agent */
.agent { grid-area: fig; align-self: start; border: 1px solid var(--line); background: var(--bar); min-width: 0; }
.agent-bar { height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--fg); white-space: nowrap; }
.agent-bar [data-mood] { color: var(--mute); overflow: hidden; text-overflow: ellipsis; }
.rec { font-style: normal; color: var(--loss); margin-right: 4px; animation: pulse 1.6s ease-in-out infinite; }
.stage { position: relative; aspect-ratio: 1 / 1; background: var(--bar); overflow: hidden; }
.stage canvas, .stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .poster { object-fit: cover; transition: opacity .5s; }
.stage canvas { opacity: 0; transition: opacity .6s; touch-action: pan-y; }
.agent.gl .stage canvas { opacity: 1; }
.agent.gl .stage .poster { opacity: 0; }
.agent[data-emo="lose"] .poster { filter: saturate(.4) brightness(.8); }

/* stats */
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 22px; }
.chips div { background: var(--bar); padding: 10px 14px; display: grid; gap: 3px; min-width: 0; }
.chips span { color: var(--mute); font-size: 12.5px; }
.chips b { font-weight: 600; font-size: 19px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.w { color: var(--win); } .l { color: var(--loss); } .g { color: var(--gold); } .o { color: var(--burn); }
.bump { animation: bump .6s ease-out; }

.think { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 11px 14px; border: 1px solid var(--line); background: var(--bar); min-width: 0; }
.think .star { color: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
.think .meta { margin-left: auto; padding-left: 12px; color: var(--mute); font-size: 13px; white-space: nowrap; }
.sweep { background: linear-gradient(90deg, var(--gold) 0 38%, #FFF6DC 50%, var(--gold) 62% 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sweep 2.4s linear infinite;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.think[data-emo="lose"] .sweep { background-image: linear-gradient(90deg, #d9a49a 0 38%, #fff 50%, #d9a49a 62% 100%); }
.think[data-emo="burn"] .sweep { background-image: linear-gradient(90deg, var(--burn) 0 38%, #FFF2D6 50%, var(--burn) 62% 100%); }
.think[data-emo="burn"] .star { color: var(--burn); }

/* pane b: thoughts */
.tw-list { display: grid; gap: 18px; align-content: start; }
.tw { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.tw img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--gold-wash); }
.tw-h { color: var(--mute); font-size: 13px; }
.tw-h b { color: var(--fg); font-weight: 500; }
.tw p { color: var(--fg); font: 16px/1.45 var(--sans); margin-top: 2px; overflow-wrap: anywhere; }
.tw.new { animation: logIn .5s ease-out; }
.tw.new p::after { content: ""; display: inline-block; width: .5em; height: 1em; vertical-align: -2px; margin-left: 2px; background: var(--gold); animation: blink 1.1s steps(1) infinite; }
.tw.new.done p::after { display: none; }

/* pane c: games (towers, crash, flips) */
.top-l { color: var(--dim); }
.top-l b { font-weight: 600; color: var(--fg); }
.top-l b.w { color: var(--win); } .top-l b.l { color: var(--loss); } .top-l b.g { color: var(--gold); } .top-l b.o { color: var(--burn); }
.bar { position: relative; height: 22px; border: 1px solid var(--line); margin: 14px 0; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(255,255,255,.035) 6px 8px); }
.bar span { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--win) 0 5px, transparent 5px 8px); opacity: .7; transition: width .6s; }
.bar em { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--fg); background: var(--bg); padding: 0 4px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th { text-align: left; font-weight: 600; color: var(--gold-ink); background: var(--gold); padding: 4px 12px; font-size: 13px; }
.tbl td { padding: 6px 12px; border-bottom: 1px solid var(--row); }
.tbl tr:first-child td { background: #17130b; }
.tbl tr.new td { animation: rowIn 1.2s ease-out; }
.tbl a:hover { text-decoration: underline; }
.tbl td.pl { color: var(--dim); }
.gsum { display: grid; gap: 2px; margin-top: 12px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.gsum div { display: grid; grid-template-columns: 8ch 11ch 12ch minmax(0, 1fr); gap: 8px; white-space: nowrap; }
.gsum b { color: var(--fg); font-weight: 600; }
.gsum i { font-style: normal; }

/* pane d: wallet log */
.log { display: grid; gap: 4px; align-content: start; }
.ll { display: grid; grid-template-columns: 82px 52px minmax(0, 1fr) auto; gap: 10px; white-space: nowrap; }
.ll.new { animation: logIn .35s ease-out; }
.ll .t { color: var(--mute); }
.ll .x { overflow: hidden; text-overflow: ellipsis; }
.ll .sig { color: var(--mute); }
.ll .sig:hover { color: var(--fg); }
.tag { font-weight: 600; }
.k-win .tag { color: var(--win); } .k-collect .tag { color: var(--dim); } .k-loss .tag { color: var(--loss); } .k-buy .tag { color: var(--gold); } .k-burn .tag { color: var(--burn); } .k-claim .tag { color: var(--gold-hi); }

/* burns view */
.burn-hero { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 18px; }
.burn-hero div { background: var(--bar); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.burn-hero span { color: var(--mute); font-size: 12.5px; }
.burn-hero b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.burn-hero em { font-style: normal; color: var(--mute); font-size: 12.5px; }

/* how view */
.how { max-width: 78ch; display: grid; gap: 14px; }
.how h2 { font: 600 24px/1.2 var(--mono); color: var(--gold); }
.how h3 { font: 600 15px/1.3 var(--mono); color: var(--fg); margin-top: 10px; }
.how p, .how li { color: var(--dim); }
.how ol { padding-left: 24px; display: grid; gap: 6px; }
.how b { color: var(--fg); font-weight: 600; }
.addr { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; }
.addr dt { color: var(--mute); }
.addr dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.addr a, .ca-inline { color: var(--fg); overflow-wrap: anywhere; text-align: left; }
.addr a:hover { color: var(--gold-hi); }
.fine { font-size: 12.5px; color: var(--mute) !important; border-top: 1px solid var(--line); padding-top: 14px; }

/* status bar */
.status { background: var(--bar); padding: 8px 14px; display: flex; gap: 18px; color: var(--mute); font-size: 13px; flex-wrap: wrap; }
.status .dot { font-style: normal; color: var(--win); }
.status .dot.warn { color: var(--gold); }
.status .dot.err { color: var(--loss); }
.status .r { margin-left: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--gold); color: var(--gold-ink); font-weight: 600; padding: 7px 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@keyframes sweep { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes logIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes rowIn { from { background: rgba(245,184,58,.22); } }
@keyframes bump { 30% { color: #fff; text-shadow: 0 0 12px rgba(255,200,90,.7); } }

/* tablet: one column */
@media (max-width: 980px) {
  .term { margin: 0; border-width: 0; }
  .view.grid { grid-template-columns: minmax(0, 1fr); }
  .hdr { flex-wrap: wrap; row-gap: 8px; gap: 14px; padding: 10px 14px; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; gap: 20px; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
}
/* phone */
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .hdr-r { gap: 14px; }
  .hdr-r .ca { display: none; }
  .pc { padding: 14px 14px; }
  .pt { padding: 0 12px; }
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "word" "fig" "tag" "sub" "loop" "ca"; grid-template-rows: none; margin-top: 12px; }
  .word { font-size: clamp(40px, 13vw, 56px); margin-top: 6px; }
  .agent { margin-top: 18px; }
  .tagline { font-size: 17px; }
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips div:last-child { grid-column: span 2; }
  .think .meta { display: none; }
  .ll { grid-template-columns: 66px 42px minmax(0, 1fr); gap: 8px; font-size: 12.5px; }
  .ll .sig { display: none; }
  .tbl th, .tbl td { padding-left: 8px; padding-right: 8px; }
  /* plays: #, time and tx give way to the game and what happened (tx links stay on wider screens); the play text wraps */
  .tbl-plays th:nth-child(-n+2), .tbl-plays td:nth-child(-n+2), .tbl-plays th:nth-child(7), .tbl-plays td:nth-child(7) { display: none; }
  .tbl-plays td.pl { white-space: normal; min-width: 12ch; }
  .gsum div { grid-template-columns: 7ch 9ch 10ch minmax(0, 1fr); gap: 6px; font-size: 12.5px; }
  .tw p { font-size: 15px; }
  .burn-hero { grid-template-columns: 1fr 1fr; }
  .burn-hero div:first-child { grid-column: span 2; }
  .status { gap: 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= multi-page demo: shared nav (shell.js), games / flow / man pages, tv ================= */
.tabs a { white-space: nowrap; }
.tabs a:hover { color: var(--fg); }
.status a { color: var(--dim); }
.status a:hover { color: var(--gold-hi); }
.status a i { font-style: normal; color: var(--mute); }
.status a.r + span { margin-left: -6px; }
.bnav { display: none; }
.span { grid-column: 1 / -1; }
.sh { color: var(--mute); font-size: 13px; margin: 22px 0 10px; }
.sh b { color: var(--gold); font-weight: 500; margin-right: 6px; }
.sh:first-child { margin-top: 0; }
.prm + .top-l, .prm + .sh { margin-top: 16px; }
.muted { color: var(--mute); }

/* games: one pane per game (win rate interval, return), w/l tape with game initials */
.view.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gst { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 18px; margin-top: 14px; color: var(--mute); font-size: 13px; }
.gst dd { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.gst dd.w, .gst dd b.w { color: var(--win); } .gst dd.l, .gst dd b.l { color: var(--loss); }
.gp .think .sweep { white-space: normal; }
.fgames { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.fgames b { color: var(--fg); }
.fgames i { font-style: normal; color: var(--gold); }
.ci { margin: 14px 0 6px; }
.ci-tr { position: relative; height: 30px; border: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--row) calc(10% - 1px) 10%); }
.ci-band { position: absolute; top: 5px; bottom: 5px; background: rgba(245,184,58,.16); border: solid var(--gold); border-width: 0 1px; transition: left .6s, width .6s; }
.ci-fair { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: var(--fg); }
.ci-p { position: absolute; top: 50%; width: 10px; height: 10px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 10px rgba(255,190,80,.6); transition: left .6s; }
.ci-ax { display: flex; justify-content: space-between; color: var(--mute); font-size: 12px; margin-top: 5px; }
.ci-ax .f { color: var(--fg); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--mute); font-size: 12.5px; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; }
.legend .lw { background: var(--win); } .legend .ll2 { background: var(--loss); }
.tape { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 12px; }
.tape i { width: 18px; height: 18px; background: var(--loss); opacity: .82; font: 600 11px/18px var(--mono); font-style: normal; text-align: center; color: rgba(10,9,7,.78); }
.tape i.w { background: var(--win); }
.tape i:last-child { outline: 1px solid #fff; outline-offset: 1px; opacity: 1; }
.tape i.new { animation: tapeIn .8s ease-out; }
.chips.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chips em { font-style: normal; color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes tapeIn { from { transform: scale(0); } }

/* flow: stacked framed boxes, labels on the border line, joined by arrows */
.flow { max-width: 640px; margin: 30px auto 10px; display: grid; justify-items: center; }
.fbox { position: relative; width: 100%; border: 1px solid var(--line2); padding: 20px 18px 14px; display: grid; gap: 3px; min-width: 0; }
.fbox > .lbl { position: absolute; top: 0; left: 14px; transform: translateY(-50%); background: var(--bg); padding: 0 8px; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.fbox .big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg); overflow-wrap: anywhere; }
.fbox .sm { color: var(--dim); font-size: 13px; }
.fbox .note { color: var(--mute); font-size: 12px; margin-top: 4px; }
.fbox .tag2 { font-size: 11.5px; color: var(--mute); border: 1px solid var(--line2); padding: 0 6px; margin-left: 8px; vertical-align: 3px; font-weight: 400; }
.fbox.tbd { border-style: dashed; }
.fbox.tbd .big { color: var(--mute); }
.fbox.g { border-color: var(--gold); box-shadow: inset 0 0 26px rgba(245,184,58,.07); } .fbox.g > .lbl, .fbox.g .big { color: var(--gold); }
.fbox.w { border-color: rgba(111,232,168,.55); } .fbox.w > .lbl, .fbox.w .big { color: var(--win); }
.fbox.l { border-color: rgba(255,107,94,.5); } .fbox.l > .lbl, .fbox.l .big { color: var(--loss); }
.fbox.o { border-color: var(--burn); box-shadow: inset 0 0 26px rgba(255,138,61,.08); } .fbox.o > .lbl, .fbox.o .big { color: var(--burn); }
.fbox a { color: var(--fg); } .fbox a:hover { color: var(--gold-hi); }
.fv { width: 1px; height: 34px; background: var(--line2); position: relative; margin-bottom: 10px; flex: none; }
.fv::after { content: "▼"; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font-size: 10px; line-height: 1; color: var(--mute); }
.fv.g { background: var(--gold); } .fv.g::after { color: var(--gold); }
.fv.w { background: var(--win); } .fv.w::after { color: var(--win); }
.fv.o { background: var(--burn); } .fv.o::after { color: var(--burn); }
.fork { position: relative; width: 100%; height: 46px; margin-bottom: 10px; --q: calc((100% - 12px) / 4); }
.fork::before { content: ""; position: absolute; left: 50%; top: 0; height: 16px; width: 1px; background: var(--line2); }
.fork::after { content: ""; position: absolute; left: var(--q); right: var(--q); top: 16px; height: 1px; background: var(--line2); }
.fork i { position: absolute; top: 16px; bottom: 0; width: 1px; }
.fork i.l { left: var(--q); background: var(--loss); } .fork i.w { right: var(--q); background: var(--win); }
.fork i::after { content: "▼"; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font-size: 10px; line-height: 1; font-style: normal; }
.fork i.l::after { color: var(--loss); } .fork i.w::after { color: var(--win); }
.fsplit, .fjoin { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.fjoin > span { text-align: center; color: var(--loss); opacity: .75; font-size: 12.5px; padding-top: 10px; white-space: nowrap; }
.fjoin em { font-style: normal; }
.fjoin > div { display: grid; justify-items: center; }
.supply { display: inline-block; color: var(--burn); border: 1px solid var(--burn); padding: 0 7px; font-size: 12px; font-weight: 600; margin-left: 8px; vertical-align: 3px; }
.fmeter { position: relative; height: 10px; border: 1px solid var(--line2); margin-top: 10px; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(255,255,255,.035) 6px 8px); }
.fmeter span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--burn); box-shadow: 0 0 10px rgba(255,138,61,.6); transition: width .6s; }

/* man page */
.man { max-width: 92ch; }
.man-hd, .man-ft { display: flex; justify-content: space-between; gap: 12px; color: var(--mute); flex-wrap: wrap; }
.man-ft { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 12px; }
.man h2 { font: 600 14px/1.4 var(--mono); color: var(--gold); margin: 26px 0 8px; letter-spacing: .06em; }
.man .ind { padding-left: 7ch; color: var(--dim); display: grid; gap: 10px; }
.man .ind b { color: var(--fg); font-weight: 600; }
.man .ind b.g { color: var(--gold); } .man .ind b.o { color: var(--burn); } .man .ind b.w { color: var(--win); } .man .ind b.l { color: var(--loss); }
.man u { text-decoration-color: var(--mute); text-underline-offset: 3px; }
.man .syn { color: var(--fg); overflow-wrap: anywhere; }
.man .opts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 24px; }
.man .opts dt { color: var(--fg); white-space: nowrap; }
.man ol { padding-left: 3ch; display: grid; gap: 6px; }
.man .addr dd { overflow: visible; }
.man a:hover { color: var(--gold-hi); }

/* tv: stream / OBS view, no chrome */
body.tvb { overflow: hidden; background: #050302; }
.tv { position: fixed; inset: 0; background: var(--bar); overflow: hidden; }
.tv > canvas, .tv > .poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tv > .poster { object-fit: cover; object-position: 75% 50%; transition: opacity .5s; }
.tv > canvas { opacity: 0; transition: opacity .6s; }
.tv.gl > canvas { opacity: 1; } .tv.gl > .poster { opacity: 0; }
.tv[data-emo="lose"] > .poster { filter: saturate(.4) brightness(.8); }
.tv-ui { position: absolute; left: 4vw; top: 5vh; bottom: 6vh; width: min(680px, 42vw); display: flex; flex-direction: column; gap: 14px; }
.tv-word { font: 600 clamp(56px, 7.4vw, 132px)/1 var(--mono); letter-spacing: .05em; color: var(--gold); text-shadow: 0 0 40px rgba(255,170,40,.45); margin-top: 18px; }
.tv-tag { color: #fff; font-size: clamp(17px, 1.6vw, 28px); font-weight: 500; margin-top: 8px; }
.tv-sub { color: var(--dim); font-size: clamp(13px, 1.05vw, 18px); max-width: 44ch; }
.tv-sp { flex: 1; }
.tv-box { background: rgba(10,9,7,.84); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--gold); }
.tv-flip { padding: 14px 16px; font-size: clamp(16px, 1.55vw, 27px); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-flip .coin { display: inline-block; color: var(--gold); animation: spin .5s linear infinite; }
.tv-flip small { display: block; font-size: .72em; color: var(--dim); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.tv .chips { margin-top: 0; }
.tv .chips div { background: rgba(17,15,11,.88); }
.tv .chips span { font-size: clamp(12px, 1vw, 17px); }
.tv .chips b { font-size: clamp(22px, 2vw, 40px); }
.tv .think { margin-top: 0; background: rgba(17,15,11,.88); font-size: clamp(14px, 1.3vw, 23px); }
.tv-ca { position: absolute; right: 2vw; bottom: 2.4vh; color: rgba(255,236,200,.75); font-size: clamp(12px, .95vw, 16px); background: rgba(8,6,3,.62); padding: 3px 9px; }
@keyframes spin { to { transform: rotateY(360deg); } }
@media (orientation: portrait) {
  .tv > canvas, .tv > .poster { height: 58%; bottom: auto; }
  .tv-ui { left: 16px; right: 16px; top: 16px; bottom: 16px; width: auto; }
  .tv-word { margin-top: 6px; }
  .tv-sub { display: none; }
  .tv-flip { white-space: normal; }
  .tv-ca { left: 16px; right: auto; top: calc(58% - 34px); bottom: auto; }
}

@media (max-width: 980px) {
  .fbox .big { font-size: 20px; }
  .view.grid.g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .hdr .tabs { display: none; }
  body.has-bnav { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .bnav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bar); border-top: 1px solid var(--line2); padding-bottom: env(safe-area-inset-bottom); }
  .bnav a { display: grid; justify-items: center; gap: 3px; padding: 9px 0 8px; color: var(--mute); font-size: 11px; line-height: 1.1; }
  .bnav i { font-style: normal; font-size: 17px; line-height: 1; }
  .bnav a[aria-current] { color: var(--gold); box-shadow: inset 0 2px 0 var(--gold); background: var(--gold-wash); }
  .bnav a:hover { color: var(--fg); }
  .bnav a[aria-current]:hover { color: var(--gold); }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .chips.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips.c4 div:last-child { grid-column: auto; }
  .flow { margin-top: 22px; }
  .fbox { padding: 18px 12px 12px; }
  .fbox > .lbl { left: 8px; padding: 0 6px; }
  .fbox .big { font-size: 18px; }
  .fsplit, .fjoin { gap: 8px; }
  .fork { --q: calc((100% - 8px) / 4); }
  .fjoin em { display: none; }
  .man .ind { padding-left: 2ch; }
  .man .opts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .man .opts dd { padding-left: 2ch; margin-bottom: 8px; }
  .sk-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* desktop: the terminal reaches the bottom of the window; the last row of panes takes the slack */
@media (min-width: 981px) {
  .term { min-height: calc(100vh - 32px); grid-template-rows: auto 1fr auto; }
  .term > main { display: grid; }
  .view.grid:not(.g3):has(> :nth-child(3)) { grid-template-rows: auto 1fr; }
}
