/* ==================== table.css ==================== */

.poker-table-container {
  padding: 30px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.poker-table {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 280px;
  background: radial-gradient(ellipse at center, #131315 0%, #060607 100%);
  border: 4px solid #cc0000;
  border-radius: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 35px rgba(204, 0, 0, 0.35),
    inset 0 0 45px rgba(204, 0, 0, 0.25),
    inset 0 0 120px rgba(0, 0, 0, 0.9);
}

/* Водяной знак по центру */
.table-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  width: 100%;
}

.watermark-title {
  font-size: 64px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: -3px;
}

.watermark-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 5px;
  text-transform: uppercase;
}

/* Борд (общие карты) */
.board {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* ==================== НОВЫЙ ДИЗАЙН КАРТ ==================== */
.card {
  width: 56px;
  height: 80px;
  background: #fdfdfd;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border-radius: 6px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  user-select: none;
  overflow: hidden;
  display: block;
}

/* Цвета мастей */
.card.red {
  color: #d32f2f;
}

.card.black {
  color: #1c1c1c;
}

.card.back {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #1a1a1a, #070707 58%, #b10000);
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 0 0 2px rgba(255, 32, 40, 0.36),
    0 4px 12px rgba(0, 0, 0, 0.5);
}

.card.back::before {
  content: "Tir";
  position: absolute;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.card.back::after {
  content: "Poker";
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  color: #ff1a1a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

/* Верхний левый угол: Цифра + Маленькая масть под ней */
.card-top-left {
  position: absolute;
  top: 3px;
  left: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
}

/* Крупный вытянутый номинал как в казино */
.card-rank {
  font-family: "Arial Narrow", "Impact", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -1px;
}

/* Маленькая масть под цифрой */
.card-suit-small {
  font-size: 13px;
  margin-top: -1px;
}

/* Огромная масть в правом нижнем углу */
.card-suit-large {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 42px;
  line-height: 1;
}

/* Игроки */
.player-spot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 20;
}

.player-cards {
  display: flex;
  gap: 2px;
}

.player-name {
  background: #000;
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 12px;
  color: #fff;
  border: 1px solid #cc0000;
  white-space: nowrap;
}

/* Позиции игроков */
.poker-table .p1 {
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
}

.poker-table .p2 {
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
}

.poker-table[data-players-count="3"] .p3 {
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
}

.poker-table[data-players-count="4"] .p3 {
  left: 15%;
  bottom: -30px;
}

.poker-table[data-players-count="4"] .p4 {
  right: 15%;
  bottom: -30px;
}

.study-table-preview {
  padding: 8px 0 2px;
}

.study-table-preview .poker-table-container {
  padding: 8px 0 18px;
}

.study-preview-table {
  height: 230px;
  max-width: 540px;
}

.study-preview-table .board {
  top: 10px;
}

.study-preview-table .player-spot {
  gap: 0;
}

.study-preview-table .player-name {
  display: none;
}

.study-preview-table .player-cards {
  gap: 4px;
}

.study-preview-table .card {
  width: 48px;
  height: 68px;
}

.study-preview-table .card-rank {
  font-size: 22px;
}

.study-preview-table .card-suit-small {
  font-size: 13px;
}

.study-preview-table .card-suit-large {
  font-size: 34px;
}

.study-table-preview__caption {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  margin: 0;
}

/* ==================== АДАПТИВНОСТЬ (МОБИЛЬНЫЕ ТЕЛЕФОНЫ) ==================== */
@media (max-width: 768px) {
  .table-watermark {
    display: flex !important; /* или block, но flex для центровки */
    transform: translate(-50%, -50%) !important;
    pointer-events: none !important;
    user-select: none !important;
    z-index: 1 !important;
    opacity: 0.8; /* можно чуть прозрачности для читаемости карт */
  }

  .watermark-title {
    font-size: 28px !important; /* было 64px - уменьшаем в 2+ раза */
    letter-spacing: 1px !important;
    margin-bottom: -2px !important;
  }

  .watermark-subtitle {
    font-size: 8px !important; /* было 13px */
    letter-spacing: 3px !important;
  }

  .poker-table-container {
    padding: 0 !important;
    margin: 4px 0 !important;
    width: 100%;
    height: 100%;
    min-height: 250px !important;
  }

  .poker-table {
    width: 100% !important;
    max-width: 90vw !important;
    height: 100% !important;
    min-height: 230px !important;
    max-height: 55vh !important;
    border-width: 6px !important;
    border-radius: 100px !important;
  }

  /* Пропорциональное сжатие новых элементов внутри карты */
  .board .card,
  .player-cards .card {
    width: 44px !important;
    height: 62px !important;
    border-radius: 4px !important;
  }

  .board .card .card-top-left,
  .player-cards .card .card-top-left {
    top: 2px !important;
    left: 3px !important;
  }

  .board .card .card-rank,
  .player-cards .card .card-rank {
    font-size: 20px !important;
  }

  .board .card .card-suit-small,
  .player-cards .card .card-suit-small {
    font-size: 10px !important;
  }

  .board .card .card-suit-large,
  .player-cards .card .card-suit-large {
    font-size: 32px !important;
    bottom: 1px !important;
    right: 2px !important;
  }

  .player-name {
    font-size: 10px !important;
    padding: 2px 8px !important;
    margin-bottom: 2px !important;
  }

  .player-spot {
    gap: 2px !important;
  }

  .poker-table .board {
    top: 8px !important;
    gap: 4px !important;
  }

  .poker-table .p1 {
    left: -6px !important;
    top: 53% !important;
    transform: translateY(-50%) !important;
  }

  .poker-table .p2 {
    right: -6px !important;
    top: 53% !important;
    transform: translateY(-50%) !important;
  }

  .poker-table[data-players-count="3"] .p3 {
    bottom: -20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .poker-table[data-players-count="4"] .p3 {
    left: 18% !important;
    bottom: -20px !important;
    transform: none !important;
  }

  .poker-table[data-players-count="4"] .p4 {
    right: 18% !important;
    bottom: -20px !important;
    transform: none !important;
  }

  .study-table-preview .poker-table-container {
    height: auto;
    min-height: 0 !important;
    padding: 4px 0 14px !important;
  }

  .study-preview-table {
    height: 190px !important;
    min-height: 190px !important;
    max-height: none !important;
    border-width: 4px !important;
  }

  .study-preview-table .board {
    top: 12px !important;
  }

  .study-preview-table .card {
    width: 36px !important;
    height: 51px !important;
  }

  .study-preview-table .card-rank {
    font-size: 17px !important;
  }

  .study-preview-table .card-suit-small {
    font-size: 10px !important;
  }

  .study-preview-table .card-suit-large {
    font-size: 26px !important;
  }
}

@media (max-width: 400px) {
  .board .card,
  .player-cards .card {
    width: 38px !important;
    height: 54px !important;
  }

  .board .card .card-rank,
  .player-cards .card .card-rank {
    font-size: 17px !important;
  }

  .board .card .card-suit-small,
  .player-cards .card .card-suit-small {
    font-size: 9px !important;
  }

  .board .card .card-suit-large,
  .player-cards .card .card-suit-large {
    font-size: 26px !important;
    bottom: 0px !important;
    right: 1px !important;
  }
}

.poker-table[data-game="omaha"] .player-cards {
  gap: 0;
}
.poker-table[data-game="omaha"] .player-cards .card:not(:first-child) {
  margin-left: -24px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
}
@media (max-width: 768px) {
  .poker-table[data-game="omaha"] .player-cards .card:not(:first-child) {
    margin-left: -18px !important;
  }
}
@media (max-width: 400px) {
  .poker-table[data-game="omaha"] .player-cards .card:not(:first-child) {
    margin-left: -16px !important;
  }
}

/* =======================================================
   УЛУЧШЕНИЕ ОМАХИ: ЧИТАЕМОСТЬ ВЕЕРА И АДАПТАЦИЯ ИГРОКОВ
   ======================================================= */

/* 1. Увеличиваем масть под цифрой на десктопе */
.card-suit-small {
  font-size: 18px !important; /* Было 13px */
  margin-top: -2px !important;
}
.card-top-left {
  left: 5px !important; /* Чуть отодвигаем от края, чтобы крупной масти не было тесно */
  top: 4px !important;
}

/* Раздвигаем 3 и 4 игрока на десктопе для Омахи */
.poker-table[data-game="omaha"][data-players-count="4"] .p3 {
  left: 5% !important;
}
.poker-table[data-game="omaha"][data-players-count="4"] .p4 {
  right: 5% !important;
}

/* 2. Адаптация для обычных смартфонов (до 768px) */
@media (max-width: 768px) {
  .board .card .card-suit-small,
  .player-cards .card .card-suit-small {
    font-size: 14px !important; /* Было 10px */
  }
  
  .board .card .card-top-left,
  .player-cards .card .card-top-left {
    left: 4px !important;
    top: 3px !important;
  }

  /* Разводим игроков по углам стола в Омахе */
  .poker-table[data-game="omaha"][data-players-count="4"] .p3 {
    left: 2% !important;
  }
  .poker-table[data-game="omaha"][data-players-count="4"] .p4 {
    right: 2% !important;
  }
}

/* 3. Адаптация для очень узких смартфонов (до 400px) */
@media (max-width: 400px) {
  .board .card .card-suit-small,
  .player-cards .card .card-suit-small {
    font-size: 13px !important; /* Было 9px */
  }
  
  /* Делаем веер из 4-х карт чуть-чуть плотнее, чтобы он точно влез в экран */
  .poker-table[data-game="omaha"] .player-cards .card:not(:first-child) { 
    margin-left: -22px !important; 
  }
  
  /* Сдвигаем нижних игроков еще сильнее за пределы овала (стол позволяет) */
  .poker-table[data-game="omaha"][data-players-count="4"] .p3 {
    left: -2% !important;
  }
  .poker-table[data-game="omaha"][data-players-count="4"] .p4 {
    right: -2% !important;
  }
}
