:root {
  --bg: #0c1424;
  --bg-2: #142038;
  --bg-3: #1d2c4c;
  --ink: #f1f3fb;
  --muted: #9ba6c6;
  --gold: #f2c14e;
  --felt: #0f6b3e;
  --felt-2: #0a5130;
  --red: #c8102e;
  --team0: #3aa0ff;
  --team1: #ff6b6b;
  --line: rgba(255, 255, 255, 0.12);
  --cw: clamp(48px, 11vw, 76px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: radial-gradient(900px 500px at 50% -15%, rgba(31, 154, 92, 0.28), transparent 70%), var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.err { color: var(--team1); }

.hub-tabs { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: rgba(12, 20, 36, 0.92); overflow-x: auto; }
.hub-tabs[hidden] { display: none; }
.hub-brand { font-weight: 900; text-decoration: none; color: var(--ink); margin-right: 8px; white-space: nowrap; }
.hub-brand span { color: var(--gold); }
.hub-tab { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.hub-tab[aria-current="page"] { background: var(--gold); color: #1a1400; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; max-width: 1100px; margin: 0 auto; }
.logo { background: none; border: 0; font-size: 21px; font-weight: 900; padding: 0; letter-spacing: 0.02em; }
.logo span { color: var(--gold); font-weight: 800; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); font-weight: 800; }
.sound-toggle[aria-pressed="false"] { opacity: 0.4; }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

.btn { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: 10px 16px; font-weight: 800; }
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: #1a1400; border-color: var(--gold); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.input { font: 600 16px system-ui, sans-serif; color: var(--ink); background: var(--bg); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 10px 12px; width: 100%; }
.row { display: flex; gap: 8px; }
.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 900; }

/* home */
.home { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; padding-top: 10px; }
.intro h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.05; margin: 0 0 10px; }
.intro h1 span { color: var(--gold); }
.intro h2 { font-size: 18px; margin: 18px 0 6px; }
.intro p, .intro li { color: #cfd5ec; }
.intro ul { padding-left: 18px; margin: 6px 0; }
.intro .tagline { font-weight: 800; color: var(--gold); }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 12px; position: sticky; top: 12px; }
.field { display: grid; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toggle { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--gold); }
.divider { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.12em; }
@media (max-width: 820px) { .home { grid-template-columns: 1fr; } .panel { position: static; } }

/* lobby */
.lobby { text-align: center; padding-top: 10px; }
.lobby .code { font: 900 46px/1 ui-monospace, monospace; letter-spacing: 0.25em; color: var(--gold); margin: 6px 0; }
.seat-table { position: relative; width: min(420px, 100%); aspect-ratio: 1; margin: 18px auto; }
.seat-table .felt { position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, var(--felt), var(--felt-2)); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), 0 0 0 8px #3b2414; }
.seat-btn { position: absolute; width: 156px; transform: translate(-50%, -50%); background: var(--bg-2); border: 2px dashed var(--line); border-radius: 14px; padding: 10px 8px; display: grid; gap: 2px; }
.seat-btn.taken { border-style: solid; }
.seat-btn.t0 { border-color: var(--team0); }
.seat-btn.t1 { border-color: var(--team1); }
.seat-btn.me { box-shadow: 0 0 0 3px var(--gold); }
.seat-btn .team { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; }
.seat-btn.t0 .team { color: var(--team0); } .seat-btn.t1 .team { color: var(--team1); }
.pos-bottom { left: 50%; top: 90%; } .pos-right { left: 88%; top: 50%; } .pos-top { left: 50%; top: 10%; } .pos-left { left: 12%; top: 50%; }

