/* Planetbreaker Table. Plain CSS, no build step. */
:root {
  /* Dusk Paperback (5 Nov 2026): colours sampled from the General PB Art paintings, after Tim White's covers. */
  --bg: #0E0A1C;      /* void: space above the horizon */
  --panel: #1E1738;   /* dusk: the sky an hour after sunset */
  --line: #3A2E5C;
  --ink: #F1E6D0;     /* bone: the cover plate */
  --muted: #A497C4;   /* haze: cloud shadow */
  --amber: #F2C46D;   /* sunglow: highlights, the active turn */
  --peach: #F4B48A;   /* horizon: the primary action */
  --teal: #4FB9B5;    /* lagoon: links, on and done states */
  --danger: #E36F5A;  /* ember: attack, damage, danger */
  --f-disp: Michroma, "Eurostile", "Arial Black", sans-serif;
  --f-body: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --f-num: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --side: 340px;
  --right: 300px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--f-body); }
button, input, select { font: inherit; }
button { background: var(--teal); color: #0E0A1C; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-weight: 600; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .4; cursor: default; }
input, select { background: #0E0A1C; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; }
h1 { font: 700 20px/1.1 var(--f-disp); letter-spacing: 1px; text-transform: uppercase; margin: 0 0 4px; }
h2 { font: 600 13px/1 var(--f-disp); letter-spacing: 2px; text-transform: uppercase; color: var(--amber); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
h2 .muted { font: 400 11px/1 var(--f-body); letter-spacing: 0; text-transform: none; flex: 1; }
.muted { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.row { display: flex; gap: 6px; }
.row button { flex: 1; padding: 6px 0; }

#app { display: flex; height: 100%; }
#side { width: var(--side); flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
#side header, #side section, #side footer { padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
#side footer { border-bottom: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: auto; position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 2; }
#right { width: var(--right); flex: none; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
#right section { padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
#right #logsec { flex: 1 1 0; display: flex; flex-direction: column; min-height: 220px; border-bottom: 0; }
#right #oppsec { max-height: 45%; overflow-y: auto; }
#right #log { flex: 1; max-height: none; }

/* the game: name, host, house rules, result (lobby games) */
#right #gameinfo { padding: 10px 14px; border-bottom: 1px solid var(--line); }
#gameinfo[hidden] { display: none; }
#gameinfo h2 { color: var(--ink); font-size: 15px; letter-spacing: 1px; }
.gchips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.gchip { font-size: 11px; padding: 3px 7px; border-radius: 6px; background: rgba(242, 196, 109, .1); color: #F4D394; border: 1px solid rgba(242, 196, 109, .25); }
.gchip.plain { background: transparent; color: var(--muted); border-color: var(--line); }
.gres { font-weight: 700; color: var(--amber); margin-bottom: 6px; }
.tolobby { display: inline-block; font-size: 12px; color: var(--teal); text-underline-offset: 3px; margin: 2px 0 4px; }
.gover { text-align: center; padding: 10px 6px 4px; }
.gover .k { font: 600 12px/1 var(--f-disp); letter-spacing: 3px; text-transform: uppercase; color: var(--amber); }
.gover h3 { font: 700 34px/1.1 var(--f-disp); text-transform: uppercase; margin: 8px 0; }
.egpick { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.egp { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; cursor: pointer; }
.egp input { width: 20px; height: 20px; accent-color: var(--amber); }
.egp .muted { margin-left: auto; font-size: 12px; }
#egnote { margin-bottom: 8px; }
.egbtns { display: flex; justify-content: flex-end; }

/* turn tracker, glow and banner */
#turn .num { font: 700 28px/1 var(--f-num); }
#turn .num .muted { font: 400 13px/1 var(--f-body); margin-left: 8px; }
#turn .whose { margin: 8px 0; padding: 6px 10px; border-radius: 8px; border-left: 6px solid var(--c, var(--line)); background: #0E0A1C; font-weight: 600; }
#turn .whose.mine { box-shadow: 0 0 0 1px var(--c) inset, 0 0 18px -4px var(--c); }
#turn .go { width: 100%; padding: 10px; font-size: 15px; }
#turn .start { display: flex; gap: 6px; flex-wrap: wrap; }
#glow { position: fixed; inset: 0; pointer-events: none; z-index: 45; box-shadow: inset 0 0 70px 14px var(--glow, transparent); opacity: 0; transition: opacity .6s; }
/* The edge is bright as a turn begins, then (Theo, 18 Nov 2026: "quite unpleasant to look at the boundaries of the
   screen") it leaves your own turn alone: a faint still rim, and the End turn button carries the reminder instead.
   On an opponent's turn the rim stays, steady, in their colour. */
#glow.flash { opacity: 1; }
#glow.mine { opacity: .1; transition: opacity 1.6s; }
#glow.theirs { opacity: .55; transition: opacity 1.2s; }
#turn .go { box-shadow: 0 0 0 1px var(--c, var(--amber)), 0 0 14px -2px var(--c, var(--amber)); animation: gopulse 2.6s ease-in-out infinite; }
@keyframes gopulse { 50% { box-shadow: 0 0 0 1px var(--c, var(--amber)), 0 0 26px 2px var(--c, var(--amber)); } }
@media (prefers-reduced-motion: reduce) { #turn .go { animation: none; } }
#turnbanner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: rgba(14, 10, 28,.92); border: 2px solid var(--c, var(--amber)); border-radius: 14px; padding: 12px 28px; font: 700 26px/1.2 var(--f-disp); text-transform: uppercase; letter-spacing: 2px; pointer-events: none; text-align: center; z-index: 5; }
#turnbanner[hidden] { display: none; }
#turnbanner .sub { font: 400 13px/1 var(--f-body); color: var(--muted); letter-spacing: 0; text-transform: none; margin-top: 4px; }
.seat.active { box-shadow: 0 0 0 1px var(--c) inset; }
.seat.active .who::after { content: " · turn"; color: var(--amber); font-weight: 400; font-size: 11px; }

/* other players' public tables */
.opp { border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; }
.opp.active { box-shadow: 0 0 14px -4px var(--c); }
.opp .top { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; cursor: pointer; }
.opp .top b { font-weight: 600; }
.opp .sub { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.opp .cards { display: flex; gap: 4px; flex-wrap: wrap; }
.opp .cards .c { width: 40px; text-align: center; font-size: 9px; color: var(--muted); }
.opp .cards img { width: 40px; border-radius: 3px; display: block; cursor: pointer; }

#roomline { font-size: 13px; color: var(--muted); }
#roomline b { color: var(--ink); font-family: Consolas, monospace; }
#copylink { padding: 2px 8px; font-size: 12px; margin-left: 6px; }
#conn { font-size: 12px; margin-top: 2px; }
#conn.on { color: #22C55E; } #conn.off { color: var(--danger); }
#whoami { font-size: 12px; margin-top: 2px; }
#whoami:empty { display: none; }

/* seats */
#seats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.seat { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; border-left-width: 6px; min-height: 40px; cursor: pointer; }
.seat.me { background: #2A2147; }
.seat.away { opacity: .55; }
.seat .who { font-weight: 600; font-size: 13px; }
.seat .home { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.seat .counts { color: var(--muted); font-size: 11px; }
#sitform { display: flex; flex-direction: column; gap: 6px; }
body.seated #sitform { display: none; }
#stand { display: none; }
body.seated #stand { display: inline-block; }

/* mat */
#matsec { display: none; }
body.hasdeck #matsec { display: block; }
#res { display: flex; gap: 6px; margin-bottom: 8px; }
.resbox { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; text-align: center; }
.resbox .k { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resbox .v { font: 700 22px/1 var(--f-num); }
.resbox .ore { color: #D97B2A; } .resbox .crys { color: #8E6BFF; } .resbox .pp { color: var(--amber); }
/* Planet Points are the Colony's colour, the planet that scores them (Theo, 12 Nov 2026). Written to win over brand.css. */
body .resbox .v.pp, body .mchip.pp b, body #mrespop .v.pp { color: #4FD1A5; }
.resbox .b { display: flex; justify-content: space-between; margin-top: 2px; }
.resbox .b button { padding: 0 8px; font-size: 14px; line-height: 20px; }
#libline { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
#libcount { font-weight: 600; margin-right: 4px; border-style: dashed; }
#zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.zone { text-align: center; font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.zone .slot { width: 100%; aspect-ratio: 411 / 561; border: 1px dashed var(--line); border-radius: 6px; background: #0E0A1C; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; position: relative; }
.zone .slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zone .slot .n { position: absolute; right: 3px; bottom: 3px; background: rgba(0,0,0,.7); color: var(--ink); font: 600 12px/1 var(--f-body); padding: 2px 5px; border-radius: 4px; }
.zone .slot.drop { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber) inset; }
#playedzone { grid-column: 1 / -1; text-align: left; margin-top: 4px; }
#played { display: flex; gap: 6px; flex-wrap: wrap; align-content: flex-start; min-height: 96px; padding: 6px; border: 1px dashed var(--line); border-radius: 6px; background: #0E0A1C; }
#played.drop { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber) inset; }
#played .empty { margin: auto; font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--muted); }
#played img { width: 60px; border-radius: 4px; cursor: pointer; display: block; }
#played .pc, .zone .slot, .opp .cards .c { position: relative; }
.cnt { position: absolute; left: 2px; top: 2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--teal); color: #0E0A1C; font: 700 12px/20px var(--f-body); text-align: center; padding: 0 5px; pointer-events: none; box-shadow: 0 0 0 2px #0E0A1C; }

/* box tray */
#traybody { display: flex; flex-direction: column; gap: 6px; }
#traybody[hidden] { display: none; }
#tray { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 220px; overflow-y: auto; }
.tok { text-align: center; cursor: grab; user-select: none; touch-action: pan-y; border-radius: 8px; padding: 2px; }
.tok.armed { background: var(--amber); }
.tok.armed span { color: #0E0A1C; font-weight: 600; }
.tok img { width: 100%; aspect-ratio: 1; border-radius: 50%; display: block; pointer-events: none; }
.tok span { display: block; font-size: 10px; line-height: 1.1; color: var(--muted); margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* log */
#log { overflow-y: auto; font-size: 12px; color: #BFC7D5; max-height: 180px; min-height: 60px; }
#log div.ruling { color: var(--amber); background: rgba(242, 196, 109,.08); font-weight: 600; }
#sayform input { flex: 1; min-width: 0; }
.rul { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.rul .rq { margin-bottom: 4px; }
.rul .rctx { font-size: 12px; color: var(--muted); margin-bottom: 6px; border-left: 2px solid var(--line); padding-left: 8px; }
.rul form { display: flex; gap: 6px; }
#log div { padding: 2px 0 2px 6px; border-bottom: 1px dotted #1F2740; border-left: 3px solid transparent; }
#sayform { display: flex; gap: 6px; margin-top: 6px; }

/* board */
#view { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; flex: 1; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #1E1738 0%, var(--bg) 70%); touch-action: none; cursor: grab; }
#view.panning { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }   /* width and height come from the chosen board (loadBoard) */
#board, #hexes { position: absolute; left: 0; top: 0; pointer-events: none; }
#hexes polygon { fill: transparent; stroke: rgba(127,216,255,.35); stroke-width: 2; }
/* While a unit is held: where it can go (teal), and where it could go for 1 Ore (amber, dashed). */
#hexes.reaching polygon { stroke-opacity: .35; }
#hexes polygon.reach { fill: #4FD1A5; fill-opacity: .2; stroke: #4FD1A5; stroke-opacity: 1; stroke-width: 3; }
#hexes polygon.reach2 { fill: #F2C46D; fill-opacity: .1; stroke: #F2C46D; stroke-opacity: .9; stroke-width: 2; stroke-dasharray: 8 6; }
#hexes polygon.asteroid { stroke: rgba(255,120,120,.25); stroke-dasharray: 6 6; }
#hexes polygon.homeworld { fill: var(--home, transparent); fill-opacity: .3; stroke: var(--home, rgba(127,216,255,.35)); stroke-width: 4; }
#hexes polygon.captured { stroke: var(--cap); stroke-width: 6; fill: var(--cap); fill-opacity: .2; }
#hexes polygon.contested { stroke-dasharray: 18 10; stroke-width: 10; stroke: var(--cap, #F1E6D0); }
#hexes polygon.nullified { fill: #8C8C8C; fill-opacity: .65; }
#hexes polygon.destroyed { fill: #000; fill-opacity: .6; }
#hexes polygon.target { fill: rgba(242, 196, 109,.35); fill-opacity: 1; stroke: var(--amber); stroke-width: 6; }
.peekbar { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.peekbar table.help { border-collapse: collapse; width: 100%; font-size: 14px; }
table.help td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.help td:first-child { white-space: nowrap; color: var(--amber); width: 1%; }
.zhead { margin: 0; flex: 1; }
#pieces { position: absolute; left: 0; top: 0; }
/* The Fight button (14 Nov 2026): on a hex where your units meet another side's. Same size on screen at any zoom. */
.fightbtn { position: absolute; z-index: 6; display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px 9px 12px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #F0705F, #C93C33); color: #fff; font: 600 16px/1 var(--f-disp, system-ui), system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 0 0 2px rgba(14, 10, 28, .85), 0 6px 18px rgba(0, 0, 0, .55); cursor: pointer; touch-action: manipulation;
  transform: scale(calc(1 / var(--sc, 1))) translate(-50%, calc(-100% - 4px)); transform-origin: 0 0; }   /* sits just above the hex, so the units stay in view */
.fightbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fightbtn:hover { background: linear-gradient(180deg, #F5826F, #D2463C); }
.fightbtn:focus-visible { outline: 3px solid var(--amber, #E8A33D); outline-offset: 2px; }
.fightbtn:disabled { opacity: .6; }
@media (prefers-reduced-motion: no-preference) { .fightbtn { animation: fightpulse 1.8s ease-in-out infinite; } }
@keyframes fightpulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(14, 10, 28, .85), 0 6px 18px rgba(0, 0, 0, .55), 0 0 0 0 rgba(240, 112, 95, .55); } 50% { box-shadow: 0 0 0 2px rgba(14, 10, 28, .85), 0 6px 18px rgba(0, 0, 0, .55), 0 0 0 10px rgba(240, 112, 95, 0); } }
@media (max-width: 760px), (max-height: 500px) { .fightbtn { font-size: 16px; padding: 11px 16px 11px 13px; } }
.piece { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; cursor: grab; user-select: none; touch-action: none; box-shadow: 0 0 0 6px var(--seat, #fff), 0 6px 16px rgba(0,0,0,.6); transition: transform .12s; }
.piece img { width: 100%; height: 100%; border-radius: 50%; display: block; pointer-events: none; object-fit: cover; }
.piece.card { border-radius: 8px; width: 96px; height: 131px; margin: -65px 0 0 -48px; }
.piece.card img { border-radius: 8px; }
.piece { transform: scale(var(--s, 1)); }
/* The board is turned so your own Homeworld is at the bottom (app.js, --rot). What stands on it turns back. */
#world .piece, #world .fxhome, #world .fightbtn, #world .ogm { rotate: calc(var(--rot, 0deg) * -1); }
.piece.stacked .lbl { display: none; }
.piece.infected::after { content: "\2623"; position: absolute; left: -10px; bottom: -6px; width: 40px; height: 40px; border-radius: 50%; background: var(--seat); color: #0E0A1C; font: 700 28px/40px sans-serif; text-align: center; box-shadow: 0 0 0 3px #0E0A1C; pointer-events: none; }
.piece.docked { filter: saturate(.75); }
.piece.docked::before { content: "\2693"; position: absolute; right: -8px; top: -8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; background: var(--seat); color: #0E0A1C; font: 700 18px/30px var(--f-num, sans-serif); text-align: center; box-shadow: 0 0 0 2px #0E0A1C; }
.piece.stacked.infected::after { transform: scale(1.5); transform-origin: bottom left; }
.piece.stacked .dmg { transform: scale(1.6); transform-origin: top right; }
.piece.dragging { --s: 1; transition: none; z-index: 10; cursor: grabbing; box-shadow: 0 0 0 6px var(--seat, #fff), 0 20px 40px rgba(0,0,0,.8); }
.piece.tapped { transform: scale(var(--s, 1)) rotate(90deg); filter: saturate(.5); }
.piece .lbl { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); white-space: nowrap; font-size: 18px; color: var(--ink); text-shadow: 0 1px 4px #000, 0 0 10px #000; pointer-events: none; }
.piece .dmg { position: absolute; right: -10px; top: -10px; min-width: 36px; height: 36px; border-radius: 18px; background: var(--danger); color: #fff; font: 700 22px/36px var(--f-num); text-align: center; padding: 0 6px; pointer-events: none; display: none; }
.piece.hurt .dmg { display: block; }
#hover { position: absolute; left: 12px; bottom: 150px; font-size: 13px; font-family: Consolas, monospace; pointer-events: none; }
#armbar { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 8px 8px 8px 14px; border-radius: 10px;
  background: #2E2210; border: 1px solid var(--amber); color: var(--amber); font: 600 14px/1.3 var(--f-body);
  box-shadow: 0 6px 24px rgba(0,0,0,.5); }
#armbar[hidden] { display: none; }
#armbar button { flex: none; min-height: 36px; padding: 0 16px; border-radius: 8px; border: 0; background: var(--amber); color: #1A1204; font: 700 14px var(--f-body); cursor: pointer; }

/* hand */
#hand { position: absolute; left: 0; right: 0; bottom: 0; height: 140px; display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; background: linear-gradient(180deg, transparent, rgba(14, 10, 28,.9) 30%); align-items: flex-end; touch-action: pan-x; }
#hand:empty { display: none; }
.hcard { flex: none; width: 90px; height: 123px; border-radius: 6px; overflow: hidden; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.6); transition: transform .1s; position: relative; background: #2A2147; }
.hcard:hover { transform: translateY(-8px); }
.hcard.armed { outline: 3px solid var(--amber); transform: translateY(-8px); }
.hcard img { width: 100%; height: 100%; display: block; pointer-events: none; }
.hcard .nm { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; padding: 2px 4px; background: rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* desktop: bigger hand, hover preview */
#preview { position: fixed; z-index: 75; width: 340px; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.8); pointer-events: none; display: none; }
@media (min-width: 761px) and (min-height: 501px) {
  #hand { height: 190px; }
  .hcard { width: 124px; height: 169px; }
  .hcard .nm { font-size: 12px; }
  #hover { bottom: 200px; }
}

/* dice */
#dice { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); background: rgba(14, 10, 28,.92); border: 2px solid var(--amber); border-radius: 14px; padding: 10px 22px; text-align: center; pointer-events: none; }
#dice .who { font-size: 13px; color: var(--muted); }
#dice .pips { font: 700 56px/1 var(--f-num); color: var(--amber); letter-spacing: 6px; }

/* popover menu and modal */
#menu { position: fixed; z-index: 80; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 170px; box-shadow: 0 12px 40px rgba(0,0,0,.7); display: flex; flex-direction: column; gap: 2px; }
#menu[hidden] { display: none; }
#menu .t { font-size: 12px; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
#menu .t.mhead { margin-top: 6px; border-top: 1px solid var(--line); color: var(--amber); }   /* a group heading in a menu: Fix by hand (admin), 19 Nov 2026 */
#menu button { background: transparent; color: var(--ink); text-align: left; font-weight: 500; padding: 7px 10px; border-radius: 6px; }
#menu button:hover { background: #2A2147; }
#menu button.danger { color: var(--danger); }
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal[hidden] { display: none; }
#modalbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; max-width: 920px; max-height: 100%; overflow: auto; padding: 14px; width: 100%; }
#modalclose { float: right; }
/* single-card view sits above any open pop-up, so View never replaces the scry, zone or seat view (Theo, 30 Oct) */
#cardover { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
#cardover[hidden] { display: none; }
#cardbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; max-width: 760px; max-height: 100%; overflow: auto; padding: 14px; width: 100%; }
#cardclose { float: right; }
.cardview { display: flex; gap: 16px; flex-wrap: wrap; }
.cardview img { width: 300px; max-width: 100%; border-radius: 10px; }
.cardview .txt { flex: 1; min-width: 220px; font-size: 14px; }
.cardview .txt h3 { margin: 0 0 4px; font-family: var(--f-disp); font-size: 22px; }
.cardview .stats { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.zgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.zgrid img { width: 100%; border-radius: 6px; cursor: pointer; }
.zgrid.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.scry { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; justify-content: center; }
.zgrid .cap { font-size: 11px; color: var(--muted); text-align: center; }
.zhead { font: 600 13px/1 var(--f-disp); letter-spacing: 2px; text-transform: uppercase; color: var(--amber); margin: 14px 0 8px; }

#ghost { position: fixed; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; pointer-events: none; z-index: 100; opacity: .9; box-shadow: 0 10px 30px rgba(0,0,0,.7); object-fit: cover; }

/* ---------------------------------------------------------------- phone (Theo, 1 Nov 2026)
   A phone is a controller for one player: onboarding (name, faction, deck), then the board, the hand and
   the turn. A thin bar on top, the hand along the bottom with the deck pile at its left, one round button
   that fans into Mat, Players, Dice. Hosting and record-keeping stay on desktop. Desktop never sees this. */
#mbar, #mfab, #mscrim, #mrespop, #mdeck, #mcard, #monboard, .sheethead { display: none; }
@media (max-width: 760px), (max-height: 500px) {
  :root { --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --ease-out: cubic-bezier(.16, 1, .3, 1); --card-r: 411 / 561; }
  #app { display: block; }
  #view { position: fixed; inset: 0; height: auto; }
  ::selection { background: var(--amber); color: #1A1204; }

  /* desktop-only parts: hosting, record-keeping, the mat's own counters (the top bar has them) */
  #side header, #setupsec, #seatsec, #res, #libline, #traysec, #side footer, #turnsec, #logsec, #matsec > h2 { display: none !important; }

  /* ------------------------------------------------ onboarding */
  #monboard { display: flex; position: fixed; inset: 0; z-index: 90; padding: calc(28px + var(--safe-t)) 20px calc(24px + var(--safe-b)); overflow-y: auto; overscroll-behavior: contain;
    background: radial-gradient(120% 70% at 50% 0%, rgba(79, 185, 181, .14), transparent 60%), linear-gradient(180deg, rgba(14, 10, 28, .78), var(--bg) 70%), url(assets/board.png) 50% 20% / 160% auto no-repeat, var(--bg); }
  #monboard[hidden] { display: none; }
  .obstep { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 440px; margin: 0 auto; animation: obin .45s var(--ease-out); }
  .obstep[hidden] { display: none; }
  .obstep[data-step="name"] { justify-content: center; min-height: 100%; }
  @keyframes obin { from { opacity: 0; transform: translateY(14px); } }
  .obbrand { font: 700 40px/1 var(--f-disp); letter-spacing: 5px; text-transform: uppercase; color: var(--ink); text-shadow: 0 4px 30px rgba(79, 185, 181, .35); margin-bottom: 18px; }
  .obq { display: block; font: 600 22px/1.2 var(--f-body); color: var(--ink); letter-spacing: 0; text-transform: none; margin: 0; text-wrap: balance; }
  .obsub { font: 600 13px/1 var(--f-disp); letter-spacing: 2px; text-transform: uppercase; color: var(--amber); margin: 6px 0 0; }
  #obname { height: 56px; font-size: 20px; padding: 0 16px; border-radius: 14px; background: rgba(14, 10, 28, .8); border: 1px solid var(--line); caret-color: var(--amber); }
  #obname:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 196, 109, .25); }
  .obgo { height: 56px; border-radius: 14px; font-size: 17px; background: var(--amber); color: #1A1204; box-shadow: 0 8px 24px rgba(242, 196, 109, .25); }
  .obgo:disabled { opacity: .35; box-shadow: none; }
  .obnote { color: var(--amber); font-size: 14px; margin: 0; min-height: 1em; }
  .obgame { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: rgba(30, 23, 56, .85); border: 1px solid var(--line); margin-bottom: 6px; }
  .obgame[hidden] { display: none; }
  .obgame b { font: 700 18px/1.1 var(--f-disp); letter-spacing: .5px; text-transform: uppercase; }
  .obgame span { font-size: 13px; color: var(--muted); }
  .obdiscord { display: grid; place-items: center; height: 54px; border-radius: 14px; background: #5865F2; color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; }
  .obdiscord[hidden], .obor[hidden] { display: none; }
  .obor { text-align: center; color: var(--muted); font-size: 13px; }
  .oblobby { align-self: center; color: var(--teal); font-size: 14px; text-underline-offset: 3px; margin-top: 8px; }
  #right #gameinfo { padding: 4px 18px 10px; border-bottom: 0; }
  .tolobby { display: none; }
  .gover .tolobby { display: inline-block; font-size: 15px; margin-top: 10px; }
  .obback { align-self: flex-start; margin: -6px 0 -4px -8px; }
  .obfline { margin: -4px 0 4px; color: var(--muted); font-size: 15px; line-height: 1.45; text-wrap: pretty; }
  #obfactions, .oblist { display: flex; flex-direction: column; gap: 10px; }
  #obfactions[hidden], #obdecks[hidden] { display: none; }
  #obdecks { display: flex; flex-direction: column; gap: 10px; }
  .obrow { display: flex; align-items: stretch; gap: 0; padding: 0; min-height: 104px; overflow: hidden; border-radius: 16px; background: rgba(30, 23, 56, .92); border: 1px solid var(--line); color: var(--ink); text-align: left; font-weight: 400; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); transition: transform .2s var(--ease-out), border-color .2s; }
  .obrow:active { transform: scale(.98); border-color: var(--amber); }
  .obrow .art { flex: none; width: 96px; position: relative; overflow: hidden; }
  /* zoom into the card's art band (about 17% to 45% down the card) rather than showing the whole card */
  .obrow .art img { position: absolute; width: 290px; max-width: none; left: -108px; top: 50%; margin-top: -132px; }
  .obrow .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, rgba(30, 23, 56, .92)); }
  .obrow .txt { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 12px 14px 12px 10px; min-width: 0; }
  .obrow b { font: 700 17px/1.1 var(--f-disp); letter-spacing: .5px; text-transform: uppercase; }
  .obrow b em { font: 600 10px/1 var(--f-body); font-style: normal; letter-spacing: .8px; text-transform: uppercase; color: #1A1204; background: var(--teal); border-radius: 6px; padding: 3px 6px; margin-left: 6px; vertical-align: 2px; }
  .obrow i { font-style: normal; font-size: 11px; letter-spacing: .3px; color: var(--amber); }
  .obrow .line { font-size: 14px; line-height: 1.4; color: #D8CDE6; margin-top: 2px; }
  .obrow.locked .art img { filter: grayscale(.7) brightness(.55); }
  .obrow.locked b { color: var(--muted); }
  .obrow.locked b em { background: transparent; color: var(--amber); box-shadow: inset 0 0 0 1px currentColor; display: inline-flex; align-items: center; gap: 4px; }
  .obrow.locked .lk { width: 11px; height: 11px; }
  .obrow.locked .line { color: var(--muted); }
  .obrow.obdeck.locked:active { transform: none; border-color: var(--line); }
  #obwhy:empty { display: none; }

  /* ------------------------------------------------ top bar */
  #mbar { display: flex; align-items: center; gap: 6px; position: fixed; z-index: 40; left: 8px; right: 8px; top: calc(8px + var(--safe-t)); height: 48px; padding: 0 6px; background: rgba(30, 23, 56, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
  .mturn { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1 1 auto; height: 36px; padding: 0 8px; background: transparent; color: var(--ink); font-weight: 600; font-size: 13px; border-radius: 10px; }
  .mturn .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
  .mturn .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mturn.mine .dot { box-shadow: 0 0 0 3px rgba(255, 255, 255, .1), 0 0 12px 2px rgba(255, 255, 255, .35); }
  .mend { flex: none; height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; background: var(--amber); color: #1A1204; box-shadow: 0 2px 10px rgba(242, 196, 109, .35); }
  .mend[hidden] { display: none; }
  #mres { display: flex; gap: 2px; flex: none; }
  #mres[hidden] { display: none; }
  .mchip { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 42px; height: 40px; padding: 0; background: transparent; color: var(--muted); border-radius: 9px; font-weight: 500; }
  .mchip b { font: 700 18px/1 var(--f-num); font-variant-numeric: tabular-nums; }
  .mchip span { font-size: 9px; letter-spacing: .4px; text-transform: uppercase; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
  .mchip.ore b { color: #D97B2A; } .mchip.crys b { color: #A58CFF; } .mchip.pp b { color: var(--amber); } .mchip.fac b { color: var(--ink); }
  .mchip:active, .mturn:active { background: rgba(255, 255, 255, .06); }
  .mico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; background: transparent; color: var(--ink); border-radius: 10px; }
  .mico:disabled { color: var(--muted); opacity: .45; }

  /* resource stepper */
  #mrespop { display: flex; align-items: center; gap: 10px; position: fixed; z-index: 82; width: 168px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(0, 0, 0, .6); text-align: center; }
  #mrespop[hidden] { display: none; }
  #mrespop > div { flex: 1; }
  #mrespop button { width: 44px; height: 44px; padding: 0; border-radius: 12px; font-size: 22px; background: #2A2147; color: var(--ink); }
  #mrespop .k { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
  #mrespop .v { font: 700 26px/1.1 var(--f-num); font-variant-numeric: tabular-nums; }
  #mrespop .v.ore { color: #D97B2A; } #mrespop .v.crys { color: #A58CFF; } #mrespop .v.pp { color: var(--amber); }

  /* ------------------------------------------------ hand and deck pile */
  #hand { height: calc(116px + var(--safe-b)); padding: 10px 10px calc(10px + var(--safe-b)) 86px; gap: 8px; scrollbar-width: none; background: linear-gradient(180deg, transparent, rgba(14, 10, 28, .94) 26%); }
  #hand::-webkit-scrollbar { display: none; }
  #hand { touch-action: none; }   /* the hand scrolls itself on a phone, so a held card can be dragged any way (mobile.js) */
  .hcard.lifted { opacity: .25; transform: translateY(-8px) scale(.94); }
  .hcard { width: 70px; height: 96px; border-radius: 7px; transition: transform .2s var(--ease-out), opacity .2s; }
  .hcard:hover { transform: none; }
  .hcard:active { transform: translateY(-6px); }
  .hcard.lifted { opacity: .3; transform: translateY(-10px); }
  .hcard .nm { display: none; }
  #mdeck { display: block; position: fixed; z-index: 41; left: 12px; bottom: calc(14px + var(--safe-b)); width: 62px; height: 88px; padding: 0; background: transparent; }
  #mdeck[hidden] { display: none; }
  #mdeck .back, #mdeck .top { position: absolute; inset: 0; border-radius: 8px; border: 1px solid rgba(242, 196, 109, .55);
    background: radial-gradient(circle at 50% 46%, rgba(242, 196, 109, .0) 0 13px, rgba(242, 196, 109, .55) 14px 15px, transparent 16px), radial-gradient(circle at 50% 46%, rgba(79, 185, 181, .35), transparent 60%), linear-gradient(160deg, #1B2747, #0E0A1C); }
  #mdeck .back:nth-child(1) { transform: translate(-4px, 4px) rotate(-4deg); opacity: .55; }
  #mdeck .back:nth-child(2) { transform: translate(-2px, 2px) rotate(-2deg); opacity: .8; }
  #mdeck .top { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; box-shadow: 0 8px 18px rgba(0, 0, 0, .6); }
  #mdeck b { font: 700 20px/1 var(--f-num); color: var(--ink); font-variant-numeric: tabular-nums; }
  #mdeck i { font-style: normal; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
  #mdeck:active .top { transform: translateY(-3px); }
  #mdeck.empty .top { opacity: .4; }
  body:not(.hasdeck) #hand { padding-left: 10px; }

  #hover { top: calc(64px + var(--safe-t)); bottom: auto; left: 12px; right: 12px; font: 500 12px/1.35 var(--f-body); }
  #hover:not(:empty) { background: rgba(14, 10, 28, .85); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
  #dice { top: calc(70px + var(--safe-t)); }
  #turnbanner { font-size: 20px; padding: 10px 20px; }

  /* a card lifted out of the hand, under the finger */
  #mghost { animation: mlift .18s var(--ease-out); position: fixed; z-index: 100; width: 88px; aspect-ratio: var(--card-r); border-radius: 8px; pointer-events: none; transform: translate(-50%, -112%) rotate(-5deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .75); transition: transform .18s var(--ease-out), box-shadow .18s; }
  @keyframes mlift { from { transform: translate(-50%, -80%) scale(.7); opacity: .4; } }
  #mghost.over { transform: translate(-50%, -112%) rotate(0) scale(.82); box-shadow: 0 0 0 3px var(--amber), 0 18px 40px rgba(0, 0, 0, .75); }

  /* ------------------------------------------------ a card, big, with its actions */
  #mcard { display: flex; position: fixed; inset: 0; z-index: 72; align-items: flex-end; justify-content: center; padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b)); background: rgba(8, 5, 16, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
  #mcard[hidden] { display: none; }
  #mcard.on { opacity: 1; }
  .mcardin { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; }
  .mcardin img { width: min(70vw, 290px, calc(52dvh * 411 / 561)); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .7); transform: translateY(24px) scale(.92); transition: transform .4s var(--ease-out); }
  #mcard.on .mcardin img { transform: none; }
  .mcardname { font-size: 13px; color: var(--muted); text-align: center; }
  .mcardacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .mcardacts button { min-height: 48px; padding: 8px 10px; border-radius: 12px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
  .mcardacts button:active { background: #2A2147; }
  .mcardacts button.primary { grid-column: 1 / -1; background: var(--amber); color: #1A1204; border-color: transparent; font-size: 16px; }
  .mcardacts button.step { background: #2A2147; }
  .mcardacts button.danger { color: var(--danger); border-color: rgba(239, 68, 68, .5); }
  .mmore { grid-column: 1 / -1; background: transparent !important; border-style: dashed !important; color: var(--muted) !important; }
  .mmore[hidden] { display: none; }
  .mextra { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mextra[hidden] { display: none; }
  .mcardin { scrollbar-width: none; }
  .mcardin::-webkit-scrollbar { display: none; }
  .mcardx { position: sticky; top: 0; align-self: flex-end; margin-bottom: -50px; z-index: 2; background: rgba(30, 23, 56, .85); border-radius: 50%; }

  /* ------------------------------------------------ the round button and its half-wheel */
  #mfab { display: block; position: fixed; z-index: 56; right: 14px; bottom: calc(18px + var(--safe-b)); width: 60px; height: 60px; transition: bottom .3s var(--ease-out), opacity .2s; }
  body.hashand #mfab { bottom: calc(128px + var(--safe-b)); }
  body.sheet-open #mfab { opacity: 0; pointer-events: none; }
  #mfabbtn { position: relative; z-index: 2; display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border-radius: 50%; background: var(--amber); color: #1A1204; box-shadow: 0 10px 26px rgba(0, 0, 0, .55), 0 0 0 4px rgba(14, 10, 28, .65); transition: background .2s; }
  #mfabbtn svg { transition: transform .35s var(--ease-out); }
  #mfab.open #mfabbtn { background: var(--ink); }
  #mfab.open #mfabbtn svg { transform: rotate(135deg); }
  #mwheel { position: absolute; left: 30px; top: 30px; width: 0; height: 0; }
  /* Three spokes on a quarter arc: straight left, diagonal, straight up; radius 116px. Labels sit outward. */
  .mspoke { --a: calc(180deg + 45deg * var(--i)); position: absolute; left: 0; top: 0; width: 56px; height: 56px; margin: -28px 0 0 -28px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(0, 0, 0, .55);
    transform: rotate(var(--a)) translateX(0) rotate(calc(-1 * var(--a))) scale(.3); opacity: 0; pointer-events: none;
    transition: transform .42s var(--ease-out), opacity .25s ease-out; transition-delay: calc((2 - var(--i)) * 20ms); }
  #mfab.open .mspoke { transform: rotate(var(--a)) translateX(116px) rotate(calc(-1 * var(--a))) scale(1); opacity: 1; pointer-events: auto; transition-delay: calc(var(--i) * 35ms); }
  .mspoke span { position: absolute; left: 50%; top: 50%; transform: rotate(var(--a)) translateX(52px) rotate(calc(-1 * var(--a))) translate(var(--lx, -50%), -50%); font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--ink); white-space: nowrap; text-shadow: 0 1px 6px #000, 0 0 2px #000; pointer-events: none; }
  .mspoke[data-k=mat] span { --lx: -100%; }
  .mspoke[data-k=players] span { --lx: -90%; }
  .mspoke:active { background: #2A2147; border-color: var(--amber); }
  /* The host's fourth spoke (2 Nov): four on the same quarter arc, 30deg apart, a little further out. */
  .mspoke[hidden] { display: none; }
  #mfab.four .mspoke { --a: calc(180deg + 30deg * var(--i)); }
  #mfab.four.open .mspoke { transform: rotate(var(--a)) translateX(132px) rotate(calc(-1 * var(--a))) scale(1); }
  /* With Sound (14 Nov) the host has five: 22.5deg apart, further out again. */
  #mfab.five .mspoke { --a: calc(180deg + 22.5deg * var(--i)); }
  #mfab.five.open .mspoke { transform: rotate(var(--a)) translateX(156px) rotate(calc(-1 * var(--a))) scale(1); }
  .mspoke[data-k=host] { border-color: var(--amber); color: var(--amber); }
  #mscrim { display: block; position: fixed; inset: 0; z-index: 48; background: rgba(6, 10, 20, .55); opacity: 1; transition: opacity .25s; }
  #mscrim[hidden] { display: block; opacity: 0; pointer-events: none; }

  /* ------------------------------------------------ side panels become sheets */
  #side, #right { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; width: auto; height: auto; max-height: 80dvh; border: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; box-shadow: 0 -16px 40px rgba(0, 0, 0, .6); padding-bottom: var(--safe-b); transform: translateY(105%); transition: transform .38s var(--ease-out); overscroll-behavior: contain; }
  body.sheet-mat #side, body.sheet-players #right { transform: translateY(0); }
  .sheethead { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 3; padding: 16px 10px 6px 18px; background: var(--panel); touch-action: none; }
  .sheethead .grab { position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
  .sheethead .t { flex: 1; font: 700 18px/1 var(--f-disp); letter-spacing: 1px; text-transform: uppercase; }
  #side section, #right section { padding: 8px 18px 16px; border-bottom: 0; }
  #right #oppsec { max-height: none; }
  #oppsec > h2 { display: none; }
  #zones { gap: 8px; }
  .zone { font-size: 9px; }
  #played { min-height: 110px; }
  #played img { width: 72px; }
  .opp { padding: 10px 12px; border-radius: 12px; margin-bottom: 10px; }
  .opp .top { font-size: 14px; flex-wrap: wrap; }
  .opp .cards { gap: 6px; }
  .opp .cards .c, .opp .cards img { width: 52px; }

  /* menus and pop-ups sized for thumbs */
  #menu { min-width: 210px; max-width: calc(100vw - 16px); max-height: 70dvh; overflow-y: auto; border-radius: 14px; }
  #menu button { padding: 12px 12px; font-size: 15px; }
  #modal, #cardover { padding: 10px; align-items: flex-end; }
  #modalbox, #cardbox { max-height: 88dvh; border-radius: 18px; }
  .cardview img { width: 100%; max-width: 300px; margin: 0 auto; }
  .zgrid.big { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  @media (prefers-reduced-motion: reduce) {
    #side, #right, .mspoke, #mfabbtn svg, #mscrim, .mcardin img, .obstep, #mghost, .hcard { transition-duration: 1ms; transition-delay: 0ms; animation: none; }
  }
}

/* ------------------------------------------------ set-up steps (2 Nov 2026) */
#setupsec h2 #setupstate { margin-left: auto; font-size: 11px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; gap: 6px; opacity: .72; }
.step.next { opacity: 1; border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.step.done { opacity: .85; }
.stephead { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.stephead .num { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; background: var(--line); color: var(--ink); flex: none; }
.step.next .stephead .num { background: var(--amber); color: #1A1204; }
.step.done .stephead .num { background: var(--teal); color: #0E0A1C; font-size: 0; }
.step.done .stephead .num::after { content: "\2713"; font-size: 12px; }
.step .hint { margin: 0; }
.step .row { display: flex; flex-wrap: wrap; gap: 6px; }
.seatbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seatbtns button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border-left: 5px solid var(--c); background: #2A2147; color: var(--ink); font-weight: 600; }
.seatbtns button .sn { font-size: 10px; color: var(--muted); }
.seatbtns button small { font-weight: 400; font-size: 11px; color: var(--muted); }
.seatbtns button.mine { background: #24365E; }
.seatbtns button.mine:disabled { opacity: 1; }
#startbtns { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- made pieces (Theo, 2 Nov): token units and markers */
#makesec .row { display: flex; gap: 6px; }
#makesec .row button { flex: 1; }
.piece .face, .piece .tkb { display: none; }
.piece.utoken { outline: 4px dashed #F1E6D0; outline-offset: -14px; }
.piece.utoken .tkb { display: block; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: #F1E6D0; color: #0E0A1C; font: 700 13px/18px var(--f-num); letter-spacing: .12em; padding: 0 7px; border-radius: 4px; pointer-events: none; }
.piece.noart img { display: none; }
.piece.utoken.noart { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--seat) 55%, #1B2440), #0E0A1C 75%); }
.piece.utoken.noart .face { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 12px 0 22px; text-align: center; color: var(--ink); pointer-events: none; }
.piece.utoken .face b { font: 600 15px/1.05 var(--f-num); max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece.utoken .face i { font: 700 26px/1 var(--f-num); font-style: normal; }
.piece.utoken .face small { font-size: 12px; opacity: .8; }
.piece.utoken.noart .lbl { display: none; }
.piece.marker { width: 40px; height: 40px; margin: -20px 0 0 -20px; background: var(--mk, #F2C46D); box-shadow: 0 0 0 3px #0E0A1C, 0 0 0 5px var(--mk, #F2C46D), 0 4px 10px rgba(0,0,0,.6); z-index: 3; }
.piece.marker .face { display: flex; align-items: center; justify-content: center; height: 100%; color: #0E0A1C; font: 700 16px/1 var(--f-num); pointer-events: none; overflow: hidden; white-space: nowrap; }
.piece.marker.dragging { box-shadow: 0 0 0 3px #0E0A1C, 0 0 0 5px var(--mk), 0 14px 30px rgba(0,0,0,.8); }
.mkform { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.mkform label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.mkform textarea { background: #0E0A1C; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; resize: vertical; }
.mkform .statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mkform .mkprev { display: flex; gap: 14px; align-items: center; }
.mkform .mkprev .hint { flex: 1; margin: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatches .sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid #0E0A1C; box-shadow: 0 0 0 1px var(--line); }
.swatches .sw.on { box-shadow: 0 0 0 3px var(--ink); }
.swatches .custom { flex-direction: row; align-items: center; gap: 6px; }
.swatches .custom input { width: 44px; height: 30px; padding: 0; }
.tokcard { width: 220px; flex: none; border-radius: 12px; padding: 10px; background: linear-gradient(#1B2440, #0E0A1C); border: 3px dashed var(--seat); text-align: center; position: relative; }
.tokcard .tokart { width: 150px; height: 150px; margin: 4px auto 0; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 5px var(--seat); display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--seat) 55%, #1B2440), #0E0A1C 75%); }
.tokcard .tokart img { width: 100%; height: 100%; object-fit: cover; }
.tokcard .tokart span { font: 700 48px/1 var(--f-num); color: var(--ink); }
.tokcard .tokband { display: inline-block; margin: -10px 0 4px; position: relative; background: #F1E6D0; color: #0E0A1C; font: 700 13px/20px var(--f-num); letter-spacing: .14em; padding: 0 10px; border-radius: 4px; }
.tokcard h3 { margin: 4px 0; font-family: var(--f-disp); }
.tokcard .stats { font-size: 12px; color: var(--muted); }
.tokcard p { font-size: 13px; text-align: left; margin: 8px 2px 0; }

/* ---- right panel as a fold-out drawer on desktop (Theo, 2 Nov): more of the screen is board */
#drawertab { display: none; }
@media (min-width: 761px) and (min-height: 501px) {
  #app { position: relative; overflow: hidden; }
  #right { position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; overflow: visible; transform: translateX(100%); transition: transform .22s ease; box-shadow: none; }
  body.drawer-open #right { transform: none; box-shadow: -12px 0 30px rgba(0,0,0,.5); }
  #right > section { overflow-y: auto; }
  #drawertab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; position: absolute; left: -36px; top: 50%; transform: translateY(-50%); width: 36px; height: 84px; padding: 0; border-radius: 10px 0 0 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-right: 0; box-shadow: -4px 0 12px rgba(0,0,0,.4); }
  #drawertab .arrow::before { content: "\2039"; font: 700 26px/1 var(--f-num); }
  body.drawer-open #drawertab .arrow::before { content: "\203A"; }
  #drawerbadge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--amber); color: #0E0A1C; font: 700 11px/20px var(--f-body); padding: 0 5px; }
  #drawerbadge.chat { background: var(--teal); }
  #drawerbadge[hidden] { display: none; }
}

/* ---- set-up as an onboarding card over the board (Theo, 2 Nov); gone once the game starts */
#setupsec.onboard { position: absolute; z-index: 20; left: 16px; top: 16px; width: 340px; max-height: calc(100% - 180px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
#setupsec[hidden] { display: none; }
#setupsec h2 { display: flex; align-items: center; gap: 8px; }
#setupsec h2 #setuptoggle { margin-left: 6px; }
#setupsec .onbhint { margin: 2px 0 8px; }
#setupsec.min { width: auto; padding: 8px 12px; }
#setupsec.min #setupbody, #setupsec.min .onbhint { display: none; }
#setupsec.min h2 { margin: 0; }
#turnsec[hidden] { display: none; }
#side header #stand { margin-top: 6px; }

/* ---- floating rules search (Theo, 2 Nov): a draggable ? bubble and its panel */
#rulesbub { position: fixed; z-index: 60; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: var(--amber); color: #1A1204; font: 700 21px/40px var(--f-num); box-shadow: 0 0 0 3px #0E0A1C, 0 8px 20px rgba(0,0,0,.6); cursor: grab; touch-action: none; user-select: none; }
#rulesbub.dragging { cursor: grabbing; box-shadow: 0 0 0 3px #0E0A1C, 0 16px 34px rgba(0,0,0,.8); transform: scale(1.06); }
#rulesbub.open { background: var(--teal); color: #0E0A1C; }
#rulesbub.nudge { animation: bubnudge 1.6s cubic-bezier(.16, 1, .3, 1) 1.2s 2; }
@keyframes bubnudge { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-7px, -4px); } 60% { transform: translate(5px, 3px); } }
#rulesbubtip { position: fixed; z-index: 59; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); background: rgba(20, 15, 40, .94); color: var(--ink); font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
#rulesbubtip[hidden] { display: none; }
body.incombat #rulesbubtip, body.sheet-open #rulesbubtip { display: none; }
@media (prefers-reduced-motion: reduce) { #rulesbub.nudge { animation: none; } }
#rulespanel { position: fixed; z-index: 61; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(0,0,0,.65); overflow: hidden; }
#rulespanel[hidden] { display: none; }
#rulespanel .rphead { display: flex; gap: 6px; padding: 10px 10px 6px; }
#rulespanel .rphead input { flex: 1; font-size: 15px; }
#rulespanel .rpfilters { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 10px 8px; }
#rulespanel .rpfilters:empty { display: none; }
#rulespanel .chip { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 500; }
#rulespanel .chip.on { background: var(--teal); color: #0E0A1C; border-color: var(--teal); }
#rulesout { overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
#rulesout .hint { margin: 4px 2px; }
.rres { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 7px 9px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.rres:hover { background: #18213B; }
.rres.src-keyword { border-left-color: var(--amber); }
.rres.src-rules { border-left-color: var(--teal); }
.rres.src-card { border-left-color: #B48CF2; }
.rres.src-ruling, .rres.src-table { border-left-color: #E5534B; }
.rres .rtop { display: flex; gap: 8px; align-items: baseline; }
.rres .rtop b { color: var(--ink); font-size: 14px; }
.rres .rsrc { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rres .rpath { font-size: 11px; color: var(--muted); }
.rres .rstat { font-size: 12px; color: var(--amber); margin-top: 2px; }
.rres .rtext { color: var(--ink); opacity: .9; margin-top: 3px; }
.rres mark { background: rgba(242, 196, 109,.35); color: inherit; border-radius: 2px; padding: 0 1px; }

/* No browser double-tap zoom anywhere on the table (Theo, phone, 3 Nov 2026): it fought the board's own pinch,
   long-press and drag. Zero specificity, so the touch-action rules above (#view, .piece, #hand) still win. */
:where(*) { touch-action: manipulation; }

/* Combat strip, version one (Theo, 3 Nov 2026): the front of the mat, shared, docked over the top of the board. */
#combat { position: fixed; z-index: 57; top: 12px; left: 50%; transform: translateX(-50%); width: min(1180px, calc(100vw - 24px)); max-height: 62vh; max-height: 62dvh; overflow: auto; overscroll-behavior: contain; background: rgba(14, 10, 28,.97); border: 2px solid var(--amber); border-radius: 14px; padding: 10px 12px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.7); }
#combat .chead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; position: sticky; top: -10px; z-index: 2; background: rgba(14, 10, 28,.98); padding: 4px 0 6px; }
#combat .chead h3 { margin: 0; font: 700 18px/1 var(--f-disp); letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber); }
#combat .croll { display: flex; align-items: center; gap: 6px; }
#combat .cright { display: flex; gap: 6px; margin-left: auto; }
#combat .cadd { flex: 1 1 100%; max-width: 420px; }
#combat .cdice { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 10px; border-radius: 8px; background: #1D2742; color: #F1E6D0; min-height: 34px; align-items: center; }
#combat .cdice small { font-size: 12px; color: var(--muted); }
#combat .cdice b { font: 400 26px/1 sans-serif; color: var(--amber); letter-spacing: 2px; }
#combat .cdice strong { font: 700 24px/1 var(--f-num); color: var(--amber); }
#combat .cdice.fresh { animation: cdpop .5s var(--ease-out, ease-out); box-shadow: 0 0 0 2px var(--amber); }
@keyframes cdpop { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }
#combat.min .csides, #combat.min .cadd { display: none; }
#combat .csides { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }
#combat .cvs { align-self: center; font: 700 22px/1 var(--f-num); color: var(--amber); }
#combat .cside { flex: 1 1 360px; min-width: 0; border-left: 6px solid var(--seat); padding-left: 10px; }
#combat .cshead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; }
#combat .cshead > b { font: 700 16px/1 var(--f-num); letter-spacing: 1px; color: var(--seat); }
#combat .ctot { font-size: 13px; opacity: .9; }
#combat .ctot b { font-size: 15px; color: #F1E6D0; }
#combat .call { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12px; color: var(--muted); }
#combat .call select { padding: 2px 4px; }
#combat .ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
#combat .ccard { background: #141B30; border-radius: 10px; padding: 8px; box-shadow: 0 0 0 2px var(--seat); }
#combat .ccard.tapped { opacity: .65; }
#combat .ccard.dead { opacity: .5; }
#combat .ccard.dead .cgrid { filter: grayscale(1); }
#combat .ctop { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#combat .cthumb { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; overflow: hidden; background: #1D2742; border: 2px solid var(--seat); display: grid; place-items: center; font: 700 14px var(--f-num); color: #F1E6D0; }
#combat .cthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#combat .cname { flex: 1; min-width: 0; }
#combat .cname b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#combat .cname small { font-size: 11px; color: var(--muted); }
#combat .cacts { display: flex; gap: 4px; }
#combat .cacts button { padding: 2px 7px; }
#combat .cgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
#combat .cflags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#combat .cflag { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--muted); color: var(--muted); background: transparent; }
#combat span.cflag { display: inline-flex; align-items: center; }
#combat .cflag.on { border-color: #F2C46D; color: #F2C46D; font-weight: 600; }
#combat .cotie .on { outline: 2px solid #F2C46D; }
#combat .cst { position: relative; display: flex; flex-direction: column; align-items: stretch; background: #1D2742; border-radius: 8px; padding: 3px 3px 4px; text-align: center; }
#combat .cst i { font: 600 10px/1.4 var(--f-body); font-style: normal; letter-spacing: 1px; color: var(--muted); }
#combat .cst button { min-height: 26px; padding: 0; border: 0; border-radius: 6px; background: rgba(255,255,255,.06); color: #F1E6D0; font: 700 16px/1 sans-serif; cursor: pointer; touch-action: manipulation; }
#combat .cst button:hover { background: rgba(242, 196, 109,.25); }
#combat .cst input, #combat .cdmg input { width: 100%; min-width: 0; box-sizing: border-box; text-align: center; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #F1E6D0; font: 700 20px/1.2 var(--f-num); padding: 1px 0; }
#combat .cst input:focus, #combat .cdmg input:focus { border-color: var(--amber); background: #0E0A1C; outline: none; }
#combat .cst.up input { color: #7BC96F; }
#combat .cst.down input { color: #E5534B; }
#combat .cst em { position: absolute; top: 2px; right: 4px; font: 700 10px/1 sans-serif; font-style: normal; color: var(--muted); }
#combat .cst.up em { color: #7BC96F; }
#combat .cst.down em { color: #E5534B; }
#combat .cdmg { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--muted); }
#combat .cdmg input { width: 40px; flex: none; font-size: 18px; color: #E5534B; }
#combat .cdmg button { padding: 2px 9px; }
#combat .hpbar { flex: 1; height: 6px; border-radius: 3px; background: #2A1A1A; overflow: hidden; }
#combat .hpbar span { display: block; height: 100%; background: #7BC96F; }
#combat .empty { opacity: .8; margin: 4px 0; }
#combat .corder { margin: 0 0 10px; padding: 8px; border-radius: 10px; background: #10172B; border: 1px solid var(--line, #24304F); }
#combat .cohead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
#combat .cohead b { font: 700 13px/1 var(--f-disp); letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber); }
#combat .cohead > span { font-size: 12px; color: var(--muted); }
#combat .cotie { display: inline-flex; align-items: center; gap: 4px; color: #F1E6D0 !important; }
#combat .conav { display: inline-flex; gap: 4px; margin-left: auto; }
#combat .cochips { list-style: none; margin: 0; padding: 0 0 2px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
#combat .cochip { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: #1D2742; box-shadow: inset 0 0 0 2px var(--seat); cursor: pointer; transition: transform .15s, opacity .15s; }
#combat .cochip img, #combat .cochip .coi { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #0E0A1C; font: 700 11px var(--f-num); }
#combat .cochip .con { font: 700 12px/1 var(--f-num); color: var(--muted); min-width: 12px; text-align: center; }
#combat .cochip .cot { display: flex; flex-direction: column; font-size: 12px; line-height: 1.15; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
#combat .cochip .cot small { font-size: 10px; color: var(--muted); }
#combat .cochip.done { opacity: .45; }
#combat .cochip.now { background: var(--seat); color: #0E0A1C; box-shadow: 0 0 0 2px #F1E6D0, 0 0 16px var(--seat); transform: scale(1.06); }
#combat .cochip.now .con, #combat .cochip.now .cot small { color: #0E0A1C; }
#combat .ccard { position: relative; }
#combat .ccard.now { box-shadow: 0 0 0 3px #F1E6D0, 0 0 18px var(--seat); }
#combat .cpos { position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--seat); color: #0E0A1C; font: 700 12px/22px var(--f-num); text-align: center; z-index: 1; }
/* Phones (3 Nov: the strip sat under the resource bar and was cut off): a sheet below the top bar, full width,
   one unit per row, big enough buttons for a thumb. Hide shrinks it to its header to see the board. */
@media (max-width: 760px), (max-height: 500px) {
  #combat { top: calc(62px + var(--safe-t, 0px)); left: 6px; right: 6px; bottom: calc(8px + var(--safe-b, 0px)); width: auto; transform: none; max-height: none; padding: 8px; }
  #combat.min { bottom: auto; }
  #combat .chead { top: -8px; }
  #combat .chead h3 { font-size: 16px; }
  #combat .cside { flex-basis: 100%; padding-left: 8px; }
  #combat .cvs { flex-basis: 100%; text-align: center; font-size: 16px; }
  #combat .ccards { grid-template-columns: 1fr; }
  #combat .cst button { min-height: 32px; font-size: 18px; }
  #combat .cdmg button { min-height: 32px; padding: 0 12px; }
  #combat .cacts button, #combat .call button { min-height: 32px; }
}
@media (max-width: 760px), (max-height: 500px) { body.incombat #rulesbub, body.incombat #rulespanel { display: none; } }   /* 3 Nov: the ? bubble sat over the combat damage box */
/* Phone combat tabs (3 Nov): Board | Combat under the top bar; combat is a full-screen takeover above the hand. */
#ctabs { display: none; }
@media (max-width: 760px), (max-height: 500px) {
  body.incombat #ctabs:not([hidden]) { display: flex; position: fixed; z-index: 58; left: 8px; right: 8px; top: calc(62px + var(--safe-t, 0px)); height: 40px; padding: 3px; gap: 3px; border-radius: 12px; background: rgba(30, 23, 56, .94); border: 1px solid var(--amber); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
  #ctabs button { flex: 1; min-width: 0; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 700 14px/1 var(--f-disp); letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #ctabs button.on { background: var(--amber); color: #1A1204; }
  #combat { top: calc(108px + var(--safe-t, 0px)); bottom: calc(118px + var(--safe-b, 0px)); }
  body.incombat:not(.cboard) #combat { border-radius: 12px; }
  body.cboard #combat { display: none !important; }
  #combat [data-a="min"] { display: none; }
  body.incombat:not(.cboard) #mfab { display: none; }   /* the action button sat over the unit rows; the board tab has it */
}
@media (max-width: 760px), (max-height: 500px) { body.incombat #hover { top: calc(108px + var(--safe-t, 0px)); } }

/* ------------------------------------------------ desktop deck picker (5 Nov 2026), ported from the phone onboarding */
#deck[hidden] { display: none; }
.deckpick { display: flex; flex-direction: column; gap: 6px; }
.dpline { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.dpbar { display: flex; align-items: center; gap: 6px; }
.dpfname { font: 700 13px/1 var(--f-disp); letter-spacing: .6px; text-transform: uppercase; color: var(--amber); margin-left: 4px; }
.dprow { display: flex; align-items: stretch; padding: 0; min-height: 68px; overflow: hidden; border-radius: 10px; background: rgba(30, 23, 56, .92); border: 1px solid var(--line); color: var(--ink); text-align: left; font-weight: 400; transition: border-color .15s, transform .15s; }
.dprow:hover, .dprow:focus-visible { border-color: var(--amber); outline: none; }
.dprow:active { transform: scale(.985); }
/* The tracked challenge in the game (12 Nov 2026) */
#trackline { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; margin: 0 0 10px; padding: 8px 10px 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(14, 10, 28, .35); }
#trackline[hidden], #trackstrip[hidden] { display: none; }
#trackline .k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
#trackline .n { font-size: 13px; font-variant-numeric: tabular-nums; }
#trackline .how { grid-column: 1 / -1; font-size: 13px; line-height: 1.35; color: var(--ink); }
#trackline .meter, #trackstrip .meter { position: relative; height: 4px; background: rgba(241, 230, 208, .16); border-radius: 2px; overflow: hidden; }
#trackline .meter { grid-column: 1 / -1; margin-top: 4px; }
#trackline .meter::after, #trackstrip .meter::after { content: ""; position: absolute; inset: 0; background: var(--amber); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
#trackline.up, #trackstrip.up { animation: trackup .9s cubic-bezier(.16, 1, .3, 1); }
@keyframes trackup { 0% { box-shadow: 0 0 0 0 rgba(244, 196, 98, .7); } 100% { box-shadow: 0 0 0 10px rgba(244, 196, 98, 0); } }
/* The plain combat view (12 Nov 2026): their units, what happened, your units, one button. */
#combat.lite { width: min(760px, calc(100vw - 24px)); max-height: min(86vh, 760px); padding: 12px 14px 14px; }
#combat.lite .clhead { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
#combat.lite .clhead h3 { margin: 0; font: 700 16px/1 var(--f-disp); letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber); }
#combat.lite .clround { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.clside { display: grid; gap: 6px; }
.clname { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.clside.us .clname { text-align: right; }
.clunits { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.clu { position: relative; display: grid; gap: 3px; min-height: 0; padding: 9px 10px 8px; text-align: left; border: 2px solid color-mix(in srgb, var(--seat) 55%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--seat) 10%, rgba(20, 15, 40, .96)); color: var(--ink); box-shadow: none; cursor: default; font: inherit; }
.clu .clun { font-size: 14px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clu .clus { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); }
.clu .clus i { font-style: normal; } .clu .clus b { color: var(--ink); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.clu .clhp { display: block; height: 5px; border-radius: 3px; background: rgba(241, 230, 208, .14); overflow: hidden; }
.clu .clhp span { display: block; height: 100%; background: #5BD08A; transition: width .4s cubic-bezier(.16, 1, .3, 1); }
.clu .clodds { font-size: 12px; font-weight: 600; color: var(--amber); }
.clu .clodds.kill { color: #FF9C7A; } .clu .clodds.no { color: var(--muted); font-weight: 400; }
.clu .cltag { position: absolute; top: -9px; left: 8px; padding: 1px 7px; border-radius: 8px; background: var(--seat); color: #0E0A1C; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.clu.now { border-color: var(--seat); box-shadow: 0 0 0 2px color-mix(in srgb, var(--seat) 35%, transparent); }
.clu.canhit, .clu.canjoin { cursor: pointer; }
.clu.canhit { border-style: dashed; border-color: var(--amber); }
.clu.canhit:hover { background: color-mix(in srgb, var(--amber) 14%, rgba(20, 15, 40, .96)); }
.clu.target { border-style: solid; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 196, 109, .35); }
.clu.target .cltag { background: var(--amber); }
.clu.canjoin { border-style: dashed; }
.clu.joined { border-style: solid; box-shadow: 0 0 0 3px color-mix(in srgb, var(--seat) 40%, transparent); }
.clu.dead { opacity: .4; } .clu.dead .clhp span { background: #777; } .clu.dead .cltag { background: #777; }
.clu.hit { animation: cluhit .5s; } .clu.missed { animation: clumiss .4s; }
@keyframes cluhit { 20% { transform: translateX(-5px); background: rgba(255, 90, 70, .35); } 60% { transform: translateX(4px); } }
@keyframes clumiss { 40% { transform: translateY(-3px); } }
.clmid { display: grid; gap: 8px; justify-items: stretch; margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: rgba(241, 230, 208, .05); }
.clres { display: flex; align-items: center; gap: 12px; padding-left: 10px; border-left: 4px solid var(--seat); }
.clres .crdie { font-size: 40px; line-height: 1; }
.clres b { display: block; font-size: 15.5px; line-height: 1.25; } .clres span { font-size: 12.5px; color: var(--muted); }
.clres.miss b { color: var(--muted); }
.clres.fresh { animation: lrnin .35s cubic-bezier(.16, 1, .3, 1); }
.clprompt { margin: 0; font-size: 14.5px; line-height: 1.4; } .clprompt .clhint { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.clgo { min-height: 46px; font-size: 16px; font-weight: 700; }
.clgo[disabled] { opacity: .5; }
.clabil { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
@media (max-width: 760px), (max-height: 500px) {
  #combat.lite { width: auto; max-height: none; padding: 10px 10px 12px; }
  .clunits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .clu { padding: 8px 8px 7px; } .clu .clun { font-size: 13px; } .clu .clus { gap: 7px; font-size: 10.5px; } .clu .clus b { font-size: 12.5px; }
  .clmid { margin: 10px 0; padding: 9px 10px; } .clres .crdie { font-size: 34px; } .clres b { font-size: 14.5px; }
  .clgo { min-height: 50px; }
}
@media (prefers-reduced-motion: reduce) { .clu.hit, .clu.missed, .clres.fresh { animation: none; } }
/* A hand card open on a phone: which card of the hand it is, and the way to the others. */
.mcardnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.mcardnav[hidden] { display: none; }
.mcardnav button { flex: none; min-height: 0; width: 36px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--ink); font-size: 20px; line-height: 1; box-shadow: none; }
.mcardin.slidel { animation: mcardl .22s cubic-bezier(.16, 1, .3, 1); }
.mcardin.slider { animation: mcardr .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes mcardl { from { transform: translateX(36px); opacity: .5; } }
@keyframes mcardr { from { transform: translateX(-36px); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .mcardin.slidel, .mcardin.slider { animation: none; } }
/* What you can do now, and the tips of a first game (12 Nov 2026). */
#tipstack { position: fixed; z-index: 38; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(640px, 46vw); pointer-events: none; }
#tipstack > * { pointer-events: auto; }
#hintbar { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(20, 15, 40, .92); color: var(--ink); font-size: 13.5px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
#hintbar[hidden], #coach[hidden] { display: none; }
#hintbar button { flex: none; min-height: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; box-shadow: none; }
#hintbar button:hover { color: var(--ink); }
#coach { width: min(380px, 100%); padding: 12px 14px 10px; border: 1px solid var(--amber); border-radius: 10px; background: rgba(24, 18, 46, .97); color: var(--ink); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
#coach p { margin: 4px 0 10px; font-size: 14px; line-height: 1.45; }
#coach .lrnnav { display: flex; justify-content: space-between; gap: 8px; }
@media (max-width: 760px), (max-height: 500px) {
  #tipstack { top: calc(132px + var(--safe-t)); left: 12px; right: 12px; transform: none; width: auto; }
  #hintbar { font-size: 12.5px; padding: 6px 6px 6px 10px; }
  /* On a phone the tip sits low, clear of the player's own Homeworld at the top of the board and of the round buttons. */
  #coach.low { position: fixed; left: 12px; right: 12px; bottom: calc(224px + var(--safe-b, 0px)); width: auto; }
  #coach { width: 100%; }
}
#trackstrip { display: none; }
@media (max-width: 760px), (max-height: 500px) {
  #trackstrip:not([hidden]) { display: flex; align-items: center; gap: 8px; position: fixed; z-index: 39; left: 16px; right: 16px; top: calc(108px + var(--safe-t)); height: 18px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: rgba(30, 23, 56, .9); pointer-events: none; }
  #trackstrip .meter { flex: 1; }
  #trackstrip .n { font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--amber); }
}
@media (prefers-reduced-motion: reduce) { #trackline .meter::after, #trackstrip .meter::after { transition: none; } #trackline.up, #trackstrip.up { animation: none; } }
.dprow.locked { opacity: .62; cursor: default; }
.dprow.locked:hover, .dprow.locked:focus-visible { border-color: var(--line); }
.dprow.dpfac.locked { cursor: pointer; }
.gover .earned { margin: 12px 0 6px; font-size: 15px; }
.gover .earned b { color: var(--amber); }
.gover .tolobby { display: block; margin-top: 8px; }
.dprow.chosen { border-color: var(--teal); cursor: default; transform: none; }
.dprow .art { flex: none; width: 64px; position: relative; overflow: hidden; }
/* zoom into the card's art band (about 17% to 45% down the card), centred on the row */
.dprow .art img { position: absolute; width: 240px; max-width: none; left: -88px; top: 50%; margin-top: -102px; }
.dprow .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, rgba(30, 23, 56, .92)); }
.dprow .txt { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 10px 8px 6px; min-width: 0; }
.dprow b { font: 700 13px/1.15 var(--f-disp); letter-spacing: .4px; text-transform: uppercase; }
.dprow b em { font: 600 9px/1 var(--f-body); font-style: normal; letter-spacing: .8px; text-transform: uppercase; color: #1A1204; background: var(--teal); border-radius: 5px; padding: 2px 5px; margin-left: 5px; vertical-align: 1px; }
.dprow i { font-style: normal; font-size: 10.5px; letter-spacing: .3px; color: var(--amber); }
.dprow .line { font-size: 12px; line-height: 1.35; color: #D8CDE6; }

/* ------------------------------------------------ explainers (5 Nov 2026): keyword meanings on cards, explainers first in search */
.kwx { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(79, 185, 181, .08); border: 1px solid rgba(79, 185, 181, .25); display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 13px; line-height: 1.4; }
.kwx dt { font: 700 12px/1.4 var(--f-num); letter-spacing: .4px; text-transform: uppercase; color: var(--teal); white-space: nowrap; }
.kwx dd { margin: 0; color: #D8CDE6; }
#previewkw { position: fixed; z-index: 75; width: 340px; pointer-events: none; display: none; }
#previewkw .kwx { margin: 0; background: rgba(14, 10, 28, .96); box-shadow: 0 12px 40px rgba(0,0,0,.8); }
.mcardkw:empty { display: none; }
.mcardkw { width: 100%; }
.mcardkw .kwx { margin: 0; font-size: 14px; }
#rulesout .rres.src-explain { border-left: 3px solid var(--teal); }
#rulesout .rres.src-explain .rsrc { color: var(--teal); }
#rulesout .rres.src-explain .rtext { color: var(--ink); font-size: 13.5px; }
.rpstart { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.rplearn, .helplearn { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.helplearn { margin-bottom: 14px; }

/* ------------------------------------------------ learning the game (5 Nov 2026): welcome, screen tour, the basics */
#lrn { position: fixed; inset: 0; z-index: 95; }
#lrn[hidden] { display: none !important; }
#lrn.welcome, #lrn.basics { display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 16, .74); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lrnspot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8, 5, 16, .74), 0 0 0 2px var(--amber); transition: left .35s var(--ease-out, ease), top .35s var(--ease-out, ease), width .35s var(--ease-out, ease), height .35s var(--ease-out, ease); pointer-events: none; }
.lrnspot[hidden] { display: none; }
.lrncard { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .7); color: var(--ink); animation: lrnin .35s var(--ease-out, ease); }
#lrn.tour .lrncard { position: fixed; padding: 14px 16px 12px; border-color: var(--amber); }
@keyframes lrnin { from { opacity: 0; transform: translateY(10px); } }
.lrnkick { font: 600 11px/1 var(--f-disp); letter-spacing: 2px; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.lrncard h2 { margin: 0 0 10px; font: 700 26px/1.1 var(--f-disp); letter-spacing: .5px; text-transform: uppercase; }
.lrncard h3 { margin: 0 0 6px; font: 700 18px/1.15 var(--f-disp); letter-spacing: .4px; text-transform: uppercase; }
.lrncard p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: #D8CDE6; text-wrap: pretty; }
.lrncard p b, .lrnsteps b { color: var(--ink); }
.lrnopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.lrnopts button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 12px; text-align: left; }
.lrnopts button:first-child { background: var(--amber); color: #1A1204; }
.lrnopts button:last-child { background: var(--teal); color: #0E0A1C; }
.lrnopts b { font-size: 15px; }
.lrnopts span { font-size: 12px; font-weight: 500; opacity: .8; }
.lrnskip { display: block; margin: 8px auto 0; }
.lrnnav { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.lrnnav > :first-child { margin-right: auto; }
.lrndots { display: flex; gap: 5px; margin-right: auto; }
.lrndots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.lrndots i.on { background: var(--amber); }
.lrnbody { min-height: 150px; }
.lrnsteps { margin: 0 0 10px; padding-left: 20px; font-size: 14.5px; line-height: 1.5; color: #D8CDE6; display: flex; flex-direction: column; gap: 6px; }
.lrnpair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.lrnpair > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #0E0A1C; border: 1px solid var(--line); font-size: 13px; line-height: 1.4; color: #D8CDE6; }
.lrnpair b { font: 700 16px/1 var(--f-disp); letter-spacing: .5px; text-transform: uppercase; }
.lrnpair b.ore { color: #F0A040; }
.lrnpair b.crys { color: #A98BFF; }
.lrnmath { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 12px; font: 700 18px/1 var(--f-num); color: var(--muted); }
.lrnmath span { padding: 8px 12px; border-radius: 8px; background: #0E0A1C; border: 1px solid var(--line); color: var(--ink); letter-spacing: .5px; }
.lrnmath i { font-style: normal; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--amber); }
@media (max-width: 760px), (max-height: 500px) {
  .lrnopts { grid-template-columns: 1fr; }
  .lrncard h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .lrnspot, .lrncard { transition: none; animation: none; } }

/* a paused game (11 Nov 2026): a quiet line across the top of the board so nobody plays on by mistake */
body.paused #view::before { content: "Paused. The game is being kept. Press Resume game when everyone is back."; position: absolute; z-index: 30; left: 50%; top: 14px; transform: translateX(-50%); padding: 9px 16px; border-radius: 4px; background: rgba(14, 10, 28, .9); color: var(--amber); font: 600 14px/1.3 var(--f-body); box-shadow: 0 0 0 1px rgba(242, 196, 109, .5), 0 10px 26px rgba(14, 10, 28, .6); pointer-events: none; white-space: nowrap; }
@media (max-width: 760px), (max-height: 500px) { body.paused #view::before { white-space: normal; width: calc(100% - 32px); text-align: center; top: 64px; } }

/* your attack, resolved by the Table (11 Nov 2026) */
.cattack { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 10px; margin: 6px 0; border: 1px solid rgba(241, 230, 208, .22); border-radius: 8px; }
.cattack select { max-width: 100%; }
.cattack .cjoin { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cattack .codds { font-size: 13px; opacity: .85; }

/* combat that can be followed (11 Nov 2026): the last attack's result, the hit on its target, the summary at the end */
.cresult { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; margin: 6px 0; border-radius: 8px; background: rgba(14, 10, 28, .55); box-shadow: inset 4px 0 0 var(--seat, #999); }
.cresult .crdie { font-size: 44px; line-height: 1; }
.cresult .crtext { display: grid; gap: 2px; min-width: 0; }
.cresult .crtext span { font-size: 13.5px; opacity: .85; }
.cresult strong { font-size: 18px; white-space: nowrap; color: var(--danger, #E36F5A); }
.cresult.miss strong { color: inherit; opacity: .7; }
.cresult.fresh .crdie { animation: crRoll .7s cubic-bezier(.2, .8, .2, 1); }
.cresult.fresh strong { animation: crPop .5s .65s both; }
@keyframes crRoll { 0% { transform: rotate(-200deg) scale(.4); opacity: 0; } 70% { transform: rotate(12deg) scale(1.15); opacity: 1; } 100% { transform: none; } }
@keyframes crPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: none; opacity: 1; } }
.ccard { position: relative; }
.ccard.hit { animation: cHit .6s .7s both; }
.ccard.struck { box-shadow: 0 0 0 2px rgba(241, 230, 208, .55); }
@keyframes cHit { 0% { transform: none; } 20% { transform: translateX(-7px); background: rgba(227, 111, 90, .35); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 100% { transform: none; } }
.chit { position: absolute; right: 10px; top: 6px; z-index: 2; font: 700 26px/1 var(--f-disp, sans-serif); color: var(--danger, #E36F5A); pointer-events: none; animation: cFloat 2.4s .7s both; }
.ccard.missed .chit { color: inherit; font-size: 15px; opacity: .8; }
@keyframes cFloat { 0% { transform: translateY(8px) scale(.6); opacity: 0; } 15% { transform: none; opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
.cend h4 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.cendlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; text-align: left; }
.cendlist li { display: flex; gap: 8px; align-items: baseline; }
.cendlist i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cendlog { margin-top: 14px; text-align: left; font-size: 13.5px; }
.cendlog ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; max-height: 30vh; overflow: auto; }
@media (prefers-reduced-motion: reduce) { .cresult.fresh .crdie, .cresult.fresh strong, .ccard.hit, .chit { animation: none; } }
.cend .k { color: var(--peach, #F4B183); text-shadow: 0 1px 6px #0E0A1C, 0 0 14px #0E0A1C; }
.cend h3 { text-shadow: 0 2px 10px #0E0A1C; }
.cendlist { justify-content: center; justify-items: center; }
.cendlog { max-width: 70ch; margin-left: auto; margin-right: auto; }
.cend .egbtns { display: flex; justify-content: center; margin-top: 16px; }

/* the guided combat view (11 Nov 2026): one thing at a time; the manual controls are behind "Edit by hand" */
#combat .chead h3 small { font: 600 12px/1 var(--f-body, sans-serif); letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-left: 10px; }
#combat.guided .croll, #combat.guided .cadd, #combat.guided .cotie, #combat.guided .conav, #combat.guided .call,
#combat.guided .cacts, #combat.guided .cup, #combat.guided .cdn, #combat.guided .cpos,
#combat.guided .cst[data-s="mov"], #combat.guided .cflags button:not(.on),
#combat.guided .cdmg > span:first-child, #combat.guided .cdmg > button:not(.danger), #combat.guided .cdmg > input { display: none; }
#combat.guided .cst input { pointer-events: none; border: 0; background: none; box-shadow: none; text-align: center; }
#combat.guided .cflags:not(:has(.on)) { display: none; }
#combat.guided .cflags .on { pointer-events: none; }
#combat.guided .cgrid { grid-template-columns: repeat(3, 1fr); }
#combat.guided .cdmg .hpbar { flex: 1; }
.cprompt, .cattack.guided { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 16px; margin: 6px 0; border-radius: 8px; background: rgba(241, 230, 208, .07); border: 1px solid rgba(241, 230, 208, .22); }
.cprompt.wait { opacity: .85; }
.cattack.guided .catext { display: grid; gap: 3px; min-width: 0; }
.cattack.guided .catext b { font-size: 16px; }
.cattack.guided .catext > span { font-size: 13.5px; opacity: .9; }
.catroll { font-size: 16px; padding: 12px 22px; white-space: nowrap; }
#combat.guided .ccard.canhit, #combat.guided .ccard.canjoin { cursor: pointer; }
#combat.guided .ccard.canhit:hover, #combat.guided .ccard.canjoin:hover { box-shadow: 0 0 0 2px rgba(241, 230, 208, .4); }
#combat.guided .ccard.target { box-shadow: 0 0 0 3px var(--danger, #E36F5A); }
#combat.guided .ccard.joined { box-shadow: 0 0 0 3px var(--peach, #F4B183); }
.cmark { position: absolute; left: 10px; top: -9px; z-index: 2; padding: 2px 8px; border-radius: 99px; font: 700 10.5px/1.3 var(--f-body, sans-serif); letter-spacing: .1em; text-transform: uppercase; background: var(--danger, #E36F5A); color: #0E0A1C; }
.ccard.joined .cmark { background: var(--peach, #F4B183); }
#combat:not(.guided) .cmark { display: none; }

/* effects in play, in the combat window */
.cfx { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(14, 10, 28, .45); font-size: 13.5px; }
.cfx > b { font: 400 11px/1 var(--f-disp, sans-serif); letter-spacing: .16em; text-transform: uppercase; opacity: .75; margin-right: 10px; }
.cfx.none { opacity: .7; }
.cfx ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.cfx li { display: grid; grid-template-columns: 9px auto auto minmax(0, 1fr); gap: 8px; align-items: baseline; }
.cfx li i { width: 9px; height: 9px; border-radius: 50%; background: var(--seat, #999); align-self: center; }
.cfx .cfxname { font-weight: 700; color: var(--ink, #F1E6D0); background: none; border: 0; padding: 0; font-size: inherit; text-align: left; }
.cfx button.cfxname { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(241, 230, 208, .4); }
.cfx em { font-style: normal; font-size: 12px; opacity: .7; white-space: nowrap; }
.cfx li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* In play, in two parts, and the other players' Ongoing Events (11 Nov 2026) */
#playedzone { display: block; }
.inplayhead { display: block; font: 400 12px/1.2 var(--f-disp, sans-serif); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
#played { display: grid; gap: 8px; }
.psec { display: grid; gap: 4px; }
.psub { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.prow { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.prow .empty { font-size: 12.5px; opacity: .6; }
.oppong { display: block; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(241, 230, 208, .16); }
.oppong .inplayhead { color: var(--seat, inherit); }
.oppong img { cursor: pointer; }
/* a card someone has just played, shown to the others */
#playreveal { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 4000; display: flex; gap: 16px; align-items: center; max-width: min(620px, calc(100vw - 32px)); padding: 14px 18px 14px 14px; border-radius: 12px; background: rgba(14, 10, 28, .96); box-shadow: 0 0 0 2px var(--seat, #999), 0 18px 50px rgba(0, 0, 0, .6); cursor: pointer; animation: prIn .35s cubic-bezier(.2, .8, .2, 1); }
#playreveal[hidden] { display: none; }
#playreveal img { width: 150px; border-radius: 8px; flex: none; }
#playreveal .prtext { display: grid; gap: 4px; min-width: 0; }
#playreveal small { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--seat, inherit); }
#playreveal b { font: 400 20px/1.15 var(--f-disp, sans-serif); letter-spacing: .04em; text-transform: uppercase; }
#playreveal p { margin: 2px 0; font-size: 14.5px; line-height: 1.45; }
#playreveal .struckout { text-decoration: line-through; opacity: .6; }
#playreveal .prx { color: var(--danger, #E36F5A); font-weight: 700; }
#playreveal .muted { font-size: 11.5px; opacity: .55; }
@keyframes prIn { from { transform: translateX(-50%) translateY(-14px) scale(.96); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@media (max-width: 640px) { #playreveal img { width: 96px; } #playreveal { top: 64px; } }
@media (prefers-reduced-motion: reduce) { #playreveal { animation: none; } }
.rf-card { float: right; width: 120px; margin: 0 0 8px 12px; border-radius: 8px; }
.oppong { grid-column: 1 / -1; text-align: left; }
.oppong img { width: 60px; border-radius: 4px; display: block; }
#played .psec .empty { margin: 0; }

/* phone: Board, Mat and Combat tabs, always there once seated (11 Nov 2026) */
#mtabs { display: none; }
@media (max-width: 760px), (max-height: 500px) {
  #mtabs:not([hidden]) { display: flex; position: fixed; z-index: 59; left: 8px; right: 8px; top: calc(62px + var(--safe-t, 0px)); height: 40px; padding: 3px; gap: 3px; border-radius: 12px; background: rgba(30, 23, 56, .94); border: 1px solid var(--amber); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
  #mtabs button { flex: 1; min-width: 0; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 700 14px/1 var(--f-disp); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #mtabs button.on { background: var(--amber); color: #1A1204; }
  #mtabs button[hidden] { display: none; }
  body.incombat #ctabs:not([hidden]) { display: none; }
  body.sheet-open #mtabs { z-index: 80; }
}

/* a unit's own ability, in the combat window (11 Nov 2026) */
.cabil { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 2px; }
.cabil button { border-color: var(--amber, #F2C46D); color: var(--amber, #F2C46D); }

/* a ranged attack, shown to everyone (11 Nov 2026) */
#shottoast { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 3900; width: min(680px, calc(100vw - 32px)); cursor: pointer; }
#shottoast[hidden] { display: none; }
#shottoast .cresult { background: rgba(14, 10, 28, .96); box-shadow: inset 4px 0 0 var(--seat, #999), 0 18px 50px rgba(0, 0, 0, .6); margin: 0; }

/* Another side's units (13 Nov 2026): two players on the same faction have the same art, and the ring alone was not
   enough. Theirs get a double ring and muted art; yours stay as painted. They can be tapped and read, not dragged. */
.piece.foe { cursor: pointer; box-shadow: 0 0 0 5px var(--seat, #fff), 0 0 0 9px #0E0A1C, 0 0 0 13px var(--seat, #fff), 0 6px 16px rgba(0,0,0,.6); }
.piece.foe img { filter: grayscale(.6) brightness(.78); }
.piece.foe .lbl { color: var(--seat, #fff); }

/* Sound on/off (sfx.js, 14 Nov 2026) */
#sfxbtn { display: inline-grid; place-items: center; width: 30px; height: 26px; padding: 0; margin-top: 6px; vertical-align: middle; }
/* The round menu open: the help bubble and its label step aside so they never sit on a spoke. */
body:has(#mfab.open) :is(#rulesbub, #rulesbubtip) { visibility: hidden; }

/* ---------------------------------------------------------------- Learn to play (14 Nov 2026)
   The scripted tutorial (public/learn.js). Four panels dim everything but the one place the step uses, so nothing
   else answers a tap; a ring shows what to look at; a ghost finger shows the gesture; one line says what to do.
   Under the Table's own pop-ups (menus, the referee's questions, the card view), which a step may need. */
#lsn { position: fixed; inset: 0; z-index: 59; pointer-events: none; }
#lsn[hidden] { display: none; }
.lsnblock { position: fixed; pointer-events: auto; background: rgba(8, 5, 16, .62); transition: background .3s; }
#lsn.light .lsnblock { background: rgba(8, 5, 16, .22); }
.lsnshield { position: fixed; pointer-events: auto; background: transparent; }   /* over a look-only opening in the dimming: bright, but takes no taps */
#lsn.modal .lsnblock { background: rgba(8, 5, 16, .74); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lsnring { position: fixed; border-radius: 14px; box-shadow: 0 0 0 3px var(--amber), 0 0 24px 4px rgba(242, 196, 109, .45); pointer-events: none; }
.lsnring[hidden] { display: none; }
.lsnring.round { border-radius: 50%; }
.lsnring.foe { box-shadow: 0 0 0 3px var(--danger), 0 0 24px 4px rgba(227, 111, 90, .5); }
.lsnring.quiet { box-shadow: 0 0 0 2px rgba(242, 196, 109, .45); animation: none !important; }
.lsnring span { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 8px); white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--amber); color: #1A1204; font: 600 11px/1.2 var(--f-disp); letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.lsnring.foe span { background: var(--danger); color: #fff; }
.lsnring span[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .lsnring { animation: lsnpulse 1.6s ease-in-out infinite; } }
@keyframes lsnpulse { 50% { box-shadow: 0 0 0 3px var(--amber), 0 0 36px 10px rgba(242, 196, 109, .25); } }
.lsntap { position: fixed; pointer-events: auto; background: transparent; border: 0; padding: 0; border-radius: 50%; cursor: pointer; }
.lsntap[hidden] { display: none; }
.lsntap:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }
.lsnchips { position: fixed; inset: 0; pointer-events: none; }
.lsnchips[hidden] { display: none; }
.lsnchip { position: fixed; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--amber); box-shadow: 0 8px 24px rgba(0, 0, 0, .55); text-align: center; }
.lsnchip b { font: 600 11px/1.2 var(--f-disp); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.lsnchip span { font-size: 12.5px; line-height: 1.3; color: var(--ink); text-wrap: balance; }
.lsnchip[hidden] { display: none; }
.lsnfinger { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 2; }
.lsnfinger[hidden] { display: none; }
.lsnfinger i { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 248, 234, .9); box-shadow: 0 0 0 6px rgba(255, 248, 234, .25), 0 6px 18px rgba(0, 0, 0, .55); }
@media (prefers-reduced-motion: no-preference) {
  .lsnfinger.tap i { animation: lsntap 1.4s ease-in-out infinite; }
  .lsnfinger.drag i { animation: lsndrag 2.2s cubic-bezier(.5, 0, .3, 1) infinite; }
  .lsnfinger.holddrag i { animation: lsnhold 2.8s cubic-bezier(.5, 0, .3, 1) infinite; }
}
@keyframes lsntap { 0% { transform: scale(1.35); opacity: 0; } 30% { transform: scale(.82); opacity: 1; } 55% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@keyframes lsndrag { 0% { transform: translate(0, 0) scale(1.3); opacity: 0; } 12% { transform: translate(0, 0) scale(.85); opacity: 1; } 72% { transform: translate(var(--dx), var(--dy)) scale(.85); opacity: 1; } 84% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes lsnhold { 0% { transform: translate(0, 0) scale(1.3); opacity: 0; } 10% { transform: translate(0, 0) scale(.85); opacity: 1; box-shadow: 0 0 0 6px rgba(255, 248, 234, .25); } 28% { transform: translate(0, 0) scale(.85); box-shadow: 0 0 0 16px rgba(242, 196, 109, .45); } 78% { transform: translate(var(--dx), var(--dy)) scale(.85); opacity: 1; } 88% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.lsnbar { position: fixed; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); pointer-events: auto; padding: 12px 16px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--amber); box-shadow: 0 14px 40px rgba(0, 0, 0, .6); transition: top .3s var(--ease-out, ease); }
.lsnbar[hidden] { display: none; }
.lsnkick { font: 600 10.5px/1 var(--f-disp); letter-spacing: .2em; text-transform: uppercase; color: var(--amber); margin-bottom: 7px; padding-right: 130px; min-height: 12px; }
.lsnkick:empty { display: none; }
.lsnline { font: 700 19px/1.2 var(--f-disp); letter-spacing: .02em; color: var(--ink); text-wrap: balance; }
.lsnsub { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: #D8CDE6; text-wrap: pretty; }
.lsnsub[hidden] { display: none; }
.lsnbtns:not(:empty) { display: flex; justify-content: flex-end; margin-top: 10px; }
.lsnnext, .lsncard [data-k="go"], .lsncard [data-k="ok"], .lsncard [data-k="first"] { background: var(--amber); color: #1A1204; padding: 9px 18px; border-radius: 9px; font-weight: 700; }
.lsnskip { position: absolute; top: 8px; right: 10px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; }
.lsnskip:hover, .lsnskip:focus-visible { color: var(--ink); border-color: var(--muted); }
.lsnmodal { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: auto; }
.lsnmodal[hidden] { display: none; }
.lsncard { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: lrnin .3s var(--ease-out, ease); }
.lsncard h2 { margin: 0 0 10px; font: 700 24px/1.12 var(--f-disp); letter-spacing: .5px; text-transform: uppercase; text-wrap: balance; }
.lsncard p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: #D8CDE6; text-wrap: pretty; }
.lsnread { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
.lsnread img { width: 100%; border-radius: 9px; box-shadow: 0 10px 28px rgba(0, 0, 0, .55); }
.lsnread > div { min-width: 0; }
.lsncost { margin: -2px 0 10px; font-size: 14px; color: #D8CDE6; }
.lsncost .ore { font-weight: 700; color: #F0A35E; }
.lsnstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.lsnstat { display: grid; grid-template-columns: auto auto; column-gap: 8px; padding: 7px 9px; border-radius: 9px; background: rgba(14, 10, 28, .55); border: 1px solid var(--line); }
.lsnstat b { font: 600 11px/1.3 var(--f-disp); letter-spacing: .1em; color: var(--amber); }
.lsnstat .v { font: 700 17px/1 var(--f-num); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.lsnstat > span:last-child { grid-column: 1 / -1; font-size: 12px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
@media (max-width: 760px), (max-height: 500px) {
  .lsnread { grid-template-columns: 1fr; }
  .lsnread img { width: 46%; justify-self: center; }
  .lsnline { font-size: 17px; }
  .lsnbar { padding: 10px 14px 12px; }
  .lsnchip { padding: 6px 4px; }
  .lsnchip b { font-size: 9px; letter-spacing: .02em; line-height: 1.25; }
  .lsnchip span { display: none; }
}
/* A wrong move in the lesson (26 Nov 2026): the bar turns to say what to do instead, and the combat view has no Details
   (its controls by hand could end the fight with the enemy ship still there, and the lesson could not go on). */
.lsnbar.wrong { border-color: var(--danger, #E36F5A); }
.lsnbar.wrong .lsnline { color: #FFD9CF; }
body.lesson #combat [data-a="byhand"] { display: none; }
/* While the lesson runs, the other helpers stand aside. */
body.lesson #rulesbub, body.lesson #rulesbubtip, body.lesson #tipstack, body.lesson #trackstrip, body.lesson #coach { display: none !important; }
/* No choices before the lesson (Theo, 14 Nov 2026): it is always the Terran starter, so no picker or set-up panel. */
body.lesson #setupsec, body.lesson #seatflow, body.lesson #monboard { display: none !important; }
/* Teams (20 Nov 2026): the set-up panel's team row */
#teamrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
#teamrow[hidden] { display: none; }
#teamrow .teamcol { display: grid; gap: 4px; }
#teamrow .teamcol > b { font: 600 12px/1 var(--f-disp); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
#teamrow .teamseat { font-size: 13px; padding-left: 8px; border-left: 3px solid var(--c); }
#teamrow small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
/* Ranked (20 Nov 2026): a player sees legal play only (app.js sets body.rankedplay); the admin sees the by-hand tools, marked */
body.rankedplay .cheat, body.rankedplay #res .b, body.rankedplay #mrespop button { display: none !important; }
body.rankedplay.gamestarted [data-act="mulligan"], body.rankedplay.gamestarted [data-setup="mulligan"], body.rankedplay.gamestarted:not(.casualbound) #stand { display: none !important; }
/* A Casual game with the Referee on (21 Nov 2026) is held to the rules too, but the room is still the host's: a new game and clearing the table stay. */
body.rankedplay.casualbound #reset, body.rankedplay.casualbound #cleartable { display: inline-block !important; }   /* the opening hand only */
body.rankedadmin .cheat, body.rankedadmin #res .b { outline: 1px dashed var(--amber); outline-offset: 2px; }
body.rankedadmin #makesec h2::after, body.rankedadmin #traysec h2::after { content: "admin"; font: 400 10px/1 var(--f-body); letter-spacing: .1em; color: var(--amber); border: 1px solid var(--amber); border-radius: 4px; padding: 2px 5px; }
body.rankedadmin footer::before { content: "Dashed: admin tools"; flex: 1 1 100%; font-size: 11px; color: var(--amber); }
/* Settings, folded shut by default */
#settingssec h2 { margin: 0; }
#settingsbody { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 13px; }
#settingsbody[hidden] { display: none; }
/* Ongoing Events attached to a hex: diamonds in the owner's colour along the bottom edge of the hex; on a unit, a badge (20 Nov 2026) */
#oglayer { position: absolute; inset: 0; pointer-events: none; }
.ogm { position: absolute; transform: translate(-50%, 30px); display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 18px; background: rgba(14, 10, 28, .82); box-shadow: 0 0 0 1px rgba(241, 230, 208, .35); pointer-events: auto; cursor: pointer; z-index: 3; }
.ogm i { width: 30px; height: 30px; background: var(--og); transform: rotate(45deg); border-radius: 5px; box-shadow: 0 0 0 3px rgba(14, 10, 28, .9), 0 0 14px var(--og); }
.ogm b { font: 700 30px/1 var(--f-num); color: var(--ink); margin-left: 2px; }
.ogbadge { position: absolute; right: -10px; bottom: -10px; min-width: 38px; height: 38px; display: grid; place-items: center; font: 700 22px/1 var(--f-num); color: #0E0A1C; background: var(--og); border-radius: 4px; transform: rotate(45deg); box-shadow: 0 0 0 2px rgba(14, 10, 28, .9); cursor: pointer; z-index: 4; }
/* the hexes a picker may choose (referee.js, 20 Nov 2026) */
#hexes polygon.pickable { stroke: var(--teal); stroke-width: 7; stroke-opacity: .9; fill: rgba(79, 185, 181, .14); }
/* The lane picker (referee.js, 24 Nov 2026): the lane an effect would land on, lit from end to end. */
#hexes polygon.lanelit { stroke: var(--amber); stroke-width: 7; stroke-opacity: .95; fill: rgba(242, 196, 109, .2); }
#refask .lanepick .lp-seg { display: inline-flex; margin-right: 10px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(241, 230, 208, .22); }
#refask .lanepick .lp-seg button { width: auto; height: 40px; font-size: 14px; border: 0; border-radius: 0; min-width: 0; padding: 6px 12px; font-weight: 600; }
#refask .lanepick .lp-seg button.on { background: var(--amber); color: #1A1204; }
#refask .lanepick .lp-seg button:disabled { opacity: .35; }
#refask .lanepick .lp-v { min-width: 2.2em; text-align: center; }

/* Keyword explainers outside a game (Decks section, deckbuilder): a list, the word above its meaning. */
.kwx.kwlist { display: block; }
.kwx.kwlist dt { margin-top: 10px; }
.kwx.kwlist dt:first-child { margin-top: 0; }
.kwx .kwn { margin-left: 6px; opacity: .7; font-weight: 400; }
.kwx .kwmore { display: block; margin-top: 2px; opacity: .72; }
.deckkw { margin-top: 18px; }
.deckkw h2 { margin: 0 0 8px; font-size: 14px; }
.kwhelp { margin-top: 10px; font-size: 13px; }
.kwhelp summary { cursor: pointer; opacity: .85; }
.kwhelp[open] summary { margin-bottom: 8px; }

/* A unit whose stats are not its printed ones (20 Nov 2026): the live numbers drawn over the card picture's stat row.
   Every card picture is 411 x 561; the stat row is y 315 to 361, its four cells x 33-120, 122-204, 206-289, 291-375, the
   printed numbers at y 336 to 351, the cell colour rgb(26, 26, 36). .stov fills a box the size of the picture. */
.cardpic { position: relative; display: inline-block; line-height: 0; }
.stovhold { display: contents; }
.stov { position: absolute; inset: 0; pointer-events: none; container-type: inline-size; line-height: 1; }
.stov .stc { position: absolute; top: 59.2%; height: 4.9%; display: flex; align-items: center; justify-content: center; background: rgb(26, 26, 36); }
.stov .st-atk { left: 8.6%; width: 20.2%; }
.stov .st-def { left: 30%; width: 19.5%; }
.stov .st-hp { left: 50.5%; width: 19.6%; }
.stov .st-mov { left: 71.2%; width: 19.6%; }
.stov .stc b { position: relative; font: 400 5.6cqw/1 Michroma, var(--f-disp); }
.stov .stc.up b { color: #4dff9a; text-shadow: 0 0 1.6cqw rgba(77, 255, 154, .55); }
.stov .stc.down b { color: #ff5f57; text-shadow: 0 0 1.6cqw rgba(255, 95, 87, .55); }
/* Since the faction card fronts (24 Nov 2026) each faction's stat plaque has its own colour, so the cover takes it from
   the card's faction (data-sfac, app.js). The Apostolis card is light: its changed numbers are darker and do not glow. */
.stov[data-sfac="APO"] .stc { background: rgb(240, 232, 213); }
.stov[data-sfac="APO"] .stc.up b { color: #17803F; text-shadow: none; }
.stov[data-sfac="APO"] .stc.down b { color: #C4281F; text-shadow: none; }
.stov[data-sfac="TRN"] .stc { background: rgb(49, 35, 78); }
.stov[data-sfac="BLT"] .stc { background: rgb(39, 56, 26); }
.stov[data-sfac="CON"] .stc { background: rgb(13, 50, 61); }
.stov[data-sfac="DEF"] .stc { background: rgb(68, 33, 25); }
.stov[data-sfac="DUN"] .stc { background: rgb(67, 43, 18); }
.stov .stc sup { position: absolute; left: 100%; top: -.5em; margin-left: .12em; font: 700 2.9cqw/1 var(--f-num); letter-spacing: 0; white-space: nowrap; text-shadow: none; }
#previewst { position: fixed; z-index: 76; pointer-events: none; display: none; }
.cardview .cardpic { width: 300px; max-width: 100%; align-self: flex-start; }
.cardview .cardpic img { width: 100%; max-width: none; margin: 0; display: block; }
.mcardin .cardpic .stov { transform: translateY(24px) scale(.92); transition: transform .4s var(--ease-out); }
#mcard.on .mcardin .cardpic .stov { transform: none; }
.piece.bufpulse img { animation: bufglow 1.4s ease-out; }
@keyframes bufglow { 0% { filter: brightness(2.2) drop-shadow(0 0 26px #5dffa8); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) { .piece.bufpulse img { animation: none; } }
.kwx.nowx { margin-bottom: 8px; }
.kwx.nowx b.up { color: #5dffa8; }
.kwx.nowx b.down { color: #ff8a84; }
#previewkw .kwx.nowx { margin-bottom: 8px; }

/* The Invite panel (20 Nov 2026): the game code large, the link, a QR code, and TV mode. */
.invite { max-width: 440px; }
.invite .invlabel { margin: 14px 0 2px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.invite .invcode { margin: 0; font: 400 clamp(28px, 8vw, 40px)/1.15 var(--f-disp); letter-spacing: .08em; color: var(--amber, #FFB81C); user-select: all; -webkit-user-select: all; }
.invite .invhint { margin: 6px 0 10px; font-size: 14px; line-height: 1.45; opacity: .9; }
.invite .invrow { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.invite .invrow input { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 8px; border: 1px solid rgba(241, 230, 208, .25); background: rgba(0, 0, 0, .3); color: inherit; font-size: 14px; }
.invite .invrow button { min-height: 40px; padding: 0 14px; }
.invite .invqr { display: flex; align-items: center; gap: 14px; margin: 12px 0 4px; font-size: 13px; opacity: .95; }
.invite .invqr svg { width: 132px; height: 132px; flex: none; border-radius: 8px; }

/* Choosing a bot's deck (21 Nov 2026). */
.botdecks { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.botdecks .bdg small { display: block; margin-bottom: 5px; font-family: var(--f-disp); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.botdecks .bdg > div { display: flex; flex-wrap: wrap; gap: 6px; }

/* The combat window, between a press and the Table's answer (21 Nov 2026; combatclicks.js). */
#combat.cbusy button[data-wait] { opacity: .5; cursor: progress; }
#combat.cbusy .clgo[data-wait]::after { content: ' 6'; }
/* Pinch and pan, said once on a phone (26 Nov 2026, mobile.js). A plain line over the board: no animation, outside #world. */
#mpinch { position: fixed; z-index: 57; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 8px; padding: 7px 6px 7px 14px; border: 1px solid var(--amber); border-radius: 10px; background: rgba(20, 15, 40, .95); color: var(--ink); font-size: 14px; line-height: 1.35; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
#mpinch[hidden] { display: none; }
#mpinch button { flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 20px; line-height: 1; opacity: .75; box-shadow: none; }
