/* TestMagicEngine — the browser interface. Function over form: readable text, clear states; motion only to show where things go (GUI POLISH, 2026-10-27). */
:root {
  --bg: #e9ebef; --panel: #f7f8fa; --ink: #15171a; --ink2: #4a4f57; --line: #c6cad1;
  --card: #fffdf6; --card-ink: #15171a; --card-line: #8a8f98;
  --mine: #1f5fbf; --theirs: #b5372b; --ok: #1d7a3a; --warn: #a15c00; --bad: #b3261e;
  --playable: #2fa84f; --choosable: #e2a400; --selected: #1f6feb; --attack: #c62828; --block: #1565c0;
  /* (Fills under white text: the accents themselves in the light theme; deeper shades in the dark one, where the accents
     are brightened to read as text and lines on a dark table.) */
  --fill-mine: var(--mine); --fill-theirs: var(--theirs); --fill-sel: var(--selected);
  --shadow: rgba(0, 0, 0, .25); --scrim: rgba(0, 0, 0, .45);
  --scale: 1; --ch0: clamp(80px, calc(15vh * var(--scale)), 200px); --ch: var(--ch0); --cw: calc(var(--ch) * .716);
  font: 14px/1.35 -apple-system, "Segoe UI", system-ui, sans-serif;
}
/* THE DARK THEME (the owner, 2026-11-07: "create a thoughtful dark mode for the interface"): a near-black table with
   lifted panels; every accent brightened to read on it, and a deeper shade of each for the fills white text sits on;
   deeper shadows; the browser's own controls (scroll bars, boxes, lists) dark too. polish.js applyTheme sets
   data-theme from the choice (or the system's, "As the system"); the media query is for the moment before it runs. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131518; --panel: #1c1f24; --ink: #e9ebef; --ink2: #9ea6b2; --line: #313740;
    --card: #23272e; --card-ink: #eef0f3; --card-line: #4b525d;
    --mine: #5a96f2; --theirs: #f06e61; --ok: #45c276; --warn: #e6a43c; --bad: #f2695e;
    --playable: #3cc867; --choosable: #f2b620; --selected: #4f8ff7; --attack: #f25c52; --block: #5598f3;
    --fill-mine: #2d68cc; --fill-theirs: #bf4336; --fill-sel: #2f6ad9;
    --shadow: rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .62);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131518; --panel: #1c1f24; --ink: #e9ebef; --ink2: #9ea6b2; --line: #313740;
  --card: #23272e; --card-ink: #eef0f3; --card-line: #4b525d;
  --mine: #5a96f2; --theirs: #f06e61; --ok: #45c276; --warn: #e6a43c; --bad: #f2695e;
  --playable: #3cc867; --choosable: #f2b620; --selected: #4f8ff7; --attack: #f25c52; --block: #5598f3;
  --fill-mine: #2d68cc; --fill-theirs: #bf4336; --fill-sel: #2f6ad9;
  --shadow: rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .62);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
button { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button:hover { border-color: var(--ink2); }
button.primary { background: var(--fill-mine); color: #fff; border-color: var(--fill-mine); font-weight: 600; }
button:disabled { opacity: .45; cursor: default; }
kbd { font: 11px/1 ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px; margin-right: 4px; background: var(--bg);; color: var(--ink); }
.pnl.paper h2 { position: sticky; top: -8px; background: var(--panel); padding: 4px 0; z-index: 1; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; color: var(--ink2); display: flex; justify-content: space-between; align-items: center; }

/* THE LAYOUT (docs/GUI_LAYOUT_PLAN_2026-10-27.md, layout.js): a tree of splits; a leaf is a cell of panels shown as
   tabs; the borders between cells drag (splitters); panels float. The page's sections live inside the panels. */
#app { display: flex; height: 100vh; }
#app > * { flex: 1 1 auto; min-width: 0; min-height: 0; }
.lsplit { display: flex; min-width: 0; min-height: 0; }
.lsplit.h { flex-direction: row; } .lsplit.v { flex-direction: column; }
.lcell { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
.lbody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; position: relative; }
.pnl { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.pnl.paper { background: var(--panel); }
.pnl.paper > section { padding: 8px 10px; overflow: auto; min-height: 0; flex: 1 1 auto; }
.pnl.paper > #reveal-panel { flex: 0 1 auto; }
.pnl > #opp-board, .pnl > #my-board { flex: 1 1 0; }
.pnl > #hand { flex: 1 1 auto; }
.lcell.auto #stack-panel { max-height: 48vh; }
.zpanel { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; --ch: 96px; --cw: calc(96px * .716); }
.zpanel .zempty { color: var(--ink2); font-size: 12px; }
/* the splitters: a hairline with a wider grip */
.lgut { flex: 0 0 1px; background: var(--line); position: relative; z-index: 6; touch-action: none; }
.lgut.h { cursor: col-resize; } .lgut.v { cursor: row-resize; }
.lgut::before { content: ""; position: absolute; }
.lgut.h::before { top: 0; bottom: 0; left: -4px; right: -4px; } .lgut.v::before { left: 0; right: 0; top: -4px; bottom: -4px; }
.lgut:hover, .lgut.drag { background: var(--fill-sel); }
.lgut.h:hover, .lgut.h.drag { box-shadow: 0 0 0 1px var(--selected); } .lgut.v:hover, .lgut.v.drag { box-shadow: 0 0 0 1px var(--selected); }
body.lresizing, body.lresizing * { user-select: none !important; }
body.lres-h, body.lres-h * { cursor: col-resize !important; } body.lres-v, body.lres-v * { cursor: row-resize !important; }
/* tabs: shown when a cell holds more than one panel, or while the layout is edited */
.ltabs { display: flex; gap: 2px; align-items: flex-end; background: var(--panel); border-bottom: 1px solid var(--line); padding: 2px 4px 0; flex: none; font-size: 12px; }
.ltabs.one { display: none; }
body.layout-edit .ltabs.one { display: flex; }
.ltab { display: flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 6px 6px 0 0; color: var(--ink2); cursor: pointer; user-select: none; white-space: nowrap; }
.ltab.on { color: var(--ink); font-weight: 700; background: var(--bg); box-shadow: inset 0 2px 0 var(--mine); }
.ltab button { display: none; padding: 0 5px; font-size: 11px; line-height: 16px; }
body.layout-edit .ltab button { display: inline-block; }
body.layout-edit .ltab { cursor: grab; }
body.layout-edit .lcell { outline: 1px dashed color-mix(in srgb, var(--selected) 60%, transparent); outline-offset: -1px; }
/* floating panels */
/* (The floated panels share one layer, under a question's window (20): each is raised among the others by an inline
   z-index from 31 up, which put a floated log over a library search — friends' notes 2026-11-07.) */
#lfloats { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 18; }
.lfloat { position: fixed; z-index: 30; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px var(--shadow); resize: both; overflow: hidden; min-width: 160px; min-height: 80px; }
.lf-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; font-size: 13px; font-weight: 700; cursor: move; border-bottom: 1px solid var(--line); user-select: none; flex: none; }
.lf-head button { padding: 0 8px; font-size: 12px; }
.lf-btns { display: flex; gap: 4px; }
/* Edit layout */
#lbar { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 46; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 94vw; padding: 6px 10px; background: var(--panel); border: 2px solid var(--selected); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 13px; }
#lbar .hint { color: var(--ink2); font-size: 12px; max-width: 520px; }
#ldrop { position: fixed; z-index: 60; pointer-events: none; background: color-mix(in srgb, var(--selected) 22%, transparent); border: 2px solid var(--selected); border-radius: 6px; }
.lghost { position: fixed; z-index: 61; pointer-events: none; background: var(--fill-sel); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
body.lmoving, body.lmoving * { cursor: grabbing !important; user-select: none; }
#lnote { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: 6px 14px; border-radius: 8px; font-size: 13px; }

/* player strips */
.strip { display: flex; gap: 14px; align-items: center; padding: 5px 12px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 34px; flex-wrap: wrap; }
#my-strip { border-top: 1px solid var(--line); }
.strip .who { font-weight: 700; }
.strip .life { font-size: 20px; font-weight: 800; min-width: 44px; }
.strip .stat { color: var(--ink2); }
.strip .stat b { color: var(--ink); }
.strip .zone { cursor: pointer; }
.strip.choosable { outline: 3px solid var(--choosable); outline-offset: -3px; cursor: pointer; }
.strip.selected { outline: 3px solid var(--selected); outline-offset: -3px; }
.strip .badge { border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font-size: 12px; }

/* boards */
.board { display: flex; flex-direction: column; gap: 6px; padding: 6px 10px; min-height: 0; overflow: hidden; }
#opp-board { flex-direction: column-reverse; border-bottom: 2px dashed var(--line); }
.row { display: flex; gap: 6px; align-items: flex-end; min-height: 0; flex: 1 1 0; }
.row.lands, .row.others { flex: 0 0 auto; }
/* The creatures sit in the middle of their board (the owner, 2026-10-28); a row too long to fit starts at the left and scrolls. */
.row.creatures { justify-content: safe center; }
.row .sep { flex: 1 1 auto; }
.row .label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; color: var(--ink2); text-transform: uppercase; letter-spacing: .08em; }