/* game layout */
.game { display: grid; grid-template-columns: 1fr 260px; gap: 14px; }
@media (max-width: 900px) { .game { grid-template-columns: 1fr; } }
.scorebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; }
.score { display: flex; gap: 10px; align-items: center; font-weight: 900; }
.score .t { padding: 4px 10px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.score .t0 { background: rgba(58, 160, 255, 0.18); color: var(--team0); }
.score .t1 { background: rgba(255, 107, 107, 0.18); color: var(--team1); }
.contract-chip { font-weight: 900; background: var(--bg); border-radius: 999px; padding: 4px 12px; border: 1px solid var(--line); }
.contract-chip .suit-r { color: #ff5a6a; }

.table {
  position: relative; border-radius: 26px; background: radial-gradient(ellipse at center, #13804a, var(--felt) 45%, var(--felt-2));
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5), 0 0 0 10px #3b2414, 0 20px 50px rgba(0, 0, 0, 0.5);
  height: clamp(420px, 62vh, 620px); margin: 10px 4px;
}
.player { position: absolute; display: grid; justify-items: center; gap: 4px; z-index: 2; }
.player.top { top: 12px; left: 50%; transform: translateX(-50%); }
.player.left { left: 14px; top: 50%; transform: translateY(-50%); }
.player.right { right: 14px; top: 50%; transform: translateY(-50%); }
.player.bottom { bottom: 10px; left: 50%; transform: translateX(-50%); width: 96%; }
.nameplate { display: flex; gap: 6px; align-items: center; background: rgba(0, 0, 0, 0.45); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 13px; border: 2px solid transparent; white-space: nowrap; }
.nameplate.t0 { border-color: rgba(58, 160, 255, 0.7); } .nameplate.t1 { border-color: rgba(255, 107, 107, 0.7); }
.nameplate.turn { box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(242, 193, 78, 0.8); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #fff3b0, 0 0 26px rgba(242, 193, 78, 1); } }
.chip { font-size: 10px; font-weight: 900; border-radius: 999px; padding: 1px 6px; background: var(--gold); color: #1a1400; }
.chip.off { background: rgba(255, 255, 255, 0.2); color: #fff; }
.backs { display: flex; }
.backs .card { margin-left: calc(var(--cw) * -0.72); --cw: clamp(30px, 6vw, 44px); }
.backs .card:first-child { margin-left: 0; }
.player.left .backs, .player.right .backs { flex-direction: column; }
.player.left .backs .card, .player.right .backs .card { margin-left: 0; margin-top: calc(var(--cw) * -1.1); }
.player.left .backs .card:first-child, .player.right .backs .card:first-child { margin-top: 0; }
.bubble { background: #fff; color: #111; font-weight: 900; font-size: 13px; border-radius: 12px; padding: 4px 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); animation: pop 0.25s ease-out; white-space: nowrap; }
.bubble.coinche { background: var(--red); color: #fff; }
.bubble.ann { background: var(--gold); }

/* cards */
.card {
  width: var(--cw); height: calc(var(--cw) * 1.42); border-radius: calc(var(--cw) * 0.1); background: #fffdf8; color: #151515;
  border: 1px solid rgba(0, 0, 0, 0.25); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); position: relative; flex: none; padding: 0;
  display: block; user-select: none;
}
.card.red { color: var(--red); }
.card .c-tl { position: absolute; top: 4%; left: 8%; font-weight: 900; font-size: calc(var(--cw) * 0.26); line-height: 0.9; text-align: center; }
.card .c-tl small { display: block; font-size: 0.85em; }
.card .c-mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * 0.62); padding-top: 12%; }
.card .c-face { position: absolute; inset: 22% 14% 10%; border-radius: 6px; display: grid; place-items: center; font-weight: 900; font-size: calc(var(--cw) * 0.34); background: linear-gradient(160deg, #fff3d6, #f2c14e); color: inherit; border: 1px solid rgba(0, 0, 0, 0.15); }
.card.back {
  background:
    radial-gradient(circle at 50% 50%, #f2c14e 0 9%, transparent 10%),
    conic-gradient(from 22.5deg, #b8141c 0 12.5%, #7d0d13 0 25%, #b8141c 0 37.5%, #7d0d13 0 50%, #b8141c 0 62.5%, #7d0d13 0 75%, #b8141c 0 87.5%, #7d0d13 0);
  border: 3px solid #fffdf8;
}
.hand { display: flex; justify-content: center; padding-top: 6px; min-height: calc(var(--cw) * 1.5); }
.hand .card { margin-left: calc(var(--cw) * -0.28); transition: transform 0.15s; }
.hand .card:first-child { margin-left: 0; }
.hand .card.legal { cursor: pointer; }
.hand .card.legal:hover, .hand .card.legal:focus-visible { transform: translateY(-14px); z-index: 3; }
.hand.my-turn .card.legal { box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0, 0, 0, 0.4); }
.hand.my-turn .card:not(.legal) { filter: brightness(0.55); cursor: not-allowed; }
.hand .card.trump::after { content: "★"; position: absolute; right: 6%; bottom: 3%; font-size: calc(var(--cw) * 0.18); color: #b88400; }

.trick { position: absolute; inset: 0; pointer-events: none; }
.trick .card { position: absolute; left: 50%; top: 50%; transition: transform 0.3s; }
.trick .slot-bottom { transform: translate(-50%, -12%); }
.trick .slot-top { transform: translate(-50%, -88%); }
.trick .slot-left { transform: translate(-125%, -50%) rotate(-8deg); }
.trick .slot-right { transform: translate(25%, -50%) rotate(8deg); }
.trick .card.win { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(242, 193, 78, 0.9); }
.center-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; font-weight: 900; color: rgba(255, 255, 255, 0.85); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }

/* bidding */
.bidbox { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; background: rgba(12, 20, 36, 0.96); border: 2px solid var(--gold); border-radius: 18px; padding: 14px; width: min(400px, 92%); display: grid; gap: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
.bidbox h3 { margin: 0; font-size: 16px; }
.values, .suits { display: grid; gap: 6px; }
.values { grid-template-columns: repeat(5, 1fr); }
.suits { grid-template-columns: repeat(4, 1fr); }
.vbtn, .sbtn { border: 1px solid var(--line); background: var(--bg-2); border-radius: 10px; padding: 8px 4px; font-weight: 900; }
.vbtn[aria-pressed="true"], .sbtn[aria-pressed="true"] { background: var(--gold); color: #1a1400; border-color: var(--gold); }
.sbtn { font-size: 22px; padding: 4px; }
.sbtn.red { color: #ff5a6a; }
.sbtn.red[aria-pressed="true"] { color: var(--red); }
.bidrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bidlog { font-size: 12px; color: var(--muted); max-height: 60px; overflow: auto; }

/* side */
.side { display: grid; gap: 10px; align-content: start; }
.box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.box h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 3px; max-height: 260px; overflow: auto; }
.feed li .t0 { color: var(--team0); font-weight: 800; } .feed li .t1 { color: var(--team1); font-weight: 800; }
.hist { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.hist td, .hist th { padding: 3px 4px; text-align: right; }
.hist th { color: var(--muted); font-weight: 700; }
.hist td:first-child, .hist th:first-child { text-align: left; }
.status { text-align: center; font-weight: 800; margin: 6px 0; min-height: 22px; }
.status.mine { color: var(--gold); }

/* modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(4, 8, 20, 0.75); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { margin-top: 0; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.breakdown { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.breakdown td, .breakdown th { padding: 6px; border-bottom: 1px solid var(--line); text-align: right; }
.breakdown td:first-child, .breakdown th:first-child { text-align: left; color: var(--muted); }
.breakdown tr.total td { font-weight: 900; font-size: 17px; color: var(--gold); }
.made { font-size: 22px; font-weight: 900; text-align: center; margin-bottom: 8px; }
.made.yes { color: #52d98a; } .made.no { color: var(--team1); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-weight: 800; padding: 10px 16px; border-radius: 999px; z-index: 60; }
.toast[hidden] { display: none; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }
@media (max-width: 560px) {
  .table { height: 520px; }
  .player.left { left: 4px; } .player.right { right: 4px; }
  .nameplate { font-size: 11px; padding: 3px 7px; }
}
@media (prefers-reduced-motion: reduce) { .nameplate.turn { animation: none; } }
.vbtn:disabled { opacity: 0.28; cursor: not-allowed; text-decoration: line-through; }

/* AI seats + game length */
.seat-actions { display: flex; gap: 6px; justify-content: center; }
.mini { white-space: nowrap; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 800; }
.mini:hover { border-color: var(--gold); }
.mini.ai { background: rgba(242, 193, 78, 0.15); border-color: rgba(242, 193, 78, 0.6); }
.target-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; text-transform: none; letter-spacing: normal; font-size: 14px; color: var(--ink); font-weight: 500; }
.tp input { accent-color: var(--gold); }
.tp:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

/* al3ab-hub: beta marker in the hub navigation and the "under development" banner */
.beta-chip { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: 0.08em; line-height: 16px; vertical-align: 1px; background: #7b6cff; color: #fff; }
.beta-banner { padding: 8px 14px; text-align: center; font-size: 13px; line-height: 1.4; color: #e9e6ff; background: linear-gradient(90deg, rgba(123, 108, 255, 0.28), rgba(123, 108, 255, 0.12)); border-bottom: 1px solid rgba(123, 108, 255, 0.45); }

/* al3ab-hub mark in the hub navigation */
.hub-brand { display: inline-flex; align-items: center; gap: 7px; }
.hub-mark { width: 22px; height: 22px; flex: none; }

/* Al3ab Hub wordmark: "Al3ab" + gold "Hub", one text run */
.wm, .brand .wm, .hub-brand .wm { color: var(--ink, #eef1ff); white-space: nowrap; } .wm em { font-style: normal; color: var(--gold, #f5c542); }


/* =====================================================================
   Chkobba
   ===================================================================== */
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45)); }
.logo-txt em { font-style: normal; color: var(--gold); margin-left: 6px; font-weight: 800; }

/* home */
.hero-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-cta .btn { padding: 14px 10px; font-size: 16px; display: grid; gap: 2px; }
.hero-cta .btn small { font-weight: 600; font-size: 12px; opacity: 0.8; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.intro .ar { font-size: 0.55em; color: var(--muted); margin-left: 8px; }
.points-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; padding: 0; list-style: none; }
.points-list li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.points-list b { display: block; color: var(--gold); }

/* seats for 1 vs 1 */
.seat-table.two .pos-right, .seat-table.two .pos-left { display: none; }

/* the table cards in the middle of the felt */
.board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(78%, 560px); display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 10px; min-height: calc(var(--cw) * 1.5); z-index: 1; }
.board .card { cursor: default; transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s; }
.board .card.new { animation: drop-in 0.35s ease-out; }
.board .card.target { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(242, 193, 78, 0.9); transform: translateY(-6px); }
.board .card.alt { box-shadow: 0 0 0 3px #52d98a, 0 0 16px rgba(82, 217, 138, 0.8); transform: translateY(-6px); }
.board .card.taken { box-shadow: 0 0 0 3px #fff, 0 0 24px rgba(255, 255, 255, 0.9); animation: taken 0.9s ease-in forwards; }
.board .card.played { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(242, 193, 78, 1); }
@keyframes drop-in { from { transform: translateY(-40px) scale(1.2); opacity: 0; } }
@keyframes taken { 0%, 55% { opacity: 1; } 100% { opacity: 0; transform: translateY(var(--fly, 60px)) scale(0.6); } }
.board-empty { color: rgba(255, 255, 255, 0.55); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; }
.deck-pile { position: absolute; right: 18px; bottom: 50%; transform: translateY(50%); display: grid; justify-items: center; gap: 4px; z-index: 1; }
.deck-pile .card { --cw: clamp(32px, 6vw, 46px); }
.deck-pile span { font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, 0.8); }
.table.two .deck-pile { right: 18px; }

/* the play that just happened */
.play-note { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); z-index: 4; background: rgba(0, 0, 0, 0.55); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 13px; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; animation: pop 0.25s ease-out; }
.play-note .suit-r { color: #ff7a85; }
.chkobba-burst { position: absolute; left: 50%; top: 50%; z-index: 6; pointer-events: none; transform: translate(-50%, -50%); text-align: center; animation: burst 1.6s cubic-bezier(.2, .9, .3, 1.2) forwards; }
.chkobba-burst b { display: block; font: 900 italic clamp(44px, 9vw, 84px)/1 system-ui, sans-serif; letter-spacing: 0.02em; color: #fff3b0; text-shadow: 0 4px 0 #8a5a00, 0 0 30px rgba(242, 193, 78, 0.9); }
.chkobba-burst span { font-weight: 800; color: #fff; text-shadow: 0 2px 6px #000; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(0.95); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1.05); opacity: 0; } }

/* hand: value badge on face cards helps beginners (V = 8, D = 9, R = 10) */
.card .c-val { position: absolute; right: 7%; bottom: 4%; font: 900 calc(var(--cw) * 0.17) system-ui; opacity: 0.55; }
.card.seven-d::before { content: "7aya"; position: absolute; left: 50%; bottom: -1.5em; transform: translateX(-50%); font: 900 10px system-ui; color: var(--gold); letter-spacing: 0.05em; white-space: nowrap; }
.hand .card.takes::after { content: "✓"; position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 900 11px system-ui; background: #52d98a; color: #06200f; }
.choose { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 6px 0; }
.choose .btn { padding: 8px 12px; }
.choose .opt .suit-r { color: #ff7a85; }

/* this-deal tracker */
.tally { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tally td, .tally th { padding: 4px; text-align: right; }
.tally th { color: var(--muted); font-weight: 700; }
.tally td:first-child, .tally th:first-child { text-align: left; color: var(--muted); }
.tally .lead { color: #52d98a; font-weight: 900; }
.scorebar .deal { color: var(--muted); }

@media (max-width: 560px) {
  .board { width: 86%; gap: 6px; }
  .deck-pile { right: 6px; }
  .hero-cta { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .chkobba-burst, .board .card.new, .board .card.taken { animation-duration: 0.01s; } }

/* layout polish: spread-out hand (only 3 cards), note under the opponent, compact table on phones */
.hand { gap: 12px; padding-top: 14px; }
.hand .card, .hand .card:first-child { margin-left: 0; --cw: clamp(64px, 12vw, 92px); }
.play-note { top: auto; bottom: calc(50% + var(--cw) * 0.95 + 10px); }
.table { height: clamp(380px, 56vh, 560px); }
.status { margin-top: 10px; }
@media (max-width: 560px) {
  :root { --cw: 52px; }
  .table { height: 400px; }
  .hand .card { --cw: 78px; }
  .play-note { font-size: 12px; }
}
.deck-pile, .table.two .deck-pile { right: 18px; bottom: 16px; top: auto; transform: none; }
@media (max-width: 560px) { .deck-pile, .table.two .deck-pile { right: 10px; bottom: 10px; } }

/* ---- real playing cards (SVG artwork from src/cards.js) ---- */
.card { background: none; border: 0; border-radius: calc(var(--cw) * 0.08); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); overflow: visible; }
.card .cface { display: block; width: 100%; height: 100%; }
.card.back { background: none; border: 0; }
.card.red { color: inherit; }

/* hand: tap a card to pick it, it lifts and glows */
.hand .card { transition: transform 0.18s, box-shadow 0.18s; }
.hand.my-turn .card.legal { box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.55), 0 6px 14px rgba(0, 0, 0, 0.4); }
.hand.my-turn .card.legal:hover { transform: translateY(-10px); }
.hand .card.selected, .hand.my-turn .card.selected:hover { transform: translateY(-26px) scale(1.06); box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(242, 193, 78, 0.9), 0 14px 22px rgba(0, 0, 0, 0.5); z-index: 3; }
.hand.my-turn:has(.selected) .card.legal:not(.selected) { filter: brightness(0.75); }

/* table: once a hand card is picked, tap the cards to take */
.board .card.pickable { cursor: pointer; }
.board .card.pickable:hover { transform: translateY(-6px); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 10px 18px rgba(0, 0, 0, 0.45); }
.board .card.picked { transform: translateY(-10px); box-shadow: 0 0 0 3px #52d98a, 0 0 22px rgba(82, 217, 138, 0.9); }
.board .card.shake { animation: shake 0.35s; box-shadow: 0 0 0 3px #ff5a6a, 0 0 18px rgba(255, 90, 106, 0.8); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.choose .sum { font-weight: 800; background: rgba(82, 217, 138, 0.14); border: 1px solid rgba(82, 217, 138, 0.5); border-radius: 999px; padding: 6px 12px; }
.choose .sum .suit-r, .status .suit-r { color: #ff7a85; }

/* felt framed with a Tunisian tile border */
.table {
  border: 12px solid transparent;
  background:
    radial-gradient(ellipse at center, #13804a, var(--felt) 45%, var(--felt-2)) padding-box,
    repeating-conic-gradient(from 45deg, #1d4fa0 0 25%, #f2c14e 0 50%) 0 0 / 14px 14px border-box;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.card.seven-d::before { bottom: -1.7em; }


/* =====================================================================
   Traditional Tunisian look: Sidi Bou Said blue, khatam stars, zellige borders, cream panels
   ===================================================================== */
:root {
  --tn-blue: #0d2a5c; --tn-blue-2: #123a7a; --tn-sky: #1d4fa0; --tn-red: #c8102e; --tn-gold: #e3a51b; --tn-cream: #f6ecd6; --tn-ink: #2a1f14;
  --gold: #e3a51b; --bg: #0b2350; --bg-2: #123a7a; --line: rgba(227, 165, 27, 0.35);
  --tile: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%23fbf4e2%22/%3E%3Cpath%20d%3D%22M8%201.5%2014.5%208%208%2014.5%201.5%208z%22%20fill%3D%22%231d4fa0%22/%3E%3Cpath%20d%3D%22M8%205%2011%208%208%2011%205%208z%22%20fill%3D%22%23c8102e%22/%3E%3Cpath%20d%3D%22M0%200h3L0%203zM16%200h-3l3%203zM0%2016h3l-3-3zM16%2016h-3l3-3z%22%20fill%3D%22%23e3a51b%22/%3E%3C/svg%3E");
}
body {
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2272%22%20height%3D%2272%22%20viewBox%3D%220%200%2072%2072%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%232b5fa8%22%20stroke-opacity%3D%220.35%22%20stroke-width%3D%221.2%22%3E%3Crect%20x%3D%2224%22%20y%3D%2224%22%20width%3D%2224%22%20height%3D%2224%22/%3E%3Crect%20x%3D%2224%22%20y%3D%2224%22%20width%3D%2224%22%20height%3D%2224%22%20transform%3D%22rotate%2845%2036%2036%29%22/%3E%3C/g%3E%3Ccircle%20cx%3D%2236%22%20cy%3D%2236%22%20r%3D%222.2%22%20fill%3D%22%23e3a51b%22%20fill-opacity%3D%220.45%22/%3E%3Ccircle%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221.6%22%20fill%3D%22%232b5fa8%22%20fill-opacity%3D%220.5%22/%3E%3Ccircle%20cx%3D%2272%22%20cy%3D%220%22%20r%3D%221.6%22%20fill%3D%22%232b5fa8%22%20fill-opacity%3D%220.5%22/%3E%3Ccircle%20cx%3D%220%22%20cy%3D%2272%22%20r%3D%221.6%22%20fill%3D%22%232b5fa8%22%20fill-opacity%3D%220.5%22/%3E%3Ccircle%20cx%3D%2272%22%20cy%3D%2272%22%20r%3D%221.6%22%20fill%3D%22%232b5fa8%22%20fill-opacity%3D%220.5%22/%3E%3C/svg%3E") 0 0 / 72px 72px, radial-gradient(1100px 600px at 50% -10%, #1a4a96, transparent 70%), var(--tn-blue);
  color: #f4ecdc;
}
.top { border-bottom: 0; }
.logo-txt { font-size: 22px; }
.logo-txt em { font-size: 1.25em; color: var(--tn-gold); }

/* cream panels framed with zellige tiles */
.panel, .box, .modal, .lobby .seat-table .felt + .seat-btn, .scorebar {
  background: var(--tn-cream); color: var(--tn-ink);
  border: 10px solid transparent; border-image: var(--tile) 16 round;
  border-radius: 0; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.panel .muted, .box .muted, .modal .muted, .box h3, .tally th, .tally td:first-child, .hist th, .breakdown td:first-child, .field { color: #7a644a; }
.panel .input, .modal .input { background: #fffaf0; color: var(--tn-ink); border-color: #d9c7a3; }
.tp { background: #fffaf0; color: var(--tn-ink); border-color: #d9c7a3; }
.tp:has(input:checked) { border-color: var(--tn-sky); box-shadow: 0 0 0 2px var(--tn-sky) inset; }
.divider { color: #9a8263; }
.btn { background: var(--tn-sky); color: #fff; border: 2px solid var(--tn-gold); border-radius: 999px; }
.btn.primary { background: var(--tn-red); color: #fff; border-color: var(--tn-gold); }
.btn:hover:not(:disabled) { filter: brightness(1.08); border-color: #ffd36b; }
.hero-cta .btn small { opacity: 0.9; }
.scorebar { border-width: 8px; padding: 6px 12px; }
.scorebar .deal { color: #7a644a; }
.score .t0 { background: rgba(29, 79, 160, 0.14); color: var(--tn-sky); }
.score .t1 { background: rgba(200, 16, 46, 0.12); color: var(--tn-red); }
.feed li { color: var(--tn-ink); }
.feed li .t0, .hist td, .tally td { color: var(--tn-ink); }
.feed li .t0 { color: var(--tn-sky); } .feed li .t1 { color: var(--tn-red); }
.tally .lead { color: #1f7a4a; }
.breakdown td, .breakdown th { border-bottom-color: #e2d3b4; color: var(--tn-ink); }
.breakdown tr.total td { color: var(--tn-red); }
.modal h2 { color: var(--tn-blue); }
.toast { background: var(--tn-cream); color: var(--tn-ink); border: 2px solid var(--tn-gold); }

/* home */
.intro h1 { color: #fff; }
.intro h1 .ar { font-size: 1.1em; color: var(--tn-gold); }
.intro p, .intro li { color: #e8dfcc; }
.intro .tagline { color: var(--tn-gold); }
.points-list li { background: rgba(255, 255, 255, 0.06); border-color: var(--line); color: #e8dfcc; }
.points-list b { color: var(--tn-gold); }

/* table: felt framed with tiles (already), status in gold */
.status { color: #f4ecdc; } .status.mine { color: var(--tn-gold); }
.nameplate { background: rgba(13, 42, 92, 0.85); }
.beta-banner { background: linear-gradient(90deg, rgba(227, 165, 27, 0.25), rgba(227, 165, 27, 0.1)); border-bottom-color: rgba(227, 165, 27, 0.45); color: #fff3d6; }

/* ---- Tunisian deck images (Wikimedia Commons, 89×131) ---- */
.card { height: calc(var(--cw) * 1.472); border-radius: calc(var(--cw) * 0.06); background: #fff; overflow: hidden; }
.card > img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.card.back { background: #fff; }
.card.seven-d { overflow: visible; }
.card.seven-d > img { border-radius: inherit; }

.credit { text-align: center; font-size: 11px; color: rgba(244, 236, 220, 0.55); padding: 6px 12px 18px; }
.credit a { color: rgba(244, 236, 220, 0.75); }
/* zellige frame drawn as a tiled background behind a transparent border (border-image only showed the corners) */
.panel, .box, .modal, .scorebar {
  border-image: none; border: 10px solid transparent;
  background: linear-gradient(var(--tn-cream), var(--tn-cream)) padding-box, var(--tile) 0 0 / 16px 16px border-box;
}
.scorebar { border-width: 8px; }
.tp input, .toggle input { accent-color: var(--tn-sky); }

/* link to the other game on chkobba.al3ab-hub.com */
.intro .also a { color: var(--tn-gold); font-weight: 800; }

/* =====================================================================
   Match screen (v2): the whole game fits the screen. Players sit on the edges of the table, never on the felt;
   the table cards lie loosely (turned, overlapping); no live log or tally during the match.
   ===================================================================== */
body.in-game .hub-tabs, body.in-game .beta-banner, body.in-game .credit { display: none; }
body.in-game .top { padding: 6px 10px; max-width: none; }
body.in-game .top .logo img { width: 26px; height: 26px; }
body.in-game .logo-txt { font-size: 17px; }
body.in-game main { max-width: 980px; padding: 0 8px; }
.game { display: flex; flex-direction: column; gap: 6px; height: calc(100dvh - 52px); min-height: 460px; --bw: clamp(54px, min(19vw, 12dvh), 104px); }
.game .scorebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 0; padding: 2px 10px; border-width: 6px; font-weight: 900; }
.game .scorebar .t { font-size: 15px; } .game .scorebar .t b { font-size: 20px; font-variant-numeric: tabular-nums; }
.game .scorebar .t0 { color: var(--tn-sky); } .game .scorebar .t1 { color: var(--tn-red); }
.game .scorebar .t:last-child { text-align: right; }
.game .scorebar .deal { font-size: 12px; font-weight: 800; color: #7a644a; white-space: nowrap; }

/* table = edges for the players + the felt in the middle */
.game .table {
  flex: 1 1 auto; min-height: 0; height: auto; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 1fr; grid-template-areas: ". top ." "left felt right"; gap: 6px;
}
.game.two .table { grid-template-columns: 1fr; grid-template-areas: "top" "felt"; }
.felt {
  grid-area: felt; position: relative; min-height: 0; border-radius: 22px; border: 10px solid transparent;
  background: radial-gradient(ellipse at center, #13804a, var(--felt) 45%, var(--felt-2)) padding-box, repeating-conic-gradient(from 45deg, #1d4fa0 0 25%, #f2c14e 0 50%) 0 0 / 14px 14px border-box;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5), 0 14px 34px rgba(0, 0, 0, 0.45);
}
.seat { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border-radius: 14px; background: rgba(13, 42, 92, 0.75); border: 2px solid transparent; }
.seat.t0 { border-color: rgba(58, 160, 255, 0.55); } .seat.t1 { border-color: rgba(255, 107, 107, 0.55); }
.seat.turn { box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(242, 193, 78, 0.7); }
.seat.away { opacity: 0.75; }
.seat.top { grid-area: top; justify-self: center; }
.seat.left, .seat.right { flex-direction: column; justify-content: center; align-self: center; width: 54px; padding: 6px 4px; text-align: center; }
.seat.left { grid-area: left; } .seat.right { grid-area: right; }
.seat .avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 900 14px system-ui; color: #fff; background: var(--tn-sky); box-shadow: 0 0 0 2px var(--tn-gold); }
.seat.t1 .avatar { background: var(--tn-red); }
.seat .who { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; white-space: nowrap; }
.seat .who b { overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.seat .who small { font-size: 10px; font-weight: 800; color: var(--tn-gold); text-transform: uppercase; letter-spacing: .04em; }
.seat.left .who, .seat.right .who { flex-direction: column; gap: 2px; font-size: 10px; }
.seat.left .who b, .seat.right .who b { max-width: 50px; }
.seat .chip { font: 900 10px/1 system-ui; padding: 3px 5px; border-radius: 6px; background: var(--tn-gold); color: #2a1f14; }
.seat .chip.ai { background: rgba(255, 255, 255, 0.15); color: #fff; }
.seat .chip.off { background: #6b7280; color: #fff; }
.backs { display: flex; }
.mini-back { display: block; width: 14px; height: 20px; border-radius: 2px; background: url("assets/cards/back.svg") center / 100% 100%, #8f1d27; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.backs .mini-back + .mini-back { margin-left: -7px; }
.seat.left .backs, .seat.right .backs { flex-direction: column; }
.seat.left .backs .mini-back + .mini-back, .seat.right .backs .mini-back + .mini-back { margin: -14px 0 0; }
.seat .replace { font-size: 11px; padding: 3px 7px; white-space: nowrap; }
.seat.left .replace, .seat.right .replace { white-space: normal; font-size: 10px; padding: 3px; }

/* table cards: loose on the felt */
.game .board { position: absolute; inset: 6px; transform: none; width: auto; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 0; padding: 0 calc(var(--bw) * 0.2) 0 calc(var(--bw) * 0.38); }
.game .board .card { --cw: var(--bw); margin: calc(var(--bw) * -0.06) 0 calc(var(--bw) * -0.06) calc(var(--bw) * -0.18); transform: translateY(var(--dy, 0)) rotate(var(--rot, 0)); }
.game .board .card.pickable:hover { transform: translateY(calc(var(--dy, 0px) - 6px)) rotate(var(--rot, 0)); z-index: 2; }
.game .board .card.picked { transform: translateY(calc(var(--dy, 0px) - 10px)) rotate(0deg); z-index: 3; }
.game .board .card.new { animation: drop-loose 0.35s ease-out; }
@keyframes drop-loose { from { transform: translateY(-40px) rotate(0deg) scale(1.2); opacity: 0; } }
.game .board .card.taken { animation: taken-loose 0.9s ease-in forwards; z-index: 2; }
@keyframes taken-loose { 0%, 55% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--fly, 0px, 60px)) rotate(0deg) scale(0.6); } }
.game .deck-pile { position: absolute; right: 8px; bottom: 8px; top: auto; transform: none; display: grid; justify-items: center; gap: 2px; z-index: 1; }
.game .deck-pile .mini-back.big { width: 26px; height: 38px; border-radius: 3px; }
.game .deck-pile span { font: 800 11px system-ui; color: rgba(255, 255, 255, 0.85); }
.game .status { margin: 0; min-height: 20px; font-size: 14px; }
.game .status .chip { font: 900 10px/1 system-ui; padding: 3px 5px; border-radius: 6px; background: var(--tn-gold); color: #2a1f14; vertical-align: 1px; }
.game .choose { margin: 0; }
.game .hand { flex: none; padding: 4px 0 calc(20px + env(safe-area-inset-bottom)); min-height: 0; gap: 10px; }
.game .hand .card, .game .hand .card:first-child { --cw: clamp(66px, min(24vw, 12.5dvh), 104px); }
.game .chkobba-burst b { font-size: clamp(38px, 11vw, 80px); }
@media (max-width: 560px) {
  body.in-game .top { padding: 4px 8px; }
  body.in-game .logo-txt em { display: none; }
  .game { height: calc(100dvh - 46px); gap: 4px; }
  .game .table { gap: 4px; }
  .felt { border-width: 7px; border-radius: 16px; }
  .seat.left, .seat.right { width: 46px; }
  .game .scorebar .t { font-size: 13px; } .game .scorebar .t b { font-size: 18px; }
}
/* table cards in a loose square ("carré"): a small grid, each card shifted and turned a little, overlapping */
.game .board { display: grid; grid-template-columns: repeat(var(--cols, 2), calc(var(--bw) * 0.9)); grid-auto-rows: calc(var(--bw) * 1.32); justify-content: center; align-content: center; place-items: center; padding: 0; }
.game .board .card { margin: 0; transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--rot, 0)); }
.game .board .card.pickable:hover { transform: translate(var(--dx, 0), calc(var(--dy, 0%) - 6px)) rotate(var(--rot, 0)); }
.game .board .card.picked { transform: translate(var(--dx, 0), calc(var(--dy, 0%) - 10px)) rotate(0deg); }
.game .board .board-empty { grid-column: 1 / -1; }
body.in-game .about-game { display: none; } /* the match uses the whole screen */

/* =====================================================================
   v3 (Oct 2026): Al3ab Hub look. Play first on the home screen, value badges on every card,
   the cards you can take glow, account chip in the header.
   ===================================================================== */
:root { --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif; }
.top-actions { align-items: center; }
.acc-chip { margin-left: 4px; }
.logo-txt { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0.03em; }

.home2 { display: grid; gap: 18px; padding-top: 6px; }
.hero2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; padding: 10px 0 4px; }
.kicker { display: inline-block; font: 800 14px/1 var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--tn-gold); padding: 7px 12px; border-radius: 999px; background: rgba(227, 165, 27, 0.12); box-shadow: inset 0 0 0 1px rgba(227, 165, 27, 0.4); }
.hero2 h1 { margin: 14px 0 8px; font: 800 clamp(52px, 8vw, 92px)/0.92 var(--display); letter-spacing: 0.01em; text-transform: uppercase; color: #fff; }
.hero2 h1 .ar { font-family: system-ui, sans-serif; font-weight: 800; font-size: 0.62em; color: var(--tn-gold); margin-left: 10px; text-transform: none; }
.hero2 .lead { font-size: 18px; color: #e8dfcc; margin: 0 0 16px; max-width: 36ch; }
.hero-name { max-width: 320px; margin-bottom: 12px; color: #e8dfcc; }
.hero-name .input { background: rgba(255, 255, 255, 0.95); color: var(--tn-ink); border-color: #d9c7a3; }
.play-now { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 520px; }
.btn.xl { padding: 16px 14px; font-size: 19px; display: grid; gap: 2px; line-height: 1.15; }
.btn.xl small { font-size: 12px; font-weight: 600; opacity: 0.9; }
.hero-target { max-width: 520px; margin-top: 10px; }
.hero-target .tp { padding: 8px 10px; }
.hero-me { margin: 12px 0 0; color: #e8dfcc; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--tn-gold); font-weight: 800; text-decoration: underline; }
.hero2-fan { position: relative; height: 300px; }
.fan-card { position: absolute; top: 20px; left: 50%; }
.fan-card .card { --cw: 150px; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5); }
.fan-card.f0 { transform: translateX(-118%) rotate(-12deg) translateY(24px); }
.fan-card.f1 { transform: translateX(-50%); z-index: 2; }
.fan-card.f1 .card { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 3px var(--tn-gold), 0 0 50px rgba(227, 165, 27, 0.35); }
.fan-card.f2 { transform: translateX(18%) rotate(12deg) translateY(24px); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.home-grid .panel { position: static; }
.home-grid h2 { margin: 0; font: 800 24px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; color: var(--tn-blue); }
.week-board .hub-board li { background: #fffaf0; color: var(--tn-ink); box-shadow: inset 0 0 0 1px #e2d3b4; }
.week-board .hub-board li.me { box-shadow: inset 0 0 0 2px var(--tn-gold); }
.week-board .hub-board .hub-muted { color: #7a644a; }
.week-board .hub-board b { color: var(--tn-red); }
.rules-card { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; color: #e8dfcc; }
.rules-card summary { cursor: pointer; font: 800 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; color: #fff; }
.rules-card ul { padding-left: 18px; }
.rules-card .tagline { font-weight: 800; color: var(--tn-gold); margin: 6px 0 0; }
.home2 .also { margin: 0; }
.home2 .also a { color: var(--tn-gold); font-weight: 800; }
.saved-note { margin: 10px 0 0; font-weight: 700; }

/* once a hand card is picked: the table cards it could take glow */
.game .board .card.can { box-shadow: 0 0 0 3px #52d98a, 0 0 20px rgba(82, 217, 138, 0.75); z-index: 2; }
.game .board.has-can .card.pickable:not(.can):not(.picked) { filter: brightness(0.7); }
.game .choose { margin-bottom: 18px; position: relative; z-index: 4; }

@media (max-width: 860px) {
  .hero2 { grid-template-columns: 1fr; text-align: center; }
  .hero2-fan { order: -1; height: 190px; }
  .fan-card { top: 6px; }
  .fan-card .card { --cw: 100px; }
  .hero2 .lead, .hero-name, .play-now, .hero-target { margin-left: auto; margin-right: auto; }
  .hero-me { justify-content: center; }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero2 h1 { font-size: 56px; }
  .btn.xl { font-size: 17px; padding: 14px 8px; }
  .fan-card .card { --cw: 86px; }
  .hero2-fan { height: 160px; }
}
@media (max-width: 560px) {
  .top-actions .sound-toggle[data-sound="music"], #btn-fs { display: none; }
  .logo-txt em { display: none; }
  .logo-txt { font-size: 22px; }
  .hub-signin-btn { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
}

/* Ammi, the café regular (assets/ammi-*.jpg): logo, home mascot, AI players' face, the chkobba / 7aya celebration */
.logo img.logo-av { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; box-shadow: 0 0 0 2px var(--tn-gold), 0 4px 10px rgba(0, 0, 0, 0.45); }
body.in-game .top .logo img.logo-av { width: 30px; height: 30px; border-radius: 9px; }
.hero2-fan .mascot { position: absolute; left: 50%; top: 0; width: 300px; height: 300px; transform: translateX(-50%) rotate(-2deg); border-radius: 34px; object-fit: cover; z-index: 2;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55), 0 0 0 4px var(--tn-gold); }
.hero2-fan .mascot-bubble { position: absolute; z-index: 3; top: -6px; left: calc(50% + 70px); background: var(--tn-cream); color: var(--tn-ink); font: 800 18px/1 var(--display); letter-spacing: 0.03em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 18px 18px 18px 4px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); white-space: nowrap; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.hero2-fan .fan-card.m0 { top: 120px; left: calc(50% - 205px); transform: rotate(-16deg); }
.hero2-fan .fan-card.m1 { top: 130px; left: calc(50% + 95px); transform: rotate(14deg); }
.hero2-fan .fan-card .card { --cw: 110px; }
.hero2-fan { height: 330px; }
.seat .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.ammi-cheer { position: fixed; left: 50%; bottom: 22%; z-index: 90; display: flex; align-items: center; gap: 14px; transform: translateX(-50%);
  padding: 10px 22px 10px 10px; border-radius: 26px; background: var(--tn-cream); color: var(--tn-ink); border: 3px solid var(--tn-gold);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 60px rgba(227, 165, 27, 0.45); pointer-events: none; animation: ammi-in 0.5s cubic-bezier(.2, 1.5, .4, 1) both; }
.ammi-cheer img { width: 112px; height: 112px; border-radius: 20px; object-fit: cover; flex: none; animation: ammi-nod 0.9s ease-in-out 0.4s 2; }
.ammi-say { display: grid; gap: 3px; }
.ammi-say b { font: 800 italic 38px/0.95 var(--display); letter-spacing: 0.02em; color: var(--tn-red); text-shadow: 0 2px 0 #f2c14e; }
.ammi-cheer.haya .ammi-say b { color: #b8101f; }
.ammi-say span { font-weight: 800; font-size: 16px; }
.ammi-say small { color: #7a644a; font-weight: 700; }
.ammi-cheer.out { animation: ammi-out 0.45s ease-in forwards; }
@keyframes ammi-in { from { transform: translate(-50%, 60px) scale(0.6); opacity: 0; } }
@keyframes ammi-out { to { transform: translate(-50%, 40px) scale(0.8); opacity: 0; } }
@keyframes ammi-nod { 50% { transform: rotate(-6deg) scale(1.06); } }
/* 861–1100 px: the speech bubble stayed 7 px past the screen edge (sideways scroll at 1024 px) */
@media (min-width: 861px) and (max-width: 1100px) { .hero2-fan .mascot-bubble { left: auto; right: 0; } }
@media (max-width: 860px) {
  .hero2-fan { height: 230px; }
  .hero2-fan .mascot { width: 200px; height: 200px; border-radius: 26px; }
  .hero2-fan .mascot-bubble { left: calc(50% + 40px); font-size: 14px; }
  .hero2-fan .fan-card .card { --cw: 76px; }
  .hero2-fan .fan-card.m0 { top: 90px; left: calc(50% - 150px); }
  .hero2-fan .fan-card.m1 { top: 96px; left: calc(50% + 74px); }
}
@media (max-width: 480px) {
  .ammi-cheer { bottom: 26%; gap: 10px; padding: 8px 14px 8px 8px; width: max-content; max-width: 94vw; }
  .ammi-cheer img { width: 78px; height: 78px; border-radius: 16px; }
  .ammi-say b { font-size: 28px; }
  .ammi-say span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .ammi-cheer, .ammi-cheer img, .hero2-fan .mascot-bubble { animation: none; } }

/* Al3ab Hub bar: the same look and links as al3ab-hub.com and every other Al3ab Hub game */
.hub-tabs { gap: 4px; padding: 10px 16px; background: rgba(7, 9, 26, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); overflow-x: auto; scrollbar-width: none; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-brand { display: inline-flex; align-items: center; gap: 8px; margin-right: 10px; font: 900 16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0.04em; color: #f1f3ff; text-decoration: none; white-space: nowrap; }
.hub-mark { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 3px 8px rgba(58, 214, 255, 0.4)); }
.hub-tab { color: #a3acd2; font: 700 14px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 8px 13px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; text-decoration: none; }
.hub-tab:hover { color: #f1f3ff; border-color: rgba(255, 255, 255, 0.1); }
.hub-tab[aria-current="page"] { background: rgba(255, 255, 255, 0.08); color: #f1f3ff; }

/* ---------- 2026-11-24: the café regulars and la coupe ---------- */
/* Faces of #elmoudir and #lm3alem (and Ammi) big enough to recognise */
.seat .avatar:has(img) { width: 42px; height: 42px; }
.seat.left .avatar:has(img), .seat.right .avatar:has(img) { width: 38px; height: 38px; }
.seat.speaking .avatar { animation: speak 0.5s ease-in-out infinite alternate; box-shadow: 0 0 0 3px var(--tn-gold), 0 0 18px rgba(242, 193, 78, 0.9); }
@keyframes speak { to { transform: scale(1.12); } }

.seat.left, .seat.right { width: 62px; }
.seat.left .who b, .seat.right .who b { max-width: 58px; font-size: 9.5px; }

/* ---------- la coupe in 3D (2026-11-24): a real deck on the felt, vector back (assets/cards/back.svg) ---------- */
.board.cut-phase { display: flex; justify-content: center; align-items: center; width: 100%; }
.board.cut-phase ~ .deck-pile { visibility: hidden; }
.cut-scene { --W: min(118px, 30vw); position: relative; width: 100%; height: calc(var(--W) * 2.25); display: grid; place-items: center; perspective: 900px; perspective-origin: 50% 10%; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.cut-scene.mine { cursor: ns-resize; }
.cut-stage { position: relative; width: var(--W); height: calc(var(--W) * 1.47); margin-top: calc(var(--W) * -0.35); transform-style: preserve-3d; transform: rotateX(50deg) rotateZ(-16deg); }
.cut-shadow { position: absolute; inset: 2% -4% -6% 2%; border-radius: 12px; background: rgba(0, 0, 0, 0.5); filter: blur(12px); transform: translateZ(-1px); }
.pk { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.36s cubic-bezier(.3, .8, .25, 1); will-change: transform; }
.pk .f { position: absolute; }
.f-top { inset: 0; border-radius: 8px; background: url("assets/cards/back.svg") center / 100% 100%; transform: translateZ(var(--th)); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35); }
/* the edges of the stacked cards: fine cream lines, one per card */
.f-front { left: 5px; right: 5px; top: 100%; height: var(--th); transform-origin: top; transform: rotateX(90deg);
  background: repeating-linear-gradient(to bottom, #fdf8ec 0 0.75px, #c9b991 0.75px 1.15px); box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.25); }
.f-right { top: 5px; bottom: 5px; left: 100%; width: var(--th); transform-origin: left; transform: rotateY(-90deg);
  background: repeating-linear-gradient(to right, #f3ead6 0 0.75px, #b9a77d 0.75px 1.15px); box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35); }
/* the cut line on the deck's edge: where my finger would lift the cards */
.cut-line { position: absolute; left: -10px; right: -10px; height: 2px; top: calc(var(--th) - var(--pick) * 1.15px); background: #ffe08a; border-radius: 2px;
  box-shadow: 0 0 6px #ffd35a, 0 0 14px rgba(255, 196, 64, 0.9); }
.cut-scene.mine .cut-line { animation: cut-glow 1.2s ease-in-out infinite; }
.cut-scene.mine.picking .cut-line { animation: none; height: 3px; }
@keyframes cut-glow { 50% { opacity: 0.45; } }
.cut-scene.waiting .cut-line { animation: cut-scan 1.1s ease-in-out infinite alternate; }
@keyframes cut-scan { from { top: 18%; } to { top: 82%; } }
.cut-scene.mine .pk-bottom { animation: deck-breathe 2.4s ease-in-out infinite; }
@keyframes deck-breathe { 50% { transform: translateZ(6px); } }
.cut-label { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font: 700 13px/1.3 system-ui; color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.cut-label b { color: #ffe08a; font-size: 15px; }

/* the cut itself: lift → aside → under → merge */
.pk-bottom { transform: translate3d(0, 0, 0); }
.pk-top { transform: translate3d(0, 0, var(--t2)); }
.cut-scene.lift .pk-top { transform: translate3d(0, -8%, calc(var(--t2) + 70px)) rotateZ(6deg); }
.cut-scene.aside .pk-top { transform: translate3d(66%, -16%, calc(var(--t2) + 70px)) rotateZ(16deg); }
.cut-scene.aside .pk-bottom { transform: translate3d(-36%, 8%, 0) rotateZ(-5deg); }
.cut-scene.under .pk-top { transform: translate3d(66%, -16%, 0) rotateZ(10deg); }
.cut-scene.under .pk-bottom { transform: translate3d(-36%, 8%, var(--t1)) rotateZ(-5deg); }
.cut-scene.merge .pk-top { transform: translate3d(0, 0, 0); }
.cut-scene.merge .pk-bottom { transform: translate3d(0, 0, var(--t1)); transition-timing-function: cubic-bezier(.3, 1.4, .5, 1); }
@media (prefers-reduced-motion: reduce) { .pk { transition: none; } .cut-scene .cut-line, .cut-scene .pk-bottom { animation: none; } }

/* ---------- home page, clearer (2026-11-24): faces on the play buttons, 3 steps, the regulars, Rami + Belote banners ---------- */
.btn.xl { position: relative; }
.btn.xl .faces { display: flex; justify-content: center; margin-bottom: 4px; }
.mini-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--tn-gold), 0 3px 8px rgba(0, 0, 0, 0.4); background: var(--tn-blue); }
.faces .mini-face + .mini-face { margin-left: -9px; }
.quick-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-steps li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(227, 165, 27, 0.35); color: #f1e8d4; font-size: 14.5px; line-height: 1.3; }
.quick-steps li b { color: #fff; }
.quick-steps .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 900 15px system-ui; background: var(--tn-gold); color: var(--tn-ink); }
.regulars h2, .more-games h2 { margin: 0 0 10px; font: 800 24px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; color: #fff; }
.reg-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reg { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 8px 12px; border-radius: 18px; background: linear-gradient(180deg, rgba(29, 79, 160, 0.55), rgba(13, 42, 92, 0.7)); border: 1px solid rgba(227, 165, 27, 0.4); }
.reg .mini-face.big { width: 74px; height: 74px; box-shadow: 0 0 0 3px var(--tn-gold), 0 8px 18px rgba(0, 0, 0, 0.45); margin-bottom: 4px; }
.reg b { color: #fff; font-size: 16px; }
.reg span { color: #d9cfb8; font-size: 12.5px; line-height: 1.3; }
.banners { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.banner { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; text-decoration: none; color: #fff; border: 2px solid var(--tn-gold); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.banner:hover { transform: translateY(-2px); }
.b-rami { background: linear-gradient(120deg, #0a5a35, #127a48 60%, #0d4d2f); }
.b-belote { background: linear-gradient(120deg, #4a0f19, #8f1d27 60%, #3d0c14); }
.banner img { flex: none; width: 64px; height: 64px; border-radius: 16px; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
.b-rami img { border-radius: 50%; }
.banner > span { display: grid; gap: 2px; min-width: 0; }
.banner b { font: 800 22px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.banner small { color: rgba(255, 255, 255, 0.85); font-size: 13px; line-height: 1.3; }
.banner .go { margin-left: auto; flex: none; font-style: normal; font-weight: 900; padding: 8px 12px; border-radius: 999px; background: var(--tn-gold); color: var(--tn-ink); font-size: 14px; }
@media (max-width: 860px) {
  .quick-steps { grid-template-columns: 1fr; gap: 6px; }
  .quick-steps li { padding: 9px 12px; font-size: 14px; }
  .banners { grid-template-columns: 1fr; }
  /* phones: Ammi smaller, so the play buttons show in the first screen */
  .hero2-fan { height: 150px; }
  .hero2-fan .mascot { width: 140px; height: 140px; border-radius: 22px; }
  .hero2-fan .mascot-bubble { left: calc(50% + 30px); font-size: 12px; }
  .hero2-fan .fan-card .card { --cw: 58px; }
  .hero2-fan .fan-card.m0 { top: 60px; left: calc(50% - 118px); }
  .hero2-fan .fan-card.m1 { top: 64px; left: calc(50% + 62px); }
  .hero2 h1 { margin: 8px 0 4px; }
  .hero2 .lead { font-size: 15px; margin-bottom: 12px; }
}
@media (max-width: 480px) {
  .hero2 h1 { font-size: 46px; }
  .reg { padding: 10px 4px; }
  .reg .mini-face.big { width: 58px; height: 58px; }
  .reg b { font-size: 14px; }
  .reg span { font-size: 11.5px; }
  .banner { padding: 10px 12px; gap: 12px; }
  .banner img { width: 54px; height: 54px; }
  .banner b { font-size: 20px; }
  .banner small { font-size: 12px; }
}

/* Rami + Belote: a compact strip at the very top of the Chkobba page (2026-11-24) */
.more-games.top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-games.top .banner { padding: 8px 10px; gap: 10px; border-radius: 14px; }
.more-games.top .banner img { width: 44px; height: 44px; border-radius: 12px; }
.more-games.top .b-rami img { border-radius: 50%; }
.more-games.top .banner b { font-size: 20px; }
.more-games.top .banner small { font-size: 12px; }
.more-games.top .go { padding: 6px 10px; font-size: 13px; }
@media (max-width: 480px) {
  .more-games.top { gap: 8px; }
  .more-games.top .banner { padding: 6px 8px; gap: 8px; }
  .more-games.top .banner img { width: 36px; height: 36px; }
  .more-games.top .banner b { font-size: 17px; }
  .more-games.top .banner small { font-size: 11px; }
  .more-games.top .go { display: none; }
}

/* ---------- chat and voice at the table (2026-11-24, from Football Duel's chat panel) ---------- */
.table-comms { position: fixed; left: 10px; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 40; display: grid; gap: 8px; }
.comm-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; cursor: pointer;
  background: rgba(13, 42, 92, 0.92); color: #fff; border: 2px solid var(--tn-gold); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }
.comm-btn[hidden] { display: none; }
.chat-btn .unread-dot { display: none; position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 0 2px #0d2a5c; }
.chat-btn.unread .unread-dot { display: block; }
.chat-btn[aria-expanded="true"] { background: var(--tn-gold); color: var(--tn-ink); }
.mic-btn { filter: grayscale(0.4); opacity: 0.9; }
.mic-btn[data-state="live"] { background: #d93a4a; border-color: #ffb3bb; filter: none; opacity: 1; animation: mic-live 1.6s ease-out infinite; }
.mic-btn.talking { box-shadow: 0 0 0 4px rgba(255, 224, 138, 0.9), 0 0 22px rgba(255, 210, 90, 0.9); }
.mic-btn.invite { filter: none; opacity: 1; animation: mic-invite 1.2s ease-in-out infinite; }
@keyframes mic-live { 0% { box-shadow: 0 0 0 0 rgba(217, 58, 74, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(217, 58, 74, 0); } }
@keyframes mic-invite { 50% { transform: scale(1.12); box-shadow: 0 0 0 4px rgba(227, 165, 27, 0.7); } }
.seat.talking .avatar { box-shadow: 0 0 0 3px #52d98a, 0 0 18px rgba(82, 217, 138, 0.9); }
.seat { position: relative; }
.chat-bubble { position: absolute; z-index: 30; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); max-width: 190px; width: max-content; padding: 6px 10px; border-radius: 12px;
  background: #fff8e6; color: #2a1f14; font: 700 13px/1.3 system-ui; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); animation: bubble-in 0.2s ease-out; white-space: normal; }
.chat-bubble::before { content: ""; position: absolute; left: 50%; top: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top: 0; border-bottom-color: #fff8e6; }
.seat.left .chat-bubble { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
.seat.right .chat-bubble { left: auto; right: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
.seat.left .chat-bubble::before, .seat.right .chat-bubble::before { display: none; }
@keyframes bubble-in { from { opacity: 0; } }
.chat-panel { position: fixed; right: 16px; bottom: 16px; z-index: 45; width: min(340px, calc(100vw - 32px)); max-height: min(520px, 70vh); display: flex; flex-direction: column; border-radius: 16px;
  background: rgba(10, 28, 64, 0.97); color: #f4ecdc; border: 2px solid var(--tn-gold); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.chat-note { font-size: 11px; color: #c9bfa8; flex: 1; }
.chat-mute, .chat-close { font: 800 12px system-ui; color: #f4ecdc; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.chat-mute[aria-pressed="true"] { background: rgba(255, 93, 108, 0.25); border-color: #ff5d6c; }
.chat-log { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 60px; display: grid; gap: 4px; align-content: start; font-size: 14px; }
.chat-log li b { color: #ff9aa5; margin-right: 4px; }
.chat-log li.mine b { color: #8fd3ff; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.chat-quick button { font: 700 13px system-ui; color: #f4ecdc; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.chat-quick button:hover { border-color: var(--tn-gold); background: rgba(227, 165, 27, 0.15); }
.chat-form { display: flex; gap: 6px; padding: 0 12px 12px; }
.chat-form input { flex: 1; min-width: 0; font: 600 14px system-ui; color: #f4ecdc; background: #071a3d; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 560px) { .chat-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 60vh; } .table-comms { left: 6px; bottom: calc(166px + env(safe-area-inset-bottom)); } .comm-btn { width: 42px; height: 42px; font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { .mic-btn[data-state="live"], .mic-btn.invite { animation: none; } }

/* la coupe, part 2: the card at the cut, face up; the cutter keeps it or drops it on the table */
.cut-pick { display: grid; justify-items: center; gap: 10px; text-align: center; }
.cut-pick .cut-card-up { --cw: clamp(84px, 24vw, 110px); animation: card-flip 0.55s cubic-bezier(.2, .8, .25, 1); box-shadow: 0 0 0 3px var(--tn-gold), 0 0 30px rgba(242, 193, 78, 0.7), 0 14px 26px rgba(0, 0, 0, 0.5); }
.cut-pick .hidden-cut { box-shadow: 0 14px 26px rgba(0, 0, 0, 0.5); } /* someone else's cut: the card stays face down for me */
@keyframes card-flip { from { transform: perspective(600px) rotateY(90deg) translateY(20px); opacity: 0.2; } }
.cut-q { margin: 0; max-width: 260px; font: 700 14px/1.35 system-ui; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.cut-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cut-btns .btn { padding: 10px 16px; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .cut-pick .cut-card-up { animation: none; } }

/* ---------- open tables (2026-11-25): public tables anyone on the site can sit at (src/opentables.js) ---------- */
/* Redesign (2026-11-25): table cards with round seat avatars; a grid on wide screens, one swipeable row on phones. */
.open-tables[hidden] { display: none; }
.open-tables { min-width: 0; max-width: 100%; box-sizing: border-box; } .ot-list { min-width: 0; }
.open-tables { border-radius: 18px; padding: 14px 16px 16px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.18)); border: 1px solid rgba(227, 165, 27, 0.5); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.ot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.ot-head h2 { margin: 0; font: 800 24px/1 var(--display, "Barlow Condensed", system-ui, sans-serif); text-transform: uppercase; letter-spacing: 0.03em; color: #fff; white-space: nowrap; }
.ot-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: #9be7b4; text-transform: uppercase; letter-spacing: 0.08em; }
.ot-live i { width: 8px; height: 8px; border-radius: 50%; background: #52d98a; box-shadow: 0 0 0 0 rgba(82, 217, 138, 0.7); animation: ot-pulse 1.8s ease-out infinite; }
@keyframes ot-pulse { to { box-shadow: 0 0 0 8px rgba(82, 217, 138, 0); } }
.ot-count:empty { display: none; }
.ot-count { min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; display: inline-grid; place-items: center; font: 800 13px/1 system-ui, sans-serif; color: #1a1206; background: #e3a51b; }
.ot-head .ot-new { margin-inline-start: auto; min-height: 36px; padding: 6px 14px; font-size: 14px; white-space: nowrap; }

.ot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ot-list.one { grid-template-columns: minmax(250px, 380px); }
.ot-table { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; padding: 12px 14px; border-radius: 16px; min-width: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(46, 140, 82, 0.55), rgba(18, 70, 40, 0.75)); border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.ot-table header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ot-mode { font: 800 22px/1 var(--display, "Barlow Condensed", system-ui, sans-serif); color: #fff; letter-spacing: 0.02em; }
.ot-rule { font-size: 13px; font-weight: 700; color: #e8dfcc; opacity: 0.85; }
.ot-seats { display: flex; justify-content: center; align-items: flex-start; gap: 8px; padding: 10px 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); }
.ot-seats.teams { gap: 6px; }
.ot-team { display: flex; gap: 6px; }
.ot-vs { align-self: center; font: 800 13px/1 system-ui, sans-serif; color: #e3a51b; text-transform: uppercase; padding: 0 2px; margin-top: -14px; }
.ot-seat { display: grid; justify-items: center; gap: 4px; width: 54px; min-width: 0; }
.ot-seat small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; color: #f4ecdc; }
.ot-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 17px/1 system-ui, sans-serif; font-style: normal; color: #fff;
  background: hsl(var(--h, 210) 55% 42%); border: 2px solid rgba(255, 255, 255, 0.75); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.ot-seat.ai .ot-av { background: #3a4257; font-size: 18px; border-color: rgba(255, 255, 255, 0.4); }
.ot-seat.ai small { color: #c9c3b4; }
.ot-seat.free .ot-av { background: rgba(227, 165, 27, 0.12); border: 2px dashed #e3a51b; color: #e3a51b; font-size: 20px; box-shadow: none; animation: ot-free 2s ease-in-out infinite; }
.ot-seat.free small { color: #e3a51b; }
@keyframes ot-free { 50% { background: rgba(227, 165, 27, 0.3); } }
.ot-table footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ot-left { font-size: 13px; font-weight: 800; color: #9be7b4; }
.ot-table .ot-sit { min-height: 40px; padding: 8px 18px; white-space: nowrap; }
.ot-new-tile { display: none; }

/* phones: one row you swipe through, so the section stays short and the game below stays in view */
@media (max-width: 640px) {
  .open-tables { padding: 12px 0 14px; }
  .ot-head { padding: 0 12px; margin-bottom: 10px; gap: 8px; }
  .ot-head h2 { font-size: 21px; }
  .ot-head .ot-new { min-height: 34px; padding: 4px 10px; font-size: 13px; }
  .ot-list, .ot-list.one { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 12px; padding: 0 12px 4px; gap: 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .ot-list::-webkit-scrollbar { display: none; }
  .ot-table { flex: 0 0 min(300px, calc(100% - 44px)); scroll-snap-align: start; }
  .ot-list.one .ot-table { flex-basis: calc(100% - 120px); }
  .ot-head .ot-new { display: none; }
  .ot-new-tile { flex: 0 0 104px; scroll-snap-align: start; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 10px; border-radius: 16px; cursor: pointer;
    background: rgba(227, 165, 27, 0.08); border: 2px dashed rgba(227, 165, 27, 0.7); color: #e3a51b; font: inherit; text-align: center; }
  .ot-new-tile i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 22px; font-weight: 800; background: #e3a51b; color: #1a1206; }
  .ot-new-tile b { font-size: 13px; line-height: 1.2; }
  .ot-new-tile:active { transform: scale(0.97); }
}
@media (max-width: 480px) { .ot-live { font-size: 0; gap: 0; } }
.ot-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .ot-head .ot-new, .ot-count, .ot-live { flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .ot-live i, .ot-seat.free .ot-av { animation: none; } }
[dir="rtl"] .ot-seat small, [dir="rtl"] .ot-av { unicode-bidi: plaintext; }
.vis-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pub-badge { display: inline-block; margin: 0 auto 10px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; background: rgba(82, 217, 138, 0.16); color: #9be7b4; border: 1px solid rgba(82, 217, 138, 0.5); }
.pub-badge.priv { background: rgba(255, 255, 255, 0.08); color: #e8dfcc; border-color: rgba(255, 255, 255, 0.2); }
@media (prefers-reduced-motion: reduce) { .ot-live i { animation: none; } }

/* ---------- languages (2026-11-25): EN · FR · ع switch, Arabic right to left (src/i18n.js) ---------- */
.lang-switch { position: relative; display: inline-flex; }
.lang-switch select { appearance: none; -webkit-appearance: none; height: 36px; min-width: 40px; padding: 0 8px; border-radius: 10px; cursor: pointer;
  font: 800 13px/1 system-ui, sans-serif; color: #fff; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.25); text-align: center; text-align-last: center; }
.lang-switch[data-lang="ar"] select { font-size: 16px; }
.lang-switch select:focus-visible { outline: 2px solid #e3a51b; outline-offset: 2px; }
/* Arabic: the page reads right to left, but rows of cards and the deck keep their order */
[dir="rtl"] body { font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; }
[dir="rtl"] .hand, [dir="rtl"] .board, [dir="rtl"] .backs, [dir="rtl"] .cut-scene, [dir="rtl"] .fan-card, [dir="rtl"] .hero2-fan, [dir="rtl"] .code, [dir="rtl"] .code-input, [dir="rtl"] .scorebar b { direction: ltr; }
/* the long "About" text under the game is the English page Google reads: shown in English only */
html:not([lang="en"]) .about-game { display: none; }
/* small phones: the language picker takes the place of the 🏆 button (the leaderboard stays on the home page and in the profile) */
@media (max-width: 480px) { #btn-board { display: none; } .top-actions { gap: 4px; } }
/* names keep their own direction inside Arabic (so "#elmoudir" never shows as "elmoudir#") */
[dir="rtl"] .who b, [dir="rtl"] .scorebar .t, [dir="rtl"] .ot-seat, [dir="rtl"] .seat-btn b, [dir="rtl"] .chat-log li b, [dir="rtl"] .hub-chip b,
[dir="rtl"] .reg b, [dir="rtl"] .hub-board .nm, [dir="rtl"] .nameplate, [dir="rtl"] .pn, [dir="rtl"] .owner, [dir="rtl"] .hist td:first-child,
[dir="rtl"] .chkobba-burst span, [dir="rtl"] .ammi-say small { unicode-bidi: plaintext; }
/* narrow phones (≤ 400 px): the logo keeps only the game's name, so the header fits in every language */
@media (max-width: 400px) { .logo > span:not(.logo-txt), .logo-txt em { display: none; } .hub-signin-btn { padding-left: 10px; padding-right: 10px; } }
@media (max-width: 370px) { .logo-txt { display: none; } }

/* "Play with friends" at the top of the home (2026-11-27): a button under the solo ones, it scrolls to the friends panel. */
.play-now .friends-top { grid-column: 1 / -1; width: 100%; }
.panel.friends.flash { animation: friends-flash 1.4s ease-out; }
@keyframes friends-flash { 0%, 40% { box-shadow: 0 0 0 4px #f5c542, 0 0 30px rgba(245, 197, 66, 0.6); } }

/* ===================== Dominoes (2026-12-03) ===================== */
/* A tile: ivory face, two halves of 3 × 3 dot spots, a line and a brass pin in the middle. .v stands up, .h lies down. */
.dt { position: relative; display: inline-flex; flex-direction: column; box-sizing: border-box; padding: 0; margin: 0; font: inherit; color: inherit;
  background: linear-gradient(145deg, #fffdf7 0%, #f4ecda 55%, #e3d6b8 100%); border: 1px solid #b9a982; border-radius: 9% / 4.5%;
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 3px rgba(120, 96, 50, 0.25), 0 2px 4px rgba(0, 0, 0, 0.45); -webkit-tap-highlight-color: transparent; }
.dt.h { flex-direction: row; border-radius: 4.5% / 9%; }
/* Tiles never mirror in Arabic (right to left): the half that touches its neighbour must stay on that side. */
.dt, .line-box { direction: ltr; }
.dt .half { flex: 1 1 0; min-width: 0; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 11%; }
.dt .half i { display: block; border-radius: 50%; margin: 17%; }
.dt .half i.on { background: radial-gradient(circle at 38% 34%, #5a5a5a, #111 62%); box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.25); }
.dt.dbl .half i.on { background: radial-gradient(circle at 38% 34%, #a3412f, #5d150c 62%); } /* doubles: red spots, easy to spot */
.dt .bar { position: relative; flex: none; background: #a8966c; }
.dt.v .bar { height: max(1px, 3%); margin: 0 10%; }
.dt.h .bar { width: max(1px, 1.6%); margin: 10% 0; }
.dt.v > .half, .dt.v > .bar { align-self: stretch; width: auto; } /* a <button> tile does not stretch its children by itself */
.dt.v > .half { width: 100%; box-sizing: border-box; } .dt.h > .half { height: 100%; box-sizing: border-box; }
.dt .bar::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7%; aspect-ratio: 1; min-width: 3px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2b8, #b58a2b 70%); }
.dt.h .bar::after { width: 280%; }
.dt.v .bar::after { width: 14%; }

/* the line on the felt: placed by src/line.js, tiles glide when the line bends again */
.line-box { position: absolute; inset: 8px; }
.line-box .dt.placed { position: absolute; transition: left 0.35s ease, top 0.35s ease, width 0.35s ease, height 0.35s ease; }
.line-box .dt.fresh { animation: tile-land 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.25); z-index: 2; }
@keyframes tile-land { 0% { transform: translateY(-26px) scale(1.35); opacity: 0; filter: drop-shadow(0 18px 10px rgba(0, 0, 0, 0.45)); } 60% { opacity: 1; } }
.line-box .dt.end-pick { cursor: pointer; z-index: 3; box-shadow: 0 0 0 3px var(--tn-gold, #f2c14e), 0 0 18px rgba(242, 193, 78, 0.95); animation: end-pulse 1s ease-in-out infinite; }
.line-box .dt.end-pick::before { content: ""; position: absolute; inset: -14px; } /* a bigger target for a finger */
@keyframes end-pulse { 50% { box-shadow: 0 0 0 5px var(--tn-gold, #f2c14e), 0 0 28px rgba(242, 193, 78, 1); } }
.line-box.choosing .dt.placed:not(.end-pick) { filter: brightness(0.7); }
.line-box .board-empty { position: absolute; inset: 0; display: grid; place-items: center; }

/* the boneyard (1 vs 1) */
.boneyard { position: absolute; right: 8px; bottom: 8px; z-index: 4; display: grid; justify-items: center; gap: 1px; padding: 6px 7px 5px; border: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.28); color: #fff; font: 800 12px system-ui; }
.boneyard .pile { position: relative; display: block; width: 26px; height: 34px; }
.boneyard .pile .mini-tile { position: absolute; left: 0; top: 0; }
.boneyard .pile .mini-tile + .mini-tile { left: 5px; top: 4px; }
.boneyard small { font-size: 11px; color: #1b1205; background: var(--tn-gold, #f2c14e); border-radius: 6px; padding: 1px 6px; }
.boneyard.can { cursor: pointer; box-shadow: 0 0 0 3px var(--tn-gold, #f2c14e), 0 0 20px rgba(242, 193, 78, 0.9); animation: end-pulse 1s ease-in-out infinite; }
.boneyard:disabled { opacity: 0.85; }
/* face-down tiles: the others' hands and the boneyard */
.mini-tile { display: block; width: 9px; height: 17px; border-radius: 2px; background: linear-gradient(145deg, #2c6b4f, #123d2b); border: 1px solid #0b2a1d; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.mini-tile.big { width: 19px; height: 30px; border-radius: 3px; }
.backs { align-items: center; }
.backs .mini-tile + .mini-tile { margin-left: -3px; }
.backs em { font: 900 11px system-ui; font-style: normal; margin-left: 4px; color: rgba(255, 255, 255, 0.85); }
.seat.left .backs .mini-tile + .mini-tile, .seat.right .backs .mini-tile + .mini-tile { margin: -11px 0 0; }
.seat.left .backs em, .seat.right .backs em { margin: 2px 0 0; }

/* my tiles: big enough to tap (7 fit across a 360 px phone; more wrap onto two rows) */
.game .hand { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end; gap: 6px; padding: 6px 4px calc(14px + env(safe-area-inset-bottom));
  --tw: clamp(22px, min(calc((min(100vw, 980px) - 24px) / var(--n, 7) - 6px), calc(19dvh / var(--rows, 1) / 2)), 64px); } /* the hand never takes more than about a fifth of the screen */
.game .hand .dt { width: var(--tw); height: calc(var(--tw) * 2); cursor: default; transition: transform 0.16s, box-shadow 0.16s, filter 0.16s; }
.game .hand.my-turn .dt.legal { cursor: pointer; box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.85), 0 6px 14px rgba(0, 0, 0, 0.45); }
.game .hand.my-turn .dt.legal:hover { transform: translateY(-6px); }
.game .hand.my-turn .dt.dim { filter: brightness(0.55) saturate(0.6); }
.game .hand .dt.selected, .game .hand.my-turn .dt.selected:hover { transform: translateY(-16px) scale(1.06); box-shadow: 0 0 0 3px var(--tn-gold, #f2c14e), 0 0 22px rgba(242, 193, 78, 0.95), 0 12px 20px rgba(0, 0, 0, 0.5); z-index: 2; }
.game .hand .dt.drawn { animation: tile-drawn 0.45s ease-out; }
@keyframes tile-drawn { from { transform: translate(40px, -120px) rotate(25deg) scale(0.6); opacity: 0; } }
.game .hand .dt.shake { animation: shake 0.35s; }
.game .status .mini { margin-left: 6px; vertical-align: 1px; }

/* the result box: each player's tiles left */
.breakdown.pips td { vertical-align: middle; }
.breakdown.pips tr.ours td:first-child { color: var(--tn-sky, #3aa0ff); font-weight: 800; }
.left-tiles { display: flex; flex-wrap: wrap; gap: 3px; max-width: 220px; }
.dt.tiny { width: 40px; height: 20px; }
.result-line { margin: 0 0 10px; font-weight: 700; }

/* home: tiles in the hero instead of cards, and the level pick */
.fan-tile { position: absolute; z-index: 2; }
.fan-tile .dt { width: 58px; height: 116px; box-shadow: 0 18px 30px rgba(0, 0, 0, 0.5); }
.hero2-fan .fan-tile.m0 { top: 120px; left: calc(50% - 190px); transform: rotate(-16deg); }
.hero2-fan .fan-tile.m1 { top: 130px; left: calc(50% + 120px); transform: rotate(14deg); }
.level-pick { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
@media (max-width: 560px) {
  .fan-tile .dt { width: 40px; height: 80px; }
  .hero2-fan .fan-tile.m0 { top: 60px; left: calc(50% - 120px); }
  .hero2-fan .fan-tile.m1 { top: 66px; left: calc(50% + 72px); }
  .line-box { inset: 4px; }
}
@media (prefers-reduced-motion: reduce) { .line-box .dt.placed { transition: none; } .line-box .dt.fresh, .game .hand .dt.drawn, .end-pick, .boneyard.can { animation: none; } }
