/* colours come from /games/assets/theme.css (dark "Calm Navy" / light "Polar"); the old names point to the tokens */
:root { --bg:var(--page,#0F1A2E); --bg2:var(--page2,#18243D); --surface:var(--panel,#22304D); --surface2:var(--line,#2C3C5E); --muted:var(--dim,#9AA6BC); --yellow:var(--pri-bg,#FFD43B); --blue:#3B8CFF; --orange:var(--warn,#FF9E1B); --outline:var(--pri-ink,#0A1220); --font: Manrope, "Noto Sans Armenian", system-ui, sans-serif; --cw: min(76px, calc((min(100vw, 520px) - 24px) / 4.9)); --ov:.45; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; height:100%; background:var(--page2,#0A1220); color:var(--ink); overscroll-behavior:none; }
body { font-family:var(--font); font-weight:500; display:flex; justify-content:center; }
button, input { font:inherit; color:inherit; }
.app { position:relative; width:min(100vw, 520px); height:100vh; height:100dvh; background:linear-gradient(180deg,var(--bg),var(--bg2)); display:flex; flex-direction:column; padding:max(8px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); gap:8px; overflow:hidden; }
.top { display:flex; align-items:center; gap:8px; flex:none; }
.grow { flex:1; }
.pill { background:var(--surface); color:var(--ink); border:0; border-radius:999px; padding:12px 14px; font-size:16px; font-weight:700; line-height:1; text-decoration:none; cursor:pointer; }
.round { background:var(--surface); color:var(--ink); border:0; border-radius:50%; width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; padding:0; cursor:pointer; position:relative; flex:none; }
.round.sm { width:40px; height:40px; }
.round svg { width:22px; height:22px; }
.round .slash { display:none; } .round.off { color:var(--muted); } .round.off .slash { display:block; }
.net { background:var(--orange); color:var(--outline); font-weight:800; text-align:center; border-radius:10px; padding:6px; font-size:15px; flex:none; }
.toast { position:absolute; left:50%; top:60px; transform:translateX(-50%); background:var(--ink); color:var(--outline); font-weight:700; padding:10px 16px; border-radius:12px; z-index:20; max-width:90%; text-align:center; box-shadow:0 8px 24px rgba(0,0,0,.4); }
[hidden] { display:none !important; }
main { flex:1; min-height:0; display:flex; flex-direction:column; }
.view { flex:1; min-height:0; overflow:auto; display:flex; flex-direction:column; gap:12px; padding-bottom:6px; }
.card { background:var(--surface); border-radius:16px; padding:18px 16px; display:flex; flex-direction:column; gap:12px; box-shadow:0 8px 24px rgba(0,0,0,.25); }
.card h1 { margin:0; font-size:38px; font-weight:800; color:var(--ink); line-height:1.1; }
.card h2 { margin:0; font-size:26px; font-weight:800; color:var(--ink); }
.card p { margin:0; line-height:1.5; font-size:16px; }
.muted { color:var(--muted); } .small { font-size:14px !important; }
.stack { display:flex; flex-direction:column; gap:10px; }
.row2 { display:flex; gap:10px; } .row2 .btn { flex:1; }
.btn { background:var(--yellow); color:var(--outline); border:0; border-radius:14px; padding:12px 18px; min-height:52px; font-size:18px; font-weight:800; cursor:pointer; box-shadow:0 6px 16px rgba(0,0,0,.3); transition:transform .1s; }
.btn.alt { background:var(--surface2); color:var(--ink); font-weight:700; font-size:16px; box-shadow:none; }
.btn:active { transform:scale(.97); }
.btn:disabled { opacity:.4; cursor:default; transform:none; }
.btn:focus-visible, .pill:focus-visible, .round:focus-visible, .hcard:focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
.join { display:flex; gap:8px; } .join input { flex:1; min-width:0; }
input { background:var(--bg); border:2px solid var(--surface2); border-radius:12px; padding:10px 12px; font-size:17px; min-height:48px; }
input:focus { outline:none; border-color:var(--blue); }
input:focus-visible { outline:3px solid var(--blue); outline-offset:1px; }
.seg button:focus-visible, .linkbtn:focus-visible, .tip:focus-visible, .chip:focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
.overlay { overscroll-behavior:contain; }
.target-row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:700; }
.seg { display:flex; background:var(--bg); border-radius:12px; padding:3px; }
.seg button { background:none; border:0; border-radius:10px; padding:10px 14px; font-weight:800; cursor:pointer; color:var(--muted); min-height:44px; }
.seg button.on { background:var(--sel-bg,#FFD43B); color:var(--sel-ink,#0A1220); }
.who { font-weight:800; font-size:18px; }
.linkbox { display:flex; gap:8px; } .linkbox input { flex:1; min-width:0; font-size:14px; }
.seatlist { display:flex; flex-direction:column; gap:8px; }
.seatrow { display:flex; align-items:center; justify-content:space-between; gap:8px; background:var(--bg); border-radius:12px; padding:10px 12px; font-weight:700; }
.seatrow .btn { min-height:40px; padding:6px 14px; font-size:15px; }
.tag { display:inline-block; background:var(--bg); border-radius:999px; padding:3px 10px; font-size:13px; font-weight:800; }
.tag.us { border:2px solid var(--yellow); color:var(--accent-text,#FFD43B); } .tag.them { border:2px dashed var(--ink); }

/* table */
.table-view { gap:6px; overflow:hidden; padding-bottom:0; }
.infobar { display:flex; gap:6px; align-items:center; flex:none; flex-wrap:nowrap; }
.chip { background:var(--surface); border-radius:999px; padding:6px 10px; font-weight:800; font-size:14px; white-space:nowrap; line-height:1.1; min-width:0; }
.infobar { flex-wrap:wrap; }
.chip.trump { font-size:16px; } .chip .big { font-size:22px; vertical-align:-2px; }
.chip.score { flex:1; text-align:center; font-size:14px; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.chip.score b { color:var(--accent-text,#FFD43B); }
#chatDot { position:absolute; top:6px; right:6px; width:10px; height:10px; border-radius:2px; background:var(--yellow); transform:rotate(45deg); }
.board { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; grid-template-areas:". top ." "left mid right" ". bot ."; gap:4px; align-items:center; }
.seat.s2 { grid-area:top; } .seat.s1 { grid-area:left; } .seat.s3 { grid-area:right; } .centre { grid-area:mid; } .seat.s0 { grid-area:bot; }
.seat { background:var(--surface); border-radius:14px; padding:6px 8px; text-align:center; min-width:0; border:3px solid transparent; position:relative; }
.seat.turn { border-color:var(--accent-text,#FFD43B); background:var(--surface2); }
.seat .nm { font-weight:800; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.seat .tm { font-size:12px; color:var(--muted); font-weight:700; }
.seat .turntxt { display:none; font-weight:800; font-size:13px; color:var(--accent-text,#FFD43B); }
.seat.turn .turntxt { display:block; }
.seat .bub { margin-top:3px; display:inline-block; background:var(--bg); border-radius:999px; padding:2px 9px; font-weight:800; font-size:14px; min-height:22px; }
.seat .cnt { font-size:12px; color:var(--muted); font-weight:700; }
.seat .dealer { font-size:11px; font-weight:800; color:var(--outline); background:var(--ink); border-radius:6px; padding:1px 5px; margin-left:4px; }
.seat.s0 { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; padding:4px 8px; }
.seat.s0 .nm { max-width:40%; }
.centre { position:relative; height:100%; min-height:130px; display:flex; align-items:center; justify-content:center; }
.trick { position:relative; width:100%; height:100%; max-height:200px; }
.trick .tc { position:absolute; width:calc(var(--cw) * .72); }
.trick .tc.p0 { left:50%; bottom:0; transform:translateX(-50%); }
.trick .tc.p2 { left:50%; top:0; transform:translateX(-50%); }
.trick .tc.p1 { left:2%; top:50%; transform:translateY(-50%); }
.trick .tc.p3 { right:2%; top:50%; transform:translateY(-50%); }
.trick .empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; color:var(--muted); font-weight:700; padding:6px; font-size:14px; }
.lastbtn { position:absolute; right:0; bottom:0; font-size:12px; padding:5px 8px; min-height:0; border-radius:8px; }
.msgline { flex:none; text-align:center; font-weight:800; font-size:16px; min-height:24px; color:var(--accent-text,#FFD43B); }
.msgline.wait { color:var(--muted); }

/* cards */
.pc { display:block; width:100%; aspect-ratio:5/7; }
.pc rect.f { fill:#fff; stroke:#0A1220; stroke-width:2; }
.pc text { font-family:var(--font); font-weight:800; }
.pc .k { fill:#111; } .pc .u { fill:#D0021B; }
.hand { flex:none; display:flex; justify-content:center; align-items:flex-end; height:calc(var(--cw) * 1.4 + 40px); padding:26px 0 10px; }
.hcard { width:var(--cw); margin-left:calc(var(--cw) * var(--ov) * -1); padding:0; border:0; background:none; cursor:pointer; transition:transform .15s, opacity .15s; flex:none; position:relative; }
.hcard:first-child { margin-left:0; }
.hcard.legal { transform:translateY(-8px); }
.hcard.illegal { transform:translateY(6px); filter:grayscale(1) brightness(.7); cursor:not-allowed; }
.hcard.sel { transform:translateY(-22px); z-index:5; }
.hcard.sel::after { content:attr(data-play); position:absolute; left:50%; top:-24px; transform:translateX(-50%); background:var(--yellow); color:var(--outline); font-size:12px; font-weight:800; border-radius:8px; padding:2px 8px; white-space:nowrap; }
.hcard.plain { opacity:1; }

/* bidding */
.bidpanel { flex:none; background:var(--surface); border-radius:14px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.nums, .strains, .acts { display:flex; gap:5px; flex-wrap:wrap; justify-content:center; }
.bidpanel button { background:var(--bg); border:2px solid var(--surface2); border-radius:10px; font-weight:800; font-size:16px; min-width:40px; min-height:42px; padding:4px 8px; cursor:pointer; }
.bidpanel .nums button { flex:1 0 11%; padding:4px 0; }
.bidpanel .strains button { flex:1 0 17%; line-height:1.1; font-size:20px; }
.bidpanel .strains button small { display:block; font-size:11px; font-weight:700; color:var(--muted); }
.bidpanel button.on { background:var(--sel-bg,#FFD43B); color:var(--sel-ink,#0A1220); border-color:var(--sel-bg,#FFD43B); }
.bidpanel button.on small { color:var(--outline); }
.bidpanel button:disabled { opacity:.3; text-decoration:line-through; cursor:default; }
.bidpanel .acts button { flex:1; font-size:15px; }
.bidpanel .acts button.go { background:var(--yellow); color:var(--outline); border-color:var(--accent-text,#FFD43B); }
.bidpanel .hist { font-size:13px; color:var(--muted); font-weight:700; text-align:center; }

/* drawer, overlay */
.drawer { position:absolute; inset:auto 0 0 0; height:70%; background:var(--bg2); border-radius:18px 18px 0 0; box-shadow:0 -10px 40px rgba(0,0,0,.5); z-index:10; display:flex; flex-direction:column; padding:10px 12px max(10px, env(safe-area-inset-bottom)); gap:8px; }
.drawer-head { display:flex; justify-content:space-between; align-items:center; font-size:18px; }
.msgs { flex:1; overflow:auto; display:flex; flex-direction:column; gap:6px; }
.msg { background:var(--surface); border-radius:12px; padding:6px 10px; font-size:15px; word-break:break-word; }
.msg b { color:var(--accent-text,#FFD43B); } .msg .acts { display:inline-flex; gap:6px; margin-left:6px; }
.msg .acts button { background:none; border:0; color:var(--muted); font-size:12px; text-decoration:underline; cursor:pointer; padding:2px; }
.msg.me { background:var(--surface2); }
.quick { display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; flex:none; }
.quick button { flex:none; background:var(--surface); border:0; border-radius:999px; padding:9px 13px; font-weight:700; font-size:14px; cursor:pointer; white-space:nowrap; }
.send { display:flex; gap:8px; } .send input { flex:1; min-width:0; } .send .btn { min-height:48px; padding:8px 16px; font-size:16px; }
.overlay { position:absolute; inset:0; z-index:15; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(10,18,32,.9); overflow:auto; }
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) { .overlay { background:rgba(10,18,32,.6); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); } }
.overlay .card { width:100%; max-width:360px; background:rgba(34,48,77,.95); box-shadow:0 16px 48px rgba(0,0,0,.45); text-align:center; align-items:stretch; }
.overlay .rows { text-align:left; }
.rows div { display:flex; justify-content:space-between; gap:8px; padding:6px 0; border-bottom:1px solid rgba(154,166,188,.25); }
.rows b { color:var(--accent-text,#FFD43B); font-weight:800; }
.bigno { font-size:44px; font-weight:800; color:var(--accent-text,#FFD43B); line-height:1; }
.rules h3 { margin:10px 0 2px; font-size:18px; color:var(--ink); }
.rules ul { margin:0; padding-left:20px; line-height:1.5; }
.rules p, .rules li { font-size:15px; }
.stat-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; text-align:center; }
.stat-grid div { background:var(--bg); border-radius:12px; padding:10px 4px; } .stat-grid b { display:block; font-size:24px; color:var(--accent-text,#FFD43B); } .stat-grid span { font-size:12px; color:var(--muted); font-weight:700; }
.gl div { display:flex; justify-content:space-between; gap:8px; padding:6px 0; border-bottom:1px solid rgba(154,166,188,.25); font-size:14px; }
.gl .res { font-weight:800; }
@media (max-height:640px) { :root { --cw: min(54px, 15vw); } .seat { padding:3px 6px; } .centre { min-height:100px; } }

@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }

.chipline { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:20px; }
.chipline .btn { min-height:44px; padding:6px 14px; font-size:15px; }
.chip.pot { color:var(--accent-text,#FFD43B); }

.seat.s1 .tm, .seat.s3 .tm { font-size:11px; } .seat.s1, .seat.s3 { padding:4px 4px; }
.bidpanel { max-height:42dvh; overflow:auto; }
.chip.score { flex:1 1 100%; order:5; white-space:normal; }
.bidpanel .nums button { flex:1 1 0; min-width:0; }
.centre .empty { font-size:13px; }

/* language switch: three buttons, current one is filled and underlined (not colour only) */
.langsw { display:inline-flex; background:var(--surface); border-radius:999px; padding:3px; gap:2px; }
.langsw button { background:transparent; border:0; border-radius:999px; padding:9px 10px; font-size:14px; font-weight:700; line-height:1; color:var(--ink); cursor:pointer; min-height:40px; }
.langsw button.on { background:var(--sel-bg,#FFD43B); color:var(--sel-ink,#0A1220); text-decoration:underline; text-underline-offset:3px; }
.langsw button:focus-visible { outline:3px solid var(--blue); outline-offset:2px; }

/* suit symbols in the UI: classic colours on a white chip (readable on dark, shape always visible) */
.su { display:inline-block; background:#fff; border-radius:6px; padding:0 .22em; line-height:1.2; font-weight:800; }
.suH, .suD { color:#D0021B; } .suS, .suC { color:#111; }
.chip .big .su { padding:0 .15em; }
.bidpanel .strains button .su { font-size:22px; }
.bidpanel button.on .su { outline:2px solid var(--outline); }

/* phone: compact top bar, bottom-sheet bidding, full-screen chat */
@media (max-width:699px) {
  .chip { padding:5px 8px; font-size:13px; } .chip.trump { font-size:14px; }
  .bidpanel { margin:0 -12px; border-radius:18px 18px 0 0; padding:10px 12px 8px; box-shadow:0 -8px 24px rgba(0,0,0,.4); }
  .drawer { inset:0; height:auto; border-radius:0; padding-top:max(10px, env(safe-area-inset-top)); }
  .hand { height:calc(var(--cw) * 1.4 + 40px); }
}

/* tablet and medium widths: one column, a bit wider, cards overlap less, chat stays a drawer */
@media (min-width:700px) {
  :root { --cw:84px; --ov:.15; }
  .app { width:min(100vw, 720px); }
  .drawer { inset:auto 0 0 0; height:60%; }
}

/* desktop: a real card table, chat as a permanent sidebar */
@media (min-width:1000px) {
  :root { --cw:84px; --ov:-.1; }
  .app { width:min(100vw, 1360px); padding-left:20px; padding-right:20px; }
  .app.in-table main { margin-right:332px; }
  #chat { display:none; }
  .app.in-table #chat, .app.in-table #chat[hidden] { display:flex !important; position:absolute; inset:auto; top:72px; right:20px; bottom:max(10px, env(safe-area-inset-bottom)); width:320px; height:auto; border-radius:16px; background:var(--surface); box-shadow:none; z-index:2; }
  #chat .drawer-head .round, #chatBtn { display:none; }
  .msg { background:var(--bg2); } .msg.me { background:var(--surface2); }
  .table-view { position:relative; display:grid; overflow:hidden; gap:10px 16px; grid-template-columns:220px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto auto; grid-template-areas:"info board" "info msg" "info hand"; }
  .infobar { grid-area:info; flex-direction:column; align-items:stretch; align-self:start; flex-wrap:nowrap; background:var(--surface); border-radius:16px; padding:14px; gap:10px; }
  .infobar .chip { background:var(--bg2); border-radius:12px; padding:9px 12px; font-size:15px; white-space:normal; }
  .infobar .chip.trump { font-size:18px; } .infobar .chip.score { order:0; flex:none; text-align:left; font-size:16px; }
  .infobar #menuBtn { align-self:flex-start; }
  .board { grid-area:board; grid-template-columns:minmax(140px,200px) minmax(0,1fr) minmax(140px,200px); gap:8px; padding:18px 26px; border-radius:110px; background:radial-gradient(ellipse at center,#1F3256 0%,#16243F 70%); border:2px solid var(--surface2); box-shadow:inset 0 0 70px rgba(0,0,0,.4); }
  .seat { background:var(--surface); padding:10px 12px; } .seat .nm { font-size:16px; } .seat .tm, .seat.s1 .tm, .seat.s3 .tm { font-size:13px; } .seat .turntxt { font-size:14px; } .seat .bub { font-size:16px; }
  .seat.s1, .seat.s3 { padding:10px 8px; } .seat.s0 .nm { max-width:none; }
  .centre { min-height:200px; } .trick { max-height:300px; } .trick .tc { width:84px; }
  .msgline { grid-area:msg; font-size:18px; }
  .hand { grid-area:hand; height:auto; min-height:calc(var(--cw) * 1.4 + 30px); padding:22px 0 8px; gap:8px; }
  .hcard { flex:0 1 var(--cw); min-width:0; margin-left:0; }
  .hcard.legal { transform:none; } .hcard.illegal { transform:none; }
  .hcard.sel { transform:translateY(-12px); } .hcard.sel::after { display:none; }
  .bidpanel { position:absolute; z-index:6; left:calc(236px + (100% - 236px) / 2); top:42%; transform:translate(-50%,-50%); width:min(500px, 64%); max-height:none; padding:14px; border-radius:18px; box-shadow:0 18px 50px rgba(0,0,0,.55); border:2px solid var(--surface2); gap:10px; }
  .bidpanel .hist { font-size:14px; }
  .lastbtn { right:6px; bottom:6px; font-size:13px; }
}
@media (min-width:1000px) and (hover:hover) and (pointer:fine) {
  .hcard.legal:hover { transform:translateY(-16px); z-index:3; box-shadow:0 10px 18px rgba(0,0,0,.4); border-radius:9px; }
  .hcard.illegal { cursor:not-allowed; }
  .bidpanel button:not(:disabled):hover { border-color:var(--accent-text,#FFD43B); }
}
@media (hover:hover) and (pointer:fine) { .hcard.legal { cursor:pointer; } }
@media (min-width:1000px) and (max-height:760px) { :root { --cw:64px; } .centre { min-height:140px; } .board { padding:12px 22px; } }

/* "game in progress" banner at the top of the lobby */
.resume { border:3px solid var(--yellow); }
.resume p { font-weight:800; font-size:18px; }
.resume .btn { min-height:60px; font-size:20px; }

/* ---- touch and iOS basics ---- */
html { -webkit-text-size-adjust:100%; }
button, .pill, .round, .hcard, .chip, .seg button { touch-action:manipulation; -webkit-user-select:none; user-select:none; }
input { font-size:16px; }
body { overscroll-behavior:none; }
.app { padding-left:max(12px, env(safe-area-inset-left)); padding-right:max(12px, env(safe-area-inset-right)); }
.top { min-height:44px; }

/* trick display, winner ring, announcement */
.trick .tc svg { border-radius:9px; }
.trick .tc.win svg { outline:4px solid var(--yellow); outline-offset:1px; }
.trick.show .tc.win::after { content:"\2605"; position:absolute; right:-6px; top:-8px; background:var(--yellow); color:var(--outline); border-radius:50%; width:20px; height:20px; font-size:13px; line-height:20px; text-align:center; font-weight:800; }
.trick .tc { z-index:1; } .trick .tc.win { z-index:2; }
.msgline.won { background:var(--yellow); color:var(--outline); border-radius:10px; padding:2px 8px; }
.announce { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); z-index:4; background:var(--yellow); color:var(--outline); font-weight:800; font-size:16px; line-height:1.3; text-align:center; padding:8px 14px; border-radius:14px; box-shadow:0 8px 24px rgba(0,0,0,.45); max-width:96%; border:3px solid var(--outline); }
.announce .su { border:1px solid #888; }
.stags { display:flex; flex-wrap:wrap; justify-content:center; gap:3px; margin-top:2px; }
.ctag, .ptag { font-size:11px; font-weight:800; border-radius:8px; padding:1px 6px; line-height:1.3; }
.ctag { background:var(--yellow); color:var(--outline); border:2px solid var(--outline); }
.ptag { background:transparent; color:var(--ink); border:2px dashed var(--ink); }

/* last trick panel: phone = popover under the top bar, desktop = permanent in the left column */
.lastchip { border:0; color:var(--ink); cursor:pointer; min-height:36px; }
.infobar { position:relative; }
.lastpanel { display:none; background:var(--surface); border-radius:14px; padding:10px; }
.lastpanel.open { display:block; position:absolute; left:0; right:0; top:calc(100% + 4px); z-index:9; box-shadow:0 12px 36px rgba(0,0,0,.6); border:2px solid var(--surface2); }
.lp-h { font-weight:800; color:var(--ink); margin-bottom:6px; }
.lp-cards { display:flex; gap:6px; justify-content:center; }
.lc { flex:1 1 0; min-width:0; max-width:70px; text-align:center; position:relative; }
.lc svg { border-radius:6px; } .lc.win svg { outline:3px solid var(--yellow); outline-offset:1px; }
.lc .ln { font-size:11px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; }
.lc .lw { font-size:11px; font-weight:800; color:var(--accent-text,#FFD43B); }
.lp-pts { font-size:13px; font-weight:700; margin-top:6px; text-align:center; } .lp-pts b { color:var(--accent-text,#FFD43B); }
@media (min-width:1000px) {
  .lastpanel, .lastpanel.open { display:block; position:static; box-shadow:none; border:0; background:var(--bg2); padding:10px; z-index:auto; }
  .lastchip { display:none; }
  .lp-cards { gap:4px; } .lc { max-width:48px; } .lc .ln { font-size:10px; }
}

/* ---- phones: small screens (360x640 and up) ---- */
@media (max-width:699px) {
  .infobar { gap:4px; }
  .infobar .chip.score { order:5; flex:1 1 100%; font-size:13px; padding:4px 8px; }
  .chip { max-width:100%; white-space:normal; }
  #iContract { flex:1 1 auto; font-size:13px; }
  .seat { padding:4px 4px; } .seat .nm { font-size:12px; }
  .bidpanel { padding:8px 12px calc(6px + env(safe-area-inset-bottom)); gap:5px; max-height:none; overflow:visible; }
  .bidpanel button { min-height:44px; }
  .bidpanel .nums { flex-wrap:nowrap; } .bidpanel .nums button { min-width:0; padding:0; flex:1 1 0; font-size:15px; }
  .bidpanel .strains button { min-height:46px; } .bidpanel .strains button small { font-size:10px; }
  .bidpanel .hist { font-size:12px; max-height:2.6em; overflow:hidden; }
  .hcard { min-height:44px; }
  .lastpanel.open { top:calc(100% + 2px); }
}
@media (max-width:699px) and (max-height:700px) {
  :root { --cw: min(60px, calc((min(100vw, 520px) - 24px) / 5.2)); }
  .hand { height:calc(var(--cw) * 1.4 + 26px); padding:20px 0 4px; }
  .board { gap:2px; } .centre { min-height:96px; }
  .seat .tm { display:none; } .seat.s0 .tm { display:block; }
  .bidpanel .hist { display:none; }
  .msgline { font-size:14px; min-height:20px; }
  .seat .turntxt { font-size:11px; }
}
/* phone landscape: wide and short. Same stack as portrait (bar, table, hand row), compact, bid sheet floats over the table */
@media (orientation:landscape) and (max-height:520px) and (max-width:999px) {
  .app { width:100vw; padding-top:max(4px, env(safe-area-inset-top)); padding-bottom:max(4px, env(safe-area-inset-bottom)); gap:3px; }
  :root { --W: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); --cw:46px; }
  .top { min-height:40px; } .pill { padding:9px 12px; } .top .round { width:40px; height:40px; }
  .table-view { position:relative; gap:3px; }
  .infobar { flex-wrap:nowrap; overflow:hidden; gap:4px; } #iTrump, #iPot { display:none !important; }
  .infobar .chip { flex:0 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; padding:4px 8px; }
  #iContract { order:1; flex:1 1 auto; } .infobar .chip.score { order:2; flex:0 0 auto; } .lastchip { order:3; } #chatBtn { order:4; } #menuBtn { order:5; }
  .msgline { font-size:13px; min-height:16px; }
  .hcard { margin-left:min(10px, calc((var(--W) - 8 * var(--cw)) / 7)); min-height:44px; }
  .hcard:first-child { margin-left:0; }
  .hand { height:calc(var(--cw) * 1.4 + 18px); padding:14px 0 2px; }
  .hcard.legal { transform:translateY(-6px); } .hcard.sel { transform:translateY(-14px); } .hcard.sel::after { display:none; }
  .bidpanel { position:absolute; z-index:6; left:50%; top:46%; transform:translate(-50%,-50%); width:min(600px, calc(100% - 24px)); margin:0; border-radius:14px; box-shadow:0 12px 40px rgba(0,0,0,.6); padding:8px 10px; gap:4px; }
  .bidpanel .hist { display:none; }
  .seat .tm, .seat .stags, .seat .turntxt { display:none; } .seat.s0 { display:none; }
  .seat { padding:4px 6px; } .centre { min-height:60px; }
  .trick .tc { width:40px; }
  .drawer { inset:0; height:auto; border-radius:0; }
}
.drawer { padding-left:max(12px, env(safe-area-inset-left)); padding-right:max(12px, env(safe-area-inset-right)); }

/* phone: compact top bar (2 rows), cards fill the width evenly, no suit-name chip (the contract line shows the suit) */
@media (max-width:699px) {
  :root { --W: calc(min(100vw, 520px) - 24px); --cw: min(72px, 20vw); }
  .hcard { margin-left:calc((var(--W) - 8 * var(--cw)) / 7); }
  .hcard:first-child { margin-left:0; }
  #iTrump { display:none; }
  .infobar { align-items:center; }
  #iContract { order:1; flex:1 1 0; min-width:0; } #chatBtn { order:2; } #menuBtn { order:3; }
  .infobar .chip.score { order:4; flex:1 1 0; min-width:0; } .lastchip { order:5; } #iPot { order:6; flex:1 1 100%; }
  .round.sm { width:40px; height:40px; }
  .lastchip { min-height:40px; padding:6px 10px; font-size:13px; }
}
@media (max-width:399px) { .chip.score .muted { display:none; } }
@media (max-width:699px) and (max-height:700px) {
  :root { --cw: min(54px, 20vw); }
  .hand { height:calc(var(--cw) * 1.4 + 24px); }
}

/* phone fixes after screenshots */
@media (max-width:699px) {
  #iContract { flex:1 1 calc(100% - 100px); }
  .infobar .chip.score { flex:1 1 calc(100% - 150px); white-space:nowrap; }
  .board { grid-template-areas:". top ." "left mid right" "bot bot bot"; }
  .seat.s0 { flex-wrap:nowrap; gap:6px; padding:3px 8px; }
  .seat.s0 > div { flex:none; } .seat.s0 .nm { max-width:45%; } .seat.s0 .stags { margin:0; }
  .seat.s0 .turntxt { white-space:nowrap; }
}
@media (max-width:699px) and (max-height:700px) { #iPot { display:none !important; } }

@media (max-width:699px) and (max-height:700px) { .is-bidding .seat.s0 { display:none; } }
@media (orientation:landscape) and (max-height:520px) and (max-width:999px) {
  .bidpanel { max-height:none; overflow:visible; flex-direction:row; flex-wrap:wrap; }
  .bidpanel .nums, .bidpanel .strains { flex:1 1 100%; } .bidpanel .acts { flex:1 1 calc(50% - 4px); }
  .bidpanel button { min-height:40px; }
}
@media (max-width:699px) { .seat.s0 { flex-wrap:wrap; row-gap:2px; } .seat.s0 .turntxt { flex:1 1 auto; } }
@media (min-width:1000px) { .quick { flex-wrap:wrap; overflow:visible; } }

/* hand: suit groups with a small gap, trump tag, combination highlight */
:root { --g:6px; }
.hcard.grp { margin-left:calc(var(--hm, 0px) + var(--g)); }
.ttag { position:absolute; left:2px; top:-17px; font-size:10px; font-weight:800; line-height:1; background:var(--bg); color:var(--ink); border:1px solid var(--muted); border-radius:6px; padding:2px 5px; white-space:nowrap; pointer-events:none; z-index:2; }
.hcard.combo svg { outline:3px solid var(--yellow); outline-offset:-1px; border-radius:9px; }
.clab { position:absolute; left:3px; bottom:4px; font-size:10px; font-weight:800; line-height:1; background:var(--yellow); color:var(--outline); border-radius:6px; padding:2px 5px; white-space:nowrap; pointer-events:none; z-index:2; }
@media (max-width:699px) {
  :root { --g:6px; --hm: calc((var(--W) - 8 * var(--cw) - 3 * var(--g)) / 7); }
  .hcard { margin-left:var(--hm); } .hcard:first-child { margin-left:0; }
  .hcard.grp { margin-left:calc(var(--hm) + var(--g)); }
}
@media (min-width:700px) { .hcard.grp { margin-left:calc(var(--cw) * var(--ov) * -1 + 8px); } .hcard:first-child { margin-left:0 !important; } }
@media (min-width:1000px) { .hcard.grp { margin-left:12px; } }
@media (orientation:landscape) and (max-height:520px) and (max-width:999px) { .hcard.grp { margin-left:calc(min(10px, calc((var(--W) - 8 * var(--cw)) / 7)) + 8px); } }
/* desktop last-trick panel: small fixed-size cards, always inside the left column; no toggle button */
@media (min-width:1000px) {
  #lastToggle { display:none !important; }
  .lastpanel { overflow:hidden; }
  .lp-cards { flex-wrap:nowrap; justify-content:space-between; gap:4px; }
  .lc { flex:0 0 42px; width:42px; max-width:42px; min-width:0; }
  .lc .pc { width:42px; max-width:42px; height:auto; }
  .lc .ln { font-size:10px; }
}

/* card face chooser */
.cardpick { display:flex; flex-direction:column; gap:6px; text-align:left; }
.cardpick .cp-h { font-weight:800; color:var(--ink); }
.cardpick button { display:flex; align-items:center; gap:10px; background:var(--bg); border:2px solid var(--surface2); border-radius:12px; padding:6px 8px; cursor:pointer; min-height:56px; touch-action:manipulation; }
.cardpick button.on { border-color:var(--accent-text,#FFD43B); border-width:3px; }
.cardpick .pv { display:flex; gap:3px; flex:none; } .cardpick .pv .pc { width:32px; }
.cardpick .cl { font-weight:800; font-size:15px; }
.cardpick-host:empty { display:none; }

/* number picker for bids (any number up to the server maximum) */
.numpick { display:flex; align-items:center; justify-content:center; gap:10px; }
.bidpanel .numpick button { flex:0 0 56px; min-width:56px; min-height:52px; font-size:28px; font-weight:800; line-height:1; border-radius:14px; padding:0; touch-action:manipulation; }
.bidpanel .numpick input { width:96px; height:52px; text-align:center; font-size:30px; font-weight:800; border:2px solid var(--yellow); border-radius:14px; background:var(--bg); padding:0; min-height:0; }
.bidpanel .numpick input[aria-invalid="true"] { border-style:dashed; border-color:var(--orange); }
.bidpanel .numpick input:disabled { opacity:.4; border-color:var(--surface2); }
.nerr { min-height:16px; text-align:center; font-size:13px; font-weight:800; color:var(--orange); }
.bidpanel .nchips { display:flex; gap:6px; justify-content:center; flex-wrap:wrap; }
.bidpanel .nchips button { flex:1 1 0; min-width:48px; min-height:44px; font-size:16px; }
@media (max-width:699px) and (max-height:700px) { .nerr { min-height:0; } .nerr:empty { display:none; } .bidpanel .numpick button, .bidpanel .numpick input { min-height:46px; height:46px; } }

/* move timer: ring on the seat, bar above my hand, line in the desktop panel (urgency = thicker + bold + "!" , not colour) */
.seat .ring { position:absolute; inset:-3px; border-radius:17px; padding:4px; pointer-events:none; --p:1;
  background:conic-gradient(var(--yellow) calc(var(--p) * 360deg), rgba(255,255,255,.18) 0);
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite:exclude; }
.seat .ring.urgent { inset:-5px; padding:7px; }
.tsec { display:inline-block; min-width:3.4em; text-align:left; font-variant-numeric:tabular-nums; }
.tsec.urgent { font-weight:800; }
.mytimer { flex:none; height:28px; display:flex; flex-direction:column; justify-content:center; gap:3px; visibility:hidden; }
.mytimer.on { visibility:visible; }
.mt-bar { height:6px; background:rgba(255,255,255,.18); border-radius:4px; overflow:hidden; }
.mt-bar i { display:block; height:100%; background:var(--yellow); border-radius:4px; transform-origin:left center; }
.mt-txt { text-align:center; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; line-height:1.1; }
.mytimer.urgent .mt-bar { height:10px; animation:tpulse 1s ease-in-out infinite; }
.mytimer.urgent .mt-txt { font-weight:800; font-size:15px; }
@keyframes tpulse { 50% { opacity:.55; } }
@media (prefers-reduced-motion: reduce) { .mytimer.urgent .mt-bar { animation:none; } }
.itimer { display:none; font-variant-numeric:tabular-nums; min-height:2.4em; }
.itimer.urgent { font-weight:800; }
@media (min-width:1000px) { .mytimer { display:none; } .infobar .itimer { display:block; } }
@media (orientation:landscape) and (max-height:520px) and (max-width:999px) { .mytimer { height:20px; } .mt-txt { font-size:12px; } }

/* score sheet */
.sheetpanel { display:none; }
.sheet { width:100%; border-collapse:collapse; font-size:12px; font-variant-numeric:tabular-nums; }
.sheet th, .sheet td { padding:3px 4px; text-align:left; border-bottom:1px solid rgba(154,166,188,.25); vertical-align:top; }
.sheet th { font-size:11px; color:var(--muted); position:sticky; top:0; background:var(--surface2); z-index:1; }
.sheet .num { text-align:right; white-space:nowrap; } .sheet .tt { font-weight:800; }
.sheet .rs b { font-weight:800; margin-right:2px; }
.sheet tr.now td { font-style:italic; border-bottom-style:dashed; }
.sheet tr.rd td { color:var(--muted); }
.sheet tfoot td { font-weight:800; border-top:2px solid var(--ink); border-bottom:0; position:sticky; bottom:0; background:var(--surface2); }
.sheet .sr { display:none; }
.sheetbox { overflow:auto; border-radius:10px; background:var(--bg); }
.sheetbox.full { max-height:46vh; text-align:left; font-size:13px; } .sheetbox.full .sheet { font-size:13px; }
.overlay .card.wide { max-width:520px; }
.iscore, #iScore { cursor:pointer; }
@media (min-width:1000px) {
  #iScore { cursor:default; }
  .sheetpanel { display:block; background:var(--bg2); border-radius:12px; padding:8px; }
  .sheetpanel .sheetbox { max-height:150px; background:transparent; }
  .sheetpanel .sheet { font-size:11px; } .sheetpanel .sheet th { background:var(--bg2); } .sheetpanel .sheet tfoot td { background:var(--bg2); }
  .sheetpanel .sheet th:nth-child(3), .sheetpanel .sheet td.rs { width:18px; }
}
@media (min-width:1000px) {
  .sheetpanel .sheet { table-layout:fixed; }
  .sheetpanel .sheet th:nth-child(1), .sheetpanel .sheet td:nth-child(1) { width:16px; }
  .sheetpanel .sheet th:nth-child(3), .sheetpanel .sheet td:nth-child(3) { width:16px; overflow:hidden; }
  .sheetpanel .sheet th:nth-child(4), .sheetpanel .sheet td:nth-child(4), .sheetpanel .sheet th:nth-child(5), .sheetpanel .sheet td:nth-child(5) { width:34px; }
  .sheetpanel .sheet th { overflow:hidden; text-overflow:clip; white-space:nowrap; }
  .sheetpanel .sheet th:nth-child(3) { font-size:0; } .sheetpanel .sheet th:nth-child(3)::after { content:"\2713\2717"; font-size:10px; }
  .sheetpanel .sheet td.ct { word-break:break-word; }
}

/* ---------- Real card style: photo-like cards (Public Domain deck, see cards/real/CREDITS.md) ---------- */
.pc.rc { position:relative; aspect-ratio:167/243; container-type:inline-size; border-radius:4.2% / 2.9%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.35), 0 3px 8px rgba(0,0,0,.35); }
.pc.rc img { display:block; width:100%; height:100%; border-radius:inherit; pointer-events:none; -webkit-user-drag:none; }
/* very small cards: a big plain index over the corner, so rank and suit stay readable (colour is never the only sign) */
.pc.rc .ri { display:none; position:absolute; left:0; top:0; box-sizing:border-box; padding:3cqw 4cqw 4cqw; background:#fff; border-radius:4.2% 0 22% 0; font:800 27cqw/.92 var(--font); text-align:center; }
.pc.rc .ri i { display:block; font-style:normal; font-size:24cqw; }
.pc.rc .ri.k { color:#111; } .pc.rc .ri.u { color:#C00018; }
@container (max-width:52px) { .pc.rc .ri { display:block; } }
.trick .tc .rc, .lc .rc { box-shadow:0 1px 2px rgba(0,0,0,.35), 0 2px 5px rgba(0,0,0,.35); }
.trick .tc.win .rc, .lc.win .rc { outline:4px solid var(--yellow); outline-offset:1px; }
.hcard.combo .rc { outline:3px solid var(--yellow); outline-offset:-1px; }
.cardpick .pv .pc.rc { width:32px; }
.lc .pc.rc { width:100%; max-width:none; height:auto; }

/* the hand as a fan, all cards turn around one point below the hand */
.hand.fan { position:relative; display:block; padding:0; box-sizing:border-box; overflow:visible; }
.hand.fan .hcard { position:absolute; left:50%; bottom:var(--drop, 20px); width:var(--cw); min-width:0; flex:none;
  margin:0 0 0 calc(var(--cw) * -.5) !important; transform-origin:50% calc(100% + var(--pv, 300px)); rotate:calc(var(--d, 0) * var(--fa, 5) * 1deg);
  transition:transform .15s, opacity .15s; border-radius:5%; }
.hand.fan .hcard.plain { transform:none; }
.hand.fan .hcard.legal { transform:translateY(-10px); }
.hand.fan .hcard.illegal { transform:translateY(8px); filter:grayscale(1) brightness(.7); }
.hand.fan .hcard.sel { transform:translateY(-24px); z-index:5; }
.hand.fan .hcard.legal:hover { transform:translateY(-16px); z-index:3; box-shadow:none; }
.hand.fan .hcard.sel::after { display:block; }
.hand.fan .hcard.grp { margin-left:calc(var(--cw) * -.5) !important; }
.hand.fan .hcard:first-child { margin-left:calc(var(--cw) * -.5) !important; }
@media (max-width:699px) { .hand.fan .hcard.sel::after { display:none; } }

/* ---- lobby tables, avatars, leaders, settings, top bar ---- */
.av { position:relative; flex:none; display:inline-flex; align-items:center; justify-content:center; width:var(--s,28px); height:var(--s,28px); border-radius:50%; background:var(--surface2); border:2px solid var(--surface2); overflow:hidden; font-weight:800; font-size:calc(var(--s,28px) * .42); line-height:1; vertical-align:middle; color:var(--ink); }
.av img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.seat .nm .av { margin-right:2px; }
.msg .av { margin-right:2px; }
.pubs { display:flex; flex-direction:column; gap:10px; }
.pubt { background:var(--bg); border-radius:14px; padding:10px; display:flex; flex-direction:column; gap:8px; }
.pubh { font-size:14px; line-height:1.4; } .pubh .st { font-weight:800; }
.pubs4 { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.ps { display:flex; align-items:center; gap:6px; min-width:0; background:var(--surface); border-radius:12px; padding:6px 8px; min-height:48px; }
.ps .pn { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; font-size:14px; }
.ps.empty { border:2px dashed var(--muted); background:transparent; }
.btn.pj { min-height:44px; padding:6px 12px; font-size:15px; flex:none; box-shadow:none; }
.tabs3 { display:flex; gap:6px; }
.tabs3 button { flex:1; background:var(--bg); border:2px solid var(--surface2); border-radius:12px; padding:10px 4px; font-weight:800; min-height:46px; cursor:pointer; }
.tabs3 button.on { background:var(--sel-bg,#FFD43B); color:var(--sel-ink,#0A1220); border-color:var(--sel-bg,#FFD43B); text-decoration:underline; text-underline-offset:4px; }
.ldbox { overflow:auto; border-radius:12px; background:var(--bg); }
.ld { width:100%; border-collapse:collapse; font-size:13px; font-variant-numeric:tabular-nums; }
.ld th, .ld td { padding:6px 5px; text-align:left; border-bottom:1px solid rgba(154,166,188,.25); }
.ld th { font-size:11px; color:var(--muted); } .ld .num { text-align:right; white-space:nowrap; }
.ld td.nm { display:flex; align-items:center; gap:6px; min-width:110px; font-weight:700; }
.ld tr.you td { border-bottom:0; font-weight:800; }
.ldh { margin:8px 0 0; font-size:16px; color:var(--ink); }
.ban { border:3px solid var(--orange); } .ban h2 { color:var(--ink) !important; } .ban h2::before { content:"\26D4  "; }
.mutenote { border:2px dashed var(--muted); border-radius:10px; padding:8px; margin:0; font-weight:700; }
.adminlink { display:inline-block; color:var(--muted); text-decoration:underline; padding:8px 0; }
.adslot { display:block; } .adslot:empty, .adslot[hidden] { display:none !important; }
#tgOld { margin-top:6px; } #tgOld summary { cursor:pointer; padding:8px 0; font-weight:700; color:var(--muted); min-height:44px; }
#tgBtn { width:100%; }
.setsec { display:flex; flex-direction:column; gap:6px; }
.opts { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.opt, .tog { display:flex; align-items:center; gap:8px; background:var(--bg); border:2px solid var(--surface2); border-radius:12px; padding:8px 10px; min-height:48px; cursor:pointer; font-weight:700; text-align:left; touch-action:manipulation; }
.opt.on { border-color:var(--accent-text,#FFD43B); border-width:3px; }
.tog { width:100%; justify-content:space-between; } .tog b { font-weight:800; }
.cb { display:inline-block; width:26px; height:36px; border-radius:5px; border:2px solid #fff; flex:none; }
.bk-blue { background:repeating-linear-gradient(45deg,#1D3FA8 0 4px,#2B55D1 4px 8px); }
.bk-red { background:repeating-linear-gradient(45deg,#9B1B2A 0 4px,#C22B3D 4px 8px); }
.bk-green { background:repeating-linear-gradient(45deg,#1C6B47 0 4px,#268A5C 4px 8px); }
.bk-dark { background:repeating-linear-gradient(45deg,#1b1f27 0 4px,#2c323d 4px 8px); }
.sw { display:inline-block; width:34px; height:24px; border-radius:7px; border:2px solid var(--ink); flex:none; }
.fe-navy { background:linear-gradient(135deg,#0F1A2E,#22304D); } .fe-green { background:linear-gradient(135deg,#0D2A20,#1E4A38); }
.fe-graphite { background:linear-gradient(135deg,#17191C,#2C3036); } .fe-wood { background:linear-gradient(135deg,#2A1B12,#5B3F2C); }
:root[data-felt="green"] { --bg:#0D2A20; --bg2:#143A2B; --surface:#1E4A38; --surface2:#285C47; --muted:#A8C2B4; }
:root[data-felt="graphite"] { --bg:#17191C; --bg2:#202328; --surface:#2C3036; --surface2:#383D44; --muted:#A5ABB5; }
:root[data-felt="wood"] { --bg:#2A1B12; --bg2:#3A2619; --surface:#4A3222; --surface2:#5B3F2C; --muted:#C5AE9C; }
.calm *, .calm *::before, .calm *::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
/* top bar: at the table the "Leave" button replaces the back link and the language switch */
.leave { display:inline-flex; align-items:center; gap:6px; min-height:44px; } .leave svg { width:20px; height:20px; }
.app.in-table #leaveBtn { display:inline-flex; } .app:not(.in-table) #leaveBtn { display:none; }
.app.in-table #menuBtn { display:inline-flex; } .app:not(.in-table) #menuBtn { display:none; }
.app.in-table #backGames, .app.in-table #langSw { display:none; }
#gearBtn svg { width:22px; height:22px; }
.pc.rc.ld .ri { display:block; } .pc.rc.ld img { opacity:0; }
.ps.empty .av, .ps.empty .pn { display:none; } .ps.empty { padding:4px; } .ps.empty .btn.pj { flex:1; }
.opts { grid-template-columns:repeat(2, minmax(0,1fr)); }
.opt span, .tog span { min-width:0; overflow-wrap:anywhere; }
.opts:has([data-lang]) { grid-template-columns:repeat(3, minmax(0,1fr)); }
.tog { flex-wrap:wrap; }
.ld { table-layout:fixed; }
.ld th:nth-child(1), .ld td:nth-child(1) { width:24px; }
.ld th:nth-child(3), .ld td:nth-child(3), .ld th:nth-child(4), .ld td:nth-child(4) { width:40px; }
.ld th:nth-child(5), .ld td:nth-child(5) { width:44px; }
.ld th:nth-child(6), .ld td:nth-child(6) { width:52px; }
.ld th { white-space:normal; line-height:1.1; vertical-align:bottom; }
.ld td.nm { min-width:0; overflow:hidden; } .ld td.nm span:last-child { min-width:0; overflow-wrap:anywhere; }
.ld th { overflow:hidden; text-overflow:clip; }

/* join requests and table types */
.typerow { flex-wrap:wrap; } .typerow .seg { flex:1 1 100%; order:3; } .typerow .seg button { flex:1; padding:10px 4px; font-size:14px; }
.typerow #tVisL { flex:1; } .typerow #typeHelp { order:4; flex:1 1 100%; margin:0; }
.ttype { font-weight:800; border:2px solid var(--muted); border-radius:8px; padding:0 6px; white-space:nowrap; }
.ttype.closed { border-style:solid; border-color:var(--accent-text,#FFD43B); }
.ttype.open { border-style:dashed; }
.reqs { display:flex; flex-direction:column; gap:8px; }
.reqh { margin:0; color:var(--ink); font-size:17px; }
.reqc { background:var(--bg); border:3px solid var(--yellow); border-radius:14px; padding:10px; display:flex; flex-direction:column; gap:8px; }
.rq-h { display:flex; gap:10px; align-items:center; } .rq-n { min-width:0; overflow-wrap:anywhere; }
.rq-s { font-size:13px; line-height:1.5; font-variant-numeric:tabular-nums; }
.rq-a { display:flex; gap:8px; } .rq-a .btn { flex:1; min-height:48px; }
.bigcd { font-size:34px; font-weight:800; text-align:center; font-variant-numeric:tabular-nums; }
.cd { font-variant-numeric:tabular-nums; }
.reqbadge { min-height:44px; font-weight:800; border:2px solid var(--yellow); }
.pill { white-space:nowrap; }

/* own countdown: thick bright bar on a dark track, big seconds; last 5 s = orange + "!" + pulse + thicker (shape and text, not colour only) */
.mytimer { flex-direction:row; align-items:center; gap:10px; height:40px; }
.mt-bar { flex:1 1 auto; height:16px; background:#0A1220; border:2px solid var(--surface2); border-radius:9px; overflow:hidden; }
.mt-bar i { background:#FFD43B; border-radius:6px; }
.mt-txt { flex:none; display:flex; flex-direction:column; align-items:flex-end; min-width:5.2em; line-height:1; }
.mt-txt small { font-size:11px; font-weight:700; color:var(--muted); }
.mt-txt b { font-size:24px; font-weight:800; font-variant-numeric:tabular-nums; }
.mytimer.urgent .mt-bar { height:22px; border-color:#FF9E1B; animation:tpulse .9s ease-in-out infinite; }
.mytimer.urgent .mt-bar i { background:#FF9E1B; }
.mytimer.urgent .mt-txt b { color:#FF9E1B; font-size:28px; }
@keyframes tpulse { 50% { opacity:.6; transform:scaleY(.9); } }
.itimer, .infobar .itimer { display:none !important; }
.sshort { display:none; }
@media (max-width:699px) { .sfull { display:none; } .sshort { display:inline; } .mytimer { height:36px; } .mt-txt b { font-size:22px; } .mytimer.urgent .mt-txt b { font-size:26px; } }
@media (max-width:699px) and (max-height:700px) { .mytimer { height:32px; } }
@media (min-width:1000px) {
  .mytimer { display:flex; grid-area:timer; }
  .table-view { grid-template-rows:minmax(0,1fr) auto auto auto; grid-template-areas:"info board" "info msg" "info timer" "info hand"; }
}
@media (orientation:landscape) and (max-height:520px) and (max-width:999px) { .mytimer { height:26px; } .mt-bar { height:12px; } .mt-txt b { font-size:18px; } .mt-txt small { display:none; } }
@media (prefers-reduced-motion: reduce) { .mytimer.urgent .mt-bar { animation:none; } }

/* leaderboard podium, sort chips, FAQ, install hint, rating */
.sortchips { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.sortchips button { flex:1 1 0; min-height:44px; background:var(--bg); border:2px solid var(--surface2); border-radius:999px; font-weight:800; cursor:pointer; padding:6px 8px; }
.sortchips button.on { border-color:var(--sel-bg,#FFD43B); background:var(--sel-bg,#FFD43B); color:var(--sel-ink,#0A1220); }
.podium { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); align-items:end; gap:8px; margin:10px 0; }
.pod { display:flex; flex-direction:column; align-items:center; gap:4px; text-align:center; min-width:0; }
.pod .pd-name { font-weight:800; font-size:14px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pod .pd-val { font-size:12px; color:var(--muted); font-weight:700; }
.pod .pd-step { width:100%; background:var(--surface2); border-radius:10px 10px 0 0; display:flex; align-items:center; justify-content:center; border:2px solid var(--yellow); border-bottom:0; }
.pod .pd-step b { font-size:26px; font-weight:800; color:var(--accent-text,#FFD43B); }
.pod.p1 .pd-step { height:76px; } .pod.p2 .pd-step { height:54px; } .pod.p3 .pd-step { height:38px; }
.pod.p1 .pd-av .av { border-color:var(--accent-text,#FFD43B); border-width:3px; }
.ld th:nth-child(3), .ld td:nth-child(3) { width:46px; } .ld th:nth-child(4), .ld td:nth-child(4), .ld th:nth-child(5), .ld td:nth-child(5) { width:38px; } .ld th:nth-child(6), .ld td:nth-child(6) { width:42px; }
.ld .cw { display:block; font-size:10px; color:var(--muted); font-weight:700; }
.ratingb { display:inline-block; margin-left:6px; border:2px solid var(--yellow); border-radius:999px; padding:1px 8px; font-size:13px; font-weight:800; }
.qa { background:var(--bg); border-radius:12px; padding:0 12px; margin-bottom:6px; }
.qa summary { cursor:pointer; font-weight:800; padding:12px 0; min-height:44px; list-style:none; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.qa summary::-webkit-details-marker { display:none; }
.qa summary::after { content:"+"; font-size:22px; color:var(--accent-text,#FFD43B); }
.qa[open] summary::after { content:"\2212"; }
.qa p { margin:0 0 12px; line-height:1.5; font-size:15px; color:var(--ink); }
.install { border:2px dashed var(--yellow); }
.inst-h { display:flex; justify-content:space-between; align-items:center; gap:8px; } .inst-h b { font-size:17px; }
.ld th { padding:6px 2px; font-size:10px; }

/* manual combinations */
.combobar { flex:none; display:flex; flex-wrap:wrap; gap:6px; align-items:center; justify-content:center; background:var(--surface); border-radius:14px; padding:6px 8px; }
.combobar .btn { min-height:44px; padding:6px 14px; font-size:15px; box-shadow:none; }
.cb-l { font-weight:800; font-size:18px; }
.cb-hint { flex:1 1 100%; font-size:13px; font-weight:700; text-align:center; } .cb-hint b { color:var(--accent-text,#FFD43B); }
.cb-types, .cb-acts { display:flex; gap:6px; flex:1 1 100%; } .cb-types .btn, .cb-acts .btn { flex:1; padding:6px 4px; }
.cb-list { display:flex; flex-wrap:wrap; gap:6px; flex:1 1 100%; justify-content:center; }
.cb-chip { background:var(--bg); border:2px solid var(--yellow); border-radius:999px; padding:2px 4px 2px 10px; font-weight:800; font-size:13px; display:inline-flex; align-items:center; gap:4px; }
.cb-chip button { background:none; border:0; width:32px; height:32px; font-size:16px; cursor:pointer; color:var(--ink); }
.hcard.pick { transform:translateY(-16px); z-index:4; }
.hcard.pick::before { content:"\2713"; position:absolute; right:2px; top:-6px; width:22px; height:22px; border-radius:50%; background:var(--yellow); color:var(--outline); font-weight:800; font-size:14px; line-height:22px; text-align:center; z-index:5; }
.hcard.pick .pc { outline:3px solid var(--yellow); outline-offset:-1px; border-radius:8px; }
.cbub { margin-top:3px; display:inline-block; background:var(--bg); border:2px solid var(--yellow); border-radius:10px; padding:1px 8px; font-weight:800; font-size:12px; }
.cbub.no { border-style:dashed; border-color:var(--orange); }
.cshow { display:flex; flex-direction:column; gap:3px; margin-top:3px; align-items:center; }
.cs-c { display:flex; gap:2px; justify-content:center; flex-wrap:wrap; } .cm { width:26px; } .cm .pc { width:100%; }
.cs-l { font-size:11px; font-weight:800; } .cs-l.no { text-decoration:underline dotted; }
@media (min-width:1000px) { .cm { width:34px; } }
@media (max-width:699px) { .cm { width:20px; } .cs-l { font-size:10px; } }

/* ---- round: timer in calm blue, SVG ring with constant speed, contract line, bid strip ---- */
.seat .ring { position:absolute; left:-5px; top:-5px; background:none; -webkit-mask:none; mask:none; padding:0; inset:auto; border-radius:0; overflow:visible; pointer-events:none; }
.seat .ring path { fill:none; stroke-width:5; }
.seat .ring .rt { stroke:rgba(255,255,255,.2); }
.seat .ring .rp { stroke:#3B8CFF; }
.seat .ring.urgent { inset:auto; padding:0; animation:rpulse .9s ease-in-out infinite; }
.seat .ring.urgent path { stroke-width:8; }
.seat .ring.urgent .rp { stroke:#FF9E1B; }
@keyframes rpulse { 50% { opacity:.55; } }
.mt-bar i { background:#3B8CFF; }
.mytimer.urgent .mt-bar i { background:#FF9E1B; }
.mytimer.urgent .mt-bar { border-color:#FF9E1B; }
.mytimer.urgent .mt-txt b { color:#FF9E1B; }
@media (prefers-reduced-motion: reduce) { .seat .ring.urgent { animation:none; } }
#iContract { overflow-wrap:anywhere; }
#iContract .cl { white-space:nowrap; font-weight:800; }
#iContract .cn { white-space:nowrap; }
@media (max-width:480px) { #iContract .ctail { display:none; } #iContract { font-size:13px; } }
.bidpanel .hist { display:flex !important; flex-wrap:nowrap; gap:12px; overflow-x:auto; overflow-y:hidden; white-space:nowrap; font-size:13px; max-height:none; padding:2px 0 6px; justify-content:flex-start; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.bidpanel .hist::-webkit-scrollbar { display:none; }
.bidpanel .hist .hb { flex:none; } .bidpanel .hist .hb b { color:var(--ink); font-weight:800; }
.seat .bub { font-size:15px; font-weight:800; border:2px solid var(--yellow); background:var(--bg); padding:1px 10px; white-space:nowrap; }

/* ---- phones: nothing cut, bidding keeps the seats visible ---- */
@media (max-width:699px) {
  .seat .nm { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; line-height:1.15; }
  .seat.s0 .nm { white-space:nowrap; }
  .seat .bub { margin-top:2px; }
}
@media (max-width:699px) and (max-height:940px) {
  .is-bidding #msgLine { display:none; }
  .is-bidding .bidpanel .nchips { display:none; }
  .is-bidding .infobar .chip.score, .is-bidding .infobar .lastchip { display:none; }
  .is-bidding .seat .turntxt, .is-bidding .seat .stags { display:none; }
  .is-bidding .bidpanel button { min-height:42px; }
  .is-bidding .bidpanel .numpick button, .is-bidding .bidpanel .numpick input { min-height:44px; height:44px; }
  .is-bidding .board { min-height:128px; }
}
@media (max-width:699px) and (max-height:940px) {
  .is-bidding .seat.s1 .tag, .is-bidding .seat.s3 .tag { display:none; }
  .is-bidding .board { min-height:150px; }
  .is-bidding .mytimer { height:30px; } .is-bidding .mytimer .mt-txt small { display:none; } .is-bidding .mt-txt b { font-size:20px; }
  .is-bidding .bidpanel { padding-top:6px; gap:4px; }
  .is-bidding .bidpanel .numpick button, .is-bidding .bidpanel .numpick input { min-height:40px; height:40px; }
  .is-bidding .bidpanel .strains button { min-height:42px; }
  .is-bidding .hand { height:calc(var(--cw) * 1.4 + 14px); padding-top:12px; }
}

/* profile screen and preset avatars */
.av.pre { border:0; background:transparent; } .av.pre svg { width:100%; height:100%; display:block; }
.pf-prev { display:flex; align-items:center; gap:12px; font-size:20px; }
.pf-l { font-weight:800; color:var(--ink); margin-top:6px; }
#pfNick { width:100%; }
#pfNick:disabled { opacity:.55; }
.pf-msg { min-height:20px; font-size:14px; font-weight:700; } .pf-msg.bad { color:var(--orange); } .pf-msg.ok { color:var(--ink); }
.avgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(52px, 1fr)); gap:8px; }
.avopt { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; background:var(--bg); border:2px solid var(--surface2); border-radius:14px; padding:4px; min-height:56px; cursor:pointer; touch-action:manipulation; }
.avopt small { font-size:9px; font-weight:700; line-height:1.1; text-align:center; overflow-wrap:anywhere; }
.avopt.on { border:3px solid var(--yellow); padding:3px; }
.avopt.on::after { content:"\2713"; position:absolute; right:-4px; top:-6px; width:20px; height:20px; border-radius:50%; background:var(--sel-bg,#FFD43B); color:var(--sel-ink,#0A1220); font-weight:800; font-size:13px; line-height:20px; text-align:center; }
.pf-priv { margin:4px 0; }
.avopt small { font-size:8.5px; }

/* ring: an SVG exactly the size of the seat box plus 3 px around it, never clipped by the table */
.seat .ring { position:absolute; left:-3px; top:-3px; width:calc(100% + 6px); height:calc(100% + 6px); overflow:visible; pointer-events:none; }
.seat .ring path { stroke-width:4; }
.seat .ring.urgent path { stroke-width:6; }
.seat.s0 .ring path { stroke-width:3; } .seat.s0 .ring.urgent path { stroke-width:5; }
.board { overflow:visible; }
@media (max-width:699px) { .board { padding:4px; } .seat.s0 .ring path { stroke-width:2.5; } }

/* bot icon, dealer chip, declaration lists */
.botic { width:14px; height:14px; vertical-align:-2px; color:var(--muted); flex:none; }
.seat .nm .botic { margin-left:2px; }
.dchip { position:relative; display:inline-flex; align-items:center; gap:3px; background:var(--ink); color:var(--outline); border-radius:8px; padding:1px 5px; font-size:11px; font-weight:800; margin-left:4px; vertical-align:middle; cursor:default; }
.dchip svg { width:14px; height:14px; flex:none; }
.dchip .dtx { display:none; white-space:nowrap; }
.dchip.tip .dtx { display:block; position:absolute; left:0; top:calc(100% + 3px); background:var(--ink); color:var(--outline); padding:2px 7px; border-radius:6px; z-index:8; box-shadow:0 4px 12px rgba(0,0,0,.4); }
@media (min-width:1000px) { .dchip .dtx { display:inline; } .dchip.tip .dtx { position:static; box-shadow:none; padding:0; } }
.dlist { text-align:left; display:flex; flex-direction:column; gap:4px; font-size:13px; line-height:1.4; }
.dl b { color:var(--accent-text,#FFD43B); }
.sheet tr.clk { cursor:pointer; } .sheet tr.dtl td { background:var(--bg2); padding:6px 8px; }
.sheet tr.dtl[hidden] { display:none; }
@media (max-width:999px) { .board { overflow:hidden; padding:4px; } }
@media (orientation:landscape) and (max-height:520px) and (max-width:999px) { .cshow .cs-c { display:none; } .seat .cbub, .seat .cs-l { font-size:11px; } .trick .tc { width:36px; } }

/* ring: svg = border box + 3 px on every side (the seat has a 3 px border, so offset by 6) */
.seat .ring { left:-6px; top:-6px; width:calc(100% + 12px); height:calc(100% + 12px); }
.pc.rc .ri.ten { letter-spacing:-.08em; }

/* typographic scale: body 1.45, headings 1.2, buttons 1.1, chips and badges 1, tables 1.35; Armenian glyphs get more room */
body { line-height:1.45; }
h1, h2, h3, .card h1, .card h2, .rules h3 { line-height:1.2; }
button, .btn, .pill, input { line-height:1.1; }
.chip, .tag, .badge, .ttype, .dchip, .cbub, .ctag, .ptag, .bub { line-height:1; }
table, .sheet, .ld { line-height:1.35; }
.card p, .msg, .seatrow, .qa p, .rows div, .gl div, .pubh, .ps { line-height:1.4; }
.seat .nm, .seat .tm, .seat .turntxt { line-height:1.2; }
.chip { padding-top:6px; padding-bottom:6px; }
html[lang="hy"] body { line-height:1.55; }
html[lang="hy"] h1, html[lang="hy"] h2, html[lang="hy"] h3 { line-height:1.3; }
html[lang="hy"] button, html[lang="hy"] .btn, html[lang="hy"] .pill, html[lang="hy"] input { line-height:1.25; }
html[lang="hy"] .chip, html[lang="hy"] .tag, html[lang="hy"] .ttype, html[lang="hy"] .cbub, html[lang="hy"] .ctag, html[lang="hy"] .bub, html[lang="hy"] .dchip { line-height:1.25; }
html[lang="hy"] table, html[lang="hy"] .sheet, html[lang="hy"] .ld { line-height:1.45; }
html[lang="hy"] .seat .nm, html[lang="hy"] .seat .tm, html[lang="hy"] .seat .turntxt { line-height:1.35; }
html[lang="hy"] .chip { padding-top:7px; padding-bottom:7px; }
@media (orientation:landscape) and (max-height:520px) and (max-width:999px) {
  .seat .turntxt, .seat.turn .turntxt { display:none; }
  .seat { padding:3px 6px; } .seat .bub { font-size:13px; padding:0 8px; }
  .board { grid-template-rows:auto minmax(0,1fr) 0; }
}

/* ---- Real cards: card stock, thin edge, layered soft shadow, gentle fan ---- */
.pc.rc { border-radius:6% / 4.2%; background:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.14), 0 2px 4px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.2); overflow:hidden; }
.pc.rc img { image-rendering:auto; border-radius:inherit; }
@container (max-width:52px) { .pc.rc .ri { display:none; } }
@container (max-width:48px) { .pc.rc .ri { display:block; } }
.hand.fan .hcard { transition:transform .15s ease, opacity .15s; }
.hand.fan .hcard.sel .pc.rc, .hand.fan .hcard.legal:hover .pc.rc, .hand.fan .hcard.pick .pc.rc { box-shadow:0 0 0 1px rgba(0,0,0,.14), 0 4px 8px rgba(0,0,0,.3), 0 14px 26px rgba(0,0,0,.3); }
.hand.fan .hcard.sel { transform:translateY(-22px); }
.hand.fan .hcard.legal { transform:translateY(-8px); }
/* cards on the table: dropped, each with a fixed small turn */
.trick .tc.p0 .rc, .trick .tc.p0 svg { rotate:-3deg; } .trick .tc.p1 .rc, .trick .tc.p1 svg { rotate:4deg; }
.trick .tc.p2 .rc, .trick .tc.p2 svg { rotate:-4deg; } .trick .tc.p3 .rc, .trick .tc.p3 svg { rotate:3deg; }
.trick .tc .rc { box-shadow:0 0 0 1px rgba(0,0,0,.14), 0 2px 4px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.2); }
@media (min-width:1000px) { .trick .tc { width:96px; } .trick { max-height:330px; } }
@media (min-width:700px) and (max-width:999px) { .trick .tc { width:80px; } }
.hand.fan .hcard.illegal { opacity:1; filter:grayscale(.9) brightness(.72); }  /* solid, not see-through */

/* ======== calm pass: two weights (500 and 700), more room, fewer outlines, 8 px spacing ======== */
.app, .app *, .toast, .overlay * { font-weight:500; }
.app :is(h1, h2, h3, b, strong, .btn, .tabs button, .tabs3 button, .sortchips button, .seg button.on, .nm, .pn, .cbub, .ctag, .bub, .bigno, .mt-txt b, .tsec, .ld th, .lp-h, .cp-h, .pf-l, .tog b, .sc, .sheet tfoot td, .sheet th) , .overlay :is(h2, b, .btn) { font-weight:700; }
.app :is(.chip.trump, .who, .nm, .chipline b) { font-weight:700; }
.card h1, .card h2 { font-weight:700; }
.muted, .small, .meta, .stat-grid span { font-weight:500; }

/* panels and chips: room to breathe */
.card { padding:16px; gap:12px; border-radius:16px; }
.chip { padding:8px 12px; font-size:14px; }
.tag, .ttype, .dchip { padding:3px 8px; }
.cbub, .ctag { border:0; background:var(--surface2); padding:3px 10px; font-size:13px; }
.cbub.no { background:var(--bg); text-decoration:none; }
.ctag { background:var(--yellow); color:var(--outline); }
.seat .bub { border:0; background:var(--surface2); padding:3px 12px; font-size:15px; }
.sortchips button, .tabs3 button, .opt, .tog { border-width:1px; }
.ps { gap:8px; padding:8px 10px; }
.reqc { border-width:2px; padding:12px; gap:12px; }
.qa summary { font-weight:700; }
.seg { padding:4px; gap:2px; }
.stack { gap:12px; }
.row2 { gap:12px; }

/* seats */
.seat { padding:8px 10px; } .seat .nm { font-size:14px; }
.seat .tm, .seat .turntxt { font-size:12px; }
.seat.turn { border-color:rgba(255,212,59,.7); }

/* score block as clean rows */
.sfull { display:flex; flex-direction:column; gap:4px; align-items:flex-start; line-height:1.3; }
.sfull .sn { font-size:14px; } .sfull .sc { font-size:26px; line-height:1.1; color:var(--accent-text,#FFD43B); }
.chip.score .st { display:block; font-size:12px; margin-top:2px; }

/* score sheet: readable */
.sheet { font-size:14px; line-height:1.35; }
.sheet th, .sheet td { padding:7px 8px; }
.sheet th { font-size:12px; font-weight:700; }
.sheet td.ct { overflow-wrap:anywhere; }
.sheet tfoot td { font-weight:700; }

/* desktop: more space */
@media (min-width:1000px) {
  :root { --lp:clamp(236px, 19vw, 290px); }
  .table-view { grid-template-columns:var(--lp) minmax(0,1fr); gap:14px 20px; }
  .bidpanel { left:calc(var(--lp) + 20px + (100% - var(--lp) - 20px) / 2); }
  .infobar { padding:16px; gap:12px; }
  .infobar .chip { padding:12px 14px; font-size:15px; line-height:1.4; }
  .infobar .chip.score { padding:14px; }
  .lastpanel, .sheetpanel { padding:12px; }
  .sheetpanel .sheet { font-size:13px; }
  .sheetpanel .sheet th, .sheetpanel .sheet td { padding:6px 6px; }
  .seat { padding:12px 14px; } .seat .nm { font-size:15px; }
  .board { padding:22px 30px; }
  .msgline { font-size:17px; }
  .hand.fan { margin-bottom:max(10px, env(safe-area-inset-bottom)); }
}
/* phones: keep it tight but with the same two weights */
@media (max-width:699px) {
  .card { padding:16px; }
  .seat { padding:6px 8px; } .seat .nm { font-size:13px; }
  .chip { padding:7px 11px; }
  .hand.fan { margin-bottom:max(6px, env(safe-area-inset-bottom)); }
}
.hand.fan .hcard { bottom:calc(var(--drop, 20px) + 12px); }
html[lang="hy"] .sheet, html[lang="hy"] .seat .nm { line-height:1.5; }
html[lang="hy"] .sfull { gap:6px; }
@media (max-width:699px) {
  .sfull { display:none !important; } .sshort { display:inline !important; } .chip.score .st { display:inline; font-size:13px; margin:0; }
  .chip.score { padding:7px 12px; }
  .ctag { white-space:nowrap; font-size:12px; padding:3px 8px; }
  .seat .bub { font-size:14px; padding:2px 10px; }
}
@media (min-width:1000px) {
  .sheetpanel .sheet th, .sheetpanel .sheet td { padding:6px 4px; }
  .sheetpanel .sheet th:nth-child(4), .sheetpanel .sheet td:nth-child(4), .sheetpanel .sheet th:nth-child(5), .sheetpanel .sheet td:nth-child(5) { width:40px; }
  .sheetpanel .sheet th:nth-child(1), .sheetpanel .sheet td:nth-child(1) { width:20px; }
}
.is-bidding #msgLine { display:none; }

/* bidding: history row, out-of-turn button, panel slide-up, new call highlight */
.bidrow { flex:none; display:flex; align-items:center; gap:8px; min-height:34px; }
.bidhist { flex:1 1 auto; min-width:0; display:flex; gap:14px; overflow-x:auto; white-space:nowrap; font-size:14px; padding:4px 2px; scrollbar-width:none; }
.bidhist::-webkit-scrollbar { display:none; }
.bidhist .hb { flex:none; color:var(--muted); } .bidhist .hb b { color:var(--ink); font-weight:700; }
.oobbtn { flex:none; min-height:44px; padding:8px 18px; border-radius:999px; border:3px solid var(--yellow); background:var(--bg); color:var(--ink); font-weight:700; font-size:15px; cursor:pointer; touch-action:manipulation; }
.bidpanel.opening { animation:bpIn .3s ease-out; }
@keyframes bpIn { from { translate:0 28px; opacity:0; } to { translate:0 0; opacity:1; } }
.seat.flash { animation:seatflash 1.4s ease-out; }
.seat.flash .bub { animation:bubpop .5s ease-out; }
@keyframes seatflash { 0% { background:rgba(255,212,59,.6); box-shadow:0 0 0 5px rgba(255,212,59,.8); } 100% { background:var(--surface); box-shadow:0 0 0 0 rgba(255,212,59,0); } }
@keyframes bubpop { 0% { transform:scale(1.35); } 100% { transform:scale(1); } }
@media (prefers-reduced-motion: reduce) { .bidpanel.opening, .seat.flash, .seat.flash .bub { animation:none; } .seat.flash { box-shadow:0 0 0 4px var(--yellow); } }
@media (min-width:1000px) { .bidrow { max-width:100%; } }

/* accordion: FAQ and rules */
.accs { display:flex; flex-direction:column; background:var(--bg); border-radius:14px; overflow:hidden; }
.acc { border-bottom:1px solid rgba(154,166,188,.18); }
.acc:last-child { border-bottom:0; }
.acc-s { list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; min-height:52px; font-weight:700; line-height:1.35; }
.acc-s::-webkit-details-marker { display:none; }
.acc-i { flex:none; width:12px; height:12px; position:relative; }
.acc-i::before, .acc-i::after { content:""; position:absolute; left:0; right:0; top:5px; height:2px; background:var(--yellow); border-radius:1px; transition:transform .25s; }
.acc-i::after { transform:rotate(90deg); }
.acc[open] .acc-i::after { transform:rotate(0deg); }
.acc-b { overflow:hidden; transition:height .26s ease; }
.acc-in { padding:8px 16px 12px; line-height:1.5; font-size:15px; }
.acc-in p { margin:0 0 8px; } .acc-in p:last-child { margin-bottom:0; }
.acc-in ul, .acc-in ol { margin:6px 0 8px; padding-left:20px; } .acc-in li { margin:3px 0; }
.acc-in table { width:100%; border-collapse:collapse; font-size:14px; } .acc-in th, .acc-in td { padding:6px 8px; border-bottom:1px solid rgba(154,166,188,.2); text-align:left; }
.acc-in h4 { margin:10px 0 4px; font-size:15px; color:var(--ink); }
.rulespage { display:block; text-align:center; text-decoration:none; margin-top:12px; line-height:1.3; padding-top:14px; padding-bottom:14px; }
@media (prefers-reduced-motion: reduce) { .acc-b, .acc-i::before, .acc-i::after { transition:none; } }
.calm .acc-b, .calm .acc-i::before, .calm .acc-i::after { transition:none !important; }
.kapl { text-align:center; font-weight:700; font-size:15px; color:var(--accent-text,#FFD43B); }
.bidpanel #bKap.on { background:var(--sel-bg,#FFD43B); color:var(--sel-ink,#0A1220); border-color:var(--sel-bg,#FFD43B); }
.bidpanel #bKap:disabled.on { opacity:1; }
/* declaring several combinations: used cards carry the number of their combination */
.hcard.used::after { content:attr(data-un); position:absolute; left:2px; top:-6px; min-width:20px; height:20px; padding:0 5px; border-radius:10px; background:var(--ink); color:var(--outline); font-size:12px; font-weight:700; line-height:20px; text-align:center; z-index:5; }
.hand.fan .hcard.used::after { display:block; }
.hcard.used .pc { outline:2px dashed var(--ink); outline-offset:-1px; border-radius:6px; }
.cb-yd { flex:1 1 100%; font-size:13px; font-weight:700; text-align:center; margin-top:4px; }
.cb-no { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; border-radius:10px; background:var(--yellow); color:var(--outline); font-size:12px; font-weight:700; margin-right:4px; }

/* bazar: newest call marked, last calls fade out, history block (desktop) and popup (phone) */
.hb.new, .bidhist .hb.new { background:var(--yellow); color:var(--outline); border-radius:8px; padding:2px 10px; }
.hb.new b { color:var(--outline) !important; font-weight:700; }
.seat .bub { transition:opacity .5s ease; } .seat .bub.fade { opacity:0; }
.bazarpanel { display:none; }
.bz, .bzl { display:flex; flex-wrap:wrap; gap:8px 12px; font-size:14px; line-height:1.4; } .bz .hb, .bzl .hb { color:var(--muted); } .bz .hb b, .bzl .hb b { color:var(--ink); font-weight:700; }
.bzl { text-align:left; font-size:16px; }
#iContract { cursor:pointer; }
@media (min-width:1000px) { .bazarpanel { display:block; background:var(--bg2); border-radius:12px; padding:12px; } .bazarpanel[hidden] { display:none; } #iContract { cursor:default; } }
@media (prefers-reduced-motion: reduce) { .seat .bub { transition:none; } }
.bz .hb.new, .bzl .hb.new, .bidhist .hb.new { color:var(--outline); }

/* speech clouds */
.cloud { position:absolute; z-index:9; background:#fff; color:#14203A; border-radius:14px; padding:6px 12px; font-weight:700; font-size:15px; line-height:1.3; text-align:center; max-width:min(210px, 44vw); box-shadow:0 6px 18px rgba(0,0,0,.35); pointer-events:none; animation:cloudin .15s ease-out; }
.cloud::after { content:""; position:absolute; border:7px solid transparent; }
.cloud.cd-above { bottom:calc(100% + 10px); left:50%; translate:-50% 0; } .cloud.cd-above::after { top:100%; left:50%; margin-left:-7px; border-top-color:#fff; border-bottom:0; }
.cloud.cd-below { top:calc(100% + 10px); left:50%; translate:-50% 0; } .cloud.cd-below::after { bottom:100%; left:50%; margin-left:-7px; border-bottom-color:#fff; border-top:0; }
.cloud.cd-right { left:calc(100% + 10px); top:50%; translate:0 -50%; } .cloud.cd-right::after { right:100%; top:50%; margin-top:-7px; border-right-color:#fff; border-left:0; }
.cloud.cd-left { right:calc(100% + 10px); top:50%; translate:0 -50%; } .cloud.cd-left::after { left:100%; top:50%; margin-top:-7px; border-left-color:#fff; border-right:0; }
.cloud .su { border:1px solid rgba(0,0,0,.12); }
.cloud.out { animation:cloudout .26s ease-in forwards; }
@keyframes cloudin { from { scale:.8; opacity:0; } to { scale:1; opacity:1; } }
@keyframes cloudout { to { scale:.55; opacity:0; } }
.cloud.own { display:none; }
.centre { position:relative; }
.centre .cloud.own { left:50%; bottom:8px; top:auto; }
@media (max-width:699px) {
  .cloud { font-size:14px; padding:5px 10px; }
  .is-bidding .seat.s0 .cloud { display:none; }
  .is-bidding .centre .cloud.own { display:block; }
}
@media (prefers-reduced-motion: reduce) { .cloud, .cloud.out { animation:none; } .cloud.out { opacity:0; } }

/* bid panel details: no strikethrough, dimmed Bid button; the history strip stays visible */
.bidpanel button:disabled { text-decoration:none; }
.bidpanel #bGo:disabled { opacity:.6; }
.hb.new { animation:hbflash 1.4s ease-out; }
@keyframes hbflash { 0%, 40% { box-shadow:0 0 0 4px rgba(255,212,59,.8); } 100% { box-shadow:0 0 0 0 rgba(255,212,59,0); } }
@media (prefers-reduced-motion: reduce) { .hb.new { animation:none; } }
@media (min-width:1000px) { .bidrow { grid-area:msg; position:relative; z-index:8; } }

/* show step: my trick-1 card can be part of a combination */
.combobar { position:relative; z-index:3; }
.combobar .fcard { width:34px; height:auto; padding:0; margin:0 4px; border:2px solid transparent; border-radius:6px; background:none; cursor:pointer; flex:0 0 auto; vertical-align:middle; }
.combobar .fcard.pick { border-color:var(--accent-text,#FFD43B); outline:3px dashed var(--ink); outline-offset:1px; }
.combobar .fcard svg, .combobar .fcard img { width:100% !important; height:auto !important; display:block; position:static !important; }
.combobar .cb-list .cb-yd { flex:0 0 auto; margin:0; align-self:center; }
.combobar .fcard .pc { width:100% !important; height:auto !important; display:block; position:relative !important; margin:0 !important; transform:none !important; }
.combobar .fcard .ri { font-size:11px !important; }

/* how a hand was counted */
.bdt { width:100%; border-collapse:collapse; margin:8px 0 12px; font-size:15px; }
.bdt th, .bdt td { padding:6px 8px; text-align:left; border-bottom:1px solid var(--surface2); }
.bdt th { font-size:13px; font-weight:700; opacity:.85; }
.bdt .num { text-align:right; width:64px; }
.bdt tr.sum td { border-top:2px solid var(--ink); }
.bdt small { font-size:12px; opacity:.8; font-weight:400; }

/* lobby: live summary, tables, top players, recent matches. Phone: one column. Desktop: two columns. */
.lgrid { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.pulse { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.pulse:empty { display:none; }
.ptile { background:var(--surface); border-radius:16px; padding:14px 16px; display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; column-gap:10px; align-items:center; }
.ptile .pi { grid-row:1 / 3; width:36px; height:36px; border-radius:10px; background:var(--bg2); display:flex; align-items:center; justify-content:center; font-size:18px; color:var(--accent-text,#FFD43B); }
.ptile .pn { font-size:26px; font-weight:800; line-height:1.1; color:var(--accent-text,#FFD43B); }
.ptile .pl { font-size:13px; opacity:.85; }
#pubT .cnt { display:inline-block; min-width:28px; padding:2px 8px; margin-left:6px; border-radius:999px; background:var(--bg2); color:var(--ink); font-size:15px; text-align:center; vertical-align:middle; }
.toplist { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.toplist li { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:12px; background:var(--bg2); }
.toplist .tr { width:22px; text-align:center; font-weight:800; }
.toplist li:nth-child(-n+3) .tr { color:var(--accent-text,#FFD43B); }
.toplist .tn { flex:1; min-width:0; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.toplist .tn small { display:block; font-weight:400; font-size:12px; opacity:.8; }
.toplist .tv { font-size:18px; }
.recent { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.recent li { padding:10px 12px; border-radius:12px; background:var(--bg2); line-height:1.45; }
.recent .rs { display:block; font-size:13px; opacity:.85; margin-top:2px; }
.lmain, .lside { display:contents; }
.lobby .lgrid > .hero { order:1; } .lobby .pulse { order:2; } .lobby #pubCard { order:3; } .lobby #loginCard { order:4; }
.lobby #topCard { order:5; } .lobby #recentCard { order:6; } .lobby #faqCard { order:7; }
@media (min-width:700px) { .pulse { grid-template-columns:repeat(4, 1fr); } }
@media (min-width:1000px) {
  .lgrid { grid-template-columns:minmax(0,1.55fr) minmax(0,1fr); grid-template-areas:"hero me" "pulse pulse" "main side"; align-items:start; gap:16px; }
  .lmain, .lside { display:flex; flex-direction:column; gap:16px; min-width:0; }
  .lmain { grid-area:main; } .lside { grid-area:side; }
  .lobby .hero { grid-area:hero; } .lobby #loginCard { grid-area:me; align-self:stretch; } .lobby .pulse { grid-area:pulse; }
}

/* lobby tables: a small round table in playing order (creator at the bottom), partners across */
.ordnote { margin:0; }
.rtabs { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap:12px; }
.rtab { background:var(--bg2); border-radius:16px; padding:12px; display:flex; flex-direction:column; gap:10px; }
.rtab .pubh { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; font-size:14px; }
.rtab .rcnt { margin-left:auto; font-weight:800; background:var(--surface2); border-radius:999px; padding:2px 10px; }
.rt { position:relative; width:100%; max-width:320px; aspect-ratio:1 / 1; margin:0 auto; color:var(--ink); }
.rt .felt { position:absolute; left:14%; top:14%; width:72%; height:72%; overflow:visible; }
.rt .disc { fill:#1E5A3C; stroke:#2E6E4C; stroke-width:2; }
.rt .tm1, .rt .tm2 { stroke:var(--ink); stroke-opacity:.5; stroke-width:2.5; } .rt .tm2 { stroke-dasharray:6 6; }
.rt .ord path { fill:none; stroke:var(--ink); stroke-opacity:.7; stroke-width:1.6; }
.rt .mid { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); background:#174A31; border-radius:10px; padding:4px 8px; text-align:center; font-size:12px; line-height:1.25; color:#DDEFE4; max-width:34%; }
.rt .mid b { display:block; font-size:16px; color:var(--ink); white-space:nowrap; } .rt .mid small { display:block; font-size:11px; }
.rt .rs { position:absolute; display:flex; flex-direction:column; align-items:center; gap:2px; text-align:center; width:36%; }
.rt .rs.b { left:32%; bottom:0; } .rt .rs.t { left:32%; top:0; }
.rt .rs.l { left:0; top:50%; transform:translateY(-50%); width:27%; } .rt .rs.r { right:0; top:50%; transform:translateY(-50%); width:27%; }
.rt .ic { position:relative; }
.rt .no { position:absolute; right:-8px; bottom:-4px; min-width:20px; height:20px; border-radius:10px; background:var(--ink); color:var(--bg); font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.rt .dl { position:absolute; left:-8px; top:-4px; width:20px; height:20px; border-radius:6px; background:var(--yellow); color:#1A1A1A; font-size:11px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.rt .nm { font-size:13px; font-weight:700; max-width:100%; overflow:hidden; text-overflow:ellipsis; line-height:1.25; }
.rt .nm small { display:block; font-weight:500; font-size:11px; color:var(--muted); white-space:normal; }
.rt .plus { width:40px; height:40px; border-radius:50%; border:2px dashed var(--ink); display:flex; align-items:center; justify-content:center; font-size:24px; line-height:1; background:transparent; color:var(--ink); cursor:pointer; padding:0; font-weight:500; }
.rt .plus.ask { border-color:var(--accent-text,#FFD43B); color:var(--accent-text,#FFD43B); } .rt .plus.off { opacity:.4; cursor:default; }
.rt .plus:focus-visible { outline:3px solid var(--yellow); outline-offset:2px; }
.rt .held { width:40px; height:40px; border-radius:50%; border:2px dotted var(--muted); display:flex; align-items:center; justify-content:center; font-size:18px; color:var(--muted); }
.rfoot { text-align:center; font-size:14px; padding:6px 0; }
@media (max-width:359px) { .rt .nm { font-size:12px; } .rt .plus, .rt .held { width:36px; height:36px; } }

/* ---------- lobby, less text (2026-11-23): (i) tips, online options on demand, icon nav ---------- */
.lab { display:inline-flex; align-items:center; gap:6px; }
.tip { flex:none; width:28px; height:28px; border-radius:50%; border:2px solid var(--muted); background:none; color:var(--muted); font:italic 800 14px/1 Georgia, serif; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; padding:0; position:relative; }
.tip::before { content:""; position:absolute; inset:-8px; }   /* 44px touch target */
.tip:hover, .tip[aria-expanded="true"] { border-color:var(--accent-text,#FFD43B); color:var(--accent-text,#FFD43B); }
.tipbox { position:fixed; z-index:40; max-width:min(300px, calc(100vw - 24px)); background:var(--ink); color:var(--outline); font-size:15px; font-weight:600; line-height:1.45; padding:12px 14px; border-radius:12px; box-shadow:0 10px 28px rgba(0,0,0,.45); white-space:pre-line; }
.who-row { display:flex; align-items:center; gap:8px; }
.onlinebox { display:flex; flex-direction:column; gap:12px; padding:14px; border-radius:14px; background:var(--bg); border:2px solid var(--surface2); }
.onlinebox .seg { background:var(--bg2); }
.onlinebox .typerow .lab { flex:1; }
.ob-h { display:flex; align-items:center; justify-content:space-between; gap:8px; } .ob-h b { font-size:17px; }
.linkbtn { align-self:flex-start; background:none; border:0; padding:10px 0; min-height:44px; color:var(--muted); font-weight:700; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.linkbtn:hover { color:var(--ink); }
.navrow { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.navb { background:var(--surface2); border:0; border-radius:14px; padding:10px 12px; min-height:52px; display:flex; align-items:center; gap:10px; cursor:pointer; font-size:15px; font-weight:700; line-height:1.25; text-align:left; min-width:0; }
.navb span { min-width:0; overflow-wrap:break-word; }
.navb svg { width:22px; height:22px; flex:none; color:var(--accent-text,#FFD43B); }
.navb:hover { background:#344769; }
.install { border:2px dashed var(--yellow); padding:10px 12px; gap:8px; }
.inst-h { display:flex; align-items:center; gap:10px; } .inst-h b { flex:1; font-size:15px; line-height:1.3; }
.inst-i { width:24px; height:24px; flex:none; color:var(--accent-text,#FFD43B); }
.btn.sm { min-height:40px; padding:6px 14px; font-size:15px; box-shadow:none; }

/* bid panel: last call of each other player when the panel covers their seats (left, partner, right) */
.bidpanel .said { display:none; gap:6px; }
.bidpanel.cover .said { display:flex; }
.bidpanel .sd { flex:1 1 0; min-width:0; display:flex; align-items:baseline; justify-content:center; gap:6px; background:var(--bg); border:2px solid var(--surface2); border-radius:10px; padding:5px 8px; font-size:14px; white-space:nowrap; }
.bidpanel .sd .sn { color:var(--muted); font-weight:700; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.bidpanel .sd b { font-weight:800; flex:none; }
.bidpanel .sd.new { border-color:var(--accent-text,#FFD43B); }
.bidpanel .sd2 .sn::before { content:"\2191 "; } .bidpanel .sd1 .sn::before { content:"\2190 "; } .bidpanel .sd3 .sn::after { content:" \2192"; }
.bidpanel .said { flex:1 1 100%; }
/* short laptop screens: number picker and quick numbers on one line, so the panel (with the 'said' row) fits under the top bar */
@media (min-width:1000px) and (max-height:820px) {
  .bidpanel { flex-direction:row; flex-wrap:wrap; padding:10px 12px; gap:8px; }
  .bidpanel .said, .bidpanel .strains, .bidpanel .nerr { flex:1 1 100%; }
  .bidpanel .nchips { flex:1 1 0; } .bidpanel .acts { flex:1 1 100%; }
  .bidpanel .numpick button, .bidpanel .numpick input { min-height:46px; height:46px; }
  .bidpanel .nerr:empty { display:none; }
}

/* Declare / Show: the main button of the moment, not a grey one */
.combobar .btn.cta { min-height:52px; padding:8px 26px; font-size:18px; font-weight:800; border-radius:14px; box-shadow:0 6px 18px rgba(0,0,0,.35); }
.combobar:has(.cta) { background:none; padding:0; }
/* desktop: the bar sits on the table, lower right, close to the hand (it had no grid place and fell under the side panel) */
@media (min-width:1000px) {
  .combobar { grid-area:board; align-self:end; justify-self:end; margin:0 26px 28px 0; z-index:6; max-width:min(560px, 70%); }
  .combobar:not(:has(.cta)) { box-shadow:0 12px 36px rgba(0,0,0,.55); border:2px solid var(--surface2); padding:10px 12px; }
}
/* desktop side panel: fewer boxes (the contract line already shows the trump) */
@media (min-width:1000px) {
  #iTrump { display:none !important; }
  #iContract { cursor:pointer; }
}
.sheettg { display:flex; width:100%; justify-content:space-between; align-items:center; background:none; border:0; font:inherit; font-weight:800; color:var(--accent-text,#FFD43B); cursor:pointer; padding:0; min-height:32px; text-align:left; }
.sheettg[aria-expanded="false"] { margin-bottom:0; }
.cbub.hi { background:var(--yellow); color:var(--outline); border-color:var(--accent-text,#FFD43B); }
/* own yellow cards in the lobby */
.cardnote summary { cursor:pointer; font-weight:800; display:flex; align-items:center; gap:10px; min-height:36px; }
.cardnote .yc { display:inline-block; width:16px; height:22px; border-radius:3px; background:var(--yellow); transform:rotate(-8deg); flex:none; }
.cardnote ul { margin:6px 0; padding-left:22px; }

/* ---- themes (Calm Navy dark / Polar light), 2026-11-23: calmer surfaces, clear states ---- */
.card { box-shadow:var(--shadow); border:1px solid var(--line); }
.card h1 { font-weight:700; } .card h2 { font-weight:700; }
.btn { box-shadow:none; font-weight:700; }
.overlay .card { background:var(--panel); box-shadow:var(--shadow-pop); }
.mt-bar { background:var(--sunk); border-color:var(--line); }
.seat .ring .rt { stroke:var(--line); }
.seat.turn { border-color:var(--pri-bg); }
/* a main button that cannot be pressed yet: empty, dashed, not a dim fill */
.bidpanel .acts button.go:disabled { background:transparent; color:var(--dim); border:2px dashed var(--line-strong); opacity:1; text-decoration:none; }
/* the table: a quiet felt surface (light theme), unchanged navy in the dark theme */
.board { background:var(--felt); border-radius:18px; }
@media (min-width:1000px) { .board { background:var(--felt-desk); } }
.seat.turn { background:var(--raised); }
.sheettg { color:var(--ink); }
.btn.alt { background:var(--panel); border:1px solid var(--line-strong); }
