:root {
  --bg: #efe9dc; --panel: #f9f5ec; --felt: #2f5a48; --felt-mine: #2a5040; --ink: #2a2622; --muted: #6a6256;
  --line: #cfc5b0; --accent: #8a2b1e; --on-accent: #fff; --empty: rgba(255,255,255,.14); --felt-ink: #e8efe9;
  --phasenow-bg: #232323; --phasenow-line: rgba(255,255,255,.55); --areaplayed: #c9a25a;
  --token-bg: #e6dcc4; --token-ink: #2a2622; --token-edge: #8a7a58;
  --ghost: rgb(205 225 240 / .28); --ghost-edge: rgb(150 190 225 / .55); --ghost-glow: rgb(120 170 220 / .5);
  --frame-bg: #f1eadb; --frame-line: #8a7a58; --frame-ink: #1f1c18;
  /* tokens are glass beads (the user's bead CSS, 2026-11-12): each kind its colour, light spot, dark edge */
  --bead-bonus: #2f9e44; --bead-bonus-light: #8ce99a; --bead-bonus-dark: #145a22;
  --bead-penalty: #d9381e; --bead-penalty-light: #ff8a75; --bead-penalty-dark: #7a190a;
  --bead-word: #2f63c4; --bead-word-light: #8db4ff; --bead-word-dark: #12306e;
  --bead-favor: #d4a017; --bead-favor-light: #ffe28a; --bead-favor-dark: #7a5600;
  --bead-more: #6c6c74; --bead-more-light: #c4c4cc; --bead-more-dark: #2e2e34;
  --basecard: clamp(52px, 8.4vw, 92px);
  --card: var(--basecard);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181a; --panel: #212326; --felt: #1d3a2f; --felt-mine: #1a3329; --ink: #e9e5dc; --muted: #a39d90;
    --line: #3b3e42; --accent: #d9694f; --on-accent: #1a1a1a; --empty: rgba(255,255,255,.08); --felt-ink: #d7e4dc;
    --phasenow-bg: #0e0e0f; --phasenow-line: rgba(255,255,255,.4); --areaplayed: #a8864a;
  --token-bg: #c9bea6; --token-ink: #1f1c18; --token-edge: #6e6247;
  --ghost: rgb(120 160 200 / .22); --ghost-edge: rgb(140 185 230 / .45); --ghost-glow: rgb(110 160 220 / .45);
  --frame-bg: #d9d0bc; --frame-line: #6e6247; --frame-ink: #17140f;
  --bead-bonus: #2b8f3e; --bead-bonus-light: #7fd68c; --bead-bonus-dark: #11501e;
  --bead-penalty: #c8331b; --bead-penalty-light: #f07d69; --bead-penalty-dark: #6c1608;
  --bead-word: #2b5ab3; --bead-word-light: #80a6f0; --bead-word-dark: #102b62;
  --bead-favor: #c29214; --bead-favor-light: #f0d27c; --bead-favor-dark: #6c4c00;
  --bead-more: #626269; --bead-more-light: #b6b6bd; --bead-more-dark: #29292e;
  }
}
:root[data-theme="dark"] {
  --bg: #17181a; --panel: #212326; --felt: #1d3a2f; --felt-mine: #1a3329; --ink: #e9e5dc; --muted: #a39d90;
  --line: #3b3e42; --accent: #d9694f; --on-accent: #1a1a1a; --empty: rgba(255,255,255,.08); --felt-ink: #d7e4dc;
  --phasenow-bg: #0e0e0f; --phasenow-line: rgba(255,255,255,.4); --areaplayed: #a8864a;
  --token-bg: #c9bea6; --token-ink: #1f1c18; --token-edge: #6e6247;
  --ghost: rgb(120 160 200 / .22); --ghost-edge: rgb(140 185 230 / .45); --ghost-glow: rgb(110 160 220 / .45);
  --frame-bg: #d9d0bc; --frame-line: #6e6247; --frame-ink: #17140f;
  --bead-bonus: #2b8f3e; --bead-bonus-light: #7fd68c; --bead-bonus-dark: #11501e;
  --bead-penalty: #c8331b; --bead-penalty-light: #f07d69; --bead-penalty-dark: #6c1608;
  --bead-word: #2b5ab3; --bead-word-light: #80a6f0; --bead-word-dark: #102b62;
  --bead-favor: #c29214; --bead-favor-light: #f0d27c; --bead-favor-dark: #6c4c00;
  --bead-more: #626269; --bead-more-light: #b6b6bd; --bead-more-dark: #29292e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.35 system-ui, sans-serif; }
[hidden] { display: none !important; }
button, select, input, textarea { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; min-height: 34px; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* start */
#start { max-width: 560px; margin: 0 auto; padding: 24px 16px; }
#start h1 { margin: 0 0 4px; }
#starthead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#account { display: flex; align-items: center; gap: 8px; min-width: 0; }
#accountname { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
#loginbutton { min-height: 36px; font-weight: 600; }
#start h1 { display: flex; align-items: center; gap: 10px; }
.choosebutton { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); text-decoration: none; }
.choosebutton:hover, .choosebutton:focus-visible { border-color: var(--accent); }
/* the game chooser (choose.html) */
#chooser { max-width: 560px; margin: 0 auto; padding: 24px 16px; }
#chooser h1 { margin: 0 0 12px; }
#gamelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.choosegame { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); text-decoration: none; }
.choosegame strong { font-size: 17px; }
.choosegame span { color: var(--muted); }
.choosegame:hover, .choosegame:focus-visible { border-color: var(--accent); }
#choosererror { color: var(--accent); }
/* the game's note on the start page (config note: the bare table's "no direct play support yet") */
#gamenote { padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; background: var(--panel); }
.sitemenu { min-width: 40px; min-height: 36px; font-size: 20px; line-height: 1; padding: 2px 8px; }
#start .sitemenu { font-size: 22px; }
#startform, #roundform { display: grid; gap: 8px; }
#startform label { font-weight: 600; margin-top: 10px; }
#startform textarea, #startform select, #startform input { width: 100%; }
#begin { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; min-height: 44px; margin-top: 10px; }
#starterror { color: var(--accent); min-height: 1.3em; }

.findbutton { justify-self: start; }
#moreplayers { display: contents; }
#addplayer { justify-self: start; }

/* the deck finder (finder.js) */
body.finding { overflow: hidden; }
.finder { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; justify-content: center; align-items: flex-start; padding: max(16px, env(safe-area-inset-top)) 16px 16px; }
.finderbox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; width: min(900px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 14px; }
.finderhead { position: sticky; top: 0; z-index: 1; background: var(--bg); display: flex; align-items: center; justify-content: space-between; padding: 10px 0 6px; font-size: 17px; }
.finderclose { min-width: 40px; font-size: 20px; line-height: 1; }
.finderform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.finderform input[type=search] { flex: 1 1 180px; min-width: 0; }
.finderform select { flex: 0 1 auto; max-width: min(100%, 280px); }
.findercheck { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; }
.findercount { color: var(--muted); font-size: 13px; }
.finderpath { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; }
.finderpath:empty { display: none; }
.crumb { min-height: 30px; padding: 2px 8px; }
.crumbhere { font-weight: 600; padding: 2px 4px; }
.crumbsep { color: var(--muted); }
.finderstatus { color: var(--muted); margin: 8px 0; min-height: 1.3em; }
.finderresults { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 8px; }
.finderdeck, .finderfolder { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; min-height: 52px; }
.finderdeck:hover, .finderfolder:hover { border-color: var(--accent); }
.finderfolder { flex-direction: row; align-items: center; gap: 8px; }
.finderfolder strong { flex: 1; overflow-wrap: anywhere; }
.foldericon { color: var(--muted); }
.deckname { overflow-wrap: anywhere; }
.deckmeta, .deckfolder, .deckprecon { font-size: 13px; color: var(--muted); }
.deckaward { font-size: 13px; }
.deckbad { font-size: 12px; font-weight: 600; color: var(--accent); }
.finderempty { color: var(--muted); grid-column: 1 / -1; }
.findermore { display: flex; justify-content: center; margin-top: 10px; }
.findermore:empty { display: none; }

#start h2 { font-size: 17px; margin: 20px 0 6px; }
#opengames ul, #finishedgames ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#opengames li, #finishedgames li { display: flex; gap: 6px; }
.opengame { flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; text-align: left; }
.opengame strong { overflow-wrap: anywhere; }
.opengame span { font-size: 13px; color: var(--muted); }
/* playing someone else: Open games, an invite, the host's wait */
#offers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#offers li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
#offers li span { flex: 1; min-width: 12em; font-size: 14px; color: var(--muted); }
#offers .nooffers { color: var(--muted); font-size: 14px; }
#invite, #waiting { padding: 8px 12px; border: 2px solid var(--accent); border-radius: 8px; margin: 12px 0; }
#invite h2, #waiting h2 { margin-top: 4px; }
#waiting .invitelink { width: 100%; box-sizing: border-box; margin-bottom: 6px; font-size: 13px; }
#waiting button + button { margin-left: 6px; }
#playsomeone { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#playsomeone p { width: 100%; margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* game frame */
#game { height: 100dvh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
#bar, #frame, #hand { user-select: none; -webkit-user-select: none; }   /* drags mustn't select text; the log still can */
#bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.turn { font-weight: 600; margin-right: auto; }
/* the panes (layout.js): rows and columns of them, splitters between */
#frame { position: relative; display: flex; min-height: 0; min-width: 0; }
#frame > .split, #frame > .pane:not(.floating) { flex: 1 1 0px !important; }
.split { display: flex; min-width: 0; min-height: 0; }
.split.row { flex-direction: row; }
.split.col { flex-direction: column; }
.split > * { min-width: 0; min-height: 0; }
.gutter { flex: 0 0 6px; position: relative; z-index: 6; background: var(--line); touch-action: none; }
.split.row > .gutter { cursor: col-resize; }
.split.col > .gutter { cursor: row-resize; }
.gutter::after { content: ''; position: absolute; inset: -5px 0; }   /* easier to catch with a finger */
.split.row > .gutter::after { inset: 0 -5px; }
.gutter:hover, .gutter.active { background: var(--accent); }
.pane { position: relative; display: flex; flex-direction: column; background: var(--felt); color: var(--felt-ink); }
.pane[data-pane="hand"], .pane[data-pane="log"] { background: var(--panel); color: var(--ink); }
.panebody { position: relative; flex: 1 1 0px; min-height: 0; overflow: auto; container-type: size; touch-action: pan-x pan-y; cursor: grab; }
.panebody.panning { cursor: grabbing; }
.panebody.zooming { cursor: ns-resize; }
.pane[data-pane="hand"] .panebody, .pane[data-pane="log"] .panebody { overflow: hidden; cursor: auto; }
/* in Layout mode a strip across the top of the pane, so it covers none of the pane's own controls */
.panehead { display: none; flex: none; z-index: 30; flex-wrap: wrap; align-items: center; gap: 3px; padding: 2px 4px; font-size: 12px; color: #fff; background: rgba(0,0,0,.75); }
#game.layouton .panehead { display: flex; }
#game.layouton .pane { outline: 1px dashed rgba(240,208,96,.55); outline-offset: -1px; }
.panehead label { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; }
.panegrip { padding: 6px; cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.panehead button { min-width: 30px; min-height: 30px; padding: 0; color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.panehead input { width: 84px; min-height: 0; padding: 0; }
.pane.floating { position: absolute; z-index: 40; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.45); }
.paneresize { display: none; position: absolute; right: 0; bottom: 0; z-index: 30; width: 26px; height: 26px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.75) 50%); }
#game.layouton .pane.floating .paneresize { display: block; }
#paneghost { position: fixed; z-index: 85; pointer-events: none; padding: 6px 10px; font-size: 13px; white-space: nowrap; color: #fff; background: rgba(0,0,0,.8); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#paneghost.free { min-width: 120px; min-height: 60px; border: 2px solid rgba(255,255,255,.7); background: rgba(0,0,0,.35); }
#dockhint { position: fixed; z-index: 84; pointer-events: none; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #222; background: color-mix(in srgb, #f0d060 35%, transparent); outline: 3px dashed #f0d060; outline-offset: -3px; }
.logtoggle { display: none; }
#logpanel { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--panel); }
/* the log and chat grow and shrink with their pane's zoom (the user, 2026-11-18: "or the event log") */
[data-area="log"] > #logpanel { zoom: var(--zoom, 1); }
#log { flex: 1; overflow-y: auto; margin: 0; padding: 8px 10px; list-style: none; font-size: 13px; }
#log li { padding: 2px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
.logcard { color: var(--accent); }
#log li.emphasis { margin: 3px 0; padding: 5px 7px; font-weight: 700; color: var(--on-accent); background: var(--accent); border: 0; border-radius: 5px; }
#log li.emphasis .logcard { color: inherit; text-decoration: underline; }
#log li.heading { margin-top: 8px; padding: 3px 0 2px; font-weight: 700; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line); }
#chat { display: flex; gap: 4px; padding: 6px; border-top: 1px solid var(--line); }
#chat input { flex: 1; min-width: 0; }

/* a seat */
.seat { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; }
.seat.theirs { min-height: 100%; }
[data-area^="their"] { --basecard: clamp(40px, 6vw, 70px); }
.counters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.counters button { min-height: 30px; min-width: 30px; padding: 0; background: var(--empty); color: var(--felt-ink); border-color: rgba(255,255,255,.25); }
.counter { display: inline-flex; align-items: center; gap: 4px; }
.counter b { min-width: 1.5em; text-align: center; font-size: 17px; }
.countername { font-size: 12px; opacity: .85; }
.counters button.paybutton { min-width: 0; padding: 0 8px; font-size: 12px; }
.rows { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; }
/* one line that always fits: the cards shrink with the pane rather than wrapping out of the game's order */
.layoutrow { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, var(--card))); gap: 5px; justify-content: center; }
/* zoomed past the pane: the row keeps its full size, and the pane scrolls */
[data-zoomed] .layoutrow { grid-template-columns: repeat(var(--cols), var(--card)); justify-content: start; }
.layoutrow .slot, .layoutrow .pile, .layoutrow .pile .pileface, .layoutrow .pile .pilelabel { width: 100%; }
/* a play area fills its pane, and reaches as far past it as the cards do (--fw, --fh: card widths) */
.panebody > .free { margin: 8px; width: max(calc(100cqw - 16px), calc(var(--fw, 0) * var(--card))); height: max(calc(100cqh - 16px), calc(var(--fh, 0) * var(--card))); }
.seat.theirs .free { flex: 1 1 auto; width: max(100%, calc(var(--fw, 0) * var(--card))); min-height: max(calc(var(--card) * 2.2), calc(var(--fh, 0) * var(--card))); }
.seat.theirs .freelabel { left: auto; right: 6px; }
.cardprobe { position: absolute; width: var(--card); height: 0; visibility: hidden; pointer-events: none; }
/* the tools over your play area stay in view however it's scrolled */
/* a phone's tap on a card beside a button (Arrange, Fit) went to the button: Chromium moves a tap onto what it takes
   for a tap target nearby, and a card's presses are the document's pointer events. A style on :active makes the card one,
   so the tap stays on the card under the finger (a click listener did too, but broke WebKit's touch presses) */
