/* Set & Steal — card-table theme, mobile first. */
:root {
  --felt: #12704a;
  --felt2: #0b4d31;
  --felt3: #062b1b;
  --paper: #fbf8f1;
  --ink: #1f1d1a;
  --muted: #77736a;
  --line: #e4ddcd;
  --gold: #f2c14e;
  --gold-d: #c7961c;
  --danger: #d1495b;
  --ok: #2a9d8f;
  --glass: rgba(0, 0, 0, .24);
  --glass2: rgba(255, 255, 255, .1);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; color: #fff;
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
body {
  background: radial-gradient(130% 90% at 50% 25%, var(--felt) 0%, var(--felt2) 55%, var(--felt3) 100%) fixed var(--felt2);
  overflow: hidden;
}
#app { position: relative; max-width: 520px; height: 100vh; height: 100dvh; margin: 0 auto; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-user-select: none; user-select: none; }
button[disabled] { cursor: default; }
input { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: #ffd3d8; background: rgba(209, 73, 91, .35); padding: 8px 12px; border-radius: 10px; text-align: center; }

/* ---------- icons ---------- */
.ico { width: 22px; height: 22px; flex: none; }
.ico.sm { width: 17px; height: 17px; }
.ico.xs { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px;
  margin-top: 8px; padding: 0 16px; border: 0; border-radius: 14px; background: #ece6d8; color: var(--ink);
  font-weight: 800; font-size: 16px; transition: transform .1s, opacity .2s;
}
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.big { min-height: 56px; font-size: 18px; }
.btn.gold { background: var(--gold); color: #2b2100; box-shadow: 0 3px 0 var(--gold-d); }
.btn.red { background: var(--danger); color: #fff; box-shadow: 0 3px 0 #9c2f3e; }
.btn.green { background: var(--ok); color: #fff; box-shadow: 0 3px 0 #1d6f65; }
.btn.ghost { background: var(--glass2); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .25); }
.btn[disabled] { opacity: .4; box-shadow: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link { background: none; border: 0; color: #fff; opacity: .8; text-decoration: underline; padding: 10px; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--glass); color: #fff; display: grid; place-items: center; flex: none; }
.iconbtn.dark { background: #ece6d8; color: var(--ink); width: 36px; height: 36px; }

/* ---------- cards ---------- */
/* Cards are compact tiles, not poker-shaped: each size has an explicit width (--cw) and height (--ch). */
.c {
  --cw: 80px; --ch: 96px; position: relative; display: flex; flex-direction: column; flex: none;
  width: var(--cw); height: var(--ch); padding: 0; border: 0; overflow: hidden;
  border-radius: calc(var(--cw) * .1); background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .28);
  font-size: calc(var(--cw) * .13); line-height: 1.12; text-align: center;
}
.c > span { display: flex; }
.sz-xs { --cw: 40px; --ch: 30px; font-size: 10px; border-radius: 6px; }
.sz-sm { --cw: 58px; --ch: 62px; font-size: 8.5px; }
.sz-md { --cw: 80px; --ch: 96px; }
.sz-lg { --cw: min(200px, 52vw); --ch: calc(var(--cw) * 1.3); }
.c-head {
  flex: none; align-items: center; justify-content: center; padding: .35em .35em; min-height: 2.5em;
  color: #fff; font-weight: 800; font-size: .95em; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); word-break: break-word;
}
.c-body { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: .2em; padding: .2em .3em 1.75em; min-height: 0; }
.c-body .ico { width: 1.9em; height: 1.9em; color: #555; }
.c-sub { font-size: .72em; color: var(--muted); font-weight: 700; }
.c-lad { display: none; flex-direction: column; width: 86%; gap: .12em; font-size: .62em; }
.c-lad > span { display: flex; justify-content: space-between; border-bottom: 1px dotted #d3cbb8; }
.c-lad i { font-style: normal; color: #b4ab98; letter-spacing: -.1em; }
.c-val {
  position: absolute; left: .25em; bottom: .25em; width: 1.6em; height: 1.6em; border-radius: 50%;
  align-items: center; justify-content: center; background: #fff; border: .1em solid #cfc6b2;
  font-weight: 900; font-size: .85em; color: var(--ink);
}
.c-val small, .c-money small { font-size: .55em; }
/* money */
.k-money { background: linear-gradient(155deg, #eef7e6, #cde6bc); }
.c-money { flex: 1; align-items: center; justify-content: center; }
.c-money > span {
  display: flex; align-items: center; justify-content: center; width: 2.3em; height: 2.3em; border-radius: 50%;
  font-size: 1.8em; font-weight: 900; color: #2d6a2d; background: #f6fbf2; border: .08em dashed #6aa86a;
}
/* action */
.k-action { background: linear-gradient(180deg, var(--ac) 0 1.6em, var(--paper) 1.6em); }
.c-act { flex: 1; flex-direction: column; align-items: center; padding: .35em .3em 1.75em; gap: .15em; min-height: 0; }
.c-act .ico { width: 2.6em; height: 2.6em; padding: .22em; border-radius: 50%; background: var(--paper); color: var(--ac); box-shadow: 0 0 0 .14em var(--ac), 0 2px 4px rgba(0, 0, 0, .2); }
.c-name { font-weight: 900; font-size: .95em; }
.c-desc { display: none; font-size: .62em; color: var(--muted); }
/* rent / wild */
.k-rent .c-head, .k-wild .c-head { letter-spacing: .1em; text-transform: uppercase; min-height: 1.9em; }
.k-property .c-body { background: linear-gradient(180deg, transparent 0, color-mix(in srgb, var(--cc) 26%, transparent)); }
/* back */
.c.back {
  align-items: center; justify-content: center; border: .2em solid var(--paper);
  background: repeating-linear-gradient(45deg, #7a1f2b 0 .5em, #8f2a37 .5em 1em);
}
.c.back b { background: var(--paper); color: var(--ink); border-radius: 999px; padding: .1em .55em; font-size: 1.1em; }
.c.slot { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2); }
/* large (zoom / prompt): everything */
.sz-lg .c-lad { display: flex; }
.sz-lg .c-desc { display: block; }
.sz-lg .c-head { min-height: 2.8em; }
.sz-lg .c-act { padding-top: .6em; gap: .3em; }
/* small: name + colour only */
.sz-sm .c-head { min-height: 0; padding: .3em .3em; }
.sz-sm .c-body { justify-content: flex-end; padding-bottom: .45em; padding-left: 1.9em; }
.sz-sm .c-body .ico { display: none; }
.sz-sm .c-act { padding-top: .25em; }
.sz-sm .c-act .ico { width: 2.6em; height: 2.6em; }
/* extra small (bank chips, set pickers): colour + value only */
.sz-xs .c-head { font-size: 0; min-height: 0; height: 38%; padding: 0; }
.sz-xs .c-body, .sz-xs .c-act, .sz-xs .c-money { display: none; }
.sz-xs .c-val { position: static; margin: auto; width: auto; height: auto; border: 0; background: none; font-size: 1.15em; }
.sz-xs.k-money .c-money { display: flex; }
.sz-xs .c-money > span { width: auto; height: auto; border: 0; background: none; font-size: 1.3em; }
.sz-xs.k-action { background: var(--ac); }
.sz-xs.k-action .c-val { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.prompt-card .c { --cw: min(160px, 42vw, 22dvh); }
/* states */
.c.on { box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0, 0, 0, .35); translate: 0 -4px; }
.c.on::after {
  content: "✓"; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); color: #2b2100; font: 900 12px/18px system-ui; text-align: center;
}
.c.pop { animation: pop .38s var(--ease); }
.movebadge {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); color: #2b2100; display: grid !important; place-items: center;
}

/* ---------- header ---------- */
.hdr { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 6px) 12px 4px; }
.pill {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
  background: var(--glass); color: #fff; font-size: 14px; letter-spacing: .04em;
}
.pill b { letter-spacing: .14em; }
.conn { flex: 1; font-size: 12px; color: #ffd27a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5ee28a; box-shadow: 0 0 6px #5ee28a; }

/* ---------- avatars / pips ---------- */
.av { width: 26px; height: 26px; font-size: 13px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 900; color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.av.sm { width: 22px; height: 22px; font-size: 12px; }
.av.lg { width: 46px; height: 46px; font-size: 20px; }
.av.empty { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3); }
.pips { display: inline-flex; gap: 3px; align-items: center; }
.pip { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.pip.on { background: var(--gold); box-shadow: 0 0 5px rgba(242, 193, 78, .8); }
.pips.big .pip { width: 11px; height: 11px; }

/* ---------- game layout ---------- */
.game { display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: flex-start; gap: 6px; flex: none; padding: calc(env(safe-area-inset-top) + 6px) 12px 6px; }
.opps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding-top: 7px; margin-top: -7px; }
.seat { position: relative; }
.seat .st { position: absolute; top: -7px; right: 8px; font-size: 9px; line-height: 13px; }
.menubtn { margin-top: 2px; }
.connbar { flex: none; padding: calc(env(safe-area-inset-top) + 4px) 12px 4px; background: #8a5a00; color: #fff; font-size: 12px; text-align: center; }
.connbar + .topbar { padding-top: 6px; }
.opps::-webkit-scrollbar, .handrow::-webkit-scrollbar, .sets::-webkit-scrollbar, .row::-webkit-scrollbar, .dockbar::-webkit-scrollbar { display: none; }
.seat {
  flex: none; display: flex; flex-direction: column; gap: 3px; width: 132px; padding: 5px 8px 6px; text-align: left;
  border: 2px solid transparent; border-radius: 12px; background: var(--glass); color: #fff; transition: border-color .2s, box-shadow .2s;
}
.seat.active { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242, 193, 78, .2); }
.seat.off { opacity: .55; }
.seat-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.seat-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.st { font-size: 10px; font-weight: 800; text-transform: uppercase; background: var(--gold); color: #2b2100; border-radius: 6px; padding: 1px 5px; animation: blink 1.2s infinite; }
.st.off { background: #777; color: #fff; animation: none; }
.seat-stats { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1; opacity: .9; }
.seat-stats > span:not(.pips) { display: inline-flex; align-items: center; gap: 2px; }
.seat-stats .pips { margin-left: auto; }
.minisets { display: flex; gap: 3px; flex-wrap: wrap; min-height: 6px; }
.ms { position: relative; width: 14px; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ms i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); }
.ms.done { box-shadow: 0 0 0 1.5px var(--gold); }

.table { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 6px; display: flex; flex-direction: column; gap: 6px; }
.center {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px; flex: none;
  border-radius: 16px; border: 2px dashed rgba(255, 255, 255, .14); transition: border-color .2s, background .2s;
}
.piles { display: flex; gap: 6px; flex: none; }
.piles .c { --cw: 46px; --ch: 56px; font-size: 7.5px; }
.pile { position: relative; }
.pile .c.back { box-shadow: 2px 2px 0 #5d1720, 4px 4px 0 #4b121a, 0 6px 12px rgba(0, 0, 0, .3); }
.status { flex: 1; min-width: 0; }
.status h2 { margin: 0 0 3px; font-size: 16px; line-height: 1.2; }
.plays { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; }
.status .sub { margin-top: 2px; font-size: 12px; opacity: .8; }
.drop-hint { display: none; }

.zone { flex: none; padding: 5px 8px 6px; border-radius: 14px; background: rgba(0, 0, 0, .16); border: 2px solid transparent; transition: border-color .2s, background .2s; }
.zlabel { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.zlabel b { font-size: 15px; letter-spacing: 0; opacity: 1; color: var(--gold); }
.sets { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; padding: 1px 0 0; min-height: 30px; }
/* property sets: one tile per colour, one slot per card the set needs */
.pset { flex: none; padding: 4px 6px 6px; border-radius: 10px; background: rgba(0, 0, 0, .22); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }
.pset.done { border-color: var(--gold); box-shadow: 0 0 10px rgba(242, 193, 78, .35); }
.pset-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.pset-h span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--c); vertical-align: 0; }
.pset-h b { color: var(--gold); }
.slots { display: flex; align-items: center; gap: 3px; }
.slot { position: relative; flex: none; display: grid; place-items: center; width: 17px; height: 24px; padding: 0; border: 0; border-radius: 4px; color: #fff; }
.slot.full { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5), 0 2px 4px rgba(0, 0, 0, .3); }
.slot.empty { border: 1.5px dashed rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .04); }
.slot.wild .ico { width: 11px; height: 11px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.slot.movable { outline: 2px solid var(--gold); outline-offset: 1px; }
.slot .mv { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); color: #2b2100; }
.slot .mv .ico { width: 9px; height: 9px; filter: none; }
.bld { display: grid; place-items: center; width: 22px; height: 24px; margin-left: 2px; padding: 0; border: 0; border-radius: 4px; background: var(--paper); color: var(--ink); }
.bld .ico { width: 15px; height: 15px; }
.sets.light .pset { background: #efe9dc; color: var(--ink); }
.sets.light .pset-h b { color: #8a6500; }
.sets.light .slot.empty { border-color: #c4baa6; background: none; }
.sets.light .bld { background: #fff; box-shadow: inset 0 0 0 1px #d8d0bf; }
.setpick .pset { background: transparent; border-width: 0; padding: 0; }
.setpick .pset-h b { color: #8a6500; }
.setpick .slot.empty { border-color: #c4baa6; }
.zone.bank { display: flex; align-items: center; gap: 10px; }
.zone.bank .zlabel { flex-direction: column; align-items: flex-start; margin: 0; gap: 1px; }
.bankrow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 2px; min-height: 34px; scrollbar-width: none; }
.empty-hint { font-size: 12px; opacity: .55; padding: 4px 2px; }

/* drag & drop */
body.dragging { cursor: grabbing; }
.drop-ok { border-color: rgba(242, 193, 78, .55) !important; }
.center.drop-ok .drop-hint { display: block; position: absolute; right: 10px; top: 8px; font-size: 11px; font-weight: 800; color: var(--gold); text-transform: uppercase; }
.drop-hover { border-color: var(--gold) !important; border-style: solid !important; background: rgba(242, 193, 78, .18) !important; }
.drag-ghost { position: fixed !important; z-index: 80; pointer-events: none; margin: 0 !important; transform: translate(-50%, -70%) rotate(-5deg) scale(1.1); box-shadow: 0 16px 30px rgba(0, 0, 0, .45) !important; }
.dragging-src { opacity: .25; }

/* dock */
.dock { flex: none; padding: 2px 0 calc(env(safe-area-inset-bottom) + 4px); background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .35) 35%); }
.dockbar { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.hint { font-size: 13px; opacity: .8; white-space: nowrap; }
.chipbtn {
  flex: none; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 800; font-size: 14px; animation: rise .2s var(--ease);
}
.chipbtn.gold { background: var(--gold); color: #2b2100; }
.chipbtn.ghost { background: var(--glass2); color: #fff; padding: 0 10px; }
.endturn {
  flex: none; margin-left: auto; height: 38px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 900; box-shadow: 0 3px 0 rgba(0, 0, 0, .3);
}
.endturn.pulse { background: var(--gold); color: #2b2100; animation: pulse 1.4s infinite; }
.endturn.big {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 54px; margin: 2px 0; border-radius: 16px; font-size: 19px; box-shadow: 0 4px 0 var(--gold-d);
}
.endturn.big > span { display: flex; align-items: center; gap: 6px; }
.endturn.big small { font-size: 11px; font-weight: 700; opacity: .75; }
.handrow { display: flex; align-items: flex-end; overflow-x: auto; padding: 18px 12px 4px; touch-action: pan-x; scrollbar-width: none; min-height: 118px; }
.handrow .c + .c { margin-left: var(--ov, -22px); }
.handrow .c { transition: translate .18s var(--ease), filter .2s; touch-action: pan-x; box-shadow: -3px 0 8px rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .3); }
.handrow .c-head, .handrow .c-name { justify-content: flex-start; text-align: left; align-self: stretch; padding-left: .45em; }
.handrow .c-act { align-items: flex-start; }
.handrow .c-act .ico { margin-left: .2em; }
.handrow .c.sel { translate: 0 -14px; z-index: 2; box-shadow: 0 0 0 3px var(--gold), 0 10px 20px rgba(0, 0, 0, .4); }
.handrow .c.dim { filter: saturate(.5) brightness(.75); }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); animation: fade .2s; }
.scrim.dark { background: rgba(0, 0, 0, .7); }
.sheet {
  position: fixed; left: 50%; top: 50%; z-index: 31; width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 40px);
  overflow-y: auto; overscroll-behavior: contain; padding: 10px 16px 16px; border-radius: 22px;
  background: var(--paper); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .06);
  transform: translate(-50%, -50%); animation: bubble .26s var(--ease);
}
.sheet.prompt { box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 4px var(--gold); }
/* Re-rendered without replaying entry animations (see render() in ui.js). */
.noanim, .noanim .prompt-card .c { animation: none !important; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet h3 { margin: 4px 0 8px; font-size: 19px; }
.sec { display: flex; align-items: center; gap: 6px; margin: 12px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 10px; scrollbar-width: none; }
.row.wrap { flex-wrap: wrap; overflow: visible; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tile {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px; text-align: left;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.tile span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tile small { color: var(--muted); font-size: 12px; }
.tile.on { border-color: var(--gold-d); background: #fff4d6; }
.sw { width: 24px; height: 24px; border-radius: 7px; flex: none; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; height: 42px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 800; }
.seg button.on { border-color: var(--gold-d); background: #fff4d6; }
.flow-card { float: right; margin: -44px 40px 0 0; transform: rotate(6deg); }
.setpick { border: 2px solid transparent; border-radius: 12px; background: #f1ebde; padding: 6px 8px; color: var(--ink); }
.setpick.on { border-color: var(--gold-d); background: #fff4d6; }
.sets.light { color: var(--ink); }
.prompt-card { position: relative; display: flex; justify-content: center; margin: 4px 0 6px; }
.prompt-card .c { animation: deal .45s var(--ease); }
.nope-stamp {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); padding: 4px 14px;
  border: 4px solid var(--danger); border-radius: 10px; color: var(--danger); background: rgba(255, 255, 255, .85);
  font-weight: 900; font-size: 26px; letter-spacing: .06em; animation: stamp .35s var(--ease);
}
.ptext { margin: 6px 0 10px; font-size: 16px; text-align: center; }
.paybar { display: flex; align-items: center; gap: 10px; }
.paybar b { font-size: 18px; white-space: nowrap; }
.progress { flex: 1; height: 12px; border-radius: 6px; background: #e8e1d1; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #5ccf9a); transition: width .25s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font-weight: 700; text-align: left; }
.menu-item.danger { color: var(--danger); border-bottom: 0; }
.menu-item.static { cursor: default; }
.langs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .22); }
.langs button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: inherit; font-weight: 700; font-size: 14px; opacity: .75; }
.langs button.on { background: var(--gold); color: #2b2100; opacity: 1; }
.sheet .langs { background: #ece6d8; }
.home { position: relative; }
.home-top { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 16px; }
.opp-head { display: flex; align-items: center; gap: 12px; }
.opp-head .pips { margin-left: auto; }
.opp-head .pip { background: #ddd5c4; }
.rules p { margin: 6px 0 10px; }
.rule-cards { display: flex; flex-direction: column; gap: 8px; }
.rule-card { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.zoom { position: fixed; inset: 0; z-index: 32; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; }
.zoom .c { animation: deal .35s var(--ease); }
.zoom p { max-width: 280px; margin: 6px 0 0; }

/* ---------- overlays ---------- */
#fly { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 176px); z-index: 60; width: min(496px, calc(100% - 24px)); pointer-events: none; text-align: center; }
.toast { display: inline-block; margin-top: 6px; padding: 8px 14px; border-radius: 12px; background: rgba(15, 20, 17, .9); font-size: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); animation: drop .25s var(--ease); }
.toast.err { background: var(--danger); }
.splash { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; pointer-events: none; }
.splash span { font-size: 44px; font-weight: 900; color: var(--gold); text-shadow: 0 4px 24px rgba(0, 0, 0, .6), 0 2px 0 #6b4e00; animation: splash 1.2s var(--ease) forwards; }
.win { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .6); animation: fade .3s; }
.win-card { position: relative; width: min(360px, 100%); padding: 24px 20px 18px; border-radius: 24px; background: var(--paper); color: var(--ink); text-align: center; animation: deal .5s var(--ease); }
.win-card h2 { margin: 6px 0; font-size: 28px; }
.trophy { width: 72px; height: 72px; margin: -60px auto 0; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #2b2100; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.trophy .ico { width: 40px; height: 40px; }
.confetti i { position: fixed; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.8s linear infinite; }

/* ---------- home / lobby ---------- */
.home { display: flex; flex-direction: column; justify-content: center; gap: 10px; height: 100%; padding: calc(env(safe-area-inset-top) + 20px) 22px calc(env(safe-area-inset-bottom) + 20px); overflow-y: auto; }
.logo { position: relative; height: 150px; margin-bottom: 6px; }
.logo .c { position: absolute; left: 50%; top: 14px; margin-left: -42px; transform-origin: 50% 120%; animation: deal .6s var(--ease) backwards; }
.logo .c:nth-child(1) { transform: rotate(-16deg) translateX(-26px); }
.logo .c:nth-child(2) { transform: translateY(-8px); animation-delay: .08s; }
.logo .c:nth-child(3) { transform: rotate(16deg) translateX(26px); animation-delay: .16s; }
.title { margin: 0; text-align: center; font-size: 36px; color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.tag { margin: 0 0 8px; text-align: center; opacity: .85; }
.tag.small { font-size: 12px; margin-top: -4px; }
.field { width: 100%; padding: 15px 16px; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); font-size: 18px; outline: none; box-shadow: inset 0 0 0 2px transparent; }
.field:focus { box-shadow: inset 0 0 0 2px var(--gold); }
.codein { text-align: center; font: 900 32px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .35em; text-transform: uppercase; }
.spinner { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .2); border-top-color: var(--gold); animation: spin .9s linear infinite; }
.lobby { display: flex; flex-direction: column; gap: 10px; height: calc(100% - 56px); overflow-y: auto; padding: 8px 18px calc(env(safe-area-inset-bottom) + 20px); }
.codebig { display: flex; justify-content: center; gap: 7px; border: 0; background: none; padding: 0; }
.codebig span { width: 50px; height: 64px; display: grid; place-items: center; border-radius: 12px; background: var(--paper); color: var(--ink); font: 900 34px/1 ui-monospace, Menlo, Consolas, monospace; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); animation: deal .4s var(--ease) backwards; }
.codebig span:nth-child(2) { animation-delay: .05s; } .codebig span:nth-child(3) { animation-delay: .1s; }
.codebig span:nth-child(4) { animation-delay: .15s; } .codebig span:nth-child(5) { animation-delay: .2s; }
.qr { width: 168px; margin: 6px auto 0; padding: 10px; border-radius: 16px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.plist { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pl { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--glass); animation: rise .3s var(--ease); }
.pl.empty { background: none; border: 2px dashed rgba(255, 255, 255, .18); opacity: .6; animation: none; }
.tagchip { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--glass2); font-size: 12px; font-weight: 700; }
.tagchip.you { margin-left: 4px; background: var(--gold); color: #2b2100; }
.tagchip + .tagchip { margin-left: 4px; }
.waiting { margin-top: 8px; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }

/* ---------- animations ---------- */
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes deal { from { transform: translateY(40px) scale(.7) rotate(-6deg); opacity: 0; } }
@keyframes bubble { from { transform: translate(-50%, -46%) scale(.9); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 193, 78, .7); } 60% { box-shadow: 0 0 0 10px rgba(242, 193, 78, 0); } }
@keyframes blink { 50% { opacity: .55; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-14deg) scale(2.2); opacity: 0; } }
@keyframes splash { 0% { transform: scale(.5); opacity: 0; } 20% { transform: scale(1.06); opacity: 1; } 75% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.12); opacity: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- opponent table (inline, no pop-up) ---------- */
.topbar.solo .opps { flex: none; }
.topbar.solo .seat { width: 112px; }
.topbar.solo .oppt { flex: 1; min-width: 0; padding-top: 1px; }
.topbar.solo .minisets, .seat.sel .minisets { display: none; }
.seat.sel { background: rgba(255, 255, 255, .13); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.seat.sel.active { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45), 0 0 0 4px rgba(242, 193, 78, .2); }
.oppx { flex: none; padding: 0 12px 6px; animation: rise .2s var(--ease); }
.oppx .oppt { padding: 6px 8px; border-radius: 12px; background: rgba(0, 0, 0, .16); }
.oppt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.oppt .empty-hint { padding: 2px 0; font-size: 11px; }
.sets.mini { gap: 4px; min-height: 0; padding: 0; }
.sets.mini .pset { padding: 2px 4px 3px; border-radius: 7px; border-width: 1px; }
.sets.mini .pset-h { gap: 4px; margin-bottom: 2px; font-size: 8.5px; }
.sets.mini .pset-h span::before { width: 5px; height: 5px; margin-right: 3px; }
.sets.mini .slots { gap: 2px; }
.sets.mini .slot { width: 11px; height: 16px; border-radius: 3px; }
.sets.mini .slot.full { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.sets.mini .slot.empty { border-width: 1px; }
.sets.mini .slot.wild .ico { width: 8px; height: 8px; }
.sets.mini .bld { width: 15px; height: 16px; margin-left: 1px; }
.sets.mini .bld .ico { width: 11px; height: 11px; }
.obank { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; opacity: .95; }
.chip { height: 17px; padding: 0 5px; border: 0; border-radius: 5px; background: #d7ecc8; color: #2d6a2d; font: 800 10px/17px system-ui, sans-serif; }
.chip.k-action { background: var(--ac); color: #fff; }
.chip.k-rent { background: #ece6d8; color: var(--ink); }

/* ---------- centre row: piles/status + activity feed ---------- */
.midrow { display: flex; gap: 6px; flex: none; align-items: stretch; }
.midrow .center { flex: 1; min-width: 0; }
.feed {
  flex: none; width: 124px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 6px;
  border: 0; border-radius: 16px; background: rgba(0, 0, 0, .2); text-align: left; overflow: hidden;
}
.fi { display: flex; align-items: center; gap: 3px; height: 20px; font-size: 11px; white-space: nowrap; animation: feedin .4s var(--ease); }
.feed .fi:nth-child(1) { background: rgba(255, 255, 255, .1); border-radius: 8px; margin: 0 -3px; padding: 0 3px; }
.feed .fi:nth-child(2) { opacity: .8; }
.feed .fi:nth-child(3) { opacity: .6; }
.feed .fi:nth-child(4) { opacity: .4; }
.fi.empty { justify-content: center; height: 100%; opacity: .35; }
.fi-ic { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); color: var(--ac, #555); flex: none; }
.fi-ic .ico { width: 12px; height: 12px; }
.fsw { display: inline-block; width: 10px; height: 14px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.fm { font-weight: 900; color: var(--gold); }
.far { opacity: .7; font-weight: 900; }
.fi .x { color: #ff8b98; }
.av.xs { width: 16px; height: 16px; font-size: 9px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5); }
.av.gone { background: #777; }
.status h2 { font-size: 15px; }
.status .sub { font-size: 11px; }
.flog { list-style: none; margin: 0; padding: 0; }
.flog li { display: flex; flex-direction: column; gap: 2px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.flog .fi { height: auto; font-size: 13px; gap: 5px; animation: none; }
.flog .fi-ic { background: #ece6d8; width: 22px; height: 22px; }
.flog .fi-ic .ico { width: 14px; height: 14px; }
.flog .fm { color: #8a6500; }
.flog .av.xs { width: 20px; height: 20px; font-size: 11px; }
.flog .fsw { width: 12px; height: 17px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.flog small { color: var(--muted); font-size: 12px; }
@keyframes feedin { from { transform: translateX(14px); opacity: 0; } }

/* ---------- swipe / swap: what moves where ---------- */
.deal { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; margin: 2px 0 4px; border-radius: 14px; background: #f1ebde; }
.deal-side { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.deal-lbl { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.deal-side.take .deal-lbl { color: #1d7f72; }
.deal-side.give .deal-lbl { color: #b8384a; }
.deal-side.take .c { box-shadow: 0 0 0 3px var(--ok); }
.deal-side.give .c { box-shadow: 0 0 0 3px var(--danger); }
.deal-q { align-items: center; justify-content: center; background: transparent; box-shadow: none !important; border: 2px dashed #c4baa6; color: #b4ab98; font-size: 22px; font-weight: 900; }
.deal-side.take .deal-q { border-color: rgba(42, 157, 143, .6); }
.deal-side.give .deal-q { border-color: rgba(209, 73, 91, .6); }
.deal-arrow { color: var(--muted); margin-top: 16px; }
.deal-arrow .ico { width: 30px; height: 30px; }
.deal-note { margin: 0 0 4px; text-align: center; font-size: 12px; color: var(--muted); }
.step { display: flex; align-items: center; gap: 6px; margin: 12px 0 2px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 900; }
.step.take { background: rgba(42, 157, 143, .14); color: #1d7f72; }
.step.give { background: rgba(209, 73, 91, .12); color: #b8384a; }
.step .num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 12px; }
.step.take .num { background: var(--ok); }
.step.give .num { background: var(--danger); }
.who { display: flex; align-items: center; gap: 6px; margin: 6px 0 -4px; font-size: 13px; font-weight: 800; }
.c.on.pick-take { box-shadow: 0 0 0 3px var(--ok), 0 6px 14px rgba(0, 0, 0, .35); }
.c.on.pick-take::after { background: var(--ok); color: #fff; content: "↓"; }
.c.on.pick-give { box-shadow: 0 0 0 3px var(--danger), 0 6px 14px rgba(0, 0, 0, .35); }
.c.on.pick-give::after { background: var(--danger); color: #fff; content: "↑"; }

/* ---------- opponents: larger now that the table has room ---------- */
.seat { width: 148px; gap: 4px; }
.topbar.solo .seat { width: 124px; }
.seat-stats { font-size: 13px; }
.mback { display: inline-block; width: 11px; height: 15px; margin-right: 2px; border-radius: 2px; border: 1.5px solid var(--paper); background: repeating-linear-gradient(45deg, #7a1f2b 0 2px, #8f2a37 2px 4px); vertical-align: -3px; }
.ms { width: 16px; height: 7px; }
.sets.mini { gap: 5px; }
.sets.mini .pset { padding: 3px 5px 4px; border-radius: 8px; }
.sets.mini .pset-h { font-size: 10px; margin-bottom: 3px; }
.sets.mini .pset-h span::before { width: 6px; height: 6px; }
.sets.mini .slots { gap: 3px; }
.sets.mini .slot { width: 16px; height: 23px; border-radius: 4px; }
.sets.mini .slot.wild .ico { width: 10px; height: 10px; }
.sets.mini .bld { width: 20px; height: 23px; }
.sets.mini .bld .ico { width: 13px; height: 13px; }
.obank { gap: 4px; }
.obank > .ico { width: 15px; height: 15px; }
.chip { height: 21px; padding: 0 7px; border-radius: 6px; font: 800 12px/21px system-ui, sans-serif; }

.nope-note { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; padding: 6px 10px; border-radius: 10px; background: rgba(209, 73, 91, .12); color: #b8384a; font-size: 13px; font-weight: 800; }

/* steal prompt: picture of what moves */
.prompt-card.compact { margin: 0 0 2px; }
.prompt-card.compact .c { --cw: 64px; --ch: 70px; font-size: 9px; }
.prompt-card.compact .nope-stamp { font-size: 15px; padding: 2px 8px; border-width: 3px; }
.deal-who { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: 16px; font-size: 13px; }
.deal-set { display: block; padding: 4px 6px; border-radius: 10px; background: #fff; }
.deal-set .pset { background: transparent; border-width: 0; padding: 0; }
.deal-set .pset-h { font-size: 12px; }
.deal-set .pset-h b { color: #8a6500; }
.deal-set .slot { width: 22px; height: 31px; }
.deal-side.take .deal-set { box-shadow: 0 0 0 3px var(--ok); }
.deal-side.give .deal-set { box-shadow: 0 0 0 3px var(--danger); }
.deal-side:not(.take):not(.give) .deal-lbl { color: var(--muted); }
