/* Argent suit symbol: one glyph (U+E000), a flat silver "split kite" shield (peaked top, full sides).
   Source paths and font builder: brand/argent-suit/ (shapes.py, build_font.py). */
@font-face { font-family: ArgentSuit; src: url(data:font/woff;base64,d09GRgABAAAAAAKMAAoAAAAAArQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABZAAAAC0AAABgJOA0vGNtYXAAAAGcAAAAKgAAADQADOBTZ2x5ZgAAAdAAAABMAAAATEgEpsZoZWFkAAAA9AAAADYAAAA2MGohGmhoZWEAAAEsAAAAHQAAACQGkgJkaG10eAAAAZQAAAAGAAAABgN6AABsb2NhAAAByAAAAAYAAAAGACYAAG1heHAAAAFMAAAAFgAAACAABAAWbmFtZQAAAhwAAABYAAAAaeMjaiBwb3N0AAACdAAAABcAAAAtzW9r3wABAAAAAQAA9U8xW18PPPUAAQPoAAAAAOcabskAAAAA5xpuyQAy/6YC7gMCAAAAAwACAAAAAAAAeJxjYGRgYFb4bwEiGaIYuJjFGIAiKIARADcHAf4AAAB4nGNgZGBgYGIQYQDRIBYaAAACogAbAAB4nGNgZlZgnMDAysDCQAQQQGLbAwEDwwMgZFb4b8EAJBlOoClXYGAAANdWBfIAAAADIAAAAFoAAHicY2BgYGJgYGAGYhEgyQimWRgUgDQLEAL5Dxj+/4eQCoxgeQYAWYoGPQAAAAAAAAAmAAAAAQAy/6YC7gMCABMAABM2NjcWFhcWAgcOAgcuAicmAkNiqENEqGERLUQnWVEcHFFYKEQtArcPJhYWJg+//uJiN003Fxc3TTdiAR4AeJwtiEEKgCAURJ8mRC2CoCt0hfZeQU/gQkQQF6L37xvNYua9AQwPihnF/vWMZhVbUGaT5+L8WXNw25Zi7X7k7mIaJTQsjUSk0vEMsqwTT8KFQHsB1bkOiHicY2BiwA+A8oxMbMUZmak5KQAJqQKHAA==) format('woff'); unicode-range: U+E000; }
/* ---------- Themes ---------- */
:root, [data-theme="felt"] {
  --bg: #0d1f17; --bg2: #12291f; --panel: #173326; --panel2: #1e3f30; --line: #2b5442;
  --text: #f2f5ef; --muted: #a9bdb2; --accent: #f5c542; --accent-text: #1b1300;
  --felt: #1d6b45; --felt2: #0f4a2e; --rail: #5b3a1e; --cardback: #b91c1c; --cardback2: #7f1d1d;
  --danger: #ef4444; --shadow: 0 8px 24px rgba(0,0,0,.35);
}
[data-theme="midnight"] {
  --bg: #0b0f1a; --bg2: #111827; --panel: #161e2e; --panel2: #1f2a3f; --line: #2c3a55;
  --text: #e8ecf5; --muted: #9aa6bf; --accent: #60a5fa; --accent-text: #06122a;
  --felt: #1e3a5f; --felt2: #0f2240; --rail: #334155; --cardback: #4338ca; --cardback2: #312e81;
}
[data-theme="royal"] {
  --bg: #1d0a0f; --bg2: #2a0f17; --panel: #3a1420; --panel2: #4a1a29; --line: #6b2a3c;
  --text: #fbefe9; --muted: #d6b4b0; --accent: #e9b949; --accent-text: #2a1600;
  --felt: #6d1a2b; --felt2: #45101b; --rail: #8a6a2a; --cardback: #1e3a8a; --cardback2: #172554;
}
[data-theme="daylight"] {
  --bg: #f4f1ea; --bg2: #ebe6db; --panel: #ffffff; --panel2: #f6f3ec; --line: #ddd5c4;
  --text: #1f2421; --muted: #5f6b64; --accent: #0f766e; --accent-text: #ffffff;
  --felt: #2f8f5b; --felt2: #1f6b42; --rail: #8b5e34; --cardback: #0f766e; --cardback2: #115e59;
  --shadow: 0 6px 18px rgba(60,40,10,.12);
}
[data-theme="festive"] {
  --bg: #1a0b2e; --bg2: #24103f; --panel: #2e1650; --panel2: #3b1d66; --line: #56308c;
  --text: #fff6e6; --muted: #d9c3f0; --accent: #ff9f1c; --accent-text: #2a1300;
  --felt: #6b21a8; --felt2: #3b0764; --rail: #c2410c; --cardback: #ea580c; --cardback2: #9a3412;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 ArgentSuit, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.red { color: #d42a2a; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: transform .08s, filter .15s;
}
.btn:hover:not([disabled]) { filter: brightness(1.12); }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.big { padding: 12px 22px; font-size: 16px; }
.btn.suit-red { color: #f87171; font-size: 17px; }
.btn.suit-black { font-size: 17px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 19px; }
.logo { width: 34px; height: 34px; border-radius: 8px; display: block; flex: none; }
#splash { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 50% 38%, #23855a, #0b2a1c 75%); color: #f2f5ef; transition: opacity .4s; }
#splash img { width: 132px; height: 132px; margin-bottom: 10px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.4)); }
#splash b { font-size: 34px; font-weight: 800; letter-spacing: .5px; }
#splash small { color: #f5c542; letter-spacing: 5px; font-size: 13px; }
#splash.gone { opacity: 0; pointer-events: none; }
.tb-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip-pill {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer;
}
.chip-pill .bonus { font-size: 11px; color: var(--muted); }
.chip-pill .claim { color: var(--accent); font-weight: 700; }
.theme-pick select, .opts select, .opts input, .seat-row input, #search, .join input, .modal input, .modal textarea, .modal select, .pd-form input, .pd-form textarea, .pd-form select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font: inherit;
}

main { max-width: 1240px; margin: 0 auto; padding: 16px 16px 60px; }

/* ---------- Home ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px; border-radius: 18px; margin-bottom: 16px;
  background: radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%), linear-gradient(135deg, var(--felt), var(--felt2));
  box-shadow: var(--shadow); color: #fff;
}
.hero h1 { font-size: clamp(22px, 4vw, 34px); }
.hero p { margin: 0; max-width: 680px; opacity: .92; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
#search { flex: 1 1 220px; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: var(--panel); color: var(--muted); border: 0; padding: 8px 12px; font: inherit; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.seg.sm button { padding: 6px 10px; font-size: 13px; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.pill.on { background: var(--c, var(--accent)); color: #fff; border-color: transparent; }
.pill.on i { background: #fff; }
.pill[data-filter="all"].on, .pill[data-filter="playable"].on { color: var(--accent-text); }

.cat { margin: 22px 0 6px; }
.cat h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.cat h2 i { width: 6px; height: 22px; border-radius: 3px; background: var(--c); }
.cat h2 span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel); border-radius: 999px; padding: 2px 8px; }
.empty { color: var(--muted); }
.empty.sm { font-size: 13px; margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  border-top: 4px solid var(--c); transition: transform .12s, box-shadow .12s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-art {
  display: flex; align-items: center; justify-content: center; height: 72px; font-size: 34px; color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, #000));
}
.tile-art.big { width: 96px; height: 96px; border-radius: 20px; font-size: 48px; flex: none; }
.tile-body { padding: 10px 12px 4px; flex: 1; }
.tile-name { font-weight: 700; }
.tile-meta { font-size: 12px; color: var(--muted); }
.tile-desc { font-size: 13px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-tags { padding: 6px 12px 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag.play { background: color-mix(in srgb, var(--c, var(--accent)) 25%, transparent); color: var(--text); border: 1px solid var(--c, var(--accent)); }
.tag.soon { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.fav {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.35); color: rgba(255,255,255,.75); font-size: 17px; cursor: pointer;
}
.fav.on { color: #fbbf24; background: rgba(0,0,0,.55); }
.fav:hover { color: #fde68a; }

/* list layout */
.layout-list .tiles { grid-template-columns: 1fr; gap: 8px; }
.layout-list .tile { flex-direction: row; align-items: center; border-top-width: 1px; border-left: 5px solid var(--c); }
.layout-list .tile-art { width: 64px; height: 64px; flex: none; font-size: 28px; }
.layout-list .tile-desc { -webkit-line-clamp: 1; }
.layout-list .tile-tags { padding: 0 52px 0 8px; }
.layout-list .fav { top: 50%; transform: translateY(-50%); }
/* compact layout */
.layout-compact .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.layout-compact .tile-art { height: 44px; font-size: 22px; }
.layout-compact .tile-desc, .layout-compact .tile-meta { display: none; }
.layout-compact .tile-body { padding: 8px 10px 2px; font-size: 14px; padding-right: 30px; }
.layout-compact .tile-tags { padding: 4px 10px 10px; }
.layout-compact .fav { top: 50px; right: 4px; width: 26px; height: 26px; font-size: 14px; background: transparent; color: var(--muted); }
.layout-compact .fav.on { color: #fbbf24; }
/* shelves layout */
.layout-shelf .tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.layout-shelf .tile { flex: 0 0 210px; scroll-snap-align: start; }

.about { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; margin-bottom: 14px; font-size: 14px; }
.about summary { cursor: pointer; font-weight: 700; }
.about-cat b { color: var(--c); }
.brand-sub { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 4px; }

/* ---------- Game page ---------- */
.gpage { max-width: 900px; margin: 0 auto; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 12px; }
.ghero { position: relative; display: flex; gap: 18px; align-items: center; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--c); }
.ghero h1 { font-size: clamp(24px, 4vw, 32px); }
.ghero p { margin: 0 0 6px; color: var(--muted); }
.ghero-text { padding-right: 36px; }
.cat-chip { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); padding: 2px 10px; border-radius: 999px; margin-bottom: 6px; }
.meta { font-size: 13px; color: var(--muted); }
.gactions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.rules { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.rules ul { padding-left: 18px; margin: 0; }
.rules li { margin: 8px 0; }
.rules li b { color: var(--c); }
.rules li b::after { content: ":"; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.fld input { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; font-size: 16px; }
.modal .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fine { font-size: 12.5px; color: var(--muted); }

/* setup */
.setup h3 { margin-top: 20px; font-size: 15px; }
.modes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
  padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font: inherit;
}
.mode.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--panel)); }
.mode .mi { font-size: 24px; }
.mode small { color: var(--muted); }
.counter { display: flex; align-items: center; gap: 12px; }
.counter b { font-size: 20px; min-width: 24px; text-align: center; }
.seat-list { display: grid; gap: 8px; }
.seat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.seat-row input { flex: 1 1 140px; min-width: 0; }
.seat-no { width: 64px; font-size: 13px; color: var(--muted); font-weight: 700; }
.seat-row.team-a { border-left: 4px solid #38bdf8; }
.seat-row.team-b { border-left: 4px solid #fb7185; }
.opts label.tick { flex-direction: row; align-items: center; gap: 8px; align-self: flex-end; padding-bottom: 8px; color: var(--text); cursor: pointer; }
.opts label.tick input { width: 18px; height: 18px; padding: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.opts label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

/* online placeholder */
.lobby { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 12px 0; }
.lobby-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; opacity: .8; }
.join { display: flex; gap: 8px; margin-top: 10px; }
.join input { flex: 1; min-width: 0; }
.notice { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 1px solid var(--accent); border-radius: 16px; padding: 16px 20px; }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(440px, 100%); box-shadow: var(--shadow); }
.modal form { display: grid; gap: 12px; }
.modal .btns { justify-content: flex-start; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.stats div { background: var(--panel2); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; }
.stats span { font-size: 11px; color: var(--muted); }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 60;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px;
  box-shadow: var(--shadow); transition: .25s; pointer-events: none; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Roulette */
.rl { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rl-n { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 14px; color: #fff; padding: 0 4px; }
.rl-ball .rl-n { min-width: 64px; height: 64px; font-size: 28px; box-shadow: 0 0 0 4px rgba(255,255,255,.35); }
.rl-red { background: #C62828; } .rl-black { background: #20242b; } .rl-green { background: #1b8a4a; }
.rl-hist { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.btn.rl-btn { color: #fff; min-width: 46px; } .btn.rl-btn.rl-red { background: #C62828; } .btn.rl-btn.rl-black { background: #20242b; } .btn.rl-btn.rl-green { background: #1b8a4a; }
.vp-pay { display: grid; grid-template-columns: repeat(2, auto); gap: 2px 16px; font-size: 12px; background: rgba(0,0,0,.35); padding: 8px 12px; border-radius: 10px; }
.vp-pay b { grid-column: 1 / -1; }

/* ---------- Cards ---------- */
.card {
  --w: 62px; position: relative; flex: none; width: var(--w); height: calc(var(--w) * 1.4);
  background: #fff; color: #2F3640; border-radius: 7px; border: 1px solid #d4d4d4;
  box-shadow: 0 2px 5px rgba(0,0,0,.3); user-select: none;
}
.card.red { color: #C62828; }
.card.silver, .silver { color: #939EAE; }
.card .cr.cb { top: auto; left: auto; bottom: 3px; right: 5px; transform: rotate(180deg); }
.card.sm .cr.cb { display: none; }
.card .cr { position: absolute; top: 3px; left: 5px; font-weight: 800; font-size: calc(var(--w) * .27); line-height: 1; display: flex; flex-direction: column; align-items: center; }
.card .cr i { font-style: normal; font-size: .8em; }
.card .cc { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--w) * .55); padding-top: 10%; padding-left: 12%; }
.card.sm { --w: 30px; border-radius: 4px; }
.card.sm .cr { top: 1px; left: 2px; }
.card.sm .cc { font-size: calc(var(--w) * .5); padding: 30% 0 0 25%; }
.card.back {
  background: repeating-linear-gradient(45deg, var(--cardback) 0 5px, var(--cardback2) 5px 10px);
  border: 3px solid #fff;
}
.card.empty { background: transparent; border: 2px dashed rgba(255,255,255,.35); box-shadow: none; }
.card.wild { box-shadow: 0 0 0 2px #facc15, 0 0 12px #facc15; }
.card.playable { cursor: pointer; transition: transform .12s; }
.card.playable:hover, .card.playable:focus { transform: translateY(-12px); }
.card.dim { filter: brightness(.6) saturate(.6); }

/* ---------- Table ---------- */
body[data-page="play"] main, body[data-page="demo"] main { max-width: 1100px; padding-top: 8px; }
.table-wrap { position: relative; }
.table-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tb-title { font-weight: 800; font-size: 17px; }
.tb-info { flex: 1; color: var(--muted); font-size: 13px; text-align: right; }
.felt {
  position: relative; height: clamp(340px, 56vh, 540px); border-radius: 48% / 42%;
  background: radial-gradient(ellipse at center, var(--felt), var(--felt2));
  border: 12px solid var(--rail); box-shadow: inset 0 0 40px rgba(0,0,0,.45), var(--shadow);
  color: #fff;
}
.seat {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  min-width: 96px; max-width: 150px; text-align: center; padding: 5px 8px; border-radius: 12px;
  background: rgba(0,0,0,.55); border: 2px solid transparent; font-size: 12.5px; line-height: 1.3;
}
.seat-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-sub { color: #d6e2da; font-size: 11.5px; }
.seat-sub em { color: #fde68a; font-style: normal; }
.seat-cards { display: flex; justify-content: center; gap: 2px; margin-top: 3px; }
.seat.active { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.seat.folded { opacity: .5; }
.seat.done { opacity: .7; border-color: #22c55e; }
.seat.won { border-color: #22c55e; }
.seat.team-a { background: rgba(8, 47, 73, .78); }
.seat.team-b { background: rgba(76, 5, 25, .72); }
.badge { display: inline-block; background: var(--accent); color: var(--accent-text); border-radius: 6px; padding: 0 5px; font-size: 10px; font-weight: 800; vertical-align: 1px; }
.mini-stack { display: flex; align-items: center; gap: 4px; }
.mini-stack b { font-size: 12px; }
.mini-fan { display: flex; flex-wrap: wrap; justify-content: center; max-width: 140px; }
.mini-fan .card { margin: 0 -6px 2px 0; }
.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; pointer-events: none; }
.center .tcard { position: absolute; transform: translate(-50%, -50%); animation: drop .2s ease-out; }
.center .tcard.still { animation: none; }
@keyframes drop { from { transform: translate(-50%, -70%) scale(.9); opacity: 0; } }
.center-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 10px; font-size: 13px; max-width: 60%; }
.center-note:empty { display: none; }
.pot { font-size: 20px; }
.joker { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.scorebox { position: absolute; left: 12px; top: 10px; font-size: 11.5px; text-align: left; background: rgba(0,0,0,.35); border-radius: 8px; padding: 4px 8px; }
.scorebox .team-a { color: #7dd3fc; }
.scorebox .team-b { color: #fda4af; }
.ab { display: flex; gap: 22px; align-items: flex-end; }
.ab-pile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 12px; }
.ab-pile.win { background: rgba(250, 204, 21, .25); box-shadow: 0 0 0 2px #facc15; }
.ab-pile .muted { color: #d6e2da; font-size: 12px; }
.ab-label { font-weight: 800; }
.status { min-height: 26px; text-align: center; margin: 10px 0 4px; font-size: 15px; }
.actions { min-height: 10px; margin: 6px 0; }
.actions .prompt { text-align: center; margin-bottom: 8px; color: var(--muted); }
.hand { display: flex; flex-direction: column; align-items: center; min-height: 20px; padding: 8px 0 4px; }
.fan { display: flex; justify-content: center; flex-wrap: wrap; padding-top: 14px; row-gap: 8px; }
.fan .card + .card { margin-left: -16px; }
.hand-label { margin-top: 6px; font-weight: 700; color: var(--accent); }
.log { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.log summary { cursor: pointer; color: var(--muted); }
.log-body { max-height: 180px; overflow: auto; margin-top: 6px; }
.log-body div { padding: 2px 0; border-bottom: 1px solid var(--line); }
.overlay { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.overlay.show { display: flex; }
.ov-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px; text-align: center; width: min(420px, 100%); box-shadow: var(--shadow); }
.ov-icon { font-size: 44px; }
.chip-win { color: var(--accent); font-weight: 800; font-size: 18px; }

/* ---------- Hukum Saajha ---------- */
.hk-info { position: absolute; right: 12px; top: 10px; text-align: right; font-size: 12px; background: rgba(0,0,0,.4); border-radius: 10px; padding: 6px 10px; line-height: 1.5; }
.big-suit { font-size: 18px; }
.red-on-dark { color: #fca5a5; }
.hk-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; background: color-mix(in srgb, var(--accent) 15%, var(--panel)); border: 1px solid var(--accent); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.hk-actions { align-items: center; }
.hk-actions .prompt { flex-basis: 100%; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper input { width: 78px; text-align: center; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px; font: inherit; font-weight: 700; }
.choose-panel { display: grid; gap: 10px; justify-items: center; width: 100%; }
.call-grid { display: grid; gap: 4px; }
.call-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.call { min-width: 40px; padding: 6px 4px; border-radius: 6px; border: 1px solid #c9c2b2; background: #fffdf8; color: #1c1c1c; font: inherit; font-weight: 700; cursor: pointer; }
.call.red { color: #d42a2a; }
.call.own { opacity: .3; cursor: not-allowed; text-decoration: line-through; }
.call.sel { outline: 3px solid var(--accent); transform: translateY(-2px); }
.summary { width: 100%; }
.summary table { margin: 0 auto; border-collapse: collapse; font-size: 14px; }
.summary th, .summary td { padding: 4px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.summary tr.won td { color: #86efac; background: rgba(22,163,74,.16); }
.summary tr.lost td { color: #fca5a5; background: rgba(220,38,38,.14); }
.countdown { display: inline-block; margin-left: 8px; font-weight: 800; color: var(--accent); }
.countdown.urgent { color: var(--danger); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { opacity: .4; } }
.err { color: var(--danger); }
.chat { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.chat-log { max-height: 160px; overflow: auto; font-size: 13.5px; margin-bottom: 6px; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
.room-code { font-family: ui-monospace, monospace; letter-spacing: 3px; color: var(--accent); }
.seat-row .grow { flex: 1; }
.lobby-card input, .lobby-card select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
.lobby-card summary { cursor: pointer; font-weight: 700; }
details.lobby-card { opacity: 1; margin-top: 12px; }
.lobby-card { opacity: 1; }

@media (max-width: 640px) {
  .hk-info { right: -6px; top: -8px; font-size: 10.5px; padding: 4px 7px; line-height: 1.35; max-width: 42%; }
  .call { min-width: 30px; padding: 5px 2px; font-size: 12px; }
}

@media (max-width: 640px) {
  main { padding: 12px 16px 50px; }
  .brand span:last-child { display: none; }
  .ghero { flex-direction: column; align-items: flex-start; }
  .card { --w: 46px; }
  .fan .card + .card { margin-left: -20px; }
  .seat { min-width: 70px; max-width: 104px; font-size: 11px; padding: 3px 5px; }
  .seat-sub { font-size: 10px; }
  .felt { border-width: 8px; height: clamp(280px, 44vh, 420px); }
  .topbar { padding: 8px 12px; }
  .theme-pick select { max-width: 104px; padding: 6px; font-size: 13px; }
  .chip-pill { padding: 3px 10px; }
  .tb-right .btn.sm { padding: 6px 8px; }
  .user-name { display: none; }
  .tb-title { font-size: 15px; }
  .card.sm { --w: 22px; }
  .scorebox { display: none; }
  .tb-info { flex-basis: 100%; text-align: left; order: 5; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .seg button { padding: 7px 8px; font-size: 13px; }
}

/* Satte Pe Satta board */
.sv-board { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; margin: 0 auto; max-width: 96%; }
.sv-row { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.sv-suit { font-size: 20px; width: 22px; text-align: center; }
.sv-cards { display: flex; flex-wrap: nowrap; }
.sv-cards .card { margin-right: -14px; }
.sv-note.center-note { position: static; transform: none; margin: 6px auto 0; display: inline-block; max-width: 90%; }

/* Seep floor */
.seep-floor { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 96%; margin: 0 auto; }
.seep-houses { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.house { background: rgba(255,255,255,.08); border: 1px dashed rgba(255,255,255,.4); border-radius: 8px; padding: 3px 5px; text-align: center; }
.house.cemented { border-style: solid; border-color: #fcd34d; }
.seep-call { margin: 6px auto; padding: 6px 12px; max-width: 92%; border-radius: 10px; background: #16a34a; color: #fff; font-weight: 700; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); position: relative; z-index: 5; }
.seep-callbar { pointer-events: auto; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 6px auto; max-width: 96%; position: relative; z-index: 6; }
.seep-callbar .muted { width: 100%; text-align: center; font-size: 12px; }
.seep-callout { background: #15803d; color: #fff; border-color: #22c55e; }
.house-v { font-weight: 700; font-size: 13px; }
.house-cards { display: flex; }
.house-cards .card { margin-right: -16px; }
.house-cards .card:last-child { margin-right: 0; }
.house-o { font-size: 10.5px; opacity: .8; }
.seep-loose { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 40px; }
@media (max-width: 600px) { .sv-cards .card { margin-right: -20px; } .sv-row { min-height: 32px; } }

/* Jokers and rummy */
.card.joker-card { color: #7c3aed; }
.rm-groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; }
.rm-group { display: flex; flex-direction: column; align-items: center; }
.rm-group .fan { padding: 0; }
.rm-tag { font-size: 11px; margin-top: 2px; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,.12); }
.rm-tag.pure { background: #15803d; color: #fff; }
.rm-tag.seq { background: #0e7490; color: #fff; }
.rm-tag.set { background: #7c3aed; color: #fff; }
.rm-tag.dead { background: rgba(239,68,68,.3); }
.rm-center { display: flex; gap: 18px; align-items: flex-end; }
.rm-pile { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; }
.chit { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 64px; border-radius: 8px; background: #fef3c7; color: #3b2a06; font-size: 11px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.chit span { font-size: 20px; line-height: 1.1; }
.chit small { opacity: .7; }
.chit.back { background: repeating-linear-gradient(45deg, #b91c1c 0 6px, #991b1b 6px 12px); color: #fff; font-size: 22px; font-weight: 800; }
.chit-chor { background: #fecaca; }
.chit-raja { background: #fde68a; }
.chit-big { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chit-big .chit { transform: scale(1.5); margin: 18px; }

/* Solitaires */
.felt.sol { height: auto; min-height: 420px; border-radius: 18px; border-width: 8px; padding: 10px 8px 16px;
  --sw: min(62px, calc((min(100vw, 1100px) - 70px) / var(--cols) - 5px)); }
.sol .center { position: static; pointer-events: auto; display: block; }
.sol .card { --w: var(--sw); }
.sol .card .cr { font-size: calc(var(--w) * .3); }
.sol-top { display: flex; gap: 5px; margin-bottom: 10px; align-items: flex-start; }
.sol-top > div { position: relative; cursor: pointer; }
.sol-center { justify-content: center; margin-top: 12px; }
.sol-gap { flex: 1; }
.sol-waste { display: flex; }
.sol-waste > div + div { margin-left: calc(var(--sw) * -0.7); }
.sol-tab { display: flex; gap: 5px; align-items: flex-start; }
.sol-col { width: var(--sw); flex: none; display: flex; flex-direction: column; cursor: pointer; }
.sol-slot + .sol-slot { margin-top: calc(var(--sw) * -1.05); }
.sol-slot.down + .sol-slot { margin-top: calc(var(--sw) * -1.22); }
.sol-slot.down + .sol-slot.up { margin-top: calc(var(--sw) * -1.22); }
.sol-slot.up { cursor: pointer; }
.sol-lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.5); font-size: calc(var(--sw) * .32); }
.sol-lbl2 { position: absolute; bottom: 2px; right: 4px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.sol-done { font-size: 28px; letter-spacing: -6px; }
.sol-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.card.glow { box-shadow: 0 0 0 2px #4ade80, 0 0 10px #4ade80; }
.card.sel { box-shadow: 0 0 0 3px #facc15, 0 0 12px #facc15; transform: translateY(-4px); }
.hinted .card, .card.hinted { box-shadow: 0 0 0 3px #38bdf8, 0 0 14px #38bdf8; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pyr { display: flex; flex-direction: column; align-items: center; }
.pyr-row { display: flex; gap: 4px; }
.pyr-row + .pyr-row { margin-top: calc(var(--sw) * -0.75); }
.pyr-row > div { cursor: pointer; }
.pyr-gap { width: var(--sw); height: calc(var(--sw) * 1.4); }
@media (max-width: 640px) { .felt.sol { --sw: calc((100vw - 64px) / var(--cols) - 4px); padding: 8px 4px 12px; } .sol-tab, .sol-top { gap: 3px; } }
.dk-pairs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 70%; }
.dk-pair { position: relative; }
.dk-def { position: absolute; left: 12px; top: 14px; }
.dk-stack { display: flex; align-items: center; }
.dk-stack .card.sm { transform: rotate(90deg); margin-right: -8px; }
.hk-tally-card { max-width: 560px; width: 94%; }
.hk-tally-card table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 14px; }
.hk-tally-card th, .hk-tally-card td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.12); text-align: left; }
.hk-hist { max-height: 40vh; overflow: auto; }
.icon-btn { font-size: 16px; padding: 6px 9px; }
.fb-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.fb-type { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.fb-type:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.fb-type span { display: flex; flex-direction: column; }
.fb-type small { color: var(--muted); font-size: 12px; }
.fb-label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 13px; color: var(--muted); }
.fb-label textarea, .fb-label select { width: 100%; box-sizing: border-box; }

/* ---------- Profile ---------- */
.pd { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.pd-banner { position: relative; height: 150px; border-radius: 24px; margin-bottom: 44px; box-shadow: 0 14px 30px color-mix(in srgb, var(--pd) 35%, transparent); }
.pd-banner::before { content: ""; position: absolute; inset: 0; border-radius: 24px; background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.28), transparent 45%); }
.pd-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.pd-blob.b1 { width: 120px; height: 120px; right: 0; top: -20px; } .pd-blob.b2 { width: 70px; height: 70px; left: 40%; bottom: 14px; }
.pd-mini { position: absolute; width: 44px; height: 62px; border-radius: 8px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 30px; }
.pd-mini.m1 { right: 30px; bottom: 22px; transform: rotate(-12deg); } .pd-mini.m2 { right: 78px; bottom: 34px; transform: rotate(8deg); background: rgba(255,255,255,.12); }
.pd-photo { position: absolute; left: 20px; bottom: -44px; width: 104px; height: 104px; border-radius: 50%; background: linear-gradient(135deg, var(--pd), var(--pd2)); border: 5px solid var(--bg); display: grid; place-items: center; color: #fff; font: 800 34px system-ui, sans-serif; cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.pd-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.pd-cam { position: absolute; right: -2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 15px; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.pd-id { padding: 0 4px; } .pd-name { font-weight: 800; font-size: 24px; } .pd-role { color: var(--pd2); font-weight: 700; margin-top: 2px; } .pd-bio { color: var(--muted); margin-top: 6px; font-size: 14px; }
.pd-actions { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--pd) 30%, var(--panel)), color-mix(in srgb, var(--pd2) 30%, var(--panel))); }
.pd-act { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--panel); color: var(--text); font-size: 18px; text-decoration: none; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.pd-h { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 17px; margin: 6px 0 0; }
.pd-h::before, .pd-h::after { content: ""; flex: 1; max-width: 70px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--pd2)); }
.pd-h::after { background: linear-gradient(90deg, var(--pd2), transparent); }
.pd-tiles, .pd-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pd-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; }
.pd-tile b { font-size: 22px; } .pd-tile small { color: var(--muted); font-size: 12px; }
.small { font-size: 12.5px; } .txt-c { text-align: center; }
.pd-row { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 10px; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.pd-row .grow { display: flex; flex-direction: column; min-width: 0; } .pd-row .grow span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pd-ic { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, var(--pd), var(--pd2)); }
.pd-carousel, .pd-themes { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
.pd-game { flex: none; width: 104px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px; padding: 10px 8px; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 13px; }
.pd-game span { font-size: 26px; }
.pd-list { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pd-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.pd-item:first-child { border-top: 0; }
.pd-item select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font: inherit; font-weight: 700; }
.pd-sw { flex: none; width: 92px; height: 58px; border-radius: 16px; border: 3px solid transparent; color: #fff; font: 700 12px system-ui, sans-serif; display: flex; align-items: flex-end; padding: 6px 8px; cursor: pointer; }
.pd-sw[aria-pressed="true"] { border-color: var(--text); }
.pd-edit { text-align: center; }
.pd-form { max-width: 560px; }
.pd-form h3 { margin-top: 18px; }
.pd-form input { width: 100%; }
.pd-photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pd-photo.sm { position: static; width: 72px; height: 72px; font-size: 24px; border-width: 3px; --pd: var(--accent); --pd2: var(--felt); }
.tb-me { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.tb-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ---------- Mobile tidy-up: one-line top bar, smaller hero, layout in profile ---------- */
@media (max-width: 640px) {
  .tb-right { flex-wrap: nowrap; gap: 6px; }
  .brand-sub, .theme-pick { display: none; }
  .chip-pill { flex-direction: row; gap: 6px; align-items: center; }
  .chip-pill .bonus { display: none; }
  .chip-pill .bonus:has(.claim) { display: inline; }
  .hero { padding: 14px 16px; margin-bottom: 10px; }
  .hero h1 { font-size: 20px; margin-bottom: 4px; }
  .hero p { font-size: 13px; }
  .toolbar .seg { display: none; }
  .toolbar #search { flex: 1; }
  .filters { flex-wrap: nowrap; }
  .pill { white-space: nowrap; flex: none; }
  .about { font-size: 13px; padding: 8px 12px; }
}
@media (max-width: 640px) {
  .layout-grid .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .layout-grid .tile-art { height: 52px; font-size: 26px; }
  .layout-grid .tile-body { padding: 8px 10px 2px; padding-right: 8px; }
  .layout-grid .tile-name { font-size: 14px; padding-right: 26px; }
  .layout-grid .tile-desc { display: none; }
  .layout-grid .tile-tags { padding: 4px 10px 10px; }
  .layout-grid .fav { top: 4px; right: 4px; transform: scale(.85); }
}

/* ---------- Invite friends ---------- */
.hero-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.iv-code-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--accent)); border-radius: 16px; padding: 16px; text-align: center; margin: 12px 0; }
.iv-code { font: 800 clamp(34px, 9vw, 52px)/1.1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .18em; color: var(--accent); margin: 4px 0 12px; user-select: all; }
.iv-code-card .btns { justify-content: center; }
.iv-seats { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.iv-seat { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.iv-err { background: color-mix(in srgb, var(--danger) 18%, var(--panel)); border: 1px solid var(--danger); border-radius: 12px; padding: 10px 12px; }
.iv-form { max-width: 420px; }
.iv-form input { width: 100%; }
.iv-form #jCode { text-transform: uppercase; letter-spacing: .15em; font-weight: 800; font-size: 20px; }
.iv-form input, .join-page input { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
.card.picked { transform: translateY(-14px); outline: 3px solid var(--accent); }
.hand .card.up { box-shadow: 0 0 0 2px var(--accent); }
.br-trump { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: #d6e2da; }

/* ---------- Colour Clash ---------- */
.card.cc { color: #fff; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; position: relative; }
.card.cc .cc-corner { position: absolute; left: 4px; top: 2px; font-size: calc(var(--w) * .26); font-weight: 800; line-height: 1; }
.card.cc .cc-mid { font-size: calc(var(--w) * .5); font-weight: 900; background: rgba(255,255,255,.92); border-radius: 30% 6px; width: 70%; aspect-ratio: 1; display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
.cc-r { background: #dc2626 !important; } .cc-r .cc-mid { color: #dc2626; }
.cc-a { background: #f59e0b !important; } .cc-a .cc-mid { color: #b45309; }
.cc-j { background: #16a34a !important; } .cc-j .cc-mid { color: #15803d; }
.cc-s { background: #2563eb !important; } .cc-s .cc-mid { color: #1d4ed8; }
.cc-wild { background: conic-gradient(#dc2626 0 25%, #f59e0b 0 50%, #16a34a 0 75%, #2563eb 0) !important; } .cc-wild .cc-mid { color: #111; }
.card.sm.cc .cc-mid { font-size: calc(var(--w) * .45); }
.cc-back { background: repeating-linear-gradient(135deg, #111 0 6px, #333 6px 12px) !important; }
.cc-now { padding: 1px 8px; border-radius: 8px; color: #fff; font-weight: 700; }
.btn.cc-btn { color: #fff; border-color: transparent; }

/* ---------- Chuppa Rustam: info box, round history ---------- */
.hk-info { z-index: 3; background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.14); pointer-events: none; }
.hk-scores { pointer-events: auto; display: block; margin: 4px 0 0 auto; font: inherit; font-size: 11px; font-weight: 700; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 2px 8px; cursor: pointer; }
.hk-two span { display: block; }
@media (max-width: 600px) { .hk-two span { display: inline; } .hk-two span + span::before { content: ' · '; } .hk-scores span { display: none; } .hk-scores { font-size: 10px; padding: 1px 7px; margin-top: 2px; } }
.hk-info-min { background: none; border: 0; padding: 0; }
.hk-info-min .hk-scores { margin: 0; background: rgba(0,0,0,.62); padding: 4px 9px; }
.hk-deck { position: absolute; left: 12px; top: 10px; z-index: 3; max-width: 46%; font-size: 11.5px; line-height: 1.35; background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 5px 9px; pointer-events: none; }
.btn.suit-silver { color: #c3cbd6; font-size: 17px; }
.call.silver { color: #7d8898; }
@media (max-width: 600px) { .hk-deck { left: -6px; top: -8px; font-size: 10px; padding: 3px 6px; max-width: 33%; } }
.hk-rounds-list { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; text-align: left; }
.hk-round { border: 1px solid var(--line); border-left: 5px solid #16a34a; border-radius: 12px; padding: 8px 10px; background: var(--panel2); }
.hk-round.failed { border-left-color: #dc2626; }
.hk-round-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.hk-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.hk-chip { border-radius: 99px; padding: 2px 9px; font-size: 12.5px; font-weight: 700; }
.hk-chip.won { background: rgba(22,163,74,.22); color: #86efac; }
.hk-chip.lost { background: rgba(220,38,38,.2); color: #fca5a5; }
.hk-chip small { font-weight: 400; opacity: .8; }
[data-theme="daylight"] .hk-chip.won, [data-theme="daylight"] .summary tr.won td { color: #166534; }
[data-theme="daylight"] .hk-chip.lost, [data-theme="daylight"] .summary tr.lost td { color: #991b1b; }
.hk-teams { display: flex; gap: 8px; margin: 4px 0; font-size: 13px; }
.hk-teams span { padding: 3px 9px; border-radius: 8px; background: rgba(255,255,255,.08); }
.hk-teams .won { background: rgba(74,222,128,.22); color: #86efac; } .hk-teams .lost { background: rgba(248,113,113,.2); color: #fca5a5; }
.hk-tricks { margin: 6px 0; font-size: 12.5px; } .hk-tricks summary { cursor: pointer; color: var(--muted); }
.hk-trick { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.hk-trick > b { width: 18px; color: var(--muted); } .hk-trick .tw { background: rgba(250,204,21,.18); border-radius: 6px; padding: 0 4px; } .hk-trick em { margin-left: auto; font-style: normal; color: var(--muted); }
.hk-trick span b.red-on-dark { color: #fca5a5; }
.rules-ov { max-width: 560px; width: 94%; max-height: 86vh; overflow: auto; text-align: left; }
.rules-ov .rules-list { padding-left: 18px; line-height: 1.5; font-size: 14px; }

/* ---------- Kalooki melds ---------- */
.kl-melds { max-height: 38%; overflow: auto; margin-top: 6px; font-size: 12px; }
.kl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 3px 0; }
.kl-meld { display: inline-flex; gap: 0; padding: 2px; border-radius: 6px; background: rgba(255,255,255,.08); }
.kl-meld .card.sm { margin-left: -12px; }
.kl-meld .card.sm:first-child { margin-left: 0; }

/* ---------- Mobile home redesign ---------- */
/* Home: hero with stats, sticky search + filters, quick-play shelf, category shelves on phones, bottom tab bar. */
.lbl-short { display: none; }
.hero { align-items: flex-end; }
.hero-copy { min-width: 0; flex: 1 1 380px; }
.hero-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 80%, #fff); opacity: 1; }
.hero h1 { margin: 0 0 6px; text-wrap: balance; }
.hero-sub { margin: 0; max-width: 560px; opacity: .9; }
.hero-stats { list-style: none; display: flex; gap: 8px; margin: 14px 0 0; padding: 0; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; min-width: 84px; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.12); line-height: 1.2; }
.hero-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 11px; opacity: .8; }
.hero-btns .btn { min-height: 44px; }

.finder { position: relative; z-index: 15; background: var(--bg); margin: 0 -16px; padding: 8px 16px 2px; border-bottom: 1px solid transparent; }
.search-box { flex: 1 1 220px; min-width: 0; position: relative; display: flex; align-items: center; }
.search-box span { position: absolute; left: 12px; font-size: 18px; color: var(--muted); pointer-events: none; }
.search-box #search { width: 100%; padding: 11px 12px 11px 36px; border-radius: 12px; font-size: 16px; }
.search-box #search:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.filters { scrollbar-width: none; margin-bottom: 4px; }
.filters::-webkit-scrollbar { display: none; }
.pill { min-height: 36px; }

.results { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.link-btn, .see-all { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 2px; }
.see-all { margin-left: auto; font-size: 14px; }
.cat h2 .cat-count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel); border-radius: 999px; padding: 2px 8px; }
.cat h2 .cat-name { font-size: inherit; font-weight: inherit; color: inherit; background: none; padding: 0; border-radius: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.about { margin: 28px 0 0; }

.tabbar { display: none; }

@media (max-width: 640px) {
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .topbar { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top, 0px)); }
  .brand span:last-child { display: inline; }
  .brand .brand-sub { display: none; }
  .brand { font-size: 18px; }
  .logo { width: 30px; height: 30px; }

  .hero { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px; border-radius: 18px; margin-bottom: 4px; }
  .hero-copy { flex: none; }
  .hero h1 { font-size: 23px; }
  .hero-sub { font-size: 14px; line-height: 1.45; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
  .hero-stats li { min-width: 0; padding: 8px 10px; }
  .hero-stats b { font-size: 17px; white-space: nowrap; }
  .hero-btns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
  .hero-btns .btn { padding: 10px 8px; font-size: 15px; white-space: nowrap; }

  .finder { position: sticky; top: 53px; margin: 0 -16px; padding: 10px 16px 4px; box-shadow: 0 6px 12px -10px rgba(0,0,0,.6); }
  .toolbar { margin-bottom: 8px; }

  .cat { margin: 18px 0 4px; }
  .cat h2 { font-size: 17px; margin-bottom: 10px; }

  /* Browsing on a phone: every section is a swipeable shelf, "See all" opens the full list. */
  .browse.layout-grid .tiles { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scroll-padding: 0 16px; scrollbar-width: none; }
  .browse.layout-grid .tiles::-webkit-scrollbar { display: none; }
  .browse.layout-grid .tile { flex: 0 0 42%; max-width: 170px; scroll-snap-align: start; }
  .layout-grid .tile { border-radius: 14px; }
  .layout-grid .tile-art { height: 64px; font-size: 30px; }
  .layout-grid .tile-name { font-size: 14px; line-height: 1.25; padding-right: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
  .layout-grid .tile-meta { font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .layout-grid .fav { top: 6px; right: 6px; width: 30px; height: 30px; transform: none; font-size: 15px; }
  .cat-quick .tile { flex-basis: 38%; }
  .cat-quick .tile-art { height: 76px; font-size: 36px; }

  /* Bottom tab bar */
  body[data-page="home"], body[data-page="join"], body[data-page="rooms"] { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  body[data-page="home"] .tabbar, body[data-page="join"] .tabbar, body[data-page="rooms"] .tabbar { display: grid; }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; min-height: 48px; justify-content: center;
    background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: 12px; }
  .tabbar .ti { font-size: 20px; line-height: 1; height: 22px; display: flex; align-items: center; }
  .tabbar .ti img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
  .tabbar a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
  body[data-page="home"] .topbar [data-open="feedback"], body[data-page="join"] .topbar [data-open="feedback"], body[data-page="rooms"] .topbar [data-open="feedback"] { display: none; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 360px) {
  .hero-btns { grid-template-columns: 1fr; }
  .browse.layout-grid .tile { flex-basis: 46%; }
}

/* ---------- Game page + setup redesign ---------- */
/* Game page: colour hero, "ways to play" list, rules as numbered accordion, sticky Play bar.
   Setup: three numbered cards, live round-table preview (tap a seat to change it), chip options, sticky Start bar. */
.gp2 .back, .sp2 .back { font-size: 14px; padding: 4px 0; }
.gp-hero {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center;
  padding: 20px; border-radius: 20px; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 85% 0%, rgba(255,255,255,.18), transparent 50%), linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 35%, #050a08));
  box-shadow: var(--shadow);
}
.gp-art { width: 84px; height: 84px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 46px;
  background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.18); }
.gp-art.sm { width: 52px; height: 52px; border-radius: 14px; font-size: 28px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, #000)); flex: none; }
.gp-head { min-width: 0; padding-right: 40px; }
.gp-hero .cat-chip { background: rgba(0,0,0,.28); margin-bottom: 6px; }
.gp-hero h1 { margin: 0; font-size: clamp(24px, 5vw, 34px); text-wrap: balance; }
.gp-alias { font-size: 13px; opacity: .85; margin-top: 2px; }
.gp-hero .fav { top: 14px; right: 14px; }
.gp-desc { grid-column: 1 / -1; margin: 8px 0 0; font-size: 15px; line-height: 1.5; opacity: .95; max-width: 640px; }
.gp-facts { grid-column: 1 / -1; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.gp-facts li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.14); }
.gp-facts li.ok { background: rgba(255,255,255,.92); color: #0f2a20; }
.gp-h { font-size: 18px; margin: 22px 0 10px; }
.gp-ways { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gp-way { position: relative; display: grid; grid-template-columns: 44px 1fr 16px; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, transform .1s; }
.gp-way:hover { border-color: var(--c); }
.gp-way:active { transform: scale(.99); }
.gp-way .mi { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: color-mix(in srgb, var(--c) 22%, var(--panel2)); }
.gp-way b { font-size: 15px; }
.gp-way small { grid-column: 2; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.gp-way i { grid-column: 3; grid-row: 1 / 3; font-style: normal; font-size: 22px; color: var(--muted); }
.gp-soon { margin-top: 16px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.gp-soon b { color: var(--text); display: block; }
.gp-rules { margin-top: 6px; }
.gp-rules-head { display: flex; align-items: baseline; justify-content: space-between; }
.rule { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; overflow: hidden; }
.rule summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; font-weight: 700; min-height: 48px; }
.rule summary::-webkit-details-marker { display: none; }
.rule .rn { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; background: color-mix(in srgb, var(--c) 25%, var(--panel2)); color: var(--text); }
.rule .rt { flex: 1; min-width: 0; }
.rule .chev { color: var(--muted); font-size: 18px; transition: transform .2s; line-height: 1; }
.rule[open] .chev { transform: rotate(180deg); }
.rule[open] { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.rule .rb { padding: 0 16px 12px 52px; color: var(--text); font-size: 14.5px; line-height: 1.6; }
.rule .rb p { margin: 0 0 8px; }
.actbar { position: sticky; bottom: 0; z-index: 12; display: flex; gap: 10px; align-items: center; margin: 18px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.actbar .grow { flex: 1; }
.actbar .btn.big { min-height: 50px; }
.gp2 .actbar .btn.primary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sp-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.sp-head h1 { margin: 0; font-size: clamp(22px, 5vw, 30px); }
.sp-kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sp-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.sp2.setup h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; }
.step { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; background: var(--c); color: #fff; }
.sp2 .modes { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.sp2 .mode { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; min-height: 52px; border-width: 2px; background: var(--panel2); }
.sp2 .mode .mi { font-size: 22px; }
.sp2 .mode b { font-size: 14px; line-height: 1.2; }
.sp2 .mode.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.mode-desc { margin: 10px 2px 0; font-size: 13.5px; color: var(--muted); }
.opt-l { font-size: 13px; color: var(--muted); font-weight: 600; }
.counter { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.stepper { align-self: flex-start; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel2); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 22px; cursor: pointer; }
.stepper button:hover:not([disabled]) { background: color-mix(in srgb, var(--c) 20%, transparent); }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.stepper b { min-width: 40px; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.stepper input { width: 80px; height: 44px; border: 0; border-inline: 1px solid var(--line); border-radius: 0; background: var(--panel); color: var(--text); text-align: center; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.ring { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1.35; margin: 4px auto 18px; }
.ring-felt { position: absolute; inset: 20% 18%; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px;
  background: radial-gradient(circle, var(--felt), var(--felt2)); border: 6px solid var(--rail); box-shadow: inset 0 0 20px rgba(0,0,0,.4); font-size: 11px; font-weight: 700; color: rgba(255,255,255,.75); line-height: 1.35; }
.ring-seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 84px;
  background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; transition: transform .12s; }
.ring-seat:active { transform: translate(-50%, -50%) scale(.94); }
.ring-seat .ra { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--panel2); border: 3px solid var(--line); box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.ring-seat.human .ra { border-color: var(--accent); }
.ring-seat.remote .ra { border-color: #38bdf8; }
.ring-seat.team-a .ra { box-shadow: 0 0 0 3px #38bdf8, 0 4px 10px rgba(0,0,0,.35); }
.ring-seat.team-b .ra { box-shadow: 0 0 0 3px #fb7185, 0 4px 10px rgba(0,0,0,.35); }
.ring-seat .rn { font-size: 11px; font-weight: 700; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(0,0,0,.45); padding: 1px 7px; border-radius: 999px; }
.ring.crowd .ring-seat .ra { width: 38px; height: 38px; font-size: 19px; }
.hint { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.sp2 .seat-list { gap: 6px; }
.sp2 .seat-row { flex-wrap: nowrap; gap: 10px; padding: 8px 10px; background: var(--panel2); }
.seat-av { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); font-size: 20px; cursor: pointer; }
.seat-av.human { border-color: var(--accent); }
.seat-av.remote { border-color: #38bdf8; }
.seat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp2 .seat-no { width: auto; font-size: 11px; }
.sp2 .seat-row input { flex: none; width: 100%; padding: 6px 8px; }
.seat-type { flex: none; }
.seat-type button { min-height: 36px; }
.opts2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.opt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt.hide { display: none; }
.opt select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; min-height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.chips button.on { background: var(--c); border-color: var(--c); color: #fff; font-weight: 700; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; grid-column: 1 / -1; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .sw { background: var(--c); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch small { display: block; color: var(--muted); font-size: 12px; }
.sp2 #setupNote { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, var(--panel2)); color: var(--text); font-size: 13px; line-height: 1.5; }
.demo-link { display: block; text-align: center; color: var(--muted); font-size: 14px; padding: 8px; }
.act-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.act-sum b { font-size: 14px; }
.act-sum span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
  .gp-hero { padding: 16px; border-radius: 18px; gap: 4px 14px; }
  .gp-art { width: 64px; height: 64px; font-size: 34px; border-radius: 18px; }
  .gp-desc { font-size: 14px; }
  .gp-ways { grid-template-columns: 1fr; }
  .sp-card { padding: 14px 12px; border-radius: 16px; }
  .sp2 .modes { grid-template-columns: 1fr 1fr; }
  .seat-type span { display: none; }
  .seat-type button { padding: 6px 9px; font-size: 16px; }
  .opts2 { grid-template-columns: 1fr; }
  .ring { aspect-ratio: 1.2; }
  .actbar .btn.big { padding: 12px 16px; }
}

/* ---------- Hanafuda tiles ---------- */
.hn-field { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.hn-tile { width: 54px; height: 78px; border-radius: 6px; background: #f6f0df; color: #2f3640; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 4px 2px; font-size: 10px; border: 2px solid #c8bfa4; text-align: center; line-height: 1.1; }
.hn-tile i { font-style: normal; font-size: 22px; }
.hn-tile b { font-size: 12px; }
.hn-tile.kB { border-color: #d4a017; background: #fff3c4; }
.hn-tile.kA { border-color: #3b82f6; }
.hn-tile.kR { border-color: #c62828; }
.hn-tile.sm { width: 28px; height: 42px; font-size: 7px; padding: 2px 1px; }
.hn-tile.sm i { font-size: 12px; }
.hn-tile.sm b { display: none; }
.hn-cap { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: 4px; font-size: 11px; }
.hn-deck { text-align: center; font-size: 11px; opacity: .7; margin: 4px 0; }

/* ---------- Profile names, add computer ---------- */
.pd-real { font-size: 13px; opacity: .8; margin-top: 2px; }
.addcpu { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; }
.tag.origin { background: rgba(255,255,255,.12); color: inherit; }
.gp-hero .origin-chip { background: rgba(255,255,255,.18); }

/* ---------- Table info strip + round history ---------- */
.table-info { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.table-info:empty { display: none; }
.table-info > * { position: static !important; transform: none !important; max-width: none !important; margin: 0 !important;
  flex: 1 1 auto; text-align: left !important; font-size: 12.5px; line-height: 1.45; color: var(--text);
  background: var(--panel) !important; border: 1px solid var(--line) !important; border-radius: 12px; padding: 7px 11px !important; pointer-events: auto; }
.table-info .hk-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.table-info .hk-info > div { white-space: nowrap; }
.table-info .hk-two span { display: inline !important; }
.table-info .hk-two span + span::before { content: ' · '; }
.table-info .hk-scores { margin: 0 0 0 auto !important; background: color-mix(in srgb, var(--accent) 18%, var(--panel2)); border-color: var(--accent); color: var(--text); font-size: 12px; padding: 3px 10px; }
.table-info .hk-scores span { display: inline !important; }
.table-info .hk-info-min { flex: 0 0 auto; background: none !important; border: 0 !important; padding: 0 !important; }
.table-info .hk-deck { color: var(--muted); }
.table-info .scorebox > div { display: inline; }
.table-info .scorebox > div + div::before { content: '  ·  '; color: var(--muted); }
.table-info .red-on-dark { color: #e5484d; }
[data-theme] .table-info .silver { color: var(--muted); }

.rhist { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.rhist summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; color: var(--text); font-weight: 700; }
.rh-sub { color: var(--muted); font-weight: 500; }
.rh-scroll { max-height: 230px; overflow: auto; margin-top: 8px; border-radius: 8px; }
.rhist table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rhist th { position: sticky; top: 0; background: var(--panel2); color: var(--muted); font-size: 11px; font-weight: 700; padding: 5px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.rhist th.me { color: var(--accent); }
.rhist td { text-align: center; padding: 5px 4px; border-top: 1px solid var(--line); }
.rhist td.tn { color: var(--muted); font-size: 11px; width: 26px; }
.rhist tr.now td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rhist td.win .hc { background: var(--accent); color: var(--accent-text); }
.rhist td.lead .hc { box-shadow: inset 0 -2px 0 currentColor; }
.hc { display: inline-block; min-width: 34px; padding: 2px 5px; border-radius: 6px; background: #fff; color: #111; font-weight: 800; font-size: 12.5px; }
.hc.red { color: #c81e1e; }
.hc.silver { color: #64748b; }
.rh-key { display: flex; gap: 12px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.rh-key .k::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.rh-key .k.win::before { background: var(--accent); }
.rh-key .k.lead::before { background: #fff; box-shadow: inset 0 -2px 0 #111; }
@media (max-width: 640px) {
  .rhist th { font-size: 10px; max-width: 54px; }
  .hc { min-width: 30px; font-size: 12px; padding: 2px 3px; }
  .rhist td { padding: 4px 2px; }
}
/* Seats at the top and bottom of the felt stick out past its edge; leave room so they never cover the info line or the status. */
.table-wrap .felt:not(.sol) { margin-top: 56px; margin-bottom: 44px; }
@media (max-width: 640px) { .table-wrap .felt:not(.sol) { margin-top: 64px; margin-bottom: 40px; } }

/* ---------- Tile Rummy ---------- */
.tr-tile { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 34px; margin: 1px; border-radius: 5px; background: #f6f0df; font-weight: 800; font-size: 15px; border: 2px solid #c8bfa4; }
.tr-tile.cR { color: #c62828; } .tr-tile.cB { color: #1565c0; } .tr-tile.cK { color: #222; } .tr-tile.cO { color: #e07b00; }
.tr-tile.w { background: #fff7cf; border-style: dashed; }
.tr-meld { display: inline-flex; padding: 2px; margin: 3px; border-radius: 6px; background: rgba(255,255,255,.08); }
.tr-table { display: flex; flex-wrap: wrap; justify-content: center; max-height: 45%; overflow: auto; }
.tr-rack { margin-top: 6px; text-align: center; font-size: 12px; }

/* ---------- Label filters ---------- */
.filters.labels { gap: 6px; margin-top: -2px; }
.lab { flex: none; min-height: 32px; padding: 4px 12px; border-radius: 8px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lab.on { background: var(--text); color: var(--bg); border-style: solid; border-color: var(--text); }
.tile-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- View options ---------- */
.vp { --c: var(--accent); display: grid; gap: 10px; }
.vp-head { display: flex; align-items: center; justify-content: space-between; }
.vp-head h2 { margin: 0; font-size: 20px; }
.vp h3 { margin: 8px 0 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.vp-row { display: flex; flex-direction: column; gap: 6px; }
.vp .chips button.on { color: var(--accent-text); }
.modal:has(.vp) { max-height: 88vh; overflow: auto; }
@media (max-width: 640px) {
  .modal-bg:has(.vp) { align-items: flex-end; padding: 0; }
  .modal:has(.vp) { width: 100%; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
}
/* Text size */
html[data-v-text="sm"] body { font-size: 13.5px; }
html[data-v-text="lg"] body { font-size: 17px; }
html[data-v-text="lg"] .tile-name, html[data-v-text="lg"] .rule .rb, html[data-v-text="lg"] .gp-desc { font-size: 1.08em; }
html[data-v-text="lg"] .tile-meta, html[data-v-text="lg"] .seat { font-size: 13.5px; }
/* Home */
html[data-v-hero="hide"] #hero { display: none; }
/* Game page */
html[data-v-ghero="slim"] .gp-desc, html[data-v-ghero="slim"] .gp-facts { display: none; }
html[data-v-ghero="slim"] .gp-art { width: 56px; height: 56px; font-size: 30px; }
/* Setup */
html[data-v-setup="quick"] .sp2 .ring, html[data-v-setup="quick"] .sp2 .hint { display: none; }
/* Table */
html[data-v-cards="sm"] .table-wrap .hand .fan, html[data-v-cards="sm"] .table-wrap .center .tcard { zoom: .82; }
html[data-v-cards="lg"] .table-wrap .hand .fan { zoom: 1.25; }
html[data-v-cards="lg"] .table-wrap .center .tcard { zoom: 1.15; }
html[data-v-hand="spread"] .table-wrap .hand .fan { gap: 4px; row-gap: 8px; padding-top: 6px; }
html[data-v-hand="spread"] .table-wrap .hand .fan .card + .card { margin-left: 0; }
html[data-v-felt="flat"] .table-wrap .felt:not(.sol) { border-radius: 22px; }
html[data-v-panels="hide"] .table-wrap .rhist, html[data-v-panels="hide"] .table-wrap .log { display: none !important; }
/* List layout on phones: one tidy row per game */
@media (max-width: 640px) {
  .layout-list .tile-art { width: 56px; height: 56px; font-size: 26px; }
  .layout-list .tile-body { padding: 8px 10px; min-width: 0; }
  .layout-list .tile-name { font-size: 15px; }
  .layout-list .tile-desc { display: none; }
  .layout-list .tile-tags { padding: 0 46px 0 0; flex-direction: column; align-items: flex-end; }
  .layout-list .tile-tags .origin { display: none; }
}

/* ---------- Quiz games ---------- */
.qz-card { text-align: center; padding: 8px 6px; max-width: 520px; margin: 0 auto; }
.qz-k { font-size: 12px; opacity: .75; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.qz-q { font-size: 18px; font-weight: 700; margin: 6px 0; line-height: 1.3; }
.qz-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0; }
.qz-chips span { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 17px; }
.qz-emoji { font-size: 38px; letter-spacing: 4px; margin: 6px 0; word-break: break-all; }
.qz-form { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.qz-form input { flex: 1 1 160px; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.25); color: inherit; font-size: 16px; }
.qz-ans { font-size: 20px; margin: 8px 0; } .qz-ans.ok b { color: #86efac; } .qz-ans.no b { color: #fca5a5; }
.qz-why { font-size: 13px; opacity: .85; margin: 4px 0; }

/* ---------- Kids & Arcade ---------- */
.ar-card { text-align: center; padding: 6px; max-width: 520px; margin: 0 auto; }
.ar-big { font-size: 54px; line-height: 1.1; } .ar-hud { font-weight: 800; margin-bottom: 6px; }
.ar-grid { display: grid; gap: 8px; justify-content: center; } .ar-grid.g3 { grid-template-columns: repeat(3, 1fr); max-width: 300px; margin: 0 auto; }
.ar-hole { aspect-ratio: 1; border-radius: 50%; border: 3px solid #7c4a1d; background: radial-gradient(circle at 50% 70%, #3b2410, #1c1209); font-size: 38px; line-height: 1; cursor: pointer; color: inherit; }
.ar-cell { aspect-ratio: 1; min-width: 40px; border-radius: 10px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); font-size: 26px; cursor: pointer; color: inherit; padding: 0; }
.ar-cell.up { background: #fff7cf; } .ar-cell.gone { opacity: .25; }
.ar-mem { max-width: 360px; margin: 0 auto; }
.ar-claw { position: relative; height: 54px; } .ar-claw span { position: absolute; top: 0; transform: translateX(-50%); font-size: 36px; transition: left .05s linear; left: 0; }
.ar-prizes { display: flex; justify-content: space-between; margin: 6px 0 12px; } .ar-prizes div { text-align: center; flex: 1; } .ar-prizes i { font-style: normal; font-size: 26px; display: block; } .ar-prizes small { font-weight: 800; font-size: 12px; }
.ar-drops { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 4px; } .ar-drops .btn { flex: 1; padding: 6px 0; }
.ar-board { margin: 6px auto; max-width: 300px; } .ar-row { display: flex; justify-content: space-between; height: 30px; align-items: center; } .ar-row span { width: 14.28%; font-size: 20px; opacity: .8; }
.ar-slots { display: flex; justify-content: space-between; } .ar-slots b { width: 14.28%; background: rgba(255,255,255,.14); border-radius: 6px; padding: 4px 0; font-size: 14px; }
.ar-crowd { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-size: 28px; } .ar-opts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Interactive game content sits inside .center (which ignores the pointer); let it be clicked. */
.qz-card, .ar-card, .kl-melds { pointer-events: auto; }
.qz-card, .ar-card { max-height: 100%; overflow-y: auto; width: 100%; }
.felt:has(.ar-card), .felt:has(.qz-card) { height: clamp(320px, 56vh, 520px); }
.felt:has(.ar-card), .felt:has(.qz-card) { border-radius: 28px; }
.ar-card, .qz-card { padding-bottom: 52px; }

/* Argent page */
.argent-page { padding-bottom: 90px; }
.ag-hero { text-align: center; padding: 18px 0 6px; }
.ag-shield { font-size: 84px; line-height: 1; color: #939EAE; text-shadow: 0 4px 18px rgba(147,158,174,.45); }
.ag-hero h1 { margin: 4px 0; }
.ag-row { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; flex-wrap: wrap; }
.ag-card { width: 52px; height: 74px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #2F3640; font-size: 15px; }
.ag-card i { font-style: normal; font-size: 26px; line-height: 1; }
.ag-card.red { color: #C62828; } .ag-card.silver { color: #939EAE; border-color: #939EAE; }
.ag-list { padding-left: 20px; line-height: 1.6; }
.ag-games { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.ag-games .pd-game { width: calc(33.3% - 7px); }

/* ---------- Chuppa Rustam info: deck line first, then bid / trump / called / partner spread evenly ---------- */
.table-info .hk-deck { order: 0; flex: 1 1 100%; text-align: center !important; }
.table-info .hk-info, .table-info .hk-info-min { order: 1; flex: 1 1 100%; }
.table-info .hk-info:not(.hk-info-min) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0 !important; overflow: hidden; text-align: center !important; }
.table-info .hk-info .hk-two { display: contents !important; }
.table-info .hk-info:not(.hk-info-min) > div:not(.hk-two), .table-info .hk-info .hk-two > span { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 8px 4px; white-space: normal; line-height: 1.3; min-width: 0; }
.table-info .hk-info .hk-two > span + span::before { content: none !important; }
.table-info .hk-info .hk-two > span, .table-info .hk-info .hk-two + div { border-left: 1px solid var(--line); }
.table-info .hk-info .hk-scores { grid-column: 1 / -1; margin: 0 !important; border-radius: 0; border: 0; border-top: 1px solid var(--line); padding: 8px; font-size: 13px; }
.table-info .hk-info-min { display: flex; justify-content: center; }
.table-info .hk-info-min .hk-scores { margin: 0 !important; }
.table-info .hk-info small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.table-info .hk-info b { font-size: 15px; }
.table-info .hk-info em { font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.table-info .hk-info i { font-size: 13px; }
.table-info .hk-info .big-suit { font-size: 20px; line-height: 1; }

/* Open rooms */
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; }
.room-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.rr-i { font-size: 28px; }
.rr-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rr-t small { color: var(--muted, #9aa); }

/* Back button in the top bar */
.tb-back { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-right: 4px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text, inherit); font-size: 28px; line-height: 1; text-decoration: none; flex: none; padding-bottom: 3px; }

/* Hand sort toggle */
.sortbar { display: flex; justify-content: center; margin-top: 4px; }
.sortbar .btn { font-size: 12px; padding: 3px 12px; opacity: .85; }

/* Globe Guess / Word Warm-Up */
.wg-board { margin: 6px 0; text-align: left; }
.wg-row { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr auto; align-items: center; gap: 8px; padding: 5px 4px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.wg-row b { text-transform: capitalize; }
.wg-row i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #38bdf8 var(--w), rgba(255,255,255,.15) var(--w)); }
.wg-row em { font-style: normal; font-weight: 700; min-width: 36px; text-align: right; }

/* Clue Ladder */
.ld { margin: 6px auto; max-width: 420px; display: flex; flex-direction: column; gap: 4px; }
.ld-row { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.08); min-height: 28px; text-align: left; }
.ld-row.on { background: rgba(251,191,36,.9); color: #3b2a05; font-weight: 700; }
.ld-row.ans.on { background: #22c55e; color: #052e16; }
.ld-n { font-size: 12px; opacity: .8; font-weight: 700; } .ld-pts { font-size: 11px; opacity: .6; text-align: right; }

/* ---------- Table chat (online games) ---------- */
.tchat-fab { position: absolute; right: var(--tchat-right, 4px); top: var(--tchat-top, 120px); z-index: 35; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 22px; box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.tchat.open .tchat-fab { display: none; }
.tchat-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font: 700 11.5px/20px system-ui, sans-serif; }
.tchat-panel { position: fixed; left: 50%; transform: translateX(-50%); top: calc(6px + env(safe-area-inset-top, 0px)); z-index: 45; width: min(480px, calc(100vw - 16px)); max-height: 46vh;
  display: flex; flex-direction: column; color: var(--text); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
  background: color-mix(in srgb, var(--panel) 80%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tchat-panel[hidden] { display: none; }
.tchat-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 0 12px; font-size: 13px; color: var(--muted); }
.tchat-tools { display: flex; align-items: center; gap: 2px; }
.tchat-size { border: 1px solid var(--line); background: var(--bg2); color: var(--muted); font: inherit; font-size: 12px; height: 26px; padding: 0 9px; border-radius: 999px; cursor: pointer; }
.tchat-size:hover { color: var(--text); }
/* Chat size presets: Medium is the default look. */
.tchat-panel.tchat-s { max-height: 30vh; }
.tchat-panel.tchat-s .tchat-log { max-height: 44px; font-size: 12.5px; }
.tchat-panel.tchat-s .tchat-emojis button { width: 32px; height: 32px; font-size: 19px; }
.tchat-panel.tchat-s .tchat-chip { padding: 3px 9px; font-size: 12px; }
.tchat-panel.tchat-s .tchat-form input { padding: 5px 9px; font-size: 16px; }
.tchat-panel.tchat-l { max-height: 62vh; }
.tchat-panel.tchat-l .tchat-log { max-height: 200px; font-size: 15px; }
.tchat-panel.tchat-l .tchat-emojis button { width: 44px; height: 44px; font-size: 26px; }
.tchat-panel.tchat-l .tchat-chip { padding: 7px 13px; font-size: 14px; }
.tchat-panel.tchat-l .tchat-form input { padding: 9px 12px; }
.tchat-x { border: 0; background: transparent; color: var(--muted); font-size: 16px; width: 34px; height: 30px; border-radius: 8px; cursor: pointer; }
.tchat-x:hover { background: var(--panel2); color: var(--text); }
.tchat-log { flex: 1 1 auto; min-height: 30px; max-height: 84px; overflow-y: auto; padding: 2px 10px 4px; font-size: 13.5px; display: flex; flex-direction: column; gap: 3px; }
.tchat-empty { color: var(--muted); margin: 2px 0; font-size: 13px; }
.tchat-msg { background: color-mix(in srgb, var(--bg2) 85%, transparent); border-radius: 10px; padding: 3px 9px; max-width: 88%; align-self: flex-start; overflow-wrap: anywhere; }
.tchat-msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 24%, var(--panel)); }
.tchat-msg b { color: var(--accent); font-weight: 700; margin-right: 2px; }
.tchat-msg .big { font-size: 18px; line-height: 1; vertical-align: -2px; }
.tchat-emojis { flex: none; display: flex; align-items: center; gap: 2px; overflow-x: auto; overflow-y: hidden; padding: 4px 8px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); scrollbar-width: none; }
.tchat-emojis::-webkit-scrollbar, .tchat-chips::-webkit-scrollbar { display: none; }
.tchat-emojis button { flex: none; border: 0; background: transparent; font-size: 22px; line-height: 1; width: 38px; height: 38px; padding: 0; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.tchat-emojis button:hover, .tchat-emojis button:active { background: var(--panel2); }
.tchat-chips { flex: none; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 0 8px 6px; scrollbar-width: none; }
.tchat-chip { flex: none; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 85%, transparent); color: var(--text); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tchat-chip:active { background: var(--panel2); }
.tchat-form { flex: none; display: flex; gap: 6px; padding: 6px 8px 8px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tchat-form input { flex: 1; min-width: 0; background: color-mix(in srgb, var(--bg2) 90%, transparent); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 16px; }
.tchat-pop { position: absolute; z-index: 30; transform: translate(-50%, -100%); pointer-events: none; width: max-content; max-width: min(220px, 70vw); background: #fff; color: #111; border-radius: 12px; padding: 5px 10px;
  font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: tchatPop 3.2s ease forwards; overflow-wrap: anywhere; }
.tchat-pop::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.tchat-pop.emoji { background: transparent; box-shadow: none; font-size: 42px; padding: 0; line-height: 1; text-align: center; animation: tchatEmoji 2.2s ease forwards; }
.tchat-pop.emoji::after { display: none; }
.tchat-pop.emoji small { display: block; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }
@keyframes tchatPop { 0% { opacity: 0; margin-top: 6px; } 8% { opacity: 1; margin-top: -4px; } 85% { opacity: 1; } 100% { opacity: 0; margin-top: -10px; } }
@keyframes tchatEmoji { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -110%) scale(1.25); } 30% { transform: translate(-50%, -100%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .tchat-pop, .tchat-pop.emoji { animation-duration: 2.5s; animation-name: tchatFade; } }
@keyframes tchatFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* Open rooms: game filter chips and the per-game list on a game's page */
.room-chips { margin: 4px 0 10px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
.room-chips button { white-space: nowrap; flex: none; }
.room-chips .cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: rgba(127,127,127,.22); font-size: 12px; font-weight: 700; }
.gp-rooms { margin: 18px 0 8px; }
.gp-rooms .notice { padding: 12px 14px; }
.gp-rooms .notice h3 { font-size: 15px; margin: 0 0 4px; }

/* ---------- Animated table mode (js/anim.js) ---------- */
.anim-on .center .tcard { animation: none; }
.anim-on .card { backface-visibility: hidden; }
.anim-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.anim-ghost { position: absolute; will-change: transform, opacity; }
.anim-ghost > .card { width: 100%; height: 100%; margin: 0 !important; }
.opt .opt-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