.card:active { --pressing: 1; }
.fieldtools { position: sticky; top: 0; left: 0; z-index: 30; height: 0; width: max-content; display: flex; align-items: flex-start; gap: 6px; transform: translate(12px, 12px); pointer-events: none; }
.fieldtools > * { pointer-events: auto; }
.fieldtools button { min-height: 30px; padding: 2px 10px; font-size: 13px; color: var(--felt-ink); background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.3); }
.fieldtools button.selcount { background: #f0d060; color: #1a1a1a; border-color: #f0d060; }
.fieldtools + .free > .freelabel { display: none; }
.card.selected { outline: 3px solid #f0d060; outline-offset: 2px; }
/* picked as a target of the action being set up */
.card.targeted, .slot.targeted, .areacol.targeted { outline: 3px solid #e0533a; outline-offset: 2px; }
.marquee { position: fixed; z-index: 80; pointer-events: none; border: 1.5px dashed #f0d060; background: rgba(240,208,96,.12); }
.ghostcount { position: absolute; right: -8px; top: -8px; min-width: 24px; padding: 2px 6px; border-radius: 12px; background: #f0d060; color: #1a1a1a; font: bold 13px/1.4 system-ui, sans-serif; text-align: center; }
/* the far player's counters at the end of their card row; on a phone, a line above it */
.theirline { display: flex; align-items: flex-start; gap: 8px; }
.theirline > .rows { flex: 1 1 auto; min-width: 0; padding: 0; }
.stats.theirstats { flex: 0 0 auto; min-height: 0; padding: 4px 8px; max-width: 200px; border-right: 1px solid rgba(255,255,255,.15); }
.stats.theirstats > .counters { flex: 1 1 auto; gap: 4px 12px; }
@media (max-width: 760px) {
  .theirline { flex-wrap: wrap; }
  .stats.theirstats { max-width: none; flex-basis: 100%; border-right: 0; padding: 0 4px; }
  .stats.theirstats .seatname { flex-basis: auto; }
  .stats.theirstats .counter b { font-size: 15px; }
}
/* your counters, and the phase button beside them (below, when the pane is narrow) */
.stats { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 8px 14px; padding: 8px; min-height: 100%; }
.stats > .counters { flex: 0 1 150px; gap: 4px 12px; }
.stats .seatname { flex-basis: 100%; }
.phasebox { display: flex; flex-direction: column; align-items: stretch; gap: 6px; flex: 1 1 140px; min-width: 0; max-width: 260px; }
.phasebutton { display: flex; align-items: center; min-width: 140px; min-height: 44px; padding: 0; line-height: 1.2;
  text-align: left; color: var(--on-accent); background: var(--accent); border-color: var(--phasenow-bg); }
/* just what a press does (the user, 2026-11-07); what's going on now is on the turn mark */
.phasenext { padding: 6px 12px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.phasebutton.blocked { opacity: .55; }
.phasenote { font-size: 13px; }
/* a token one player holds (the Imperial Favor): gold when it's yours, outlined when the other player has it */
.scenehere { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.passbutton { min-height: 34px; color: var(--felt-ink); background: var(--empty); border-color: rgba(255,255,255,.3); }
/* a phone: your counters' pane is never shorter than what's in it, up to a quarter of the screen (a long phase note in
   a battle scrolls), so Hand size and the Action and Pass buttons aren't cut off, also in a layout saved with the older,
   shorter pane; the panes around it give up the room. Not in Layout mode, where the panes are being sized by hand */
@media (max-width: 760px) {
  #game:not(.layouton) .split.col > .pane[data-pane="stats"] { min-height: max-content; }
  /* its body as tall as its content (a size container, or one sized from 0, has no height of its own) */
  #game:not(.layouton) .pane[data-pane="stats"] > .panebody { container-type: normal; flex: 1 0 auto; max-height: 25dvh; }
}
@media (max-width: 760px) { .stats .seatname { flex-basis: auto; } .phasebox { flex-direction: row; flex-wrap: wrap; align-items: center; } .phasebutton { min-height: 44px; min-width: 120px; } }

/* an area's own zoom */
[data-area] { --card: calc(var(--basecard) * var(--zoom, 1)); }
/* a part with its own zoom (layout.js zoompart), on top of its pane's */
[data-zoom] { --card: calc(var(--basecard) * var(--zoom, 1) * var(--subzoom, 1)); }
/* the counters grow and shrink with their pane's zoom (and their part's), as the cards do (the user, 2026-11-18: "both
   current and remote player's control area aren't scaling") */
.stats { zoom: calc(var(--zoom, 1) * var(--subzoom, 1)); }
#bar .autoswitch { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; cursor: pointer; }
#bar .autoswitch input { margin: 0; width: 16px; height: 16px; }
#bar button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* Undo's list of points, joined to Undo */
#bar button.undoto { margin-left: -5px; padding-inline: 6px; }

/* cards */
/* a card's shape is the game's (config cardratio, width ÷ height): --cardratio and --cardtall (height in card widths),
   set by ui/layout.js setcardshape before any card is drawn; no shape number is written here (whole-code pass 7f) */
.card, .pile .pileface, .slot { width: var(--card); aspect-ratio: var(--cardratio); }
.card { position: relative; container: card / inline-size; border-radius: 5px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.card, .card img, .pile img { -webkit-user-drag: none; }
.card img, .pileface > img { background: #3a352c; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 5px; pointer-events: none; }
.card.blank, .card:not(:has(img)) { background: #514a3e; color: #fff; padding: 3px; font-size: 10px; overflow: hidden; outline: 1px solid rgba(255,255,255,.3); }
.card.rot90, .card.rot270 { transform: rotate(90deg) scale(.86); }
.card.peeked img { opacity: .72; outline: 2px dashed #f0d060; }
.card.dragsource { opacity: .25; }
/* changes made by hand: the turn's blue, a scene's orange, a lasting one purple; a bonus a card in play gives, green */
.cardcount.cardmod { background: #1d4f8a; }
.cardcount.cardmod.until-scene { background: #a5531a; }
.cardcount.cardmod.until-ever { background: #5d2f86; }
.cardcount.cardmod.until-bonus { background: #2b6b3c; }
/* tokens on a card, by name, down its right edge */
.cardtokens { position: absolute; right: 2px; top: 2px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: calc(100% - 4px); pointer-events: none; }
.cardcount { min-width: 14px; padding: 0 3px; text-align: center; font: 700 10px/1.45 system-ui; letter-spacing: -.02em; background: #111; color: #fff; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* the far player's cards face them (their play area turns its cards in app.js); the big preview stays upright */
.seat.theirs .slot .card img, .seat.theirs .pile img { transform: rotate(180deg); }
/* rot180, a half turn (L5R's dishonored): the picture turns in its own box, so rot270 (with rot90's box) ends up at 270 */
.card.rot180 > img, .card.rot180 > .cardname, .card.rot270 > img, .card.rot270 > .cardname { transform: rotate(180deg); }
.ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; width: var(--card); transform: translate(-200px, -200px); box-shadow: 0 8px 22px rgba(0,0,0,.5); }

.slot { touch-action: manipulation; position: relative; border: 1px dashed rgba(255,255,255,.28); border-radius: 5px; display: flex; align-items: center; justify-content: center; background: var(--empty); }
.slot .card { position: absolute; inset: 0; width: 100%; z-index: 5; }
.slot .card:not(.onslot):nth-child(2) { left: 16%; top: 8%; }
/* a Region or Fortification on a province: behind its card, a step out per card (--dx, --dy: card widths) */
.slot .card.onslot, .slot .card.onslot.rot90, .slot .card.onslot.rot270 { transform: translate(calc(var(--dx, 0) * 100%), calc(var(--dy, 0) * 100% / var(--cardtall))) rotate(var(--rot, 0deg)); }
.layoutrow { margin-top: calc(var(--att, 0) * .28 * var(--card)); }
.seat.theirs .layoutrow { margin-top: 0; margin-bottom: calc(var(--att, 0) * .28 * var(--card)); }
.slotlabel, .freelabel { font-size: 10px; opacity: .75; text-align: center; }
.slot.destroyed { border-style: solid; border-color: rgba(0,0,0,.5); background: repeating-linear-gradient(45deg, rgba(0,0,0,.28) 0 6px, transparent 6px 12px); }
.pile { position: relative; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pileface { position: relative; border: 1px dashed rgba(255,255,255,.28); border-radius: 5px; background: var(--empty); }
.stack { --edge: 2px; position: absolute; left: 0; top: 0; right: calc(var(--edge) * var(--layers)); bottom: calc(var(--edge) * var(--layers)); border-radius: 5px; }
.stack img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 5px; pointer-events: none; }
.stack .card { width: 100%; height: 100%; aspect-ratio: auto; }
.pilelabel { display: block; width: var(--card); font-size: 10px; line-height: 1.1; margin-top: 2px; opacity: .85; }
.pilecount { position: absolute; right: -3px; top: -3px; min-width: 19px; padding: 0 4px; text-align: center; font-size: 12px; background: #111; color: #fff; border-radius: 9px; }
.free { position: relative; min-height: calc(var(--card) * 2.2); border: 1px dashed rgba(255,255,255,.2); border-radius: 8px; background: rgba(0,0,0,.1); }
.freelabel { position: absolute; left: 6px; top: 3px; pointer-events: none; }
/* a unit's cards are placed by unitplace() in app.js: offset in card widths, and turned */
.free > .card, .free > .card.rot90, .free > .card.rot270 { position: absolute; right: calc(var(--px, 0) * var(--card)); bottom: calc(var(--py, 0) * var(--card));
  margin: 0 calc(var(--card) / -2) calc(var(--card) * -.7) 0; transform: rotate(var(--rot, 0deg)); }
.free.mirrored > .card, .free.mirrored > .card.rot90, .free.mirrored > .card.rot270 { right: auto; bottom: auto; left: calc(var(--px, 0) * var(--card)); top: calc(var(--py, 0) * var(--card));
  margin: calc(var(--card) * -.7) 0 0 calc(var(--card) / -2); }
.droptarget { outline: 2px solid #f0d060; outline-offset: 1px; }

/* the areas pane (areaband in app.js): a column per area of the table scene's child scenes (L5R the Battlefields: a
   column per defender's province, like a siege) */
/* its cards are sized to fit the pane's height: a heading and a row of units (the pane's zoom still caps them) */
.areaband { --card: max(26px, min(calc(var(--basecard) * var(--zoom, 1)), calc((100cqh - 64px) / 1.5)));
  display: flex; gap: 8px; padding: 6px 8px; width: max-content; min-width: 100%; min-height: 100%; align-items: stretch; color: var(--felt-ink); }
.areacol { flex: 1 0 calc(var(--card) * 2.3); display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px dashed rgba(255,255,255,.25); border-radius: 8px; background: rgba(0,0,0,.12); }
.areacol.current { outline: 3px solid var(--accent); outline-offset: 1px; }
.areacol.done { opacity: .7; }
/* picking the next area: each one left glows and has its button (L5R Fight here) */
.areacol.pickable { outline: 2px dashed var(--accent); outline-offset: 1px; cursor: pointer; }
.areacol.pickable:hover { outline-style: solid; }
.choosable { outline: 2px dashed var(--accent); outline-offset: 2px; cursor: pointer; }
.choosable:hover { outline-style: solid; }
.areacol .areapick { align-self: center; margin: 2px 0 4px; min-height: 30px; padding: 1px 10px; background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; }
.areahead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.28); }
.areaprop, .areatitle, .areatotals { font-size: 12px; opacity: .85; }
/* an area's attachments in the corner of its column */
.areahead { position: relative; }
.areaattached { margin-left: auto; display: flex; gap: 3px; align-self: center; --card: 26px; }
.areaattached .card { width: var(--card); flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.areaattached .card.rot90, .areaattached .card.rot270 { transform: rotate(90deg) scale(.86); margin: 0 6px; }
.areaplayed { display: flex; align-items: center; gap: 4px; align-self: center; --card: 30px; }
.areaplayed .card { width: var(--card); flex: 0 0 auto; box-shadow: 0 0 0 2px var(--areaplayed); }
.cardcount.cardmod.masked { opacity: .5; }
.cardcount.cardtag { background: #2f6b4f; }
/* a province's Strength changed by an effect, along its top edge */
.slot .slotprop { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); z-index: 8; pointer-events: none; max-width: none; overflow: visible; }
.slot .slotprop ~ .slotprop { top: 18px; }
/* a token (made in play: no card picture): its name, numbers and traits, a card of its own colour */
/* a proxy (a made card, tokens step 4): the arc's blank frame (or one drawn here), its words written on, a translucent
   ghost edge so it never reads as a printed card */
.card.proxy { background: transparent; color: var(--token-ink); overflow: visible; }
.card.proxy::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--ghost); border: calc(var(--card) * .06) solid var(--ghost-edge);
  box-shadow: 0 0 calc(var(--card) * .08) var(--ghost-glow); pointer-events: none; }
/* an anchor (generic step 16b): a group's root with no card, only the ghost edge and the group's word */
.card.anchor { background: transparent; overflow: visible; }
.card.anchor::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--ghost); border: calc(var(--card) * .06) dashed var(--ghost-edge);
  box-shadow: 0 0 calc(var(--card) * .08) var(--ghost-glow); pointer-events: none; }
.anchorword { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; color: var(--token-ink); font: 700 calc(var(--card) * .11)/1 system-ui, sans-serif; text-transform: capitalize; }
.proxyface { position: absolute; inset: 7%; border-radius: 4%; background: center / 100% 100% no-repeat; opacity: .97; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 3px; text-align: center; }
.cssframe .proxyface { background-color: var(--frame-bg); border: 1px solid var(--frame-line); box-shadow: inset 0 0 0 2px var(--frame-bg), inset 0 0 0 3px var(--frame-line); justify-content: space-between; }
/* on a real frame (its own black border, the user 2026-11-13: "you can blue-glow the border itself"): the frame fills
   the card, the glow sits on its black border, a thin one outside, the art window a pale ghost */
.card.proxy.framed::before { background: none; border: none; box-shadow: 0 0 calc(var(--card) * .03) var(--ghost-glow); border-radius: calc(var(--card) * .045); }
.framed .proxyface { display: block; padding: 0; opacity: 1; inset: 0; border-radius: calc(var(--card) * .045); background-color: var(--ghost); }
.framed .proxyface::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 calc(var(--card) * .025) calc(var(--card) * .012) var(--ghost-edge); }
.proxyface > span { color: var(--frame-ink); text-shadow: 0 0 2px var(--frame-bg), 0 0 1px var(--frame-bg); overflow-wrap: anywhere; overflow: hidden; }
.framed .proxyface > span { display: flex; align-items: center; justify-content: center; text-align: center; }
.pxtitle { font: 700 calc(var(--card) * .12)/1.1 system-ui, sans-serif; }
.cssframe .pxtitle { width: 100%; border-bottom: 1px solid var(--frame-line); padding-bottom: 2px; }
.pxstats, .pxstat { font: 800 calc(var(--card) * .16)/1 system-ui, sans-serif; }
.pxkind { font: 600 calc(var(--card) * .085)/1.15 system-ui, sans-serif; }
.pxtext { font: 400 calc(var(--card) * .075)/1.2 system-ui, sans-serif; }
.cssframe .pxtext { width: 100%; border-top: 1px solid var(--frame-line); padding-top: 2px; }
.pxword { position: absolute; left: 0; right: 0; bottom: 1px; font: italic 700 calc(var(--card) * .075)/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; opacity: .65; display: block !important; }
.cssframe .pxword { position: static; }
.card.rot180.proxy .proxyface, .card.rot270.proxy .proxyface { transform: rotate(180deg); }
/* on a real frame the words fit the frame's own places (look.frames layout): sized to them, not to a drawn frame */
.framed .pxtitle { font: 700 calc(var(--card) * .062)/1 system-ui, sans-serif; white-space: nowrap; color: #1b140c; text-shadow: 0 0 2px #fff8e8; }
.framed .pxstat { font: 800 calc(var(--card) * .075)/1 system-ui, sans-serif; color: #1b140c; text-shadow: 0 0 2px #fff8e8; }
.framed .pxkind { font: 700 calc(var(--card) * .048)/1 system-ui, sans-serif; color: #1b140c; text-shadow: none; }
.framed .pxtext { font: 400 calc(var(--card) * .044)/1.15 system-ui, sans-serif; color: #1b140c; text-shadow: none; align-items: flex-start !important; }
.framed .pxword { color: var(--token-ink); }

/* tokens on a card: counters (discs) on its bottom edge, a pile for several of one name, tinted by what they do */
.carddiscs { position: absolute; left: -6%; right: -6%; bottom: calc(var(--disc) * -.38); display: flex; justify-content: center; flex-wrap: nowrap;
  --disc: max(12px, calc(var(--card) * .3)); z-index: 2; }
/* crowded: they overlap like counters dropped side by side */
.carddiscs > .disc + .disc { margin-left: calc(var(--disc) * -.12); }
.disc { --bc: var(--bead-word); --bl: var(--bead-word-light); --bd: var(--bead-word-dark);
  position: relative; width: var(--disc); height: var(--disc); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, var(--bl) 0%, var(--bc) 45%, var(--bd) 100%);
  box-shadow: 0 calc(var(--disc) * .09) calc(var(--disc) * .19) rgb(0 0 0 / .45), inset 0 2px 4px rgb(255 255 255 / .5), inset 0 -4px 6px rgb(0 0 0 / .4);
  color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .7); border: 0; cursor: pointer; }
/* the glossy spot */
.disc::before { content: ''; position: absolute; top: 10%; left: 18%; width: 28%; height: 16%; border-radius: 50%; background: rgb(255 255 255 / .45); transform: rotate(-28deg); pointer-events: none; }
.disc.tint-bonus, .dot.tint-bonus { --bc: var(--bead-bonus); --bl: var(--bead-bonus-light); --bd: var(--bead-bonus-dark); }
.disc.tint-penalty, .dot.tint-penalty { --bc: var(--bead-penalty); --bl: var(--bead-penalty-light); --bd: var(--bead-penalty-dark); }
/* both: half and half, lit the same */
.disc.tint-split, .dot.tint-split { background: radial-gradient(circle at 32% 28%, rgb(255 255 255 / .55) 0%, transparent 45%, rgb(0 0 0 / .45) 100%),
  linear-gradient(135deg, var(--bead-bonus) 50%, var(--bead-penalty) 50%); }
.disc.more { --bc: var(--bead-more); --bl: var(--bead-more-light); --bd: var(--bead-more-dark); }
.disclabel { position: relative; font: 800 calc(var(--disc) * .26 * var(--fit, 1))/1.2 system-ui, sans-serif; letter-spacing: -.02em; max-width: 92%; overflow-x: clip; overflow-y: visible; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; }
.disclabel.two { font-size: calc(var(--disc) * .24 * var(--fit, 1)); line-height: 1.05; }
/* a bowed card's counters stay readable: the words turn back upright */
.card.rot90 .disclabel, .card.rot270 .disclabel { transform: rotate(-90deg); }
.disccount { position: absolute; left: -4px; top: -4px; z-index: 1; font: 800 9px/1.3 system-ui; padding: 0 3px; border-radius: 6px; background: #111; color: #fff; text-shadow: none; }
.disc.more .disclabel { font-size: calc(var(--disc) * .34); }
/* zoomed out: dots instead (no words), a small bead a token */
.carddots { display: none; position: absolute; left: 0; right: 0; bottom: -3px; justify-content: center; flex-wrap: wrap; gap: 2px; z-index: 2; }
.dot { --bc: var(--bead-word); --bl: var(--bead-word-light); --bd: var(--bead-word-dark); width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--bl) 0%, var(--bc) 45%, var(--bd) 100%); box-shadow: 0 1px 2px rgb(0 0 0 / .6), 0 0 0 1px rgb(255 255 255 / .55); }
@container card (max-width: 66px) { .carddiscs { display: none; } .carddots { display: flex; } }
/* the big card's tokens, below it */
.previewtokens { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px 0; --disc: 30px; }
.previewtoken { display: inline-flex; align-items: center; gap: 5px; font: 600 12px/1.2 system-ui; }
.previewtoken .disc { cursor: default; }
.card.rot180 .carddiscs, .card.rot270 .carddiscs { transform: rotate(180deg); }
/* a player's token (the Favor): a disc by its holder's name, or faded in the bar while nobody has it */
.disc.seatdisc, #bar .disc.seatdisc { --disc: 34px; --bc: var(--bead-favor); --bl: var(--bead-favor-light); --bd: var(--bead-favor-dark); margin-left: 8px; vertical-align: middle; padding: 0; min-height: 0; min-width: 0; flex: none; }
#bar .disc.seatdisc, .disc.seatdisc { background: radial-gradient(circle at 32% 28%, var(--bl) 0%, var(--bc) 45%, var(--bd) 100%); border: 0; color: #fff; }
.disc.seatdisc .disclabel { font-size: 9px; letter-spacing: 0; }
#bar .disc.seatdisc.iconed, .disc.seatdisc.iconed { background: none; box-shadow: none; --disc: 38px; }
.disc.seatdisc.iconed::before { display: none; }
.disc.seatdisc.iconed img { width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .6)); }
.disc.seatdisc.untaken { opacity: .5; margin: 0 6px; }
.disc.seatdisc.untaken:hover, .disc.seatdisc.untaken:focus-visible { opacity: .9; }
.areaplayedlabel { font-size: 11px; opacity: .85; }
/* while the areas pane is up, the row of the areas' owner is small: the scenes show in the areas pane */
.rows.shrunkrow .layoutrow { grid-template-columns: repeat(var(--cols), minmax(0, calc(var(--card) * .55))); }
[data-zoomed] .rows.shrunkrow .layoutrow { grid-template-columns: repeat(var(--cols), calc(var(--card) * .55)); }
.lane { flex: 1 1 auto; position: relative; display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: center; gap: 6px; min-height: calc(var(--card) * 1.45); padding: 2px; border-radius: 6px; }
.lanelabel { font-size: 12px; opacity: .6; }
/* the other player's unit faces them, turned round as in their home */
.lineup.away { transform: rotate(180deg); }
.lineup { position: relative; width: calc(var(--fw) * var(--card)); height: calc(var(--fh) * var(--card)); }
.lineup > .card, .lineup > .card.rot90, .lineup > .card.rot270 { position: absolute; right: calc(var(--px, 0) * var(--card)); bottom: calc(var(--py, 0) * var(--card));
  margin: 0 calc(var(--card) / -2) calc(var(--card) * -.7) 0; transform: rotate(var(--rot, 0deg)); }
.areacol.scenesofar { flex: 0 0 auto; width: 15.5em; justify-content: center; gap: 4px; background: var(--panel); color: var(--ink); border-style: solid; }
/* never taller than the pane: it scrolls inside itself, so the band and its lanes stay in view */
.areaband > .areacol.scenesofar { max-height: calc(100cqh - 16px); overflow-y: auto; justify-content: flex-start; }
.areawrap .areacol.scenesofar { max-height: calc(100cqh - 52px); }
.scenesofar .sceneline { gap: 4px; }
/* its lines: a column, in the box or standing out of the pane over the table (#sofarfloat, fitsofar in app.js) */
.sofarbody { display: flex; flex-direction: column; gap: 4px; }
#sofarfloat { position: fixed; z-index: 39; box-sizing: border-box; padding: 4px; overflow-y: auto; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.scenesofar .sceneside { font-size: 13px; white-space: normal; }
.verdict { margin: 2px 0; font-size: 13px; }
.scenesofar .resolve { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; }
.scenesofar .resolve.skip { background: transparent; color: var(--ink); border: 1px solid var(--line, currentColor); font-weight: 400; }
/* a phone: tabs for one province or all, above the band */
.areawrap { display: flex; flex-direction: column; min-height: 100%; }
.areatabs { position: sticky; left: 0; display: flex; align-items: center; gap: 4px; padding: 4px 4px 0; color: var(--felt-ink); }
.areatabs .tablabel { font-size: 12px; opacity: .85; margin-right: 2px; }
.areatabs button { min-height: 30px; padding: 2px 10px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.areatabs button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.areatabs button.current:not(.on) { border-color: var(--accent); }
.tabcount { min-width: 16px; padding: 0 4px; border-radius: 8px; background: rgba(0,0,0,.35); color: #fff; font-size: 11px; }
/* sideways is for swiping between tabs here, not scrolling */
.areawrap > .areaband { touch-action: pan-y; flex: 1 1 auto; min-height: 0; --card: max(26px, min(calc(var(--basecard) * var(--zoom, 1)), calc((100cqh - 124px) / 1.5))); }
/* with tabs the band is the pane's width, never wider: All squeezes the columns, one area gets the room */
.areawrap > .areaband { width: 100%; min-width: 0; }
.areawrap .areacol:not(.scenesofar) { flex: 1 1 0; min-width: 0; overflow: hidden; }
.areawrap .areacol.scenesofar { width: 13em; }
@media (max-width: 760px) {
  /* a phone: all the areas across (L5R four provinces), each just wider than a card */
  .areaband { gap: 4px; padding: 4px; }
  .areacol { flex-basis: calc(var(--card) * 1.35); padding: 3px; }
  .areahead { padding: 2px 4px; font-size: 13px; }
  .areaprop, .areatitle, .areatotals { font-size: 11px; }
}

/* hand: cards squeeze together to fit, so it never needs a sideways scroll that a drag would fight with */
#hand { position: relative; display: flex; height: 100%; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); overflow: hidden; }
#hand .card { flex: 0 1 var(--card); min-width: 0; width: auto; aspect-ratio: auto; height: calc(var(--card) * var(--cardtall)); }
#hand .card img { width: var(--card); max-width: none; height: calc(var(--card) * var(--cardtall)); }
#hand .card:last-child { flex-shrink: 0; }
#hand .card + .card { margin-left: calc(var(--card) * var(--overlap, 0) * -1); }
#hand .card:hover { z-index: 5; }
#hand .slotlabel { color: var(--muted); align-self: center; }

/* overlays */
#menu { position: fixed; z-index: 80; display: flex; flex-direction: column; min-width: 170px; max-height: 70dvh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.4); }
/* items keep their height and the menu scrolls: shrunk, a closed action's note ran onto the next item and took its presses */
#menu > * { flex-shrink: 0; }
#menu button { border: 0; border-radius: 0; text-align: left; min-height: 42px; background: transparent; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.countrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.countlabel { flex: 1 0 100%; font-size: 13px; color: var(--muted); }
#menu .countrow button { flex: 1 1 36px; min-width: 36px; min-height: 40px; padding: 0 4px; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.countmore { display: flex; flex: 1; gap: 4px; }
.countmore input { flex: 1; min-width: 0; }
/* --pv: the wheel over a hovered card sizes it; never taller than the screen */
#preview { position: fixed; z-index: 70; right: 270px; top: 54px; width: min(calc(300px * var(--pv, 1)), 80vw, calc((100dvh - 64px) / var(--cardtall))); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.4); overflow: hidden; pointer-events: none; }
#preview > img { display: block; width: 100%; }
#preview > .previewproxy { --card: calc(300px * var(--pv, 1)); width: 100%; aspect-ratio: var(--cardratio); cursor: default; }
/* touch screens: the big card takes fingers, to pinch it bigger (app.js previewzoom) */
@media (hover: none) { #preview { pointer-events: auto; touch-action: none; } }
#preview > img { transform-origin: 0 0; }
#preview.zoomed { overflow: visible; z-index: 95; }
#preview.zoomed .previewtext { visibility: hidden; }
.previewtext { padding: 8px 10px; font-size: 13px; }
.previewtext p { margin: 4px 0 0; }
/* card text symbols, as the site draws them (its classes) */
#preview .previewtext img.inlinesymbol { display: inline; width: auto; height: 1.5em; vertical-align: middle; border: none; transform: none; }
#preview .previewtext img.inlinesymbolbounded { display: inline; width: auto; height: 1em; vertical-align: middle; border: none; transform: none; }
/* a game's own symbol classes and font: config symbols (ui/app.js symbolfont) */
#search { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); }
.searchhead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.searchhead strong { margin-right: auto; }
.searchgrid { --card: clamp(104px, 16vw, 150px); display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card), 1fr)); gap: 6px; padding: 8px; overflow-y: auto; touch-action: pan-y; }
.searchgrid .card { width: 100%; touch-action: pan-y; }
.stackcell { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stackpos { position: absolute; top: 4px; left: 4px; z-index: 1; min-width: 1.6em; padding: 0 4px; border-radius: 9px; text-align: center; font-weight: bold; font-size: 13px; font-variant-numeric: tabular-nums; background: var(--panel); color: var(--ink); border: 1px solid var(--line); pointer-events: none; }
.stacktools { display: flex; gap: 2px; }
.stacktools button { flex: 1; min-width: 0; padding: 2px 0; }
.stackgrid .card.held { outline: 3px solid var(--accent); outline-offset: 1px; opacity: .75; }
.stackgrid .card.dropat { outline: 3px dashed var(--accent); outline-offset: 1px; }

@media (min-width: 761px) { #preview.onleft { right: auto; left: 8px; } }
@media (max-width: 760px) {
  :root { --basecard: clamp(46px, 13.6vw, 72px); }
  .logtoggle { display: inline-block; }
  #logpanel { display: none; position: fixed; z-index: 50; height: 45dvh; left: 0; right: 0; bottom: 0; height: 45dvh; border-left: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.35); }
  #logpanel.open { display: flex; }
  #preview { left: 50%; right: auto; top: 8px; width: min(230px, 62vw); max-height: 44dvh; transform: translateX(-50%); }
  #menu { left: 0; right: 0; bottom: 0; top: auto; max-height: 50dvh; border-radius: 12px 12px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #bar { font-size: 13px; padding: 4px 6px; gap: 4px; }
  #bar button, #bar select { min-height: 32px; padding: 3px 7px; }
  .turn { width: 100%; }
  [data-area^="their"] { --basecard: clamp(36px, 10vw, 54px); }
  .pilelabel { font-size: 8px; }
  .layoutrow { gap: 3px; }
  .stack { --edge: 1.5px; }
  .pilecount { min-width: 16px; font-size: 10px; right: -2px; top: -2px; }
  .slotlabel { font-size: 8px; }
}

/* the province whose Event is being resolved */
.slot.eventnow { outline: 3px solid #e0b84a; outline-offset: 2px; border-radius: 6px; }

/* the action round: Action (I took one) and Pass side by side */
.actbuttons { display: flex; gap: 6px; }
.actbuttons > button { flex: 1 1 0; }
.passbutton.actionbutton { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* off-screen markers: a triangle at a play area's edge pointing at a unit out of view, in its fields' colour (table.offscreen) */
.offlayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 25; }
.offmark { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; transform: rotate(var(--turn));
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.offmark::before { content: ''; position: absolute; inset: 0; background: var(--mark); clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* the game is over: the winner where the turn was */
.turn.gameover { font-weight: 700; color: var(--on-accent); background: var(--accent); padding: 2px 10px; border-radius: 6px; }

/* the active area (the user, 2026-11-04): left of a play area, room for about three cards across; on a phone, small in
   the play area's upper left, growing with what's in it */
.pane { --activecard: 64px; --activegap: 6px; --activew: calc(3 * var(--activecard) + 4 * var(--activegap)); }
.activebox { position: absolute; left: 0; bottom: 0; z-index: 26; width: var(--activew); --card: var(--activecard);
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: var(--activegap); padding: 20px var(--activegap) var(--activegap);
  overflow-y: auto; background: var(--felt-mine); border-right: 1px dashed rgba(255,255,255,.28); color: var(--felt-ink); }
.pane:has(> .activebox) > .panebody { margin-left: calc(var(--activew) * var(--activezoom, 1)); }
/* an active area's own zoom (layout.js zoompart, --activezoom on its pane) */
.activebox { zoom: var(--activezoom, 1); }
.activebox.droptarget { outline: 2px solid #f0d060; outline-offset: -2px; }
.activelabel { position: absolute; top: 3px; left: var(--activegap); font-size: 11px; opacity: .75; pointer-events: none; }
.activebox .card { flex: none; }
/* a rule one of this player's cards holds (Emperor's Peace), until it ends */
.activerule { flex: 1 0 100%; font-size: 12px; line-height: 1.3; padding: 3px 5px; border-left: 3px solid #f0d060;
  background: rgba(0,0,0,.22); border-radius: 0 4px 4px 0; overflow-wrap: anywhere; }
/* a card of yours selected (press here) or being dragged: your active area says so, and on a phone opens up from its
   small tag (the user couldn't find it to drop a card into, 2026-11-04) */
.activehint { display: none; flex: 1 0 100%; font-size: 12px; font-weight: 600; color: #f0d060; pointer-events: none; }
.activebox.ready, .activebox.dropready { outline: 2px dashed #f0d060; outline-offset: -2px; }
.activebox.ready .activehint, .activebox.dropready .activehint { display: block; }
.activebox.dropready.droptarget { outline-style: solid; background: color-mix(in srgb, var(--felt-mine) 80%, #f0d060); }
.activebox.theirs .card img { transform: rotate(180deg); }
.activetarget { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; background: rgba(0,0,0,.75); color: #f0d060; font-size: 10px;
  line-height: 1.3; padding: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 0 0 5px 5px; pointer-events: none; }
@media (max-width: 760px) {
  .pane { --activecard: 44px; --activegap: 4px; }
  .activebox { bottom: auto; width: auto; max-width: var(--activew); max-height: 62%; border: 1px dashed rgba(255,255,255,.28); border-width: 0 1px 1px 0;
    border-radius: 0 0 6px 0; padding-top: 16px; }
  .activebox.empty { padding: 3px 8px; }
  .activebox.empty .activelabel { position: static; }
  .activebox.empty.ready, .activebox.empty.dropready { min-width: 140px; min-height: 64px; padding: 6px 10px; align-content: center; }
  .activebox.empty.ready .activelabel, .activebox.empty.dropready .activelabel { font-size: 13px; opacity: 1; }
  .pane:has(> .activebox) > .panebody { margin-left: 0; }
  .pane:has(> .activebox) .fieldtools { transform: translate(calc(12px + var(--activeboxw, 0px)), 12px); }
  .pane:has(> .activebox) .seat.theirs { padding-top: var(--activeboxh, 0px); }
}

/* picking targets (Create challenge, Focus): a line along the top */
#pickbar { position: fixed; top: 4px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px); white-space: nowrap; padding: 4px 6px 4px 14px; border-radius: 8px; background: #f0d060; color: #1a1a1a; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#pickbar span { overflow: hidden; text-overflow: ellipsis; }
/* a phone's Reset, Layout, Stats and Games are in ☰: the strip starts right of it, so ☰ stays in reach (a Reaction's too) */
@media (max-width: 760px) { #pickbar { left: 56px; right: 8px; transform: none; max-width: none; } }
#pickbar button { flex: none; min-height: 30px; padding: 2px 10px; background: rgba(255,255,255,.7); color: #1a1a1a; border-color: rgba(0,0,0,.25); }
/* a scene's panel (scenepanel in app.js), beside the phase button */
#scenepanel, #answerpanel { position: fixed; z-index: 65; top: 54px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 16px));
  display: grid; gap: 6px; padding: 10px 12px; border: 2px solid #f0d060; border-radius: 10px; background: var(--felt-mine); color: var(--felt-ink);
  box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#scenepanel .phasenote, #answerpanel .phasenote { font-size: 13px; }
.scenestep { min-height: 30px; padding: 0 12px; color: var(--felt-ink); background: var(--empty); border-color: rgba(255,255,255,.3); }
@media (max-width: 760px) { #scenepanel, #answerpanel { top: 4px; } }
.scenetitle { font-size: 13px; }
.sceneline { display: flex; align-items: center; gap: 6px; }
.sceneside { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.scenetotal { min-width: 2ch; text-align: center; }
/* a scene panel in the middle (config panel: middle; L5R's battle at Resolution): big, both players' to read and agree on */
#scenepanel.middle { z-index: 64; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 16px)); max-height: calc(100vh - 16px);
  overflow-y: auto; gap: 8px; padding: 14px 18px; border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: 0 10px 32px rgba(0,0,0,.55); }
#scenepanel.middle .scenehead { display: flex; align-items: center; gap: 8px; }
#scenepanel.middle .scenetitle { flex: 1; font-size: 18px; text-align: center; }
#scenepanel .scenehide { flex: none; min-height: 30px; padding: 2px 12px; font-size: 14px; }
#scenepanel.middle .sceneside { font-size: 18px; }
#scenepanel.middle .scenetotal { font-size: 26px; min-width: 3ch; }
#scenepanel.middle .scenestep { min-width: 48px; min-height: 42px; font-size: 20px; color: var(--ink); }
#scenepanel.middle .phasenote { font-size: 15px; }
#scenepanel.middle .verdict { font-size: 17px; text-align: center; margin: 4px 0; }
#scenepanel.middle .actbuttons button { min-height: 44px; font-size: 17px; }
#scenepanel.middle .actbuttons .sceneoff { background: transparent; color: var(--ink); border: 1px solid var(--line, currentColor); font-weight: 400; }
/* hidden: a button low in the middle, to bring it back */
#scenepanel.middle.hidden { top: auto; bottom: 12px; transform: translateX(-50%); width: auto; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
#scenepanel.middle.hidden .resolve { padding: 8px 16px; border: 2px solid #f0d060; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
@media (max-width: 760px) { #scenepanel.middle { padding: 10px 12px; top: 50%; } #scenepanel.middle .scenetitle { font-size: 17px; }
  #scenepanel.middle .scenetotal { font-size: 22px; } #scenepanel.middle .scenestep { min-height: 38px; } }
/* a phone: the other player's pane has tabs, Play area, Provinces and Both (clear of the active box over its corner) */
.theirtabs { position: sticky; left: 0; display: flex; align-items: center; gap: 4px; padding-top: 4px; color: var(--felt-ink); }
.theirtabs button { display: inline-flex; align-items: center; color: var(--ink); }
.theirtabs button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.theirtabs .tablabel { opacity: .85; }
.theirtabs { padding-left: calc(var(--activeboxw, 0px) + 6px); padding-bottom: 4px; flex-wrap: nowrap; white-space: nowrap; }
.theirtabs .theirsum { margin-left: 6px; overflow: hidden; text-overflow: ellipsis; }
.seat.theirs.tabbed { display: flex; flex-direction: column; }
.theirtabs button { min-height: 24px; padding: 0 8px; font-size: 13px; }
.theirtabs .theirsum { font-size: 12px; }
.seat.theirs.tabbed { gap: 2px; padding-top: 2px; }
/* Reactions: the menu's heading; the bar while choosing one (the table as it stood then); a cancelled event in the log */
#menu .menuhead { padding: 6px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
#menu .menustats { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.35; cursor: default; }
#menu .statgroup { margin-bottom: 4px; font-size: 14px; }
#menu .statline { display: flex; flex-wrap: wrap; gap: 0 6px; padding-left: 8px; }
#menu .statline.statmain { padding-left: 0; font-weight: 600; }
#menu .stattitle::after { content: ':'; }
#menu .statline.statrot90 { opacity: .6; }
#menu .statnote { color: var(--muted); font-weight: 400; }
/* an Event's pick: a button for each card it may be, wrapping under the words when there are many */
#pickbar.eventpick { flex-wrap: wrap; justify-content: center; max-height: 40vh; overflow-y: auto; }
#pickbar.eventpick span { flex: 1 0 100%; text-align: center; white-space: normal; }
#pickbar.reacting { background: #b9473a; color: #fff; }
/* Rally Troops' placing (the Done bar): the words wrap on a narrow screen */
#pickbar.placing { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 16px); }
#pickbar.placing span { flex: 1 1 240px; white-space: normal; }
#pickbar.reacting .logcard { color: inherit; text-decoration: underline; }
#log li.cancelled { text-decoration: line-through; opacity: .65; }

/* a menu item that can't be used now (an action whose timing isn't open), with why under it */
#menu button.shut { opacity: .55; cursor: default; }
#menu button.shut .menunote { display: block; font-size: 11px; font-weight: 400; opacity: .9; }

/* cards moving by themselves (motion.js): a stand-in flies from where the card was to where it is; an Event flipped up
   or cards revealed show big in the middle of the table first, side by side */
.flycard { position: fixed; left: 0; top: 0; z-index: 85; pointer-events: none; border-radius: 5px; overflow: hidden; background: var(--empty, #444); box-shadow: 0 6px 18px rgba(0,0,0,.45); transform-origin: 50% 50%; will-change: transform; }
.flycard img, #spotlight img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flycard.spotfly { z-index: 87; border-radius: 10px; }
#spotlight { position: fixed; z-index: 87; display: flex; justify-content: center; align-items: center; cursor: pointer; }
#spotlight .spotcard { flex: none; border-radius: 12px; overflow: hidden; background: var(--empty, #444); box-shadow: 0 14px 44px rgba(0,0,0,.6), 0 0 0 3px rgba(240,208,96,.85); }

/* the table's questions (ask.js), in place of the browser's confirm/prompt: a box over the dimmed table for a follow-up
   to your own click; docked, a panel at the top that leaves the table live (Imperial Gift's "Search now?") */
dialog.ask { padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); width: min(440px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
dialog.ask::backdrop { background: rgba(0,0,0,.45); }
.ask.docked { position: fixed; z-index: 75; top: 54px; left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.45), 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.askbox { padding: 14px 16px 12px; }
.asktext { margin: 0; font-weight: 600; white-space: pre-line; }
.askdetail { margin: 6px 0 0; color: var(--muted); font-size: 14px; white-space: pre-line; }
.askinput { display: block; width: 100%; margin-top: 10px; min-height: 40px; }
.askbuttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.askbuttons button { min-height: 40px; }
.askbuttons .askmain { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }

/* the turn mark: whose turn, and who acts now, on the line between the two players (clicks go through it) */
#turnmark { position: fixed; z-index: 40; transform: translate(-50%, -50%); display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; pointer-events: none;
  max-width: calc(100vw - 16px); background: var(--felt); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.45); border: 1px solid var(--phasenow-line); font-size: 13px; line-height: 1.15; white-space: nowrap; opacity: .94; }
#turnmark > span { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 14px 4px; }
#turnmark .tmturn b, #turnmark .tmactive { font-weight: 700; }
#turnmark .tmactive { font-size: 14px; }
/* a name on its player's seat colour (table.seatcolour), as the arrow's spot; the second of two of one value striped */
.seatspot { background: var(--seat); color: var(--seatink); padding: 0 6px; border-radius: 6px; }
.seatspot.second { background: repeating-linear-gradient(135deg, var(--seat) 0 7px, color-mix(in srgb, var(--seat) 60%, var(--seatink)) 7px 11px);
  text-shadow: 0 0 3px var(--seat), 0 0 3px var(--seat); }
#turnmark .tmphase { font-size: 11px; opacity: .85; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#turnmark .tmphase b { font-weight: inherit; }
#turnmark .tmturn { background: var(--phasenow-bg); color: #fff; }
#turnmark .tmacts { flex-direction: row; gap: 7px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
#turnmark .tmacts.other { background: #c9a25a; color: #1f1c18; }
#turnmark .tmarrow { font-size: 18px; line-height: 1; }
/* the seat colour of the player it points at; the second of two of one value striped */
#turnmark .tmacts.seatcolour { background: var(--seat); color: var(--seatink); }
#turnmark .tmacts.seatcolour.second { background: repeating-linear-gradient(135deg, var(--seat) 0 7px, color-mix(in srgb, var(--seat) 60%, var(--seatink)) 7px 11px);
  text-shadow: 0 0 3px var(--seat), 0 0 3px var(--seat); }
/* the control panel on the mark: its buttons take clicks, the rest of the mark lets them through */
#turnmark .tmcontrols { flex: 0 1 auto; padding: 4px 6px; background: var(--felt); white-space: normal; }
#turnmark .tmcontrols button { pointer-events: auto; }
#turnmark .phasebox { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; max-width: none; flex: none; }
#turnmark .phasebutton { min-width: 0; min-height: 34px; }
#turnmark .phasenext { padding: 4px 10px; font-size: 13px; }
#turnmark .passbutton { min-height: 34px; padding: 3px 10px; }
#turnmark .actbuttons > button { flex: none; }
#turnmark .phasenote { color: var(--felt-ink); font-size: 12px; }
/* a phone: beside your counters, where the control panel was, each part a row */
#turnmark.docked { transform: none; flex-wrap: wrap; border-radius: 10px; font-size: 11px; line-height: 1.15; white-space: normal; }
#turnmark.docked > span { flex: 1 1 100%; padding: 2px 6px; }
#turnmark.docked .tmactive { font-size: 12px; }
#turnmark.docked .tmphase { max-width: none; white-space: normal; text-align: center; }
#turnmark.docked .tmacts { justify-content: center; }
#turnmark.docked .tmarrow { font-size: 14px; }
#turnmark.docked .tmcontrols { padding: 3px; }
#turnmark.docked .phasebox { gap: 3px; }
#turnmark.docked .phasebutton, #turnmark.docked .passbutton { min-height: 32px; min-width: 0; padding: 2px 8px; font-size: 12px; line-height: 1.15; }
#turnmark.docked .phasenext { padding: 0; font-size: 12px; }
#turnmark.docked .actbuttons { gap: 3px; }


/* a server game's state in the bar: Saved, Saving… (moves on their way), Rolling… (waiting on the server's dice) */
#bar .serverstate { font-size: 0.8em; opacity: 0.7; margin-left: 0.5em; white-space: nowrap; }
#opengames .openproblem, #start > p > .openproblem { color: var(--warn, #b00); }

/* the round table (ui/rounds.js: games dealt around, played in tricks; Hearts) */
#rt { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; background: var(--bg); }
#rt.logopen { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); }
.rt-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.rt-status { flex: 1 1 220px; color: var(--muted); }
.rt-bar label { display: inline-flex; align-items: center; gap: 4px; }
.rt-home { color: var(--accent); }
/* overflow: a short phone's table scrolls in its row; spilled over the hand, the player's own box covered Pass 3 (iPhone) */
.rt-table { grid-column: 1; min-height: 0; overflow: auto; display: grid; gap: 8px; padding: 10px 16px; background: var(--felt); color: var(--felt-ink);
  grid-template-columns: minmax(0, 1fr) minmax(200px, 2fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto;
  grid-template-areas: ". top ." "left mid right" ". me ."; }
.rt-table.seats3 { grid-template-areas: "left . right" "left mid right" ". me ."; }
.rt-table.hasboard { overflow: auto; grid-template-rows: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "board board board" ". . ." ". top ." "left mid right" ". me ."; }
.rt-table.hasboard.seats2 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "board" "." "top" "mid" "me"; }
.rt-table.hasboard.seats3 { grid-template-areas: "board board board" ". . ." "left . right" "left mid right" ". me ."; }
.rt-board { grid-area: board; display: grid; gap: 3px; padding: 6px 10px; border-radius: 8px; background: var(--board-wood); color: var(--board-ink); }
.rt-lane { display: grid; grid-template-columns: minmax(60px, 9em) 1fr 3ch; align-items: center; gap: 8px; font-size: 13px; }
.rt-lanename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-lanescore { text-align: right; }
.rt-track { position: relative; height: 12px; border-radius: 6px; background: rgba(0,0,0,.28)
  repeating-linear-gradient(90deg, transparent 0 calc(500% / 121 - 1px), rgba(255,255,255,.35) calc(500% / 121 - 1px) calc(500% / 121)); }
.rt-peg { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(0,0,0,.5); background: var(--peg); }
.rt-peg.back { opacity: .45; }
.rt-lane.peg0 { --peg: var(--peg-a); } .rt-lane.peg1 { --peg: var(--peg-b); } .rt-lane.peg2 { --peg: var(--peg-c); } .rt-lane.peg3 { --peg: var(--peg-d); }
.rt-team { font-size: 12px; opacity: .8; }
.rt-tag.dealer { background: rgba(255,255,255,.3); } .rt-tag.Go { background: #c96a5a; }
.rt-played { display: flex; gap: 3px; margin-top: 4px; --rtcard: calc(var(--rtbase) * .6); }
.rt-countbox { position: static; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0; overflow: auto; }
.rt-pilerow { display: flex; align-items: flex-end; gap: 14px; --rtcard: calc(var(--rtbase) * .8); }
.rt-pile, .rt-count { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.rt-empty { width: var(--rtcard); height: calc(var(--rtcard) * var(--cardtall)); border: 1px dashed rgba(255,255,255,.35); border-radius: 6px; }
.rt-count b { font-size: calc(var(--rtcard) * .7); line-height: 1.2; min-width: 2ch; text-align: center; }
.rt-show { display: grid; gap: 6px; width: 100%; max-width: 560px; }
.rt-shown { display: grid; grid-template-columns: minmax(5em, auto) auto minmax(0, 1fr); align-items: center; gap: 2px 8px; padding: 3px 6px; border-radius: 6px; background: rgba(0,0,0,.18); font-size: 13px; }
.rt-showcards { display: flex; gap: 2px; --rtcard: calc(var(--rtbase) * .55); }
.rt-showcards .rt-card .st, .rt-played .rt-card .st { display: none; }
.rt-show .rt-go { justify-self: center; color: var(--ink); background: var(--panel); }
.rt-tally b { margin-left: 4px; }
.rt-seat { border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 6px 8px; min-width: 0; align-self: start; cursor: pointer; }
.rt-seat.top { grid-area: top; } .rt-seat.left { grid-area: left; align-self: center; } .rt-seat.right { grid-area: right; align-self: center; }
.rt-seat.me { grid-area: me; cursor: default; }
.rt-seat.acting { border-color: #f5d76e; box-shadow: 0 0 0 2px #f5d76e inset; }
.rt-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rt-tag { font-size: 12px; padding: 0 6px; border-radius: 9px; background: rgba(255,255,255,.16); }
.rt-name .msgbutton { font-size: 12px; padding: 1px 8px; margin-left: auto; color: var(--ink); background: var(--panel); }
.rt-tag.toplay { background: #f5d76e; color: #2a2622; } .rt-tag.wins { background: var(--accent); color: var(--on-accent); }
.rt-nums { display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: 13px; opacity: .9; }
.rt-backs { display: flex; margin-top: 4px; }
.rt-mini { width: 9px; height: 16px; border-radius: 2px; margin-right: -3px; background: repeating-linear-gradient(45deg, #7b2f26 0 3px, #a8473a 3px 6px); border: 1px solid rgba(255,255,255,.5); }
.rt-trick { grid-area: mid; position: relative; min-height: calc(var(--rtcard) * 2.9); }
.rt-spot { position: absolute; transform: translate(-50%, -50%); }
.rt-spot.me { left: 50%; top: 78%; } .rt-spot.top { left: 50%; top: 22%; } .rt-spot.left { left: 22%; top: 50%; } .rt-spot.right { left: 78%; top: 50%; }
.rt-mid { position: absolute; left: 0; top: 0; font-size: 13px; max-width: 45%; }
.rt-broken { margin-top: 4px; font-weight: 600; }
/* card size from the width and the height (the user, 2026-11-10, on a phone: "silly amounts of space wasted") */
#rt { --rtbase: clamp(48px, min(16vw, 9vh), 140px); --rtcard: var(--rtbase); }
/* the pegging board: wood, pegs one colour a lane (both themes: the felt doesn't change) */
:root { --board-wood: #8a5a2b; --board-ink: #fff8ec; --peg-a: #e0483a; --peg-b: #3a7be0; --peg-c: #f2d14b; --peg-d: #f4f4f4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --board-wood: #6b4521; --board-ink: #fff3e0; --peg-a: #ff6a5c; --peg-b: #6ba2ff; --peg-c: #f7dc6f; --peg-d: #e8e8e8; } }
:root[data-theme="dark"] { --board-wood: #6b4521; --board-ink: #fff3e0; --peg-a: #ff6a5c; --peg-b: #6ba2ff; --peg-c: #f7dc6f; --peg-d: #e8e8e8; }
.rt-card { position: relative; width: var(--rtcard); height: calc(var(--rtcard) * var(--cardtall)); padding: 0; min-height: 0; border-radius: 6px; border: 1px solid #9a927f;
  background: #fbfaf6; color: #1d1d1d; font-weight: 700; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.rt-card.red { color: #b3221a; }
.rt-card .rk { position: absolute; left: 5px; top: 3px; font-size: calc(var(--rtcard) * .26); line-height: 1; }
.rt-card .st { position: absolute; left: 5px; top: calc(var(--rtcard) * .3); font-size: calc(var(--rtcard) * .22); line-height: 1; }
.rt-card .big { position: absolute; right: 6px; bottom: 4px; font-size: calc(var(--rtcard) * .5); line-height: 1; }
.rt-card.back { background: repeating-linear-gradient(45deg, #7b2f26 0 6px, #a8473a 6px 12px); }
.rt-card.dim { filter: grayscale(.4) brightness(.7); }
.rt-card.lift { transform: translateY(-6px); }
.rt-card[tabindex="-1"] { cursor: default; }
.rt-hand { grid-column: 1; padding: 6px 16px 10px; background: var(--felt-mine); color: var(--felt-ink); }
.rt-fan { min-width: 0; overflow: hidden; display: flex; padding-top: 8px; min-height: calc(var(--rtcard) * var(--cardtall) + 8px); }
@media (hover: hover) { .rt-fan .rt-card:not(.dim):not([tabindex="-1"]):hover { transform: translateY(-8px); z-index: 1; } }
.rt-chosen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.rt-go { font-weight: 600; }
/* Pass 3 on the felt: the felt's light text on a light button was all but invisible; dark on the panel, as the show's buttons */
.rt-chosen .rt-go { color: var(--ink); background: var(--panel); }
.rt-hint { font-size: 14px; padding-top: 4px; }
.rt-note { grid-column: 1; min-height: 0; padding: 0 16px; color: var(--accent); font-weight: 600; background: var(--felt-mine); }
.rt-note:empty { display: none; }
.rt-log { display: none; }
/* pass and play's cover (ui/rounds.js coverbox): the table hidden until the next player says it's them */
#rt.covered { grid-template-rows: auto 1fr; }
.rt-cover { grid-column: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px 16px; text-align: center; background: var(--felt); color: var(--felt-ink); }
.rt-cover h2 { margin: 0; font-size: clamp(28px, 7vw, 48px); }
.rt-cover p { margin: 0; max-width: 36em; }
.rt-coverstatus { font-weight: 600; }
.rt-coverscores { display: flex; flex-direction: column; gap: 2px; opacity: 0.9; }
.rt-coverlog { list-style: none; margin: 0; padding: 8px 12px; max-width: 36em; font-size: 14px; opacity: 0.85; border-radius: 6px; background: rgba(0, 0, 0, 0.15); }
.rt-cover .rt-note { background: none; padding: 0; }
.rt-cover #rtreveal { font-size: 20px; padding: 12px 24px; color: var(--ink); background: var(--panel); }
.rt-coverundo { color: var(--ink); background: var(--panel); opacity: 0.85; }
#rt.logopen .rt-log { display: block; grid-column: 2; grid-row: 2 / span 3; overflow: auto; border-left: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.rt-log ol { list-style: none; margin: 0; padding: 8px 10px; }
.rt-log li { padding: 1px 0; } .rt-log li.heading { font-weight: 700; margin-top: 6px; } .rt-log li.em { font-weight: 600; }
.rt-inline { font-weight: 700; } .rt-inline.red { color: #b3221a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rt-inline.red { color: #ff7a6b; } }
:root[data-theme="dark"] .rt-inline.red { color: #ff7a6b; }
@media (max-width: 640px) {
  #rt.logopen { grid-template-columns: minmax(0, 1fr); }
  #rt.logopen .rt-log { grid-column: 1; grid-row: auto; max-height: 30vh; border-left: 0; border-top: 1px solid var(--line); }
  .rt-table { padding: 8px; gap: 6px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); }
  .rt-seat { padding: 4px 6px; }
  .rt-seat.top, .rt-seat.me { justify-self: center; }
  .rt-nums { font-size: 12px; }
  .rt-bar .rt-status { order: 10; flex-basis: 100%; }
  .rt-shown { grid-template-columns: minmax(0, 1fr); }

  .rt-pilerow { gap: 8px; justify-content: center; }
  .rt-lane { grid-template-columns: minmax(40px, 6em) 1fr 3ch; }
}

/* the round table's online games (ui/rounds.js): Play others online, Open games, Your games, an invite, waiting for seats */
.rt-online h2 { margin-top: 1.2em; }
.rt-play { display: grid; gap: 8px; }
.rt-play label { margin-bottom: -4px; }
.rt-onlineerror:empty { display: none; }
.rt-offers ul, .rt-mine ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.rt-offers li, .rt-mine li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt-mine .opengame { flex: 1; display: grid; text-align: left; }
.rt-seatlist li.empty, .seatlist li.empty { color: var(--muted, #777); font-style: italic; }
.rt-waiting .invitelink { min-width: 0; width: 100%; }
.rt-saved { font-size: 0.9em; opacity: 0.8; }
/* counting by hand (Cribbage's Count it yourself) */
.rt-claim { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }
.rt-claimbuttons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rt-claimbutton { font-weight: 600; background: #f5d76e; color: #2a2622; }
.rt-claim .rt-go { color: var(--ink); background: var(--panel); }
.rt-claimed { font-size: 13px; }
.rt-option { white-space: nowrap; }
.rt-shown.claiming { outline: 2px solid #f5d76e; }
.rt-missed { display: block; color: #ffb3ad; font-size: 12px; }
.rt-tag.counting { background: #f5d76e; color: #2a2622; }
.rt-steal .rt-claimbutton { background: #e8a87c; }
.rt-shown.stealing { outline: 2px dashed #e8a87c; }
.rt-stolen { display: block; color: #f5c9a8; font-size: 12px; }
.rt-wrongsteal { display: block; color: #ffb3ad; font-size: 12px; }

/* the site's messages at the table (ootv-claude ONLINE-PLAY-MESSAGING.md): the unread count on ☰, Send to…, Message,
   Report on another player's chat line */
.sitemenu { position: relative; }
.sitemenu[data-unread]::after { content: attr(data-unread); position: absolute; top: -5px; right: -7px; min-width: 15px; padding: 0 3px;
  border-radius: 8px; background: #c00; color: #fff; font: bold 10px/15px system-ui, sans-serif; text-align: center; pointer-events: none; }
.sendto { margin-top: 8px; }
.sendto .sendtofind, .sendto .sendtonote { width: 100%; box-sizing: border-box; margin: 4px 0; font-size: 14px; }
.sendtolist { list-style: none; margin: 4px 0; padding: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.sendtolist li { border-bottom: 1px solid var(--line); }
.sendtolist li:last-child { border-bottom: 0; }
.sendtolist li.empty { padding: 6px 8px; font-size: 14px; color: var(--muted); }
.sendtopick { display: flex; width: 100%; gap: 8px; justify-content: space-between; align-items: baseline; padding: 6px 8px; border: 0; border-radius: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.sendtopick:hover, .sendtopick:focus-visible { background: var(--hover, rgba(127, 127, 127, .15)); }
.sendtohow { font-size: 12px; color: var(--muted); }
.sendtostatus, .waitingnote { font-size: 14px; margin: 4px 0; }
#log .reportline { margin-left: 6px; padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; opacity: .5; }
#log li:hover .reportline, #log .reportline:focus-visible { opacity: 1; }
