/* Tichu (static/js/games/tichu.js): a lacquer room — a table of red lacquer (or jade, rice paper, a night with
   lanterns, teak) with a fine gold line and cloud corners, the players on dark plates round it (your partner across),
   the combinations in the middle each lying where it landed, the scores on a small plaque. Five tables (.tct-*) and
   five card backs (drawn in the js). Its own look. */

/* ---------- the tables ---------- */
.tct-lacquer { --f1: #a3212c; --f2: #4a0a10; --gold: #e2b85c; --gold2: #ffe3a1; --ink: #fff4e4; --mut: #f0c9b8;
  --plate: rgba(40,6,10,.62); --plateb: rgba(226,184,92,.45); --pink: #fff4e4; --pmut: #f0c9b8; --pan: #2b0a0e; --pan2: #431218; --panb: #e2b85c; --acc: #ffd77a; }
.tct-jade { --f1: #1f7a5c; --f2: #0a2f24; --gold: #c9a24e; --gold2: #f3dc9a; --ink: #eefaf3; --mut: #b6dccb;
  --plate: rgba(6,32,24,.6); --plateb: rgba(201,162,78,.42); --pink: #eefaf3; --pmut: #b6dccb; --pan: #0b2a21; --pan2: #134234; --panb: #c9a24e; --acc: #f3dc9a; }
.tct-ink { --f1: #f4eedf; --f2: #d8ccb0; --gold: #a83a32; --gold2: #c9473d; --ink: #1d1a16; --mut: #5b5247;
  --plate: rgba(255,252,244,.78); --plateb: rgba(168,58,50,.4); --pink: #1d1a16; --pmut: #5b5247; --pan: #f7f2e6; --pan2: #ebe2cf; --panb: #a83a32; --acc: #a83a32; }
.tct-night { --f1: #1c2a52; --f2: #070c1e; --gold: #ff9f43; --gold2: #ffd29a; --ink: #eef2ff; --mut: #a9b4d8;
  --plate: rgba(6,10,28,.62); --plateb: rgba(255,159,67,.42); --pink: #eef2ff; --pmut: #a9b4d8; --pan: #0a1128; --pan2: #142045; --panb: #ff9f43; --acc: #ffb86b; }
.tct-teak { --f1: #8a5a32; --f2: #3a2210; --gold: #f0c27a; --gold2: #ffe2b0; --ink: #fff6ea; --mut: #e6c9a8;
  --plate: rgba(36,20,8,.6); --plateb: rgba(240,194,122,.42); --pink: #fff6ea; --pmut: #e6c9a8; --pan: #2a1708; --pan2: #3f2510; --panb: #f0c27a; --acc: #ffd99a; }

/* ---------- a card ---------- */
.tcc { position: relative; display: block; width: var(--cw, 64px); aspect-ratio: 2 / 3; flex: none; border-radius: calc(var(--cw, 64px) * .1); }
.tcc .tcsvg, .tc-hc .tcsvg { display: block; width: 100%; height: 100%; }
.tc-ghost { position: fixed; z-index: 95; pointer-events: none; will-change: transform; filter: drop-shadow(0 12px 14px rgba(0,0,0,.35)); }
.tc-ghost .tcc { width: 100%; }

/* ---------- the page ---------- */
html:has(body.game-tichu[data-page="table"]) { overflow: hidden; }
body.game-tichu[data-page="table"] .site-foot { display: none; }
body.game-tichu[data-page="table"] .chat-fab { display: none !important; }
body.game-tichu[data-page="table"] #table.page { max-width: none; height: calc(100dvh - var(--top)); box-sizing: border-box; overflow: hidden; padding: 10px 14px; }
body.game-fs .tc-wrap { height: 100%; }
.tc-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; height: 100%;
  --cw: clamp(50px, 4.6vw, 72px); }

/* ---------- the bar ---------- */
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 5px 6px 5px 14px; border-radius: 12px;
  background: var(--pan); border: 1px solid color-mix(in srgb, var(--panb) 50%, transparent); color: var(--ink); }
.tc-info { min-width: 0; font: 700 12.5px 'Inter', system-ui, sans-serif; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.tc-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 38px; height: 38px; padding: 0; border-radius: 9px; cursor: pointer;
  color: var(--ink); font: 700 12.5px 'Inter', system-ui, sans-serif; background: var(--plate); border: 1px solid var(--plateb); backdrop-filter: blur(10px); }
.tc-tool:hover { color: var(--gold2); border-color: var(--gold); }
.tc-tool svg.i { width: 17px; height: 17px; }
.tc-tool.wide { width: auto; padding: 0 14px; white-space: nowrap; }
.tc-tool.hidden { display: none; }
.tc-tool > b { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; display: grid; place-items: center;
  font-size: 10.5px; color: #fff; background: #d23a44; }
.tc-tool > b.hidden { display: none; }
.tc-mute .tv-snd-off { display: none; }
body.tv-muted .tc-mute .tv-snd-off { display: inline; } body.tv-muted .tc-mute .tv-snd-on { display: none; }

/* ---------- the table: lacquer, a gold line, cloud corners ---------- */
.tc-table { position: relative; min-height: 0; border-radius: 26px; isolation: isolate; color: var(--ink);
  background: radial-gradient(ellipse 55% 45% at 50% 40%, rgba(255,255,255,.12), transparent 70%), radial-gradient(ellipse 100% 90% at 50% 50%, var(--f1), var(--f2));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 75%, transparent), inset 0 0 0 7px rgba(0,0,0,.28), inset 0 2px 40px rgba(0,0,0,.35), 0 22px 40px -22px rgba(0,0,0,.6); }
.tc-table::before { content: ''; position: absolute; inset: 14px; border-radius: 16px; pointer-events: none; z-index: -1; border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.tc-table::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: .5;
  background: radial-gradient(circle at 26px 26px, transparent 14px, color-mix(in srgb, var(--gold) 40%, transparent) 15px, transparent 16px),
    radial-gradient(circle at calc(100% - 26px) 26px, transparent 14px, color-mix(in srgb, var(--gold) 40%, transparent) 15px, transparent 16px),
    radial-gradient(circle at 26px calc(100% - 26px), transparent 14px, color-mix(in srgb, var(--gold) 40%, transparent) 15px, transparent 16px),
    radial-gradient(circle at calc(100% - 26px) calc(100% - 26px), transparent 14px, color-mix(in srgb, var(--gold) 40%, transparent) 15px, transparent 16px); }
.tc-table.boom { animation: tcBoom .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes tcBoom { 20% { transform: translate(-4px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, 3px); } 80% { transform: translate(2px, -1px); } }

/* ---------- the scores ---------- */
.tc-score { position: absolute; left: 22px; top: 18px; z-index: 6; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--plate); border: 1px solid var(--plateb);
  backdrop-filter: blur(10px); box-shadow: 0 8px 18px -10px rgba(0,0,0,.45); }
.tc-sc { display: grid; justify-items: center; min-width: 54px; padding: 4px 8px; border-radius: 7px; line-height: 1.15; }
.tc-sc small { font: 800 9.5px 'Inter', system-ui, sans-serif; letter-spacing: .8px; text-transform: uppercase; color: var(--pmut); }
.tc-sc b { font: 800 19px 'Inter', system-ui, sans-serif; color: var(--pink); font-variant-numeric: tabular-nums; }
.tc-sc.us { background: color-mix(in srgb, var(--gold) 22%, transparent); } .tc-sc.us b { color: var(--gold2); }
.tct-ink .tc-sc.us b { color: var(--gold); }
.tc-sc.to b { font-size: 14px; color: var(--pmut); }

/* ---------- the others ---------- */
.tc-opps { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.tc-opp { position: absolute; display: grid; justify-items: center; gap: 6px; }
.tc-opp.at-t { left: 50%; top: 20px; transform: translateX(-50%); }
.tc-opp.at-l { left: 24px; top: 50%; transform: translateY(-50%); } .tc-opp.at-r { right: 24px; top: 50%; transform: translateY(-50%); }
.tc-plate { display: flex; align-items: center; gap: 7px; padding: 4px 8px 4px 4px; border-radius: 999px; background: var(--plate); border: 1px solid var(--plateb);
  backdrop-filter: blur(10px); box-shadow: 0 8px 18px -10px rgba(0,0,0,.45); }
.tc-opp.mate .tc-plate { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent), 0 8px 18px -10px rgba(0,0,0,.45); }
.tc-opp.turn .tc-plate { border-color: var(--gold2); box-shadow: 0 0 0 2px var(--gold), 0 8px 22px -8px var(--gold); }
.tc-av { position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 3px; box-sizing: border-box; border-radius: 50%; flex: none; }
.tc-tring { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.2); }
.tc-opp.turn .tc-tring, .tc-dock.my-turn .tc-tring { background: conic-gradient(var(--gold2) calc(var(--k, 1) * 360deg), rgba(0,0,0,.2) 0); }
.tc-avi { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 800; font-size: 15px;
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.4), transparent 45%), var(--bg); box-shadow: 0 0 0 2px var(--gold); }
.tc-avi svg.i { width: 19px; height: 19px; } .tc-avi .ava-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tc-pn { display: grid; line-height: 1.15; color: var(--pink); }
.tc-pn b { font-size: 12.5px; font-weight: 800; max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-pn small { font-size: 10.5px; font-weight: 600; color: var(--pmut); }
.tc-cnt { min-width: 22px; padding: 2px 7px; border-radius: 999px; text-align: center; font: 800 12px 'Inter', system-ui, sans-serif; font-style: normal; color: var(--f2); background: var(--gold); }
.tc-callb { padding: 2px 8px; border-radius: 999px; font: 900 10px/1.4 'Inter', system-ui, sans-serif; letter-spacing: .5px; text-transform: uppercase; color: #2a0508;
  background: linear-gradient(145deg, #ffe08a, #f0a83a); box-shadow: 0 0 10px rgba(255,190,80,.6); }
.tc-callb.grand { color: #fff; background: linear-gradient(145deg, #ff5e62, #b3122a); box-shadow: 0 0 12px rgba(255,80,90,.65); }
.tc-outb { padding: 2px 8px; border-radius: 999px; font: 800 10.5px 'Inter', system-ui, sans-serif; color: #0d2a1c; background: #7fe0a8; }
.tc-ready { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 900; color: #0d2a1c; background: #7fe0a8; }
.tc-backs { position: relative; display: block; width: 120px; height: 40px; }
.tc-backs i { position: absolute; left: calc(50% - 13px + var(--k) * 6px); bottom: 0; width: 26px; aspect-ratio: 2 / 3; transform: rotate(calc(var(--k) * 4deg)); transform-origin: 50% 120%;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.tc-backs i .tcsvg { display: block; width: 100%; height: 100%; }
.tc-say { padding: 3px 10px; border-radius: 999px; font: 800 11.5px 'Inter', system-ui, sans-serif; white-space: nowrap; color: var(--pink); background: var(--plate);
  border: 1px solid var(--plateb); animation: tcSay .25s ease-out; }
.tc-say.me { margin-left: 4px; }
@keyframes tcSay { from { transform: scale(.7); opacity: 0; } }

/* ---------- the middle: the deck while dealing, the combinations of the trick, the wish ---------- */
.tc-center { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 4; display: grid; place-items: center; width: min(70%, 640px); height: calc(var(--cw) * 2.9); }
.tc-deck { position: absolute; width: var(--cw); aspect-ratio: 2 / 3; z-index: 3; }
.tc-deck.hidden { display: none; }
.tc-deck .tcc.d { position: absolute; inset: 0; width: 100%; transform: translate(calc(var(--i) * -1.5px), calc(var(--i) * -2px)); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
/* (the shuffle: the deck split and riffled twice, before everybody's eyes) */
.tc-deck.shuf .tcc.d:nth-child(odd) { animation: tcRiffA .7s ease-in-out 2; }
.tc-deck.shuf .tcc.d:nth-child(even) { animation: tcRiffB .7s ease-in-out 2; }
@keyframes tcRiffA { 40% { transform: translate(-70%, -4px) rotate(-10deg); } 60% { transform: translate(-70%, -4px) rotate(-10deg); } }
@keyframes tcRiffB { 40% { transform: translate(70%, -4px) rotate(10deg); } 60% { transform: translate(70%, -4px) rotate(10deg); } }
.tc-pile { position: relative; width: 100%; height: 100%; }
.tc-pile.fade { transition: opacity .6s; opacity: 0; }
.tc-play { position: absolute; left: 50%; top: 50%; display: flex; transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)); }
.tc-play .tcc { width: var(--cw); margin-left: calc(var(--cw) * -.58); filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.tc-play .tcc:first-child { margin-left: 0; }
.tc-combo { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); z-index: 6; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 12px; border-radius: 999px; font: 700 12px 'Inter', system-ui, sans-serif; color: var(--pink); background: var(--plate); border: 1px solid var(--plateb); }
.tc-combo.hidden, .tc-wish.hidden { display: none; }
.tc-wish { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); z-index: 6; padding: 4px 14px; border-radius: 999px; white-space: nowrap;
  font: 700 12.5px 'Inter', system-ui, sans-serif; color: #2a0508; background: linear-gradient(145deg, #ffe08a, #f0a83a); box-shadow: 0 0 14px rgba(255,190,80,.5); }
.tc-wish b { font-size: 15px; }

/* ---------- the word in the middle ---------- */
.tc-banner { position: absolute; left: 50%; top: 18%; z-index: 25; transform: translateX(-50%); max-width: min(92%, 560px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; padding: 8px 18px; border-radius: 10px; font: 800 14px 'Inter', system-ui, sans-serif; color: var(--pink); background: var(--plate);
  border: 1px solid var(--plateb); backdrop-filter: blur(12px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.5); animation: tcBan .3s ease-out; }
.tc-banner.blank { display: none; }
.tc-banner.good { color: #0d2a1c; background: #7fe0a8; border-color: transparent; }
.tc-banner.gold { color: #2a1a05; background: linear-gradient(145deg, #ffe3a1, #e2b85c); border-color: #c9a14a; }
.tc-banner.call { color: #2a0508; background: linear-gradient(145deg, #ffe08a, #f0a83a); border-color: transparent; font-size: 16px; }
.tc-banner.bomb { color: #fff; background: linear-gradient(145deg, #ff5e62, #8f0f22); border-color: transparent; font-size: 16px; }
@keyframes tcBan { from { opacity: 0; transform: translate(-50%, -6px); } }
.tc-table > .paused21 { z-index: 26; }

/* ---------- the time round the table ---------- */
/* (the turn's line round the table: on its own layer — it changes every frame, the table under it is not drawn again) */
.tc-timer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; will-change: transform; }
.tc-timer rect { fill: none; stroke-width: 3; }
.tc-timer .tr-bg { stroke: rgba(0,0,0,.12); }
.tc-timer .tr-fg { stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-linecap: round; stroke-dasharray: 100 100; }
.tc-timer.mine .tr-fg { stroke: var(--gold2); }
.tc-timer.low .tr-fg { stroke: #ff5e62; animation: tcLow .55s ease-in-out infinite alternate; }
.tc-timer.idle .tr-fg, .tc-timer.idle .tr-head { opacity: 0; }
.tc-timer .tr-head { fill: #fff; stroke: var(--gold); stroke-width: 2; }
@keyframes tcLow { to { stroke-width: 5; } }

/* ---------- you ---------- */
.tc-me { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.tc-dock { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; padding: 9px 230px; border-radius: 12px; min-width: 0; text-align: center;
  background: var(--pan); border: 1px solid color-mix(in srgb, var(--panb) 50%, transparent); color: var(--pink); }
.tc-dock.my-turn { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); }
.tc-who { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; }
.tc-meinfo { display: flex; align-items: center; gap: 6px; } .tc-meinfo b { font-size: 13px; font-weight: 800; }
.tc-dock .turnlbl { display: flex; justify-content: center; gap: 10px; margin: 0; max-width: 100%; }
.tc-dock .turnlbl b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-dock .turnlbl span { font-size: 12px; font-weight: 600; color: var(--pmut); white-space: nowrap; }
.tc-dock .tbar { display: none; }
/* what you may do */
.tc-acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 4px 8px 0; }
.tc-acts.hidden { display: none; }
.tc-ask { font: 700 12.5px 'Inter', system-ui, sans-serif; color: var(--pmut); }
.tc-must { font: 800 12px 'Inter', system-ui, sans-serif; color: #ffbf5e; }
.tc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px; cursor: pointer; color: var(--pink);
  background: var(--pan2); border: 1px solid color-mix(in srgb, var(--panb) 55%, transparent); font: 800 13.5px 'Inter', system-ui, sans-serif; transition: transform .12s, box-shadow .2s, opacity .2s; }
.tc-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 14px -6px var(--gold); }
.tc-btn:disabled { opacity: .5; cursor: default; }
.tc-btn.go { color: #2a1a05; background: linear-gradient(145deg, var(--gold2), var(--gold)); border-color: transparent; }
.tc-btn.bomb { color: #fff; background: linear-gradient(145deg, #ff5e62, #a3122a); }
.tc-btn.call { color: #2a0508; background: linear-gradient(145deg, #ffe08a, #f0a83a); border-color: transparent; }
.tc-btn.call.arm { animation: tcArm .6s ease-in-out infinite alternate; }
@keyframes tcArm { to { box-shadow: 0 0 0 3px rgba(255,190,80,.6), 0 0 18px rgba(255,190,80,.7); } }
.tc-btn.rk { min-width: 38px; justify-content: center; padding: 8px 10px; }
.tc-slot { display: grid; justify-items: center; gap: 3px; min-width: 70px; padding: 5px 8px; border-radius: 10px; cursor: pointer; color: var(--pink);
  background: var(--pan2); border: 1px dashed color-mix(in srgb, var(--panb) 70%, transparent); font: 700 10.5px 'Inter', system-ui, sans-serif; }
.tc-slot small { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pmut); }
.tc-slot i { font-style: normal; font-size: 20px; line-height: 38px; color: var(--pmut); }
.tc-slot.full { border-style: solid; border-color: var(--gold); }
.tc-slot.k-p { border-color: color-mix(in srgb, #7fe0a8 70%, transparent); }
.tc-slot .tcc.mini { --cw: 26px; }
/* your cards: the chosen ones stand up; under the pointer only the picture rises (the card's place stays: no flicker) */
.tc-hand { display: flex; justify-content: center; align-items: flex-end; min-width: 0; overflow: hidden; --gap: 0px;
  padding: 30px 8px calc(14px + env(safe-area-inset-bottom)); min-height: calc(var(--cw) * 1.5 + 34px); }
.tc-hc { position: relative; flex: none; width: var(--cw); aspect-ratio: 2 / 3; padding: 0; border: 0; background: none; cursor: pointer; margin-left: var(--gap);
  border-radius: calc(var(--cw) * .1); filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); transition: filter .2s, opacity .2s; }
.tc-hc:first-child { margin-left: 0; }
.tc-hc .tcsvg { transition: transform .16s; }
.tc-hc:hover .tcsvg { transform: translateY(-10px); }
.tc-hc.sel .tcsvg, .tc-hc.sel:hover .tcsvg { transform: translateY(-24px); }
.tc-hc.sel { filter: drop-shadow(0 0 0 var(--gold)) drop-shadow(0 0 8px color-mix(in srgb, var(--gold) 80%, transparent)) drop-shadow(0 8px 10px rgba(0,0,0,.4)); z-index: 2; }
.tc-hc.given { opacity: .35; }
.tc-hc.recv .tcsvg { animation: tcRecv 1.2s ease-in-out 2; }
@keyframes tcRecv { 50% { filter: drop-shadow(0 0 10px #7fe0a8); } }
.tc-hc.gone { opacity: 0; transition: opacity .08s; }
.tc-hc.nope { animation: tcNope .35s; }
@keyframes tcNope { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
.tc-hc.came .tcsvg { animation: tcCame .45s cubic-bezier(.3,1.3,.5,1); }
@keyframes tcCame { from { transform: translateY(-60px) scale(.8); opacity: 0; } }

/* ---------- the end of a round ---------- */
.tc-res { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 12px; pointer-events: none; }
.tc-res.hidden { display: none; }
.tc-res-in { pointer-events: auto; width: min(440px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; box-sizing: border-box; padding: 18px; border-radius: 16px;
  color: var(--pink); background: var(--pan); border: 1px solid var(--panb); box-shadow: inset 0 0 0 4px var(--pan), inset 0 0 0 5px color-mix(in srgb, var(--panb) 45%, transparent), 0 30px 70px -20px rgba(0,0,0,.7);
  animation: tcIn .3s ease-out; }
@keyframes tcIn { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.tc-res-in h3 { margin: 2px 0 10px; text-align: center; font: 800 21px 'Inter', system-ui, sans-serif; color: var(--gold2); }
.tct-ink .tc-res-in h3 { color: var(--gold); }
.tc-rorder, .tc-rcalls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.tc-ro { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 3px; border-radius: 999px; font: 700 12px 'Inter', system-ui, sans-serif; background: var(--pan2); }
.tc-ro em { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-weight: 900; color: #2a1a05; background: var(--gold); }
.tc-rc { padding: 3px 9px; border-radius: 999px; font: 800 11.5px 'Inter', system-ui, sans-serif; }
.tc-rc.ok { color: #0d2a1c; background: #7fe0a8; } .tc-rc.no { color: #fff; background: #b3122a; }
.tc-rt { width: 100%; border-collapse: separate; border-spacing: 0 5px; font: 600 13px 'Inter', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.tc-rt th { font-size: 11.5px; font-weight: 700; color: var(--pmut); text-align: center; padding: 0 6px; }
.tc-rt th.us { color: var(--gold2); }
.tc-rt td, .tc-rt tr:not(:first-child) th { padding: 8px 8px; background: var(--pan2); text-align: center; }
.tc-rt tr:not(:first-child) th { border-radius: 8px 0 0 8px; color: var(--pink); text-align: left; }
.tc-rt td:last-child { border-radius: 0 8px 8px 0; }
.tc-rt tr.sum td { font-weight: 800; color: var(--gold2); }
.tct-ink .tc-rt tr.sum td { color: var(--gold); }
.tc-rt tr.tot td { font-size: 17px; font-weight: 900; }
.tc-res-n { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--pmut); }

/* ---------- home and my look ---------- */
.hero-tc .tc-art { display: flex; justify-content: center; padding: 4px 0 10px; }
.hero-tc .tc-art img { display: block; width: 100%; max-width: 320px; height: auto; filter: drop-shadow(0 14px 18px rgba(0,0,0,.45)); }
.tc-target { display: grid; grid-template-columns: repeat(2, 1fr); }
.tc-target button { font-size: 12.5px; font-weight: 900; }
.tc-lk { position: relative; display: block; width: 100%; height: 100%; min-height: 60px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse 90% 80% at 50% 50%, var(--f1), var(--f2)); box-shadow: inset 0 0 0 2px var(--gold); }
.tc-lk-c { position: absolute; top: 50%; width: 28%; max-width: 46px; aspect-ratio: 2 / 3; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.tc-lk-c .tcsvg { width: 100%; height: 100%; display: block; }
.tc-lk-c.b { left: 32%; transform: translate(-50%, -50%) rotate(-8deg); } .tc-lk-c.f { left: 64%; transform: translate(-50%, -50%) rotate(6deg); }
.logo-tc { width: 36px; height: 36px; flex: none; } .logo-tc img { width: 36px; height: 36px; display: block; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
.tc-team { align-self: flex-start; margin-top: 4px; padding: 2px 9px; border: 0; border-radius: 999px; cursor: pointer; font: 900 10px/1.4 'Inter', system-ui, sans-serif;
  letter-spacing: .4px; text-transform: uppercase; transition: background .2s, color .2s, box-shadow .2s; }
.tc-team.mate { background: rgba(226,184,92,.2); color: #ffe3a1; box-shadow: inset 0 0 0 1px rgba(226,184,92,.55); }
.tc-team.foe { background: rgba(140,150,168,.14); color: #c2c9d6; box-shadow: inset 0 0 0 1px rgba(140,150,168,.35); }
.tc-team.foe:hover { background: rgba(226,184,92,.14); color: #ffe3a1; box-shadow: inset 0 0 0 1px rgba(226,184,92,.45); }
/* the seats: your partner marked in gold, the opponents in grey */
.seat-wrap.tc-mate-seat .seat-row { box-shadow: inset 3px 0 0 #e2b85c; }
.seat-wrap.tc-foe-seat .seat-row { box-shadow: inset 3px 0 0 #8c96a8; }

/* ---------- a computer: the tools on the table's corner ---------- */
@media (min-width: 761px) and (min-height: 521px) {
  .tc-wrap { grid-template-rows: minmax(0, 1fr) auto; }
  .tc-top { position: absolute; top: 16px; right: 20px; z-index: 30; padding: 0; background: none; border: 0; }
  .tc-top .tc-info { display: none; }
}
/* ---------- a phone ---------- */
@media (max-width: 760px) {
  .tc-wrap { --cw: clamp(34px, 9.6vw, 50px); }
  .tc-av { width: 30px; height: 30px; padding: 2px; } .tc-pn b { font-size: 11px; max-width: 60px; } .tc-pn small { display: none; }
  .tc-backs { width: 64px; height: 26px; } .tc-backs i { width: 17px; left: calc(50% - 8px + var(--k) * 3px); }
  .tc-opp.at-l { left: 6px; } .tc-opp.at-r { right: 6px; } .tc-opp.at-t { top: 58px; }
  .tc-score { left: 50%; top: 8px; transform: translateX(-50%); } .tc-sc { min-width: 42px; padding: 3px 6px; } .tc-sc b { font-size: 15px; }
  .tc-dock { padding: 7px 10px; } .tc-who { display: none; }
  .tc-tool { width: 34px; height: 34px; }
  .tc-center { width: 92%; }
  .tc-btn { padding: 8px 12px; font-size: 12.5px; }
}
@media (max-width: 760px) and (orientation: portrait) { .tc-table { align-self: center; height: min(100%, 140vw); }
  .tc-opp.at-l, .tc-opp.at-r { top: 44%; } .tc-center { top: 58%; } }
@media (orientation: landscape) and (max-height: 520px) {
  body.game-tichu[data-page="table"] .top { display: none; }
  body.game-tichu[data-page="table"] #table.page { height: 100dvh; margin: 0; padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(2px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .tc-wrap { --cw: clamp(28px, 8vh, 42px); gap: 4px; grid-template-rows: minmax(0, 1fr) auto; }
  .tc-top { position: absolute; top: 8px; right: 10px; z-index: 30; padding: 0; background: none; border: 0; } .tc-top .tc-info { display: none; }
  .tc-score { left: 12px; top: auto; bottom: 10px; transform: none; } .tc-sc { min-width: 36px; padding: 2px 5px; } .tc-sc b { font-size: 13px; }
  .tc-opp.at-t { top: 6px; } .tc-opp.at-t .tc-backs { display: none; } .tc-opp.at-l, .tc-opp.at-r { top: 46%; }
  .tc-opp .tc-backs { width: 56px; height: 22px; } .tc-opp .tc-backs i { width: 14px; left: calc(50% - 7px + var(--k) * 3px); }
  .tc-av { width: 26px; height: 26px; padding: 2px; } .tc-pn small { display: none; }
  /* (a low table: the trick a little lower, its name beside it, the wish under it) */
  .tc-center { top: 60%; height: calc(var(--cw) * 2.1); width: 50%; }
  .tc-combo { bottom: auto; top: 50%; left: auto; right: calc(50% + var(--cw) * 1.3); transform: translateY(-50%); }
  .tc-wish { top: 50%; left: calc(50% + var(--cw) * 1.3); transform: translateY(-50%); }
  .tc-dock { padding: 4px 8px; gap: 3px; flex-direction: row; justify-content: center; } .tc-who { display: none; }
  .tc-hand { padding-top: 22px; min-height: calc(var(--cw) * 1.5 + 24px); }  .tc-tool { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .tc-deck.shuf .tcc.d, .tc-hc.came .tcsvg, .tc-hc.recv .tcsvg { animation: none !important; } }
