/* ============ THE MOODY GAME TABLE — design tokens ============ */
:root {
  --felt-0:#0b0e12; --felt-1:#131920; --felt-2:#1b232d; --felt-3:#26313e;
  --line:#2b3644; --line-hi:#3a4a5c;
  --ink:#eef2f6; --dim:#8b9bad;
  --gold:#e8b64c; --gold-soft:rgba(232,182,76,.16);
  --ember:#e0604f; --leaf:#5fc46f; --sky:#5aa9e6; --violet:#a78bda;
  --r-s:8px; --r-m:12px; --r-l:18px;
  --sh-1:0 2px 10px rgba(0,0,0,.5); --sh-2:0 10px 34px rgba(0,0,0,.6);
  --cw:84px; --ch:112px;              /* the card: a chunky 3:4 vertical */
  --face-a:#f5ecdb; --face-b:#e7dbc2; --face-ink:#2a2620;
  --back-a:#202b3a; --back-b:#141c28;
}
* { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body { color:var(--ink); font:15px/1.45 -apple-system,'Segoe UI',sans-serif;
  background:radial-gradient(1100px 700px at 50% -12%, #1a222c 0%, var(--felt-0) 62%) fixed; }
button { font:inherit; color:inherit; background:var(--felt-2);
  border:1px solid var(--line); border-radius:var(--r-s); padding:9px 14px;
  cursor:pointer; transition:border-color .15s, transform .1s; }
button:hover { border-color:var(--gold); }
button:active { transform:scale(.97); }
button:disabled { opacity:.35; cursor:default; }
.dim { color:var(--dim); font-size:12.5px; }

/* ============ THE CHIP — card / die-face / token ============ */
.pcard { width:var(--cw); height:var(--ch); perspective:800px; flex:none;
  transition:transform .16s var(--ease-pop); }
.pcard.mini { --cw:58px; --ch:77px; }
.pcard-inner { position:relative; width:100%; height:100%;
  transform-style:preserve-3d; transition:transform var(--dur-flip) var(--ease-pop); }
.pcard.flipped .pcard-inner { transform:rotateY(180deg); }
.pface { position:absolute; inset:0; backface-visibility:hidden;
  border-radius:10px; overflow:hidden; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:3px; box-shadow:var(--sh-1); }
/* face-up: warm paper, a tint header band, an inner highlight for depth.
   NEVER position:relative here — .pface's absolute inset:0 is what makes the
   face FILL the card; a relative override collapses it to content height
   (the squat-card bug the paint-fill law now guards). */
.pfront { background:
    radial-gradient(125% 80% at 50% -5%, #fcf5e7 0%, var(--face-a) 48%, var(--face-b) 100%);
  color:var(--face-ink); border:1px solid #c9ba98;
  box-shadow:var(--sh-1), inset 0 1px 0 rgba(255,255,255,.65); }
/* the tint is a crisp top accent bar + a faint identity wash — not a block */
.ctint { position:absolute; top:0; left:0; right:0; height:4px;
  background:var(--tint,#9a8f78); z-index:2; }
.pfront::before { content:''; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(78% 52% at 50% 24%, var(--tint,transparent) 0%, transparent 62%);
  opacity:.13; }
.cicon { font-size:38px; line-height:1; z-index:1;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.16)); }
.pcard.mini .cicon { font-size:24px; }
/* THE CHIP NAME — one line, ellipsized, at every size (a long single word like
   Battlecruiser can never mid-word-wrap on a 72px card). The full name lives on
   the hero and the inspector, which have the width to wrap at spaces. */
.cname { font-size:10px; font-weight:800; letter-spacing:.02em; text-align:center;
  line-height:1.05; overflow:hidden; padding:0 5px; max-width:100%;
  white-space:nowrap; text-overflow:ellipsis;
  text-transform:uppercase; color:#6b6049; z-index:1; }
.csub { position:absolute; top:4px; left:5px; z-index:2;
  min-width:15px; height:15px; padding:0 3px; border-radius:5px;
  display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:800; color:#fff; background:var(--tint,#8a7a58);
  box-shadow:0 1px 2px rgba(0,0,0,.28); }
.pcard.mini .cname, .pcard.mini .csub { display:none; }
/* THE CARD BADGE — the game's word on a card you hold (an expiry, a
   countdown): a pill in the bottom-left corner — the corner a fanned card
   keeps in view, the next card covering the right — in the face's own ink
   (paper in either theme), below the name at every size. A badged face
   lifts its icon + name a hair so the pill never touches them. */
.cbadge { position:absolute; left:4px; bottom:2px; z-index:3; box-sizing:border-box;
  max-width:calc(100% - 8px); height:13px; padding:0 5px; border-radius:999px;
  overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
  font-size:8.5px; font-weight:800; line-height:13px; letter-spacing:.01em;
  background:var(--face-ink); color:var(--face-a);
  box-shadow:0 1px 2px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.4); }
.pfront.badged { padding-bottom:6px; }
.pcard.mini .pfront.badged { padding-bottom:11px; }
.pcard.mini .cbadge { left:2px; bottom:2px; max-width:calc(100% - 4px); height:10px; padding:0 3px;
  font-size:7px; line-height:10px; letter-spacing:0; }
.pcard.hero .pfront.badged { padding-bottom:16px; }
.pcard.hero .cbadge { left:8px; bottom:8px; max-width:calc(100% - 16px); height:20px; padding:0 9px;
  font-size:12px; line-height:20px; }
/* the small RESTING chips (a committed slot, a pile top, the shared stage) show
   icon + number only — a long name (AMBASSADOR) mid-word-wraps at 72px. The name
   lives on the rail card, the hero, and the inspector, where there is room. */
.slot .cname, .piles .cname, .spile .cname, .stage .cname { display:none; }
/* face-down: branded, patterned back */
.pback { background:
    repeating-linear-gradient(45deg, rgba(232,182,76,.06) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, var(--back-a), var(--back-b));
  border:1px solid var(--line-hi); }
.bglyph { color:rgba(232,182,76,.45); font-size:24px;
  filter:drop-shadow(0 0 8px rgba(232,182,76,.22)); }
.pcard.mini .bglyph { font-size:16px; }
/* states */
.pcard.playable { cursor:pointer; }
.pcard.playable:hover { transform:translateY(-4px); }
.pcard.selected { transform:translateY(-8px) scale(1.02); }
.pcard.selected .pface { box-shadow:0 0 0 2px var(--gold), 0 12px 24px rgba(0,0,0,.5); }
.pcard.glow .pface { box-shadow:0 0 0 2px var(--gold), 0 0 18px rgba(232,182,76,.5);
  animation:chipglow 1.3s ease-in-out infinite; }
@keyframes chipglow { 50% { box-shadow:0 0 0 2px var(--gold), 0 0 30px rgba(232,182,76,.85); } }
.pcard.dimmed { opacity:.4; filter:saturate(.65); }
.game.picked { border-color:var(--gold); background:var(--gold-soft); }
.gicon { font-size:20px; }

/* multiplayer join + lobby */
input { font:inherit; color:var(--ink); background:var(--felt-2);
  border:1px solid var(--line); border-radius:var(--r-s); padding:9px 12px; }
.gunit .avatar { width:26px; height:26px; font-size:12px; }
.gunit .meter .pip { width:5px; height:5px; }

/* seat tile */
@keyframes breathe { 50% { box-shadow:0 0 0 1px var(--leaf),
  0 0 36px rgba(95,196,111,.45), var(--sh-1); } }
@keyframes hitshake {
  25% { transform:translate(-50%,-50%) translateX(-6px); }
  75% { transform:translate(-50%,-50%) translateX(6px); } }
.trow { display:flex; gap:10px; align-items:center; }
.avatar { width:34px; height:34px; border-radius:50%; border:2px solid;
  display:flex; align-items:center; justify-content:center; font-weight:800;
  font-size:14px; flex:none; }
.tmain { min-width:0; flex:1; }
.pname { font-weight:700; display:flex; align-items:center; gap:6px; }
.pend { color:var(--gold); font-size:9px; animation:pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity:.25; } }
.skull { position:absolute; top:6px; right:10px; font-size:18px;
  transform:rotate(12deg); }

/* meters */
.meters { display:flex; flex-wrap:wrap; gap:8px 12px; margin-top:5px; }
.meter { display:flex; align-items:center; gap:5px; }
.micon { font-size:12px; }
.pips { display:flex; gap:2.5px; }
.pip { width:7px; height:7px; border-radius:50%; background:#2a3441;
  border:1px solid #35414f; }
.t-life  .pip.on { background:var(--leaf);  box-shadow:0 0 6px rgba(95,196,111,.55); border-color:transparent; }
.t-score .pip.on { background:var(--gold);  box-shadow:0 0 6px rgba(232,182,76,.55); border-color:transparent; }
.t-energy .pip.on{ background:var(--sky);   box-shadow:0 0 6px rgba(90,169,230,.55); border-color:transparent; }
.t-gems  .pip.on { background:var(--violet);box-shadow:0 0 6px rgba(167,139,218,.55); border-color:transparent; }
.t-vote  .pip.on { background:var(--sky); border-color:transparent; }
.t-buff  .pip.on { background:var(--gold); box-shadow:0 0 6px rgba(232,182,76,.55); border-color:transparent; }
.meter.counter .mval { font-weight:800; font-size:14px; }
.t-life.counter .mval { color:var(--leaf); } .t-score.counter .mval { color:var(--gold); }
.t-energy.counter .mval { color:var(--sky); } .t-gems.counter .mval { color:var(--violet); }
.t-buff.counter .mval { color:var(--gold); }
.t-vote.counter .mval { color:var(--sky); }
.pile { position:relative; }
.zchip { background:var(--felt-3); border-radius:6px; padding:2px 7px;
  font-size:11.5px; color:var(--dim); }
.secrets { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.chip.secret { background:#241f31; border:1px solid #38304e; border-radius:6px;
  padding:2px 8px; font-size:12px; }
.plabel { font-size:10.5px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--dim); }

/* ============ THE ACTION AREA ============ */
/* Inline by default — content flows right under the stage (grid-centric, no
   dead middle). Only THE HAND floats: a hand lives at the bottom edge and the
   throw gesture needs the runway. */
.dock { display:flex; flex-direction:column; align-items:center; gap:8px;
  margin-top:14px; background:var(--felt-1); border:1px solid var(--line);
  border-radius:var(--r-l); padding:14px; box-shadow:var(--sh-1); }
.dock.floating { position:fixed; left:0; right:0; bottom:0; z-index:30;
  margin:0; border:none; border-radius:0; box-shadow:none;
  background:linear-gradient(180deg, rgba(11,14,18,0) 0%, rgba(11,14,18,.88) 22%, #0b0e12 60%);
  padding:26px 14px calc(12px + env(safe-area-inset-bottom)); }
.moves,.opts { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.dock .verb.cardverb { display:flex; align-items:center; gap:9px; padding:5px 16px 5px 6px;
  border-left:3px solid var(--tint, var(--gold)); }
.dock .verb .vname { font-size:13px; font-weight:700; letter-spacing:.02em; }
.opt { border-radius:var(--r-m); }
.opt.card { padding:5px; background:transparent; }
.confirm { border-color:var(--leaf); background:rgba(95,196,111,.1); font-weight:700; }
.confirm.small { padding:6px 12px; min-height:44px; }
.ghost { background:transparent; border-color:transparent; color:var(--dim); }
.stagedrow { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:center; }
.stagedchip { background:var(--felt-3); border-radius:7px; padding:3px 9px; font-size:12.5px; }

/* THE HAND */
.handwrap { display:flex; flex-direction:column; align-items:center; width:100%; }
/* rail cards are real, named cards; grabbable at rest (vertical drag = grab,
   so horizontal touch still scrolls the rail) */
.railcard { flex:none; scroll-snap-align:center; cursor:grab;
  touch-action:pan-x; transition:transform .16s; }
.railcard:hover { transform:translateY(-7px); }

/* the GRABBED card — one look, from the rail OR the giant. Scale is GSAP's; this
   is the lift shadow + a hair of tilt, and pointer-events:none so the target
   BENEATH the pointer is what elementFromPoint hit-tests. */
.grabbing { pointer-events:none; z-index:60; cursor:grabbing;
  filter:drop-shadow(0 16px 26px rgba(0,0,0,.55)); }
/* a legal drop target lit under the grabbed card */

/* the GIANT immersive card — the art IS the view; rules ON the card, no panel */
.handopenwrap { position:fixed; inset:0; z-index:46; display:flex;
  align-items:center; justify-content:center;
  padding:24px 0 calc(24px + env(safe-area-inset-bottom)); }
.openbackdrop { position:absolute; inset:0; background:rgba(5,7,10,.74);
  backdrop-filter:blur(4px); transition:opacity .2s; }
.giantwrap { position:relative; z-index:1;
  animation:openup var(--dur-pop) var(--ease-pop); }
@keyframes openup { from { transform:translateY(40px) scale(.85); opacity:0; } }
.giantname { font-weight:800; font-size:22px; margin-top:12px; letter-spacing:.02em; }
.giantrules { font-size:15px; line-height:1.5; text-align:center; margin-top:8px;
  color:#4a3d28; max-width:min(72vw,270px); }
.tools { display:flex; gap:8px; }
.dice { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.die { width:52px; height:52px; border-radius:12px; font-size:20px;
  background:linear-gradient(168deg,var(--face-a),var(--face-b));
  color:var(--face-ink); border:1px solid #cbbd9d; box-shadow:var(--sh-1);
  display:flex; align-items:center; justify-content:center; }
.sheet { pointer-events:auto; position:fixed; left:0; right:0; bottom:0;
  max-height:46vh; overflow-y:auto; background:#10151bee; backdrop-filter:blur(8px);
  border-top:1px solid var(--line); padding:12px 18px 20px; z-index:40; }
@keyframes sheetup { from { transform:translateY(40%); opacity:.4; } }
@keyframes cardpop { from { transform:translate(-50%,-50%) scale(.9); opacity:0; } }
.rulehint { font-size:12px; color:var(--gold); opacity:.6; font-weight:700; }
.igrid .pcard { cursor:pointer; }
.spile,.pile,.slot,.avatar { cursor:pointer; }

/* ============ FX (outside the Replicant root) ============ */
#fx-layer { position:fixed; inset:0; pointer-events:none; z-index:50; }
/* card flight */
.flywrap { position:absolute; transform:translate(-50%,-50%); }
.flywrap .pcard-inner { transition:transform var(--dur-flip) var(--ease-pop); }
/* the flight pair: the front face is pre-rotated so UNflipped shows the BACK
   and .flipped rotates the face in — without this, .flipped hides BOTH faces
   (backface-visibility) and the card vanishes mid-flight */
.flywrap .pfront { transform:rotateY(180deg); }
.flywrap.rise-slow { animation:risecard 1.4s ease-out forwards; }
@keyframes risecard { 0%{opacity:0} 10%{opacity:1} 80%{opacity:1}
                      100%{opacity:0; margin-top:-30px} }
.flyn { position:absolute; top:-8px; right:-10px; background:var(--gold);
  color:#221a08; font-size:11px; font-weight:800; border-radius:9px;
  padding:1px 6px; }
.tracerdot { display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; font-size:18px; border-radius:50%;
  background:radial-gradient(circle at 40% 35%, #ffd98a, var(--ember));
  box-shadow:0 0 16px 3px rgba(224,96,79,.7); filter:drop-shadow(0 2px 4px rgba(0,0,0,.5));
  animation:tracerspin .4s linear infinite; }
@keyframes tracerspin { to { transform:rotate(360deg); } }
.dicerow { position:absolute; transform:translate(-50%,-50%); display:flex; gap:6px;
  animation:fadeout .5s ease-in forwards; animation-delay:1.6s; }
@keyframes fadeout { to { opacity:0; } }
.die-fx { width:34px; height:34px; border-radius:8px; font-size:16px; font-weight:800;
  background:linear-gradient(168deg,var(--face-a),var(--face-b));
  color:var(--face-ink); border:1px solid #cbbd9d; box-shadow:var(--sh-1);
  display:flex; align-items:center; justify-content:center;
  animation:tumble var(--dur-die-spin) var(--ease-pop) backwards; }
@keyframes tumble { 0% { transform:translateY(-46px) rotate(220deg) scale(.5);
                          opacity:0; }
                    60% { opacity:1; }
                    100% { transform:none; } }
@keyframes rise { 0%{opacity:0; margin-top:10px} 12%{opacity:1}
                  100%{opacity:0; margin-top:-52px} }
@keyframes land { 0%{opacity:0; transform:translate(-50%,-50%) scale(.86)}
                  14%{opacity:1; transform:translate(-50%,-50%) scale(1)}
                  85%{opacity:1} 100%{opacity:0} }

/* the resting card a flight is landing on — hidden until the sprite hands off
   at touchdown, so the card identity is in exactly ONE place every frame (L4).
   `visibility:hidden` keeps its box (layout, the flight's endpoint) intact. */
.landing { visibility:hidden; }

/* ============ MOBILE ============ */
@media (max-width: 480px) {
  /* the gutter MUST match .backpack's negative margin (-14px) or the backpack
     overhangs and the page scrolls sideways (the enshrined 4px h-overflow) */
  .table { padding:10px 14px 32px; }
  .table.has-hand { padding-bottom:calc(180px + env(safe-area-inset-bottom)); }
  .seats { grid-template-columns:1fr 1fr; gap:8px; }
  .gamegrid { grid-template-columns:1fr; }
  :root { --cw:78px; --ch:104px; }
  .hcard { margin:0 -12px; }
  .die { width:48px; height:48px; }
}
/* a card too small to READ drops its text — icon only (mid-enter, any
   transient tininess): text that cannot be read is never rendered */
@container (max-width: 56px) {
  .gcanvas .sent .cname, .gcanvas .sent .csub, .gcanvas .sent .ctype,
  .gcanvas .sent .cdesc, .gcanvas .sent .cpower { display:none !important; }
}

/* THE HERO — the expanded card (same node, bigger box; the morph is the
   transition). Deep face slots reveal at this size only. */
.ctype, .cdesc, .cpower { display:none; }
/* a seat marker on the stage */
.sseat { display:flex; flex-direction:column; align-items:center; gap:5px;
  background:linear-gradient(180deg,var(--felt-2),var(--felt-1));
  border:1px solid var(--line); border-radius:var(--r-m); padding:8px 14px;
  box-shadow:var(--sh-1); cursor:pointer; justify-content:center; }
.sstext { text-align:center; }
.smeters { display:flex; gap:8px; justify-content:center; margin-top:3px; }

/* ============ V5 THREE-REGION LAYOUT — tiles · mat · backpack ============ */
/* z-index tokens: the stacking order in one place (was scattered magic numbers).
   Normally the backpack sits BELOW the fx-layer; during a drag it lifts above. */
:root { --z-backpack:20; --z-fx:50; --z-grab:60; --z-drag:70; }
/* the mat wrapper centers its content and fills the space between tiles and hand
   — so a card game's play stage occupies the middle instead of a dead band */
.matwrap { justify-content:center; }

/* THE PLAY STAGE — the central felt where committed cards meet and resolve */
.playstage { display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:20px; min-height:240px;
  background:radial-gradient(120% 78% at 50% 50%, rgba(95,196,111,.06), transparent 72%);
  border:1px solid var(--line); border-radius:var(--r-l); padding:22px 14px; }
.playslot { display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer; }                          /* you sit at the bottom of the felt */
.slotempty { width:var(--cw); height:var(--ch); border:2px dashed var(--line-hi);
  border-radius:12px; display:flex; align-items:center; justify-content:center;
  color:var(--line-hi); font-size:30px; }

/* opponents — satellite tiles (facing = a duel column; grid = a table) */

/* the mat — region panels (board grid & shared stage keep their own classes) */
.matregions { display:flex; gap:10px; align-items:stretch; }
.matregions .rocc { display:flex; flex-wrap:wrap; gap:8px; align-content:flex-start; }

/* the pinned YOU strip — your tile as the backpack head + a self-target surface */
.youstrip { display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background:linear-gradient(180deg,var(--felt-2),var(--felt-1));
  border:1px solid var(--line); border-radius:var(--r-m); padding:7px 11px; }
.youstrip .trow { display:flex; align-items:center; gap:10px; flex:1 1 auto; min-width:0; }
.youstrip .tmain { flex:1 1 auto; min-width:0; }
.youstrip .pname { font-weight:700; }
.youstrip .meters { display:flex; gap:8px; flex-wrap:wrap; }
.youstrip.glow { border-color:var(--gold); cursor:pointer;
  box-shadow:0 0 0 2px var(--gold), 0 0 22px -4px var(--gold); animation:pulse 1.4s ease-in-out infinite; }
.youstrip.dimmed { opacity:.4; }
.youstrip .secrets { width:100%; display:flex; gap:6px; flex-wrap:wrap; }

/* carry chips — forward-carried decision state (spy glimpse, riding spoils, …) */
.carry { display:flex; gap:6px; flex-wrap:wrap; margin-left:auto; }
.carrychip { display:inline-flex; align-items:center; gap:5px; font-size:11.5px;
  background:var(--felt-3); border:1px solid var(--line); border-radius:999px; padding:3px 10px; }
.carrychip .cl { color:var(--dim); } .carrychip .cv { font-weight:700; color:var(--gold); }

/* your piles inside the backpack */
.bppiles { display:flex; justify-content:center; }

/* ---- ARMING — the wiggling card waits; targets stay natively tappable ---- */
/* The cancel backdrop sits LOW (z-34); glowing targets and the armed card are
   RAISED above it, so a target tap lands on the target and any dead-space tap
   lands on the backdrop (= cancel). The backpack lifts too (the you-strip may
   glow for a self-target) while the rail dims out of reach. */
.armbackdrop { position:fixed; inset:0; z-index:34; background:transparent; }
.armedcard { position:fixed; left:50%; margin-left:calc(var(--cw) / -2 - 8px);
  bottom:calc(196px + env(safe-area-inset-bottom)); z-index:38; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:7px;
  filter:drop-shadow(0 16px 26px rgba(0,0,0,.6));
  animation:wiggle var(--dur-wiggle) ease-in-out infinite; }
.armedcard .armhint { font-size:12px; color:var(--gold); font-weight:700;
  white-space:nowrap; text-shadow:0 1px 6px #000; }
@keyframes wiggle { 0%,100% { transform:rotate(-3deg); }
                    50%     { transform:rotate(3deg) translateY(-4px); } }

/* the giant's ONE action — a visual affordance (the whole card is the button) */
.giantbtn { pointer-events:none; margin-top:14px; width:100%; padding:12px;
  border:none; border-radius:12px; font-weight:800; font-size:15px;
  background:linear-gradient(180deg, var(--gold), #caa23f); color:#141313;
  box-shadow:0 8px 18px -6px rgba(232,182,76,.55); }

/* THE MINI PERSONAL REVEAL — the tray tumbles IN PLACE on every fresh roll
   (each die is keyed by value + the viewer's roll generation, so a new roll
   REMOUNTS the dice and this mount animation plays — a same-value reroll
   still visibly answers the tap). Snappy, never an overlay — the executor
   skips the sprite while the tray is live. */
@keyframes diespin {
  0%   { transform: rotate(-300deg) scale(.35); opacity:.15; filter: blur(1.5px); }
  62%  { transform: rotate(14deg) scale(1.12);  opacity:1;   filter: blur(0); }
  100% { transform: none; }
}
.dice .die { animation: diespin var(--dur-die-spin) var(--ease-snap) backwards; }

/* THE MARKET — a browsable shelf of buyable cards (a shop, a deckbuilder's
   trade row). Always visible; affordable cards glow and buy in one tap. */
.market { display:flex; flex-direction:column; gap:7px; padding:10px 8px;
  border-radius:var(--r-l); background:rgba(255,255,255,.02); border:1px solid var(--line);
  width:100%; min-width:0; }
.marketrow { display:flex; gap:10px; overflow-x:auto; padding:2px 2px 6px;
  min-width:0; scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch; }
.marketrow::-webkit-scrollbar { height:0; }
.marketcard { position:relative; flex:none; scroll-snap-align:center;
  border-radius:12px; padding:4px; transition:transform .14s; }
.marketcard.buyable { cursor:pointer; }
.marketcard.buyable:hover { transform:translateY(-5px); }
.marketcard:not(.buyable) { opacity:.5; filter:saturate(.7); }
.marketcard.buyable .pcard .pface { box-shadow:0 0 0 2px var(--gold), 0 0 16px rgba(232,182,76,.45); }
.mkcost { position:absolute; bottom:2px; left:50%; transform:translateX(-50%);
  background:#221a08; color:var(--gold); font-size:11px; font-weight:800;
  border-radius:999px; padding:2px 9px; border:1px solid var(--gold); white-space:nowrap; }
.mkinfo { position:absolute; top:0; right:0; width:24px; height:24px; min-height:0;
  padding:0; border-radius:50%; font-size:12px; background:rgba(13,17,22,.85);
  color:var(--dim); border:1px solid var(--line); }

/* TRACKS — declared communal state resting on the mat (a mission scoreboard,
   the standing bid). Pips fill toward :max; counters/chips just read. */
.matwrap { display:flex; flex-direction:column; gap:10px; align-items:stretch;
  min-width:0; }
.tracks { display:flex; gap:14px; flex-wrap:wrap; justify-content:center;
  padding:8px 14px; border-radius:12px; background:rgba(255,255,255,.03); }
.track { display:inline-flex; align-items:center; gap:6px; font-size:13px; }
.track .ticon { font-size:15px; }
.track .tval { font-weight:800; }
.track .tlabel { color:var(--dim, #8a93a6); font-size:11px; }
.track .pips { display:inline-flex; gap:3px; }
.track .pip { width:9px; height:9px; border-radius:50%;
  background:rgba(255,255,255,.12); }
.track .pip.on { background:var(--ember, #e8a33d); }

/* the declared active-seat mark (Resistance's 👑) */
.seatmark { font-size:13px; }
.pstack { position:relative; width:100%; height:100%; }
.pstack .pcard { position:absolute; inset:0;
  box-shadow:2px 2px 0 rgba(0,0,0,.35), 4px 4px 0 rgba(0,0,0,.22); }
.pcount { position:absolute; top:-9%; right:-9%; z-index:3;
  min-width:38cqw; height:38cqw; padding:0 6cqw; border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-size:max(9px, 24cqw); font-weight:800; color:#141313;
  background:var(--gold); box-shadow:0 1px 3px rgba(0,0,0,.4); }
.pzname { position:absolute; left:0; right:0; bottom:-32cqw; z-index:2;
  text-align:center; font-size:max(8px, 20cqw); letter-spacing:.08em;
  text-transform:uppercase; color:var(--dim); pointer-events:none; }
/* the market cost badge rides the card corner */
.scost { position:absolute; bottom:-8%; left:50%; transform:translateX(-50%);
  z-index:3; padding:1cqw 8cqw; border-radius:999px; white-space:nowrap;
  font-size:max(9px, 22cqw); font-weight:800; color:var(--gold);
  background:rgba(11,14,18,.85); border:1px solid var(--gold-soft); }
/* the CLAIMED stamp — a bought market card is marked the moment the buy
   stages (the projected taken-ledger), before the row settles */
.sclaimed { position:absolute; top:-7%; right:-7%; z-index:3;
  width:32cqw; height:32cqw; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:var(--leaf); color:#0b0e12; font-weight:900;
  font-size:max(9px, 20cqw); box-shadow:0 2px 8px rgba(0,0,0,.45); }
/* the declared badge on an ATTACHED card — a base's 🛡 defense */
.sdef { position:absolute; top:-9%; left:50%; transform:translateX(-50%);
  z-index:3; padding:1cqw 8cqw; border-radius:999px; white-space:nowrap;
  font-size:max(9px, 22cqw); font-weight:800; color:var(--leaf);
  background:rgba(11,14,18,.85); border:1px solid rgba(95,196,111,.5); }
@keyframes seatpulse { 50% { box-shadow:0 0 0 2px var(--gold), 0 0 34px rgba(232,182,76,.85); } }
/* TRACKS on the felt — declared :data as chips (pips / counter / a named chip) */
.strack { width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  gap:4cqw; padding:0 5cqw; box-sizing:border-box; border-radius:999px;
  background:rgba(11,14,18,.72); border:1px solid var(--line); white-space:nowrap; overflow:hidden; }
.strack .ticon  { font-size:max(10px, 48cqh); line-height:1; }
.strack .tval   { font-size:max(10px, 42cqh); font-weight:800; color:var(--gold); }
.strack .tlabel { font-size:max(8px, 26cqh); color:var(--dim); letter-spacing:.06em; text-transform:uppercase;
  overflow:hidden; text-overflow:ellipsis; }
.strack .pips   { gap:max(1px, 2cqh); flex:0 0 auto; }
.strack .pip { width:max(5px, 26cqh); height:max(5px, 26cqh); }
.strack .pip.on { background:var(--gold); border-color:transparent; box-shadow:0 0 5px rgba(232,182,76,.55); }
/* THE LOG — a bare table's center: the last beats, tappable into history */
.slog { width:100%; height:100%; box-sizing:border-box; padding:4cqw 5cqw;
  display:flex; flex-direction:column; justify-content:flex-end; gap:1.2cqw;
  border-radius:var(--r-l); border:1px dashed var(--line-hi);
  background:radial-gradient(90% 70% at 50% 50%, rgba(95,196,111,.05), transparent 72%);
  overflow:hidden; cursor:pointer; }
.slog .sline { font-size:max(10px, 5.2cqw); line-height:1.35; color:var(--ink, #e8e4d8);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.slog .sline.dim { color:var(--dim); text-align:center; }
.slog .sline:last-child { color:var(--gold); font-weight:700; }
