/* فونت وزیرمتن — لوکال و بسته‌شده (OFL). */
@font-face { font-family: 'Vazirmatn'; font-weight: 400; font-display: swap; src: url('fonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 500; font-display: swap; src: url('fonts/Vazirmatn-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 700; font-display: swap; src: url('fonts/Vazirmatn-Bold.woff2') format('woff2'); }

:root {
  --felt: #1a6b47;
  --felt-2: #0d4530;
  --felt-edge: #08321f;
  --rail: #5b3b22;
  --rail-2: #3d2614;
  --ink: #0c1a13;
  --line: rgba(255, 255, 255, .14);
  --gold: #f4c95d;
  --you: #5b8cff;
  --opp: #ff7a7a;
  --card-bg: #fdfdfb;
  --card-red: #d11f37;
  --card-ink: #1b2330;
  --timer-full: #36d399;
  --timer-warn: #f4c95d;
  --timer-danger: #ff7a7a;
  /* سایه‌ی کارت: ambient نرم + contact نزدیک */
  --card-shadow: 0 1px 1px rgba(0,0,0,.28), 0 6px 12px rgba(0,0,0,.34), 0 14px 26px rgba(0,0,0,.30);
  --card-shadow-lift: 0 6px 10px rgba(0,0,0,.28), 0 22px 40px rgba(0,0,0,.46);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif;
  color: #eaf2ec;
  background: radial-gradient(120% 120% at 50% 0%, #1c2a23 0%, #0b120e 70%);
  overflow: hidden;
}
.hidden { display: none !important; }
.muted { color: #b9c6bd; }
.small { font-size: 12px; }
button { cursor: pointer; font-family: inherit; }

/* ---------- لابی ---------- */
.lobby {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(60% 55% at 50% 38%, rgba(26,107,71,.45) 0%, rgba(26,107,71,0) 70%),
    radial-gradient(120% 120% at 50% 0%, #18241d 0%, #0a110d 72%);
}
.lobby-card {
  position: relative;
  background: linear-gradient(180deg, rgba(28,44,36,.82) 0%, rgba(16,26,21,.82) 100%);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(244,201,93,.22);
  border-radius: 22px;
  padding: 38px 36px 32px;
  width: 460px; max-width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.07);
}
/* خط طلایی نازک بالای کارت */
.lobby-card::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 3px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.lobby-card h1 { margin: 0 0 6px; font-size: 40px; color: var(--gold); }

/* ---------- لوگوی چهاربرگ ---------- */
.brand-mark { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.brand-mark .suits { display: inline-flex; padding-inline-start: 5px; }
.brand-mark .suits i {
  width: 22px; height: 30px; border-radius: 5px; font-style: normal;
  background: linear-gradient(160deg, #fff 0%, #e7ebf2 100%);
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
  border: 1px solid rgba(255,255,255,.85); box-shadow: 0 3px 6px rgba(0,0,0,.45);
  margin-inline-start: -6px; transform-origin: 50% 100%;
}
.brand-mark .suits i:nth-child(1) { transform: rotate(-16deg) translateY(2px); color: #1b2330; }
.brand-mark .suits i:nth-child(2) { transform: rotate(-6deg);  color: var(--card-red); }
.brand-mark .suits i:nth-child(3) { transform: rotate(6deg);   color: var(--card-red); }
.brand-mark .suits i:nth-child(4) { transform: rotate(16deg) translateY(2px); color: #1b2330; }
.brand-mark .brand-name {
  font-size: 38px; font-weight: 800; color: var(--gold); letter-spacing: .01em;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
/* نسخه‌ی کوچک برای نوار بالای میز */
.brand-mark.sm { flex-direction: row; align-items: center; gap: 8px; }
.brand-mark.sm .suits i { width: 15px; height: 20px; font-size: 10px; border-radius: 3px; margin-inline-start: -5px; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.brand-mark.sm .brand-name { font-size: 19px; }
.ghost-sm { background: transparent; border: 1px solid var(--line); color: #cfe; border-radius: 8px; padding: 5px 12px; font-size: 13px; }
/* انتخابگرِ بازی (شلم / حکم) */
.game-select { display: flex; gap: 6px; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 14px 0 4px; }
.game-opt { flex: 1; background: transparent; border: none; color: #cfe; border-radius: 9px; padding: 9px 0; font-size: 15px; font-weight: 700; transition: background .15s, color .15s; }
.game-opt.active { background: linear-gradient(180deg, #f6d271, #e3b23f); color: #2a1d00; box-shadow: 0 3px 8px rgba(227,178,63,.3); }
/* گزینه‌ی بدون ربات */
.nobot-toggle { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12px; color: rgba(207,238,207,.65); }
.nobot-toggle label { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.nobot-toggle input[type=checkbox] { accent-color: var(--gold); width: 14px; height: 14px; cursor: pointer; }
/* اکشن‌های لابی: ساخت اتاق / ورود با کد */
.lobby-actions { display: flex; gap: 8px; margin-top: 10px; }
.lobby-actions .ghost-sm { flex: 1; }
.create-room { margin-top: 10px; padding: 12px; background: rgba(0,0,0,.24); border: 1px solid var(--line); border-radius: 12px; }
.cr-row { display: flex; gap: 8px; margin-bottom: 8px; }
.cr-input { width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 9px; color: #eaf; padding: 9px 12px; font: inherit; }
.cr-toggle { flex: 1; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: #cfe; border-radius: 9px; padding: 9px 0; font-weight: 700; transition: background .15s; }
.cr-toggle.on { background: linear-gradient(180deg, #f6d271, #e3b23f); color: #2a1d00; border-color: transparent; }
.cr-select { flex: 1; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: #cfe; border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; appearance: none; text-align: center; }
.cr-select option { background: #0f1f17; color: #cfe; }
.cr-go { width: 100%; margin-top: 2px; }
/* grade badge */
.grade-tag { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 800; background: var(--gc, #6b7280); color: #000; margin-inline-end: 4px; flex-shrink: 0; line-height: 1; cursor: default; }
/* اتاقِ انتظار (ready-up) */
.wait-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.wait-seat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 10px; }
.wait-seat.empty { opacity: .5; }
.wait-seat.ready { border-color: rgba(120,220,140,.5); background: rgba(120,220,140,.1); }
.wait-seat .ws-name { font-weight: 700; }
.wait-seat .ws-status { font-size: 12px; color: #9db8ff; }
.wait-seat.ready .ws-status { color: #7fe39a; }
.wait-code { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 10px 0; }
.wait-code strong { letter-spacing: 1px; color: var(--gold); }
.wait-actions { display: flex; gap: 8px; }
.wait-actions button { flex: 1; }
/* برچسبِ نوعِ بازی روی اتاق */
.game-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; margin-inline-start: 6px; }
.game-badge.shelem { background: rgba(91,140,255,.18); color: #9db8ff; }
.game-badge.hokm { background: rgba(244,201,93,.18); color: var(--gold); }
/* ردیفِ خالِ بزرگ برای انتخاب حکم */
.suit-row.big { gap: 12px; justify-content: center; margin: 8px 0 4px; flex-wrap: wrap; }
.suit-row.big .suit-btn { font-size: 22px; padding: 16px 22px; min-width: 96px; border-radius: 14px; }

.room-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; font-size: 14px; color: #b9c6bd; }
.room-list { display: flex; flex-direction: column; gap: 8px; text-align: right; }
.room-item { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.room-meta { display: flex; flex-direction: column; gap: 2px; }
.room-state { font-size: 12px; padding: 2px 9px; border-radius: 20px; }
.room-state.waiting { background: rgba(54,211,153,.16); color: #56e0a8; }
.room-state.in_hand { background: rgba(255,180,84,.16); color: #ffc06a; }
.room-count { font-size: 13px; color: #cfe; }
.join-btn { background: var(--you); color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 700; }
.join-btn.off { background: rgba(255,255,255,.08); color: #8b97a8; cursor: default; }
.room-item { transition: border-color .15s, background .15s, transform .15s; }
.room-item:hover { border-color: rgba(244,201,93,.4); background: rgba(255,255,255,.08); transform: translateY(-1px); }
.primary {
  background: linear-gradient(180deg, #f6d271 0%, #e3b23f 100%);
  color: #2a1d00; border: none; border-radius: 12px;
  padding: 14px 18px; font-size: 16px; font-weight: 800; width: 100%; margin: 16px 0 6px;
  box-shadow: 0 8px 18px rgba(227,178,63,.35), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .14s var(--ease-spring), box-shadow .14s, filter .14s;
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(227,178,63,.45), inset 0 1px 0 rgba(255,255,255,.5); filter: brightness(1.03); }
.primary:active { transform: translateY(0); }
.primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- میز ---------- */
.table { position: relative; height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px; background: rgba(8, 16, 12, .6); border-bottom: 1px solid var(--line);
  z-index: 5;
}
.topbar .brand { font-size: 22px; font-weight: 700; color: var(--gold); margin-left: 6px; }
.chip { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; font-size: 13px; }
.chip .lbl { color: #aebcb2; }
.chip strong { font-weight: 700; }
.chip.red strong { color: #ff8a8a; }
.chip.wide { margin-right: auto; background: rgba(244,201,93,.12); border-color: rgba(244,201,93,.35); }
.chip-hokm-icon {
  padding: 3px 12px; font-size: 17px; line-height: 1;
  background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.25);
  box-shadow: 0 0 10px rgba(255,255,255,.1);
}
.chip-hokm-icon.red {
  background: rgba(255,80,80,.14); border-color: rgba(255,100,100,.4);
  box-shadow: 0 0 10px rgba(255,80,80,.2);
}
.chip-hokm-icon .hokm-glyph { font-size: 19px; }
.icon-btn { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #eaf2ec; border-radius: 8px; width: 34px; height: 30px; font-size: 15px; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255,255,255,.14); }

/* ---------- تایمر ---------- */
.timer-bar-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px; background: rgba(4,10,7,.5);
  border-bottom: 1px solid var(--line); min-height: 20px;
}
.timer-bar {
  flex: 1; height: 6px; background: rgba(255,255,255,.08);
  border-radius: 3px; overflow: hidden;
}
.timer-bar.yours { height: 8px; }
.timer-fill {
  height: 100%; border-radius: 3px;
  background: var(--timer-full);
  transition: width .25s linear, background .25s;
}
.timer-fill.danger { background: var(--timer-danger); animation: timer-danger-pulse .75s ease-in-out infinite; }
@keyframes timer-danger-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.timer-label { font-size: 12px; color: #9fb0c4; min-width: 24px; text-align: left; }
.timer-label.yours { color: var(--gold); font-weight: 700; }

.felt {
  position: relative; flex: 1;
  margin: 14px; border-radius: 120px / 80px;
  /* پارچه‌ی فلت: نور جهت‌دار از بالا + بافت ظریف نخ + vignette */
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 45%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 2px, rgba(255,255,255,.012) 2px 4px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.04) 0 2px, rgba(255,255,255,.012) 2px 4px),
    radial-gradient(125% 125% at 50% 42%, var(--felt) 0%, var(--felt-2) 62%, var(--felt-edge) 100%);
  /* rail چوبی دور میز */
  border: 10px solid transparent;
  background-clip: padding-box;
  box-shadow:
    inset 0 0 80px rgba(0,0,0,.5),
    inset 0 2px 6px rgba(255,255,255,.06),
    0 0 0 10px var(--rail-2),
    0 0 0 12px rgba(0,0,0,.4),
    0 18px 40px rgba(0,0,0,.55);
  /* پرسپکتیو سه‌بعدی: کارت‌ها کمی به سمت بازیکن خم می‌شوند */
  perspective: 1400px;
  perspective-origin: 50% 120%;
}
/* نشانِ محوِ مرکز میز */
.felt::before {
  content: '♠ ♥ ♦ ♣'; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(34px, 6vh, 64px); letter-spacing: .15em;
  color: rgba(255,255,255,.018); pointer-events: none;
  transition: all 0.6s var(--ease-spring);
}
/* وقتی حکم انتخاب شده، خال حکم بزرگ و لوکس و درخشان روی فلت نشان داده می‌شود */
.felt.hokm-hearts::before   {
  content: '♥'; color: rgba(235,50,50,.075); font-size: clamp(120px, 24vh, 260px); letter-spacing: 0;
  text-shadow: 0 0 35px rgba(255,80,80,0.22); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}
.felt.hokm-diamonds::before {
  content: '♦'; color: rgba(235,50,50,.075); font-size: clamp(120px, 24vh, 260px); letter-spacing: 0;
  text-shadow: 0 0 35px rgba(255,80,80,0.22); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}
.felt.hokm-clubs::before    {
  content: '♣'; color: rgba(244,201,93,.065); font-size: clamp(120px, 24vh, 260px); letter-spacing: 0;
  text-shadow: 0 0 35px rgba(244,201,93,0.18); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}
.felt.hokm-spades::before   {
  content: '♠'; color: rgba(244,201,93,.065); font-size: clamp(120px, 24vh, 260px); letter-spacing: 0;
  text-shadow: 0 0 35px rgba(244,201,93,0.18); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

/* صندلی‌ها */
.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; isolation: isolate; }
.seat-bottom { bottom: 8px; left: 50%; transform: translateX(-50%); }
.seat-top    { top: 8px; left: 50%; transform: translateX(-50%); }
.seat-left   { left: 14px; top: 50%; transform: translateY(-50%); }
.seat-right  { right: 14px; top: 50%; transform: translateY(-50%); }

/* لفاف آواتار با تایمر دایره‌ای */
.seat-av-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  box-sizing: content-box;
}
.seat-avatar {
  border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  font-weight: 700; color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  z-index: 2; box-sizing: border-box;
}
.radial-timer-svg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  transform: rotate(-90deg); pointer-events: none; z-index: 3;
}
.radial-timer-track {
  fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 3;
}
.radial-timer-ring {
  fill: none; stroke: var(--gold); stroke-width: 3.5; stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear, stroke 0.3s;
  filter: drop-shadow(0 0 5px rgba(244,201,93,0.75));
}
.radial-timer-ring.danger {
  stroke: #ff4d4d;
  filter: drop-shadow(0 0 6px rgba(255,77,77,0.9));
  animation: timer-danger-ring 0.65s ease-in-out infinite alternate;
}
@keyframes timer-danger-ring {
  from { opacity: 0.7; stroke-width: 3.5; }
  to   { opacity: 1.0; stroke-width: 4.2; }
}

.seat-name { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; padding: 4px 12px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid transparent; }
.seat.team-you .seat-name { border-color: rgba(91,140,255,.6); }
.seat.team-opp .seat-name { border-color: rgba(255,122,122,.5); }
.seat.turn .seat-name { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(244,201,93,.28); animation: seat-turn-glow 1.6s ease-in-out infinite; }
@keyframes seat-turn-glow { 0%,100% { box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(244,201,93,.2); } 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(244,201,93,.45); } }
.seat.afk .seat-name { border-color: var(--timer-danger); animation: afk-pulse 1s ease-in-out infinite; }
@keyframes afk-pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(255,122,122,.3); } 50% { box-shadow: 0 0 0 4px rgba(255,122,122,.7); } }
.seat-tag { font-size: 11px; color: var(--gold); }
/* حاکم */
.seat.hakem .seat-name { border-color: var(--gold) !important; box-shadow: 0 0 0 2px rgba(244,201,93,.35), 0 0 12px 2px rgba(244,201,93,.18); }
.seat-crown { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 17px; line-height: 1; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.8)); z-index: 4; }
.report-btn { background: transparent; border: none; color: #9fb0c4; font-size: 13px; cursor: pointer; padding: 0 2px; }
.report-btn:hover { color: var(--opp); }
.fan-wrap { display: flex; align-items: center; gap: 8px; }
.fan { display: flex; }
.fan .card.back.small { margin-inline-start: -22px; }
.fan .card:first-child { margin-inline-start: 0; }
.fan-wrap .count { font-size: 12px; color: #cfe; background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; }

/* ری‌اکشن‌های شناور روی میز */
.floating-reactions-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 99999;
  direction: ltr;
}
.floating-emoji {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.7));
  will-change: transform, opacity;
  animation: fly-reaction 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 100000;
}
@keyframes fly-reaction {
  0% {
    opacity: 0;
    transform: translate(var(--startX), var(--startY)) scale(0.3) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translate(var(--midX), var(--midY)) scale(1.3) rotate(calc(var(--rot) * 0.5));
  }
  40% {
    opacity: 1;
    transform: translate(var(--midX), var(--midY)) scale(1.1) rotate(var(--rot));
  }
  75% {
    opacity: 1;
    transform: translate(var(--endX, var(--midX)), var(--endY, var(--midY))) scale(1.15) rotate(var(--rot));
  }
  100% {
    opacity: 0;
    transform: translate(var(--endX, var(--midX)), var(--endY, var(--midY))) scale(0.7) rotate(var(--rot));
  }
}

/* منوی پاپ‌آپ ری‌اکشن‌ها */
.reactions-popup {
  position: fixed; display: flex; gap: 8px; background: rgba(14,24,18,0.92);
  border: 1px solid rgba(244,201,93,0.35); border-radius: 24px; padding: 6px 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.55), 0 0 16px rgba(244,201,93,0.15);
  z-index: 50; animation: reaction-pop 0.2s var(--ease-spring);
}
@keyframes reaction-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.reaction-btn {
  background: transparent; border: none; font-size: 22px; cursor: pointer;
  padding: 4px; border-radius: 8px; transition: transform 0.14s, background 0.14s;
  line-height: 1;
}
.reaction-btn:hover {
  transform: scale(1.3); background: rgba(255,255,255,0.1);
}

/* هایلایت شیک کارت‌های مجاز برای بازی */
.card.legal-playable {
  box-shadow: 0 0 0 2px var(--gold), 0 8px 22px rgba(244,201,93,0.35);
  transform: translateY(-8px);
}
.card.dim {
  opacity: 0.36; filter: grayscale(0.65) brightness(0.8);
  pointer-events: none;
}

/* مرکز و تریک */
.center { position: absolute; inset: 0; display: grid; place-items: center; }
.play { position: absolute; }
.play-bottom { bottom: 34%; left: 50%; transform: translateX(-50%); }
.play-top    { top: 34%; left: 50%; transform: translateX(-50%); }
.play-left   { left: 30%; top: 50%; transform: translateY(-50%); }
.play-right  { right: 30%; top: 50%; transform: translateY(-50%); }
.play.win .card { box-shadow: 0 0 0 3px var(--gold), 0 10px 22px rgba(0,0,0,.45); animation: win-glow .7s var(--ease-spring) both; }
@keyframes win-glow { 0% { box-shadow: 0 0 0 0 rgba(244,201,93,.9); transform: rotate(var(--rest-rot)) scale(1); } 45% { box-shadow: 0 0 0 10px rgba(244,201,93,.15); transform: rotate(var(--rest-rot)) scale(1.07); } 100% { box-shadow: 0 0 0 3px var(--gold), 0 10px 22px rgba(0,0,0,.45); transform: rotate(var(--rest-rot)) scale(1); } }
.lead-hint { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #cfe; opacity: .85; display: flex; gap: 6px; align-items: center; }
.lead-hint .red { color: #ff8a8a; }
.reveal-banner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(8,16,12,.85); border: 1px solid var(--gold); color: var(--gold); font-weight: 700; padding: 8px 18px; border-radius: 22px; font-size: 15px; }

/* «انداختن کارت» — از سمت بازیکن پرتاب می‌شود و فنری می‌نشیند؛ هر کارت کمی کج */
.play .card {
  --from-x: 0px; --from-y: 0px; --rest-rot: 0deg;
  transform: rotate(var(--rest-rot));
  transform-origin: 50% 60%;
}
/* فقط کارتی که همین‌الان انداخته شده انیمیشنِ پرتاب می‌گیرد (نه همهٔ کارت‌های روی میز) */
.play .card.thrown { animation: throw-card .36s var(--ease-spring) both; }
.play-bottom .card { --from-x: 0px;    --from-y: 150px;  --rest-rot: -4deg; }
.play-top    .card { --from-x: 0px;    --from-y: -150px; --rest-rot: 5deg;  }
.play-left   .card { --from-x: -170px; --from-y: 0px;    --rest-rot: -8deg; }
.play-right  .card { --from-x: 170px;  --from-y: 0px;    --rest-rot: 7deg;  }
@keyframes throw-card {
  0%   { transform: translate(var(--from-x), var(--from-y)) rotate(0deg) scale(1.18); opacity: 0; }
  55%  { opacity: 1; }
  100% { transform: translate(0,0) rotate(var(--rest-rot)) scale(1); opacity: 1; }
}

/* کارت */
.card {
  position: relative; width: 80px; height: 112px; border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 16%),
    linear-gradient(158deg, #ffffff 0%, #f4f6fa 55%, #e6ebf3 100%);
  color: var(--card-ink); user-select: none;
  border: 1.5px solid rgba(255,255,255,.95);
  box-shadow: var(--card-shadow), inset 0 0 0 1px rgba(0,0,0,.08);
}
/* گلوس براق گوشه‌ی بالا */
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 26%);
  mix-blend-mode: screen; opacity: .7;
}
.card.small { width: 56px; height: 79px; border-radius: 8px; }
.card.red { color: var(--card-red); }
.card .corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .9; font-weight: 900; z-index: 2; font-variant-numeric: tabular-nums; }
.card .corner b { font-size: 21px; letter-spacing: -.5px; font-weight: 900; text-shadow: 0 0.5px 0 rgba(0,0,0,0.15); }
.card .corner i { font-size: 15px; font-style: normal; margin-top: 1px; font-weight: 900; }
.card.small .corner b { font-size: 14.5px; font-weight: 900; }
.card.small .corner i { font-size: 12px; font-weight: 900; }
.card .corner.tl { top: 5px; left: 6px; }
.card .corner.br { bottom: 5px; right: 6px; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: 47px; opacity: .95; z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,.15); font-weight: 900; }
.card.small .pip { font-size: 32px; }
.card.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 60%),
    repeating-linear-gradient(45deg, #2f57a0 0 6px, #244888 6px 12px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 6px, rgba(0,0,0,.06) 6px 12px),
    #244888;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: var(--card-shadow), inset 0 0 0 3px rgba(255,255,255,.12), inset 0 0 0 4px rgba(10,28,70,.55);
}
.card.back .logo { position: absolute; inset: 0; display: grid; place-items: center; }
/* مدالِ دوحلقه‌ای وسط پشت‌کارت */
.card.back .logo::before {
  content: ''; position: absolute; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4);
  box-shadow: 0 0 0 5px rgba(255,255,255,.06), inset 0 0 6px rgba(0,0,0,.25);
}
.card.back .logo::after {
  content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  box-shadow: 0 0 0 3px rgba(10,28,70,.45);
}
.card.back.small .logo::before { width: 22px; height: 22px; box-shadow: 0 0 0 4px rgba(255,255,255,.06), inset 0 0 5px rgba(0,0,0,.25); }
.card.back.small .logo::after { width: 9px; height: 9px; }
/* Face cards (K, Q, J) */
.card.face {
  overflow: hidden;
  background: linear-gradient(158deg, #fdf9f0 0%, #f6eedb 55%, #ece3c8 100%);
}
.card.face::before { content: ''; position: absolute; inset: 4px; border: 1px solid currentColor; opacity: .14; border-radius: 6px; z-index: 0; pointer-events: none; }
.card.face .face-art { position: absolute; left: 50%; transform: translateX(-50%); width: 62%; height: 40%; z-index: 1; display: flex; align-items: center; justify-content: center; }
.card.face .face-art:not(.bot) { top: 10%; }
.card.face .face-art.bot { bottom: 10%; transform: translateX(-50%) rotate(180deg); }
.card.face .face-art svg { width: 100%; height: 100%; }
.card.face .face-divider { position: absolute; left: 7%; right: 7%; top: calc(50% - 0.5px); height: 1px; background: currentColor; opacity: .13; z-index: 3; pointer-events: none; }
.card.small.face .face-art { width: 58%; height: 38%; }
.card.small.face .face-art:not(.bot) { top: 9%; }
.card.small.face .face-art.bot { bottom: 9%; }
.card.click { cursor: pointer; transition: transform .16s var(--ease-spring), box-shadow .16s; }
.card.click:hover { transform: translateY(-16px) scale(1.06); box-shadow: var(--card-shadow-lift); z-index: 30; }
.card.dim { opacity: .42; filter: grayscale(.55); }
.card.selectable { cursor: pointer; transition: transform .14s var(--ease-spring), box-shadow .14s; }
.card.sel { box-shadow: 0 0 0 3px var(--you), var(--card-shadow-lift); transform: translateY(-10px) scale(1.04); }

/* دستِ بازیکن */
.hand-strip {
  display: flex; justify-content: center; align-items: flex-end; flex-wrap: nowrap;
  padding: 22px 14px 14px; background: linear-gradient(0deg, rgba(8,16,12,.78), rgba(8,16,12,.4));
  border-top: 1px solid var(--line);
  min-height: 130px; position: relative; z-index: 4; overflow: visible;
}
/* بادبزنِ دست: چرخش حول محور پایین → قوس طبیعی */
.hand-strip .card {
  --i: 0; --n: 1; --mid: calc((var(--n) - 1) / 2);
  --rot: calc((var(--i) - var(--mid)) * 3.4deg);
  margin-inline-start: -14px;
  transform-origin: 50% 280%;
  transform: rotate(var(--rot));
  transition: transform .18s var(--ease-spring), box-shadow .18s;
  /* هر کارت روی همسایه‌ی سمت چپش بنشیند تا گوشه‌ی بالا-چپ (رتبه/خال) همیشه دیده شود */
  z-index: calc(100 - var(--i));
}
.hand-strip .card:first-child { margin-inline-start: 0; }
/* ورودِ کارت‌ها هنگامِ پخش: از بالا به جای خود می‌نشینند (با تأخیرِ پلکانیِ inline) */
.hand-strip .card.deal-in { animation: deal-in .56s var(--ease-spring) both; }
@keyframes deal-in {
  0%   { opacity: 0; transform: translate(60px, -320px) rotate(calc(var(--rot) - 24deg)) scale(.7); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: rotate(var(--rot)) scale(1); }
}
/* hover/sel: فقط بالا‌رفتنِ مستقیم (بدونِ scale) تا کارت پرتاب و نشانگر رد نشود → بدونِ لرزش */
.hand-strip .card.click:hover { transform: rotate(var(--rot)) translateY(-28px); z-index: 200; }
.hand-strip .card.sel { transform: rotate(var(--rot)) translateY(-16px); z-index: 200; }
.your-turn { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #2a1d00; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 20px; animation: turn-pulse 1.4s ease-in-out infinite; white-space: nowrap; }
@keyframes turn-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(244,201,93,.7); } 55% { box-shadow: 0 0 0 9px rgba(244,201,93,0); } }

/* اورلی */
.overlay { position: absolute; inset: 0; background: rgba(4,10,7,.78); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 20; padding: 16px; }

/* اورلی تعهد و انتخاب حکم: کارت‌های دست بیرون از بلور باقی می‌مانند */
.overlay.clear-hand-overlay {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-bottom: 140px;
  background: rgba(4,10,7,.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* دستِ کارت‌ها بالاتر از لایه بلور قرار می‌گیرد تا کاربر هنگام اعلام تعهد کارت‌های خود را شفاف ببیند */
.hand-strip.above-overlay {
  position: relative;
  z-index: 30 !important;
  background: linear-gradient(0deg, rgba(8,16,12,0.96), rgba(8,16,12,0.85));
  border-top: 1px solid rgba(244,201,93,0.45);
  box-shadow: 0 -10px 32px rgba(0,0,0,0.8);
}

.hand-focus-hint {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1f1400;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2.5px 14px;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.55);
  white-space: nowrap;
  pointer-events: none;
  z-index: 35;
  animation: turn-pulse 1.6s ease-in-out infinite;
}

.panel { background: linear-gradient(180deg, #19271e 0%, #111e18 100%); border: 1px solid rgba(255,255,255,.13); border-radius: 18px; padding: 24px 26px; width: 560px; max-width: 100%; max-height: 92vh; overflow: auto; box-shadow: 0 32px 64px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.07); }
.panel h2 { margin: 0 0 14px; font-size: 20px; }

.bid-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.bid-btn { background: rgba(255,255,255,.08); border: 1px solid var(--line); color: #eaf2ec; border-radius: 10px; padding: 10px 14px; font-size: 15px; font-weight: 700; min-width: 56px; }
.bid-btn:hover { background: rgba(91,140,255,.25); }
.bid-btn.shelem { background: rgba(244,201,93,.2); border-color: var(--gold); color: var(--gold); }
.bid-btn.pass { background: rgba(255,122,122,.15); border-color: rgba(255,122,122,.5); }
.bid-actions { margin-top: 10px; }

.kot-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; justify-content: center; }
.suit-row { display: flex; gap: 8px; }
.suit-btn { background: rgba(255,255,255,.08); border: 1px solid var(--line); color: #eaf2ec; border-radius: 10px; padding: 8px 14px; font-size: 15px; }
.suit-btn.red { color: #ff8a8a; }
.suit-btn.sel { box-shadow: 0 0 0 2px var(--gold); }
.field { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.field .lbl { color: #b9c6bd; }

.res-tbl { width: 100%; border-collapse: collapse; margin: 6px 0 16px; }
.res-tbl th, .res-tbl td { border: 1px solid var(--line); padding: 9px 12px; text-align: center; font-size: 14px; }
.res-tbl th:first-child, .res-tbl td:first-child { text-align: right; color: #b9c6bd; }
.res-tbl .delta td { color: var(--gold); font-weight: 700; }
.res-tbl .total td { font-size: 16px; font-weight: 700; }
.verdict { font-size: 16px; font-weight: 700; margin: 0 0 14px; }

/* ---------- توست ---------- */
.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: rgba(8,16,12,.94); border: 1px solid var(--gold); color: var(--gold);
  padding: 9px 18px; border-radius: 22px; font-size: 14px; z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 0 1px rgba(244,201,93,.1);
  animation: toast-in .32s var(--ease-spring) both;
  backdrop-filter: blur(8px);
}
@keyframes toast-in { 0% { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.88); } 100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* ---------- چت اتاق ---------- */
.chat {
  position: fixed; left: 14px; bottom: 14px; width: 280px;
  background: rgba(10,18,14,.94); border: 1px solid var(--line);
  border-radius: 14px; z-index: 25; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: rgba(255,255,255,.06); cursor: pointer; font-size: 14px; font-weight: 700; }
.chat-head .chev { color: #9fb0c4; }
.chat-inner { display: none; }
.chat.open .chat-inner { display: block; }
.chat-body { height: 148px; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; }
.chat-body .msg { font-size: 13px; background: rgba(255,255,255,.06); padding: 4px 9px; border-radius: 9px; align-self: flex-start; max-width: 96%; }
.chat-body .msg.me { align-self: flex-end; background: rgba(91,140,255,.22); }
.chat-body .msg.system { align-self: center; background: rgba(244,201,93,.1); color: var(--gold); font-size: 12px; padding: 3px 10px; }
.chat-body .msg b { color: var(--gold); font-weight: 700; }

/* پیام صوتی */
.msg.voice-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.msg.voice-msg.listened { opacity: .5; }
.voice-play {
  background: rgba(91,140,255,.25); border: 1px solid rgba(91,140,255,.5);
  color: #eaf2ec; border-radius: 14px; padding: 3px 10px; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.voice-play:hover { background: rgba(91,140,255,.45); }
.voice-hint { font-size: 11px; color: #7a8b8e; }

.presets { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 10px; border-top: 1px solid var(--line); }
.preset { background: rgba(255,255,255,.07); border: 1px solid var(--line); color: #dfe; border-radius: 14px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.preset:hover { background: rgba(91,140,255,.25); }

.chat-row { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); align-items: center; }
.chat-input { flex: 1; min-width: 0; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: #eaf2ec; border-radius: 8px; padding: 7px 9px; font-size: 13px; }
.chat-input:disabled { opacity: .4; }
.chat-send { background: var(--you); color: #fff; border: none; border-radius: 8px; padding: 0 12px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* دکمه ضبط صدا */
.voice-record {
  background: rgba(255,255,255,.08); border: 1px solid var(--line);
  color: #eaf2ec; border-radius: 8px; width: 32px; height: 32px;
  font-size: 15px; display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  transition: background .15s, box-shadow .15s;
}
.voice-record:hover { background: rgba(255,122,122,.2); }
.voice-record.recording {
  background: rgba(255,60,60,.35);
  box-shadow: 0 0 0 3px rgba(255,60,60,.5);
  animation: rec-pulse .7s ease-in-out infinite;
}
.voice-record:disabled { opacity: .3; cursor: not-allowed; }
@keyframes rec-pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(255,60,60,.4); } 50% { box-shadow: 0 0 0 6px rgba(255,60,60,.15); } }

/* ---------- لابی — دکمه تماشا + حاضرین ---------- */
.room-item { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.room-counts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.watch-count { font-size: 11px; color: #9fb0c4; }
.room-actions { display: flex; gap: 6px; align-items: center; }
.watch-btn {
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  color: #9fb0c4; border-radius: 8px; padding: 6px 11px; font-size: 12px;
}
.watch-btn:hover { background: rgba(255,255,255,.14); color: #eaf2ec; }

/* ---------- banner ناظر ---------- */
.observer-banner {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  background: rgba(244,201,93,.15); border: 1px solid rgba(244,201,93,.45);
  color: var(--gold); padding: 6px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 700; z-index: 10; pointer-events: none;
}

/* ---------- پنل حاضرین ---------- */
.occupants-panel {
  position: fixed; top: 56px; right: 14px; width: 200px;
  background: rgba(10,18,14,.95); border: 1px solid var(--line);
  border-radius: 14px; z-index: 22; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  max-height: 0; opacity: 0; transition: max-height .25s ease, opacity .2s;
}
.occupants-panel.open { max-height: 360px; opacity: 1; }
.occ-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: rgba(255,255,255,.06);
  font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--line);
}
.occ-close { background: transparent; border: none; color: #9fb0c4; font-size: 14px; cursor: pointer; padding: 0; }
.occ-close:hover { color: #eaf2ec; }
.occ-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.05);
}
.occ-item.turn { background: rgba(244,201,93,.1); }
.occ-item.me { background: rgba(91,140,255,.1); }
.occ-item.watching { color: #7a8b8e; }
.occ-pos { color: #7a8b8e; font-size: 11px; min-width: 32px; }
.occ-name { flex: 1; }
.occ-badge { font-size: 10px; background: var(--gold); color: #2a1d00; border-radius: 8px; padding: 1px 6px; font-weight: 700; }

/* ---------- آواتار صندلی ---------- */
.seat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; user-select: none;
  border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  flex-shrink: 0; object-fit: cover;
  transition: transform .14s var(--ease-spring), box-shadow .14s;
}
.seat-avatar[style*="cursor"] { cursor: pointer; }
.seat-avatar[style*="cursor"]:hover { transform: scale(1.12); box-shadow: 0 4px 14px rgba(0,0,0,.5); }

/* ---------- حباب محو‌شونده ---------- */
.seat-bubble {
  --bubble-tx: -50%;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(var(--bubble-tx));
  background: rgba(14,24,18,.92);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 5px 11px;
  font-size: 13px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
  z-index: 15;
  backdrop-filter: blur(6px);
  animation: bubble-in .18s var(--ease-spring) both;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.seat-bubble::after {
  content: ''; position: absolute;
  bottom: -5px; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(14,24,18,.92);
  border-bottom: none;
}
.seat-left .seat-bubble {
  --bubble-tx: 0%;
  left: -4px;
}
.seat-left .seat-bubble::after {
  left: 20px;
  transform: none;
}
.seat-right .seat-bubble {
  --bubble-tx: 0%;
  left: auto;
  right: -4px;
}
.seat-right .seat-bubble::after {
  left: auto;
  right: 20px;
  transform: none;
}
.seat-top .seat-bubble {
  bottom: auto;
  top: calc(100% + 6px);
}
.seat-top .seat-bubble::after {
  bottom: auto;
  top: -5px;
  border-top: none;
  border-bottom: 5px solid rgba(14,24,18,.92);
}
.seat-bubble.voice {
  pointer-events: auto;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  max-width: none;
  overflow: visible;
}
.seat-bubble.voice::after {
  display: none;
}
.bubble-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e4d2b, #13331c);
  border: 2px solid #48c774;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55), 0 0 0 1px rgba(72,199,116,0.25);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}
.bubble-play:hover {
  transform: scale(1.14);
  border-color: #5deb8b;
  box-shadow: 0 6px 18px rgba(72, 199, 116, 0.45);
}
.bubble-play .play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #ffffff;
  line-height: 1;
  margin-left: 2px; /* optical center */
}
.bubble-play.playing {
  background: linear-gradient(135deg, #4d380f, #2e2005);
  border-color: #f4c95d;
  box-shadow: 0 4px 16px rgba(244, 201, 93, 0.45);
  animation: voice-pulse 1.2s ease-in-out infinite;
}
.bubble-play.playing .play-icon {
  color: #f4c95d;
  margin-left: 0;
}
@keyframes voice-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(72, 199, 116, 0.4); }
  50%  { box-shadow: 0 0 0 6px rgba(72, 199, 116, 0); }
  100% { box-shadow: 0 0 0 0 rgba(72, 199, 116, 0); }
}
@keyframes bubble-in {
  0% { opacity: 0; transform: translateX(var(--bubble-tx, -50%)) translateY(6px) scale(.9); }
  100% { opacity: 1; transform: translateX(var(--bubble-tx, -50%)) translateY(0) scale(1); }
}

/* ---------- کامپوزر ---------- */
.composer-bar {
  position: fixed;
  bottom: 14px;
  left: 14px; transform: none;
  display: flex; align-items: center; gap: 6px;
  background: rgba(10,18,14,.82);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 5px 9px;
  z-index: 14;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  width: 300px; max-width: 64vw;
  opacity: .82; transition: opacity .15s;
}
.composer-bar:hover, .composer-bar:focus-within { opacity: 1; }
.composer-preset-btn {
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  color: #eaf2ec; border-radius: 50%; width: 32px; height: 32px;
  font-size: 15px; display: grid; place-items: center; flex-shrink: 0;
  cursor: pointer; transition: background .13s;
}
.composer-preset-btn:hover { background: rgba(91,140,255,.25); }
.composer-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: #eaf2ec; font-family: inherit; font-size: 13px;
  padding: 0 4px;
}
.composer-input::placeholder { color: #7a8b8e; }
.composer-input:disabled { opacity: .35; }
.composer-send {
  background: var(--you); color: #fff; border: none;
  border-radius: 18px; padding: 5px 13px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  flex-shrink: 0;
}
.composer-send:hover { filter: brightness(1.1); }

/* ---------- پاپ‌آپ پیام‌های آماده ---------- */
.presets-popup {
  background: rgba(10,18,14,.97); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px;
  z-index: 30; box-shadow: 0 10px 32px rgba(0,0,0,.55);
  min-width: 240px; max-width: 340px;
  backdrop-filter: blur(12px);
}
.preset-group { margin-bottom: 10px; }
.preset-group-label { font-size: 11px; color: #7a8b8e; margin-bottom: 6px; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.preset {
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  color: #dfe; border-radius: 14px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; font-family: inherit;
  transition: background .12s;
}
.preset:hover { background: rgba(91,140,255,.28); }
.preset.custom { border-color: rgba(244,201,93,.3); color: var(--gold); }
.preset.custom:hover { background: rgba(244,201,93,.15); }
.preset-edit-btn {
  display: block; width: 100%; margin-top: 10px; padding: 6px;
  background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.14);
  color: #9fb0c4; border-radius: 10px; font-size: 12px;
  cursor: pointer; font-family: inherit;
  transition: background .12s;
}
.preset-edit-btn:hover { background: rgba(255,255,255,.09); }

/* ---------- کارت پروفایل سریع ---------- */
.profile-card {
  background: linear-gradient(160deg,#101e18,#0c1812); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 16px; z-index: 40;
  box-shadow: 0 12px 36px rgba(0,0,0,.6);
  min-width: 200px; max-width: 240px;
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.profile-card .seat-avatar { width: 48px; height: 48px; font-size: 22px; }
.pc-close {
  position: absolute; top: 8px; left: 10px;
  background: transparent; border: none; color: #7a8b8e;
  font-size: 14px; cursor: pointer; line-height: 1;
}
.pc-close:hover { color: #eaf2ec; }
.profile-card { position: fixed; z-index: 9999; }
.pc-name { font-weight: 700; font-size: 15px; margin: 6px 0 2px; }
.pc-grade { display: flex; align-items: center; gap: 5px; font-size: 12px; margin-bottom: 4px; }
.pc-grade-label { font-weight: 700; }
.pc-elo-num { color: rgba(207,238,207,.55); }
.pc-stats { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b9c6bd; margin-bottom: 2px; }
.pc-sep { opacity: .4; }
.pc-bio { font-size: 12px; color: #9fb0c4; font-style: italic; max-width: 200px; margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }
.pc-action-btn {
  background: rgba(255,255,255,.08); border: 1px solid var(--line);
  color: #eaf2ec; border-radius: 10px; padding: 6px 14px;
  font-size: 12px; cursor: pointer; font-family: inherit; width: 100%;
  transition: background .12s;
}
.pc-action-btn:hover { background: rgba(91,140,255,.28); }
.pc-action-btn.primary-sm {
  background: rgba(91,140,255,.2); border-color: rgba(91,140,255,.5); color: #8ab4ff;
}
.pc-action-btn.primary-sm:hover { background: rgba(91,140,255,.35); }

/* ---------- پنل پروفایل من ---------- */
.my-profile-panel {
  position: fixed; top: 56px; left: 14px; width: 260px;
  max-height: calc(100vh - 80px); display: flex; flex-direction: column;
  background: linear-gradient(180deg,#19271e,#111e18); border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px; overflow: hidden; z-index: 500;
  box-shadow: 0 20px 48px rgba(0,0,0,.55);
}
.mp-body { overflow-y: auto; flex: 1; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mp-av-wrap { position: relative; cursor: pointer; border-radius: 50%; }
.mp-av-wrap .seat-avatar { width: 72px; height: 72px; font-size: 32px; transition: opacity .15s; }
.mp-av-wrap:hover .seat-avatar { opacity: .75; }
.mp-av-hint { position: absolute; bottom: 0; right: 0; background: var(--gold); color: #2a1d00; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; pointer-events: none; }
.mp-username { font-weight: 800; font-size: 16px; color: #eaf2ec; }
.mp-grade-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mp-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.mp-stat { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.28); border-radius: 10px; padding: 8px 4px; }
.mp-stat b { font-size: 17px; font-weight: 800; color: #eaf2ec; }
.mp-stat span { font-size: 10px; color: rgba(207,238,207,.55); margin-top: 2px; }
.mp-stat.win b { color: #36d399; }
.mp-stat.loss b { color: #ff7a7a; }
.mp-divider { width: 100%; border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.mp-label { font-size: 12px; color: rgba(207,238,207,.55); align-self: flex-start; font-weight: 700; }
.mp-bio-input { width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 9px; color: #eaf2ec; padding: 9px 12px; font: inherit; font-size: 13px; resize: none; box-sizing: border-box; }
.mp-bio-input:focus { outline: none; border-color: rgba(244,201,93,.5); }
.mp-save-btn { align-self: flex-end; }

/* ---------- پنل دوستان ---------- */
.friends-panel {
  position: fixed; top: 56px; left: 14px; width: 220px;
  background: rgba(10,18,14,.97); border: 1px solid var(--line);
  border-radius: 14px; z-index: 22; overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  max-height: 80vh; display: flex; flex-direction: column;
}
.fp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: rgba(255,255,255,.06);
  font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.fp-list { overflow-y: auto; flex: 1; }
.fp-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,.04);
}
.fp-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-name-link { cursor: pointer; }
.fp-name-link:hover { color: #eaf2ec; text-decoration: underline; }
.fp-invite-btn {
  background: rgba(91,140,255,.18); border: 1px solid rgba(91,140,255,.4);
  color: #8ab4ff; border-radius: 8px; padding: 3px 8px;
  font-size: 11px; cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.fp-invite-btn:hover { background: rgba(91,140,255,.35); }
.fp-search-wrap {
  border-top: 1px solid var(--line); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
}
.fp-results { display: flex; flex-direction: column; gap: 2px; max-height: 120px; overflow-y: auto; }

/* ---------- اسکرول‌بار ظریف ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }

/* ---------- رسپانسیو: تبلت ---------- */
@media (max-width: 820px) {
  .felt { margin: 10px; }
  .topbar { padding: 7px 10px; gap: 6px; }
  .topbar .chip { font-size: 12px; padding: 3px 9px; }
  .play-left  { left: 24%; }
  .play-right { right: 24%; }
}

/* ---------- رسپانسیو: موبایل ---------- */
/* ---------- رسپانسیو: موبایل ---------- */
@media (max-width: 560px) {
  .felt {
    margin: 4px; border-width: 6px; border-radius: 40px;
    padding-bottom: 8px;
  }
  /* topbar فشرده‌تر و مینیمال؛ چیپ‌ها افقی اسکرول می‌شوند نه چندردیفه */
  .topbar {
    flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding: 4px 6px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar .chip { flex: 0 0 auto; font-size: 10.5px; padding: 2.5px 7px; border-radius: 12px; }
  .topbar .brand-mark.sm .brand-name { font-size: 14px; }
  .topbar .brand-mark.sm .suits i { width: 12px; height: 15px; font-size: 8.5px; }
  .chip.wide { margin-right: 0; }
  .icon-btn { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; flex-shrink: 0; }

  /* تنظیم صندلی‌ها در موبایل */
  .seat { min-width: 76px; gap: 3px; }
  .seat-top { top: 4px; }
  .seat-bottom { bottom: 4px; }
  .seat-left { left: 4px; }
  .seat-right { right: 4px; }
  .seat-name { font-size: 11px; padding: 2px 7px; border-radius: 8px; }
  .seat-name span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .seat-tag { font-size: 9.5px; }
  .seat-av-wrap { width: 44px; height: 44px; }
  .seat-avatar { width: 36px !important; height: 36px !important; font-size: 16px !important; }
  .radial-timer-svg { width: 44px !important; height: 44px !important; }

  /* مرکز و کارت‌های پرتاب‌شده */
  .play-left  { left: 18%; }
  .play-right { right: 18%; }
  .play-top   { top: 22%; }
  .play-bottom{ bottom: 22%; }

  /* کارت‌ها در موبایل: ۸٪ بزرگ‌تر، واضح‌تر و ارگونومیک‌تر */
  .card { width: 52px; height: 75px; border-radius: 8px; }
  .card .corner b { font-size: 15px; font-weight: 900; }
  .card .corner i { font-size: 11.5px; font-weight: 900; }
  .card .pip { font-size: 28px; font-weight: 900; }
  .card.small { width: 39px; height: 56px; border-radius: 6px; }
  .card.small .corner b { font-size: 11px; font-weight: 900; }
  .card.small .pip { font-size: 22px; }

  /* دست: چینش منظم، خوانا با لمس آسان در موبایل */
  .hand-strip {
    flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 6px 0; padding: 10px 4px 60px; min-height: auto;
  }
  .hand-strip .card {
    transform: rotate(0deg); transform-origin: center;
    margin-inline-start: -9px;
  }
  .hand-strip .card:first-child { margin-inline-start: 0; }
  .hand-strip .card.click:hover, .hand-strip .card.click:active { transform: translateY(-10px) scale(1.05); }
  .hand-strip .card.sel { transform: translateY(-8px) scale(1.04); }
  .hand-strip .card.click { box-shadow: var(--card-shadow), 0 0 0 1.5px rgba(91,140,255,.4); }

  /* کامپوزر شناور مینیمال و فشرده در موبایل */
  .composer-bar {
    left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none;
    padding: 4px 7px; gap: 4px; border-radius: 20px;
  }
  .composer-preset-btn { width: 28px; height: 28px; font-size: 13px; }
  .composer-input { font-size: 12px; padding: 0 2px; }
  .composer-send { padding: 4px 10px; font-size: 11px; }
  .voice-record { width: 28px; height: 28px; font-size: 13px; }

  /* حباب چت/ویس هماهنگ با موبایل */
  .seat-bubble { max-width: 140px; font-size: 11.5px; padding: 3px 8px; }

  /* ری‌اکشن‌های شناور */
  .floating-emoji { font-size: 26px; }
  .reactions-popup { padding: 5px 8px; gap: 6px; }
  .reaction-btn { font-size: 20px; }

  /* اورلی‌های تعهد روی موبایل */
  .overlay.clear-hand-overlay {
    padding: 6px 10px 115px;
    justify-content: center;
  }
  .overlay.clear-hand-overlay .panel {
    padding: 12px 14px;
    max-height: calc(100vh - 140px);
  }
  .overlay.clear-hand-overlay .bid-row {
    gap: 5px;
  }
  .overlay.clear-hand-overlay .bid-btn {
    padding: 6px 9px;
    font-size: 13px;
    min-width: 42px;
  }
}

/* صفحه‌های خیلی باریک (موبایل‌های کوچک) */
@media (max-width: 380px) {
  .card { width: 42px; height: 61px; }
  .card .pip { font-size: 22px; }
  .card .corner b { font-size: 12px; }
  .card.small { width: 32px; height: 46px; }
  .hand-strip .card { margin-inline-start: -7px; }
  .hand-strip .card:first-child { margin-inline-start: 0; }
  .seat-name { font-size: 10px; padding: 2px 5px; }
}

/* ---------- رسپانسیو: لابی/لاگین — موبایل ---------- */
@media (max-width: 480px) {
  .lobby { padding: 10px; }
  .lobby-card { padding: 22px 16px 18px; }
  .brand-mark .brand-name { font-size: 28px; }
  .brand-mark .suits i { width: 18px; height: 24px; font-size: 12px; }
  .game-select { margin: 10px 0 4px; }
  .game-opt { font-size: 13px; padding: 7px 0; }
  .lobby-actions { flex-direction: column; gap: 6px; }
  .lobby-actions .ghost-sm { width: 100%; }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
  .play .card { animation-duration: .01ms; }
  .card.click, .card.selectable, .hand-strip .card { transition-duration: .01ms; }
  .hand-strip .card.click:hover { transform: rotate(var(--rot)) translateY(-18px); }
}

/* ==========================================================================
   طراحی لاگین و ورود کد OTP — ترندهای UX/UI 2026 (Modern Velvet Glass)
   ========================================================================== */
.auth-modern-card {
  position: relative;
  background: radial-gradient(120% 120% at 50% 0%, rgba(30, 52, 42, 0.92) 0%, rgba(13, 22, 17, 0.95) 100%);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(244, 201, 93, 0.28);
  border-radius: 26px;
  padding: 38px 34px 34px;
  width: 440px;
  max-width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  animation: authCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* گروه‌بندی فیلدهای ورودی در فرم Onboarding */
.auth-input-group {
  text-align: right;
  margin-bottom: 14px;
}

.auth-input-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #b9d8c8;
  margin-bottom: 6px;
}

.auth-text-input {
  width: 100%;
  background: rgba(8, 14, 11, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 11px 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-text-input:focus {
  border-color: var(--gold);
  background: rgba(8, 14, 11, 0.9);
  box-shadow: 0 0 14px rgba(244, 201, 93, 0.25);
}

.auth-input-hint {
  font-size: 11px;
  color: #79a38f;
  margin-top: 4px;
  display: block;
}

/* استایل‌های ویرایش مشخصات در پنل پروفایل من */
.mp-fields-box {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 14px 0;
  text-align: right;
}

.mp-field-row {
  margin-bottom: 10px;
}

.mp-field-row:last-child {
  margin-bottom: 0;
}

.mp-field-label {
  display: block;
  font-size: 12px;
  color: #cfe;
  margin-bottom: 4px;
  font-weight: 600;
}

.mp-field-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  color: #eaf2ec;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.mp-field-input:focus {
  border-color: var(--gold);
}

@keyframes authCardFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modern-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 99px;
  box-shadow: 0 0 14px var(--gold);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 201, 93, 0.1);
  border: 1px solid rgba(244, 201, 93, 0.25);
  padding: 4px 14px;
  border-radius: 99px;
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 8px;
}

.auth-title {
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  color: #9eb5a8;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 24px;
}

/* ورودی کپسولی شماره موبایل */
.auth-phone-field {
  display: flex;
  align-items: center;
  direction: ltr;
  background: rgba(8, 14, 11, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 4px 6px 4px 14px;
  transition: all 0.22s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.auth-phone-field:focus-within {
  border-color: var(--gold);
  background: rgba(8, 14, 11, 0.85);
  box-shadow: 0 0 0 3px rgba(244, 201, 93, 0.2), inset 0 2px 4px rgba(0,0,0,0.3);
}

.auth-phone-prefix {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #9eb5a8;
  font-size: 14px;
  font-weight: 700;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  user-select: none;
}

.auth-phone-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 12px 10px;
  text-align: left;
}

.auth-phone-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.04em;
  font-size: 14px;
  font-weight: 500;
}

/* دکمه ارسال مدرن با افکت بازتاب */
.auth-submit-btn {
  position: relative;
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  font-size: 15.5px;
  font-weight: 800;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #f6d271 0%, #e3b23f 100%);
  color: #261a00;
  box-shadow: 0 10px 24px rgba(227, 178, 63, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(227, 178, 63, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* سلول‌های کد ۵ رقمی OTP (2026 PIN Cells) */
.otp-cells-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  direction: ltr;
  margin: 20px 0 16px;
}

.otp-digit-cell {
  width: 52px;
  height: 60px;
  background: rgba(8, 14, 11, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all 0.18s ease;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

.otp-digit-cell:focus {
  border-color: var(--gold);
  background: rgba(8, 14, 11, 0.9);
  box-shadow: 0 0 18px rgba(244, 201, 93, 0.35), inset 0 0 6px rgba(244, 201, 93, 0.15);
  transform: translateY(-2px);
}

.otp-digit-cell.filled {
  border-color: rgba(244, 201, 93, 0.5);
  color: var(--gold);
}

/* وضعیت خطای ارتعاشی */
.auth-shake {
  animation: hapticShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes hapticShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* جعبه وضعیت و تایمر معکوس */
.otp-meta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 16px 0 10px;
  font-size: 13px;
}

.otp-timer-text {
  color: #9eb5a8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.otp-timer-num {
  color: var(--gold);
  font-weight: 700;
  font-family: monospace, sans-serif;
  font-size: 14px;
}

.otp-resend-btn {
  background: transparent;
  border: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: opacity 0.15s;
  padding: 0;
}

.otp-resend-btn.disabled {
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  pointer-events: none;
}

.auth-change-phone-btn {
  background: transparent;
  border: none;
  color: #79a38f;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  transition: color 0.15s;
}

.auth-change-phone-btn:hover {
  color: #bce3d0;
}

.auth-feedback-msg {
  font-size: 12.5px;
  margin-top: 12px;
  min-height: 18px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.auth-feedback-msg.error {
  color: #ff7a7a;
}
.auth-feedback-msg.success {
  color: #36d399;
}

/* لودر چرخشی مدرن */
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(38, 26, 0, 0.3);
  border-top-color: #261a00;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
  display: inline-block;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* ─── استایل‌های VIP و فروشگاه اشتراک (UX 2026) ─── */
.vip-lobby-btn {
  background: linear-gradient(135deg, rgba(244, 201, 93, 0.15), rgba(212, 175, 55, 0.05)) !important;
  border: 1px solid var(--gold) !important;
  color: var(--gold) !important;
  box-shadow: 0 0 10px rgba(244, 201, 93, 0.18);
  transition: all 0.2s var(--ease-spring);
}
.vip-lobby-btn:hover {
  background: linear-gradient(135deg, rgba(244, 201, 93, 0.28), rgba(212, 175, 55, 0.15)) !important;
  box-shadow: 0 0 16px rgba(244, 201, 93, 0.35);
  transform: translateY(-1px);
}

.mp-vip-box {
  background: rgba(14, 24, 18, 0.6);
  border: 1px solid rgba(244, 201, 93, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.mp-vip-tag {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}
.mp-vip-tag.active {
  background: rgba(244, 201, 93, 0.2);
  color: var(--gold);
  border: 1px solid rgba(244, 201, 93, 0.4);
}
.mp-vip-tag.regular {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.mp-vip-sub {
  font-size: 12px;
  color: var(--gold);
}
.mp-upgrade-btn {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  font-weight: 700;
  font-size: 12px !important;
}

/* مدال فروشگاه */
.shop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 7, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}
.shop-modal {
  background: linear-gradient(170deg, rgba(20, 34, 26, 0.96), rgba(12, 20, 15, 0.98));
  border: 1px solid rgba(244, 201, 93, 0.35);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(244, 201, 93, 0.15);
  width: 780px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 28px;
  position: relative;
}
.shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(244, 201, 93, 0.15);
  padding-bottom: 14px;
}
.shop-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shop-crown {
  font-size: 26px;
}
.shop-head-title h2 {
  margin: 0;
  font-size: 20px;
  color: #fff;
  font-weight: 800;
}
.shop-subtitle {
  color: #a4c4b5;
  font-size: 13.5px;
  margin: 14px 0 16px;
  line-height: 1.6;
}

.shop-perks-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}
.shop-perk {
  background: rgba(244, 201, 93, 0.06);
  border: 1px solid rgba(244, 201, 93, 0.18);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #f1f6f2;
  font-weight: 600;
}

.shop-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.shop-plan-card {
  background: rgba(14, 24, 18, 0.7);
  border: 1px solid rgba(244, 201, 93, 0.2);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.22s var(--ease-spring);
}
.shop-plan-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(244, 201, 93, 0.18);
}
.shop-plan-card.featured {
  background: linear-gradient(180deg, rgba(244, 201, 93, 0.12), rgba(14, 24, 18, 0.85));
  border: 1.5px solid var(--gold);
  box-shadow: 0 4px 20px rgba(244, 201, 93, 0.15);
}
.plan-badge {
  position: absolute;
  top: -11px;
  right: 14px;
  background: linear-gradient(135deg, #f4c95d, #d4af37);
  color: #1a1200;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.plan-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
}
.plan-days {
  font-size: 12px;
  color: #79a38f;
  margin: 6px 0 12px;
}
.plan-price {
  margin: 8px 0 14px;
}
.plan-price .amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
}
.plan-price .unit {
  font-size: 12px;
  color: #a4c4b5;
}
.plan-desc {
  font-size: 12px;
  color: #8dafa0;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}
.plan-buy-btn {
  width: 100%;
  background: linear-gradient(135deg, #f4c95d, #cfa234);
  color: #1a1200;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.plan-buy-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}


