@font-face { font-family: 'Alibaba Sans'; src: url(../fonts/AlibabaSans-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Alibaba Sans'; src: url(../fonts/AlibabaSans-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Alibaba Sans'; src: url(../fonts/AlibabaSans-Heavy.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }

:root { --u: min(1vw, 5.2px);
  --felt: #0f4a34; --panel: #0b1d15; --panel2: #13301f; --gold: #d6ae55; --gold2: #f2d98d; --cream: #f6ecd2; --muted: #a9b9a8;
  --red: #c8323c; --line: rgba(246, 236, 210, .16);
  --disp: 'Alibaba Sans', 'Avenir Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ui: 'Alibaba Sans', 'Avenir Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07130d; color: var(--cream); font-family: var(--ui); overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
#app { position: relative; max-width: 520px; height: 100vh; height: 100dvh; margin: 0 auto; overflow: hidden;
  background: var(--felt) url(../assets/felt.jpg) center / 256px repeat; user-select: none; -webkit-user-select: none; }
#app::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.06), rgba(0,0,0,.38) 85%); pointer-events: none; }
.scr { position: absolute; inset: 0 0 72px 0; display: none; flex-direction: column; overflow: hidden; }
.scr.on { display: flex; }
#scr-table { inset: 0; }

/* header */
.hdr { flex: none; background: linear-gradient(180deg, var(--panel2), var(--panel)); border-bottom: 1px solid var(--gold); padding: 8px 12px 12px; position: relative; z-index: 2;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.hname { text-align: center; font-size: 17px; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow { display: flex; align-items: center; gap: 12px; }
.hava { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 2px solid var(--gold); flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.hava img { width: 100%; height: 100%; display: block; }
.hstats { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); min-width: 0; }
.hstats b { color: var(--cream); font-weight: 600; }
.hbal { display: flex; align-items: center; gap: 6px; }
.hbal .amt { font-family: var(--disp); font-size: 28px; color: var(--gold2); }
.chip { width: 26px; height: 26px; vertical-align: middle; }
.plus { width: 38px; height: 38px; border-radius: 9px; border: 1.5px solid var(--gold); color: var(--gold2); display: grid; place-items: center; margin-inline-start: 4px; }
.plus svg { width: 22px; height: 22px; }

/* home tiles */
.tiles { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; position: relative; z-index: 1; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-bottom: 1px solid var(--line); color: var(--cream); }
.tile:nth-child(2n) { border-inline-end: 1px solid var(--line); }
.tile.wide { grid-column: 1 / -1; }
.tile svg { width: 34px; height: 34px; color: var(--gold2); }
.tile.wide svg { width: 44px; height: 44px; }
.tile span { font-family: var(--disp); font-size: 25px; text-shadow: 0 2px 4px rgba(0,0,0,.5); text-align: center; padding: 0 6px; }
.tile:active { background: rgba(255,255,255,.06); }

/* tab bar */
#tabs { position: absolute; left: 0; right: 0; bottom: 0; height: 72px; display: flex; background: linear-gradient(180deg, var(--panel2), var(--panel)); border-top: 1px solid var(--gold); z-index: 5; }
#tabs.hide { display: none; }
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); min-width: 0; }
#tabs button svg { width: 28px; height: 28px; }
#tabs button span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
#tabs button.on { color: var(--gold2); }

/* lists */
.stitle { flex: none; margin: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; font-family: var(--disp); font-size: 24px; font-weight: 700; position: relative; z-index: 1; }
.stitle svg { width: 26px; height: 26px; color: var(--gold2); flex: none; }
.pback { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1.5px solid var(--line); }
.list { flex: 1; overflow-y: auto; padding: 4px 12px 16px; position: relative; z-index: 1; touch-action: pan-y; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; background: rgba(8, 24, 17, .72); border: 1px solid var(--line); border-radius: 12px; }
.lstake { font-family: var(--disp); font-size: 20px; color: var(--gold2); min-width: 92px; display: flex; align-items: center; gap: 4px; }
.lstake .chip { width: 20px; height: 20px; }
.lmid { flex: 1; min-width: 0; }
.lopts { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; margin-bottom: 6px; }
.ot { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(246, 236, 210, .1); color: var(--muted); white-space: nowrap; }
.ot.off { text-decoration: line-through; }
.ot.lk svg { width: 12px; height: 12px; color: var(--gold2); }
.lseats { display: flex; gap: 4px; }
.lseats img, .lseats i { width: 28px; height: 28px; border-radius: 6px; display: block; }
.lseats i { border: 1.5px dashed rgba(246,236,210,.35); }
.empty { text-align: center; color: var(--muted); margin-top: 40px; }

/* forms */
.form { flex: 1; overflow-y: auto; padding: 6px 16px 20px; position: relative; z-index: 1; touch-action: pan-y; }
.form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.seg { display: flex; background: rgba(8, 24, 17, .72); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.seg button.on { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1d1606; font-weight: 600; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 0 30%; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; scrollbar-width: none; touch-action: pan-x; overscroll-behavior-x: contain; }
.hscroll::-webkit-scrollbar { display: none; }
.stk { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 10px; background: rgba(8, 24, 17, .72); border: 1px solid var(--line); font-family: var(--disp); font-size: 17px; color: var(--gold2); }
.stk .chip { width: 18px; height: 18px; }
.stk.on { border-color: var(--gold2); box-shadow: 0 0 0 1.5px var(--gold2) inset; background: rgba(214, 174, 85, .16); }
.pot { margin: 18px 0 10px; text-align: center; font-family: var(--disp); font-size: 19px; color: var(--gold2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.inp { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(8, 24, 17, .8); color: var(--cream); font: inherit; font-size: 16px; margin-top: 8px; user-select: text; -webkit-user-select: text; }
.inp:focus { outline: none; border-color: var(--gold); }
.avs .avb { flex: none; width: 64px; height: 64px; border-radius: 11px; overflow: hidden; border: 2px solid transparent; opacity: .75; }
.avs .avb img { width: 100%; height: 100%; display: block; }
.avs .avb.on { border-color: var(--gold2); opacity: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 16px; color: #1d1606;
  background: linear-gradient(180deg, var(--gold2), var(--gold)); box-shadow: 0 3px 0 #8a6a25, 0 6px 14px rgba(0,0,0,.35); white-space: nowrap; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6a25; }
.btn[disabled] { opacity: .55; }
.btn.big { width: 100%; padding: 15px; font-size: 18px; margin-top: 10px; }
.btn.sm { padding: 8px 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--cream); border: 1.5px solid var(--line); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #e4636b, var(--red)); color: #fff; box-shadow: 0 3px 0 #7d1a20; }
.rules { padding-inline-start: 20px; line-height: 1.5; font-size: 15px; }
.rules li { margin-bottom: 10px; }
.lead .ldr { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.ldr.mine { background: rgba(214, 174, 85, .12); border-radius: 8px; }
.ldr .pos { width: 26px; text-align: center; color: var(--muted); }
.ldr img { width: 34px; height: 34px; border-radius: 7px; }
.ldr .ln { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ldr .lb { font-family: var(--disp); color: var(--gold2); display: flex; align-items: center; gap: 4px; }
.ldr .lb .chip { width: 18px; height: 18px; }

/* overlays */
.ov { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(3, 10, 7, .62); z-index: 50; padding: 20px; }
.ov.show { display: flex; }
.panel { width: 100%; max-width: 360px; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--gold); border-radius: 18px; padding: 20px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.panel h2 { font-family: var(--disp); font-size: 30px; margin: 0 0 8px; color: var(--gold2); }
.panel h3 { font-family: var(--disp); font-size: 21px; margin: 0 0 12px; }
.panel .sub { color: var(--muted); margin: 8px 0; font-size: 14px; }
.panel .sub.hot { color: var(--gold2); }
.panel .row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.panel .row .btn { flex: 1; }
.panel label { display: block; text-align: start; font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
#onboard { background: rgba(3, 10, 7, .5); }
#toast { position: absolute; left: 50%; top: 18px; transform: translate(-50%, -20px); opacity: 0; transition: .25s; background: #1d1606; color: var(--gold2); border: 1px solid var(--gold);
  padding: 10px 16px; border-radius: 10px; z-index: 99; pointer-events: none; font-size: 14px; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------- table ------- */
.tb-top { position: absolute; left: 0; right: 0; top: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; z-index: 30; }
.tb-exit { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--cream); background: rgba(0,0,0,.25); }
.tb-exit svg { width: 22px; height: 22px; }
.tb-rules { display: flex; gap: 6px; position: absolute; left: 50%; transform: translateX(-50%); }
.tb-rules span { width: 28px; height: 30px; border: 1.3px solid rgba(246,236,210,.5); border-radius: 6px; display: grid; place-items: center; color: rgba(246,236,210,.8); }
.tb-rules span svg { width: 20px; height: 20px; }
.tb-rules .dk { font-size: 12px; font-weight: 700; }
.tb-stake { font-family: var(--disp); font-size: 22px; color: var(--cream); display: flex; align-items: center; gap: 5px; }
.tb-stake img { width: 24px; height: 24px; }

.tb-opps .opp { position: absolute; transform: translate(-50%, -50%); width: var(--s); height: var(--s); z-index: 20; }
.ava { position: relative; width: var(--s, 64px); height: var(--s, 64px); border-radius: 10px; background: #0b1d15; border: 3px solid rgba(246,236,210,.85); box-shadow: 0 4px 10px rgba(0,0,0,.45); }
.ava img { width: 100%; height: 100%; border-radius: 7px; display: block; }
.ava .nm { position: absolute; left: -3px; right: -3px; bottom: -3px; background: rgba(8, 20, 14, .82); font-size: 11px; font-weight: 600; text-align: center; padding: 2px 2px 3px;
  border-radius: 0 0 9px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava .cnt { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--cream); color: #1b1f24; font-style: normal; font-size: 12px; font-weight: 800;
  display: grid; place-items: center; padding: 0 4px; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.att > .ava, .ava.att { border-color: var(--gold2); }
.def > .ava, .ava.def { border-color: #e2575f; }
.out > .ava, .ava.out { opacity: .55; }
.ring { position: absolute; left: -10px; top: -10px; width: calc(100% + 20px); height: calc(100% + 20px); pointer-events: none; overflow: visible; opacity: 0; }
.ring rect { fill: none; stroke: var(--gold2); stroke-width: 2.6; filter: drop-shadow(0 0 1.5px rgba(0,0,0,.9)); stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset .2s linear; }
.ring.on { opacity: 1; }
.ring.low rect { stroke: #ff6a6a; }
.opp .fan { position: absolute; left: 50%; top: 62%; width: 0; height: 0; z-index: -1; }
.opp .fan i { position: absolute; width: calc(var(--s) * .52); height: calc(var(--s) * .78); left: calc(var(--s) * -.6); top: 0; border-radius: 4px; transform-origin: 50% 100%;
  background: var(--back, url(../assets/back.webp)) center / cover; border: 1px solid rgba(255,255,255,.7); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.opp.empty .ava { border-style: dashed; border-color: rgba(246,236,210,.35); background: rgba(0,0,0,.15); box-shadow: none; }
.done-mark { position: absolute; top: -10px; right: -10px; width: 24px; height: 24px; border-radius: 12px; background: var(--gold2); color: #1d1606; display: grid; place-items: center; }
.done-mark svg { width: 16px; height: 16px; }

.tb-deckn { position: absolute; left: 10px; font-family: var(--disp); font-size: 26px; z-index: 25; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.trumpmark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 20px; background: rgba(255, 253, 247, .92); }
.tb-layer { position: absolute; inset: 0; z-index: 15; touch-action: none; }
.deckstack i, .discard i { position: absolute; left: 0; top: 0; border-radius: 7px; background: var(--back, url(../assets/back.webp)) center / cover; border: 1.5px solid rgba(255,255,255,.85);
  box-shadow: 0 2px 6px rgba(0,0,0,.4); transform-origin: 50% 50%; }
.card { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; transition: transform .38s cubic-bezier(.2,.8,.25,1), opacity .45s ease; will-change: transform; border-radius: 7.5%/5%;
  box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.card svg { width: 100%; height: 100%; pointer-events: none; }
.card.sel { box-shadow: 0 0 0 3px var(--gold2), 0 10px 24px rgba(0,0,0,.5); }
.card.drag { transition: none; box-shadow: 0 16px 36px rgba(0,0,0,.55); }
.card.tgt { box-shadow: 0 0 0 3px rgba(242, 217, 141, .85), 0 3px 10px rgba(0,0,0,.35); }
.card.hov { box-shadow: 0 0 0 5px var(--gold2), 0 3px 10px rgba(0,0,0,.35); }
.card.shake { animation: shake .32s; }
@keyframes shake { 25% { margin-left: -6px; } 75% { margin-left: 6px; } }
.tb-layer.droppass::after { content: ''; position: absolute; left: 8%; right: 8%; top: 24%; height: 34%; border: 2px dashed rgba(242, 217, 141, .55); border-radius: 16px; pointer-events: none; }

.tb-hint { position: absolute; left: 0; right: 0; text-align: center; bottom: calc(76px + min(calc(31 * var(--u)), 150px) * 1.5 * .72 + 10px); font-size: 14px; color: var(--gold2); text-shadow: 0 1px 3px rgba(0,0,0,.8); z-index: 26; pointer-events: none; }
.tb-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 76px; display: flex; align-items: center; background: linear-gradient(180deg, var(--panel2), var(--panel)); border-top: 1px solid var(--gold); z-index: 40;
  padding: 0 10px; padding-bottom: env(safe-area-inset-bottom); }
.tb-bl, .tb-br { flex: 1; display: flex; }
.tb-br { justify-content: flex-end; }
.tb-btn { visibility: hidden; min-width: 128px; height: 54px; padding: 0 18px; border-radius: 12px; font-family: var(--disp); font-size: 24px; color: #1d1606;
  background: linear-gradient(180deg, var(--gold2), var(--gold)); box-shadow: 0 3px 0 #8a6a25, 0 6px 14px rgba(0,0,0,.35); white-space: nowrap; }
.tb-btn.on { visibility: visible; }
.tb-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6a25; }
.tb-me { flex: none; --s: 58px; margin-top: -26px; }
.tb-me .ava { --s: 58px; }
.bal { display: flex; align-items: center; gap: 4px; font-family: var(--disp); font-size: 17px; color: var(--gold2); }
.bal img { width: 20px; height: 20px; }

.tb-wait .panel h3 .num { color: var(--gold2); }
.wseats { display: flex; justify-content: center; align-items: flex-start; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.ws { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.ws img, .ws i { width: 56px; height: 56px; border-radius: 10px; display: block; border: 2px solid var(--gold); }
.ws.empty i { border: 2px dashed rgba(246,236,210,.35); }
.ws span { min-height: 15px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite { margin: 12px 0; text-align: start; }
.invite span { font-size: 12px; color: var(--muted); }
.invite input { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--cream); font-size: 12px; margin: 4px 0 8px; }
.tb-wait .btn.ghost { margin-top: 10px; }
.tb-wait, .tb-over { z-index: 45; background: rgba(3, 10, 7, .45); }
.tb-over .panel.lose h2 { color: #ff8a8a; }
.tb-over .amt { font-family: var(--disp); font-size: 34px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tb-over .amt img { width: 32px; height: 32px; }

/* ===== Reference palette and proportions (measured from the reference screenshots, 2026-11-28) =====
   felt #497196 (light weave), white bars #f7f7f7, red numbers #eb0807, red outline buttons #f2424f, tab labels #414141 / active #6f0507,
   bottom bar light grey, Done: white with a #c5c6c5 border and red text, timer frame green #94ca21 turning red #ff4152. */
:root { --felt: #497196; --bar: #f7f7f7; --ink: #414141; --grey: #828282; --rnum: #eb0807; --rbtn: #f2424f; --ract: #6f0507; --green: #94ca21; --rframe: #ff4152;
  --line: rgba(255, 255, 255, .42); --cream: #ffffff; --muted: rgba(255, 255, 255, .82); }
html, body { background: #2c4864; }
#app { background: var(--felt) url(../assets/felt-blue.jpg) center / 256px repeat; }
#app::before { background: none; }
.scr { inset: 0 0 9.8dvh 0; }
#scr-table { inset: 0; }

.hdr { background: var(--bar); border-bottom: 0; box-shadow: 0 2px 6px rgba(0,0,0,.25); padding: 0 11px 10px; height: 20.9dvh; min-height: 150px; display: flex; flex-direction: column; }
.hname { color: var(--grey); font-size: 18px; height: 5.1dvh; min-height: 34px; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0 0 8px; border-bottom: 1px solid #d8d8d8; }
.hrow { flex: 1; min-height: 0; }
.hava { width: calc(24.9 * var(--u)); max-width: 130px; height: auto; aspect-ratio: 1; border: 0; border-radius: 0; box-shadow: none; background: #000; }
.hstats { color: var(--grey); }
.hstats b { color: var(--ink); }
.hbal .amt { font-family: var(--ui); font-weight: 300; font-size: 30px; color: var(--rnum); }
.plus { width: 36px; height: 36px; border-radius: 3px; border: 1px solid var(--rbtn); color: var(--rbtn); background: #fff; }

.tiles { flex: none; grid-auto-rows: 11.55dvh; align-content: start; }
.tile { color: #fff; border-color: var(--line); }
.tile svg, .tile.wide svg { color: #fff; width: 30px; height: 30px; }
.tile.wide svg { width: 36px; height: 36px; }
.tile span { font-size: 23px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.tile { flex-direction: column; gap: 6px; }

#tabs { height: 9.8dvh; min-height: 64px; background: var(--bar); border-top: 0; box-shadow: 0 -1px 4px rgba(0,0,0,.2); }
#tabs button { color: var(--ink); gap: 2px; }
#tabs button span { font-size: 13px; color: var(--ink); }
#tabs button.on span { color: var(--ract); }
#tabs button .suit { width: 46px; height: 40px; position: relative; display: grid; place-items: center; }
#tabs button .suit > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; }
#tabs button .suit .glyph { position: relative; width: 20px; height: 20px; color: #fff; margin-top: -2px; }

.stitle { color: #fff; }
.stitle svg { color: #fff; }
.pback { border-color: var(--line); color: #fff; }
.lrow { background: #fff; border: 0; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.2); border-radius: 6px; }
.lstake { font-family: var(--ui); font-weight: 300; color: var(--rnum); font-size: 22px; }
.ot { background: #eef1f4; color: #55606b; }
.ot.lk svg { color: var(--rbtn); }
.lseats i { border-color: #c5c6c5; }
.empty { color: #fff; }

.form label { color: rgba(255,255,255,.9); }
.seg { background: rgba(255,255,255,.95); border: 0; border-radius: 6px; }
.seg button { color: var(--ink); border-radius: 4px; }
.seg button.on { background: var(--rbtn); color: #fff; }
.stk { background: #fff; border: 1px solid #c5c6c5; color: var(--rnum); font-family: var(--ui); font-weight: 400; border-radius: 6px; }
.stk.on { border-color: var(--rbtn); box-shadow: 0 0 0 2px var(--rbtn) inset; background: #fff; }
.pot { color: #fff; font-family: var(--ui); font-weight: 400; }
.inp { background: #fff; color: var(--ink); border: 1px solid #c5c6c5; border-radius: 6px; }
.inp:focus { border-color: var(--rbtn); }
.avs .avb.on { border-color: var(--rbtn); }
.btn { background: #fff; color: var(--rnum); border: 1px solid #c5c6c5; box-shadow: 0 2px 4px rgba(0,0,0,.18); border-radius: 8px; font-weight: 400; }
.btn:active { box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #c5c6c5; box-shadow: 0 2px 4px rgba(0,0,0,.18); }
.btn.danger { background: var(--rbtn); color: #fff; border: 0; box-shadow: 0 2px 4px rgba(0,0,0,.18); }
.rules { color: #fff; }
.lead .ldr { border-color: var(--line); color: #fff; }
.ldr.mine { background: rgba(255,255,255,.16); }
.ldr .pos { color: rgba(255,255,255,.8); }
.ldr .lb { font-family: var(--ui); color: #fff; }

.ov { background: rgba(20, 34, 48, .55); }
.panel { background: #fff; border: 0; border-radius: 10px; color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.panel h2 { color: var(--rnum); font-family: var(--ui); font-weight: 400; }
.panel h3 { color: var(--ink); font-family: var(--ui); font-weight: 500; }
.panel .sub { color: var(--grey); }
.panel .sub.hot { color: var(--rnum); }
.panel label { color: var(--grey); }
#toast { background: #333; color: #fff; border: 0; }

/* table */
.tb-exit { background: rgba(255,255,255,.12); color: #fff; }
.tb-rules span { border-color: rgba(255,255,255,.45); color: rgba(255,255,255,.55); border-radius: 4px; }
.tb-stake { font-family: var(--ui); font-weight: 300; font-size: 26px; color: #fff; }
.ava { border: 0; border-radius: 3px; background: #000; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.ava img { border-radius: 3px; }
.ava .nm { left: 0; right: 0; bottom: 0; background: rgba(70, 70, 70, .72); color: #fff; font-weight: 400; font-size: 12px; border-radius: 0 0 3px 3px; padding: 1px 2px 2px; }
.ava .cnt { top: 2px; right: 3px; min-width: 0; height: auto; background: none; color: #fff; font-weight: 400; font-size: 11px; border-radius: 0; padding: 0 1px; box-shadow: none;
  border-bottom: 1.5px solid #fff; text-shadow: 0 0 2px #000; line-height: 1.1; }
.att > .ava, .ava.att, .def > .ava, .ava.def { border: 0; }
.def-mark { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; border-radius: 3px; background: var(--rframe); color: #fff; display: grid; place-items: center; z-index: 3; }
.def-mark svg { width: 11px; height: 11px; }
.ring { left: -6px; top: -6px; width: calc(100% + 12px); height: calc(100% + 12px); }
.ring rect { stroke: var(--green); stroke-width: 4.2; filter: none; stroke-linecap: butt; }
.ring.low rect { stroke: var(--rframe); }
.opp .fan i { border-radius: 3px; border: 1px solid #fff; }
.tb-deckn { font-family: var(--ui); font-weight: 300; font-size: 30px; color: #fff; text-shadow: none; }
.tb-hint { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); bottom: calc(68px + min(calc(35 * var(--u)), 170px) * 1.5 * .72 + 10px); }
.tb-bar { height: 68px; background: linear-gradient(180deg, #f8f8f8, #d9d9d9); border-top: 1px solid #bdbdbd; }
.tb-btn { background: #fff; color: #ff0000; border: 1px solid #c5c6c5; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.15); font-family: var(--ui); font-weight: 400; font-size: 30px;
  height: 52px; min-width: calc(37 * var(--u)); }
.tb-btn:active { box-shadow: none; }
.tb-me { margin-top: 0; --s: 54px; }
.tb-me .ava { --s: 54px; }
.bal { font-family: var(--ui); font-weight: 400; color: #777; font-size: 15px; }
.ws img, .ws i { border: 0; border-radius: 3px; }
.ws.empty i { border: 2px dashed #c5c6c5; }
.ws span { color: var(--ink); }
.invite input { background: #f4f4f4; color: var(--ink); border-color: #c5c6c5; }
.invite span { color: var(--grey); }
.tb-wait, .tb-over { background: rgba(20, 34, 48, .4); }
.tb-over .panel.lose h2 { color: var(--rnum); }
.tb-over .panel.win h2 { color: #4f8f12; }
.tb-over .amt { font-family: var(--ui); font-weight: 300; color: var(--ink); }
.card.sel { box-shadow: 0 0 0 3px #fff, 0 10px 24px rgba(0,0,0,.45); }
.card.tgt { box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 3px 10px rgba(0,0,0,.35); }
.card.hov { box-shadow: 0 0 0 5px #fff, 0 3px 10px rgba(0,0,0,.35); }
.tb-layer.droppass::after { border-color: rgba(255,255,255,.6); }
#tabs button .suit { width: 56px; height: 46px; }
#tabs button .suit .glyph { width: 22px; height: 22px; }
.tb-wait .panel h3 .num { color: var(--rnum); }
.done-mark { background: var(--green); color: #fff; }

/* ===== Table tidy-up, measured on the reference (u = 1 % of the width) ===== */
.tb-top { height: calc(11 * var(--u)); padding: 0 calc(2 * var(--u)); }
.tb-exit { width: calc(8 * var(--u)); height: calc(8 * var(--u)); background: none; color: rgba(255,255,255,.75); }
.tb-exit svg { width: calc(6 * var(--u)); height: calc(6 * var(--u)); }
.tb-rules { gap: calc(1 * var(--u)); top: calc(2.3 * var(--u)); }
.tb-rules span { width: calc(5.2 * var(--u)); height: calc(6.8 * var(--u)); border-width: 1.2px; border-color: rgba(255,255,255,.38); color: rgba(255,255,255,.45); }
.tb-rules span svg { width: calc(4.2 * var(--u)); height: calc(4.2 * var(--u)); }
.tb-rules .dk { font-size: calc(2.6 * var(--u)); }
.tb-stake { font-weight: 400; font-size: calc(5.4 * var(--u)); gap: calc(1 * var(--u)); }
.tb-stake img { width: calc(5.4 * var(--u)); height: calc(5.4 * var(--u)); }
.ava .nm { font-size: calc(3 * var(--u)); padding: 0 1px 1px; }
.ava .cnt { font-size: calc(2.6 * var(--u)); }
.opp .fan { left: 50%; top: 38%; }
.opp .fan i { width: calc(var(--s) * .8); height: calc(var(--s) * 1.15); left: calc(var(--s) * -.4); top: 0; transform-origin: 50% 150%; border-radius: 2px; }
.ring rect { stroke-width: 3.6; }
.tb-deckn { left: calc(2.5 * var(--u)); font-weight: 400; font-size: calc(7 * var(--u)); }
.tb-bar { height: calc(16.3 * var(--u)); max-height: 74px; padding: 0 calc(2 * var(--u)); background: linear-gradient(180deg, #ffffff, #e9e9e9); border-top: 1px solid #c9c9c9; box-shadow: 0 -2px 4px rgba(0,0,0,.12); }
.tb-btn { min-width: calc(36.4 * var(--u)); height: calc(13.3 * var(--u)); max-height: 60px; border-radius: calc(2.2 * var(--u)); font-size: calc(8.7 * var(--u)); color: #f00; padding: 0 calc(3 * var(--u)); }
.tb-me, .tb-me .ava { --s: calc(12.8 * var(--u)); }
.tile span { font-family: var(--ui); font-weight: 700; }
.opp .fan { top: 58%; }
.opp .fan i { width: calc(var(--s) * .62); height: calc(var(--s) * .9); left: calc(var(--s) * -.31); transform-origin: 50% 130%; }
/* every avatar wears a frame: full red while waiting; the acting player's frame is the turn clock, green draining to red */
.tb-opps .opp:not(.empty) .ring, .tb-me .ring { opacity: 1; }
.ring rect { stroke: var(--rframe); }
.ring.on rect { stroke: var(--green); }
.ring.on.low rect { stroke: var(--rframe); }
.opp .fan { top: 48%; }
.opp .fan i { width: calc(var(--s) * .7); height: calc(var(--s) * 1.0); left: calc(var(--s) * -.35); transform-origin: 50% 165%; }
/* menu tiles as in the reference: dividers inset from the edges with a soft shadow, small icons close above the label */
.tile { border: 0 !important; position: relative; gap: 4px; }
.tile::after { content: ''; position: absolute; left: 2.5%; right: 2.5%; bottom: 0; height: 1px; background: rgba(255,255,255,.55); box-shadow: 0 1px 1px rgba(0,0,0,.25); }
.tile:not(.wide):nth-child(2n)::before { content: ''; position: absolute; right: 0; top: 6%; bottom: 6%; width: 1px; background: rgba(255,255,255,.55); box-shadow: 1px 0 1px rgba(0,0,0,.25); }
.tile:not(.wide):nth-child(2n)::after { left: 5%; right: 0; }
.tile:not(.wide):nth-child(2n+1)::after { left: 0; right: 5%; }
.tile svg { width: calc(5 * var(--u)) !important; height: calc(5 * var(--u)) !important; max-width: 24px; max-height: 24px; }
.tile.wide svg { width: calc(6 * var(--u)) !important; height: calc(6 * var(--u)) !important; }
.tile span { font-size: calc(5.4 * var(--u)); font-weight: 700; }
#tabs button span { font-size: calc(3.5 * var(--u)); }
.tile svg { width: calc(7 * var(--u)) !important; height: calc(7 * var(--u)) !important; max-width: 34px; max-height: 34px; }
.tile.wide svg { width: calc(7.5 * var(--u)) !important; height: calc(7.5 * var(--u)) !important; }

/* ===== Art icons and the reference's full menu, header, boosters ===== */
.ic { display: block; object-fit: contain; pointer-events: none; }
.plus img { width: 60%; height: 60%; }
.hava { position: relative; overflow: visible; }
.hava .lvl { position: absolute; top: 2px; right: 4px; color: #fff; font-style: normal; font-size: calc(3.6 * var(--u)); line-height: 1.1; border-bottom: 1.5px solid #fff; text-shadow: 0 0 3px #000; padding: 0 1px; }
.hrow { gap: calc(2.5 * var(--u)); }
.hprem { display: flex; align-items: center; gap: calc(1.5 * var(--u)); align-self: flex-start; margin-top: calc(1 * var(--u)); }
.hprem .crown { width: calc(9 * var(--u)); height: calc(9 * var(--u)); max-width: 44px; max-height: 44px; }
.hprem button:first-child { opacity: .55; }
.hprem button.on:first-child { opacity: 1; }
.hcur { flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: calc(1.6 * var(--u)); min-width: 0; }
.hbal .amt { font-size: calc(7.4 * var(--u)); line-height: 1; }
.hbal .chip, .hbal .coin { width: calc(8 * var(--u)); height: calc(8 * var(--u)); max-width: 40px; max-height: 40px; }
.plus { width: calc(9 * var(--u)); height: calc(9 * var(--u)); max-width: 42px; max-height: 42px; }
.hstats { display: none; }

.tile .ic { width: calc(7 * var(--u)); height: calc(7 * var(--u)); max-width: 34px; max-height: 34px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.tile.wide .ic { width: calc(7.5 * var(--u)); height: calc(7.5 * var(--u)); }
.tile .tcount { position: absolute; left: 6%; top: 7%; font-weight: 400; font-size: calc(3.2 * var(--u)); color: #fff; }
.tile .tbadge { position: absolute; left: 50%; top: 50%; transform: translate(calc(calc(3.5 * var(--u)) + 4px), -150%); font-weight: 400; font-size: calc(4.6 * var(--u)); color: #fff; }
.tile .tbadge:empty, .tile .tcount:empty { display: none; }

#tabs button .suit { width: auto; height: auto; }
#tabs button .suit .ic { width: calc(13 * var(--u)); height: calc(11 * var(--u)); max-width: 60px; max-height: 50px; }
.stitle .ic { width: calc(7 * var(--u)); height: calc(7 * var(--u)); }
.pback .ic { width: calc(5 * var(--u)); height: calc(5 * var(--u)); }
.ot.lk .ic { width: 12px; height: 12px; }
.lseats img { object-fit: cover; }

/* pages */
.card-row { background: #fff; color: var(--ink); border-radius: 6px; padding: 12px; margin-bottom: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.18); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-row b { font-weight: 700; }
.card-row small { display: block; color: var(--grey); font-size: 12.5px; margin-top: 2px; }
.card-row .it { flex: 1; min-width: 0; }
.card-row .ic.big { width: calc(13 * var(--u)); height: calc(13 * var(--u)); max-width: 60px; max-height: 60px; }
.card-row .ic.m { width: calc(9 * var(--u)); height: calc(9 * var(--u)); max-width: 40px; max-height: 40px; }
.card-row.news { display: block; }
.card-row.news time { float: right; color: var(--grey); font-size: 12px; }
.card-row.news p { margin: 8px 0 0; line-height: 1.45; }
.card-row.game img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.card-row.game b { flex: 1; }
.card-row.tour { display: block; }
.card-row.tour .tt { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.card-row.tour .tt .ic { width: 34px; height: 34px; filter: invert(.35) sepia(1) saturate(4) hue-rotate(5deg); }
.card-row.tour label { color: var(--grey); }
.card-row.tour .mine { color: var(--rnum); font-weight: 700; }
.card-row .btn .coin, .card-row .btn .chip, .plans .btn .coin, .plans .btn .chip { width: 18px; height: 18px; }
.muted { color: rgba(255,255,255,.85); font-size: 13px; }
.card-row .muted { color: var(--grey); }
.prize { flex: none; background: #f4f6f8; border-radius: 6px; padding: 8px 10px; text-align: center; color: var(--ink); }
.prize span { display: block; font-size: 12px; color: var(--grey); }
.prize b { display: flex; align-items: center; gap: 3px; }
.prize .coin, .prize .chip { width: 18px; height: 18px; }
.plans { margin-bottom: 6px; }
.plans .btn { flex: none; }
.wallet { display: flex; gap: 18px; color: #fff; font-size: 20px; margin: 4px 0 4px; }
.wallet span { display: flex; align-items: center; gap: 5px; }
.wallet .coin, .wallet .chip { width: 24px; height: 24px; }
.card-row.prem .crown { width: 44px; height: 44px; }
.card-row.ach.got { opacity: .7; }
.card-row.ach.ready { box-shadow: 0 0 0 2px var(--rbtn), 0 2px 6px rgba(0,0,0,.18); }
.bar { height: 6px; background: #e6e9ee; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--green); }
.card-row.lvl { display: block; }
.search { display: flex; gap: 8px; align-items: center; }
.search .inp { margin-top: 0; }
.search .btn { height: 44px; }
.search .btn .ic { width: 24px; height: 24px; filter: brightness(.3); }
.ldr.fr { background: #fff; color: var(--ink); border-radius: 6px; margin-bottom: 6px; padding: 8px; }
.ldr.fr .ln small { display: block; color: var(--grey); font-size: 11.5px; }
.ldr.fr .ln small.on { color: #4f8f12; }
.ldr.fr .lvl-s { color: var(--grey); font-size: 12px; }
.inv-ava { width: 64px; height: 64px; border-radius: 6px; display: block; margin: 0 auto 10px; }
.mini { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0; justify-content: center; }
.mini i { width: 34px; height: 51px; display: block; }
.mini i svg { width: 100%; height: 100%; }

/* table: art icons, boosters like the reference (price above, wallet below), highlight */
.tb-exit .ic { width: calc(6 * var(--u)); height: calc(6 * var(--u)); opacity: .75; }
.tb-rules span .ic { width: calc(4 * var(--u)); height: calc(4 * var(--u)); opacity: .6; }
.def-mark { background: none; width: calc(4.6 * var(--u)); height: calc(4.6 * var(--u)); right: -1.5vw; bottom: -1.5vw; }
.def-mark .ic { width: 100%; height: 100%; }
.done-mark { background: none; width: calc(6 * var(--u)); height: calc(6 * var(--u)); }
.done-mark .ic { width: 100%; height: 100%; }
.tb-bl { flex: none; }
.tb-me { margin: 0 calc(2 * var(--u)); }
.tb-br { flex: 1; flex-direction: column; align-items: stretch; justify-content: center; gap: 0; }
.bsts { display: flex; justify-content: space-around; }
.bst { display: flex; flex-direction: column; align-items: center; }
.bp { font-size: calc(3.1 * var(--u)); color: #777; display: flex; align-items: center; gap: 1px; height: calc(4 * var(--u)); }
.bp .coin, .bwal .coin { width: calc(3.2 * var(--u)); height: calc(3.2 * var(--u)); }
.bst button { width: calc(10.5 * var(--u)); height: calc(10.5 * var(--u)); max-width: 50px; max-height: 50px; }
.bst button .ic { width: 100%; height: 100%; }
.bst button.off { opacity: .4; }
.bst button.act { filter: drop-shadow(0 0 3px var(--green)); }
.bwal { display: flex; justify-content: space-around; font-size: calc(3.1 * var(--u)); color: #777; }
.bwal span { display: flex; align-items: center; gap: 2px; }
.bwal img { width: calc(3.2 * var(--u)); height: calc(3.2 * var(--u)); }
.tb-btn { min-width: calc(30 * var(--u)); font-size: calc(7.6 * var(--u)); }
.card.dim { filter: brightness(.55); }

/* opponents hold their cards: the fan hangs from a point above the cards, spreading towards the table, as they would see them */
.opp .fan { top: 52%; }
.opp .fan i { transform-origin: 50% -70%; }
.card-row .ic.m { filter: brightness(.6); } .card-row.ach.got .ic.m { filter: none; }
.bp { height: calc(3.4 * var(--u)); font-size: calc(2.9 * var(--u)); }
.bst button { width: calc(9 * var(--u)); height: calc(9 * var(--u)); }
.bwal { font-size: calc(2.9 * var(--u)); line-height: 1.1; }
.opp .fan i { width: calc(var(--s) * .66); height: calc(var(--s) * .95); left: calc(var(--s) * -.33); }

/* ===== Sub-pages, lists, filters, achievements, items as in the reference (measured on IMG_2143-2161, u = 1 % of the width) ===== */
.scr { inset: 0 0 calc(15 * var(--u)) 0; }
#scr-table { inset: 0; }
/* the tab bar: a white floating bar with the active tab on a grey pill */
#tabs { height: calc(15 * var(--u)); min-height: 0; background: #fff; box-shadow: none; padding: calc(1.6 * var(--u)) calc(3.2 * var(--u)) calc(2.6 * var(--u)); gap: 0; }
#tabs::before { content: ''; position: absolute; left: calc(3.2 * var(--u)); right: calc(3.2 * var(--u)); top: calc(1.6 * var(--u)); bottom: calc(2.6 * var(--u)); border-radius: calc(3.4 * var(--u));
  border: 1px solid #e6e6e6; box-shadow: 0 1px 4px rgba(0,0,0,.12); pointer-events: none; }
#tabs button { position: relative; border-radius: calc(3 * var(--u)); margin: calc(.4 * var(--u)); gap: calc(.3 * var(--u)); }
#tabs button.on { background: #ececec; }
#tabs button .suit .ic { width: calc(7.5 * var(--u)); height: calc(6 * var(--u)); }
#tabs button span { font-size: calc(1.9 * var(--u)); font-weight: 700; color: #333; }
#tabs button.on span { color: #e0333f; }

/* the white bar: Back on a pill, the title in the middle */
.pbar { flex: none; height: calc(12.5 * var(--u)); background: #fff; display: flex; align-items: center; justify-content: center; position: relative; z-index: 3; border-bottom: 1px solid #dcdcdc; }
.ptitle { font-size: calc(2.9 * var(--u)); color: #555; }
.pback2 { position: absolute; left: calc(3 * var(--u)); top: 50%; transform: translateY(-50%); height: calc(7.3 * var(--u)); padding: 0 calc(2.6 * var(--u)) 0 calc(1.6 * var(--u)); display: flex; align-items: center; gap: calc(1 * var(--u));
  border-radius: calc(3.6 * var(--u)); background: #fff; border: 1px solid #e4e4e4; box-shadow: 0 1px 3px rgba(0,0,0,.14); color: #222; font-size: calc(2.9 * var(--u)); }
.pback2 .ic { width: calc(2.6 * var(--u)); height: calc(2.6 * var(--u)); filter: brightness(0); }
/* the white strip under it: my avatar and money, or the page's own head */
.pstrip { flex: none; height: calc(12 * var(--u)); background: #fff; display: flex; align-items: center; gap: calc(2 * var(--u)); padding: 0 calc(1 * var(--u)); position: relative; z-index: 2;
  box-shadow: 0 2px 2px rgba(0,0,0,.55); }
.pstrip.none { display: none; }
.pstrip .hava { width: calc(10 * var(--u)); height: calc(10 * var(--u)); flex: none; }
.pstrip .hava .lvl { font-size: calc(1.7 * var(--u)); top: 1px; right: 2px; }
.pstrip .hcur { gap: calc(.6 * var(--u)); justify-content: center; }
.pstrip .hbal .amt { font-size: calc(3 * var(--u)); color: #e25563; }
.pstrip .hbal .chip, .pstrip .hbal .coin { width: calc(5 * var(--u)); height: calc(5 * var(--u)); }
.pstrip .plus, .pstrip .plus-gap { width: calc(4.5 * var(--u)); height: calc(4.5 * var(--u)); flex: none; display: block; }
.pstrip .phead { width: calc(10 * var(--u)); height: calc(10 * var(--u)); object-fit: contain; }
.pstrip .pcount, .pstrip .pcontact { align-self: flex-start; margin-top: calc(1.6 * var(--u)); color: #777; font-size: calc(2.4 * var(--u)); }
.pstrip .pcontact b { color: #e25563; font-weight: 400; margin-left: 4px; }
.pstrip .pq { width: calc(10 * var(--u)); height: calc(10 * var(--u)); background: #cfe4f2; border-radius: 2px; display: grid; place-items: center; box-shadow: 2px 2px 0 #a9c6dc; }
.pstrip .pq .ic { width: 60%; height: 60%; filter: brightness(0) invert(27%) sepia(90%) saturate(4000%) hue-rotate(345deg); }
.pprem { flex: 1; display: flex; flex-direction: column; gap: calc(2 * var(--u)); align-self: stretch; justify-content: center; }
.pprem b { color: #e25563; font-size: calc(2.6 * var(--u)); display: flex; align-items: center; gap: 2px; }
.pprem b .crown { width: calc(3 * var(--u)); height: calc(3 * var(--u)); }
.plink { color: #e25563; font-size: calc(2.3 * var(--u)); text-align: left; }
.pstrip .pprem + .hcur { flex: none; align-self: flex-start; margin-top: calc(1.4 * var(--u)); }

/* the blue list: full-width rows with inset light dividers */
.plist { flex: 1; overflow-y: auto; position: relative; z-index: 1; touch-action: pan-y; padding: 0 0 calc(4 * var(--u)); color: #fff; }
.prow { position: relative; display: flex; align-items: center; gap: calc(1.6 * var(--u)); min-height: calc(8.9 * var(--u)); padding: calc(.8 * var(--u)) calc(1.4 * var(--u)); }
.prow::after { content: ''; position: absolute; left: calc(1.4 * var(--u)); right: calc(1.4 * var(--u)); bottom: 0; height: 1px; background: rgba(255,255,255,.5); box-shadow: 0 1px 1px rgba(0,0,0,.2); }
.prow.mine { background: rgba(255,255,255,.12); }
.prow.col { flex-direction: column; align-items: stretch; padding-top: calc(2 * var(--u)); padding-bottom: calc(2 * var(--u)); }
.prow.col time { font-size: calc(1.9 * var(--u)); opacity: .8; }
.prow.col p { margin: calc(1 * var(--u)) 0 0; font-size: calc(2.6 * var(--u)); line-height: 1.4; }
.prow .pt { flex: 1; min-width: 0; font-size: calc(2.75 * var(--u)); font-weight: 700; font-style: italic; text-shadow: 0 1px 2px rgba(0,0,0,.45); display: flex; flex-direction: column; justify-content: center; }
.prow .pt b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pt small { font-size: calc(1.7 * var(--u)); font-weight: 400; font-style: normal; text-shadow: none; opacity: .95; margin-top: 1px; }
.prow .pt small.on { color: #b8f07a; }
.prow .pr { font-size: calc(2.6 * var(--u)); white-space: nowrap; }
.prow .pos { width: calc(5 * var(--u)); text-align: center; font-size: calc(2.6 * var(--u)); opacity: .85; }
.prow .pav { width: calc(7 * var(--u)); height: calc(7 * var(--u)); border-radius: 3px; object-fit: cover; flex: none; }
.prow.locked .aic, .prow.locked .pt { opacity: .38; }
.psep { height: calc(1.2 * var(--u)); background: rgba(255,255,255,.75); box-shadow: 0 1px 2px rgba(0,0,0,.3); margin: 0 calc(1.4 * var(--u)) calc(.6 * var(--u)); }
.num { font-weight: 300; }
/* round icons: an achievement or an item in a ring */
.aic, .pic { position: relative; flex: none; width: calc(6.2 * var(--u)); height: calc(6.2 * var(--u)); border-radius: 50%; border: 1.5px solid rgba(255,255,255,.9); background: rgba(20, 40, 60, .25); display: grid; place-items: center; overflow: hidden; }
.aic img { width: 74%; height: 74%; object-fit: contain; }
.aic em { position: absolute; top: 4%; left: 0; right: 0; text-align: center; font-style: italic; font-weight: 700; font-size: calc(1.45 * var(--u)); color: #ffe27a; text-shadow: 0 0 2px #000, 0 0 2px #000; line-height: 1; }
.aic em + img, .aic img:has(+ em) { margin-top: 18%; width: 62%; height: 62%; }
.aic.none { background: rgba(20, 40, 60, .35); }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic.back img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.5); }
img.pic { padding: calc(1 * var(--u)); object-fit: contain; background: #fff; }
.radio { flex: none; width: calc(3.1 * var(--u)); height: calc(3.1 * var(--u)); border-radius: 50%; border: 1.5px solid #fff; margin-right: calc(1 * var(--u)); position: relative; }
.radio.on::after { content: ''; position: absolute; inset: 18%; border-radius: 50%; background: #fff; }
.pbuy { display: flex; align-items: center; gap: calc(1 * var(--u)); font-size: calc(2.9 * var(--u)); color: #fff; white-space: nowrap; flex: none; }
.pbuy .coin { width: calc(4.6 * var(--u)); height: calc(4.6 * var(--u)); }
.pbuy .for { font-size: calc(2.4 * var(--u)); margin-right: calc(2.5 * var(--u)); }
.pbuy.off { opacity: .6; }
.cart { width: calc(3.2 * var(--u)); height: calc(3.2 * var(--u)); padding: calc(.5 * var(--u)); border-radius: 50%; background: #5f7590; margin-left: calc(1.4 * var(--u)); box-sizing: content-box; }
.buyrow { justify-content: space-between; }
.buyrow .pamt { display: flex; align-items: center; gap: calc(1 * var(--u)); font-size: calc(2.9 * var(--u)); min-width: calc(24 * var(--u)); justify-content: flex-end; }
.buyrow .pamt .chip, .buyrow .pamt .coin { width: calc(5 * var(--u)); height: calc(5 * var(--u)); }
.buyrow .pamt .crown { width: calc(5.4 * var(--u)); height: calc(5.4 * var(--u)); }
.buyrow.dim { opacity: .85; }
.smgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.smgrid img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.bigback { display: block; width: 46%; margin: 10px auto; border-radius: 6px; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.fh { margin: calc(3 * var(--u)) 0 calc(1.2 * var(--u)); text-align: center; color: #fff; font-style: italic; font-weight: 700; font-size: calc(3 * var(--u)); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.fh.l { text-align: left; padding: 0 calc(2 * var(--u)); font-size: calc(2.4 * var(--u)); }
.plist .search { display: flex; gap: 8px; padding: calc(1.4 * var(--u)); }
.plist .search .inp { margin: 0; }
.tourhead { gap: 4px; }
.tourhead .pt { flex-direction: row; align-items: center; gap: 8px; justify-content: flex-start; }
.tourhead .pt .ic { width: calc(6 * var(--u)); height: calc(6 * var(--u)); }
.tourhead .prize { background: #fff; color: var(--ink); }

/* home: the count and NEW! sticker beside the icons */
.tile .ti { position: relative; display: block; }
.tile .tl { font-size: calc(5.4 * var(--u)); font-weight: 700; font-style: italic; }
.tile .tbadge { transform: translate(calc(5 * var(--u)), -165%); font-size: calc(2.6 * var(--u)); }
.newtag { position: absolute; right: 2%; top: 6%; width: calc(21 * var(--u)); height: calc(10 * var(--u)); background: url(../assets/ic/r_new.png?a=1) center / contain no-repeat; display: grid; place-items: center; transform: rotate(-8deg); pointer-events: none; }
.newtag span { color: #fff; font-weight: 800; font-style: italic; font-size: calc(3.2 * var(--u)); text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.hava .hbadge { position: absolute; right: -4px; bottom: -4px; width: 40%; height: 40%; }
.hava .hbadge .aic { width: 100%; height: 100%; border-width: 1px; background: rgba(20, 40, 60, .6); }
.hava .hbadge .aic em { display: none; }

/* open games: the filter summary and one row per table */
#scr-open .pbar { border-bottom: 0; }
#listHead { flex: none; position: relative; z-index: 2; }
.fbar { width: 100%; display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto 1fr; align-items: center; height: calc(12 * var(--u)); padding: 0 calc(1 * var(--u)) calc(.6 * var(--u));
  background: linear-gradient(180deg, #34506e, #22384f); color: #fff; box-shadow: 0 2px 2px rgba(0,0,0,.55); }
.fttl { grid-column: 1 / -1; text-align: center; font-style: italic; font-weight: 700; font-size: calc(2.3 * var(--u)); padding-top: calc(.4 * var(--u)); }
.fmodes { display: flex; flex-direction: column; gap: calc(.8 * var(--u)); }
.fmodes > span { display: flex; align-items: center; gap: calc(.9 * var(--u)); }
.fmodes i { display: block; }
.fmodes .ic { width: calc(3.6 * var(--u)); height: calc(3.6 * var(--u)); }
.fmodes .off, .fmodes .dk.off { opacity: .3; }
.dk { display: inline-grid; place-items: center; font-style: normal; font-size: calc(1.7 * var(--u)); min-width: calc(3 * var(--u)); height: calc(3.6 * var(--u)); border: 1px solid rgba(255,255,255,.85); border-radius: 2px; padding: 0 2px; color: #fff; }
.fright { display: flex; flex-direction: column; align-items: flex-end; gap: calc(.8 * var(--u)); font-size: calc(2.3 * var(--u)); padding-right: calc(1 * var(--u)); }
.fright span { display: flex; align-items: center; gap: 3px; }
.fright .chip { width: calc(3.6 * var(--u)); height: calc(3.6 * var(--u)); }
.fright .ic { width: calc(3 * var(--u)); height: calc(3 * var(--u)); }
.chev { width: calc(3 * var(--u)) !important; height: calc(3 * var(--u)) !important; padding: calc(.6 * var(--u)); border-radius: 50%; background: rgba(255,255,255,.85); filter: none; box-sizing: content-box; }
.chev { background: #fff; }
img.chev { filter: invert(1) brightness(.25); background: #000; }
#scr-open .list { padding: 0; }
.lrow2 { position: relative; display: block; width: 100%; text-align: left; color: #fff; padding: calc(.6 * var(--u)) calc(1 * var(--u)) calc(.8 * var(--u)); min-height: calc(8.7 * var(--u)); }
.lrow2::after { content: ''; position: absolute; left: calc(1.4 * var(--u)); right: calc(1.4 * var(--u)); bottom: 0; height: 1px; background: rgba(255,255,255,.5); box-shadow: 0 1px 1px rgba(0,0,0,.2); }
.lnames { display: flex; justify-content: center; align-items: center; gap: 4px; font-size: calc(1.9 * var(--u)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 calc(8 * var(--u)); }
.lnames .lk { width: calc(2.4 * var(--u)); height: calc(2.4 * var(--u)); }
.lline { display: flex; align-items: center; }
.lstk { width: calc(22 * var(--u)); display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: calc(3.4 * var(--u)); font-weight: 300; }
.lstk .chip { width: calc(3.8 * var(--u)); height: calc(3.8 * var(--u)); }
.lseat { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: calc(3.3 * var(--u)); font-weight: 300; padding-right: calc(5 * var(--u)); }
.lseat .ic { width: calc(3 * var(--u)); height: calc(3 * var(--u)); opacity: .9; }
.lrules { display: flex; align-items: center; gap: calc(.4 * var(--u)); margin-right: calc(1.6 * var(--u)); }
.lrules .ic { width: calc(3.4 * var(--u)); height: calc(3.4 * var(--u)); }
.lrules .dk { height: calc(3.4 * var(--u)); }

/* filters */
.frange { padding: calc(6 * var(--u)) calc(5 * var(--u)) 0; }
.ftrack { position: relative; height: calc(6 * var(--u)); touch-action: none; }
.ftrack::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: rgba(255,255,255,.35); border-radius: 2px; }
.fsel { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; background: #f2424f; }
.fth { position: absolute; top: 50%; width: calc(3.6 * var(--u)); height: calc(3.6 * var(--u)); margin: calc(-1.8 * var(--u)) 0 0 calc(-1.8 * var(--u)); border-radius: 50%; background: #fff; border: 2px solid #9aa4ae; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.fticks { position: relative; height: calc(3 * var(--u)); }
.fticks span { position: absolute; transform: translateX(-50%); font-size: calc(1.6 * var(--u)); color: #fff; white-space: nowrap; }
.frow { display: flex; justify-content: center; gap: calc(2.2 * var(--u)); }
.fpair { display: flex; justify-content: center; gap: calc(6 * var(--u)); }
.fchk { height: calc(5.2 * var(--u)); min-width: calc(8.6 * var(--u)); padding: 0 calc(1 * var(--u)); border-radius: calc(2.6 * var(--u)); background: #fff; color: #e0333f; display: flex; align-items: center; justify-content: center; gap: 2px;
  font-size: calc(3 * var(--u)); font-style: italic; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.fchk span .ic { width: calc(3 * var(--u)); height: calc(3 * var(--u)); filter: brightness(0) invert(27%) sepia(90%) saturate(4000%) hue-rotate(345deg); }
.fchk i .ic, .fmode i .ic { width: calc(3 * var(--u)); height: calc(3 * var(--u)); filter: hue-rotate(250deg) saturate(1.6); }
.fchk:not(.on) { background: rgba(255,255,255,.3); color: #fff; }
.fchk:not(.on) span .ic { filter: none; }
.fchk:not(.on) i { visibility: hidden; }
.fgrid { display: grid; grid-template-columns: repeat(4, calc(15.5 * var(--u))); justify-content: center; gap: calc(2.4 * var(--u)) calc(3 * var(--u)); margin-top: calc(2 * var(--u)); }
.fmode { position: relative; height: calc(10.8 * var(--u)); border-radius: calc(1.6 * var(--u)); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: calc(.6 * var(--u)); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.fmode > .ic { width: calc(7 * var(--u)); height: calc(7 * var(--u)); filter: brightness(.3) sepia(1) hue-rotate(175deg) saturate(2.2); }
.fmode span { font-size: calc(1.9 * var(--u)); color: #e0333f; white-space: nowrap; }
.fmode i { position: absolute; right: calc(-1 * var(--u)); top: calc(-1.2 * var(--u)); }
.fmode:not(.on) { background: rgba(255,255,255,.28); }
.fmode:not(.on) > .ic { filter: none; }
.fmode:not(.on) span { color: #fff; }
.fmode:not(.on) i { visibility: hidden; }

/* the player card */
.panel:has(.pcard) { padding: 0; width: min(92%, calc(72 * var(--u))); }
.pcard { position: relative; padding: calc(1 * var(--u)) calc(2 * var(--u)) calc(2 * var(--u)); }
.pcx { position: absolute; left: calc(1.6 * var(--u)); top: calc(1.6 * var(--u)); width: calc(5 * var(--u)); height: calc(5 * var(--u)); border-radius: 50%; background: #e94352; display: grid; place-items: center; }
.pcx .ic { width: 60%; height: 60%; transform: rotate(45deg); filter: brightness(0) invert(1); }
.pcname { text-align: center; color: #888; font-size: calc(3 * var(--u)); padding: calc(.6 * var(--u)) 0 calc(1 * var(--u)); }
.pcbody { display: flex; gap: calc(2 * var(--u)); }
.pcl { flex: 1; }
.pcava { position: relative; width: calc(28 * var(--u)); aspect-ratio: 1; margin: 0 auto; background: #000; }
.pcava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcava .lvl { position: absolute; top: 2px; right: 4px; color: #fff; font-style: normal; font-size: calc(2.4 * var(--u)); border-bottom: 1.5px solid #fff; text-shadow: 0 0 3px #000; }
.pcava .crown { position: absolute; left: -8px; top: -10px; width: calc(7 * var(--u)); height: calc(7 * var(--u)); transform: rotate(-20deg); }
.pcst { width: 100%; margin-top: calc(2 * var(--u)); border-collapse: collapse; font-size: calc(2.4 * var(--u)); color: #555; }
.pcst th { font-weight: 400; font-size: calc(2 * var(--u)); color: #999; }
.pcst td { text-align: center; padding: 2px 0; }
.pcst .st, .pcst .chip { width: calc(4 * var(--u)); height: calc(4 * var(--u)); display: inline-block; }
.pcst .gold { filter: brightness(0) saturate(100%) invert(68%) sepia(76%) saturate(560%) hue-rotate(2deg); }
.pcach { width: calc(16 * var(--u)); max-height: calc(48 * var(--u)); overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: calc(1.4 * var(--u)); padding: calc(1 * var(--u)) 0;
  background: #f4f6f8; border-radius: 4px; touch-action: pan-y; }
.pcach .aic { width: calc(9 * var(--u)); height: calc(9 * var(--u)); background: #2f4a66; }
.pcach .aic em { font-size: calc(1.8 * var(--u)); }

/* rules */
.rules2 { padding: calc(1 * var(--u)) calc(3.6 * var(--u)) calc(4 * var(--u)); font-size: calc(3.3 * var(--u)); line-height: 1.32; }
.rules2 h3 { font-weight: 400; font-size: calc(3.5 * var(--u)); margin: calc(3 * var(--u)) 0 calc(1.4 * var(--u)); }
.rules2 p { margin: 0 0 calc(1.6 * var(--u)); text-align: justify; text-indent: calc(2 * var(--u)); }
.rules2 ul { margin: 0 0 calc(1.6 * var(--u)); padding-left: calc(4 * var(--u)); }
.rules2 li { margin-bottom: calc(.6 * var(--u)); }
.smb { position: absolute; left: 50%; top: 50%; width: 120%; height: 120%; transform: translate(-50%, -50%) scale(.2); object-fit: contain; z-index: 9; pointer-events: none;
  animation: smpop 2.6s ease forwards; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
@keyframes smpop { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 20% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.smgrid.pick button { padding: 6px; border-radius: 10px; }
.smgrid.pick button:active { background: #eef1f4; }
.smgrid.pick img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.tb-me .ava, .opp .ava { cursor: pointer; }

.pcach:empty { visibility: hidden; }
.lstk { font-size: calc(4 * var(--u)); }
.lseat { font-size: calc(3.9 * var(--u)); }
.lnames { font-size: calc(2.1 * var(--u)); }
img.chev { background: #111; filter: invert(.95); }
.frange { padding-bottom: calc(6 * var(--u)); }

/* ===== Table, from the reference play screens (IMG_2163-2169) ===== */
.tb-exit.flag { width: calc(6.4 * var(--u)); height: calc(4.8 * var(--u)); margin-top: calc(1 * var(--u)); border-radius: calc(.9 * var(--u)); background: rgba(255,255,255,.22); }
.tb-exit.flag .ic { width: calc(3.6 * var(--u)); height: calc(3.6 * var(--u)); }
.tb-btn { border-radius: calc(3.9 * var(--u)); min-width: calc(37.4 * var(--u)); height: calc(7.7 * var(--u)); font-size: calc(3.6 * var(--u)); color: #e0333f;
  background: #fff; border: 1px solid #dedede; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.tb-btn.txt { visibility: visible; background: none; border: 0; box-shadow: none; font-size: calc(3.1 * var(--u)); pointer-events: none; }
.tb-btn.on.txt { pointer-events: auto; }
.bub { position: absolute; left: 50%; bottom: calc(100% - calc(1.2 * var(--u))); transform: translateX(-50%); z-index: 8; background: #f7ec00; color: #111; font-size: calc(2.7 * var(--u));
  padding: calc(.2 * var(--u)) calc(1.2 * var(--u)); border-radius: calc(1 * var(--u)); white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.3); pointer-events: none; }
.tb-me { position: relative; }
.tb-fx { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.fx-jester { position: absolute; width: calc(13 * var(--u)); aspect-ratio: 512 / 400; transform: translate(-50%, -50%) scale(.2); opacity: 0;
  background: url(../assets/ui/jester.png?a=1) center / contain no-repeat; transition: left .7s cubic-bezier(.4,.1,.3,1), top .7s cubic-bezier(.4,.1,.3,1), width .7s ease, transform .7s ease, opacity .3s; }
.fx-jester.big { width: calc(24 * var(--u)); opacity: 1; transform: translate(-50%, -50%) scale(1); animation: jpop .5s cubic-bezier(.2,1.6,.4,1); }
.fx-jester.big::before { content: ''; position: absolute; inset: -60%; z-index: -1; background: radial-gradient(circle, rgba(255,255,255,.75) 0, rgba(255,255,255,.28) 28%, rgba(255,255,255,0) 62%); }
.fx-jester.land { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.fx-jester span { position: absolute; left: 45.9%; top: 49.9%; transform: translate(-50%, -50%) rotate(-6deg); font-size: calc(var(--jw, 1) * 1em); color: #3a2a1a; font-weight: 400; white-space: nowrap; }
.fx-jester.big span { font-size: calc(4.4 * var(--u)); }
.fx-jester span { font-size: calc(2.4 * var(--u)); transition: font-size .7s ease; }
@keyframes jpop { from { transform: translate(-50%, -50%) scale(.2); } to { transform: translate(-50%, -50%) scale(1); } }
.fx-cash { position: absolute; width: calc(7.4 * var(--u)); aspect-ratio: 256 / 160; transform: translate(-50%, -50%) scale(0); background: url(../assets/ui/cash.png?a=1) center / contain no-repeat;
  display: grid; place-items: center; transition: transform .45s cubic-bezier(.2,1.6,.4,1); }
.fx-cash.shown { transform: translate(-50%, -50%) scale(1); }
.fx-cash span { font-size: calc(2.3 * var(--u)); color: #fff; text-shadow: 0 0 2px #2f6b12, 0 0 2px #2f6b12, 0 1px 1px #2f6b12; }
.card.back > * { visibility: hidden; }
.card.back { background: var(--back, url(../assets/back.webp)) center / cover !important; border: 1px solid rgba(255,255,255,.8); }
.card.ghost { pointer-events: none; transition: transform .42s cubic-bezier(.3,.7,.3,1), opacity .3s ease; }

/* ===== Create game, filters, keypad: 1:1 with IMG_2170-2173 (u = 1 % of the width) ===== */
.crbody { flex: 1; position: relative; overflow-y: auto; touch-action: pan-y; color: #fff; padding: 0 0 calc(14 * var(--u)); }
.crstake { display: flex; align-items: center; justify-content: space-between; padding: calc(3.6 * var(--u)) calc(1.4 * var(--u)) 0; }
.crstake b { font-style: italic; font-weight: 700; font-size: calc(3.1 * var(--u)); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.crval { display: flex; align-items: center; gap: calc(1 * var(--u)); font-size: calc(3.4 * var(--u)); font-weight: 700; }
.crval .chip { width: calc(5.6 * var(--u)); height: calc(5.6 * var(--u)); }
.sl { padding: calc(3 * var(--u)) calc(3.6 * var(--u)) 0; }
.sl.fsl { padding-top: calc(7 * var(--u)); }
.sltrack { position: relative; height: calc(5 * var(--u)); touch-action: none; }
.sltrack::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: rgba(255,255,255,.3); border-radius: 2px; }
.slsel { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; background: #f2424f; }
.slth { position: absolute; top: 50%; width: calc(3.8 * var(--u)); height: calc(3.8 * var(--u)); margin: calc(-1.9 * var(--u)) 0 0 calc(-1.9 * var(--u)); border-radius: 50%; background: #fff; border: 2px solid #a1a8b0; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.slbub { display: none; position: absolute; left: 50%; bottom: calc(100% + calc(1.2 * var(--u))); transform: translateX(-50%); min-width: calc(7.6 * var(--u)); padding: calc(.8 * var(--u)) calc(1.2 * var(--u));
  background: #fff; color: #e0333f; font-style: normal; font-size: calc(2.6 * var(--u)); text-align: center; border-radius: calc(1 * var(--u)); box-shadow: 0 1px 3px rgba(0,0,0,.3); white-space: nowrap; }
.slbub::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: #fff; }
.slth.on .slbub { display: block; }
.slticks { position: relative; height: calc(3 * var(--u)); margin-top: calc(.4 * var(--u)); }
.slticks span { position: absolute; transform: translateX(-50%); font-size: calc(1.6 * var(--u)); color: #fff; }
.slticks span:first-child { transform: none; } .slticks span:last-child { transform: translateX(-100%); }
.crbody .fh, .plist .fh { margin: calc(3.2 * var(--u)) 0 calc(.8 * var(--u)); font-size: calc(3.1 * var(--u)); }
.crbody .crrow { display: flex; justify-content: center; }
.crbody > .fh:first-of-type, .plist .fsl + .fh { margin-top: calc(17 * var(--u)); }
.crbody .fpair { gap: calc(2 * var(--u)); }
.crbody .fpair > div { display: flex; flex-direction: column; align-items: center; }
/* segmented bars */
.sbar { display: inline-flex; border-radius: calc(2.6 * var(--u)); overflow: hidden; background: rgba(255,255,255,.26); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sbar button { width: calc(10.6 * var(--u)); height: calc(5.2 * var(--u)); display: flex; align-items: center; justify-content: center; gap: 1px; color: #fff; font-style: italic; font-weight: 700; font-size: calc(3.1 * var(--u)); }
.sbar button.on { background: #fff; color: #e0333f; }
.sbar button:disabled { opacity: .35; }
.sbar .ic { width: calc(3 * var(--u)); height: calc(3 * var(--u)); }
.sbar button.on > span .ic { filter: brightness(0) invert(27%) sepia(90%) saturate(4000%) hue-rotate(345deg); }
.tick { width: calc(2.9 * var(--u)); height: calc(2.9 * var(--u)); object-fit: contain; }
/* the rule columns: top half / bottom half of each pair */
.mcols { display: flex; justify-content: center; gap: calc(1.4 * var(--u)); margin-top: calc(1.4 * var(--u)); }
.mcol { width: calc(12.4 * var(--u)); display: flex; flex-direction: column; gap: 1px; }
.mhalf { position: relative; height: calc(10.6 * var(--u)); background: rgba(255,255,255,.26); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: calc(.5 * var(--u)); }
.mhalf:first-child { border-radius: calc(1.8 * var(--u)) calc(1.8 * var(--u)) 0 0; }
.mhalf:last-child { border-radius: 0 0 calc(1.8 * var(--u)) calc(1.8 * var(--u)); }
.mhalf > .ic { width: calc(6.6 * var(--u)); height: calc(6.6 * var(--u)); margin-bottom: calc(.4 * var(--u)); }
.mhalf span { font-size: calc(1.9 * var(--u)); color: #fff; white-space: nowrap; }
.mhalf.on { background: #fff; }
.mhalf.on > .ic { filter: brightness(.3) sepia(1) hue-rotate(175deg) saturate(2.2); }
.mhalf.on span { color: #e0333f; }
.mhalf .tick { position: absolute; right: calc(-.8 * var(--u)); top: calc(-1 * var(--u)); width: calc(3.2 * var(--u)); height: calc(3.2 * var(--u)); }
/* private + Create */
.crfoot { position: absolute; left: calc(2 * var(--u)); right: calc(3 * var(--u)); bottom: calc(2.8 * var(--u)); display: flex; align-items: center; justify-content: space-between; }
#scr-create .crbody { display: flex; flex-direction: column; }
#scr-create .crfoot { position: relative; left: auto; right: auto; bottom: auto; margin: auto calc(3 * var(--u)) calc(2.8 * var(--u)) calc(2 * var(--u)); padding-top: calc(6 * var(--u)); }
.crbody { padding-bottom: 0; }
.crpriv { display: flex; align-items: center; gap: calc(1.4 * var(--u)); color: #fff; text-align: left; }
.cbox { width: calc(4.3 * var(--u)); height: calc(4.3 * var(--u)); border: 2px solid #fff; border-radius: calc(.8 * var(--u)); display: grid; place-items: center; flex: none; }
.cbox .ic { width: 90%; height: 90%; filter: brightness(0) invert(1); }
.crpriv span { font-style: italic; font-weight: 700; font-size: calc(3.1 * var(--u)); line-height: 1.1; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.crgo { width: calc(26 * var(--u)); height: calc(7.5 * var(--u)); border-radius: calc(3.75 * var(--u)); background: rgba(255,255,255,.3); box-shadow: 0 1px 3px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; gap: calc(2.4 * var(--u)); color: #fff; font-style: italic; font-weight: 700; font-size: calc(2.8 * var(--u)); }
.crgo .ic { width: calc(3.4 * var(--u)); height: calc(3.4 * var(--u)); }
/* filters: selected chips are white pills with a red tick, the others grey circles */
.plist .frow { gap: calc(2.1 * var(--u)); align-items: center; }
.fchk { height: calc(5 * var(--u)); min-width: calc(8.5 * var(--u)); border-radius: calc(2.5 * var(--u)); padding: 0 calc(1.2 * var(--u)); gap: 2px; font-size: calc(3.1 * var(--u)); }
.fchk:not(.on) { min-width: calc(5 * var(--u)); width: calc(5 * var(--u)); padding: 0; border-radius: 50%; background: rgba(255,255,255,.26); }
.fchk .tick { width: calc(2.9 * var(--u)); height: calc(2.9 * var(--u)); }
.fchk.on span .ic { filter: brightness(0) invert(27%) sepia(90%) saturate(4000%) hue-rotate(345deg); }
.plist .fpair { gap: calc(6 * var(--u)); }
.fgrid { grid-template-columns: repeat(4, calc(12.1 * var(--u))); gap: calc(3 * var(--u)) calc(1.5 * var(--u)); margin-top: calc(1.4 * var(--u)); }
.fmode { height: calc(10.3 * var(--u)); border-radius: calc(1.8 * var(--u)); }
.fmode > .ic { width: calc(6.6 * var(--u)); height: calc(6.6 * var(--u)); }
.fmode .tick { position: absolute; right: calc(-.8 * var(--u)); top: calc(-1 * var(--u)); width: calc(3.2 * var(--u)); height: calc(3.2 * var(--u)); }
.fmode:not(.on) { box-shadow: none; }
/* keypad */
.panel:has(.kpad) { padding: 0; width: calc(38.4 * var(--u)); border-radius: calc(2.6 * var(--u)); }
.kpad { position: relative; padding: calc(2 * var(--u)) calc(1.8 * var(--u)) calc(2.4 * var(--u)); }
.kttl { text-align: center; color: #666; font-size: calc(2.3 * var(--u)); }
.kslots { display: flex; justify-content: center; gap: calc(1.6 * var(--u)); margin: calc(2 * var(--u)) auto calc(2.4 * var(--u)); width: max-content; border-bottom: 1px solid #999; padding: 0 calc(1 * var(--u)) calc(.6 * var(--u)); }
.kslots i { width: calc(3 * var(--u)); height: calc(5 * var(--u)); border-left: 1px solid #ccc; border-right: 1px solid #ccc; font-style: normal; font-size: calc(3.4 * var(--u)); color: #e0333f; display: grid; place-items: center; }
.kkeys { display: grid; grid-template-columns: repeat(3, calc(10.7 * var(--u))); gap: calc(1.4 * var(--u)); justify-content: center; }
.kkeys button { width: calc(10.7 * var(--u)); height: calc(10.7 * var(--u)); border-radius: 50%; border: 1px solid #e0333f; color: #e0333f; font-size: calc(3.6 * var(--u)); }
.kkeys button:active { background: #fdecee; }
.kpad .pcx { left: calc(1.4 * var(--u)); top: calc(1.4 * var(--u)); width: calc(3.6 * var(--u)); height: calc(3.6 * var(--u)); }
.pcnote { display: block; margin: calc(.8 * var(--u)) auto 0; color: #e25563; font-size: calc(2.1 * var(--u)); }
.pcbtns { display: flex; justify-content: space-around; margin-top: calc(2 * var(--u)); }
.pcbtns button { color: #e25563; font-size: calc(2.6 * var(--u)); padding: calc(.6 * var(--u)) calc(2 * var(--u)); }

/* settings: side padding; the "+" squares in the white strip keep the sign centred */
.spad { padding: calc(2 * var(--u)) calc(4 * var(--u)) calc(4 * var(--u)); }
.spad label { display: block; font-size: calc(2.6 * var(--u)); color: rgba(255,255,255,.9); margin: calc(3 * var(--u)) 0 calc(1.2 * var(--u)); text-transform: uppercase; letter-spacing: .06em; }
.spad .btn.big { margin-top: calc(4 * var(--u)); width: 100%; }
.pstrip .plus { display: grid; place-items: center; padding: 0; }
.pstrip .plus .ic, .plus .ic { width: 60%; height: 60%; margin: auto; }
/* tournaments switched off for now */
.tile.off { opacity: .4; }
/* the rematch: ready order under the avatars */
.rnum { position: absolute; left: 50%; top: calc(100% + calc(1.4 * var(--u))); transform: translateX(-50%); color: #fff; font-style: italic; font-weight: 700; font-size: calc(2.8 * var(--u)); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.tb-me { position: relative; }
.tb-me .rnum { top: calc(100% - calc(.6 * var(--u))); }
/* the end of a game is all art: the glow behind the cap is an image too */
.fx-jester.big::before { inset: -70%; background: url(../assets/ui/glow.png?a=1) center / contain no-repeat; }
.pbuy .tgstar { width: calc(4.2 * var(--u)); height: calc(4.2 * var(--u)); margin-left: calc(.6 * var(--u)); }
