@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn[wght].woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #0a1b21; --ink2: #0f272f; --panel: #133440; --panel2: #1a4452;
  --ivory: #f4ead2; --ivory2: #cfc4a8; --mute: #8fa6a8;
  --saffron: #eab04a; --saffron2: #c98a21; --turq: #3cc4b0; --turq2: #1e8f82; --red: #e0604f; --green: #5fcf8a;
  --line: rgba(244, 234, 210, .11);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--ivory); overscroll-behavior: none; }
body {
  font-family: 'Vazirmatn', system-ui, sans-serif; font-size: 15px; line-height: 1.6; font-feature-settings: 'ss01';
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(60, 196, 176, .13), transparent 60%),
    radial-gradient(700px 480px at 0% 110%, rgba(234, 176, 74, .09), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 3 41 22 22 41 3 22Z' fill='none' stroke='%23f4ead2' stroke-opacity='.035'/%3E%3Cpath d='M22 13 31 22 22 31 13 22Z' fill='none' stroke='%233cc4b0' stroke-opacity='.05'/%3E%3C/svg%3E"),
    var(--ink);
  user-select: none; -webkit-user-select: none; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--turq); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

#app { height: 100dvh; position: relative; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: max(14px, env(safe-area-inset-top)) 16px calc(16px + var(--safe-b)); animation: scr .28s ease-out; }
@keyframes scr { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- shared bits ---------- */
.av { position: relative; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none; background: linear-gradient(145deg, var(--turq2), var(--panel)); display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(244, 234, 210, .2); }
.av b { font-weight: 800; font-size: 18px; } .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 34px; height: 34px; } .av.sm b { font-size: 14px; } .av.lg { width: 76px; height: 76px; } .av.lg b { font-size: 30px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 700; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s, filter .12s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #f3c15f, var(--saffron2)); color: #2a1a08; box-shadow: 0 6px 18px rgba(234, 176, 74, .28), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.turq { background: linear-gradient(180deg, #4fd6c2, var(--turq2)); color: #06251f; }
.btn.danger { background: rgba(224, 96, 79, .16); color: #ffb3a8; box-shadow: inset 0 0 0 1px rgba(224, 96, 79, .4); }
.btn.block { width: 100%; } .btn[disabled] { opacity: .5; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: rgba(244, 234, 210, .09); font-size: 13px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(95, 207, 138, .2); }
.muted { color: var(--mute); } .center { text-align: center; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 44px; }
.topbar h2 { font-size: 20px; font-weight: 800; flex: 1; }
.back { width: 44px; height: 44px; border-radius: 50%; background: rgba(244, 234, 210, .08); display: grid; place-items: center; }
.back svg { width: 22px; height: 22px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card { background: linear-gradient(180deg, rgba(26, 68, 82, .75), rgba(19, 52, 64, .75)); border-radius: 20px; padding: 16px; box-shadow: inset 0 0 0 1px var(--line); }

/* toasts, network bar, modals */
#toasts { position: fixed; top: max(12px, env(safe-area-inset-top)); inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; }
.toast { background: #23596a; color: var(--ivory); padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); opacity: 0; transform: translateY(-10px); transition: .25s; max-width: 90vw; text-align: center; }
.toast.in { opacity: 1; transform: none; }
#netbar { position: fixed; bottom: calc(10px + var(--safe-b)); inset-inline: 16px; background: #7a2e25; padding: 9px 14px; border-radius: 12px; text-align: center; z-index: 95; font-weight: 600; }
.modal-back { position: fixed; inset: 0; background: rgba(3, 12, 15, .7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; z-index: 80; opacity: 0; transition: opacity .2s; }
.modal-back.in { opacity: 1; }
.modal { width: min(380px, 100%); background: linear-gradient(180deg, #1c4b59, #11303b); border-radius: 24px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(244, 234, 210, .16); transform: scale(.94); transition: transform .22s cubic-bezier(.2, 1.3, .4, 1); }
.modal-back.in .modal { transform: none; }
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; } .modal p { color: var(--ivory2); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; } .modal-actions .btn { flex: 1; padding: 0 10px; }

/* ---------- splash / gate / states ---------- */
.splash { align-items: center; justify-content: center; gap: 18px; text-align: center; }
.logo { width: 92px; height: 92px; animation: spin 14s linear infinite; filter: drop-shadow(0 6px 22px rgba(234, 176, 74, .3)); }
@keyframes spin { to { transform: rotate(360deg); } }
.splash h1 { font-size: 30px; font-weight: 800; }
.gate-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.gate-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(244, 234, 210, .06); }
.gate-item .t { flex: 1; font-weight: 700; } .gate-item .ok { color: var(--green); font-weight: 800; }
.gate-item a { }

/* ---------- home ---------- */
.home-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.home-head h1 { font-size: 28px; font-weight: 800; line-height: 1.2; flex: 1; }
.me-chip { display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 14px; border-radius: 999px; background: rgba(244, 234, 210, .08); box-shadow: inset 0 0 0 1px var(--line); }
.me-chip small { color: var(--saffron); font-weight: 800; font-size: 14px; }
.banner { display: block; width: 100%; text-align: start; padding: 11px 14px; border-radius: 14px; margin-bottom: 14px; background: linear-gradient(90deg, rgba(234, 176, 74, .2), rgba(60, 196, 176, .14)); box-shadow: inset 0 0 0 1px rgba(234, 176, 74, .35); font-weight: 600; }
.tiles { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.tile { position: relative; display: flex; align-items: stretch; min-height: 138px; border-radius: 24px; overflow: hidden; text-align: start; box-shadow: inset 0 0 0 1px rgba(244, 234, 210, .16), 0 10px 28px rgba(0, 0, 0, .3); transition: transform .15s; }
.tile:active { transform: scale(.985); }
.tile .tx { flex: 1; padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 4px; position: relative; z-index: 1; }
.tile h3 { font-size: 24px; font-weight: 800; } .tile p { color: var(--ivory2); font-size: 14px; }
.tile .art { width: 46%; flex: none; display: grid; place-items: center; }
.tile .art svg { width: 100%; height: 100%; }
.tile.bg1 { background: linear-gradient(135deg, #1f6b6d, #12384a 70%); }
.tile.bg2 { background: linear-gradient(135deg, #5b3a63, #2a1f45 70%); filter: saturate(.75); }
.tile.soon { cursor: default; }
.tile .tag { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; }
.tile .live { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--ivory2); }
.nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; border-radius: 16px; background: rgba(244, 234, 210, .07); font-size: 12.5px; font-weight: 600; color: var(--ivory2); }
.nav button svg { color: var(--saffron); }

/* ---------- lobby ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 18px; background: rgba(0, 0, 0, .28); margin: 6px 0 4px; }
.seg button { padding: 12px 0; border-radius: 13px; font-weight: 700; color: var(--ivory2); display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.seg button b { font-size: 22px; font-weight: 800; } .seg button small { font-size: 12px; opacity: .8; }
.seg button.on { background: linear-gradient(180deg, #f3c15f, var(--saffron2)); color: #2a1a08; box-shadow: 0 4px 14px rgba(234, 176, 74, .3); }
.modes { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.mode { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; text-align: start; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.mode.find { background: linear-gradient(135deg, #7a58e0, #4630a5); } .mode.invite { background: linear-gradient(135deg, #2aa56c, #176b48); }
.mode.ai { background: linear-gradient(135deg, #2f8fb3, #1b4f75); } .mode.ai .ic { font-size: 28px; }
.mode .ic { width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.mode .ic svg { width: 28px; height: 28px; } .mode h3 { font-size: 18px; font-weight: 800; } .mode p { font-size: 13.5px; opacity: .85; }
.hint { margin-top: 14px; font-size: 13.5px; color: var(--mute); padding: 0 4px; }
.searching { position: fixed; inset: 0; z-index: 60; background: rgba(6, 20, 25, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; animation: scr .25s; }
.searching .big { font-size: 22px; font-weight: 800; } .searching .time { font-size: 40px; font-weight: 800; color: var(--saffron); font-variant-numeric: tabular-nums; }
.dice-pair { display: flex; gap: 14px; margin-bottom: 8px; }
.dice-pair .die { animation: bob 1.1s ease-in-out infinite; } .dice-pair .die:nth-child(2) { animation-delay: -.55s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-14px) rotate(8deg); } }
.code { font-size: 40px; font-weight: 800; letter-spacing: .22em; padding-inline-start: .22em; color: var(--saffron); direction: ltr; text-align: center; margin: 6px 0; font-variant-numeric: tabular-nums; }
.linkbox { direction: ltr; text-align: left; font-size: 12.5px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); color: var(--ivory2); word-break: break-all; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; } .stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- lists: leaderboard / profile / help / settings ---------- */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(244, 234, 210, .05); }
.lb-row.me { background: rgba(234, 176, 74, .14); box-shadow: inset 0 0 0 1px rgba(234, 176, 74, .45); }
.lb-row .rk { width: 28px; text-align: center; font-weight: 800; color: var(--ivory2); }
.lb-row:nth-child(1) .rk { color: #ffd76a; font-size: 18px; } .lb-row:nth-child(2) .rk { color: #dfe6ea; font-size: 17px; } .lb-row:nth-child(3) .rk { color: #e2a373; font-size: 16px; }
.lb-row .nm { flex: 1; min-width: 0; } .lb-row .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lb-row .nm small { color: var(--mute); }
.lb-row .rt { font-weight: 800; color: var(--saffron); font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { padding: 12px 6px; border-radius: 16px; background: rgba(244, 234, 210, .06); text-align: center; } .stat b { display: block; font-size: 22px; font-weight: 800; } .stat span { font-size: 12.5px; color: var(--mute); }
.hist { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(244, 234, 210, .05); margin-bottom: 8px; }
.hist .res { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; flex: none; }
.hist .res.w { background: rgba(95, 207, 138, .2); color: var(--green); } .hist .res.l { background: rgba(224, 96, 79, .2); color: #ff9c8f; }
.hist .d { flex: 1; min-width: 0; } .hist .d small { color: var(--mute); display: block; }
.delta.pos { color: var(--green); } .delta.neg { color: #ff9c8f; } .delta { font-weight: 800; direction: ltr; unicode-bidi: embed; }
.help h3 { font-size: 17px; font-weight: 800; margin: 18px 0 6px; color: var(--saffron); } .help p, .help li { color: var(--ivory2); } .help ul { margin: 6px 0; padding-inline-start: 20px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(244, 234, 210, .06); margin-bottom: 10px; }
.set-row .t { flex: 1; } .set-row .t b { display: block; } .set-row .t small { color: var(--mute); }
.switch { width: 52px; height: 30px; border-radius: 999px; background: rgba(0, 0, 0, .4); position: relative; flex: none; transition: background .2s; box-shadow: inset 0 0 0 1px var(--line); }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--ivory); transition: inset-inline-start .2s; }
.switch.on { background: var(--turq2); } .switch.on::after { inset-inline-start: 25px; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.theme { padding: 8px; border-radius: 16px; background: rgba(244, 234, 210, .06); text-align: center; font-weight: 700; font-size: 13px; }
.theme.on { box-shadow: 0 0 0 2px var(--saffron); } .theme i { display: block; height: 42px; border-radius: 10px; margin-bottom: 6px; }
.empty { text-align: center; padding: 36px 10px; color: var(--mute); }

/* ---------- game ---------- */
.game { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 8px calc(8px + var(--safe-b)); animation: scr .3s; }
.pcard { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 18px; background: linear-gradient(180deg, rgba(26, 68, 82, .9), rgba(17, 48, 59, .9)); box-shadow: inset 0 0 0 1px var(--line); position: relative; transition: box-shadow .25s, opacity .25s; opacity: .78; }
.pcard.active { opacity: 1; box-shadow: inset 0 0 0 2px var(--saffron), 0 0 26px rgba(234, 176, 74, .22); }
.pcard.offline .av { filter: grayscale(1); } .pcard.offline::after { content: 'آفلاین'; position: absolute; top: -9px; inset-inline-start: 56px; background: var(--red); font-size: 11.5px; font-weight: 800; padding: 1px 9px; border-radius: 999px; }
.pcard .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pcard .nm { font-weight: 800; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.pcard .sub { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mute); }
.pcard .col { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .35); } .pcard .col.w { background: radial-gradient(circle at 35% 30%, #fff, #d8ccae); } .pcard .col.b { background: radial-gradient(circle at 35% 30%, #5c544e, #120e0b); }
.offbar { display: flex; gap: 2px; } .offbar i { width: 5px; height: 11px; border-radius: 2px; background: rgba(244, 234, 210, .15); } .offbar i.on { background: var(--saffron); }
.pcard .nums { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 84px; }
.score { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; } .score small { font-size: 13px; color: var(--mute); font-weight: 600; }
.clock { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; color: var(--ivory2); }
.pcard.active .clock { color: var(--ivory); } .clock.low { color: #ff8a7a; animation: blink 1s steps(2) infinite; } @keyframes blink { 50% { opacity: .55; } }
.bar { position: absolute; inset-inline: 14px; bottom: 0; height: 3px; border-radius: 3px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--p, 100%); background: linear-gradient(90deg, var(--turq), var(--saffron)); transform-origin: right; } .bar.low i { background: var(--red); }
.board-wrap { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.board-host { position: relative; width: min(100%, calc(100dvh - 292px - var(--safe-b))); aspect-ratio: 1; min-width: 280px; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .55)); }
.board-svg { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.ck { transition: transform .32s cubic-bezier(.3, .8, .3, 1), opacity .3s; pointer-events: none; } .ck.nomove { transition: none; } .ck.leaving { opacity: 0; }
.cnt { font: 800 19px 'Vazirmatn'; paint-order: stroke; } .ck.w .cnt { fill: #4d3a1b; } .ck.b .cnt { fill: #f4ead2; }
.hl { pointer-events: none; } .hits rect { cursor: pointer; }
.dest-tri { fill: rgba(255, 210, 122, .15); stroke: var(--glow); stroke-width: 2; stroke-dasharray: 7 6; animation: march 1.2s linear infinite; } @keyframes march { to { stroke-dashoffset: -26; } }
.dest-dot { fill: rgba(255, 210, 122, .35); stroke: var(--glow); stroke-width: 2.5; animation: pulse 1s ease-in-out infinite; }
.ring-movable { fill: none; stroke: var(--glow); stroke-width: 2.5; stroke-opacity: .6; animation: pulse 1.3s ease-in-out infinite; }
.ring-selected { fill: none; stroke: var(--glow); stroke-width: 4; } .ring-glow { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.dice-layer { position: absolute; inset: 0; margin: auto; width: min(100%, calc(100dvh - 292px - var(--safe-b))); min-width: 280px; aspect-ratio: 1; pointer-events: none; }
.dice-spot { position: absolute; top: 50%; left: 74%; transform: translate(-50%, -50%); display: flex; gap: 10px; align-items: center; justify-content: center; pointer-events: none; width: 44%; flex-wrap: wrap; }
.die { width: 52px; height: 52px; border-radius: 14px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 8px; gap: 1px; background: linear-gradient(145deg, #fffaf0, #d9cdb0); box-shadow: 0 5px 12px rgba(0, 0, 0, .5), inset 0 -3px 0 rgba(120, 96, 50, .25), inset 0 2px 0 #fff; direction: ltr; }
.die.b { background: linear-gradient(145deg, #4a423c, #17120f); box-shadow: 0 5px 12px rgba(0, 0, 0, .55), inset 0 -3px 0 rgba(0, 0, 0, .5), inset 0 2px 0 rgba(255, 255, 255, .18); }
.die i { border-radius: 50%; background: transparent; margin: 1px; } .die i.p { background: #2a1a0e; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5); } .die.b i.p { background: #f4ead2; box-shadow: none; }
.die.used { opacity: .32; transform: scale(.88); transition: .25s; } .die.shake { animation: shake .13s linear infinite; } .die.land { animation: land .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes shake { 0% { transform: rotate(-14deg) translate(-4px, 2px); } 50% { transform: rotate(12deg) translate(4px, -3px); } 100% { transform: rotate(-14deg) translate(-4px, 2px); } }
@keyframes land { from { transform: scale(1.35) rotate(18deg); } to { transform: none; } }
.roll-btn { pointer-events: auto; padding: 14px 26px; border-radius: 18px; font-weight: 800; font-size: 17px; background: linear-gradient(180deg, #f3c15f, var(--saffron2)); color: #2a1a08; box-shadow: 0 8px 22px rgba(234, 176, 74, .45), inset 0 1px 0 rgba(255, 255, 255, .5); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.overlay { position: absolute; inset: 0; margin: auto; display: grid; place-items: center; z-index: 5; pointer-events: none; }
.ovcard { pointer-events: auto; width: min(86%, 330px); padding: 20px 18px; border-radius: 22px; background: rgba(8, 30, 36, .92); box-shadow: 0 16px 50px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(234, 176, 74, .45); text-align: center; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); backdrop-filter: blur(3px); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.ovcard h3 { font-size: 20px; font-weight: 800; color: var(--saffron); margin-bottom: 4px; } .ovcard p { color: var(--ivory2); }
.open-dice { display: flex; justify-content: center; gap: 26px; margin: 14px 0 6px; } .open-dice > div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; } .open-dice .win .die { box-shadow: 0 0 0 3px var(--turq), 0 0 22px rgba(60, 196, 176, .6); }
.mars { display: inline-block; margin: 8px 0 2px; padding: 3px 14px; border-radius: 999px; background: linear-gradient(90deg, #e0604f, #eab04a); color: #2a1208; font-weight: 800; }
.tools { display: flex; gap: 8px; } .tools button { flex: 1; min-height: 46px; border-radius: 14px; background: rgba(244, 234, 210, .08); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tools button[hidden] { display: none; } .tools .off { background: linear-gradient(180deg, #4fd6c2, var(--turq2)); color: #06251f; flex: 2; animation: breathe 1.2s ease-in-out infinite; }
.oppnote { text-align: center; font-size: 12.5px; color: #ffb3a8; margin-top: -2px; }
.emo-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.emo { position: absolute; font-size: 44px; animation: emo 2.2s ease-out forwards; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); } @keyframes emo { 0% { transform: scale(.4); opacity: 0; } 15% { transform: scale(1.2); opacity: 1; } 100% { transform: translateY(-80px) scale(1); opacity: 0; } }
.emo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; } .emo-grid button { font-size: 30px; padding: 8px 0; border-radius: 14px; background: rgba(244, 234, 210, .08); }
.result-top { text-align: center; } .result-top .big { font-size: 34px; font-weight: 800; } .result-top .big.win { color: var(--saffron); } .result-top .big.lose { color: #ff9c8f; }
.rate { display: flex; justify-content: center; align-items: baseline; gap: 10px; margin: 14px 0 2px; } .rate b { font-size: 32px; font-weight: 800; }
@media (max-height: 640px) { .pcard .av { width: 36px; height: 36px; } .die { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; } }
.tools .done { background: linear-gradient(180deg, #f6c66a, #d8932a); color: #2a1706; flex: 2; animation: breathe 1.2s ease-in-out infinite; }
.dhint { position: absolute; inset-inline: 0; top: calc(100% + 6px); text-align: center; font-size: 12.5px; color: #f6d78f; white-space: nowrap; pointer-events: none; }
.die.pick { pointer-events: auto; cursor: pointer; outline: 2px dashed rgba(246, 198, 106, .75); outline-offset: 3px; transition: transform .15s, outline-color .15s; }
.die.pick:active { transform: scale(.94); }
.die.picked { outline: 3px solid #f6c66a; outline-offset: 3px; transform: translateY(-4px) scale(1.08); box-shadow: 0 0 18px rgba(246, 198, 106, .8), 0 8px 14px rgba(0, 0, 0, .5); }
.watchers { position: absolute; top: 8px; inset-inline-end: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(10, 27, 33, .72); border: 1px solid rgba(246, 198, 106, .35); color: #f6d78f; font-size: 13px; font-weight: 700; pointer-events: none; backdrop-filter: blur(6px); }
.watchers[hidden] { display: none; }
.tools .leave { background: rgba(214, 90, 70, .22); }

/* ================= Hokm ================= */
.suit-row { font-size: 46px; letter-spacing: .15em; direction: ltr; color: var(--saffron); }
.ttable { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 14px 0; direction: ltr; }
.trow { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; }
.tfelt { flex: 0 0 90px; height: 90px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #1d6a5c, #0f4038); border: 2px solid rgba(234,176,74,.5); font-size: 20px; color: var(--ivory2); }
.tseat { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 104px; padding: 10px 6px; border-radius: 16px; background: rgba(0,0,0,.28); border: 1.5px dashed var(--line); direction: rtl; }
.tseat.taken { border-style: solid; background: var(--panel); }
.tseat.mine { border-color: var(--saffron); }
.tseat:disabled { opacity: 1; cursor: default; }
.tseat b { font-size: 13px; max-width: 94px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tseat small { color: var(--mute); font-size: 11px; }
.tseat.s0, .tseat.s2 { box-shadow: inset 0 -3px 0 var(--turq2); }
.tseat.s1, .tseat.s3 { box-shadow: inset 0 -3px 0 var(--saffron2); }
.empty-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: 20px; color: var(--mute); }

.hk { --cw: min(60px, 15vw); position: absolute; inset: 0; display: flex; flex-direction: column; padding: max(8px, env(safe-area-inset-top)) 10px calc(8px + var(--safe-b)); gap: 6px; background: linear-gradient(180deg, #0e1f1c, #0a1613); animation: scr .3s; overflow: hidden; }
.hk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hk-exit, .hk-share { padding: 8px 16px; border-radius: 14px; background: linear-gradient(180deg, #3a2a1e, #22170f); border: 1.5px solid #8a6a33; color: var(--ivory); font-weight: 700; font-size: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.hk-share[hidden] { display: none; }
.hk-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hk-sub { font-size: 11px; color: var(--ivory2); }
.hk-score { display: flex; align-items: center; gap: 12px; padding: 4px 18px; border-radius: 18px; background: #0b1d1b; border: 1.5px solid #8a6a33; box-shadow: inset 0 0 10px rgba(0,0,0,.6); }
.hk-score .t { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.hk-score small { font-size: 11px; color: var(--ivory2); } .hk-score b { font-size: 22px; font-variant-numeric: tabular-nums; }
.hk-score .me b { color: var(--turq); } .hk-score span { color: var(--mute); }
.hk-right { display: flex; gap: 6px; align-items: center; }
.hk-trump { display: flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 14px; background: linear-gradient(180deg, #3a2a1e, #22170f); border: 1.5px solid #c9a24a; box-shadow: 0 2px 8px rgba(0,0,0,.5); line-height: 1; }
.hk-trump small { font-size: 14px; font-weight: 800; color: var(--saffron); } .hk-trump b { font-size: 24px; color: #f5f0e0; }
.hk-trump.on.red b { color: #ff6a5b; }

/* wooden-framed felt table */
.hk-table { position: relative; flex: 1; min-height: 0; margin: 14px 0 0; direction: ltr; border-radius: 28px; padding: 9px; background: linear-gradient(135deg, #6b4524, #3c2410 40%, #5a3a1b 70%, #2e1b0b); box-shadow: 0 8px 22px rgba(0,0,0,.65), inset 0 0 0 1.5px rgba(246,198,106,.35); }
.hk-table::before { content: ''; position: absolute; inset: 9px; border-radius: 20px; background: radial-gradient(ellipse at 50% 45%, #1f7a57 0%, #14573f 55%, #0c3a2a 100%); box-shadow: inset 0 0 28px rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.4); }
.hk-table::after { content: '♠ ♥ ♣ ♦'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 54px; letter-spacing: .3em; color: rgba(255,255,255,.045); pointer-events: none; white-space: nowrap; }

.seat { position: absolute; display: flex; align-items: center; gap: 6px; z-index: 3; --av: 56px; }
.seat .badge { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; direction: rtl; }
.seat .ring { position: relative; width: calc(var(--av) + 10px); height: calc(var(--av) + 10px); border-radius: 50%; padding: 4px; display: grid; place-items: center; background: conic-gradient(#ffd166 var(--p, 0%), #c9a24a55 0); box-shadow: 0 0 0 2px #2a1a0a, 0 4px 12px rgba(0,0,0,.6); }
.seat .ring::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: linear-gradient(135deg, #f6d27a, #8a5a12); }
.seat.ally .ring::before { background: linear-gradient(135deg, #7be3d2, #1e8f82); }
.seat.active .ring { box-shadow: 0 0 0 2px #2a1a0a, 0 0 18px 4px rgba(255,209,102,.75); animation: pulse 1.2s infinite; }
.seat .ring.low { background: conic-gradient(#ff6a5b var(--p, 0%), #ff6a5b33 0); }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px #2a1a0a, 0 0 26px 8px rgba(255,209,102,.5); } }
.seat .avw { position: relative; z-index: 1; border-radius: 50%; overflow: hidden; display: grid; width: var(--av); height: var(--av); border: 2px solid #1a1007; }
.seat .avw .av { width: 100%; height: 100%; }
.seat.offline .ring { filter: grayscale(1); opacity: .6; }
.seat .plate { margin-top: -9px; z-index: 2; padding: 1px 12px 2px; min-width: 70px; text-align: center; border-radius: 10px; background: linear-gradient(180deg, #1c3731, #0b1b18); border: 1.5px solid #8a6a33; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.seat.hakem .plate { border-color: #ffd166; background: linear-gradient(180deg, #4a3510, #1f1606); }
.seat .nm { font-size: 12px; font-weight: 800; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .cnt { position: absolute; z-index: 3; right: -16px; top: -2px; min-width: 30px; padding: 1px 5px; border-radius: 10px; background: #0b1b18; border: 1.5px solid #c9a24a; text-align: center; line-height: 1.05; box-shadow: 0 2px 5px rgba(0,0,0,.6); }
.seat .cnt b { display: block; font-size: 14px; color: #ffd166; } .seat .cnt small { display: block; font-size: 9px; color: var(--ivory2); }
.seat .crown { position: absolute; z-index: 4; top: -16px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 22px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.seat .crown[hidden] { display: none; }
.tbar { display: none; }
.tbar.wide { display: block; position: static; margin-top: 10px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.tbar i { display: block; height: 100%; width: 0; background: #3cc4b0; }
.tbar.low i { background: var(--red); }
.seat.t { top: 12px; left: 50%; transform: translateX(-50%); flex-direction: column; gap: 3px; }
.seat.l { left: 4px; top: 53%; transform: translateY(-50%); flex-direction: column; gap: 4px; --av: 50px; }
.seat.r { right: 4px; top: 53%; transform: translateY(-50%); flex-direction: column; gap: 4px; --av: 50px; }
.seat.b { margin-top: 10px; position: static; flex-direction: column; justify-content: center; --av: 44px; }
.seat .backs { display: flex; height: 34px; }
.seat.l .plate, .seat.r .plate { min-width: 60px; } .seat.l .nm, .seat.r .nm { max-width: 66px; }
.seat .pile { display: none; }

/* cards */
.pk { position: relative; width: var(--cw); height: calc(var(--cw) * 1.45); border-radius: calc(var(--cw) * .12); background: linear-gradient(160deg, #fffdf5, #f1e8d0); color: #1d1b26; box-shadow: 0 2px 7px rgba(0,0,0,.5), inset 0 0 0 1px rgba(150,120,50,.35); flex: 0 0 auto; direction: ltr; font-family: 'Georgia', 'Times New Roman', serif; overflow: hidden; }
.pk.red { color: #c0281f; }
.pk .cn { position: absolute; top: 3%; left: 6%; display: flex; flex-direction: column; align-items: center; line-height: .95; z-index: 2; }
.pk .cn:last-child { top: auto; left: auto; right: 6%; bottom: 3%; transform: rotate(180deg); }
.pk .cn b { font-size: calc(var(--cw) * .3); font-weight: 800; } .pk .cn i { font-style: normal; font-size: calc(var(--cw) * .27); }
.pk .pips { position: absolute; left: 22%; right: 22%; top: 13%; bottom: 13%; }
.pk .pip { position: absolute; font-style: normal; font-size: calc(var(--cw) * .3); transform: translate(-50%, -50%); line-height: 1; }
.pk .pip.f { transform: translate(-50%, -50%) rotate(180deg); }
.pk .pips.ace { display: grid; place-items: center; left: 0; right: 0; top: 0; bottom: 0; }
.pk .pip.big { position: static; transform: none; font-size: calc(var(--cw) * .85); }
.pk .art { position: absolute; left: 20%; right: 20%; top: 10%; bottom: 10%; }
.pk .art svg { width: 100%; height: 100%; display: block; }
.pk .art .ap { position: absolute; right: 2px; top: 1px; font-style: normal; font-size: calc(var(--cw) * .2); }
.pk.back { background: radial-gradient(circle at 50% 50%, #234a8a 0%, #14285a 70%); border: calc(var(--cw) * .09) solid #f3ead2; box-shadow: 0 2px 6px rgba(0,0,0,.55); }
.pk.back::after { content: ''; position: absolute; inset: 12%; border-radius: 4px; border: 1px solid rgba(246,210,122,.6); background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(246,210,122,.22) 4px 5px), repeating-linear-gradient(-45deg, transparent 0 4px, rgba(246,210,122,.22) 4px 5px); }
.pk.back.mini { --cw: 24px; margin-inline-start: -15px; }
.pk.back.mini:first-child { margin-inline-start: 0; }
.pk.back.sm { --cw: 18px; }

.hk-center { --cw: min(60px, 16vw); position: absolute; left: 50%; top: 56%; width: calc(var(--cw) * 2.8); height: calc(var(--cw) * 3); transform: translate(-50%, -50%); z-index: 6; }
.hk-center .pk { position: absolute; left: 50%; top: 50%; margin: 0; transition: translate .4s ease, opacity .4s ease, scale .4s ease; }
.hk-center .pk[data-pos='b'] { transform: translate(-50%, 2%) rotate(var(--rot)); z-index: 4; }
.hk-center .pk[data-pos='t'] { transform: translate(-50%, -76%) rotate(var(--rot)); z-index: 1; }
.hk-center .pk[data-pos='l'] { transform: translate(-96%, -50%) rotate(var(--rot)); z-index: 2; }
.hk-center .pk[data-pos='r'] { transform: translate(-4%, -50%) rotate(var(--rot)); z-index: 3; }
.hk-center .pk.play { animation: fly .34s cubic-bezier(.2, .8, .3, 1); }
.hk-center .from-b { --fx: 0px; --fy: 220px; } .hk-center .from-t { --fx: 0px; --fy: -200px; } .hk-center .from-l { --fx: -190px; --fy: 0px; } .hk-center .from-r { --fx: 190px; --fy: 0px; }
@keyframes fly { from { translate: var(--fx) var(--fy); opacity: .2; scale: 1.2; } to { translate: 0 0; opacity: 1; scale: 1; } }
.hk-center .pk.sweeping { opacity: 0; scale: .45; }
.hk-center .pk.sweeping.to-b { translate: 0 260px; } .hk-center .pk.sweeping.to-t { translate: 0 -260px; } .hk-center .pk.sweeping.to-l { translate: -260px 0; } .hk-center .pk.sweeping.to-r { translate: 260px 0; }

.hk-status { text-align: center; font-size: 14px; font-weight: 700; padding: 4px 12px; color: var(--ivory2); }
.hk-status.mine { margin: 0 auto; padding: 6px 22px; border-radius: 14px; background: linear-gradient(180deg, #f6d27a, #c9962c); color: #2b1b00; box-shadow: 0 2px 10px rgba(201,150,44,.5); }
.hk-hand { position: relative; height: calc(var(--cw) * 1.45 + 30px); display: flex; justify-content: center; align-items: flex-end; direction: ltr; padding-bottom: 6px; touch-action: none; }
.hk-hand[hidden] { display: none; }
.hk-hand .hc { margin-inline-start: calc(var(--cw) * -.54); transform-origin: 50% 170%; transform: rotate(calc(var(--d) * 2.4deg)) translateY(calc(var(--d) * var(--d) * .7px)); transition: transform .18s, filter .2s; cursor: pointer; }
.hk-hand .hc:first-child { margin-inline-start: 0; }
.hk-hand .hc.dim { filter: brightness(.62) saturate(.7); }
.hk-hand .hc.legal { box-shadow: 0 0 0 2px rgba(255,209,102,.85), 0 3px 9px rgba(0,0,0,.5); }
.hk-hand .hc.sel { transform: translateY(-26px) scale(1.07); z-index: 5; }
.hk-hand .hc.nope { animation: nope .3s; }
.hk-hand .hc.dragging { transition: none; z-index: 9; }
.hk-hand.dealing .hc { animation: dealin .5s backwards; }
@keyframes nope { 30% { translate: -5px 0; } 70% { translate: 5px 0; } }
@keyframes dealin { from { opacity: 0; translate: 0 -80px; } }

.hk-overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 6; pointer-events: none; direction: rtl; }
.hk-overlay .ovc { pointer-events: auto; padding: 16px 20px; border-radius: 20px; background: rgba(8, 20, 17, .94); border: 1.5px solid #8a6a33; text-align: center; max-width: 94%; animation: scr .25s; }
.hk-overlay h3 { font-size: 18px; margin-bottom: 4px; }
.hk-overlay .suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; direction: ltr; }
.hk-overlay .suit { display: flex; flex-direction: column; align-items: center; padding: 10px 10px; border-radius: 14px; background: linear-gradient(160deg, #fffdf5, #f1e8d0); color: #1d1b26; box-shadow: inset 0 0 0 1px #c9a24a; }
.hk-overlay .suit.red { color: #c0281f; } .hk-overlay .suit b { font-size: 32px; line-height: 1.1; } .hk-overlay .suit small { font-size: 11px; }
.hk-overlay .ace-cards { display: flex; gap: 8px; justify-content: center; margin: 10px 0; direction: ltr; }
.hk-overlay .ace-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; }
.hk-overlay .ace-slot small { font-size: 10px; color: var(--ivory2); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk-overlay .ace-slot .pk { --cw: 44px; margin-top: -42px; animation: dealin .3s; } .hk-overlay .ace-slot .pk:first-of-type { margin-top: 0; }
.hk-overlay .ace-slot.won .pk:last-child { box-shadow: 0 0 0 3px #ffd166; }
.hk-overlay .round .kind { font-size: 28px; font-weight: 800; color: var(--saffron); }
.hk-overlay .round.good { border-color: var(--green); }
.hk-overlay .round .tr { display: flex; gap: 16px; justify-content: center; margin: 6px 0; font-size: 13px; }
.hk-watch { font-size: 12px; }
.seat.l .pk.back.mini, .seat.r .pk.back.mini { margin-inline-start: -19px; } .seat.l .pk.back.mini:first-child, .seat.r .pk.back.mini:first-child { margin-inline-start: 0; }

/* ================= Chess ================= */
.tile.bg3 { background: linear-gradient(135deg, #7a4a24, #3b2312 75%); }
.hist .res.d { background: rgba(234, 176, 74, .2); color: var(--saffron); }
.ch { background: linear-gradient(180deg, #0e1f1c, #0a1613); gap: 6px; }
.chp { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 12px 8px; border-radius: 16px; background: linear-gradient(180deg, #17302b, #0b1b18); border: 1.5px solid #8a6a33; box-shadow: 0 3px 8px rgba(0,0,0,.5); transition: box-shadow .2s, border-color .2s; }
.chp.active { border-color: #ffd166; box-shadow: 0 0 0 2px rgba(255,209,102,.3), 0 0 16px rgba(255,209,102,.45); }
.chp.offline .avw { filter: grayscale(1); opacity: .6; }
.chp .avw .av { width: 42px; height: 42px; border: 2px solid #c9a24a; }
.chp .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chp .nm { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chp .sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mute); }
.chp .col { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); } .chp .col.w { background: #f8f1de; } .chp .col.b { background: #2b2623; }
.chp .cap { display: flex; align-items: center; flex-wrap: nowrap; min-height: 18px; direction: ltr; gap: 0; overflow: hidden; }
.chp .cap .ci { width: 17px; height: 17px; margin-inline-end: -5px; flex: none; } .chp .cap .ci svg { width: 100%; height: 100%; }
.chp .cap b { font-size: 12px; color: var(--ivory2); margin-inline-start: 9px; }
.cclock { min-width: 84px; text-align: center; padding: 4px 10px; border-radius: 10px; background: rgba(0,0,0,.45); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; color: var(--ivory2); }
.cclock.on { background: #f4ead2; color: #1b130a; } .cclock.low { background: #c9372c; color: #fff; animation: blink 1s steps(2) infinite; }
.chp .bar { position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; } .chp .bar i { display: block; height: 100%; background: #3cc4b0; }
.cboard-wrap { position: relative; width: min(100%, calc(100dvh - 350px)); aspect-ratio: 1; align-self: center; flex: none; padding: 8px; border-radius: 14px; background: linear-gradient(135deg, #6b4524, #3c2410 40%, #5a3a1b 70%, #2e1b0b); box-shadow: 0 8px 22px rgba(0,0,0,.65), inset 0 0 0 1.5px rgba(246,198,106,.35); }
.cboard { position: relative; width: 100%; height: 100%; border-radius: 4px; overflow: hidden; direction: ltr; touch-action: none; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.sqs { position: absolute; inset: 0; display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr); }
.sq { position: relative; } .sq.lt { background: #ecd9b0; } .sq.dk { background: #a9774a; }
.sq.last::before { content: ''; position: absolute; inset: 0; background: rgba(255, 214, 80, .45); }
.sq.sel::before { content: ''; position: absolute; inset: 0; background: rgba(80, 200, 120, .55); }
.sq.chk::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 40, 30, .95) 0%, rgba(255, 40, 30, .55) 45%, transparent 75%); }
.sq.mv::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(20, 60, 40, .42); }
.sq.cap::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid rgba(20, 60, 40, .42); }
.coords { position: absolute; inset: 0; pointer-events: none; font-size: 10px; font-weight: 800; }
.coords .cf { position: absolute; bottom: 1px; width: 12.5%; text-align: end; padding-inline-end: 3px; font-style: normal; } .coords .cr { position: absolute; left: 2px; height: 12.5%; font-style: normal; }
.cf:nth-of-type(odd), .cr { color: #7a5230; } .coords .cf { color: #7a5230; }
.pcs { position: absolute; inset: 0; pointer-events: none; }
.cp { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; transform: translate(var(--x), var(--y)); transition: transform .2s ease, opacity .18s; pointer-events: auto; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.cp svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.cp.gone { opacity: 0; transform: translate(var(--x), var(--y)) scale(.6); pointer-events: none; }
.cp.drag { transition: none; z-index: 9; filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)); }
.cboard:not(.mine) .cp { cursor: default; }
.promo { position: absolute; inset: 0; z-index: 8; background: rgba(8, 20, 17, .78); display: grid; place-items: center; align-content: center; gap: 10px; direction: rtl; }
.promo[hidden] { display: none; }
.promo .pbox { text-align: center; background: #f4ead2; color: #1b130a; border-radius: 16px; padding: 10px 12px; } .promo .pr { display: flex; gap: 6px; margin-top: 6px; direction: ltr; }
.promo .pr button { width: 58px; height: 58px; border-radius: 12px; background: #a9774a; } .promo .pr button svg { width: 100%; height: 100%; }
.promo .pc { padding: 6px 18px; border-radius: 12px; background: rgba(255,255,255,.14); }
.chbanner { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); z-index: 7; min-width: 220px; text-align: center; padding: 8px 14px; border-radius: 14px; background: rgba(8, 20, 17, .95); border: 1.5px solid #c9a24a; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.chbanner[hidden] { display: none; } .chbanner .row { display: flex; gap: 8px; margin-top: 6px; } .chbanner .btn { flex: 1; padding: 6px; }
.mlist { display: flex; gap: 6px; align-items: center; overflow-x: auto; white-space: nowrap; padding: 6px 4px; font-size: 13.5px; direction: ltr; scrollbar-width: none; min-height: 34px; } .mlist::-webkit-scrollbar { display: none; }
.mlist .mn { color: var(--mute); font-size: 12px; } .mlist .mv { padding: 1px 7px; border-radius: 8px; background: rgba(244,234,210,.08); font-weight: 700; } .mlist .mv.cur { background: var(--saffron); color: #2b1b00; }
.ch-tools button.dim { opacity: .55; }
@media (max-height: 700px) { .cboard-wrap { width: min(100%, calc(100dvh - 310px)); } .chp { padding: 4px 10px 6px; } .chp .avw .av { width: 34px; height: 34px; } .cclock { font-size: 19px; min-width: 72px; } }
.cboard-wrap .watchers { top: -12px; inset-inline-end: 10px; z-index: 9; }

/* ---------- Menchi (ludo) ---------- */
.tile.bg4 { background: linear-gradient(135deg, #2f5b3a, #14301f 75%); }
.lu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: max(8px, env(safe-area-inset-top)) 10px calc(8px + var(--safe-b)); gap: 6px; background: radial-gradient(900px 500px at 50% 30%, #1d3a30, #0a1613); animation: scr .3s; overflow: hidden; }
.lu-top { width: 100%; max-width: 520px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lu-title { display: flex; flex-direction: column; align-items: center; line-height: 1.15; } .lu-title b { font-size: 17px; } .lu-title small { color: var(--mute); font-size: 11px; }
.lu-btn { padding: 8px 14px; border-radius: 14px; background: linear-gradient(180deg, #3a2a1e, #22170f); border: 1.5px solid #8a6a33; color: var(--ivory); font-weight: 700; font-size: 13px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.lu-btn[hidden] { display: none; } .lu-btn.end.on { background: linear-gradient(180deg, #2f7a54, #1b4a33); border-color: #6fe0a0; } .lu-btn:disabled { opacity: .5; }
.lu-row { width: 100%; max-width: 520px; display: flex; justify-content: space-between; gap: 8px; min-height: 52px; direction: ltr; }
.lu-badge { --c: #888; --cd: #444; display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 40px; background: rgba(0,0,0,.35); border: 1.5px solid color-mix(in srgb, var(--c) 60%, transparent); max-width: 49%; transition: .25s; position: relative; direction: rtl; }
.lu-badge[hidden] { display: none; } .lu-badge.d1, .lu-badge.d0 { margin-right: auto; } .lu-badge.d2, .lu-badge.d3 { margin-left: auto; }
.lu-badge.active { background: color-mix(in srgb, var(--c) 35%, #000a); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 70%, transparent); transform: scale(1.04); }
.lu-badge.done { opacity: .75; } .lu-badge.offline { filter: grayscale(.8); }
.lu-badge .ring { --p: 0%; width: 46px; height: 46px; border-radius: 50%; padding: 3px; flex: none; background: conic-gradient(var(--c) var(--p), rgba(255,255,255,.12) 0); transition: background .1s; }
.lu-badge .ring.low { background: conic-gradient(#ff5a4a var(--p), rgba(255,255,255,.12) 0); animation: lupulse .6s infinite alternate; }
@keyframes lupulse { to { transform: scale(1.08); } }
.lu-badge .avw { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; } .lu-badge .avw .av { width: 100%; height: 100%; }
.lu-badge .plate { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lu-badge .nm { font-size: 12.5px; font-weight: 700; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-badge .tag { font-size: 10.5px; color: var(--ivory2); } .lu-badge .tag.vote { color: #7ff0b0; font-weight: 700; }
.lu-badge .med { position: absolute; top: -8px; inset-inline-end: -4px; font-size: 20px; }
.lu-frame { width: min(100%, 520px, calc(100dvh - 250px)); aspect-ratio: 1; padding: 9px; border-radius: 22px; background: linear-gradient(145deg, #9a6532, #5a3416 55%, #7b4a22); box-shadow: 0 10px 30px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.25), inset 0 -3px 6px rgba(0,0,0,.4); flex: none; }
.lu-board { position: relative; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.lu-svg { width: 100%; height: 100%; display: block; }
.lu-pc { transition: transform .13s linear; cursor: default; } .lu-pc-in { transform-box: fill-box; transform-origin: center; }
.lu-pc.moving .lu-pc-in { animation: luhop .13s ease-out; } @keyframes luhop { 50% { transform: translateY(-9px) scale(1.12); } }
.lu-pc.hit .lu-pc-in { animation: luhit .5s; } @keyframes luhit { 30% { transform: scale(1.5) rotate(20deg); opacity: .8; } 100% { transform: scale(.6); opacity: .2; } }
.lu-pc.can { cursor: pointer; } .lu-pc.can .lu-pc-in { animation: lucan .7s infinite alternate; filter: drop-shadow(0 0 7px #fff); } @keyframes lucan { to { transform: translateY(-5px) scale(1.1); } }
.lu-mark { cursor: pointer; } .lu-mark-c { fill: rgba(255,255,255,.18); stroke: #fff; stroke-width: 3; stroke-dasharray: 8 6; animation: luspin 3s linear infinite; transform-box: fill-box; transform-origin: center; } .lu-mark.hit .lu-mark-c { stroke: #ff5a4a; fill: rgba(255,90,74,.25); } .lu-mark-d { fill: #fff; }
@keyframes luspin { to { transform: rotate(360deg); } }
.lu-centre { position: absolute; left: 36.4%; top: 36.4%; width: 27.2%; height: 27.2%; display: grid; place-items: center; pointer-events: none; }
.lu-die { --dc: #e04a3c; --dd: #8f1f16; --dl: #ff8a78; pointer-events: auto; width: 46%; aspect-ratio: 1; border-radius: 22%; background: linear-gradient(145deg, #fffdf6, #e8dcc0); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 11%; gap: 2%; box-shadow: 0 5px 12px rgba(0,0,0,.55), inset 0 -4px 0 rgba(0,0,0,.14), 0 0 0 3px var(--dc); transition: transform .2s; }
.lu-die[hidden] { display: none; } .lu-die i { border-radius: 50%; } .lu-die i.on { background: radial-gradient(circle at 35% 30%, #555, #111 70%); box-shadow: inset 0 1px 1px rgba(255,255,255,.3); }
.lu-die .q { grid-area: 2 / 2; text-align: center; font-weight: 800; color: #6b5a3a; font-size: 24px; line-height: 1; }
.lu-die.ready { animation: luready 1s infinite alternate; cursor: pointer; box-shadow: 0 5px 12px rgba(0,0,0,.55), 0 0 0 4px var(--dc), 0 0 22px var(--dl); } @keyframes luready { to { transform: scale(1.12) rotate(-6deg); } }
.lu-die.rolling { animation: lushake .14s infinite; } @keyframes lushake { 25% { transform: rotate(14deg) translateY(-4px); } 75% { transform: rotate(-14deg) translateY(2px); } }
.lu-diehint { position: absolute; bottom: -2px; font-size: 10.5px; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; }
.lu-status { min-height: 28px; font-weight: 700; font-size: 14px; color: var(--ivory2); text-align: center; } .lu-status.mine { color: var(--saffron); animation: lupulse .8s infinite alternate; }
.lu-bar { display: flex; gap: 10px; justify-content: center; width: 100%; max-width: 520px; flex-wrap: wrap; }
.lu-rank { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; } .lu-rank .row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.06); } .lu-rank .row.me { background: rgba(234,176,74,.18); } .lu-rank .row b { flex: 1; text-align: start; } .lu-rank .medal { font-size: 20px; }
.lu-rank .delta.pos { color: var(--green); } .lu-rank .delta.neg { color: var(--red); }
.lu .emo-layer .emo { font-size: 38px; }
.tseat.s0.l2, .tseat.s0.l3 { }
.lutable { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; direction: rtl; }
.lutable .tseat { width: auto; }

/* ---------- Shelem ---------- */
.seg.fam { margin: 0 0 10px; }
.ovc.bid, .ovc.kitty { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 250px; max-width: 92%; }
.ovc.bid h3, .ovc.kitty h3 { font-size: 16px; }
.bids { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.bids .bd { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1.5px solid transparent; min-width: 0; }
.bids .bd small { font-size: 10px; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ivory2); }
.bids .bd b { font-size: 15px; } .bids .bd.on { border-color: var(--saffron); box-shadow: 0 0 10px rgba(234,176,74,.5); } .bids .bd.pass { opacity: .45; } .bids .bd.top b { color: var(--saffron); }
.stepper { display: flex; align-items: center; gap: 14px; } .stepper .st { width: 42px; height: 42px; border-radius: 50%; font-size: 24px; font-weight: 800; background: linear-gradient(180deg, #3a2a1e, #22170f); border: 1.5px solid #8a6a33; } .stepper .st:disabled { opacity: .35; } .stepper .val { font-size: 32px; min-width: 70px; text-align: center; color: var(--saffron); }
.ovc.bid .row { display: flex; gap: 8px; width: 100%; } .ovc.bid .row .btn { flex: 1; }
.hk-hand .hc.new { box-shadow: 0 0 0 2px var(--saffron), 0 0 12px rgba(234,176,74,.8); }
.hk-hand .hc.sel { transform: translateY(-16px); }
.pk.joker { display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(160deg, #fffdf5, #efe3c6); border: 1px solid #c9a24a; }
.pk.joker .cn { position: absolute; top: 4%; inset-inline-start: 9%; line-height: 1; font-size: calc(var(--cw) * .26); color: #1d1b26; } .pk.joker.red .cn { color: #c4281c; }
.pk.joker .jk { font-size: calc(var(--cw) * .66); line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); } .pk.joker.big .jk { filter: drop-shadow(0 0 4px rgba(224,74,60,.6)); }
.pk.joker small { font-size: calc(var(--cw) * .15); color: #6b5a3a; font-weight: 700; margin-top: 2px; }
.stepper { direction: ltr; }

/* ---------- Domino ---------- */
.tile.bg5 { background: linear-gradient(135deg, #1d5a4c, #0e2f29 75%); }
.dt { --s: 22px; display: flex; width: calc(var(--s) * 2); height: var(--s); border-radius: calc(var(--s) * .22); background: linear-gradient(160deg, #fffdf5, #ece0c2); box-shadow: 0 2px 5px rgba(0,0,0,.5), inset 0 0 0 1px rgba(120,90,40,.4); direction: ltr; flex: none; }
.dt.v { flex-direction: column; width: var(--s); height: calc(var(--s) * 2); }
.dh { width: var(--s); height: var(--s); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: calc(var(--s) * .16); gap: 0; place-items: center; }
.dt .dh + .dh { border-left: max(1px, calc(var(--s) * .06)) solid #8a6a33; } .dt.v .dh + .dh { border-left: 0; border-top: max(1px, calc(var(--s) * .06)) solid #8a6a33; }
.dh i { width: 74%; height: 74%; border-radius: 50%; } .dh i.on { background: radial-gradient(circle at 35% 30%, #4a4a52, #111 70%); box-shadow: inset 0 1px 1px rgba(255,255,255,.25); }
.dm-frame { width: min(100%, 520px); padding: 8px; border-radius: 20px; background: linear-gradient(145deg, #9a6532, #5a3416 55%, #7b4a22); box-shadow: 0 10px 30px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.25); flex: none; }
.dm-board { --u: 24px; position: relative; width: 100%; aspect-ratio: 14 / 13; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #1f7a5f, #105040 70%); box-shadow: inset 0 0 0 2px rgba(0,0,0,.4), inset 0 0 40px rgba(0,0,0,.35); }
.dm-pieces { position: absolute; inset: 0; }
.dm-piece { position: absolute; --s: var(--u); } .dm-piece.pop { animation: dmpop .35s ease-out; } @keyframes dmpop { 0% { transform: scale(1.5); opacity: 0; } 100% { transform: none; opacity: 1; } }
.dm-ghost { position: absolute; border-radius: calc(var(--u) * .25); border: 2px dashed #fff; background: rgba(255,255,255,.16); color: #fff; font-size: calc(var(--u) * .8); font-weight: 800; display: grid; place-items: center; animation: lupulse .7s infinite alternate; cursor: pointer; }
.dm-ends { position: absolute; top: 6px; inset-inline-start: 8px; display: flex; flex-direction: column; line-height: 1.1; background: rgba(0,0,0,.35); padding: 3px 8px; border-radius: 10px; } .dm-ends small { font-size: 10px; color: var(--ivory2); } .dm-ends b { font-size: 14px; }
.dm-bone { position: absolute; bottom: 6px; inset-inline-end: 8px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; background: rgba(0,0,0,.35); padding: 3px 10px; border-radius: 10px; } .dm-bone small { font-size: 10px; color: var(--ivory2); } .dm-bone[hidden] { display: none; }
.dm-hint { position: absolute; left: 0; right: 0; top: 56%; text-align: center; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; padding: 0 12px; }
.dm-over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,20,16,.96); z-index: 4; } .dm-over[hidden] { display: none; }
.dm-over .ovc { width: 94%; padding: 10px 12px; } .dm-over h3 { font-size: 15px; margin-bottom: 6px; }
.rvs { display: flex; flex-direction: column; gap: 5px; width: 100%; } .rv { display: flex; align-items: center; gap: 8px; direction: rtl; } .rv b { min-width: 52px; font-size: 12px; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 64px; } .rv .tiles { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; direction: ltr; } .rv .pp { font-weight: 800; color: var(--saffron); min-width: 26px; text-align: end; }
.dm-over .tr { display: flex; justify-content: space-around; margin-top: 8px; font-weight: 700; gap: 8px; }
.dm-row { min-height: 54px; justify-content: space-around; gap: 6px; } .dm-row .lu-badge { max-width: 33%; margin: 0; padding-inline-end: 8px; } .dm-row.me { justify-content: center; } .dm-row.me .lu-badge { max-width: 70%; }
.dmb .nm { max-width: 70px; } .dmb .tag { font-size: 10px; }
.dm-score { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 16px; background: rgba(0,0,0,.4); border: 1.5px solid #8a6a33; } .dm-score .t { display: flex; flex-direction: column; align-items: center; min-width: 54px; line-height: 1.15; } .dm-score .t small { font-size: 10px; color: var(--ivory2); } .dm-score .t b { font-size: 20px; } .dm-score .t.me b { color: var(--turq); }
.dm-score .lim { display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 0 4px; } .dm-score .lim small { font-size: 9px; color: var(--mute); } .dm-score .lim b { font-size: 13px; color: var(--saffron); }
.pbar { width: 54px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; } .pbar i { display: block; height: 100%; background: var(--turq); transition: width .4s; } .pbar.hot i { background: #ff5a4a; }
.dm-hand { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 6px; padding: 4px 6px; max-width: 520px; min-height: 76px; }
.dm-hand .hd { cursor: pointer; transition: transform .15s; } .dm-hand .hd.dim { opacity: .45; } .dm-hand .hd.legal { box-shadow: 0 0 0 2px var(--saffron), 0 2px 8px rgba(0,0,0,.5); } .dm-hand .hd.sel { transform: translateY(-12px); box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(0,0,0,.6); } .dm-hand .hd.nope { animation: lushake .14s 2; }
.dm-draw { margin: 2px 0; } .dm-draw[hidden] { display: none; }
.dm .lu-frame { display: none; }
.rdy { font-size: 10.5px; color: var(--mute); } .rdy.on { color: #7ff0b0; font-weight: 700; }
.btn.ready-on { background: linear-gradient(180deg, #2f7a54, #1b4a33); border: 1.5px solid #6fe0a0; color: #fff; }

/* ---- Domino polish ---- */
.dm { gap: 8px; }
.dm-frame { padding: 10px; background: linear-gradient(145deg, #b27a3d, #6a3c17 50%, #8d5726); box-shadow: 0 14px 34px rgba(0,0,0,.65), inset 0 2px 0 rgba(255,255,255,.3), inset 0 -3px 0 rgba(0,0,0,.35); }
.dm-board { background: radial-gradient(ellipse at 50% 45%, #2a9674 0%, #17705a 45%, #0c4637 100%); box-shadow: inset 0 0 0 2px rgba(0,0,0,.45), inset 0 0 60px rgba(0,0,0,.45); }
.dm-board::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 4px); pointer-events: none; }
.dm-piece.dt { box-shadow: 0 3px 6px rgba(0,0,0,.55), inset 0 0 0 1px rgba(120,90,40,.45), inset 0 2px 0 rgba(255,255,255,.7); }
.dm-over { background: radial-gradient(ellipse at center, rgba(8,40,32,.97), rgba(3,16,13,.98)); backdrop-filter: blur(3px); }
.dm-over .ovc.round { background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); border: 1.5px solid rgba(255,214,120,.5); border-radius: 18px; padding: 14px 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dm-over h3 { font-size: 17px; color: #ffe08a; margin: 0; }
.dm-over .sub { font-size: 11px; color: var(--ivory2); text-align: center; }
.rv { padding: 5px 8px; border-radius: 10px; background: rgba(0,0,0,.28); width: 100%; box-sizing: border-box; } .rv.win { box-shadow: inset 0 0 0 1.5px #7ff0b0; } .rv.mine b { color: var(--turq); }
.rv .pp { color: #ff8a7a; font-size: 15px; }
.dm-over .tr { width: 100%; display: flex; gap: 8px; } .dm-over .chip { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1.5px solid #8a6a33; line-height: 1.25; } .dm-over .chip.me { border-color: var(--turq); } .dm-over .chip b { font-size: 22px; color: #ff8a7a; } .dm-over .chip small { font-size: 10.5px; color: var(--ivory2); }
.dm-over .cd { color: #ffe08a; font-weight: 700; margin-top: 2px; }
.dm-score { padding: 6px 12px; background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.3)); } .dm-score .t b { font-size: 24px; } .pbar { height: 5px; }
.dm .lu-status { font-size: 14px; padding: 6px 14px; border-radius: 14px; background: rgba(0,0,0,.3); } .dm .lu-status.mine { background: rgba(240,180,60,.18); color: #ffd877; box-shadow: 0 0 0 1.5px rgba(240,180,60,.5); }
.dm-hand { padding: 10px 8px 6px; gap: 7px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.35)); border-radius: 18px 18px 0 0; }
.dm-hand .hd { box-shadow: 0 4px 8px rgba(0,0,0,.55), inset 0 2px 0 rgba(255,255,255,.7); } .dm-hand .hd.legal { box-shadow: 0 0 0 2.5px #ffc94d, 0 0 14px rgba(255,201,77,.55); }
.dm-ends, .dm-bone { background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15); }
.dm-over .ovc.round { gap: 5px; padding: 9px 10px; width: 94%; max-height: 98%; box-sizing: border-box; } .dm-over h3 { font-size: 16px; } .rv { padding: 3px 8px; } .dm-over .chip { padding: 3px 6px; } .dm-over .chip b { font-size: 19px; } .dm-over .sub { font-size: 10px; }
