/* ============================================================
   ماشین‌حساب اکوییتی اوماها — میز به سبک کلاسیک، لوگو وسط
   ============================================================ */

.plo-page { padding-top: calc(var(--header-h) + 20px); padding-bottom: 70px; }

.plo-head { text-align: center; max-width: 640px; margin-inline: auto; }
.plo-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; }
.plo-lead { color: var(--khakestar); margin-top: 8px; }

/* ---------- controls ---------- */
.plo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--khat);
  border-radius: 100px;
  overflow: hidden;
  background: rgba(10, 15, 12, 0.55);
}
.seg button {
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--khakestar);
  transition: background 0.25s, color 0.25s;
}
.seg button.on { background: var(--laki); color: #06120b; }
.ctrl-btn {
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--khat);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sadaf);
  background: rgba(10, 15, 12, 0.55);
  transition: border-color 0.25s, background 0.25s;
}
.ctrl-btn:hover:not(:disabled) { border-color: var(--laki); background: var(--laki-soft); }
.ctrl-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- calculator workspace ---------- */
.calc-workspace {
  width: min(100%, 1010px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  direction: rtl;
}
.calc-main { min-width: 0; }

/* ---------- table ---------- */
.plo-table-wrap { padding: 70px 8px 70px; }
.plo-table {
  position: relative;
  width: min(100%, 760px);
  margin-inline: auto;
  aspect-ratio: 1.75 / 1;
  border-radius: 999px;
  /* ماهوت سرمه‌ای */
  background: radial-gradient(ellipse at 50% 38%, #2c4a86 0%, #1e3363 50%, #16244a 100%);
  border: 15px solid #14171d;
  box-shadow:
    0 34px 90px -30px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(238, 244, 239, 0.08),
    inset 0 0 70px rgba(0, 0, 0, 0.55);
}
.plo-table::before {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

/* برد دقیقاً وسط میز */
.table-center { position: absolute; inset: 0; pointer-events: none; }
.board-row {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 8px;
  direction: ltr;
  pointer-events: auto;
}

/* کارت‌های برد کمی بزرگ‌تر از کارت‌های دست بازیکن‌ها */
#board-row .cslot { width: 44px; height: 61px; border-radius: 8px; }
#board-row .cslot.filled { font-size: 1.25rem; }
#board-row .cslot .s { font-size: 1.1rem; }

/* ---------- card slots ---------- */
/* خانه‌ی خالی = کارتِ از پشت با لوگوی کوچک خانه پوکر */
.cslot {
  width: 48px;
  height: 66px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    radial-gradient(ellipse at 50% 28%, #232f55 0%, #182241 55%, #111830 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.05),
    0 4px 12px -4px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s, filter 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.cslot .back-logo {
  width: 54%;
  height: auto;
  opacity: 0.55;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
  pointer-events: none;
}
.cslot:hover { border-color: var(--laki); filter: brightness(1.15); }
.cslot.active {
  border-color: var(--laki);
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.3), 0 0 18px rgba(61, 220, 132, 0.35);
}
.cslot.filled {
  border: none;
  background: linear-gradient(165deg, #f9fbf8, #e9efe8);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.6);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}
.cslot.filled img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cslot.filled:hover { transform: translateY(-3px); }
.cslot .s { font-size: 0.95rem; margin-top: 1px; }
.c-red { color: #c8102e; }
.c-black { color: #16181d; }
.c-blue { color: #1258c7; }
.c-green { color: #0c7a43; }

/* ---------- seats ---------- */
/* لنگرگاهِ صندلی = مرکزِ خودِ کارت‌هاست؛ لیبل و درصد مطلق و بیرون از آن قرار می‌گیرند
   تا وسطِ کارت‌ها دقیقاً روی لبه‌ی میز بنشیند. */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: max-content;
}
.seat-remove {
  position: absolute;
  top: -15px;
  right: -15px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(8, 12, 10, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1;
}
.seat-remove:hover { color: #fff; border-color: #ff7b7b; background: rgba(126, 28, 35, 0.92); }
.seat-remove:focus-visible { outline: 3px solid rgba(61, 220, 132, 0.45); outline-offset: 2px; }
.seat-cards { display: flex; gap: 5px; direction: ltr; }
.seat .cslot { width: 38px; height: 52px; font-size: 0.6rem; }
.seat .cslot.filled { font-size: 0.95rem; }
/* باکس درصد داخل جریان صندلی است؛ در نتیجه هرگز روی کارت یا برد نمی‌افتد. */
.seat-equity {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.seat-equity:empty { visibility: hidden; }
.eq-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  min-width: 116px;
  padding: 3px 8px 4px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.75);
  animation: eq-pop 0.35s var(--ease);
}
@keyframes eq-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.eq-box .eq {
  font-family: 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  color: var(--laki);
  direction: ltr;
  line-height: 1.2;
}
/* برچسبِ عددِ بزرگ — بدون این، معلوم نیست ۴۷٪ چیه */
.eq-box .eq-label {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.2;
}
/* برد و مساوی، دو ردیفِ جدا زیرِ هم */
.eq-box .eq-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.eq-box .eq-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
}
.eq-box .eq-row b {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  direction: ltr;
}

/* ---------- actions ---------- */
.plo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
}
.plo-actions .btn-primary { font-size: 0.94rem; padding: 12px 30px; }
.plo-actions .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.calc-status { width: 100%; text-align: center; margin-top: 10px; min-height: 34px; }
.calc-progress {
  width: min(340px, 80%);
  height: 5px;
  margin: 6px auto 0;
  border-radius: 4px;
  background: rgba(238, 244, 239, 0.1);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}
.calc-progress.show { opacity: 1; }
.calc-progress .bar { height: 100%; width: 0%; background: linear-gradient(to left, var(--laki), var(--zar)); border-radius: 4px; }
.calc-note { font-size: 0.82rem; color: var(--khakestar); margin-top: 8px; }

/* ---------- picker ---------- */
.picker-wrap {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  margin-top: 18px;
  border: 1px solid var(--khat);
  border-radius: 18px;
  background: linear-gradient(175deg, var(--doodeh), var(--shab-2));
  padding: 12px;
  direction: rtl;
}
.picker-title { font-size: 0.84rem; font-weight: 800; color: var(--sadaf); text-align: center; margin-bottom: 2px; }
.picker-help { font-size: 0.64rem; color: var(--khakestar); text-align: center; margin-bottom: 9px; }
.picker { display: grid; gap: 4px; direction: ltr; }
.picker-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pk {
  min-width: 0;
  aspect-ratio: 0.76 / 1;
  border-radius: 5px;
  background: linear-gradient(165deg, #f9fbf8, #e9efe8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
  transition: transform 0.15s var(--ease), box-shadow 0.15s, opacity 0.2s;
}
.pk img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.pk .s { font-size: 0.65rem; margin-top: 1px; }
.pk:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.55); }
.pk:focus-visible { outline: 3px solid rgba(61, 220, 132, 0.55); outline-offset: 1px; }
.pk:disabled { opacity: 0.16; cursor: not-allowed; filter: grayscale(0.65); }

.plo-hint { text-align: center; color: var(--khakestar); font-size: 0.85rem; max-width: 60ch; margin: 26px auto 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .calc-workspace { display: flex; flex-direction: column; align-items: stretch; }
  .calc-main { order: 1; }
  .picker-wrap { order: 2; position: static; width: min(100%, 760px); margin: 16px auto 0; }
  .picker { grid-template-columns: repeat(13, 1fr); gap: 4px; }
  .picker-row { display: contents; }
  .pk { order: var(--mobile-order); }
  .plo-table-wrap { padding-top: 68px; padding-bottom: 70px; }
  .plo-table { aspect-ratio: 1.7 / 1; }
  .seat .cslot { width: 34px; height: 47px; }
  #board-row .cslot { width: 38px; height: 53px; }
  .eq-box { min-width: 112px; }
}
@media (max-width: 640px) {
  .plo-table-wrap { padding: 70px 0 80px; }
  /* فرم عمودیِ میز در موبایل؛ دسکتاپ همان میز افقی کلاسیک باقی می‌ماند. */
  .plo-table {
    aspect-ratio: 0.6 / 1;
    border-width: 10px;
    border-radius: 46% / 16%;
    background:
      radial-gradient(ellipse at 50% 43%, #2b4d8d 0%, #1d376d 48%, #121f42 100%);
    box-shadow:
      0 30px 70px -26px rgba(0, 0, 0, 0.92),
      0 0 0 1px rgba(238, 244, 239, 0.08),
      inset 0 0 82px rgba(0, 0, 0, 0.58);
  }
  .plo-table::before { inset: 10px; border-radius: inherit; }
  .seat { gap: 5px; }
  .seat .cslot { width: 27px; height: 38px; }
  .seat .cslot.filled { font-size: 0.72rem; }
  .seat .cslot .s { font-size: 0.66rem; }
  .cslot { width: 34px; height: 48px; }
  #board-row .cslot { width: 30px; height: 43px; }
  #board-row .cslot.filled { font-size: 0.9rem; }
  #board-row .cslot .s { font-size: 0.8rem; }
  .board-row { gap: 5px; }
  .table-center { gap: 9px; }
  .table-logo img { width: 38px; }
  .seat-remove { top: -13px; right: -13px; width: 26px; height: 26px; font-size: 0.9rem; }
  .seat-equity { min-height: 38px; }
  .eq-box { min-width: 104px; padding: 4px 9px 5px; border-radius: 10px; }
  .eq-box .eq { font-size: 0.95rem; }
  .eq-box .eq-row { font-size: 0.57rem; }
  .plo-table[data-player-count="5"] .seat .cslot { width: 25px; height: 35px; }
  .plo-table[data-player-count="5"] .seat-cards { gap: 3px; }
  .pk { font-size: 0.68rem; border-radius: 4px; }
  .pk .s { font-size: 0.6rem; }
  .picker-wrap { padding: 12px; }
}
