/* آرنا — طراحی «کاغذ و جوهر»: رنگ‌های تخت، قاب‌های ضخیم، سایه‌ی سخت */
:root {
  --paper: #f3e9d2; --paper2: #e8dbbb; --card: #fffaf0; --ink: #1f1b2e; --ink2: #6a6479;
  --c0: #ff6a4d; --c1: #18a999; --c2: #ffbe2e; --c3: #7b5cf6;
  --t0: #ffd9cf; --t1: #c6eee8; --t2: #ffebb4; --t3: #ddd4ff;
  --line: 3px solid var(--ink); --sh: 0 4px 0 var(--ink); --r: 18px;
  --ah: 100dvh;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink);
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif; font-size: 16px; font-weight: 600; line-height: 1.6;
  -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
body { background-image: radial-gradient(rgba(31,27,46,.13) 1.3px, transparent 1.6px); background-size: 22px 22px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.row { display: flex; gap: 10px; }
.grow { flex: 1; }

/* ---------- صفحه‌ها ---------- */
.screen { position: fixed; inset: 0; display: none; flex-direction: column; height: var(--ah); }
.screen.on { display: flex; }
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px 40px; }
.wrap.narrow { max-width: 520px; }

/* ---------- دکمه‌ها ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: var(--line); border-radius: 14px;
  background: var(--card); box-shadow: var(--sh); font-weight: 800; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 6px 14px; font-size: 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.btn.sm:active { transform: translateY(3px); }
.btn.sq { width: 40px; padding: 6px 0; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ---------- خانه ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 900; letter-spacing: -.5px; }
.mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 34px; height: 34px; transform: rotate(-8deg); }
.mark i { border: 2.5px solid var(--ink); border-radius: 8px 3px 8px 3px; }
.mark i:nth-child(1) { background: var(--c0); } .mark i:nth-child(2) { background: var(--c1); border-radius: 3px 8px 3px 8px; }
.mark i:nth-child(3) { background: var(--c2); border-radius: 3px 8px 3px 8px; } .mark i:nth-child(4) { background: var(--c3); }
.chip { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; background: var(--card); border: var(--line); border-radius: 99px; box-shadow: 0 3px 0 var(--ink); font-weight: 800; max-width: 60%; }
.chip > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { display: inline-grid; place-items: center; width: var(--s, 32px); height: var(--s, 32px); flex: none; border: 2.5px solid var(--ink); border-radius: 50%;
  font-weight: 900; font-size: calc(var(--s, 32px) * .46); line-height: 1; color: var(--ink); }
.hero { margin: 8px 0 22px; }
.hero h1 { font-size: clamp(28px, 6.5vw, 40px); font-weight: 900; line-height: 1.25; }
.hero p { color: var(--ink2); margin-top: 6px; font-size: 15px; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; background: transparent; border: 3px dashed rgba(31,27,46,.35); border-radius: var(--r); font-weight: 900; font-size: 17px; transition: .12s; }
.tabs button .dots { display: flex; gap: 4px; }
.tabs button .dots i { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper2); }
.tabs button.on { background: var(--card); border: var(--line); box-shadow: var(--sh); transform: translateY(-2px); }
.tabs button.on .dots i:nth-child(1) { background: var(--c0); } .tabs button.on .dots i:nth-child(2) { background: var(--c1); }
.tabs button.on .dots i:nth-child(3) { background: var(--c2); } .tabs button.on .dots i:nth-child(4) { background: var(--c3); }

.games { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .games { grid-template-columns: 1fr 1fr; } }
.gcard { position: relative; display: flex; gap: 14px; align-items: stretch; text-align: right; padding: 0; background: var(--card); border: var(--line); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); overflow: hidden; transition: transform .1s, box-shadow .1s; }
.gcard:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }
.gcard .ic { flex: none; width: 92px; display: grid; place-items: center; border-inline-end: var(--line); background: var(--gc); }
.gcard .tx { padding: 14px 0 14px 14px; flex: 1; min-width: 0; }
.gcard h3 { font-size: 21px; font-weight: 900; line-height: 1.3; }
.gcard p { font-size: 13.5px; color: var(--ink2); line-height: 1.65; margin-top: 2px; }
.tag { display: inline-block; margin-top: 8px; padding: 1px 10px; font-size: 12.5px; font-weight: 800; background: var(--ink); color: var(--paper); border-radius: 99px; }
.gcard.off { opacity: .5; pointer-events: none; background: transparent; box-shadow: none; border-style: dashed; }
.gcard.off .ic { background: transparent; }

.join { margin-top: 26px; padding: 16px; background: var(--ink); color: var(--paper); border-radius: 22px; }
.join-t { display: flex; flex-direction: column; margin-bottom: 10px; }
.join-t b { font-size: 18px; font-weight: 900; } .join-t span { font-size: 13px; opacity: .7; }
.join-r { display: flex; gap: 10px; }
.join input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 14px; border: 3px solid var(--paper); background: transparent; color: var(--paper); font-size: 24px; font-weight: 900; letter-spacing: 6px; text-align: center; outline: none; direction: ltr; }
.join input::placeholder { color: rgba(243,233,210,.35); }
.join input:focus { background: rgba(255,255,255,.08); }
.join .btn { background: var(--c2); color: var(--ink); border-color: var(--paper); box-shadow: 0 4px 0 var(--paper); }

/* ---------- پنل انتظار ---------- */
.lb-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 900; }
.lb-title em { font-style: normal; font-size: 13px; background: var(--ink); color: var(--paper); border-radius: 99px; padding: 0 10px; }
.codebox { background: var(--card); border: var(--line); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); padding: 16px; text-align: center; margin-bottom: 22px; }
.codebox small { color: var(--ink2); font-weight: 800; }
.digits { display: flex; justify-content: center; gap: 8px; margin: 8px 0 14px; direction: ltr; }
.digits b { display: grid; place-items: center; width: 52px; height: 66px; font-size: 38px; font-weight: 900; background: var(--paper); border: var(--line); border-radius: 14px; }
.codebox .row { justify-content: center; }