/* cards */
.card { position: relative; width: var(--cw); height: var(--ch); flex: 0 0 var(--cw); min-width: 52px; background: var(--card); color: var(--card-ink); border: 1.5px solid var(--card-line); border-radius: 7px; padding: 4px 5px; font-size: 11.5px; overflow: hidden; cursor: default; user-select: none; display: flex; flex-direction: column; }
.card.img { padding: 0; background: #000; }
.card.img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.card.img .strip-name { position: absolute; left: 0; right: 0; top: 0; background: rgba(0,0,0,.72); color: #fff; padding: 2px 4px; font-size: 11px; -webkit-line-clamp: 1; border-radius: 6px 6px 0 0; }
.card.img .badges { bottom: 26px; }
.card.img .pt { background: #fff; color: #000; }
.card.small { height: calc(var(--ch) * .62); width: calc(var(--ch) * .62 * .716); flex-basis: calc(var(--ch) * .62 * .716); min-width: 40px; }
.card .name { font-weight: 700; font-size: 12px; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .cost { font-size: 11px; color: var(--ink2); white-space: nowrap; }
.card .type { font-size: 10px; color: var(--ink2); margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card .text { font-size: 10px; margin-top: 3px; overflow: hidden; flex: 1; color: var(--ink2); }
.card .pt { position: absolute; right: 3px; bottom: 3px; font-weight: 800; font-size: 15px; background: var(--panel); border: 1.5px solid var(--card-line); border-radius: 5px; padding: 0 5px; }
.card .pt.up { color: var(--ok); border-color: var(--ok); }
.card .pt.down { color: var(--bad); border-color: var(--bad); }
.card .dmg { position: absolute; left: 3px; bottom: 3px; background: var(--bad); color: #fff; font-weight: 800; border-radius: 5px; padding: 0 5px; }
.card .badges { position: absolute; left: 3px; top: auto; bottom: 24px; display: flex; flex-wrap: wrap; gap: 2px; max-width: calc(100% - 6px); }
.card .badges span { font-size: 9.5px; font-weight: 700; background: var(--ink); color: var(--bg); border-radius: 3px; padding: 0 3px; }
.card .count { position: absolute; right: 3px; bottom: 3px; background: var(--ink); color: var(--bg); font-weight: 800; border-radius: 9px; padding: 0 6px; font-size: 12px; cursor: pointer; }
.card .num { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--choosable); color: #000; font-weight: 800; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-size: 13px; }
.card.tapped { transform: rotate(90deg); margin: 0 calc(var(--ch) * .142); flex-shrink: 0; }
.card.small.tapped { margin: 0 calc(var(--ch) * .088); }
.card.small:not(.img) { width: calc(var(--ch) * .58); flex-basis: calc(var(--ch) * .58); }
.card.small.tapped:not(.img) { margin: 0 calc(var(--ch) * .02); }
.card.sick { border-style: dashed; }
.card.playable { box-shadow: 0 0 0 3px var(--playable); cursor: pointer; }
.card.choosable { box-shadow: 0 0 0 3px var(--choosable); cursor: pointer; }
.card.selected { box-shadow: 0 0 0 4px var(--selected); }
.card.attacking { border-color: var(--attack); border-width: 3px; }
.card.blocking { border-color: var(--block); border-width: 3px; }
.card.dim { opacity: .4; }
.card.facedown { background: repeating-linear-gradient(45deg, #5b4a3a, #5b4a3a 6px, #6b5846 6px, #6b5846 12px); color: #fff; }
.card.hidden-card { background: repeating-linear-gradient(45deg, #39465a, #39465a 6px, #43526a 6px, #43526a 12px); }
.card.focus, .strip.focus, #prompt .tile.focus, #tool-items > .focus { outline: 3px dashed var(--selected); outline-offset: 2px; }
.card .hotkey { position: absolute; right: 3px; top: auto; bottom: 26px; background: var(--playable); color: #fff; font-weight: 800; border-radius: 4px; padding: 0 5px; font-size: 11px; }
.attach-group { display: flex; align-items: flex-end; flex: 0 0 auto; }
.attach-group > .attached-card { margin-right: calc(var(--cw) * -0.78); transform: translateY(-14px); z-index: 0; }
.attach-group > .card:last-child { z-index: 1; }
/* A card its host exiled until the host leaves (Portable Hole's): under the host, lower and to the left, greyed. */
/* (Placed on the host itself — the last of its group — and moved out by a part of its OWN size: a row that shrinks its
   cards would otherwise hide it.) */
.attach-group { position: relative; }
.attach-group > .exiled-under { position: absolute; right: 0; bottom: 0; transform: translate(-34%, 7%) rotate(-6deg); z-index: 0; filter: grayscale(.55) brightness(.92); }
.attach-group > .exiled-under .under-tag { position: absolute; left: 2px; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; padding: 5px 0; border-radius: 7px; background: rgba(40, 30, 60, .82); color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; letter-spacing: .04em; pointer-events: none; }
.attach-group:has(> .exiled-under) { margin-left: calc(var(--cw) * 0.34); }

/* prompt and phase bar */
#prompt { display: flex; gap: 10px; align-items: center; padding: 6px 12px; background: var(--panel); border-top: 2px solid var(--line); min-height: 46px; flex-wrap: wrap; }
#prompt .what { font-weight: 700; font-size: 15px; flex: 1 1 260px; }
#prompt .what small { display: block; font-weight: 400; font-size: 12px; color: var(--ink2); }
#prompt .error { color: var(--bad); font-weight: 600; width: 100%; }
#prompt .tile { min-width: 60px; }
#prompt .tile.sel { background: var(--fill-sel); color: #fff; border-color: var(--fill-sel); }
#hand { display: flex; gap: 6px; padding: 8px 12px; min-height: calc(var(--ch) + 16px); background: var(--bg); border-top: 1px solid var(--line); overflow-x: auto; align-items: flex-end; }

/* side */
.stack-item, .stack-standin { border: 1px solid var(--line); border-left: 5px solid var(--ink2); border-radius: 6px; padding: 5px 7px; margin-bottom: 5px; background: var(--card); }
.stack-item.mine, .stack-standin.mine { border-left-color: var(--mine); }
.stack-standin .sname { font-weight: 700; }
.stack-standin .sdesc { color: var(--ink2); font-size: 12px; }
.stack-item.theirs { border-left-color: var(--theirs); }
.stack-item:first-child { font-size: 13.5px; }
.stack-item .sname { font-weight: 700; }
.stack-item .sdesc { color: var(--ink2); font-size: 12px; }
.stack-item.choosable { box-shadow: 0 0 0 3px var(--choosable); cursor: pointer; }
.stack-item.selected { box-shadow: 0 0 0 4px var(--selected); cursor: pointer; }
/* What you are casting or activating, as it forms (the owner's notes of 2026-11-03): unfinished — a dashed edge and a soft
   shimmer — until it is on the stack, paid for. */
.stack-forming { position: relative; overflow: hidden; border: 2px dashed var(--mine); border-radius: 6px; padding: 5px 7px; margin-bottom: 5px;
  background: color-mix(in srgb, var(--card) 90%, var(--mine)); }
.stack-forming .sname { font-weight: 700; }
.stack-forming .sdesc { color: var(--ink2); font-size: 12px; }
.stack-forming .fcost { font-weight: 400; font-size: 12px; color: var(--ink2); white-space: nowrap; }
.stack-item.forming { position: relative; overflow: hidden; border-style: dashed; border-left-style: solid; }
/* (The owner, 2026-11-05: "I like the pulsing animation of the spell being cast on the stack. It's stuttery right now":
   it moved its gradient's background-position — painted by the page itself every frame, so a busy page dropped its
   frames — and the entry is drawn again with every message, which started the sweep over from its beginning. Now the
   band is a layer the compositor slides (transform only), and every drawing of it keeps one clock: app.js sets
   --fphase, the time into the sweep, as its delay.) */
.stack-forming::after, .stack-item.forming::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 250%; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--mine) 20%, transparent) 50%, transparent 70%);
  transform: translateX(-72%); will-change: transform; animation: forming-shimmer 1.8s linear infinite; animation-delay: var(--fphase, 0ms); }
.stack-forming.still::after, .stack-item.forming.still::after { animation: none; }
@keyframes forming-shimmer { from { transform: translateX(-72%); } to { transform: translateX(72%); } }
.stack-res { border: 1px dashed var(--line); border-left: 5px solid var(--ink2); border-radius: 6px; padding: 5px 7px; margin-bottom: 5px; background: var(--card); opacity: .92; }
.stack-res.mine { border-left-color: var(--mine); }
.stack-res.theirs { border-left-color: var(--theirs); }
.stack-res .sname { font-weight: 700; }
.stack-res .sdesc { color: var(--ink2); font-size: 12px; }
#stack-status { color: var(--ink2); font-size: 12px; }
#preview .pname, #detail .pname { font-size: 18px; font-weight: 800; }
#preview .ptype, #detail .ptype { color: var(--ink2); margin: 2px 0 6px; }
#preview .ptext, #detail .ptext { white-space: pre-wrap; }
#preview .pmeta, #detail .pmeta { margin-top: 8px; color: var(--ink2); font-size: 12px; }
#preview .whynot, #detail .whynot { margin-bottom: 8px; padding: 4px 6px; border-left: 3px solid var(--ink2); font-size: 12px; }
#preview .pimg { width: 100%; max-width: 250px; border-radius: 11px; display: block; margin: 0 auto 8px; }
#detail .pimg { width: 100%; max-width: 340px; border-radius: 11px; display: block; margin: 0 auto 8px; }
#log { font-size: 12.5px; }
#log div { padding: 1px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent); }
#log .you { color: var(--mine); }
#log .opp { color: var(--theirs); }
#log .sys { color: var(--ink2); font-style: italic; }

/* overlays */
#tool { position: fixed; left: calc(var(--ld-room, 0px) + (100% - var(--tool-room, 0px) - var(--ld-room, 0px)) / 2); top: 46%; transform: translate(-50%, -50%); width: min(1100px, calc(92vw - var(--tool-room, 0px) - var(--ld-room, 0px))); max-height: 80vh; overflow: auto; background: var(--panel); border: 2px solid var(--ink2); border-radius: 12px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.35); z-index: 20; }
#tool h3 { margin: 0 0 4px; font-size: 18px; padding-right: 34px; }
/* MINIMIZE (friends' notes 2026-11-07: "All windows need a button to minimize so player's can see their boardstate"): the
   window folds to a small bar at the top with its question; a click on the bar opens it again. The question waits. */
#tool .tool-min { position: absolute; top: 8px; right: 10px; width: 28px; height: 24px; padding: 0; font-size: 16px; line-height: 20px; font-weight: 800; z-index: 3; }
#tool .tool-max { display: none; }
#tool.min { top: 54px; transform: translateX(-50%); width: auto; max-width: min(620px, calc(92vw - var(--tool-room, 0px) - var(--ld-room, 0px))); max-height: none; overflow: hidden; padding: 4px; border-radius: 10px; }
#tool.min > :not(.tool-max) { display: none !important; }
#tool.min > .tool-max { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; border: none; background: var(--fill-sel); color: #fff; }
#tool.min > .tool-max span { font-weight: 500; opacity: .85; }
#tool .sub { color: var(--ink2); margin-bottom: 10px; }
#tool .grid { display: flex; flex-wrap: wrap; gap: 10px; }
#tool .tiles { display: flex; flex-wrap: wrap; gap: 8px; }
/* Whose card it is, among cards from both players' zones: a chip on its top edge, blue yours, red the opponent's; the
   opponent's start after a little more room. */
#tool .grid > .card.owned .own-tag { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); z-index: 2; padding: 0 8px; border-radius: 9px; font-size: 11px; font-weight: 800; line-height: 18px; color: #fff; white-space: nowrap; pointer-events: none; }
#tool .grid > .card.own-mine .own-tag { background: var(--fill-mine); }
#tool .grid > .card.own-theirs .own-tag { background: var(--fill-theirs); }
#tool .grid > .card.own-mine + .card.own-theirs { margin-left: 14px; }
#tool .grid:has(> .card.owned) { padding-top: 10px; row-gap: 18px; }
#tool .tiles button { min-width: 120px; text-align: left; padding: 8px 12px; }
#tool .tiles button.sel { background: var(--fill-sel); color: #fff; border-color: var(--fill-sel); }
#tool .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; position: sticky; bottom: -14px; background: var(--panel); padding: 8px 0; }
#tool input[type=text] { font: inherit; padding: 6px 8px; width: 100%; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
#tool .ord { position: absolute; left: 4px; top: 4px; background: var(--fill-sel); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-weight: 800; }
/* The mana a source can make, as pips (app.js manaPipMenu): a small window over the card, one row of buttons. */
#menu.pipmenu { display: flex; gap: 4px; padding: 5px; border-radius: 12px; box-shadow: 0 8px 22px var(--shadow, rgba(0,0,0,.3)); }
#menu.pipmenu button { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 7px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--panel); }
#menu.pipmenu button.focus, #menu.pipmenu button:hover { border-color: var(--selected); background: var(--fill-sel-soft, color-mix(in srgb, var(--selected) 14%, var(--panel))); }
#menu.pipmenu .mpips { display: inline-flex; gap: 2px; align-items: center; }
#menu.pipmenu .mpips :is(img, .sym, i) { width: 24px; height: 24px; }
.pipbar { display: inline-flex; gap: 4px; margin: 0 6px; }
.pipbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 34px; padding: 0 6px; border-radius: 8px; }
.pipbtn .mpips { display: inline-flex; gap: 2px; } .pipbtn .mpips img { width: 20px; height: 20px; }
#menu { position: fixed; background: var(--panel); border: 1.5px solid var(--ink2); border-radius: 8px; padding: 4px; z-index: 36; /* (over a card's zoom, 35) */ box-shadow: 0 8px 24px var(--shadow); max-width: 460px; }
#menu button { display: block; width: 100%; text-align: left; border: none; border-radius: 4px; padding: 6px 10px; }
#menu button:hover, #menu button.focus { background: var(--fill-sel); color: #fff; }
#overlay { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 40; }
#overlay > div { background: var(--panel); border-radius: 12px; padding: 22px 26px; max-width: 760px; max-height: 86vh; overflow: auto; }
#overlay table td { padding: 2px 10px 2px 0; }
#conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--warn); color: #fff; padding: 6px 14px; border-radius: 8px; z-index: 50; }

/* decision tools */
#tool .result { font-weight: 700; margin: 4px 0 10px; color: var(--mine); }
#tool .hint { color: var(--ink2); font-size: 12px; align-self: center; }
#tool .areas { display: flex; gap: 12px; flex-wrap: wrap; }
#tool .area { flex: 1 1 300px; min-height: calc(var(--ch) + 52px); border: 2px dashed var(--line); border-radius: 10px; padding: 8px; cursor: pointer; }
#tool .area-h { font-weight: 700; margin-bottom: 6px; }
#tool .area-h .n { color: var(--ink2); font-weight: 400; }
#tool .area-cards { display: flex; gap: 8px; flex-wrap: wrap; }
#tool .area-cards .card { cursor: grab; }
/* (An order into a pile: one row, its top end marked on the left and its bottom end on the right — the owner,
   2026-11-05.) */
#tool .area.ends { display: flex; align-items: center; justify-content: center; gap: 12px; cursor: default; }
/* (The marks beside the cards: the row's ends are the first and the last card, not the panel's edges.) */
#tool .area.ends .area-cards { flex: 0 1 auto; justify-content: center; }
#tool .area-row { display: flex; align-items: center; gap: 10px; }
#tool .area-row .area-cards { flex: 0 1 auto; }
#tool .area .end { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink2); padding: 10px 5px; border: 2px solid var(--line); border-radius: 8px; background: var(--card); }
#tool .area.ends:has(.card.selected) .end { cursor: pointer; border-color: var(--selected); color: var(--ink); }
#tool .rows { display: flex; flex-direction: column; gap: 6px; }
#tool .srow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
#tool .srow.focus { outline: 3px dashed var(--selected); }
#tool .srow .sname { flex: 1; }
#tool .srow .sval { min-width: 34px; text-align: center; font-size: 20px; }
#tool .srow button { width: 34px; font-size: 18px; padding: 2px 0; }
#tool .numpick { display: flex; align-items: center; gap: 18px; justify-content: center; margin: 14px 0; }
#tool .numpick span { font-size: 48px; font-weight: 800; min-width: 90px; text-align: center; }
#tool .numpick button { font-size: 28px; width: 56px; }
#tool .presets { display: flex; gap: 8px; justify-content: center; }
#tool .suggest { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
#tool .suggest button { text-align: left; border: none; }
#tool .suggest button.focus { background: var(--fill-sel); color: #fff; }
.card .decl { position: absolute; left: 2px; right: 2px; top: 40%; background: var(--block); color: #fff; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 4px; text-align: center; }
#tool .card { position: relative; }
#tool .ord { position: absolute; left: 4px; top: auto; bottom: 26px; }

/* arrows, stack lights, the turn banner, log filters, auto answers */
#arrows { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 15; }
#arrows line { stroke-width: 3; }
#arrows line.block { stroke: var(--block); }
#arrows line.target { stroke: var(--attack); stroke-dasharray: 6 4; }
/* The tether: from the item forming to each place its question asks you to choose from. */
#arrows line.tether { stroke: var(--choosable); stroke-width: 2.5; stroke-dasharray: 1 6; stroke-linecap: round; opacity: .9; }
.card.src { box-shadow: 0 0 0 4px var(--mine); }
/* (The card being activated, when the question also offers it — Waterbend or Improvise asking which to tap — keeps its
   light inside the source ring; the source ring had replaced it: the design adversary's L11, 2026-11-05.) */
.card.src.playable { box-shadow: 0 0 0 3px var(--playable), 0 0 0 7px var(--mine); }
.card.src.choosable { box-shadow: 0 0 0 3px var(--choosable), 0 0 0 7px var(--mine); }
.card.src.selected { box-shadow: 0 0 0 4px var(--selected), 0 0 0 8px var(--mine); }
.card.tgt, .strip.tgt { box-shadow: 0 0 0 4px var(--attack); }
#prompt .turnno { background: var(--fill-mine); color: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; vertical-align: middle; }
#prompt .turnno.theirs { background: var(--fill-theirs); }
#prompt .since { width: 100%; font-size: 12px; color: var(--theirs); }
#prompt .why .why-art { width: 36px; height: 26px; object-fit: cover; object-position: 50% 22%; border-radius: 4px; vertical-align: middle; margin-right: 6px; box-shadow: 0 0 0 1px var(--line); }
.mana-spark { position: fixed; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; z-index: 16; pointer-events: none;
  --pip: var(--playable); background: radial-gradient(circle, #fff 0, var(--pip) 46%, transparent 72%);
  box-shadow: 0 0 6px 1px color-mix(in srgb, var(--pip) 70%, transparent); }
/* Each pip in its unit's colour (the owner, 2026-11-07: "The flying mana pips should match the colors the sources are
   producing"). Black and colourless keep a light core and rim, so they show on a dark table. */
/* (White and colourless are pale: a thin dark rim keeps them in sight on a light table — the owner, 2026-11-07: "The
   white pips are hard to see on the white background. Maybe they should have a small black outline around them".) */
.mana-spark.cW { --pip: #f3e7a6; box-shadow: 0 0 0 1.5px rgba(22, 20, 14, .78), 0 0 6px 1px rgba(243, 231, 166, .75); }
.mana-spark.cU { --pip: #2f86d6; }
.mana-spark.cB { --pip: #6b4a86; background: radial-gradient(circle, #e9dcf5 0, #3b2a4a 42%, #1c1424 60%, transparent 74%); box-shadow: 0 0 0 1px rgba(255,255,255,.55), 0 0 6px 1px rgba(150,110,190,.7); }
.mana-spark.cR { --pip: #e2412f; }
.mana-spark.cG { --pip: #2f9b55; }
.mana-spark.cC { --pip: #b9b4ab; box-shadow: 0 0 0 1.5px rgba(22, 20, 14, .7), 0 0 6px 1px rgba(185, 180, 171, .7); }
#prompt .why { width: 100%; font-size: 12.5px; color: var(--ink); opacity: .78; line-height: 1.35; max-height: 3.9em; overflow: auto; }
#prompt .why b { font-weight: 650; }
#prompt .why .why-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 5px; border-radius: 3px; border: 1px solid currentColor; opacity: .8; }
.logf { display: inline-flex; gap: 2px; margin-left: auto; margin-right: 6px; }
.logf button { font-size: 11px; padding: 1px 6px; text-transform: none; letter-spacing: 0; }
.logf button.on { background: var(--fill-mine); color: #fff; border-color: var(--fill-mine); }
#stack-status .yields { margin-top: 4px; }
#stack-status .yields span { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin: 2px 2px 0 0; }
#stack-status .yields button { padding: 0 4px; font-size: 11px; }
.card .cnote { position: absolute; left: 2px; right: 2px; top: 28%; text-align: center; font-weight: 800; font-size: 12px; background: var(--warn); color: #fff; border-radius: 4px; }
.card .cnote.lethal { background: var(--bad); }

/* sandbox */
.sandbox-banner { width: 100%; font-weight: 800; color: #fff; background: #7a3fb0; border-radius: 6px; padding: 3px 10px; display: flex; gap: 10px; align-items: center; }
.sandbox-banner button { background: #fff; color: #000; }
.sb-row { width: 100%; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sb-add { position: relative; }
.sb-add input { width: 16em; }
#sb-sug { position: absolute; bottom: 100%; left: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; z-index: 30; }
#sb-sug:empty { display: none; }
#sb-sug button { border: none; text-align: left; white-space: nowrap; }
#prompt input, #prompt select { font: inherit; padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--ink); }
.sb-export { width: 100%; max-height: 160px; overflow: auto; font-size: 11px; background: var(--card); border: 1px solid var(--line); padding: 6px; margin: 4px 0 0; }
#reveal { border: 2px solid #7a3fb0; border-radius: 8px; padding: 6px; margin-bottom: 8px; }
#reveal .rv { margin: 3px 0; font-size: 12px; }
#reveal .chip { font-size: 11px; padding: 1px 6px; margin: 1px; }
#reveal .none { color: var(--ink2); }

/* settings */
.settings { min-width: 640px; }
.settings h3 { margin: 14px 0 6px; font-size: 14px; }
.settings .st-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.settings select, .settings input[type=text] { font: inherit; padding: 2px 4px; }
.settings table.keys td { padding: 2px 10px 2px 0; }
.settings .hint { color: var(--ink2); font-size: 12px; }
#stack-panel .toolbar { display: flex; gap: 6px; margin-bottom: 6px; }
#stack-panel .toolbar button { font-size: 12px; padding: 2px 8px; }

#prompt .notice { width: 100%; color: var(--ok); font-weight: 600; }
.crash { max-width: 760px; }
.crash-log { font: 12px/1.4 ui-monospace, monospace; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-height: 240px; overflow: auto; }
.hint input { font: inherit; }

/* inspection fixes */
button.primary kbd, #menu button:hover kbd, #menu button.focus kbd { color: #1b1f24; background: #fff; border-color: rgba(255,255,255,.6); }
#overlay table td { padding: 1px 10px 1px 0; line-height: 1.25; }

/* A looked-at card that cannot be chosen for this question (Narset's creature and land). */
#tool .card.unpickable { opacity: 0.42; filter: grayscale(0.7); cursor: default; }
:is(#tool, #hand) .card.chosen-before { opacity: 0.8; filter: none; outline: 2px solid var(--selected); outline-offset: 1px; }
:is(#tool, #hand) .chosen-tag { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: var(--fill-sel); color: #fff; border-radius: 9px; padding: 1px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
#tool .card.pickable:not(.selected) { box-shadow: 0 0 0 3px var(--choosable); }

/* THE NEW EDITOR (2026-10-12): select, then inspect — the side panel becomes the inspector, the
   preview and the zones browser; player 2's hand sits on the table. */
#side-tools { padding: 6px 10px 2px !important; border-bottom: 1px solid var(--line); }
#side-tools .toolbar { margin: 0 !important; }
#inspector, #zones { display: none; }
body.editing #inspector, body.editing #zones { display: block; }
body.editing #phasebar { display: none !important; }
body.editing #preview .pimg { max-width: 170px; }
#opp-hand { display: none; }
#opp-hand.on { display: flex; gap: 5px; align-items: flex-end; padding: 4px 12px; background: var(--bg); border-bottom: 1px solid var(--line); min-height: calc(var(--ch) * .62 + 10px); overflow-x: auto; }
#opp-hand .handlabel { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.drop-on { outline: 3px dashed var(--selected) !important; outline-offset: -3px; }
.sb-row .hint { color: var(--ink2); font-size: 12px; }
#inspector h2 button { font-size: 11px; padding: 0 6px; text-transform: none; letter-spacing: 0; }
#inspector .ins-h { font-size: 16px; font-weight: 800; }
#inspector .ins-sub { color: var(--ink2); font-size: 12px; margin-bottom: 6px; }
#inspector .ins-row { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding: 4px 0; border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
#inspector .lab { color: var(--ink2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; }
#inspector button { font-size: 12px; padding: 2px 7px; }
#inspector button.on { background: var(--fill-sel); color: #fff; border-color: var(--fill-sel); }
#inspector button.danger { color: var(--bad); border-color: var(--bad); }
#inspector .stepper { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; }
#inspector .stepper button { width: 24px; padding: 1px 0; }
#inspector .stepper b { min-width: 20px; text-align: center; }
#inspector .stepper.mana .lab { font-weight: 800; color: var(--ink); }
#inspector .flag { font-size: 12px; white-space: nowrap; }
#inspector input, #inspector select { font: inherit; font-size: 12px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--ink); }
#inspector .libpos { font-size: 12px; color: var(--ink2); }
#inspector .hint { color: var(--ink2); font-size: 12px; }
#inspector kbd { font-size: 10px; }
#inspector .active-badge { background: var(--ok); color: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; }
#zones .ztabs { display: inline-flex; gap: 2px; }
#zones .ztabs button { font-size: 11px; padding: 1px 8px; text-transform: none; letter-spacing: 0; }
#zones .ztabs button.on { background: var(--fill-mine); color: #fff; border-color: var(--fill-mine); }
#zones .zsec { margin-bottom: 8px; }
#zones .zh { display: flex; gap: 4px; align-items: center; font-size: 12px; margin-bottom: 2px; }
#zones .zh b { flex: 1; }
#zones .zh button { font-size: 11px; padding: 0 6px; }
#zones .zlist { border: 1px solid var(--line); border-radius: 6px; max-height: 40vh; overflow: auto; min-height: 22px; }
#zones .zrow { display: flex; gap: 6px; padding: 1px 6px; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent); }
#zones .zrow:hover { background: color-mix(in srgb, var(--selected) 12%, transparent); }
#zones .zrow.sel { background: var(--fill-sel); color: #fff; }
#zones .zi { color: var(--ink2); min-width: 22px; text-align: right; }
#zones .zrow.sel .zi { color: #fff; }
#zones .zn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#zones .zc { color: var(--ink2); font-size: 11px; white-space: nowrap; }
#zones .zempty { color: var(--ink2); font-size: 12px; padding: 2px 6px; }
#reveal .rv { max-height: 30vh; overflow: auto; }
body.editing #hand { min-height: calc(var(--ch) * .62 + 14px); padding-top: 4px; padding-bottom: 4px; }
body.editing #prompt { gap: 4px 8px; padding: 4px 10px; }
body.editing #prompt button, body.editing #prompt select, body.editing #prompt input { font-size: 12.5px; padding: 1px 6px; }
.sb-cmds .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.sandbox-tag { font-weight: 800; color: #fff; background: #7a3fb0; border-radius: 5px; padding: 1px 8px; }
.sb-notice { width: 100%; font-size: 12.5px; color: #7a3fb0; font-weight: 600; }
body.editing #preview .pimg { float: left; max-width: 118px; margin: 0 10px 4px 0; }
body.editing #preview .ptext { font-size: 12.5px; }
#inspector .stepper.mana.mW .lab { color: #9a7b00; } #inspector .stepper.mana.mU .lab { color: #1f5fbf; } #inspector .stepper.mana.mB .lab { color: #444; }
#inspector .stepper.mana.mR .lab { color: #b3261e; } #inspector .stepper.mana.mG .lab { color: #1d7a3a; } #inspector .stepper.mana.mC .lab { color: #777; }
/* Playable from elsewhere: the tray at the start of the hand row. */
#hand .elsewhere { display: flex; gap: 6px; align-items: flex-end; padding: 0 10px 0 4px; margin-right: 6px; border-right: 2px dashed var(--playable); flex: 0 0 auto; }
#hand .elsewhere .handlabel { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; color: var(--ok); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }

/* ── THE GUI POLISH (docs/GUI_POLISH_PLAN_2026-10-27.md, picks P1–P8) ─────────────────────────────── */
/* the hamburger menu and the menus */
#burger { position: fixed; top: 4px; left: 6px; z-index: 31; width: 38px; height: 30px; display: grid; place-items: center; padding: 0; border-radius: 7px; background: var(--panel); color: var(--ink); }
.lcell.ltl .pnl > .strip, .lcell.ltl .pnl > #opp-hand.on, .lcell.ltl .pnl.paper > section:first-child, .lcell.ltl .ltabs:not(.one) { padding-left: 54px; }
body.layout-edit .lcell.ltl .ltabs { padding-left: 54px; }
#side-tools { display: none !important; }
#menu.burger { min-width: 300px; }
#menu.cardmenu { min-width: 270px; }
#menu button { display: flex; align-items: center; gap: 8px; }
#menu button:disabled { opacity: .45; }
#menu button:disabled:hover { background: none; color: inherit; }
#menu .mcost { margin-left: 2px; white-space: nowrap; }
#menu .mcost img.ms { width: 15px; height: 15px; vertical-align: -3px; }
#menu .mnote { margin-left: auto; padding-left: 10px; font-size: 11px; font-style: italic; color: var(--ink2); white-space: nowrap; }
#menu .msep { height: 1px; background: var(--line); margin: 4px 6px; }
#menu .mhead { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); padding: 6px 10px 2px; }
#menu .mlabel { font-weight: 600; padding: 6px 10px 2px; }
#menu .minfo { font-size: 12px; color: var(--ink2); padding: 0 10px 6px 18px; max-width: 420px; line-height: 1.35; }
#menu .mkey { margin-left: auto; font: 11px ui-monospace, monospace; color: var(--ink2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; white-space: nowrap; }
#menu button:hover .mkey, #menu button.focus .mkey { color: #fff; border-color: rgba(255,255,255,.6); }
#menu .mtoggle { margin-left: auto; width: 30px; height: 18px; border-radius: 9px; background: var(--line); position: relative; flex: none; }
#menu .mtoggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s ease-out; }
#menu .mtoggle.on { background: var(--ok); }
#menu .mtoggle.on::after { transform: translateX(12px); }
#menu button .mkey + .mtoggle, #menu button .mtoggle + .mkey { margin-left: 8px; }
.settings.small { min-width: 420px; }

/* the side panel without the preview: the stack and the log take its place; hover zoom shows the card */
body:not(.editing) #reveal-panel { max-height: 34vh; }
#reveal-panel:has(> #reveal[hidden]) { display: none; }
body.editing #reveal-panel { display: none; }
body:not(.editing) #preview-panel { position: fixed; z-index: 35; width: 290px; max-height: calc(100vh - 16px); overflow: hidden; background: var(--panel); border: 1.5px solid var(--ink2); border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.28); padding: 10px 12px; display: none; pointer-events: none; }
body:not(.editing) #preview-panel.zoom-on { display: block; animation: zoom-in .12s ease-out; }
body:not(.editing) #preview-panel.zoom-on.over-window { z-index: 47; } /* (over #overlay 40, #duel 45, the banners 46) */
body:not(.editing) #preview .pimg { max-width: 266px; }
@keyframes zoom-in { from { opacity: 0; } to { opacity: 1; } }
.viewcard { max-width: 400px; }
.viewcard .vc-head { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.vc-body .pimg { width: 100%; max-width: 350px; border-radius: 14px; display: block; margin: 0 auto 8px; }
.vc-body .pname { font-size: 18px; font-weight: 800; }
.vc-body .ptype { color: var(--ink2); margin: 2px 0 6px; }
.vc-body .ptext { white-space: pre-wrap; }
.vc-body .pmeta { margin-top: 8px; color: var(--ink2); font-size: 12px; }
.vc-body .whynot { margin-bottom: 8px; padding: 4px 6px; border-left: 3px solid var(--ink2); font-size: 12px; }

/* the official symbols (pick P1); the letter stays in the text for the screen check */
img.ms { width: 1.05em; height: 1.05em; vertical-align: -0.17em; margin: 0 .5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card .cost img.ms { width: 12px; height: 12px; }

/* the phase bar (U4, pick P7) */
#phasebar { display: block; padding: 3px 12px 4px; background: var(--bg); }
#pb { position: relative; display: flex; align-items: center; gap: 10px; }
.pb-turn { font-weight: 800; font-size: 12.5px; white-space: nowrap; min-width: 124px; color: var(--mine); }
#pb.theirs .pb-turn { color: var(--theirs); }
/* THE PHASE TRACK (polish.js; the owner, 2026-11-05: "more separation … 5 prominent phases that then expand into sub
   phases … as they're passing. Or they can be opened and closed by clicking on them"): five bars, apart — the phase not
   reached pale, the phases passed darker, the one the turn is in in the turn's colour — and above a phase's bar, while it
   is out, its steps as marks (only the step the turn is at named). The bar opens and folds its phase; a mark sets a
   stop. (The bar never becomes its steps: they come out above it, so a second click on the bar still folds it.) */
#pb-steps { position: relative; display: flex; gap: 14px; flex: 1; min-width: 0; align-items: stretch; }
#pb-steps .seg { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; flex: 1.1 1 0; transition: flex-grow .22s ease-out; }
#pb-steps .seg-m1, #pb-steps .seg-m2 { flex-grow: 1.6; }
#pb-steps .seg-beg.open { flex-grow: 3.3; } #pb-steps .seg-cmb.open { flex-grow: 5.6; }
#pb-steps .sub { display: flex; min-width: 0; height: 19px; }
#pb-steps .seg:not(.open) .sub { visibility: hidden; }
#pb-steps .step { flex: 1; min-width: 0; position: relative; text-align: center; font-size: 11.5px; line-height: 19px; height: 19px; padding: 0 2px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; color: transparent; transition: color .12s, background-color .12s, box-shadow .12s; }
#pb-steps .step:not(.now)::before { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: var(--panel); border: 1.5px solid var(--ink2); box-sizing: border-box; transition: transform .12s; }
#pb-steps .step.passed:not(.now)::before { background: var(--ink2); border-color: var(--ink2); opacity: .55; }
#pb-steps .step:not(.now):hover::before { border-color: var(--ink); transform: scale(1.25); }
/* Untap: no stop to set (no one gets priority there) — its name, no mark, nothing to click. */
#pb-steps .step.nostop { cursor: default; }
#pb-steps .step.nostop:not(.now)::before { display: none; }
#pb-steps .seg.named:not(.tight) .step.nostop:not(.now):hover { background: none; color: inherit; }
#pb-steps .step.pin::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--warn); }
/* (The step the turn is at: outlined while the game runs, filled when it waits for you; the opponent's colour on theirs.) */
#pb-steps .step.now { flex: 0 0 auto; padding: 0 9px; color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 2px var(--mine); background: var(--panel); overflow: visible; z-index: 4; }
#pb-steps .seg.one .step.now { margin: 0 auto; }
#pb.theirs #pb-steps .step.now { box-shadow: inset 0 0 0 2px var(--theirs); }
#pb.waiting #pb-steps .step.now { background: var(--fill-mine); color: #fff; }
#pb.theirs.waiting #pb-steps .step.now { background: var(--fill-theirs); }
#pb.waiting #pb-steps .step.now.pin::after { background: #fff; } /* (on the filled step) */
#pb-steps .phase { position: relative; display: block; width: 100%; height: 10px; margin-top: 2px; padding: 0; border: none; border-radius: 5px; background: var(--line); cursor: pointer; transition: background-color .15s, box-shadow .15s; }
#pb-steps .phase::before { content: ''; position: absolute; left: -7px; right: -7px; top: -2px; bottom: calc(-1 * var(--reach, 5px)); } /* (a bigger target than the bar it is; at the window's bottom, down to its edge: polish.js reachEdge) */
#pb-steps .phase:hover { background: color-mix(in srgb, var(--ink2) 60%, var(--line)); }
#pb-steps .seg.passed .phase { background: color-mix(in srgb, var(--ink2) 45%, var(--line)); }
#pb-steps .seg.cur .phase { background: var(--fill-mine); }
#pb.theirs #pb-steps .seg.cur .phase { background: var(--fill-theirs); }
#pb.waiting #pb-steps .phase.now { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--mine); }
#pb.theirs.waiting #pb-steps .phase.now { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--theirs); }
/* (A folded phase with a stop in it: the stop's pin on its bar, where its mark would be.) */
#pb-steps .phase .pins i { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 1.5px var(--panel); }
#pb-steps .seg.open .phase .pins { display: none; }
/* THE NAMES (the owner, 2026-11-06: "The phase bar should show the name of the phase on hover. And when clicked it should
   expand into the specific component phases … a way to set stops and also a way to condense the phases back down once
   somewhere else is clicked"; polish.js). Pointed at, a bar shows its phase's name: in the empty row above a folded bar,
   above the marks of an open one; a one-step phase names its own mark. Opened by a click, a phase is NAMED: each step its
   name and a round mark, filled in orange where you have a stop (a click on a step sets or removes it). */
#pb-steps .seg { position: relative; }
#pb-steps .pb-name { position: absolute; left: 50%; bottom: 12px; height: 19px; line-height: 19px; transform: translateX(-50%); padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--ink); background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(0, 0, 0, .1);
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 6; }
#pb-steps .seg.open .pb-name { bottom: 33px; }
#pb-steps .seg > .phase:is(:hover, :focus-visible) ~ .pb-name { opacity: 1; }
#pb-steps .seg-beg.named { flex-grow: 3.6; } #pb-steps .seg-cmb.named { flex-grow: 6.4; }
:is(#pb-steps .seg.named:not(.tight), #pb-steps .seg.one:has(> .phase:is(:hover, :focus-visible))) .step:not(.now) {
  display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--ink2); overflow: hidden; }
:is(#pb-steps .seg.named:not(.tight), #pb-steps .seg.one:has(> .phase:is(:hover, :focus-visible))) .step:not(.now)::before { position: static; flex: none; margin: 0; }
#pb-steps .seg.named:not(.tight) .step:not(.now):hover { color: var(--ink); background: color-mix(in srgb, var(--line) 70%, transparent); }
#pb-steps .seg.named:not(.tight) .step.passed:not(.now) { color: color-mix(in srgb, var(--ink2) 70%, transparent); }
#pb-steps .seg.named:not(.tight) .step.passed:not(.now)::before { background: var(--panel); opacity: 1; }
:is(#pb-steps .seg.named:not(.tight), #pb-steps .seg.one:has(> .phase:is(:hover, :focus-visible))) .step.pin:not(.now)::before { background: var(--warn); border-color: var(--warn); opacity: 1; }
:is(#pb-steps .seg.named:not(.tight), #pb-steps .seg.one:has(> .phase:is(:hover, :focus-visible))) .step.pin:not(.now)::after { display: none; }
/* (Where the names do not fit, the short ones: Upk, Beg, Atk, Blk, 1st, Dmg.) */
#pb-steps .seg.named.short:not(.tight) .step:not(.now) { font-size: 0; gap: 0; padding: 0 1px; }
#pb-steps .seg.named.short:not(.tight) .step:not(.now)::after, #pb-steps .seg.named.short:not(.tight) .step.pin:not(.now)::after { content: attr(data-short); display: inline; position: static; width: auto; height: auto; margin: 0 0 0 3px; border-radius: 0; background: none; font-size: 11px; }
/* THE STATIC PHASE BAR (Settings → Interface; friends' notes 2026-11-07: "enabling or disabling the movement of the phase
   bar and replacing it with a static one similar to MTGO"): every step named in a cell of its own, all the same width;
   the step the turn is at filled; nothing widens, folds or slides. A click on a step sets or removes its stop. */
body.pb-static #pb-steps .seg { flex: var(--n, 1) 1 0; transition: none; }
body.pb-static #pb-steps .seg .sub { visibility: visible; }
body.pb-static #pb-steps .step { transition: none; }
body.pb-static #pb-steps .step.now { flex: 1 1 0; padding: 0 2px; overflow: hidden; }
body.pb-static #pb-steps .seg.one .step.now { margin: 0; }
body.pb-static #pb-steps .seg.one .step:not(.now) { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--ink2); overflow: hidden; }
body.pb-static #pb-steps .seg.one .step:not(.now)::before { position: static; flex: none; margin: 0; }
body.pb-static #pb-steps .seg.one .step.pin:not(.now)::before { background: var(--warn); border-color: var(--warn); opacity: 1; }
body.pb-static #pb-steps .seg.one .step.pin:not(.now)::after { display: none; }
body.pb-static #pb-steps .seg:not(.one) > .phase { cursor: default; }
body.pb-static #pb-steps .pb-name { display: none; }
/* THE SLIDE (polish.js): the turn's colour and the step's name glide over the track; under them the bar and the step
   keep their places (and their clicks) but draw nothing of their own. */
#pb-fill, #pb-label { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .15s; will-change: transform, width; }
#pb-fill { z-index: 1; border-radius: 5px; background: var(--fill-mine); }
#pb.theirs #pb-fill { background: var(--fill-theirs); }
#pb-steps .phase .pins i { z-index: 2; } /* (a stop's pin over the colour) */
#pb.slides #pb-steps .seg.cur .phase { background: var(--line); }
#pb.slides #pb-steps .seg.cur.passed .phase, #pb.slides #pb-steps .seg.cur .phase:hover { background: var(--line); }
#pb-label { z-index: 5; box-sizing: border-box; padding: 0 9px; border-radius: 6px; font-size: 11.5px; line-height: 19px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip;
  color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 2px var(--mine); }
#pb.theirs #pb-label { box-shadow: inset 0 0 0 2px var(--theirs); }
#pb.waiting #pb-label { background: var(--fill-mine); color: #fff; }
#pb.theirs.waiting #pb-label { background: var(--fill-theirs); }
#pb-label.pin::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--warn); }
#pb.waiting #pb-label.pin::after { background: #fff; }
#pb.slides #pb-steps .step.now, #pb.slides.waiting #pb-steps .step.now, #pb.slides.theirs #pb-steps .step.now { color: transparent; background: transparent; box-shadow: none; transition: none; }
#pb.slides #pb-steps .step.now.pin::after { opacity: 0; }
/* (The chip grows in and out — the track gives it room smoothly, never in one frame: the owner, 2026-11-07, "a smooth
   slide".) */
#pb-chip { font-size: 11.5px; border-radius: 10px; border: 0 solid var(--line); color: var(--ink2); white-space: nowrap; display: inline-block; overflow: hidden; box-sizing: border-box;
  max-width: 0; padding: 1px 0; margin-left: -10px; opacity: 0; transition: max-width .3s ease-out, padding .3s ease-out, margin .3s ease-out, opacity .2s; }
#pb-chip.on { max-width: 340px; padding: 1px 9px; border-width: 1px; margin-left: 0; opacity: 1; }
body.anim-off #pb-chip { transition: none; }
#pb-chip.mode { border-color: var(--warn); color: var(--warn); font-weight: 700; }
#pb-banner { position: fixed; left: 50%; top: 40%; transform: translate(-50%, 6px); opacity: 0; pointer-events: none; color: #fff; font-weight: 800; font-size: 14px; padding: 5px 16px; border-radius: 8px; transition: opacity .25s ease-out, transform .25s ease-out; z-index: 20; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
#pb-banner.show { opacity: 1; transform: translate(-50%, 0); }
#pb-banner.mine { background: var(--fill-mine); } #pb-banner.theirs { background: var(--fill-theirs); }
.stopgrid { display: grid; grid-template-columns: auto repeat(12, 1fr); gap: 2px; font-size: 11px; margin: 6px 0; }
.stopgrid .rowlabel { color: var(--ink2); padding-right: 6px; white-space: nowrap; }
.stopgrid .step { text-align: center; border: 1px solid var(--line); border-radius: 4px; padding: 1px 0; cursor: pointer; background: var(--panel); white-space: nowrap; overflow: hidden; }
.stopgrid .step.stop { border-color: var(--warn); box-shadow: inset 0 -3px 0 var(--warn); }
.stopgrid .step.fixed { cursor: default; opacity: .65; }
.stopgrid .step.auto { border-style: dashed; } /* (your main 2: a stop when it has a use) */

/* the stack's lines (pick P6): the item shown, its source and its targets */
#arrows { transition: opacity .15s; }
#arrows.hide { opacity: 0; }
#arrows line.source { stroke: var(--mine); stroke-width: 2; opacity: .75; }
.stack-item.lines { box-shadow: 0 0 0 2px color-mix(in srgb, var(--mine) 55%, transparent); }
.stack-item.theirs.lines { box-shadow: 0 0 0 2px color-mix(in srgb, var(--theirs) 55%, transparent); }

/* the animation layer (U5, pick P5) */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
#fx .ghost { position: fixed; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
#fx .pop { position: fixed; font-weight: 800; font-size: 24px; color: var(--bad); text-shadow: 0 1px 0 var(--panel), 0 0 6px var(--panel); white-space: nowrap; }
#fx .pop.gain { color: var(--ok); }
.card.pile { cursor: pointer; }

/* the sandbox switch and the editing haze (pick P4) */
.sb-switch { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 7px; min-height: 40px; border-radius: 22px; border: 2px solid #7a3fb0; background: var(--panel); font-weight: 700; color: var(--ink); }
.sb-switch .track { width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background-color .2s; flex: none; }
.sb-switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s ease-out; }
.sb-switch.on .track { background: #7a3fb0; }
.sb-switch.on .knob { transform: translateX(20px); }
.sb-switch b { color: #7a3fb0; min-width: 2.3em; text-align: left; }
.sb-switch:not(.on) b { color: var(--ink2); }
.sb-switch:hover { border-color: #5f2f8c; }
body.editing #prompt .sb-switch { font-size: 13px; padding: 4px 12px 4px 6px; }
.sandbox-banner { background: transparent !important; color: var(--ink) !important; padding: 0 !important; font-weight: 600 !important; }
.sandbox-banner .sb-now { color: var(--ink2); font-weight: 600; }
body.editing::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 45; box-shadow: inset 0 0 0 2px rgba(122,63,176,.7), inset 0 0 42px 6px rgba(122,63,176,.30); animation: haze-in .35s ease-out; }
@keyframes haze-in { from { opacity: 0; } to { opacity: 1; } }
.sb-cmds .grow { flex: 1 1 auto; }
.sb-to { display: inline-flex; gap: 4px; align-items: center; }
.sb-dd { position: relative; }
.sb-drop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 32; background: var(--panel); border: 1.5px solid var(--ink2); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.22); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.sb-drop > button { text-align: left; }
.sb-drop .sb-mrow { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.sb-drop .sb-msep { height: 1px; background: var(--line); margin: 2px 2px; }

@media (prefers-reduced-motion: reduce) {
  #pb-steps .seg, #pb-steps .step, #pb-steps .phase, .sb-switch .knob, #pb-banner, #arrows { transition: none !important; }
  body.editing::after, body:not(.editing) #preview-panel.zoom-on { animation: none; }
}

/* A question held back while its message's moves play (owner 2026-10-27): drawn, but hidden and not clickable. */
body.fx-hold #prompt > *, body.fx-hold #tool { visibility: hidden; }
body.fx-hold [data-play] .card.playable, body.fx-hold [data-play] .card.choosable, body.fx-hold .strip.choosable, body.fx-hold .stack-item.choosable { box-shadow: none; outline: none; }
body.fx-hold [data-play], body.fx-hold #tool, body.fx-hold #prompt { pointer-events: none; }

/* The two top-level switches on the phase bar (owner 2026-10-27): Full control and Auto-tap. */
.pb-switches { display: flex; gap: 6px; flex: none; }
.pb-sw::before { content: ''; position: absolute; left: -3px; right: -3px; top: -3px; bottom: calc(-1 * var(--reach, 3px)); } /* (the same, for the two switches) */
.pb-sw { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); cursor: pointer; white-space: nowrap; }
.pb-sw .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink2); box-sizing: border-box; }
.pb-sw.on { color: var(--ink); border-color: var(--mine); }
.pb-sw.on .dot { background: var(--fill-mine); border-color: var(--fill-mine); }
/* BLOCKING AT SCALE (U6b, the owner 2026-10-27): a row past the readable minimum scrolls; the blocks being
   declared show as arrows (one per pile pair, with its count) and as chips with − + × in the prompt bar. */
.board .row.scroll, #hand.scroll { overflow-x: auto; overflow-y: hidden; }
#arrows line.block.pending { stroke-dasharray: 8 4; }
#arrows text.bcount { fill: var(--bg); stroke: var(--block); stroke-width: 6px; paint-order: stroke; font: 800 14px system-ui, sans-serif; text-anchor: middle; dominant-baseline: middle; }
#prompt .bchips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 46%; }
#prompt .bchip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--block); border-radius: 12px; padding: 1px 4px 1px 9px; font-size: 12px; white-space: nowrap; }
#prompt .bchip button { padding: 0 6px; min-height: 0; line-height: 18px; font-size: 13px; }
#overlay .dm-arch td { vertical-align: middle; }
#overlay .dm-cards { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; max-height: 34vh; overflow: auto; }
#overlay #dm-lines { columns: 3 12em; font-size: 13px; margin-top: 6px; }
/* The table's notices (a friend left, the table closed): lobby.js gone(). */
#overlay > div.lobby { width: min(620px, calc(100vw - 32px)); max-width: none; padding: 26px 30px; }
.lobby .lb-go { margin: 14px 0 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lobby.lb-left h2 { font-size: 22px; text-transform: none; margin: 0 0 8px; }
.lb-pip { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font-size: 10px; font-weight: 700; color: #111; }
.lb-W { background: #f3ecd2; } .lb-U { background: #a9d4ef; } .lb-B { background: #b9b0ad; } .lb-R { background: #f0a888; } .lb-G { background: #9fd3a8; }
.lb-bad { color: #f2695e; font-weight: 600; }
body.lobby-only #app, body.lobby-only #burger { visibility: hidden; }
body.lobby-only #overlay { background: #17181b; }
#tbl-banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 46; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 8px 14px; box-shadow: 0 4px 18px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
#tbl-banner.away { border-color: var(--warn); }
#tbl-banner.note { border-color: var(--mine); }

/* THE START SCREEN (lobby.js, rebuilt 2026-11-08 from the owner's canvas rounds). Always dark (the owner liked the black
   background of round 2's deck box); Source Serif 4 for names, Source Sans 3 for the rest. Level-2 controls behave like
   Magic objects (the shelf of deck boxes, the colour ring on Play, the opponent's double-faced card, the face-down code
   cards, the life-total name plate); everything else is a plain text action; a real button or input is under each
   (law L21). Nothing on it speaks (law L16 as amended 2026-11-08). The host's waiting table (#duel) is the same screen. */
.start {
  --s-bg: #17181b; --s-panel: #1d1e22; --s-line: #2c2d31; --s-line2: #3a3c43; --s-plate: #26282d; --s-well: #141518;
  --s-ink: #f1efe9; --s-ink2: #c9c6bf; --s-ink3: #a7a49d;
  --s-serif: 'Source Serif 4', Georgia, serif; --s-sans: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  position: fixed; inset: 0; overflow: auto; display: flex; flex-direction: column;
  background: var(--s-bg); color: var(--s-ink); font: 16px/1.45 var(--s-sans); color-scheme: dark;
}
#overlay > div.start { max-width: none; max-height: none; padding: 0; border-radius: 0; background: var(--s-bg); overflow: auto; }
#overlay[data-kind="decks"] { background: #17181b; }
:where(.start) button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; padding: 0; cursor: pointer; }
:where(.start) button:disabled { opacity: 1; cursor: default; }
:where(.start) input, :where(.start) textarea { font: inherit; color: inherit; }
.start h1, .start h2 { margin: 0; color: inherit; text-transform: none; letter-spacing: normal; display: block; font-size: inherit; }
.start :focus-visible { outline: 2px solid var(--s-ink); outline-offset: 3px; }
.start .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; min-height: 64px; border-bottom: 1px solid var(--s-line); }
.st-mark { font: 600 22px/1 var(--s-serif); }
.st-headr { display: flex; align-items: center; gap: 18px; color: var(--s-ink3); font-size: 14px; }
.start .st-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--s-line2); background: var(--s-plate); display: inline-grid; place-items: center; color: var(--s-ink); flex: none; }
.start .st-x:hover { background: #2e3036; }
.st-main { flex: 1 0 auto; width: 100%; max-width: 1320px; margin: 0 auto; padding: 32px 32px 150px; box-sizing: border-box; }
/* level 1: a text action */
.start .st-tl { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--s-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: rgba(241,239,233,.4); transition: text-decoration-color .2s; }
.start .st-tl:hover { text-decoration-color: var(--s-ink); text-decoration-thickness: 2px; }
.start .st-platebtn { min-height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid var(--s-line2); background: var(--s-plate); color: var(--s-ink); font: 600 17px var(--s-serif); display: inline-flex; align-items: center; gap: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 #0b0c0e; transition: background .15s, transform .08s, box-shadow .08s; }
.start .st-platebtn:hover { background: #2e3036; }
.start .st-platebtn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 0 #0b0c0e; }
.start .st-line { background: transparent; border: 0; border-bottom: 1px solid #4a4c53; border-radius: 0; color: var(--s-ink); font-size: 16px; padding: 8px 0 6px; min-width: 0; width: 16em; }
.start .st-line:focus { outline: none; border-bottom: 2px solid var(--s-ink); padding-bottom: 5px; }
.st-dim { color: var(--s-ink3); }
.st-mono { font: 14px ui-monospace, Menlo, monospace; color: var(--s-ink3); overflow-wrap: anywhere; }
/* card art in a box of fixed shape (lobby.js crop) */
.st-art { position: relative; display: block; overflow: hidden; background: #2c2d31; border-radius: 6px; }
.st-art img { position: absolute; left: 0; top: 0; display: block; max-width: none; height: auto; user-select: none; -webkit-user-select: none; }
.start .st-hero, .start .st-seatart { width: 100%; aspect-ratio: 16 / 9; }
.start button.st-art:hover img { filter: brightness(1.08); }
.st-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--s-ink2); font-size: 15px; }
.st-pips { display: inline-flex; gap: 4px; }
.st-pips img { width: 22px; height: 22px; display: block; }
.st-pips .lb-pip { width: 22px; height: 22px; font-size: 12px; }
/* the deck screen */
.st-decks { display: flex; flex-direction: column; gap: 36px; }
.st-feature { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.st-fig { flex: 1.3 1 520px; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.st-fig figcaption { color: var(--s-ink3); font-size: 14px; }
.st-about { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.start .st-name { font: 600 60px/1 var(--s-serif); letter-spacing: -.01em; }
.st-curve { display: flex; align-items: flex-end; gap: 6px; height: 96px; max-width: 420px; }
.st-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--s-ink2); }
.st-bar i { display: block; width: 100%; background: #d9d4c7; border-radius: 2px; }
.st-bar small { font-size: 12px; color: var(--s-ink3); }
.st-keys { margin: 0; color: var(--s-ink2); font-size: 15px; }
.st-acts { display: flex; gap: 22px; flex-wrap: wrap; }
/* the shelf: a row of deck boxes; the chosen one stands up with a light edge, and opens its list when pressed again */
.st-shelfsec { display: flex; flex-direction: column; gap: 18px; }
.st-shelfhead { display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap; }
.start .st-h2 { font: 600 24px/1.2 var(--s-serif); margin-right: 6px; }
.st-shelf { display: flex; gap: 16px; overflow-x: auto; padding: 18px 4px 0; margin-top: -18px; border-bottom: 2px solid #34363c; scrollbar-width: thin; }
.start .st-box { flex: 0 0 140px; padding: 0 0 10px; text-align: left; display: flex; flex-direction: column; gap: 6px; transition: transform .26s cubic-bezier(.2,.7,.2,1); }
.start .st-box.on { transform: translateY(-14px); }
.st-boxart { width: 140px; height: 88px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: box-shadow .26s ease, filter .15s; }
.st-box.on .st-boxart { box-shadow: 0 14px 22px rgba(0,0,0,.55), 0 0 0 2px var(--s-ink); }
.st-box:hover .st-boxart { filter: brightness(1.12); }
.st-boxname { font-weight: 600; font-size: 15px; line-height: 1.2; }
.st-boxtag { font-size: 13px; color: var(--s-ink3); min-height: 18px; }
.st-listmark { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(11,12,14,.78); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; }
.st-box.on .st-listmark { opacity: 1; transform: none; }
/* the ways to play */
.st-split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.st-side { flex: 0 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.st-modes { flex: 0 1 540px; min-width: min(100%, 400px); margin-left: auto; display: flex; flex-direction: column; gap: 10px; }
.start .st-mode { display: flex; align-items: center; gap: 18px; height: 76px; padding: 0 18px 0 0; border: 1px solid var(--s-line); border-radius: 10px; background: var(--s-panel); overflow: hidden; text-align: left; transition: border-color .15s, background .15s; }
.start .st-mode:hover { border-color: rgba(241,239,233,.55); background: #222328; }
.start .st-mode.busy { opacity: .6; cursor: progress; }
.start .st-modeart { flex: 0 0 168px; height: 76px; border-radius: 0; }
.st-mode:hover .st-modeart img { filter: brightness(1.1); }
.st-modename { flex: 1; min-width: 0; font: 600 22px/1.15 var(--s-serif); }
.st-mode > svg { flex: none; color: var(--s-ink3); }
/* two seats */
.st-vs { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; margin-bottom: 32px; }
.st-seat { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.st-seatrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.st-seatrow > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.st-seatname { font: 600 34px/1.1 var(--s-serif); }
.st-side .st-seatname { font-size: 30px; margin-top: 4px; }
.st-vsword { flex: none; align-self: center; font: italic 500 36px var(--s-serif); color: var(--s-ink3); padding: 0 4px; }
.st-across { align-self: center; gap: 22px; }
/* the opponent's double-faced card */
.st-oppctl { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.start .st-flip { width: 96px; height: 134px; perspective: 700px; border-radius: 8px; }
.st-flipin { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .46s cubic-bezier(.2,.7,.2,1); }
.st-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 8px; background: #0b0c0e; padding: 5px; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; text-align: left; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.st-backf { transform: rotateY(180deg); }
.st-facebar { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 5px; background: #2b2d33; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); font: 700 14px var(--s-serif); }
.st-facebar svg { width: 14px; height: 14px; flex: none; }
.st-facebody { flex: 1; border-radius: 4px; background: #1c1e22; display: grid; place-items: center; }
.st-facebody svg { width: 40px; height: 40px; }
.st-faceturn { position: absolute; right: 8px; bottom: 8px; line-height: 0; }
.start .st-addr { width: 11em; font-size: 14px; text-align: center; }
/* the life-total name plates */
.st-plate { display: inline-flex; align-items: stretch; align-self: flex-start; min-height: 46px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 #0b0c0e; }
.st-plate.mine { background: #2d68cc; }
.st-plate.them { background: #bf4336; }
.st-plate.empty { background: transparent; box-shadow: none; outline: 2px dashed #4a4c53; outline-offset: -2px; min-width: 120px; }
.st-plname { display: flex; align-items: center; padding: 0 14px; min-width: 7ch; color: #fff; font-weight: 700; font-size: 18px; }
.st-plate > svg { align-self: center; margin-right: 10px; }
.start .st-namein { background: transparent; border: 0; border-bottom: 2px dashed rgba(255,255,255,.5); color: #fff; font-weight: 700; font-size: 18px; width: 9ch; padding: 8px 0 4px; margin: 0 8px 0 14px; align-self: center; }
.start .st-namein::placeholder { color: rgba(255,255,255,.55); }
.start .st-namein:focus { outline: none; border-bottom-style: solid; border-bottom-color: #fff; }
/* the code cards: face down until a letter turns each over */
.st-code { position: relative; display: flex; gap: 8px; align-self: flex-start; }
.st-cc { display: block; width: 52px; height: 72px; perspective: 500px; border-radius: 6px; outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .15s; }
.st-ccin { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .32s cubic-bezier(.2,.7,.2,1); }
.st-cc.up .st-ccin { transform: rotateY(180deg); }
.st-ccback, .st-ccface { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.st-ccback { border: 1px solid #5a6578; box-sizing: border-box; background: repeating-linear-gradient(45deg, #39465a 0 6px, #43526a 6px 12px); }
.st-ccface { transform: rotateY(180deg); background: #f1efe9; color: #17181b; display: grid; place-items: center; font: 700 30px var(--s-serif); }
.st-code.focus .st-cc.next { outline-color: var(--s-ink); }
.start .st-codein { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; border: 0; padding: 0; margin: 0; cursor: text; font-size: 16px; }
.st-turn .st-cc.up .st-ccin { animation: st-turn .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 80ms + 150ms); }
@keyframes st-turn { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
.st-linkrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.start .st-link { background: transparent; border: 0; padding: 0; color: var(--s-ink3); font: 14px ui-monospace, Menlo, monospace; min-width: 0; max-width: 100%; }
.start .st-link:focus { outline: none; color: var(--s-ink); }
.st-linkalt { font-size: 14px; margin-top: -12px; }
.st-copyarc { stroke-dasharray: 0 81.7; transition: stroke-dasharray .3s ease; }
.done .st-copyarc { stroke-dasharray: 81.7 81.7; }
.st-copytick { stroke: transparent; transition: stroke .2s ease .22s; }
.done .st-copytick { stroke: #45c276; }
/* Play, in the corner */
.st-dockwrap { position: fixed; right: 32px; bottom: 28px; z-index: 20; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.st-dockwrap > * { pointer-events: auto; }
.st-error { color: #f2695e; font-weight: 600; font-size: 14px; max-width: 360px; text-align: right; background: var(--s-bg); }
.st-error:empty { display: none; }
.start .st-dock { min-width: 300px; min-height: 76px; padding: 0 30px 0 18px; border-radius: 14px; border: 1px solid var(--s-line2); background: #24252a; color: var(--s-ink2); display: flex; align-items: center; gap: 14px; text-align: left; box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .15s ease, box-shadow .15s ease, background .2s ease, color .2s ease; }
.start .st-dock.ready { background: var(--s-ink); color: #17181b; border-color: var(--s-ink); }
.start .st-dock.ready:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,.6); }
.start .st-dock.ready:active { transform: translateY(1px); }
.start .st-dock:focus-visible { outline-offset: 5px; }
.st-ring { flex: none; }
.st-seg { transition: stroke-dasharray .22s ease, stroke .2s ease; }
.st-dockword { display: block; font: 700 28px/1.1 var(--s-serif); }
.st-docksub { display: block; font-size: 14px; opacity: .8; }
.start .st-back { position: fixed; left: 32px; bottom: 34px; z-index: 20; }
/* the sheets: a decklist, every deck, an import */
.st-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(8,9,11,.82); display: flex; align-items: flex-start; justify-content: center; padding: 24px; box-sizing: border-box; overflow-y: auto; animation: st-fade .18s ease-out; }
.st-sheet { width: 100%; max-width: 1180px; background: var(--s-panel); border: 1px solid var(--s-line); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: st-rise .22s ease-out; }
@keyframes st-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.st-sheethead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 22px; border-bottom: 1px solid var(--s-line); }
.st-sheethead > .st-sheetname { flex: 1; }
.st-sheetart { width: 104px; height: 64px; flex: none; border-radius: 4px; }
.st-sheettitle { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.start .st-sheetname { font: 600 30px/1.05 var(--s-serif); }
.st-sheetacts { display: flex; align-items: center; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.st-sort { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--s-well); }
.start .st-sort button { min-height: 36px; padding: 0 14px; border-radius: 7px; color: var(--s-ink3); font-size: 15px; font-weight: 600; transition: background .15s, color .15s; }
.start .st-sort button:hover { color: var(--s-ink); }
.start .st-sort button[aria-pressed="true"] { background: var(--s-plate); color: var(--s-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 0 #0b0c0e; }
.st-groups { display: flex; flex-wrap: wrap; gap: 26px 30px; padding: 22px 24px 30px; min-height: 220px; }
.st-groups.curve { column-gap: 16px; }
.st-group { display: flex; flex-direction: column; gap: 10px; }
.st-ghead { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.st-gtitle { font: 600 18px var(--s-serif); display: inline-flex; align-items: center; gap: 2px; }
.st-gtitle img { width: 22px; height: 22px; display: block; }
.st-gn { color: var(--s-ink3); font-size: 15px; }
.st-stacks { display: flex; gap: 10px; }
.st-stack { position: relative; width: 124px; }
.st-stk { position: absolute; left: 0; width: 124px; height: 173px; border-radius: 6px; transition: transform .15s ease; }
.st-stk:hover { transform: translateY(-8px); z-index: 60 !important; }
.st-stk img { display: block; width: 124px; height: 173px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.55); }
.st-textcard { box-sizing: border-box; width: 124px; height: 173px; border-radius: 6px; background: #2b2d33; border: 1px solid #44464d; padding: 6px 8px; font-size: 12px; font-weight: 600; line-height: 1.25; box-shadow: 0 2px 8px rgba(0,0,0,.55); }
.st-n { position: absolute; right: 7px; top: 6px; background: var(--s-ink); color: #17181b; font-weight: 700; font-size: 12px; line-height: 1.45; border-radius: 9px; padding: 0 6px; }
.st-allbody { display: flex; flex-wrap: wrap; gap: 24px 48px; padding: 20px 24px 28px; }
.st-allcol { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.st-allcol .st-ghead { margin-bottom: 6px; }
.start .st-allrow { text-align: left; min-height: 36px; padding: 0 10px; border-radius: 6px; font-size: 15px; color: var(--s-ink2); }
.start .st-allrow:hover { background: var(--s-plate); color: var(--s-ink); }
.start .st-allrow[aria-pressed="true"] { color: var(--s-ink); font-weight: 600; background: var(--s-plate); }
.st-imp { max-width: 720px; }
.st-impbody { padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.start #lb-imp-text { display: block; width: 100%; box-sizing: border-box; min-height: 260px; resize: vertical; background: var(--s-well); color: var(--s-ink); border: 0; border-radius: 8px; padding: 14px 16px; font: 14px/1.5 ui-monospace, Menlo, monospace; box-shadow: inset 0 1px 3px rgba(0,0,0,.6); }
.start #lb-imp-text::placeholder { color: #5d5f66; }
.start #lb-imp-text:focus { outline: 2px solid var(--s-ink); outline-offset: 2px; }
.st-improw { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.st-note { margin: 0; font-size: 14px; color: var(--s-ink2); }
.st-note a { color: var(--s-ink); }
.st-missing { margin: 6px 0; padding: 0; list-style: none; max-height: 12em; overflow-y: auto; font-size: 14px; }
.st-missing li { margin: 2px 0; }
/* The host's waiting table: the same screen over the (empty) game page. */
#duel { position: fixed; inset: 0; z-index: 45; background: #17181b; }
@media (max-width: 760px) {
  .st-head { padding: 0 16px; }
  .st-main { padding: 20px 16px 190px; }
  .start .st-name { font-size: 40px; }
  .st-feature { gap: 20px; }
  .st-dockwrap { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .start .st-dock { min-width: 0; width: 100%; }
  .start .st-back { left: 16px; bottom: 104px; }
  .st-vsword { display: none; }
  /* (the art box keeps the shape lobby.js crops it for: 168 × 76) */
  .start .st-mode { height: 60px; gap: 14px; }
  .start .st-modeart { flex-basis: 133px; height: 60px; }
  .st-modename { font-size: 19px; }
  .start .st-back { background: var(--s-bg); padding: 0 10px; margin-left: -10px; border-radius: 8px; }
  .start.nodock .st-back { bottom: 16px; }
  .st-scrim { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .start *, .start *::before, .start *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-delay: 0ms !important; }
}
#hand .elsewhere.look { border-right-color: var(--line); }
#hand .elsewhere.look .handlabel { color: var(--ink2); }

/* THE TABLE YOUR WAY (table.js, friends' notes 2026-11-01) */
/* Card art from Scryfall */
.art-pick { max-width: min(980px, 94vw); max-height: 86vh; overflow: auto; }
.art-cards { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.art-card { font-size: 12.5px; padding: 3px 9px; border-radius: 14px; }
.art-card.on { background: var(--fill-sel); color: #fff; border-color: var(--fill-sel); }
.art-cur { margin: 8px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 8px 0; min-height: 60px; }
.art-print { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; border-radius: 8px; background: var(--card); font-size: 11.5px; }
.art-print img { width: 100%; border-radius: 5px; aspect-ratio: 488 / 680; object-fit: cover; }
.art-print.on { box-shadow: 0 0 0 3px var(--selected); }
.art-foot { margin-top: 8px; }
/* Moving cards by hand */
#my-board { position: relative; isolation: isolate; }
#my-board .placed { position: absolute; margin: 0; }
.moving-src { visibility: hidden; }
.drag-ghost { position: fixed; z-index: 45; pointer-events: none; margin: 0; transform-origin: 50% 40%; box-shadow: 0 14px 30px rgba(0,0,0,.35); will-change: transform; }
body.dragging-card, body.dragging-card * { cursor: grabbing !important; user-select: none; }
/* A life total changing */
.life-pop { position: fixed; z-index: 44; transform: translate(-50%, -10%); pointer-events: none; font-weight: 900; font-size: 26px; text-shadow: 0 2px 6px rgba(0,0,0,.35); animation: life-pop 1.25s ease-out forwards; }
.life-pop.loss { color: var(--bad); }
.life-pop.gain { color: var(--ok); }
@keyframes life-pop { 0% { opacity: 0; transform: translate(-50%, 10%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -30%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
.strip.hit { animation: strip-hit .6s ease-out; }
.strip.hit .life { color: var(--bad); }
.strip.hit-combat { animation: strip-hit .6s ease-out, strip-shake .4s ease-in-out; }
@keyframes strip-hit { 0% { background: color-mix(in srgb, var(--bad) 38%, var(--panel)); } 100% { background: var(--panel); } }
@keyframes strip-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
/* The game waiting on you: a soft pulsing glow around the battlefield */
/* Where to look (table.js §4): soft green around your hand or the stack at your priority; amber around a question's
   place, clearer around the prompt bar and the question panel. It breathes slowly and glides to the next place. */
/* (2026-11-03, the owner: "make the bar surrounding the focus area … more apparent": a solid 3 px line in the full
   colour with a wide glow, breathing between 80 % and full — it was a 1.5 px line at 60 % that faded to under half.) */
/* (2026-11-05, the owner: "The focus ring should be larger and have a glow around it", and on moving, "pulse a single
   slow time … a full second beginning to end and … obvious enough to draw attention from other parts of the screen": a
   4 px line with a wider glow, steady — it breathed forever — and on coming to a new place one pulse (table.js `pulse`):
   ::before is the swell, a brighter, wider glow that rises and settles; ::after the ripple, a ring that leaves it
   outward and fades. Its box is placed by table.js each frame it moves; no transition of its box.) */
.focus-ring { --ring: var(--playable); position: fixed; z-index: 14; pointer-events: none; border-radius: 12px; border: 4px solid var(--ring);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ring) 45%, transparent), 0 0 26px 7px color-mix(in srgb, var(--ring) 55%, transparent), inset 0 0 18px 3px color-mix(in srgb, var(--ring) 24%, transparent);
  transition: border-color .3s, box-shadow .3s; }
.focus-ring::before, .focus-ring::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none; opacity: 0; }
.focus-ring::before { border: 6px solid var(--ring); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 60%, transparent), 0 0 64px 26px color-mix(in srgb, var(--ring) 80%, transparent), inset 0 0 40px 10px color-mix(in srgb, var(--ring) 40%, transparent); }
.focus-ring::after { border: 4px solid var(--ring); box-shadow: 0 0 16px 3px color-mix(in srgb, var(--ring) 55%, transparent); }
.focus-ring[hidden] { display: none; }
.focus-ring.ask { --ring: var(--choosable); }
.focus-ring.strong { border-width: 5px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ring) 55%, transparent), 0 0 32px 9px color-mix(in srgb, var(--ring) 62%, transparent), inset 0 0 22px 4px color-mix(in srgb, var(--ring) 30%, transparent); }
.focus-ring.strong::before, .focus-ring.strong::after { inset: -5px; }
.focus-ring.over { z-index: 21; border-radius: 14px; }
.focus-ring.still { transition: none; }
/* (2026-11-06, the owner: "The hand also doesn't need the green box around all of it. It already has the green indicators
   around cards. Make it a tasteful green underline under the cards instead", and "The hand doesn't need to pulse on focus.
   Other zones can": at your priority the ring is a 3 px green line under the hand's cards, a soft glow under it, no
   pulse. table.js places it; gliding to or from another place, its box's bottom edge is the line.) */
.focus-ring.line { border-width: 0 0 3px; border-radius: 2px; box-shadow: 0 1px 7px 0 color-mix(in srgb, var(--ring) 60%, transparent); }
.focus-ring.line::before, .focus-ring.line::after { display: none; }
@media (prefers-reduced-motion: reduce) { .focus-ring { transition: none; } .life-pop, .strip.hit, .strip.hit-combat { animation: none; } .stack-forming::after, .stack-item.forming::after { animation: none; } }

/* ── THE CONSOLE (the table plan's T2, 2026-11-03; the owner: "the zones with player information, the hand, and the
   phases and action decision options shouldn't be able to be resized individually, they should all be locked on one
   pane", with minimum sizes so nothing is cut off or scrolled and the pass button fixed). One grid, sized by what is
   in it: your strip | your hand (a fan) | the question | the main button, and the phase track under them. ── */
.pnl[data-pnl="console"] { display: grid; grid-template-columns: minmax(112px, max-content) minmax(0, 1fr) minmax(260px, 32%) 136px;
  grid-template-areas: "bar bar bar bar" "strip hand ask main" "track track track track"; background: var(--panel); border-top: 2px solid var(--line); }
.pnl[data-pnl="console"] > #my-bar { grid-area: bar; }
.pnl[data-pnl="console"] > #my-strip { grid-area: strip; flex-direction: column; align-items: flex-start; justify-content: center; flex-wrap: nowrap;
  gap: 4px; border: none; border-right: 1px solid var(--line); padding: 6px 12px; max-width: 210px; min-height: 0; }
.pnl[data-pnl="console"] > #hand { grid-area: hand; border-top: none; overflow: visible; min-width: 0; background: var(--bg); }
.pnl[data-pnl="console"] > #prompt { grid-area: ask; border-top: none; border-left: 1px solid var(--line); align-content: center; min-width: 0; }
.pnl[data-pnl="console"] > #mainbtn { grid-area: main; }
.pnl[data-pnl="console"] > #phasebar { grid-area: track; border-top: 1px solid var(--line); }
.pnl[data-pnl="console"] #prompt .why { max-height: none; overflow: visible; }
.lgut.fixed { cursor: default; pointer-events: none; }
/* The main button: one place, one size. */
/* (Its box never moves: anchored to the console's bottom, one height, whatever the question says or holds.) */
#mainbtn { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px 12px 10px 4px; background: var(--panel); }
/* One control (the owner, 2026-11-06): one frame holding the answer and, over it, one strip of two halves — Undo · the
   other ways (▴). The answer keeps its place and size whatever the question; a half with nothing to do now is greyed.
   (8 px of the frame between the strip and the answer: a slip aiming at Undo or More must not land on Pass, which can't
   be taken back — law L9's dangerous neighbours.) */
#main-ctl { position: relative; display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; padding: 4px; border-radius: 12px;
  background: color-mix(in srgb, var(--mine) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--mine) 30%, var(--line)); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
#main-ctl .mseg-top { display: flex; height: 28px; }
#main-ctl .mseg-main { display: flex; flex-direction: column; }
#main-ctl .mseg { flex: 1 1 50%; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 4px; margin: 0;
  background: color-mix(in srgb, var(--mine) 12%, var(--panel)); color: var(--mine); border: 1px solid color-mix(in srgb, var(--mine) 50%, var(--line)); font-weight: 700; }
#main-ctl .mseg-l { border-radius: 8px 0 0 8px; }
#main-ctl .mseg-r { border-radius: 0 8px 8px 0; border-left: none; box-shadow: inset 1px 0 color-mix(in srgb, var(--mine) 30%, var(--line)); }
#main-ctl button.mseg:hover:not(:disabled) { background: color-mix(in srgb, var(--mine) 22%, var(--panel)); }
#main-ctl .mseg.on { background: var(--fill-mine); color: #fff; }
#main-ctl .mseg.off { color: color-mix(in srgb, var(--ink2) 60%, transparent); background: var(--panel); border-color: var(--line); cursor: default; }
#main-ctl .mseg-ic { font-size: 15px; line-height: 1; }
#main-ctl .mseg-lab { font-size: 12px; line-height: 1; }
#main-ctl .mseg kbd { display: none; }
/* (Key hints on — Settings, or ? held — Undo's Z shows, in the arrow's place.) */
body.key-hints #main-ctl .mseg kbd, body.keys-held #main-ctl .mseg kbd { display: inline; margin-right: 0; font-size: 10px; padding: 0 3px; }
body.key-hints #main-ctl .mseg-l .mseg-ic, body.keys-held #main-ctl .mseg-l .mseg-ic { display: none; }
#mainbtn .main-answer { width: 100%; height: 64px; flex: 0 0 64px; overflow: hidden; font-size: 15px; font-weight: 700; line-height: 1.2; white-space: normal; margin: 0;
  border-radius: 8px; }
#mainbtn .main-answer small { display: block; font-size: 11.5px; font-weight: 500; opacity: .9; }
/* (A yes / no question: Yes over No, one size and one look — the owner, 2026-11-05: "simply Two large Yes/No buttons
   stacked". Together they fill the middle.) */
#main-pair { display: flex; flex-direction: column; gap: 0; }
#mainbtn.pair .main-answer { height: 48px; flex: 0 0 48px; font-size: 16px; border-radius: 8px 8px 0 0; }
#mainbtn.pair .main-answer + .main-answer { border-radius: 0 0 8px 8px; border-top-color: color-mix(in srgb, #fff 45%, transparent); }
#main-fan { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; gap: 4px; padding: 6px; min-width: 230px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
#main-fan[hidden] { display: none; }
#main-fan button { text-align: left; }
body.fx-hold #mainbtn > * { visibility: hidden; }
/* The hand as a fan: cards overlap instead of shrinking; the one under the pointer (or the keyboard) lifts. */
:is(#hand, #hand > .elsewhere).fanned > .card + .card { margin-left: calc(-1 * var(--hov, 0px)); }
:is(#hand, #hand > .elsewhere).fanned > .card { position: relative; transition: transform .12s ease-out; }
/* (It lifts but stays in its layer: raised over its neighbour it would cover the strip of the next card, and a click
   meant for that card would land on it.) */
:is(#hand, #hand > .elsewhere).fanned > .card:hover, :is(#hand, #hand > .elsewhere).fanned > .card.focus { transform: translateY(-12px); }
/* THE HAND AT ANY SIZE (hand.js; the owner, 2026-11-03: "like hundreds … you can still click on a single card among
   hundreds"): past the point where the slivers are too thin to aim at, the cards around the pointer rise into a row above
   the fan, full size. The console's cell lets the row out over the board; the slivers left in the fan take no pointer.
   The trays at the start of the row (playable from elsewhere, the top of your library) fan and lens the same way. */
#hand { position: relative; }
/* (Out upward only: sideways it is still clipped, so nothing in it makes the page scroll on a phone.) */
.lcell:has(> .lbody > .pnl[data-pnl="console"]) { overflow: clip visible; }
:is(#hand, #hand > .elsewhere).lensy > .card { transform-origin: 0 100%; transition: transform .14s ease-out; }
:is(#hand, #hand > .elsewhere).lensy > .card:not(.lifted) { pointer-events: none; }
#hand .card.lifted { z-index: 24; box-shadow: 0 10px 22px rgba(0, 0, 0, .3); }
#hand .card.lifted:hover { box-shadow: 0 0 0 2px var(--ink), 0 12px 26px rgba(0, 0, 0, .36); }
#hand .card.lens-c { outline: 2px solid var(--ink2); outline-offset: 1px; }
/* (In the fan's slivers a card's ring would only show as its edge — 200 green edges made one green slab: the mark is a
   band along the top instead, green where you can play, amber where you can choose, blue where you have chosen.) */
:is(#hand, #hand > .elsewhere).lensy > .card:not(.lifted) { box-shadow: none; }
:is(#hand, #hand > .elsewhere).lensy > .card.playable:not(.lifted) { border-top: 5px solid var(--playable); }
:is(#hand, #hand > .elsewhere).lensy > .card.choosable:not(.lifted) { border-top: 5px solid var(--choosable); }
:is(#hand, #hand > .elsewhere).lensy > .card.selected:not(.lifted) { border-top: 7px solid var(--selected); }
@media (prefers-reduced-motion: reduce) { :is(#hand, #hand > .elsewhere).lensy > .card { transition: none; } }
/* THE TABLE'S ZONES (the table plan T3; D3 clean and flat, D4 counts on hover): every zone an object with a place and
   a size. Life on a round plate; the library a squared deck, as thick as its count; the graveyard a face-up pile; exile a
   paler pile; the opponent's hand a fan of backs; floating mana as coins. The words and numbers are still in the text
   (.sr) for screen readers and the checks. */
:root { --edge-a: #dcd7ca; --edge-b: #a39c8e; --plate: #fbfaf6; --plate-lit: #ffe6ad; --plate-ring: #d99a2b; --warm: rgba(255, 176, 64, .07);
  --back-a: #44598a; --back-b: #2c3b60; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --edge-a: #6b7280; --edge-b: #383d46; --plate: #262a31; --plate-lit: #4d3b14; --plate-ring: #e0a538; --warm: rgba(255, 176, 64, .04); --back-a: #3d5283; --back-b: #26345a; } }
:root[data-theme="dark"] { --edge-a: #6b7280; --edge-b: #383d46; --plate: #262a31; --plate-lit: #4d3b14; --plate-ring: #e0a538; --warm: rgba(255, 176, 64, .04); --back-a: #3d5283; --back-b: #26345a; }
.strip .plate-row { display: inline-flex; align-items: center; gap: 6px; }
.strip .medal { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto; font-weight: 400;
  background: var(--plate); border: 1px solid var(--line); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .18); }
.strip .medal .life { font-size: 22px; font-weight: 800; line-height: 1; min-width: 0; }
#opp-strip .medal { width: 42px; height: 42px; }
#opp-strip .medal .life { font-size: 18px; }
/* (Lit on its player's turn; a wider halo, steady, while they have priority. The owner, 2026-11-05: "I don't like the
   blinking indicators on life totals while life isn't changing" — it pulsed every 1.8 s for as long as they held
   priority. A life total moves only when the life does.) */
.strip .medal.lit { background: var(--plate-lit); border-color: var(--plate-ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plate-ring) 35%, transparent), inset 0 -3px 0 rgba(0, 0, 0, .08); }
.strip .medal.prio { box-shadow: 0 0 0 3px color-mix(in srgb, var(--plate-ring) 55%, transparent), 0 0 0 7px color-mix(in srgb, var(--plate-ring) 22%, transparent), inset 0 -3px 0 rgba(0, 0, 0, .08); }
.strip .medal-name { font-size: 12px; color: var(--ink2); }
/* Designations and counters by the life total: small round chips, each its icon (and its number). */
.strip .picons { display: inline-flex; align-items: center; gap: 4px; }
.strip .picon { position: relative; display: inline-flex; align-items: center; gap: 2px; height: 24px; min-width: 24px; padding: 0 5px; justify-content: center; border-radius: 12px;
  background: var(--plate); border: 1px solid var(--card-line); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); color: var(--ink); cursor: default; }
.strip .picon svg { width: 15px; height: 15px; flex: none; }
.strip .picon b { font-size: 12px; font-weight: 800; line-height: 1; }
.strip .picon.pi-monarch { color: #b8860b; border-color: #d9b44a; background: color-mix(in srgb, #f5d76e 28%, var(--plate)); }
.strip .picon.pi-initiative { color: #5b6b82; }
.strip .picon.pi-blessing { color: #c08a00; }
.strip .picon.pi-ring { color: #b8860b; border-color: #d9b44a; }
.strip .picon.pi-poison { color: #2e8b3a; border-color: #6fbf73; }
.strip .picon.pi-energy { color: #d98a00; }
.strip .picon.pi-experience { color: #7a4fbf; }
.strip .picon.pi-rad { color: #6b8e23; }
.strip .picon.pi-speed { color: #c0392b; }
:root[data-theme="dark"] .strip .picon.pi-monarch, :root[data-theme="dark"] .strip .picon.pi-ring { color: #f0c94a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .strip .picon.pi-monarch, :root:not([data-theme="light"]) .strip .picon.pi-ring { color: #f0c94a; } }
.board.their-turn { background-image: linear-gradient(var(--warm), var(--warm)); }
/* (The objects sit on a line with room above them for a thick deck's edges.) */
.strip .objs { display: inline-flex; align-items: flex-end; gap: 12px; padding: 10px 6px 4px 0; }
.strip .obj { position: relative; display: inline-block; width: 28px; height: 39px; border-radius: 3px; flex: 0 0 auto; color: var(--ink); }
/* The count: on hover (and the deck's always at 7 or fewer — running out matters). */
.strip .obj > b { position: absolute; right: -7px; bottom: -6px; z-index: 2; min-width: 18px; padding: 0 4px; border-radius: 9px; background: var(--ink); color: var(--panel);
  font-size: 11px; line-height: 16px; text-align: center; opacity: 0; transition: opacity .12s; pointer-events: none; }
.strip .obj:hover > b, .strip .deck.low > b { opacity: 1; }
.strip .deck { background: radial-gradient(ellipse 40% 46% at 50% 50%, var(--back-a) 0 92%, var(--back-b) 100%), var(--back-b); border: 1px solid var(--back-b); }
.strip .deck::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 2px; }
.strip .deck.empty { background: none; border: 1px dashed var(--line); }
.strip .deck.empty::after { display: none; }
.strip .pile { background: var(--card); border: 1px solid var(--card-line); }
.strip .pile .face { position: absolute; inset: -1px; border-radius: 3px; overflow: hidden; transform: rotate(var(--tilt, 0deg)); background: var(--card); border: 1px solid var(--card-line); }
.strip .pile .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip .pile .face-name { display: block; padding: 2px; font-size: 7px; line-height: 1.15; overflow: hidden; color: var(--card-ink); }
/* (Empty: a faint recessed slot.) */
.strip .pile.empty { background: transparent; border: 1px dashed var(--line); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .16) !important; cursor: default; }
/* (Exile: set apart, in a cooler, paler cast; only once something is in it.) */
.strip .pile.exile .face { filter: saturate(.3) brightness(1.08); }
.strip .pile.exile::after { content: ''; position: absolute; inset: -1px; z-index: 1; border-radius: 3px; background: rgba(110, 150, 225, .3); pointer-events: none; transform: rotate(var(--tilt, 0deg)); }
.strip .obj.none { display: none; }
/* The opponent's hand: a fan of backs, closer past about a dozen. */
.strip .hand-backs { width: auto; height: 31px; }
.strip .backs { display: inline-flex; --step: clamp(2px, calc(120px / var(--n)), 12px); }
.strip .backs i { width: 22px; height: 31px; flex: 0 0 auto; border-radius: 2px; border: 1px solid var(--back-b); border-left-color: #9fb0d6;
  background: radial-gradient(ellipse 40% 46% at 50% 50%, var(--back-a) 0 92%, var(--back-b) 100%), var(--back-b); box-shadow: -1px 0 2px rgba(0, 0, 0, .3); }
.strip .backs i + i { margin-left: calc(var(--step) - 22px); }
.strip .hand-backs.empty { width: 22px; height: 31px; border: 1px dashed var(--line); }
/* (A card of theirs you know — revealed, looked at, returned to their hand: face up in the fan; a click shows them large.) */
.strip .backs i.known { background: var(--card-bg, #f3efe6) center / cover no-repeat; border-color: var(--choosable); border-left-color: var(--choosable); box-shadow: -1px 0 2px rgba(0, 0, 0, .3), inset 0 0 0 1px var(--choosable); }
.strip .hand-backs.known { cursor: pointer; }
/* Floating mana: coins. */
.strip .coins { display: inline-flex; align-items: center; }
.strip .coin { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--plate);
  border: 1px solid var(--card-line); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .25); }
.strip .coin + .coin { margin-left: -7px; }
.strip .coin img.ms { width: 18px; height: 18px; margin: 0; vertical-align: 0; }
.strip .coin small { position: absolute; right: -9px; bottom: -5px; padding: 0 2px; border-radius: 6px; background: var(--panel); font-size: 11px; font-weight: 800; }
/* The coin pointed at comes to the top of the pile, its number in sight (the owner, 2026-11-06: "whichever mana was
   moused over went to the top layer so I could see the number if it's normally buried by other mana types"). */
.strip .coin { transition: transform .12s ease-out; }
.strip .coin:hover { z-index: 6; transform: translateY(-2px) scale(1.08); }
.strip .coin small { z-index: 1; }
/* THE WORDS (the table plan T3b, §7): less interface text.
   Key hints: hidden, shown while the help key (?) is held or always with Settings → "Show key hints" (D5). The keys
   themselves always work; the keys' own pages (help, settings) keep theirs. */
body:not(.key-hints):not(.keys-held) kbd, body:not(.key-hints):not(.keys-held) .card .hotkey { display: none; }
#overlay kbd { display: inline; }
/* Name strips: a card image names itself; the strip stays on small and shrunken cards. */
.card.img:not(.small) .strip-name { display: none; }
.board .row.tiny .card.img .strip-name { display: -webkit-box; }
/* THE CARD MARKS (the table plan T3c, §7, D7): the card's look carries what it can. A summoning-sick creature sits
   dim; an attacker steps forward toward the opponent, a blocker toward the attacker it blocks (the block line joins
   them); a printed keyword is on the card's image and is not repeated (text mode keeps it: no image there); a gained
   keyword is marked +; counters are chips. The words stay in the text for screen readers. */
.card .badges span.b-pos { display: none; }
.card.img .badges span.kw.printed { display: none; }
.card .badges span.kw.gained::before { content: '+'; margin-right: 1px; }
.card .badges span.kw.gained { background: var(--fill-sel); color: #fff; }
.card .badges span.kw.lost { text-decoration: line-through; opacity: .85; }
.card .badges span.kw.lost::before { content: '\2212'; margin-right: 1px; }
.card .badges span.ctr { border-radius: 8px; padding: 0 5px; background: var(--card); color: var(--card-ink); border: 1px solid var(--card-line); }
/* (A creature that came this turn is no longer greyed — the owner, 2026-11-07: "Something is causing this desaturation
   on cards on opponent's field"; its dashed frame says it, its art stays as printed.) */
/* (No transition: the block lines are drawn from where the cards stand.) */
#my-board .card.attacking, #my-board .card.blocking { translate: 0 -16px; }
#opp-board .card.attacking, #opp-board .card.blocking { translate: 0 16px; }
/* The sandbox editor: its bar takes the console's first line; no main button, no phase track. */
body.editing .pnl[data-pnl="console"] { grid-template-columns: minmax(112px, max-content) minmax(0, 1fr); grid-template-areas: "ask ask" "strip hand"; }
body.editing .pnl[data-pnl="console"] > #prompt { border-left: none; border-bottom: 1px solid var(--line); }
body.editing #mainbtn, body.editing .ibar { display: none; }
/* A phone: the console as a column — your strip beside the main button, then the question, the hand, the track. */
@media (max-width: 760px) {
  .pnl[data-pnl="console"] { grid-template-columns: minmax(0, 1fr) 120px; grid-template-areas: "bar bar" "strip main" "ask ask" "hand hand" "track track"; }
  .pnl[data-pnl="console"] > #my-strip { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2px 12px; max-width: none; border-right: none; }
  .pnl[data-pnl="console"] > #prompt { border-left: none; border-top: 1px solid var(--line); }
  #mainbtn { padding: 8px 8px 8px 0; justify-content: center; }
  #main-ctl .mseg-lab { font-size: 11px; }
  /* (The table is short on a phone, and the old Undo and ▴ floated outside the button's box, taking no height: the
     control kept within 4 px of the button alone — 24 px halves, the 8 px gutter, a 44 px answer, no inner padding,
     4 px around it — so the boards keep what they had.) */
  #mainbtn { padding-top: 4px; padding-bottom: 4px; }
  #main-ctl { padding: 0; }
  #main-ctl .mseg-top { height: 24px; }
  #mainbtn .main-answer { height: 44px; flex-basis: 44px; }
  #mainbtn.pair .main-answer { height: 36px; flex-basis: 36px; }
  /* (The phase track takes the phone's whole width — five bars and an open phase's marks need it — and the two switches
     go under it.) */
  #pb { flex-wrap: wrap; row-gap: 4px; }
  #pb-steps { flex: 1 1 100%; gap: 10px; }
  #pb-steps .seg.named { flex-grow: 14; } /* (an opened phase takes most of the track: its steps' names need it) */
  .pb-switches { margin-left: auto; }
}
/* (The sandbox's banner wraps in the console's question column.) */
.pnl[data-pnl="console"] .sandbox-banner { flex-wrap: wrap; row-gap: 4px; }
/* (In the console's question column the block chips take the column's width, and a long chip wraps its words rather
   than run under the main button.) */
.pnl[data-pnl="console"] #prompt > * { min-width: 0; max-width: 100%; }
.pnl[data-pnl="console"] #prompt .bchips { max-width: 100%; flex: 1 1 100%; }
.pnl[data-pnl="console"] #prompt .bchip { white-space: normal; flex-wrap: wrap; }

/* THE STACK ON THE TABLE (the table plan T4, D1): a lane of table surface right of the boards; its entries centred on
   the line where the boards meet. A spell is its card (`.tcard`), an ability a chip with its source's art (`.tchip`).
   The top of the stack is in front, whole; each older entry behind it shows its top strip (a card's name bar), tucked
   under the one in front. Empty: nothing is drawn. The words stay in each entry's text (hidden where its art is shown). */
.sart { display: none; }
.lcell.ontable { position: relative; }
.lcell.ontable > .lbody { z-index: 1; }
.lcell.ontable::before { content: ''; position: absolute; left: 0; right: 0; top: var(--opp-top, 0px); height: calc(var(--seam, 50%) - var(--opp-top, 0px)); border-bottom: 2px dashed var(--line); pointer-events: none; }
.lcell.ontable.warm-top::before { background-image: linear-gradient(var(--warm), var(--warm)); }
.lcell.ontable.warm-bottom::after { content: ''; position: absolute; left: 0; right: 0; top: var(--seam, 50%); bottom: var(--my-bottom, 0px); background-image: linear-gradient(var(--warm), var(--warm)); pointer-events: none; }
body:not(.layout-edit) .lcell.ontable > .ltabs { display: none; }
.lcell.ontable > .lbody > .pnl.paper { background: transparent; }
.lcell.ontable #stack-panel { display: flex; flex-direction: column; padding: 10px 8px; overflow-y: auto; overflow-x: hidden; min-width: 0; }
/* (Room inside the rail for the ring that goes round it when you may respond: it never covers a heading.) */
.lcell.ontable #stack { padding: 9px 7px 4px; }
.lcell.ontable #stack-panel > h2, .lcell.ontable #stack .sempty, .lcell.ontable #stack-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* THE SPELL RAIL (2026-11-07; app.js renderStack, layout.js applyRail): CASTING, RESOLVING, the STACK, top to bottom,
   each shown only when it holds something; on the table the rail itself slides open and shut at the boards' right edge
   (its width from 0 to its own; its content keeps its width and is uncovered as it goes). */
.lcell.ontable { transition: flex-basis .26s cubic-bezier(.3,.7,.3,1); }
.lcell.ontable.rail-shut { flex-basis: 0px !important; }
.lcell.ontable > .lbody { min-width: 220px; }
.lgut.quiet:has(+ .lcell.ontable.rail-shut) { display: none; }
body.anim-off .lcell.ontable { transition: none; }
.lcell.ontable.rail-shut::before, .lcell.ontable.rail-shut::after { display: none; }
#stack .rsec { margin: 0 0 12px; }
#stack .rs-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 5px; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink2); }
#stack .rs-h b { font-size: 12px; color: var(--ink); }
#stack .rs-body { display: flex; flex-direction: column; gap: 5px; }
/* An entry (the queue, the item resolving): its card or its source's art, its name, what it chose. */
#stack :is(.stack-item, .stack-res) { display: flex; gap: 7px; align-items: flex-start; margin: 0; padding: 5px 6px; border-radius: 7px; border-left-width: 4px; }
#stack :is(.stack-item, .stack-res) > .sart { display: block; flex: none; width: 46px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px var(--shadow); }
#stack :is(.stack-item, .stack-res).abil > .sart { aspect-ratio: 4 / 5; object-position: 50% 22%; }
#stack :is(.stack-item.qtop, .stack-res) > .sart { width: 76px; }
#stack :is(.stack-item, .stack-res) .stext { min-width: 0; line-height: 1.25; }
#stack :is(.stack-item, .stack-res) .sname { font-size: 12.5px; }
#stack :is(.stack-item, .stack-res) .sdesc { font-size: 11.5px; }
#stack :is(.stack-item, .stack-res) .sbody { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#stack .stack-item:not(.qtop) .sbody { -webkit-line-clamp: 2; }
#stack :is(.stack-item, .stack-res) .skind { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#stack .starg { color: var(--ink); font-weight: 600; }
#stack .stack-res { opacity: 1; border-style: solid; box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 45%, transparent); animation: res-glow 1.6s ease-in-out infinite; }
@keyframes res-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); } }
#stack .stack-item:hover { filter: brightness(1.05); }
/* The item resolving: its card whole, the rail's width (no crop, no empty space beside a name), and under it what it does. */
#stack .stack-res.res-full { display: block; padding: 7px 7px 8px; }
#stack .stack-res .res-img { display: block; width: min(100%, calc(44vh * 488 / 680)); margin: 0 auto; aspect-ratio: 488 / 680; object-fit: cover; border-radius: 4.6% / 3.3%; box-shadow: 0 2px 7px var(--shadow); cursor: zoom-in; }
#stack .stack-res .res-line { margin-top: 7px; font-size: 12.5px; line-height: 1.38; color: var(--ink); }
#stack .stack-res .res-sub { margin-top: 3px; font-size: 11.5px; line-height: 1.3; color: var(--ink2); }
#stack .stack-res .res-sub.starg { color: var(--ink); font-weight: 600; }
/* THE CASTING TRAYS (app.js trayOf, trayDock): docked at the bottom of the spell rail, over the stack's lower entries —
   the opponent's above yours; the dock shrinks, whole, when its cell is short. */
#cast-dock { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 6; display: flex; flex-direction: column; gap: 6px; pointer-events: none; transform: scale(var(--tray-k, 1)); transform-origin: 100% 100%; }
#cast-dock .cast-tray { position: static; width: auto; pointer-events: none; }
.cast-tray > .rs-cast { pointer-events: auto; margin: 0; padding: 6px 8px 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 26px var(--shadow); }
.cast-tray > .rs-cast[hidden] { display: none; }
.cast-tray .rs-h { margin: 0 0 5px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.cast-tray .rs-body { display: flex; flex-direction: column; gap: 5px; }
/* THE CASTING SECTION: the item being cast or activated — its card, the steps of CR 601.2 in order, its cost as large
   symbols that fill as they are paid (a ring segment a unit, in the colour of the mana that paid it), and what is asked. */
.cast-item { position: relative; overflow: hidden; padding: 7px; border-radius: 9px; background: color-mix(in srgb, var(--mine) 6%, var(--panel));
  border: 2px dashed color-mix(in srgb, var(--mine) 55%, var(--line)); }
.cast-item.theirs { background: color-mix(in srgb, var(--theirs) 6%, var(--panel)); border-color: color-mix(in srgb, var(--theirs) 55%, var(--line)); }
.cast-live::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 250%; pointer-events: none;
  background: linear-gradient(100deg, transparent 0 40%, color-mix(in srgb, var(--mine) 13%, transparent) 50%, transparent 60% 100%);
  animation: forming-sweep 1.8s linear infinite; animation-delay: var(--fphase, 0ms); }
.cast-live.still::after { animation: none; }
.cast-live.waiting { opacity: .8; }
.cast-item > :is(.stack-item, .stack-forming) { display: block; margin: 0 0 6px; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
.cast-item > :is(.stack-item, .stack-forming)::after { display: none; }
.cast-item > :is(.stack-item, .stack-forming) .sname { font-size: 13px; font-weight: 800; }
.cast-item > :is(.stack-item, .stack-forming) .skind { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cast-item > .stack-forming .sdesc:not(.skind) { font-size: 11.5px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cast-top { display: flex; gap: 8px; align-items: flex-start; }
.ccard { flex: none; width: 92px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 5px; box-shadow: 0 2px 6px var(--shadow); }
.ccard.chip { width: 64px; aspect-ratio: 4 / 5; object-position: 50% 22%; }
.ccard.text { display: grid; place-items: center; padding: 4px; background: var(--card); color: var(--card-ink); font-size: 11px; font-weight: 700; text-align: center; }
.csteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 11.5px; }
.cst { display: flex; align-items: center; gap: 6px; color: var(--ink2); white-space: nowrap; opacity: .6; }
.cst .tick { position: relative; flex: none; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid currentColor; }
.cst.done, .cst.now { opacity: 1; color: var(--ink); }
.cst.done .tick { background: var(--ok); border-color: var(--ok); }
.cst.done .tick::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.cst.now { font-weight: 800; }
.cst.now .tick { border-color: var(--mine); background: color-mix(in srgb, var(--mine) 30%, transparent); animation: tick-pulse 1.2s ease-in-out infinite; }
@keyframes tick-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mine) 25%, transparent); } }
.cst.skip { opacity: .38; text-decoration: line-through; }
.ccost { display: flex; flex-wrap: wrap; gap: 4px 5px; justify-content: center; margin-top: 8px; min-height: 36px; }
.csym { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; }
.csym .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.csym .ring circle { fill: none; stroke-width: 3.4; stroke-linecap: butt; }
.csym .ring .track { stroke: color-mix(in srgb, var(--ink2) 30%, transparent); }
.csym .ring .seg { stroke: transparent; transition: stroke .15s; }
.csym .ring .seg.on { stroke: var(--segc); }
.csym .ring .seg.pre { stroke: var(--segc); opacity: .45; }
.seg.cW { --segc: #d6b93c; } .seg.cU { --segc: #2f86d6; } .seg.cB { --segc: #6d4f8c; } .seg.cR { --segc: #e2412f; } .seg.cG { --segc: #2f9b55; } .seg.cC { --segc: #8f8a81; } .seg.cN { --segc: var(--ok); }
:root[data-theme="dark"] .seg.cB { --segc: #a586c6; } :root[data-theme="dark"] .seg.cW { --segc: #ecd56a; } :root[data-theme="dark"] .seg.cC { --segc: #c4bfb6; }
.csym .cg { position: relative; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.csym .cg img.ms { display: block; width: 26px; height: 26px; margin: 0; opacity: .5; filter: grayscale(.35); transition: opacity .2s, filter .2s; }
.csym.paid .cg img.ms { opacity: 1; filter: none; }
.csym.xsym .ring { display: none; }
.ctiles { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; position: relative; z-index: 1; }
.ctile { position: relative; text-align: left; font-size: 12px; line-height: 1.3; padding: 5px 8px 5px 8px; white-space: normal; }
.ctile.sel { background: var(--fill-sel); color: #fff; border-color: var(--fill-sel); padding-left: 26px; }
.ctile .cord { position: absolute; left: 6px; top: 5px; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #fff; color: var(--fill-sel); font-size: 10px; font-weight: 800; }
.ctile img.ms { width: 13px; height: 13px; vertical-align: -2px; }
.cpay-hint { margin-top: 6px; font-size: 11.5px; color: var(--ink2); text-align: center; }
.cbtns { position: relative; z-index: 1; display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.cbtn { font-size: 12.5px; padding: 4px 10px; }
#prompt .pcost img.ms { width: 18px; height: 18px; vertical-align: -3px; }
.lgut.quiet { background: transparent; }
.lgut.quiet:hover, .lgut.quiet.drag { background: var(--fill-sel); }

/* THE DRAWER (the table plan T4, D6): panels kept at the edge, closed by default; open, the table makes room. On the LEFT
   edge since 2026-11-07 (the spell rail is on the right: the log and the stack never side by side — the owner); it slides. */
:root { --ld-tab: 26px; --ld-w: 360px; }
body.has-drawer #app { margin-left: var(--ld-tab); transition: margin-left .24s ease-out; }
body.has-drawer.drawer-open #app { margin-left: calc(var(--ld-tab) + var(--ld-w)); }
/* (The windows over the table — a library search, a revealed hand — sit in the room the drawer leaves, and over it: the
   log was drawn over them — friends' notes 2026-11-07.) */
body.has-drawer { --ld-room: var(--ld-tab); }
body.has-drawer.drawer-open { --ld-room: calc(var(--ld-tab) + var(--ld-w)); }
#ldrawer { position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: row-reverse; justify-content: flex-end; z-index: 19; }
#ldrawer .ld-tabs { width: var(--ld-tab); display: flex; flex-direction: column; gap: 6px; padding: 54px 2px 0 0; border-right: 1px solid var(--line); background: var(--bg); }
#ldrawer .ld-tab { writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 2px; border-radius: 6px 0 0 6px; border-left: none; font-size: 12px; position: relative; color: var(--ink2); }
#ldrawer .ld-tab.on { background: var(--panel); color: var(--ink); border-color: var(--ink2); }
#ldrawer .ld-new { position: absolute; top: 3px; left: 50%; translate: -50% 0; width: 7px; height: 7px; border-radius: 50%; background: var(--choosable); }
#ldrawer .ld-body { width: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line);
  box-shadow: 4px 0 12px rgba(0, 0, 0, .12); transition: width .24s ease-out; }
#ldrawer.open .ld-body { width: var(--ld-w); }
#ldrawer .ld-body > .pnl { flex: 1 1 auto; min-height: 0; min-width: var(--ld-w); }
body.anim-off #ldrawer .ld-body, body.anim-off.has-drawer #app { transition: none; }
/* (The menu button sits over the drawer's top: the handles start under it.) */
body.has-drawer #burger { left: 4px; }

/* THE TABLE PLAN T5 (plan §6, "comes from / goes to"): the question panel sits over the boards, left of the stack lane
   (--tool-room, layout.js placeLane), so the item it comes from stays in sight beside it with the tether between. */

/* THE DARK THEME's own fixes (2026-11-07): what was drawn in fixed colours for a light page. */
:root[data-theme="dark"] .sandbox-banner button { background: var(--panel); color: var(--ink); }
:root[data-theme="dark"] .sb-notice, :root[data-theme="dark"] .sb-switch b { color: #c39bf0; }
:root[data-theme="dark"] #inspector .stepper.mana.mW .lab { color: #e6cf6a; } :root[data-theme="dark"] #inspector .stepper.mana.mU .lab { color: #6aa6f5; }
:root[data-theme="dark"] #inspector .stepper.mana.mB .lab { color: #b9b2c4; } :root[data-theme="dark"] #inspector .stepper.mana.mR .lab { color: #f2766b; }
:root[data-theme="dark"] #inspector .stepper.mana.mG .lab { color: #5fcf87; } :root[data-theme="dark"] #inspector .stepper.mana.mC .lab { color: #b8b8b8; }
:root[data-theme="dark"] .strip .picon.pi-initiative { color: #93a6c4; } :root[data-theme="dark"] .strip .picon.pi-blessing { color: #f0c24a; }
:root[data-theme="dark"] .strip .picon.pi-poison { color: #6fd27a; } :root[data-theme="dark"] .strip .picon.pi-energy { color: #f2b03c; }
:root[data-theme="dark"] .strip .picon.pi-experience { color: #b394ec; } :root[data-theme="dark"] .strip .picon.pi-rad { color: #a8d05a; }
:root[data-theme="dark"] .strip .picon.pi-speed { color: #f2766b; }
:root[data-theme="dark"] .strip .picon.pi-monarch { background: color-mix(in srgb, #f5d76e 14%, var(--plate)); }
/* (The card frames' own art stays as printed; the boards' "your turn" warmth is fainter, as a light on a dark cloth.) */
:root[data-theme="dark"] .card:not(.img) { box-shadow: 0 1px 3px var(--shadow); }
:root[data-theme="dark"] #fx .ghost { box-shadow: 0 6px 18px var(--shadow); }
:root[data-theme="dark"] body:not(.editing) #preview-panel { border-color: var(--line); box-shadow: 0 12px 34px var(--shadow); }
:root[data-theme="dark"] .ld-body { box-shadow: 4px 0 16px var(--shadow); }

/* THE INDICATOR BARS (2026-11-07, app.js renderBars): a short band between a player's strip and the battlefield, shown
   only when it holds something — it opens and shuts by its height (a grid row from 0 to its content), so the boards
   make room as it slides. Chips big enough to click. */
.ibar { display: grid; grid-template-rows: 0fr; background: var(--bg); transition: grid-template-rows .22s ease-out; }
.ibar.on { grid-template-rows: 1fr; }
.ibar > .ibar-in { min-height: 0; overflow: hidden; }
.ibar .ibar-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 6px 12px; }
#my-bar { border-top: 1px solid transparent; }
#my-bar.on { border-top-color: var(--line); }
#opp-bar.on { border-bottom: 1px dashed var(--line); }
@media (prefers-reduced-motion: reduce) { .ibar { transition: none; } }
.ichip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 11px 3px 8px; border-radius: 16px;
  background: var(--plate); border: 1px solid var(--card-line); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08), 0 1px 2px var(--shadow); }
.ichip svg { width: 18px; height: 18px; flex: none; }
.ichip b { font-size: 14px; font-weight: 800; }
.ichip:hover { border-color: var(--ink2); }
.ichip.pi-monarch, .ichip.pi-ring { color: #9a6f00; border-color: #d9b44a; background: color-mix(in srgb, #f5d76e 24%, var(--plate)); }
.ichip.pi-initiative { color: #4f5f78; } .ichip.pi-blessing { color: #a87900; }
.ichip.pi-poison { color: #257a32; border-color: #6fbf73; } .ichip.pi-energy { color: #b86f00; }
.ichip.pi-experience { color: #6a43ad; } .ichip.pi-rad { color: #5b7a1d; } .ichip.pi-speed { color: #b03224; }
.ichip.pi-shield { color: var(--mine); border-color: color-mix(in srgb, var(--mine) 50%, var(--card-line)); }
.ichip .ilab { color: var(--ink); }
.ichip.pi-yield { gap: 4px; padding-right: 4px; font-weight: 500; cursor: default; }
.ichip .iyx { border: none; background: none; padding: 0 6px; font-size: 16px; line-height: 1; color: var(--ink2); }
/* Floating mana: a coin a colour, its count on it; a coin that can pay the cost being paid is lit and clicked to spend. */
.ichip.coin { padding: 2px 10px 2px 2px; gap: 5px; }
.ichip.coin .cface { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); }
.ichip.coin .cface img.ms { width: 24px; height: 24px; margin: 0; vertical-align: 0; }
.ichip.coin.spend { border-color: var(--choosable); box-shadow: 0 0 0 2px color-mix(in srgb, var(--choosable) 55%, transparent); cursor: pointer; }
.ichip.coin.spend:hover { transform: translateY(-1px); }
#ibar-tip { position: fixed; z-index: 60; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.35;
  box-shadow: 0 4px 14px var(--shadow); pointer-events: none; }
:root[data-theme="dark"] .ichip.pi-monarch, :root[data-theme="dark"] .ichip.pi-ring { color: #f0c94a; background: color-mix(in srgb, #f5d76e 12%, var(--plate)); }
:root[data-theme="dark"] .ichip.pi-initiative { color: #93a6c4; } :root[data-theme="dark"] .ichip.pi-blessing { color: #f0c24a; }
:root[data-theme="dark"] .ichip.pi-poison { color: #6fd27a; } :root[data-theme="dark"] .ichip.pi-energy { color: #f2b03c; }
:root[data-theme="dark"] .ichip.pi-experience { color: #b394ec; } :root[data-theme="dark"] .ichip.pi-rad { color: #a8d05a; }
:root[data-theme="dark"] .ichip.pi-speed { color: #f2766b; }
/* (A stand-in of a cast the engine made whole: steps it cannot know — a spell cast and resolved in one message — dim.) */
.cast-standin { pointer-events: none; }
.cst.unk { opacity: .38; }
/* The cards under a permanent, in its preview (app.js underHtml). */
.punder { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; }
.punder > b { flex: 1 1 100%; }
.punder .pu { display: inline-flex; align-items: center; gap: 5px; }
.punder .pu img { width: 34px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px var(--shadow); }
/* A card chosen for the player — one possible answer, taken for them (polish.js autoMark). */
#fx .automark { position: fixed; border-radius: 9px; border: 3px solid var(--choosable); box-shadow: 0 0 16px var(--choosable); }
#fx .automark .am-tag { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 9px; border-radius: 7px; background: var(--panel); color: var(--ink); box-shadow: 0 2px 10px var(--shadow); font-size: 12px; line-height: 1.25; white-space: nowrap; max-width: 260px; }
#fx .automark .am-tag i { font-style: normal; color: var(--ink2); font-size: 11px; white-space: normal; text-align: center; }
/* The rail is a belt of its own, not more table (the owner, 2026-11-07: "make the rail have a different background than
   the battlefield"): a slate surface with an edge where it meets the boards; the table's halves (the seam line, whose
   turn) stop at that edge. */
.lcell.ontable { background: color-mix(in srgb, var(--panel) 70%, #5b6b8c); box-shadow: inset 1px 0 0 var(--line), inset 8px 0 10px -8px var(--shadow); }
.lcell.ontable::before, .lcell.ontable::after { display: none; }

/* ── TABLE TALK (social.js; the owner, 2026-11-08): emotes, chat, pings and lines at a friend table. Its own two colours
   (teal yours, violet theirs), never the game's (red attack, blue block, amber choose). ── */
:root { --so-me: #0f9fb3; --so-them: #a640d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --so-me: #39c6da; --so-them: #c77bf0; } }
:root[data-theme="dark"] { --so-me: #39c6da; --so-them: #c77bf0; }
.so-mine, .so-opp { display: inline-flex; gap: 5px; align-items: center; }
.so-b { position: relative; width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--plate, var(--panel)); color: var(--ink2); cursor: pointer; }
.so-b svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.so-b svg .f { fill: currentColor; stroke: none; }
.so-b:hover, .so-b:focus-visible { border-color: var(--so-me); color: var(--so-me); }
.so-b.on { background: var(--so-me); border-color: var(--so-me); color: #fff; }
.so-opp .so-b { width: 26px; height: 26px; opacity: .7; }
.so-opp .so-b:hover, .so-opp .so-b.on { opacity: 1; }
.so-opp .so-b.on { background: color-mix(in srgb, var(--warn) 18%, var(--plate, var(--panel))); border-color: var(--warn); color: var(--warn); }
.so-badge { position: absolute; top: -5px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--so-them);
  color: #fff; font: 700 10px/16px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.so-badge[hidden] { display: none; }
body.so-alt [data-play], body.so-alt #stack-panel, body.so-pen [data-play], body.so-pen #stack-panel, body.so-aiming [data-play], body.so-aiming #stack-panel { cursor: crosshair; }
body.so-alt [data-play] .card, body.so-pen [data-play] .card, body.so-aiming [data-play] .card { cursor: crosshair; }

/* An emote or a chat line, by the plate of who said it. */
.so-bubble { position: fixed; z-index: 44; max-width: min(320px, calc(100vw - 24px)); padding: 8px 14px; border-radius: 14px; background: var(--panel); color: var(--ink);
  border: 2px solid var(--so-c); box-shadow: 0 8px 22px var(--shadow); font: 650 15px/1.3 system-ui, -apple-system, sans-serif; pointer-events: none;
  animation: so-pop .22s cubic-bezier(.2, 1.4, .4, 1) both; overflow-wrap: anywhere; }
.so-bubble.mine { --so-c: var(--so-me); }
.so-bubble.theirs { --so-c: var(--so-them); }
.so-bubble.say { font-weight: 500; font-size: 14px; }
.so-bubble.emoji { padding: 2px 10px; }
.so-bubble .so-emoji { font-size: 34px; line-height: 1.15; }
.so-bubble::after { content: ''; position: absolute; left: calc(var(--tail, 26px) - 8px); width: 14px; height: 14px; background: inherit; border: inherit; border-width: 0 2px 2px 0; }
.so-bubble.mine::after { bottom: -9px; transform: rotate(45deg); }
.so-bubble.theirs::after { top: -9px; transform: rotate(-135deg); }
.so-bubble.mine.flip::after { bottom: auto; top: -9px; transform: rotate(-135deg); }
.so-bubble.theirs.flip::after { top: auto; bottom: -9px; transform: rotate(45deg); }
.so-bubble.out { animation: so-out .3s ease-in both; }
@keyframes so-pop { from { opacity: 0; transform: translateY(6px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes so-out { to { opacity: 0; transform: translateY(-4px) scale(.96); } }

/* A ping: rings round what was pinged. */
.so-ping { position: fixed; z-index: 44; pointer-events: none; border-radius: 12px; border: 3px solid var(--so-c); box-shadow: 0 0 14px 2px var(--so-c);
  animation: so-ping 1s ease-out 2 both; }
.so-ping.dot { border-radius: 50%; }
.so-ping.mine { --so-c: var(--so-me); }
.so-ping.theirs { --so-c: var(--so-them); }
@keyframes so-ping { 0% { opacity: 0; transform: scale(1.35); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }

/* A line across the table. */
#so-marks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 31; }
#so-marks .so-l.mine { --so-c: var(--so-me); }
#so-marks .so-l.theirs { --so-c: var(--so-them); }
#so-marks .so-lo { fill: none; stroke: rgba(0, 0, 0, .35); stroke-width: 8.5; stroke-linecap: round; }
#so-marks .so-li { fill: none; stroke: var(--so-c); stroke-width: 4.5; stroke-linecap: round; }
#so-marks .so-lh { fill: var(--so-c); stroke: rgba(0, 0, 0, .35); stroke-width: 1.5; }
#so-marks .drawing .so-li { stroke-dasharray: 10 7; }

/* The emotes: the words, then the faces. */
.so-pop { position: fixed; z-index: 37; background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 12px 30px var(--shadow); }
.so-emotes { width: 316px; animation: so-pop .16s ease-out both; }
.so-words { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.so-words button { display: flex; align-items: center; gap: 5px; padding: 7px 8px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font: 600 13px system-ui, sans-serif; white-space: nowrap; cursor: pointer; }
.so-words button kbd { font: 600 10px system-ui, sans-serif; color: var(--ink2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--panel); }
.so-faces { display: flex; justify-content: space-between; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.so-faces button { width: 44px; height: 40px; border-radius: 10px; border: 1.5px solid transparent; background: none; font-size: 24px; line-height: 1; cursor: pointer; }
.so-words button:hover, .so-words button:focus-visible, .so-faces button:hover, .so-faces button:focus-visible { border-color: var(--so-me); background: color-mix(in srgb, var(--so-me) 12%, var(--panel)); outline: none; }

/* The chat: a small window of its own, moved by its title. */
#so-chat { position: fixed; z-index: 34; width: min(330px, calc(100vw - 16px)); height: min(320px, 60vh); display: flex; flex-direction: column;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px var(--shadow); overflow: hidden; }
#so-chat[hidden] { display: none; }
#so-chat.nope { animation: so-nope .3s; }
@keyframes so-nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.so-chead { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 5px 12px; cursor: move; user-select: none; touch-action: none;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--so-me) 9%, var(--panel)); }
.so-chead b { font: 700 11px system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
.so-cx { width: 26px; height: 26px; border-radius: 50%; border: none; background: none; color: var(--ink2); font-size: 18px; line-height: 1; cursor: pointer; }
.so-cx:hover { background: var(--bg); color: var(--ink); }
.so-clist { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.so-line { max-width: 88%; padding: 5px 10px 6px; border-radius: 12px; background: var(--bg); font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; align-self: flex-start; }
.so-line b { display: block; font-size: 11px; font-weight: 700; color: var(--so-them); }
.so-line.mine { align-self: flex-end; background: color-mix(in srgb, var(--so-me) 14%, var(--panel)); }
.so-line.mine b { color: var(--so-me); text-align: right; }
.so-cform { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); margin: 0; }
.so-cform input { flex: 1; min-width: 0; padding: 8px 13px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 14px system-ui, sans-serif; }
.so-cform input:focus { outline: none; border-color: var(--so-me); box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-me) 25%, transparent); }
.so-cform button { flex: none; width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--so-me); color: #fff; display: grid; place-items: center; cursor: pointer; }
.so-cform button svg { width: 18px; height: 18px; }
.so-cform button svg .f { fill: currentColor; }

/* A card's art, by the card (table.js artPop). */
#art-pop { position: fixed; z-index: 37; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 8px 8px; box-shadow: 0 14px 34px var(--shadow);
  width: max-content; max-width: min(540px, calc(100vw - 16px)); }
#art-pop[hidden] { display: none; }
#art-pop .ap-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 6px 4px; }
#art-pop .ap-head b { font: 700 13px system-ui, sans-serif; }
#art-pop .ap-x { width: 26px; height: 26px; border-radius: 50%; border: none; background: none; color: var(--ink2); font-size: 18px; line-height: 1; cursor: pointer; }
#art-pop .ap-x:hover { background: var(--bg); color: var(--ink); }
#art-pop .ap-grid { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 7px; max-height: min(60vh, 460px); overflow-y: auto; width: min(512px, calc(100vw - 32px)); }
#art-pop .ap-print { padding: 0; border: 2.5px solid transparent; border-radius: 8px; background: none; cursor: pointer; overflow: hidden; line-height: 0; }
#art-pop .ap-print img { width: 87px; aspect-ratio: 146 / 204; display: block; border-radius: 5px; }
#art-pop .ap-print:hover, #art-pop .ap-print:focus-visible { border-color: var(--choosable); outline: none; }
#art-pop .ap-print.on { border-color: var(--selected); }
#art-pop .ap-blank { display: grid; place-items: center; width: 87px; aspect-ratio: 146 / 204; border-radius: 5px; background: var(--bg); font: 600 10px/1.2 system-ui; padding: 4px; text-align: center; }
#art-pop .ap-wait { width: 87px; aspect-ratio: 146 / 204; border-radius: 6px; background: linear-gradient(100deg, var(--bg) 30%, var(--panel) 50%, var(--bg) 70%); background-size: 300% 100%; animation: ap-wait 1.1s linear infinite; }
@keyframes ap-wait { from { background-position: 100% 0; } to { background-position: 0 0; } }
#art-pop .ap-retry { width: 87px; aspect-ratio: 146 / 204; border-radius: 6px; border: 1.5px dashed var(--line); background: none; font-size: 26px; color: var(--ink2); cursor: pointer; }

/* A hand card dragged over the table it would be played onto. */
#my-board.drop-play, #opp-board.drop-play { box-shadow: inset 0 0 0 3px var(--playable), inset 0 0 40px color-mix(in srgb, var(--playable) 22%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .so-bubble, .so-bubble.out, .so-emotes, #so-chat.nope { animation: none; }
  .so-ping { animation: none; opacity: .9; }
  #art-pop .ap-wait { animation: none; }
}
/* (A card dragged from the hand or across the table never selects the page's words on its way.) */
#hand, #my-board, #opp-board { -webkit-user-select: none; user-select: none; }
/* The AI model's face while its server does not answer: greyed, asleep (lobby.js modelDown). */
.st-asleep { display: none; }
.st-flip.model-down .st-face:has(.st-asleep) :is(.st-facebody, .st-facebar) { filter: grayscale(1); opacity: .38; }
.st-flip.model-down .st-asleep { display: block; position: absolute; right: 13px; top: 30px; font: italic 700 15px var(--s-serif, Georgia, serif); color: #a9bddf; pointer-events: none; }
.st-asleep i { display: inline-block; animation: st-zz 2.4s ease-in-out infinite; }
.st-asleep i:nth-child(2) { font-size: 12px; animation-delay: .4s; }
.st-asleep i:nth-child(3) { font-size: 10px; animation-delay: .8s; }
@keyframes st-zz { 0%, 100% { opacity: .25; transform: translateY(3px); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .st-asleep i { animation: none; opacity: .8; } }

/* THE OFFER (offer.js): a question's choices beside the object that asks — no heading, no counts, no buttons of its own;
   equal choices, together (L19, L20); each a real button (L21). */
#offer { position: fixed; z-index: 21; background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: 0 10px 30px var(--shadow); }
#offer .ofr-row { display: flex; gap: 10px; align-items: stretch; }
#offer button { font: inherit; color: inherit; cursor: pointer; }
#offer button:focus-visible, #offer button.focus { outline: 3px dashed var(--selected); outline-offset: 3px; }
/* colours: the mana symbols, large */
#offer .ofr-pip { width: 58px; height: 58px; padding: 0; border-radius: 50%; border: 2.5px solid transparent; background: none; display: grid; place-items: center; transition: transform .25s ease, border-color .25s ease; }
#offer .ofr-pip :is(img, .sym, i) { width: 46px; height: 46px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
#offer .ofr-pip:hover { transform: scale(1.08); border-color: var(--choosable); }
#offer .ofr-pip.sel { border-color: var(--selected); box-shadow: 0 0 0 3px color-mix(in srgb, var(--selected) 28%, transparent); }
/* words: card-text plates, one width */
#offer .ofr-words { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
#offer .ofr-word { min-width: 120px; max-width: 260px; min-height: 54px; padding: 12px 18px; border-radius: 10px; border: 1.5px solid var(--card-line); background: var(--card); color: var(--card-ink); font-family: "Source Serif 4", Georgia, serif; font-size: 16px; line-height: 1.3; text-align: center; transition: border-color .25s ease, box-shadow .25s ease; }
#offer .ofr-word img.ms { width: 16px; height: 16px; vertical-align: -2px; }
#offer .ofr-word:hover { border-color: var(--choosable); box-shadow: 0 0 0 2px color-mix(in srgb, var(--choosable) 35%, transparent); }
#offer .ofr-word.sel { border-color: var(--selected); box-shadow: 0 0 0 3px color-mix(in srgb, var(--selected) 30%, transparent); }
/* cards: each its card; the library's card back for "draw" */
#offer .ofr-card { position: relative; width: calc(var(--ch0) * .716 * 1.25); aspect-ratio: 63 / 88; padding: 0; border-radius: 7px; border: 2.5px solid transparent; background: var(--card); overflow: hidden; transition: transform .25s ease, border-color .25s ease; }
#offer .ofr-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
#offer .ofr-card .ofr-cname { display: block; padding: 8px; font-family: "Source Serif 4", Georgia, serif; font-weight: 600; text-align: left; color: var(--card-ink); }
#offer .ofr-card:hover { transform: translateY(-4px); border-color: var(--choosable); }
#offer .ofr-card.sel { border-color: var(--selected); }
#offer .ofr-back { background: radial-gradient(ellipse 40% 46% at 50% 50%, var(--back-a, #3d5283) 0 92%, var(--back-b, #26345a) 100%), var(--back-b, #26345a); }
#offer .ofr-back::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px; }
/* a dredge choice: the card (or the library's back) and, under it, what choosing it does ("Dredge 2", "Draw") */
#offer .ofr-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: none; background: none; }
#offer .ofr-pick > .ofr-card { display: block; }
#offer .ofr-pick:hover > .ofr-card { transform: translateY(-4px); border-color: var(--choosable); }
#offer .ofr-pick.sel > .ofr-card { border-color: var(--selected); }
#offer .ofr-cap { font: 600 14px/1.2 "Source Serif 4", Georgia, serif; color: var(--ink); white-space: nowrap; }
#offer .ofr-pick:hover .ofr-cap { color: var(--choosable); }
#offer .ofr-pick.sel .ofr-cap { color: var(--selected); }
@media (prefers-reduced-motion: reduce) { #offer .ofr-pick:hover > .ofr-card { transform: none; } }
#offer .ofr-n { position: absolute; right: 6px; bottom: 6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: rgba(0, 0, 0, .78); color: #fff; font: 700 15px/26px -apple-system, system-ui, sans-serif; text-align: center; }
@media (prefers-reduced-motion: reduce) { #offer button { transition: none; } #offer .ofr-pip:hover, #offer .ofr-card:hover { transform: none; } }
/* lit modes: the card being cast, large, each printed mode line a band to click — lit softly while it can be chosen,
   blue when chosen (a tick at its margin, ×N when chosen more than once), veiled when it cannot be chosen now */
#offer.ofr-modes { padding: 8px; border-radius: 22px; }
#offer .ofr-modecard { position: relative; height: var(--mh, min(640px, calc(100vh - 120px))); aspect-ratio: 488 / 680; border-radius: 4.6% / 3.3%; overflow: hidden; box-shadow: 0 6px 18px var(--shadow); }
#offer .ofr-modecard > img { display: block; width: 100%; height: 100%; }
#offer .ofr-band { position: absolute; padding: 0; border: none; border-radius: 5px; background: color-mix(in srgb, var(--choosable) 9%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--choosable) 55%, transparent); transition: background .25s ease, box-shadow .25s ease; }
#offer .ofr-band:hover { background: color-mix(in srgb, var(--choosable) 20%, transparent); box-shadow: inset 0 0 0 2.5px var(--choosable); }
#offer .ofr-band.sel { background: color-mix(in srgb, var(--selected) 20%, transparent); box-shadow: inset 0 0 0 2.5px var(--selected); }
#offer .ofr-band.off { background: rgba(70, 72, 78, .34); box-shadow: none; }
#offer .ofr-tick { position: absolute; left: 0; top: 50%; transform: translate(-45%, -50%); min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: var(--fill-sel); color: #fff; font: 700 13px/24px -apple-system, system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
/* Phyrexian pips as the answer: each pip a button showing how it is paid — its Phyrexian symbol for 2 life, its colour's
   plain symbol for mana; a click turns it over */
.cphy { position: relative; display: inline-grid; padding: 0; border: none; background: none; border-radius: 50%; cursor: pointer; transition: transform .25s ease; }
.cphy:hover { transform: scale(1.1); }
.cphy::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; box-shadow: 0 0 0 2px color-mix(in srgb, var(--choosable) 70%, transparent); pointer-events: none; }
.cphy.focus { outline: 3px dashed var(--selected); outline-offset: 3px; }
/* the casting section's word choices: card-text plates, one width (as the offer's words) */
.ctile { font-family: "Source Serif 4", Georgia, serif; font-size: 13px; border: 1.5px solid var(--card-line); background: var(--card); color: var(--card-ink); border-radius: 8px; padding: 6px 10px; }
.ctile:hover { border-color: var(--choosable); }
.ctile.csyms { text-align: center; padding: 5px 8px; }
.ctile.csyms img.ms { width: 20px; height: 20px; vertical-align: -4px; margin: 0 1px; }
/* graveyard cards for a cost (delve, collect evidence): the cards at the table's size, chosen ones lifted and ringed */
#offer .ofr-gyrow { flex-wrap: wrap; max-width: min(760px, 62vw); align-items: center; }
#offer .ofr-card.ofr-gy { width: calc(var(--ch0) * .716); }
#offer .ofr-card.ofr-gy.sel { transform: translateY(-8px); border-color: var(--selected); box-shadow: 0 6px 14px var(--shadow); }
#offer .ofr-meter { position: relative; width: 64px; height: 64px; display: grid; place-items: center; margin-left: 6px; }
#offer .ofr-meter svg { position: absolute; inset: 0; transform: rotate(-90deg); }
#offer .ofr-meter circle { fill: none; stroke-width: 5; }
#offer .ofr-meter .trk { stroke: color-mix(in srgb, var(--ink2) 25%, transparent); }
#offer .ofr-meter .fil { stroke: var(--choosable); transition: stroke-dasharray .3s ease; }
#offer .ofr-meter.full .fil { stroke: var(--ok); }
#offer .ofr-meter b { position: relative; font: 800 20px/1 -apple-system, system-ui, sans-serif; margin-top: -8px; }
#offer .ofr-meter i { position: absolute; bottom: 13px; font: 600 11px/1 -apple-system, system-ui, sans-serif; color: var(--ink2); font-style: normal; }
#offer .ofr-meter i::before { content: '/'; margin-right: 1px; }
.csym .ring .seg.dv { stroke: var(--ink); stroke-width: 4.2; }
/* THE DUNGEON CARD (a venture's question; the indicator bar's look at a dungeon): drawn as the card prints it — parchment
   in its black border, the rooms in rows from the top down joined by their paths, the venture marker a pawn. The rooms a
   venture can enter are lit (a ghost pawn on the one pointed at); the others step back. A printed card in both themes. */
.dmap { --ink-d: #2b241c; --rw: 150px; display: inline-block; background: #1b1916; padding: 6px; border-radius: 14px; box-shadow: 0 6px 18px var(--shadow); color: var(--ink-d); font-family: "Source Serif 4", Georgia, serif; text-align: center; }
.dmap .dm-title { background: linear-gradient(#efe7d4, #e4d8bd); border-radius: 8px 8px 3px 3px; padding: 5px 12px; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.dmap .dm-body { position: relative; margin-top: 3px; padding: 12px 10px 12px; background: radial-gradient(ellipse at 50% 30%, #f3ead6, #e2d4b6); border-radius: 3px 3px 8px 8px; display: flex; flex-direction: column; gap: 20px; }
.dmap .dm-row { position: relative; display: flex; justify-content: center; gap: 10px; }
.dmap .dm-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.dmap .dm-links path { fill: none; stroke: rgba(43, 36, 28, .5); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dmap .dm-links path.go { stroke: var(--choosable); stroke-width: 2.6; }
.dmap .dm-room { position: relative; width: var(--rw); box-sizing: border-box; padding: 6px 8px 7px; border: 1.5px solid rgba(43, 36, 28, .5); border-radius: 8px; background: rgba(255, 252, 243, .72); color: var(--ink-d); font: inherit; text-align: center; transition: border-color .25s ease, box-shadow .25s ease, opacity .25s ease, transform .25s ease; }
.dmap .dm-rname { display: block; font-weight: 700; font-size: 12.5px; line-height: 1.2; }
.dmap .dm-rtext { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.25; }
.dmap .dm-rtext img.ms { width: 11px; height: 11px; vertical-align: -1px; }
.dmap .dm-room.at { border: 2px solid var(--ink-d); background: #fffaf0; }
.dmap .dm-room.dim { opacity: .5; }
.dmap .dm-room.lit { cursor: pointer; background: #fffdf7; border: 2px solid var(--choosable); box-shadow: 0 0 0 3px color-mix(in srgb, var(--choosable) 22%, transparent), 0 0 16px color-mix(in srgb, var(--choosable) 35%, transparent); }
.dmap .dm-room.lit:hover { transform: translateY(-2px); box-shadow: 0 0 0 4px color-mix(in srgb, var(--choosable) 38%, transparent), 0 0 20px color-mix(in srgb, var(--choosable) 45%, transparent); }
.dmap .dm-room.lit.sel { border-color: var(--selected); box-shadow: 0 0 0 4px color-mix(in srgb, var(--selected) 32%, transparent); }
.dmap .dm-room.lit:focus-visible, .dmap .dm-room.lit.focus { outline: 3px dashed var(--selected); outline-offset: 3px; }
.dmap .dm-pawn { position: absolute; right: -11px; top: -19px; width: 26px; height: 35px; fill: #24467a; stroke: #f6efe0; stroke-width: 1.3; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); pointer-events: none; transition: opacity .25s ease; }
.dmap .dm-pawn.dm-ghost { opacity: 0; }
.dmap .dm-room.lit:hover .dm-ghost, .dmap .dm-room.lit.sel .dm-ghost { opacity: .6; }
/* the large card a venture asks on; the small cards a choice of dungeon offers */
.dmap.dm-large { --rw: 168px; }
.dmap.dm-small { --rw: 100px; }
.dmap.dm-small .dm-title { font-size: 13px; padding: 4px 8px; }
.dmap.dm-small .dm-body { padding: 8px 6px 8px; gap: 12px; }
.dmap.dm-small .dm-row { gap: 6px; }
.dmap.dm-small .dm-room { padding: 3px 4px 4px; border-radius: 6px; }
.dmap.dm-small .dm-rname { font-size: 10px; }
.dmap.dm-small .dm-rtext { font-size: 9px; line-height: 1.18; margin-top: 1px; }
#offer.ofr-room, #offer.ofr-dungeons { padding: 8px; border-radius: 22px; }
#offer .ofr-dungeons { align-items: flex-start; }
#offer .ofr-dungeon { padding: 0; border: 3px solid transparent; border-radius: 17px; background: none; transition: transform .25s ease, border-color .25s ease; }
#offer .ofr-dungeon:hover { transform: translateY(-4px); border-color: var(--choosable); }
#offer .ofr-dungeon.sel { border-color: var(--selected); }
@media (prefers-reduced-motion: reduce) { .dmap .dm-room, .dmap .dm-pawn, #offer .ofr-dungeon { transition: none; } .dmap .dm-room.lit:hover, #offer .ofr-dungeon:hover { transform: none; } }
/* the indicator bar's dungeon: its small map (the pawn's room the filled dot) and the room's name; its look, beside it */
.ichip .dmini { width: 22px; height: 22px; }
.ichip .dmini circle.here { fill: #3d6fb8; stroke: currentColor; stroke-width: .8; }
#dmap-peek { position: fixed; z-index: 40; }
/* the printed dungeon card (the owner's pick): the card's own image, each room a box on its walls — the rooms a venture
   can enter lit, the others veiled, the room the pawn stands on clear; the pawn walks to the room chosen */
.dcard { position: relative; height: var(--mh, 560px); aspect-ratio: 488 / 680; border-radius: 4.6% / 3.3%; overflow: hidden; box-shadow: 0 6px 18px var(--shadow); }
.dcard > img { display: block; width: 100%; height: 100%; }
.dcard .dc-room { position: absolute; box-sizing: border-box; padding: 0; border: none; border-radius: 5px; background: none; overflow: visible; transition: background .25s ease, box-shadow .25s ease; }
.dcard .dc-room.dim { background: rgba(12, 12, 16, .45); }
.dcard .dc-room.at { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.dcard .dc-room.lit { cursor: pointer; background: color-mix(in srgb, var(--choosable) 12%, transparent); box-shadow: inset 0 0 0 2.5px var(--choosable), 0 0 18px color-mix(in srgb, var(--choosable) 45%, transparent); }
.dcard .dc-room.lit:hover { background: color-mix(in srgb, var(--choosable) 24%, transparent); box-shadow: inset 0 0 0 3.5px var(--choosable), 0 0 22px color-mix(in srgb, var(--choosable) 55%, transparent); }
.dcard .dc-room.lit.sel { box-shadow: inset 0 0 0 3.5px var(--selected); background: color-mix(in srgb, var(--selected) 18%, transparent); }
.dcard .dc-room.lit:focus-visible, .dcard .dc-room.lit.focus { outline: 3px dashed var(--selected); outline-offset: -6px; }
.dcard .dm-pawn { width: 26px; height: 35px; fill: #24467a; stroke: #f6efe0; stroke-width: 1.3; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.dcard .dc-pawn { position: absolute; width: 26px; height: 35px; z-index: 2; pointer-events: none; transition: left .28s ease-in-out, top .28s ease-in-out; }
.dcard .dc-pawn .dm-pawn { display: block; }
.dcard .dc-room .dm-ghost { position: absolute; right: 4px; top: -21px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.dcard .dc-room.lit:hover .dm-ghost { opacity: .55; }
.dcard.walking .dm-ghost { opacity: 0 !important; }
.dcard.dc-peek { height: min(560px, calc(100vh - 140px)); }
#offer .ofr-dungeon.printed { height: var(--dh, 420px); aspect-ratio: 488 / 680; border-radius: 5.4% / 3.9%; overflow: hidden; }
#offer .ofr-dungeon.printed img { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .dcard .dc-pawn, .dcard .dc-room { transition: none; } }
/* the invite screen's undo switch (a friend game's setting): a plain switch and its word, the start screen's ink */
.start .st-switch { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; color: var(--s-ink2); font: 600 16px var(--s-sans); }
.start .st-switch .st-track { width: 44px; height: 24px; border-radius: 12px; background: var(--s-line2); position: relative; flex: none; transition: background-color .2s; }
.start .st-switch .st-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--s-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s ease-out; }
.start .st-switch.on { color: var(--s-ink); }
.start .st-switch.on .st-track { background: #3f8f5a; }
.start .st-switch.on .st-knob { transform: translateX(20px); }
.start .st-switch:hover .st-track { box-shadow: 0 0 0 2px var(--s-line2); }
@media (prefers-reduced-motion: reduce) { .start .st-switch .st-track, .start .st-switch .st-knob { transition: none; } }

/* ONE KIND OF COUNTER (the owner, 2026-11-14): its number, sitting on the card's art as a counter does on a real card. */
.card .ctr-one { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); min-width: 24px; height: 24px; padding: 0 5px; box-sizing: border-box;
  border-radius: 12px; background: var(--ink); color: var(--bg); font: 800 14px/24px system-ui, sans-serif; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,255,255,.18); pointer-events: auto; z-index: 2; }
.card.small .ctr-one { min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; border-radius: 9px; }

/* WHAT ELSE A MANA OPTION DOES (the owner, 2026-11-14): a small red asterisk in the option's corner; its words on hover. */
#menu.pipmenu button { position: relative; }
#menu .mstar { position: absolute; top: 1px; right: 3px; color: #d23a2a; font: 900 15px/1 system-ui, sans-serif; cursor: help; }

/* PASSING TRIGGERS (the owner, 2026-11-14): the triggers this browser always passes on, each taken off by its ×. */
.settings.passtrig { max-width: 520px; }
.passtrig .pt-list { display: flex; flex-direction: column; gap: 6px; }
.passtrig .pt-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel, rgba(0,0,0,.04)); }
.passtrig .pt-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.passtrig .pt-txt span { opacity: .8; }
.passtrig .pt-x { border: 0; background: transparent; font: 700 20px/1 system-ui, sans-serif; color: inherit; opacity: .55; cursor: pointer; min-width: 28px; min-height: 28px; }
.passtrig .pt-x:hover { opacity: 1; }

/* A library search's "Find nothing": a small text button at the start of the window's answers, not a card. */
#tool .actions .t-none { border: 0; background: transparent; color: var(--ink2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 4px 6px; }
#tool .actions .t-none:hover { color: var(--ink); }
/* (Its own look, L21: a line to write on with a magnifier, no form box.) */
#tool input#tool-filter[type="search"] { width: 100%; box-sizing: border-box; margin: 4px 0 12px; padding: 7px 8px 7px 30px; border: 0; border-bottom: 2px solid var(--line);
  border-radius: 0; background: transparent no-repeat 4px 50% / 18px 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
  font: 600 15px/1.2 inherit; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
#tool input#tool-filter[type="search"]:focus { border-bottom-color: var(--fill-sel, #2a6fdb); }
#tool input#tool-filter[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
#tool input#tool-filter[type="search"]::placeholder { color: var(--ink2); font-weight: 500; }

/* NAMING A TYPE, A KEYWORD, A COUNTER (2026-11-14): a search line, then plates — the ones that matter first, each with its
   count — then every choice. Plates, not form buttons (L21). */
#tool .tm-search { width: 100%; box-sizing: border-box; margin: 4px 0 12px; padding: 7px 8px 7px 30px; border: 0; border-bottom: 2px solid var(--line); border-radius: 0;
  background: transparent no-repeat 4px 50% / 18px 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
  font: 600 15px/1.2 inherit; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
#tool .tm-search:focus { border-bottom-color: var(--fill-sel, #2a6fdb); }
#tool .tm-search::-webkit-search-cancel-button { -webkit-appearance: none; }
#tool .tm-list { max-height: min(46vh, 420px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
#tool .tm-head { font: 700 11px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); margin: 0 0 6px 2px; }
#tool .tm-plates { display: flex; flex-wrap: wrap; gap: 6px; }
#tool .tm-plate { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 0; border-radius: 16px;
  background: var(--panel2, rgba(0,0,0,.06)); color: var(--ink); font: 600 14px/1.1 system-ui, sans-serif; cursor: pointer; }
#tool .tm-plate:hover { background: var(--fill-hover, rgba(42,111,219,.14)); }
#tool .tm-plate.lit { box-shadow: 0 0 0 2px var(--fill-sel, #2a6fdb); }
#tool .tm-plate .tm-n { font-style: normal; font-weight: 800; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; text-align: center;
  background: var(--ink); color: var(--bg); }

/* THE SHELF FROM THE PILE (the owner, 2026-11-15): a graveyard or exile laid out on the table's own plane — a recessed
   tray across the player's half, under its rows (the opponent's above theirs), real card size, run sideways. */
.zshelf { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; padding: 4px 8px 8px; margin: 0 -4px; overflow: hidden;
  background: color-mix(in srgb, var(--plate) 70%, var(--bg)); border-radius: 10px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .12), inset 0 0 0 1px color-mix(in srgb, var(--line) 80%, transparent); }
.zshelf .zs-head { display: flex; align-items: center; gap: 2px; font-size: 12px; }
.zshelf .zs-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 1px 8px 2px; color: var(--ink2); font: inherit; cursor: pointer; border-radius: 0; }
.zshelf .zs-tab b { font-weight: 800; margin-left: 2px; }
.zshelf .zs-tab:hover { color: var(--ink); }
.zshelf .zs-tab.on { color: var(--ink); border-bottom-color: var(--plate-ring); }
.zshelf .zs-x { margin-left: auto; background: none; border: 0; width: 22px; height: 22px; border-radius: 50%; font-size: 16px; line-height: 1; color: var(--ink2); cursor: pointer; padding: 0; }
.zshelf .zs-x:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.zshelf .zs-cards { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding-bottom: 2px; }
.zshelf .zs-cards > .card { flex: 0 0 var(--cw); }
.zshelf .zs-none { width: var(--cw); height: var(--ch); flex: 0 0 auto; border: 1.5px dashed var(--line); border-radius: 7px; }
.strip .zone.shelf-out { outline: 2px solid var(--plate-ring); outline-offset: 3px; border-radius: 3px; }

/* THE DICE AND THE COINS (dice.js; the owner, 2026-11-14): cel-shaded — flat colour in three bands, a dark ink outline,
   no gradients — thrown onto the roller's half, never in the way of a click. */
#chance-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.chance { position: absolute; width: 0; height: 0; perspective: 600px; --ink-line: #1d1b22; --die: #f6f0e2; --die-mid: #e2d6bd; --die-shade: #bfae8e; --pip: #1d1b22; }
.chance > * { position: absolute; left: -32px; top: -32px; width: 64px; height: 64px; }
.chance::after { content: ''; position: absolute; left: -28px; top: 30px; width: 56px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .18); filter: blur(1px); }
.chance .cube { --half: 32px; transform-style: preserve-3d; }
.chance .cf { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 9px; gap: 2px; box-sizing: border-box;
  background: var(--die); border: 3px solid var(--ink-line); border-radius: 12px; backface-visibility: hidden; }
.chance .cf.mid { background: var(--die-mid); }
.chance .cf.shade { background: var(--die-shade); }
.chance .cf i { display: block; border-radius: 50%; margin: 2px; }
.chance .cf i.p { background: var(--pip); box-shadow: inset -1.5px -1.5px 0 rgba(255, 255, 255, .25); }
.chance .cf1 i.p { background: #b3261e; margin: 0; }
.chance .spin { transform-style: preserve-3d; }
.chance .poly { width: 64px; height: 64px; overflow: visible; }
.chance .poly polygon { stroke: var(--ink-line); stroke-width: 1.6; stroke-linejoin: round; }
.chance .poly polygon.lit { fill: var(--die); } .chance .poly polygon.mid { fill: var(--die-mid); } .chance .poly polygon.shade { fill: var(--die-shade); }
.chance .poly polygon.rim { fill: none; stroke-width: 4; }
.chance .poly .num { font: 800 32px/1 system-ui, sans-serif; fill: var(--ink-line); text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--die); stroke-width: 3px; }
.chance .poly .dn { font: 700 11px/1 system-ui, sans-serif; fill: var(--ink-line); text-anchor: middle; }
.chance.again .poly polygon.lit, .chance.again .cf:not(.mid):not(.shade) { fill: #fff6d8; background: #fff6d8; }
.chance.xchg.became .num { fill: #1f5fbf; }
.chance .coin { transform-style: preserve-3d; }
.chance .cface { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--ink-line); backface-visibility: hidden; display: grid; place-items: center; box-sizing: border-box; }
.chance .cface svg { width: 62%; height: 62%; }
.chance .cface.sun { background: #f2c14e; box-shadow: inset 0 0 0 5px #d99a2b, inset 6px -6px 0 5px rgba(0, 0, 0, .08); }
.chance .cface.sun svg { fill: #fff3c4; stroke: #8a5a00; stroke-width: 2.4; stroke-linecap: round; }
.chance .cface.moon { background: #c9ced8; box-shadow: inset 0 0 0 5px #9aa2b1, inset 6px -6px 0 5px rgba(0, 0, 0, .08); transform: rotateX(180deg); }
.chance .cface.moon svg { fill: #f4f6fa; stroke: #4c5566; stroke-width: 2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chance::after { background: rgba(0, 0, 0, .4); } }
:root[data-theme="dark"] .chance::after { background: rgba(0, 0, 0, .4); }

/* THE LINES MOVE (app.js arrowsSvg; the owner, 2026-11-15): drawn from their start, a ping where they land, a target's
   or a tether's dashes running on from what asks to what it asks for, a fade when they go. */
#arrows line { vector-effect: non-scaling-stroke; transform-box: view-box; }
#arrows circle.ping { fill: none; stroke-width: 2.5; transform-box: view-box; opacity: 0; }
#arrows circle.ping.target { stroke: var(--attack); }
#arrows circle.ping.tether { stroke: var(--choosable); }
#arrows circle.ping.block { stroke: var(--block); }
@keyframes line-grow { from { transform: scale(0.001); } to { transform: scale(1); } }
@keyframes line-march-10 { from { stroke-dashoffset: 10; } to { stroke-dashoffset: 0; } }
@keyframes line-march-7 { from { stroke-dashoffset: 7; } to { stroke-dashoffset: 0; } }
@keyframes line-march-12 { from { stroke-dashoffset: 12; } to { stroke-dashoffset: 0; } }
@keyframes line-leave { from { opacity: 1; } to { opacity: 0; } }
@keyframes line-ping { 0% { opacity: .9; transform: scale(.35); } 100% { opacity: 0; transform: scale(1.5); } }
