/* ═══ Покер: лобби и стол ═════════════════════════════════════════ */

.pk { --felt: #1d6b4a; --felt-dark: #124430; }

/* ── Лобби ── */

.pk-table-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: var(--r-md); cursor: pointer;
  transition: transform .3s var(--ease-spring);
}
.pk-table-card:active { transform: scale(.97); }
.pk-table-card + .pk-table-card { box-shadow: inset 0 1px 0 var(--edge); }
.pk-table-card .grow { flex: 1; min-width: 0; }
.pk-table-card b { display: block; font-size: 15px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.pk-table-card span { font-size: 12px; color: var(--text-dim); }
.pk-seats-badge { font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light); }
.pk-seats-badge.hot { color: var(--green); }

/* ── Стол ── */

/* Овал живёт в собственном поле с отступами: места стоят по его краю и раньше
   вылезали за экран на узких телефонах. Отступ = половина ширины места. */
.pk-board-wrap {
  position: relative;
  padding: 0 calc(var(--seat-w) / 2);
  --seat-w: clamp(74px, 24vw, 96px);
}

.pk-felt {
  position: relative; margin: 4px 0 10px;
  aspect-ratio: 1 / 1.05; width: 100%;
  border-radius: 46% / 44%;
  background:
    radial-gradient(60% 45% at 50% 42%, #2a8a60, var(--felt) 55%, var(--felt-dark));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5), inset 0 0 0 7px #6b4a24,
              inset 0 0 0 9px rgba(0, 0, 0, .35), inset 0 6px 22px rgba(0, 0, 0, .4);
}

.pk-center {
  position: absolute; left: 50%; top: 41%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 8px; width: 88%;
}
.pk-board { display: flex; gap: 5px; justify-content: center; min-height: 56px; }
.pk-pot { font-size: 14px; font-weight: 700; color: #ffe9a8; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.pk-stage { font-size: 11px; color: rgba(255, 255, 255, .6); text-transform: uppercase;
  letter-spacing: .08em; }

/* Игральные карты.

   Имя pk-card, а не card, и это принципиально. Раньше здесь стоял просто
   .card — ровно то же имя, каким в styles.css названы карточки-панели с
   содержимым. Этот файл подключается последним, поэтому его правила
   побеждали, и каждая панель приложения — статистика, кошелёк, админка —
   превращалась в белый прямоугольник 38×54 пикселя. Текст в нём переносился
   по три буквы и вываливался на соседние разделы.

   Классы игр обязаны иметь приставку своего экрана. */
.pk-card {
  width: 38px; height: 54px; border-radius: 7px; flex: none;
  background: linear-gradient(170deg, #fff, #e6e9ef);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45), inset 0 1px 0 #fff;
  display: grid; place-items: center; line-height: 1;
  font-weight: 800; font-size: 13px; color: #14181f;
  animation: cardIn .35s var(--ease-spring);
}
.pk-card .s { font-size: 15px; display: block; }
.pk-card.red { color: #d0342c; }
.pk-card.back {
  background: repeating-linear-gradient(45deg, #2b4c8c 0 5px, #1e3766 5px 10px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .18);
}
.pk-card.small { width: 28px; height: 40px; font-size: 11px; border-radius: 5px; }
.pk-card.small .s { font-size: 12px; }
@keyframes cardIn { from { transform: translateY(-14px) scale(.7); opacity: 0 } }

/* места */
.pk-seat {
  position: absolute; width: var(--seat-w, 92px);
  transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 3px; text-align: center;
}
.pk-seat .plate {
  width: 100%; padding: 6px 4px; border-radius: 13px;
  background: rgba(8, 20, 14, .72); backdrop-filter: blur(6px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: box-shadow .3s, transform .3s var(--ease-spring);
}
.pk-seat .nm { font-size: 11.5px; font-weight: 650; color: #eaf3ee;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pk-seat .st { font-size: 12px; font-weight: 750; color: #ffe08a;
  font-variant-numeric: tabular-nums; }
.pk-seat.acting .plate { box-shadow: 0 0 0 2px var(--gold), 0 4px 16px rgba(240, 180, 41, .55);
  transform: scale(1.06); }
.pk-seat.folded { opacity: .42; }
.pk-seat .hand { display: flex; gap: 3px; }
.pk-seat .bet {
  font-size: 11px; font-weight: 700; color: #10131a; padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(160deg, #ffd76e, var(--gold));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.pk-seat .tag { font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55); }
.pk-empty {
  width: 100%; padding: 12px 4px; border: 0; border-radius: 13px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 650; color: rgba(255, 255, 255, .75);
  background: rgba(8, 20, 14, .45);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22);
}
.pk-empty:active { transform: scale(.94); }

.pk-dealer {
  position: absolute; width: 21px; height: 21px; border-radius: 50%;
  background: linear-gradient(160deg, #fff, #ccd3de); color: #14181f;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5); transform: translate(-50%, -50%);
  transition: left .4s var(--ease-out), top .4s var(--ease-out);
}

/* таймер */
.pk-timer { position: relative; width: 100%; height: 4px; border-radius: 999px;
  overflow: hidden; background: rgba(255, 255, 255, .16); margin-top: 3px; }
.pk-timer i { display: block; height: 100%; background: var(--gold);
  transition: width 1s linear; }
.pk-timer.warn i { background: var(--red); }

/* ── Действия ── */

.pk-actions { display: grid; gap: 9px; margin-top: 4px; }
.pk-actions .row { display: flex; gap: 9px; }
.pk-actions .row > button { flex: 1; }
.pk-raise { display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: var(--r-md);
  box-shadow: inset 3px 3px 9px var(--shadow-dark), inset -3px -3px 9px var(--shadow-light); }
.pk-raise input[type=range] { flex: 1; margin: 0; }
.pk-raise b { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 62px;
  text-align: right; }
.pk-quick { display: flex; gap: 7px; }
.pk-quick button { flex: 1; padding: 8px 0; font-size: 12px; font-weight: 650; border: 0;
  border-radius: 11px; background: var(--surface); color: var(--text-dim); cursor: pointer;
  box-shadow: 3px 3px 7px var(--shadow-dark), -3px -3px 7px var(--shadow-light); }

.pk-log { max-height: 128px; overflow-y: auto; padding: 10px 14px; font-size: 12.5px;
  color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.pk-log b { color: var(--text); font-weight: 650; }

.pk-chat { height: 168px; }

/* ═══ Блэкджек ════════════════════════════════════════════════════ */

.bj-felt {
  position: relative; padding: 16px 12px 12px; border-radius: 26px; margin-bottom: 12px;
  background: radial-gradient(70% 50% at 50% 0%, #2a8a60, var(--felt) 55%, var(--felt-dark));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 0 0 6px #6b4a24,
              inset 0 0 0 8px rgba(0, 0, 0, .35);
}
.bj-dealer { display: grid; justify-items: center; gap: 6px; padding-bottom: 12px; }

/* ── Дилер ── */

.bj-avatar {
  width: 78px; height: 78px; border-radius: 50%; margin-bottom: 2px;
  background: url("/img/dealer.jpg") center/cover, var(--felt-dark);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, .85), 0 6px 18px rgba(0, 0, 0, .55),
              inset 0 0 0 1px rgba(0, 0, 0, .3);
  transition: box-shadow .35s var(--ease-spring), transform .35s var(--ease-spring);
  position: relative;
}
/* Когда ходит дилер — подсвечиваем, чтобы взгляд шёл к нему. */
.bj-avatar.active {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(240, 180, 41, .7),
              0 8px 22px rgba(0, 0, 0, .55);
}
.bj-avatar .bubble {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 750; letter-spacing: .04em; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; color: #10131a;
  background: linear-gradient(160deg, #ffd76e, var(--gold));
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45);
}
.bj-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55); }
.bj-cards { display: flex; gap: 5px; justify-content: center; min-height: 56px; }
.bj-total { font-size: 14px; font-weight: 750; color: #ffe9a8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .6); font-variant-numeric: tabular-nums; }

.bj-seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bj-seat { padding: 8px 6px; border-radius: 14px; text-align: center;
  background: rgba(8, 20, 14, .6); display: grid; gap: 5px; justify-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); transition: box-shadow .3s; }
.bj-seat.acting { box-shadow: 0 0 0 2px var(--gold), 0 4px 14px rgba(240, 180, 41, .5); }
.bj-seat .nm { font-size: 11px; font-weight: 650; color: #eaf3ee;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bj-seat .st { font-size: 11.5px; color: #ffe08a; font-variant-numeric: tabular-nums; }
.bj-hand { display: grid; gap: 3px; justify-items: center; padding: 3px; border-radius: 9px; }
.bj-hand.current { background: rgba(240, 180, 41, .18); }
.bj-hand .row { display: flex; gap: 2px; }
.bj-hand .info { font-size: 10.5px; color: rgba(255, 255, 255, .8); }
.bj-hand.win .info { color: #7ef0a5; font-weight: 700; }
.bj-hand.lose .info { color: #ff9d95; }
.bj-empty { padding: 16px 4px; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 650; color: rgba(255, 255, 255, .75);
  background: rgba(8, 20, 14, .4); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .2); }

.bj-chips { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.bj-chip { width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 800; color: #10131a;
  background: linear-gradient(160deg, #ffd76e, var(--gold));
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4), inset 0 -3px 6px rgba(150, 90, 0, .3),
              inset 0 2px 0 rgba(255, 255, 255, .5); }
.bj-chip:active { transform: scale(.9); }
.bj-chip.grey { background: linear-gradient(160deg, #e4e9f0, #aeb8c7); }