.sec-t { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 10px; font-weight: 900; font-size: 15px; }
.sec-t span { color: var(--ink2); font-weight: 700; font-size: 13px; }
.seats { display: grid; gap: 10px; margin-bottom: 18px; }
.seat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: var(--line); border-radius: 16px; min-height: 62px; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.seat b { font-weight: 900; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat small { font-size: 12px; font-weight: 800; background: var(--paper2); border-radius: 99px; padding: 0 9px; }
.seat.empty { background: transparent; border: 3px dashed rgba(31,27,46,.3); color: var(--ink2); animation: none; }
.seat.empty .av { background: transparent; border: 2.5px dashed rgba(31,27,46,.3); }
.seat.pick { border-style: dashed; background: var(--t2); animation: none; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.team { border: var(--line); border-radius: 20px; padding: 10px; background: var(--tc); box-shadow: 0 5px 0 var(--ink); }
.team h4 { margin: 0 4px 8px; display: flex; justify-content: space-between; font-size: 16px; font-weight: 900; }
.team .seat { padding: 8px; gap: 8px; min-height: 54px; } .team .seat b { font-size: 15px; }
.team .seat.empty { background: rgba(255,255,255,.35); }
.status { text-align: center; padding: 14px; border-radius: 18px; background: var(--ink); color: var(--paper); font-weight: 800; }
.status .big { display: block; font-size: 44px; font-weight: 900; line-height: 1.1; color: var(--c2); }
.wdots { display: inline-flex; gap: 5px; margin-inline-start: 8px; vertical-align: middle; }
.wdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c2); animation: bounce 1s infinite; }
.wdots i:nth-child(2) { animation-delay: .15s; } .wdots i:nth-child(3) { animation-delay: .3s; }

