.cm { --text: #dfe9ff; --muted: #8aa3c4; --line: #1c2b4a; --panel: #0b1328; --accent: #55d6ff; --warm: #ffd166; --good: #2ec27e;
  --tw: 44px; --pw: 24px; --mw: 26px; --ow: 16px;
  position: relative; display: flex; flex-direction: column; margin: 0 auto; padding: 6px 4px 6px; color: var(--text); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden; outline: none; }
.cm [hidden] { display: none !important; }
.cm-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.cm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- tiles ---------- */
.cm-t { --w: var(--pw); position: relative; display: inline-block; flex: none; width: var(--w); height: calc(var(--w) * 1.34); border-radius: calc(var(--w) * 0.13); vertical-align: bottom;
  background: linear-gradient(150deg, #fffdf7 0%, #f7f0de 55%, #ece1c6 100%);
  box-shadow: inset 0 0 0 1px rgba(122, 98, 52, 0.3), 0 calc(var(--w) * 0.07) 0 #c9b98c, 0 calc(var(--w) * 0.11) 0 #1d5d47, 0 calc(var(--w) * 0.14) calc(var(--w) * 0.18) rgba(0, 0, 0, 0.45); }
.cm-t svg { position: absolute; inset: 5% 6% 5% 5%; width: 89%; height: 90%; display: block; pointer-events: none; }
.cm-back { background: linear-gradient(160deg, #2f9a76 0%, #1f7a5c 60%, #155c45 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 calc(var(--w) * 0.07) 0 #c9b98c, 0 calc(var(--w) * 0.12) calc(var(--w) * 0.16) rgba(0, 0, 0, 0.45); }
.cm-h { --w: var(--tw); }
.cm-p { --w: var(--pw); }
.cm-m { --w: var(--mw); }
.cm-o { --w: var(--ow); }
.cm-tx { --w: 22px; }
.cm-tx-big { --w: 30px; }
.cm-r { --w: clamp(18px, 6.2vw, 34px); }
.cm-claimed { transform: rotate(0); filter: brightness(0.92) sepia(0.25); }
.cm-last { outline: 2px solid var(--warm); outline-offset: 1px; animation: cm-pop .35s ease-out; }
@keyframes cm-pop { from { transform: translateY(-30%) scale(1.25); opacity: 0.3; } }

/* ---------- top bar ---------- */
.cm-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; margin: 0 0 6px; }
.cm-info { font-size: 13px; color: var(--muted); display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.cm-info b { color: #fff; font-size: 14px; }
.cm-tools { display: flex; gap: 6px; }
.cm-btn { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; min-height: 38px; padding: 0 12px; font: inherit; font-weight: 700; font-size: 13.5px; white-space: nowrap; cursor: pointer; touch-action: manipulation; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (hover: hover) { .cm-btn:hover:not(:disabled) { border-color: var(--accent); } }
.cm-btn:active:not(:disabled) { transform: translateY(1px); }
.cm-btn:disabled { opacity: 0.45; cursor: default; }
.cm-btn:focus-visible, .cm-ibtn:focus-visible, .cm-t:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-btn[aria-pressed="true"] { border-color: var(--accent); background: #0f2442; }
.cm-btn-primary { background: var(--warm); color: #1a1200; border-color: var(--warm); }
@media (hover: hover) { .cm-btn-primary:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; } }
.cm-btn-hu { background: linear-gradient(180deg, #ff7b5a, #e0452a); color: #fff; border-color: #ff8f73; font-size: 16px; padding: 0 18px; box-shadow: 0 0 0 3px rgba(255, 110, 80, 0.25); animation: cm-glow 1s ease-in-out infinite alternate; }
@keyframes cm-glow { to { box-shadow: 0 0 0 6px rgba(255, 110, 80, 0.1); } }
.cm-btn-claim { background: #10294a; border-color: #2b5a8f; }
.cm-mini { display: inline-flex; gap: 1px; }
.cm-mini .cm-t, .cm-msg .cm-t, .cm-btn .cm-t, .cm-sug .cm-t, .cm-opt-h .cm-t { box-shadow: inset 0 0 0 1px rgba(122, 98, 52, 0.3); }
.cm-ibtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: #c9d7ef; cursor: pointer; padding: 0; touch-action: manipulation; }
.cm-ibtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- the table ---------- */
.cm-table { flex: 1 1 auto; min-height: 0; display: grid; gap: 6px; padding: 6px; border-radius: 14px; position: relative;
  background: radial-gradient(120% 100% at 50% 45%, #145244 0%, #0c3a31 55%, #072620 100%); box-shadow: inset 0 0 0 1px #1d4a3f, inset 0 0 40px rgba(0, 0, 0, 0.35); }
.cm-opp, .cm-me { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 5px 6px; border-radius: 10px; background: rgba(4, 16, 13, 0.35); border: 1px solid transparent; transition: border-color .2s, background-color .2s; }
.cm-turn { border-color: rgba(255, 209, 102, 0.85) !important; background: rgba(255, 209, 102, 0.08) !important; }
.cm-won { border-color: #ff8f73 !important; }
.cm-pname { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.cm-nm { font-weight: 800; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-score { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--warm); font-weight: 800; }
.cm-wind { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.cm-wind b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #f4ecd6; color: #14223f; font-size: 14px; font-family: 'Noto Serif CJK SC', 'Songti SC', 'SimSun', serif; }
.cm-wind.cm-dealer b { background: var(--warm); color: #1a1200; box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.4); }
.cm-wind i { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warm); }
.cm-pmelds { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: flex-end; min-height: 0; }
.cm-meld, .cm-flowers { display: inline-flex; gap: 1px; }
.cm-flowers { margin-left: 2px; opacity: 0.95; }
.cm-backs { display: flex; flex-wrap: nowrap; gap: 1px; overflow: hidden; }
.cm-center { display: grid; gap: 6px; min-width: 0; min-height: 0; }
.cm-pool { min-width: 0; padding: 3px 4px 4px; border-radius: 8px; background: rgba(0, 0, 0, 0.16); border: 1px solid transparent; }
.cm-pool-h { font-size: 11px; color: #9fc6b8; font-weight: 700; margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-pool-t { display: grid; grid-template-columns: repeat(6, var(--pw)); gap: 2px 1px; grid-auto-rows: calc(var(--pw) * 1.34 + 2px); min-height: calc(var(--pw) * 1.34 * 4 + 6px); }
.cm-compass { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: #cfe7de; }
.cm-cmp-round b { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 2px; border-radius: 10px; background: #f4ecd6; color: #b8271f; font-size: 26px; font-family: 'Noto Serif CJK SC', 'Songti SC', 'SimSun', serif; box-shadow: 0 3px 0 #c9b98c; }
.cm-cmp-round span, .cm-cmp-wall span { display: block; font-size: 11px; color: #9fc6b8; }
.cm-cmp-wall b { font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }

/* ---------- your hand and the action bar ---------- */
.cm-hand { flex: none; display: flex; justify-content: center; align-items: flex-end; gap: 2px; padding: 8px 2px 4px; min-height: calc(var(--tw) * 1.34 + 14px); touch-action: none; }
.cm-hand .cm-t { cursor: default; transition: transform .12s ease; }
.cm-hand.cm-active .cm-t.cm-can { cursor: pointer; }
.cm-hand .cm-drawn { margin-left: calc(var(--tw) * 0.35); }
.cm-hand .cm-sel { transform: translateY(-22%); box-shadow: inset 0 0 0 2px #d18a00, 0 0 0 2px rgba(255, 209, 102, 0.9), 0 8px 14px rgba(0, 0, 0, 0.45); }
.cm-hand .cm-dragging { transition: none; z-index: 5; box-shadow: 0 0 0 2px var(--accent), 0 14px 24px rgba(0, 0, 0, 0.55); }
.cm-hand .cm-ready::after { content: ''; position: absolute; top: -7px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px rgba(46, 194, 126, 0.3); }
@media (hover: hover) { .cm-hand.cm-active .cm-can:not(.cm-sel):hover { transform: translateY(-8%); } }
.cm-bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px 10px; flex-wrap: wrap; min-height: 46px; padding: 4px 4px 2px; position: relative; text-align: center; }
.cm-msg { font-size: 13.5px; color: #cfe0ff; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.cm-claimmsg { color: #fff; }
.cm-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cm-timer { position: absolute; left: 10%; right: 10%; bottom: -2px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.cm-timer i { display: block; height: 100%; background: var(--warm); transform-origin: left; animation: cm-count linear forwards; }
@keyframes cm-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.cm-dots::after { content: '…'; animation: cm-blink 1s steps(2) infinite; }
@keyframes cm-blink { 50% { opacity: 0.2; } }

/* ---------- helper panel ---------- */
.cm-helper { position: absolute; z-index: 30; right: 8px; top: 48px; width: min(330px, calc(100% - 16px)); max-height: calc(100% - 120px); overflow: auto; overscroll-behavior: contain; background: rgba(9, 18, 38, 0.97); border: 1px solid #2b4a74; border-radius: 14px; padding: 12px 12px 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); font-size: 13px; color: var(--text); user-select: text; }
.cm-helper h4 { margin: 0 0 6px; font-size: 15px; color: #fff; }
.cm-helper p { margin: 6px 0; line-height: 1.45; }
.cm-good { color: #8ff0bf; }
.cm-small { font-size: 12px; color: var(--muted); }
.cm-sug { color: var(--warm); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cm-opt { border-top: 1px solid var(--line); padding: 6px 0 2px; }
.cm-opt-h { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #fff; }
.cm-waits { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 3px; }
.cm-waits li { display: flex; align-items: center; gap: 8px; }
.cm-waits li span { flex: 1 1 auto; } .cm-waits li .cm-t { flex: none; } .cm-waits small { color: var(--muted); }
.cm-waits li.cm-ok b { color: #8ff0bf; } .cm-waits li.cm-no b { color: #ff9c8a; font-weight: 600; font-size: 12px; }
.cm-fanlist { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 2px; }
.cm-fanlist li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(138, 163, 196, 0.25); padding: 1px 0; }
.cm-helper-x { width: 100%; margin-top: 8px; min-height: 34px; }

/* ---------- toasts ---------- */
.cm-toasts { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.cm-toast { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 26px; color: #fff; padding: 6px 16px; border-radius: 12px; background: rgba(200, 50, 30, 0.92); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: cm-toast 1.3s ease forwards; letter-spacing: 0.02em; }
.cm-toast-small { font-size: 15px; background: rgba(208, 87, 122, 0.92); }
.cm-toast-hu { font-size: 44px; background: linear-gradient(180deg, #ff7b5a, #c9301a); animation-duration: 2.2s; }
.cm-toast-0 { left: 50%; top: 72%; } .cm-toast-1 { left: 82%; top: 42%; } .cm-toast-2 { left: 50%; top: 18%; } .cm-toast-3 { left: 18%; top: 42%; } .cm-toast--1 { left: 50%; top: 45%; }
@keyframes cm-toast { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 12%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }

/* ---------- sheets ---------- */
.cm-scrim { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 4, 10, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cm-sheet { position: relative; width: 100%; max-width: 460px; max-height: min(90vh, 760px); max-height: min(90dvh, 760px); overflow: auto; overscroll-behavior: contain; background: #0d1630; border: 1px solid #22345a; border-radius: 18px; padding: 20px 18px 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); color: var(--text); animation: cm-sheet .24s cubic-bezier(.2, .8, .2, 1); user-select: text; }
.cm-sheet.cm-wide { max-width: 640px; }
.cm-sheet:focus { outline: none; }
@keyframes cm-sheet { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.cm-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); color: #c9d7ef; font-size: 22px; line-height: 1; cursor: pointer; }
.cm-sheet-title { margin: 0 44px 6px 0; font-size: 21px; font-weight: 800; color: #fff; }
.cm-sub { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cm-fine { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.cm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* the main buttons stay in view while a long sheet scrolls (short landscape screens) */
.cm-sheet .cm-actions { position: sticky; bottom: -16px; z-index: 2; margin: 14px -18px -16px; padding: 12px 18px 16px; background: linear-gradient(rgba(13, 22, 48, 0), #0d1630 22%); }
.cm-actions .cm-btn { flex: 1 1 auto; min-height: 44px; }
.cm-actions .cm-btn-primary { flex-basis: 100%; }
.cm-menu { display: grid; gap: 8px; margin-top: 10px; } .cm-menu .cm-btn { min-height: 46px; font-size: 15px; }
.cm-tbl { width: 100%; border-collapse: collapse; margin: 10px 0 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cm-tbl th, .cm-tbl td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.cm-tbl th:first-child, .cm-tbl td:first-child { text-align: left; }
.cm-tbl thead th { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.cm-tbl tfoot th, .cm-tbl tfoot td { color: #fff; font-weight: 800; border-bottom: 0; }
.cm-tbl tr.cm-hi th, .cm-tbl tr.cm-hi td { color: var(--warm); }
.cm-fantbl th { font-weight: 600; color: var(--text); }
.cm-stand { font-size: 12.5px; } .cm-stand th, .cm-stand td { padding: 5px 4px; }
.cm-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.cm-rhand { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin: 8px 0 4px; }
.cm-wintile .cm-t { box-shadow: 0 0 0 2px #ff8f73, 0 0 12px rgba(255, 143, 115, 0.6); }
.cm-others summary { cursor: pointer; color: var(--accent); font-weight: 700; margin: 12px 0 4px; }
.cm-oh { margin: 8px 0; } .cm-oh b { font-size: 13px; }
.cm-res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; text-align: center; }
.cm-res div { display: flex; flex-direction: column; gap: 2px; background: #0a1226; border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; }
.cm-res b { font-size: 21px; color: #fff; } .cm-res span { font-size: 11.5px; color: var(--muted); }
.cm-search { width: 100%; box-sizing: border-box; background: #0a1226; color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; margin: 4px 0 6px; }
.cm-fanref h4 { margin: 14px 0 6px; font-size: 13px; color: var(--warm); text-transform: uppercase; letter-spacing: 0.06em; }
.cm-fanref ul { list-style: none; margin: 0; padding: 0; }
.cm-fanref li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.cm-fan-h { display: flex; align-items: baseline; gap: 8px; } .cm-fan-h b { color: #fff; } .cm-fan-h [lang] { color: var(--muted); font-size: 13px; }
.cm-fan-no { color: var(--muted); font-size: 11px; min-width: 18px; } .cm-fan-pts { margin-left: auto; font-weight: 800; color: var(--warm); }
.cm-fanref p { margin: 2px 0 0 26px; font-size: 13px; color: #c6d4ea; line-height: 1.45; } .cm-fanref small { color: var(--muted); }
.cm-list { margin: 10px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.5; } .cm-list li { margin: 0 0 8px; }
.cm-fs { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0 0; padding: 6px 10px 8px; }
.cm-fs legend { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 4px; }
.cm-radio { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; cursor: pointer; }
.cm-radio input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--warm); }
.cm-radio span, .cm-set span { display: flex; flex-direction: column; gap: 2px; } .cm-radio small, .cm-set small { color: var(--muted); font-size: 12.5px; }
.cm-set { display: flex; align-items: center; gap: 14px; padding: 12px 2px 4px; cursor: pointer; }
.cm-set span { flex: 1 1 auto; }
.cm-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cm-set i { flex: none; width: 46px; height: 28px; border-radius: 14px; background: #2b3448; position: relative; transition: background-color .15s; }
.cm-set i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.cm-set input:checked + i { background: var(--good); } .cm-set input:checked + i::after { left: 21px; }
.cm-set input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) {
  .cm-scrim { align-items: flex-end; padding: 0; }
  .cm-sheet, .cm-sheet.cm-wide { max-width: none; border-radius: 20px 20px 0 0; border-bottom: 0; padding: 18px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .cm-sheet .cm-actions { margin: 14px -14px calc(-14px - env(safe-area-inset-bottom, 0px)); padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); bottom: calc(-14px - env(safe-area-inset-bottom, 0px)); }
}

/* ---------- layouts ---------- */
/* wide: opponents around the table (left, opposite, right), the four discard pools in a 2 x 2 grid between them */
.cm-wide .cm-table { grid-template-columns: minmax(120px, 0.7fr) minmax(0, 3fr) minmax(120px, 0.7fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "left top right" "left center right" "me me me"; }
.cm-wide #cm-opp-3 { grid-area: left; } .cm-wide #cm-opp-2 { grid-area: top; } .cm-wide #cm-opp-1 { grid-area: right; } .cm-wide .cm-center { grid-area: center; } .cm-wide .cm-me { grid-area: me; }
.cm-wide #cm-opp-2 { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.cm-wide #cm-opp-2 .cm-pname { flex: 1 1 100%; }
.cm-wide #cm-opp-3 .cm-backs, .cm-wide #cm-opp-1 .cm-backs { flex-wrap: wrap; }
.cm-wide .cm-me { flex-direction: row; align-items: center; gap: 12px; }
.cm-wide .cm-me .cm-pname { flex: none; }
.cm-center { grid-template-columns: repeat(2, auto); grid-template-areas: "p3 p2" "p0 p1"; justify-content: center; align-content: center; }
#cm-pool-3 { grid-area: p3; } #cm-pool-2 { grid-area: p2; } #cm-pool-0 { grid-area: p0; } #cm-pool-1 { grid-area: p1; }
.cm-compass { display: none; }
/* phones upright: the three opponents across the top, the pools in a 2 x 2 grid (left, opposite / you, right) */
.cm-port .cm-top { margin-bottom: 4px; }
.cm-port .cm-info { font-size: 12px; } .cm-port .cm-btn { padding: 0 9px; font-size: 12.5px; }
.cm-port .cm-table { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "left top right" "center center center" "me me me"; gap: 5px; padding: 5px; }
.cm-port #cm-opp-3 { grid-area: left; } .cm-port #cm-opp-2 { grid-area: top; } .cm-port #cm-opp-1 { grid-area: right; } .cm-port .cm-center { grid-area: center; } .cm-port .cm-me { grid-area: me; }
.cm-port .cm-opp, .cm-land .cm-opp { padding: 4px 5px; }
.cm-port .cm-backs, .cm-land .cm-backs { display: none; }
/* the tile backs are hidden on small screens, so show how many tiles each opponent holds */
.cm-cnt { display: none; }
.cm-port .cm-cnt, .cm-land .cm-cnt { display: inline-block; flex: none; min-width: 16px; padding: 0 3px; border-radius: 4px; background: #2f7a5f; color: #e8fff4; font-size: 10px; font-weight: 800; line-height: 15px; text-align: center; font-variant-numeric: tabular-nums; }
.cm-port .cm-pname, .cm-land .cm-pname { font-size: 12px; gap: 4px; }
.cm-port .cm-wind b, .cm-land .cm-wind b { width: 19px; height: 19px; font-size: 12px; }
.cm-port .cm-wind i, .cm-land .cm-wind i { display: none; }
.cm-port .cm-me { flex-direction: row; align-items: center; gap: 8px; }
.cm-port .cm-me .cm-pname { flex: none; }
.cm-port .cm-bar .cm-msg { font-size: 12.5px; }
/* phones sideways: opponents stacked on the left, pools in the middle, you on the right; hand and actions below */
.cm-land { padding: 4px 4px 2px; }
.cm-land .cm-top { margin: 0 0 3px; } .cm-land .cm-info { font-size: 12px; } .cm-land .cm-btn { min-height: 32px; padding: 0 9px; font-size: 12.5px; } .cm-land .cm-ibtn { width: 32px; height: 32px; }
.cm-land .cm-table { grid-template-columns: minmax(120px, 0.9fr) auto minmax(120px, 0.9fr); grid-template-rows: repeat(3, minmax(0, auto)); grid-template-areas: "top center me" "left center me" "right center me"; gap: 4px; padding: 4px; align-content: center; }
.cm-land #cm-opp-3 { grid-area: left; } .cm-land #cm-opp-2 { grid-area: top; } .cm-land #cm-opp-1 { grid-area: right; } .cm-land .cm-center { grid-area: center; gap: 4px; } .cm-land .cm-me { grid-area: me; align-self: stretch; }
.cm-land .cm-pool-t { min-height: calc(var(--pw) * 1.34 * 3 + 4px); }
.cm-land .cm-hand { padding: 6px 2px 2px; min-height: calc(var(--tw) * 1.34 + 8px); }
.cm-land .cm-bar { min-height: 38px; padding: 2px; }
.cm-land .cm-bar .cm-btn { min-height: 34px; }
.cm-land .cm-helper { top: 40px; max-height: calc(100% - 60px); }
/* full screen (set by game.js inside the site's immersive stage) */
.cm.cm-fit { max-width: none; margin: 0; height: 100%; padding-left: max(4px, env(safe-area-inset-left, 0px)); padding-right: max(4px, env(safe-area-inset-right, 0px)); padding-bottom: max(4px, env(safe-area-inset-bottom, 0px)); }
@media (pointer: coarse) { .cm-btn { min-height: 40px; } .cm-land .cm-btn { min-height: 36px; } }
@media (prefers-reduced-motion: reduce) { .cm *, .cm-scrim, .cm-sheet { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
@media (max-height: 500px) and (orientation: landscape) { .cm-actions .cm-btn-primary { flex: 2 1 auto; } .cm-sheet .cm-actions { padding-top: 8px; } .cm-sheet { max-height: 94vh; max-height: 94dvh; } }
/* online tables (tables.js): the strip sits between the top bar and the table */
.cm .tb-strip { flex: none; margin: 0 0 6px; padding: 5px 8px; font-size: 12.5px; }
.cm-land .tb-strip { margin: 0 0 3px; padding: 3px 6px; font-size: 12px; } .cm-land .tb-strip .ol-btn { padding: 4px 8px; }
.cm-tag { flex: none; font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #9fc6b8; border: 1px solid rgba(159, 198, 184, 0.45); border-radius: 4px; padding: 0 3px; line-height: 14px; }
.cm-tag-away { color: var(--warm); border-color: rgba(255, 209, 102, 0.5); }
.cm-waittxt { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.cm-waitline { flex-basis: 100%; margin: 0; text-align: center; }
.cm-wide #cm-opp-1 .cm-wind i, .cm-wide #cm-opp-3 .cm-wind i { display: none; }   /* side cards: the gold badge marks the dealer */