/* ---------- پنجره‌ها ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; background: rgba(31,27,46,.55); padding: 0; }
.modal.on { display: flex; animation: fade .15s; }
@media (min-width: 640px) { .modal { align-items: center; } }
.sheet { width: 100%; max-width: 480px; max-height: 92%; overflow: auto; background: var(--paper); border: var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 22px 20px max(22px, env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2, 1.1, .4, 1); }
@media (min-width: 640px) { .sheet { border-bottom: var(--line); border-radius: 26px; box-shadow: 0 8px 0 var(--ink); } }
.sheet h2 { font-size: 24px; font-weight: 900; }
.sheet > p { color: var(--ink2); margin: 4px 0 14px; font-size: 14.5px; }
.sheet input { width: 100%; padding: 12px 16px; margin-bottom: 14px; font-size: 20px; font-weight: 800; border: var(--line); border-radius: 14px; background: var(--card); outline: none; text-align: right; }
.sheet input:focus { background: #fff; box-shadow: 0 0 0 4px var(--c2); }
.cr-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.cr-ic { width: 64px; height: 64px; display: grid; place-items: center; border: var(--line); border-radius: 18px; background: var(--gc); flex: none; }
.opt { margin-bottom: 14px; } .opt label { display: block; font-weight: 900; font-size: 14px; margin-bottom: 6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { padding: 8px 4px; border: var(--line); border-radius: 12px; background: transparent; font-weight: 800; font-size: 14.5px; }
.seg button.on { background: var(--ink); color: var(--paper); }
.team-pick { display: grid; gap: 12px; }
.tp { text-align: right; padding: 14px; border: var(--line); border-radius: 20px; background: var(--tc); box-shadow: 0 5px 0 var(--ink); }
.tp:active { transform: translateY(5px); box-shadow: none; }
.tp b { display: block; font-size: 20px; font-weight: 900; }
.tp > span { font-size: 14px; display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tp .pill { background: rgba(255,255,255,.7); border: 2px solid var(--ink); border-radius: 99px; padding: 0 10px; font-weight: 800; }
.end { text-align: center; }
.end-badge { width: 84px; height: 84px; margin: -64px auto 8px; display: grid; place-items: center; border: var(--line); border-radius: 50%; background: var(--c2); box-shadow: var(--sh); }
.rank { display: grid; gap: 8px; margin: 14px 0 18px; text-align: right; }
.rk { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: var(--line); border-radius: 14px; background: var(--card); }
.rk.w { background: var(--t2); box-shadow: 0 4px 0 var(--ink); }
.rk .n { width: 22px; font-weight: 900; text-align: center; color: var(--ink2); }
.rk b { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .v { font-weight: 900; font-size: 20px; }
.rk small { font-size: 12px; color: var(--ink2); }

.toast { position: fixed; z-index: 99; left: 50%; bottom: 28px; transform: translate(-50%, 30px); padding: 10px 20px; background: var(--ink); color: var(--paper); border-radius: 99px; font-weight: 800; font-size: 14.5px; opacity: 0; pointer-events: none; transition: .22s; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- صفحه‌ی بازی (مشترک) ---------- */
.game-screen, .screen.game { background: var(--paper); }
.gbar { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 8px; flex: none; }
.stage { position: relative; flex: 1; min-height: 0; touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: none; }
.score-line { flex: 1; display: flex; align-items: stretch; justify-content: center; gap: 8px; min-width: 0; }
.sb { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 10px; border: var(--line); border-radius: 14px; background: var(--tc, var(--card)); min-width: 0; flex: 1; max-width: 190px; }
.sb.me { box-shadow: 0 3px 0 var(--ink); }
.sb .nm { font-size: 12px; font-weight: 800; line-height: 1.25; min-width: 0; flex: 1; overflow: hidden; }
.sb .nm span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb .sc { font-size: 28px; font-weight: 900; line-height: 1; min-width: 26px; text-align: center; }
.sb .sc.bump { animation: bump .5s; }
.clock { align-self: center; font-weight: 900; font-size: 20px; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; }
.clock.low { color: var(--c0); animation: blink 1s infinite; }
.count { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: min(34vw, 190px); font-weight: 900; color: var(--ink); -webkit-text-stroke: 8px var(--paper); paint-order: stroke fill; opacity: 0; }
.count.go { animation: cnt .85s ease-out; }
.banner { position: absolute; left: 0; right: 0; top: 40%; transform: translateY(-50%) scale(.6) rotate(-3deg); text-align: center; pointer-events: none; opacity: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.banner b { padding: 4px 34px; font-size: clamp(40px, 12vw, 80px); font-weight: 900; line-height: 1.3; background: var(--bc, var(--c2)); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); color: var(--ink); }
.banner span { padding: 0 16px; font-weight: 800; background: var(--paper); border: 3px solid var(--ink); border-radius: 99px; }
.banner.show { animation: ban 1.9s cubic-bezier(.2, 1.3, .4, 1) forwards; }

/* ---------- تیزبین ---------- */
.spot-round { flex: 1; text-align: center; font-size: 20px; font-weight: 900; }
.spot-round small { font-size: 14px; color: var(--ink2); }
.sp-players { display: flex; gap: 8px; padding: 0 12px; flex: none; }
.sp-players .sb { max-width: none; padding: 3px 10px 3px 8px; }
.sp-players .sb.bad::after { content: '✕'; position: absolute; font-weight: 900; color: var(--c0); }
.sp-players .sb { position: relative; transition: transform .15s; }
.sp-players .sb.win { animation: bump .6s; background: var(--tc); transform: translateY(-3px); box-shadow: 0 5px 0 var(--ink); }
.sp-players .sb.lock { opacity: .45; }
.sp-timer { height: 10px; margin: 10px 12px 0; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--card); overflow: hidden; flex: none; }
.sp-timer i { display: block; height: 100%; width: 100%; background: var(--c2); border-inline-start: 0; transform-origin: right; }
.sp-table { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px; --cs: min(44vw, 38vh); }
@media (orientation: portrait) { .sp-table { flex-direction: column; --cs: min(80vw, 40vh); } }
.sp-card { position: relative; width: var(--cs); height: var(--cs); perspective: 900px; flex: none; }
.sp-card .face, .sp-card .back { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--ink); backface-visibility: hidden; transition: transform .55s cubic-bezier(.3, 1.2, .5, 1); box-shadow: 0 7px 0 var(--ink); }
.sp-card .face { background: var(--card); transform: rotateY(180deg); }
.sp-card .back { background: var(--c3); background-image: repeating-radial-gradient(circle at 50% 50%, transparent 0 14px, rgba(255,255,255,.22) 14px 17px); }
.sp-card.up .face { transform: rotateY(0); } .sp-card.up .back { transform: rotateY(-180deg); }
.sp-card.dealA { animation: dealA .5s cubic-bezier(.2, 1.1, .4, 1) both; } .sp-card.dealB { animation: dealB .5s .12s cubic-bezier(.2, 1.1, .4, 1) both; }
.sym { position: absolute; display: grid; place-items: center; padding: 0; border: 0; background: transparent; line-height: 1; border-radius: 50%; }
.sym span { font-size: calc(var(--cs) * var(--f)); pointer-events: none; filter: drop-shadow(0 2px 0 rgba(31,27,46,.18)); }
.sym.hit { animation: shake .3s; }
.sym.found::before { content: ''; position: absolute; inset: -6%; border: 5px solid var(--ink); border-radius: 50%; background: var(--c2); z-index: -1; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.sp-msg { position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-weight: 900; font-size: 20px; opacity: 0; pointer-events: none; }
.sp-msg b { display: inline-block; padding: 2px 20px; border: var(--line); border-radius: 99px; background: var(--bc, var(--c2)); box-shadow: 0 4px 0 var(--ink); }
.sp-msg.show { animation: msg 1.9s forwards; }
.sp-lock { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: none; padding: 6px 20px; border: var(--line); border-radius: 99px; background: var(--c0); font-weight: 900; box-shadow: 0 4px 0 var(--ink); }
.sp-lock.on { display: block; animation: pop .25s; }

/* ---------- اسم فامیل ---------- */
.nf-round { flex: 1; text-align: center; font-size: 18px; font-weight: 900; }
.nf-body { flex: 1; overflow-y: auto; padding: 4px 14px 16px; -webkit-overflow-scrolling: touch; }
.nf-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.nf-letter { width: 78px; height: 78px; flex: none; display: grid; place-items: center; font-size: 52px; font-weight: 900; line-height: 1; background: var(--c2); border: 4px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink); transform: rotate(-4deg); padding-top: 4px; }
.nf-hinfo { flex: 1; }
.nf-time { font-size: 34px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.nf-time.low { color: var(--c0); animation: blink 1s infinite; }
.nf-hint { font-size: 13.5px; color: var(--ink2); }
.nf-players { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.np { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--card); border: var(--line); border-radius: 14px; min-width: 0; }
.np .t { flex: 1; min-width: 0; } .np .t b { display: block; font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.np .pg { display: flex; gap: 2px; margin-top: 3px; } .np .pg i { flex: 1; height: 6px; border-radius: 3px; background: var(--paper2); }
.np .pg i.on { background: var(--pc); }
.np .s { font-weight: 900; font-size: 18px; }
.nf-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .nf-form { grid-template-columns: 1fr 1fr; } }
.fld { display: flex; align-items: center; background: var(--card); border: var(--line); border-radius: 14px; overflow: hidden; transition: background .15s; }
.fld label { flex: none; width: 74px; padding: 0 10px; align-self: stretch; display: grid; place-items: center; font-weight: 900; font-size: 14px; background: var(--paper2); border-inline-end: var(--line); }
.fld input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 12px; font-size: 18px; font-weight: 700; outline: none; text-align: right; -webkit-user-select: text; user-select: text; }
.fld .ck { flex: none; width: 30px; font-weight: 900; text-align: center; font-size: 18px; }
.fld:focus-within { background: #fff; box-shadow: 0 0 0 4px var(--c2); }
.fld.ok { background: var(--t1); } .fld.ok .ck { color: #0b7a6d; } .fld.ok .ck::after { content: '✓'; }
.fld.bad .ck { color: var(--c0); } .fld.bad .ck::after { content: '!'; }
.fld.lock input { pointer-events: none; }
.nf-foot { flex: none; padding: 10px 14px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 30%); }
.stopbtn { width: 100%; padding: 14px; font-size: 22px; font-weight: 900; border: var(--line); border-radius: 18px; background: var(--paper2); color: var(--ink2); box-shadow: 0 5px 0 var(--ink); transition: .12s; }
.stopbtn:disabled { opacity: .85; }
.stopbtn.go { background: var(--c0); color: #fff; -webkit-text-stroke: 0; animation: pulse 1s infinite; text-shadow: 0 2px 0 rgba(31,27,46,.35); }
.stopbtn:not(:disabled):active { transform: translateY(5px); box-shadow: none; }
.nf-foot.hide { display: none; }
.nf-cover { position: absolute; inset: 58px 0 0 0; z-index: 20; display: none; place-items: center; text-align: center; background: rgba(243,233,210,.94); backdrop-filter: blur(3px); padding: 20px; }
.nf-cover.on { display: grid; animation: fade .15s; }
.nf-cover .cl { font-size: min(46vw, 220px); font-weight: 900; line-height: 1.1; color: var(--ink); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.nf-cover small { display: block; font-size: 18px; font-weight: 800; color: var(--ink2); }
.nf-cover .stopmsg { font-size: 44px; font-weight: 900; line-height: 1.3; }
.nf-cover .stopmsg em { display: inline-block; font-style: normal; padding: 0 18px; border: 4px solid var(--ink); border-radius: 18px; background: var(--c0); color: #fff; box-shadow: 0 6px 0 var(--ink); transform: rotate(-3deg); }

.nf-reveal { display: none; }
.rv-t { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border: var(--line); border-radius: 16px; background: var(--t2); font-weight: 800; font-size: 14.5px; }
.rv-t b { font-size: 17px; font-weight: 900; }
.rv-tab { border: var(--line); border-radius: 18px; background: var(--card); overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.rv-r { display: grid; grid-template-columns: 62px repeat(var(--n), 1fr); border-bottom: 2px solid rgba(31,27,46,.18); }
.rv-r:last-child { border-bottom: 0; }
.rv-r > div { padding: 7px 5px; text-align: center; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; word-break: break-word; line-height: 1.35; border-inline-start: 2px solid rgba(31,27,46,.12); }
.rv-r > div:first-child { background: var(--paper2); font-weight: 900; font-size: 12.5px; border: 0; }
.rv-h > div { padding: 8px 4px; background: var(--paper); font-weight: 900; font-size: 12px; gap: 3px; }
.rv-c .pt { font-size: 12px; font-weight: 900; border-radius: 99px; padding: 0 8px; background: var(--c1); color: #fff; margin-top: 2px; }
.rv-c .pt.d { background: var(--c2); color: var(--ink); } .rv-c .pt.x { background: var(--c0); color: #fff; }
.rv-c.empty { color: rgba(31,27,46,.3); }
.rv-c.flaggable { cursor: pointer; } .rv-c.flaggable:active { background: var(--t0); }
.rv-c.bad .tx { text-decoration: line-through; opacity: .55; }
.rv-c.mine { background: var(--t3); }
.rv-c .fg { font-size: 11px; font-weight: 800; color: var(--c0); }
.rv-tot > div { background: var(--ink) !important; color: var(--paper); font-weight: 900; font-size: 18px; }
.rv-tot > div:first-child { font-size: 13px; }
.rv-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.rv-foot .info { flex: 1; font-size: 12.5px; color: var(--ink2); line-height: 1.5; }

/* ---------- انیمیشن‌ها ---------- */
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(60px); opacity: 0; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes blink { 50% { opacity: .45; } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.35) rotate(-4deg); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes cnt { 0% { opacity: 0; transform: scale(2.2); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.8); } }
@keyframes ban { 0% { opacity: 0; transform: translateY(-50%) scale(.5) rotate(-8deg); } 18% { opacity: 1; transform: translateY(-50%) scale(1) rotate(-3deg); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-60%) scale(1) rotate(-3deg); } }
@keyframes msg { 0% { opacity: 0; transform: translateY(-14px); } 12% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes shake { 20% { transform: translateX(-6px) rotate(-8deg); } 50% { transform: translateX(6px) rotate(8deg); } 80% { transform: translateX(-3px); } }
@keyframes dealA { from { transform: translateX(140%) rotate(40deg); opacity: 0; } }
@keyframes dealB { from { transform: translateX(-140%) rotate(-40deg); opacity: 0; } }
@media (orientation: portrait) { @keyframes dealA { from { transform: translateY(-140%) rotate(40deg); opacity: 0; } } @keyframes dealB { from { transform: translateY(140%) rotate(-40deg); opacity: 0; } } }
@media (max-width: 380px) { .digits b { width: 44px; height: 58px; font-size: 32px; } .game .ic { width: 78px; } }

.gtitle { flex: 1; text-align: center; font-size: 19px; font-weight: 900; }
.scorebar { flex: none; padding: 0 12px 6px; }
.scorebar .sb { max-width: none; }
.team h4 { font-size: 15px; justify-content: flex-start; gap: 6px; flex-wrap: wrap; }
@media (max-height: 520px) and (orientation: landscape) {
  .screen.game .gbar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none; padding-top: 6px; }
  .screen.game .gbar > * { pointer-events: auto; }
  .gtitle { visibility: hidden; }
  #hkStage, #flStage { margin-top: 46px; }
  .scorebar { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: min(680px, 72%); z-index: 4; padding: 0; }
  .scorebar .sb .nm span:nth-child(2) { display: none; }
}

/* ---------- XO ---------- */
.xo-top { display: flex; gap: 10px; padding: 4px 14px 0; flex: none; }
.xp { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); border: var(--line); border-radius: 18px; opacity: .6; transition: .2s; min-width: 0; }
.xp.turn { opacity: 1; background: var(--tc); box-shadow: 0 5px 0 var(--ink); transform: translateY(-3px); }
.xp .mk { width: 38px; height: 38px; flex: none; }
.xp .t { flex: 1; min-width: 0; } .xp .t b { display: block; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.3; }
.xp .t small { font-size: 12px; font-weight: 700; color: var(--ink2); }
.pips { display: flex; gap: 4px; margin-top: 2px; } .pips i { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--ink); background: transparent; } .pips i.on { background: var(--pc); }
.xo-timer { height: 8px; margin: 12px 14px 0; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--card); overflow: hidden; flex: none; }
.xo-timer i { display: block; height: 100%; width: 100%; background: var(--c2); }
.xo-timer i.low { background: var(--c0); }
.xo-wrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px; }
.xo-board { position: relative; display: grid; gap: 7px; padding: 7px; width: min(94vw, 62vh, 560px); aspect-ratio: 1; background: var(--ink); border-radius: 26px; box-shadow: 0 8px 0 rgba(31,27,46,.25); }
.xo-cell { position: relative; display: grid; place-items: center; padding: 0; border: 0; border-radius: calc(20px / var(--s) * 3); background: var(--card); transition: background .15s, transform .1s; }
.xo-cell.can:hover { background: #fff; transform: scale(.96); }
.xo-cell.can:hover::after { content: attr(data-m); position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: calc(min(94vw, 62vh, 560px) / var(--s) * .5); color: var(--mc); opacity: .28; }
.xo-cell svg { width: 70%; height: 70%; overflow: visible; }
.xo-cell svg * { fill: none; stroke-linecap: round; stroke-width: 11; }
.xo-cell .x1, .xo-cell .x2, .xo-cell .o { stroke-dasharray: 230; stroke-dashoffset: 0; }
.xo-cell.new .x1 { animation: draw .22s ease-out both; } .xo-cell.new .x2 { animation: draw .22s .16s ease-out both; } .xo-cell.new .o { animation: draw .38s ease-out both; }
.xo-cell.last { background: var(--t2); }
.xo-cell.win { background: var(--c2); animation: bump .6s .3s; }
.xo-line { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.xo-line line { vector-effect: non-scaling-stroke; stroke: var(--ink); stroke-width: 9px; opacity: .85; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: drawL .6s .15s ease-out forwards; }
.xo-msg { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; pointer-events: none; opacity: 0; }
.xo-msg b { display: inline-block; padding: 6px 26px; font-size: 26px; font-weight: 900; border: var(--line); border-radius: 99px; background: var(--bc, var(--c2)); box-shadow: 0 5px 0 var(--ink); }
.xo-msg.show { animation: msg 2.3s forwards; }
@keyframes draw { from { stroke-dashoffset: 230; } to { stroke-dashoffset: 0; } }
@keyframes drawL { to { stroke-dashoffset: 0; } }

/* ---------- پینگ‌پنگ ---------- */
.pg-info { position: absolute; left: 10px; bottom: 8px; padding: 6px 14px; background: var(--card); border: var(--line); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); font-size: 13px; font-weight: 800; line-height: 1.5; pointer-events: none; opacity: .0; transition: opacity .2s; direction: rtl; }
.pg-info.on { opacity: 1; } .pg-info b { font-size: 20px; font-weight: 900; }
.pg-hint { position: absolute; left: 0; right: 0; top: 10px; text-align: center; pointer-events: none; }
.pg-hint span { display: inline-block; padding: 4px 18px; background: var(--ink); color: var(--paper); border-radius: 99px; font-weight: 800; font-size: 14px; }
.pg-hint:empty { display: none; }
.sb .srv { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); flex: none; }
.sb .srv.off { visibility: hidden; }

#pgCount { font-size: min(18vw, 110px); opacity: 0; align-items: start; padding-top: 4%; }
