/* ============================================================
   LuckyFiesta — games-engine.css
   Стили для игровых машин казино
   ============================================================ */

/* ==============================
   ОБЩИЙ КОНТЕЙНЕР ИГРЫ
   ============================== */
.casino-game-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,4,12,0.97);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  padding: 16px;
}
.casino-game-wrapper.open { display: flex; }

.casino-game-panel {
  width: 100%;
  max-width: 820px;
  max-height: 96vh;
  overflow-y: auto;
  background: #0a0a1a;
  border: 1px solid rgba(255,107,53,0.3);
  border-radius: 24px;
  box-shadow: 0 0 80px rgba(255,107,53,0.15), 0 0 40px rgba(123,47,190,0.1);
  scrollbar-width: thin;
  scrollbar-color: #FF6B35 #0a0a1a;
}

.game-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,107,53,0.05);
}

.game-panel-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-panel-close {
  background: rgba(255,255,255,0.07);
  border: none;
  color: #aaa;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-panel-close:hover { background: rgba(255,107,53,0.25); color: #fff; }

/* ==============================
   БАЛАНС ПАНЕЛЬ
   ============================== */
.balance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
  gap: 10px;
}

.bal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.bal-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 3px;
}

.bal-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #FFD700;
  transition: color 0.3s;
}
.bal-value.win-flash { color: #00FFB3; animation: flash-win 0.6s ease; }
.bal-value.lose-flash { color: #FF4444; animation: flash-lose 0.4s ease; }

@keyframes flash-win {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.2); color: #00FFB3; }
}
@keyframes flash-lose {
  0%,100% { transform: scale(1); }
  50% { transform: scale(0.95); }
}

/* ==============================
   СЛОТ-МАШИНА 3×3
   ============================== */
.slot-machine-body {
  padding: 24px;
}

/* Машина обёртка */
.slot-machine-frame {
  background: linear-gradient(160deg, #0d0d20, #14082a);
  border: 2px solid rgba(255,107,53,0.3);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  box-shadow:
    inset 0 0 60px rgba(123,47,190,0.1),
    0 0 30px rgba(255,107,53,0.08);
}

/* Декоративная LED-полоска сверху */
.slot-led-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.led-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: led-cycle 1.2s infinite;
}
.led-dot:nth-child(1)  { background:#FF6B35; animation-delay:0.0s; }
.led-dot:nth-child(2)  { background:#FFD700; animation-delay:0.1s; }
.led-dot:nth-child(3)  { background:#00D4AA; animation-delay:0.2s; }
.led-dot:nth-child(4)  { background:#7B2FBE; animation-delay:0.3s; }
.led-dot:nth-child(5)  { background:#FF6B35; animation-delay:0.4s; }
.led-dot:nth-child(6)  { background:#FFD700; animation-delay:0.5s; }
.led-dot:nth-child(7)  { background:#00D4AA; animation-delay:0.6s; }
.led-dot:nth-child(8)  { background:#7B2FBE; animation-delay:0.7s; }
.led-dot:nth-child(9)  { background:#FF6B35; animation-delay:0.8s; }
@keyframes led-cycle {
  0%,100% { opacity:1; box-shadow:0 0 6px currentColor; }
  50% { opacity:0.2; box-shadow:none; }
}

/* Грид барабанов 3×3 */
.reels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  position: relative;
}

/* Линия выигрыша (средняя строка) */
.payline-indicator {
  position: absolute;
  left: 0; right: 0;
  top: calc(33.33% + 4px);
  height: calc(33.33% - 8px);
  border: 2px solid rgba(255,215,0,0);
  border-radius: 8px;
  pointer-events: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  z-index: 2;
}
.payline-indicator.active {
  border-color: rgba(255,215,0,0.8);
  box-shadow: 0 0 20px rgba(255,215,0,0.3), inset 0 0 20px rgba(255,215,0,0.05);
}

/* Отдельная ячейка барабана */
.reel-cell {
  background: linear-gradient(160deg, #12122a, #1a0e30);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
  user-select: none;
}

/* Анимация вращения — вертикальный блур-спин */
.reel-cell.spinning {
  animation: reel-spin 0.08s linear infinite;
}

@keyframes reel-spin {
  0%   { filter: blur(3px); transform: scaleY(0.9); }
  50%  { filter: blur(6px); transform: scaleY(1.1); }
  100% { filter: blur(3px); transform: scaleY(0.9); }
}

/* Подсветка выигрышной ячейки */
.reel-cell.winner {
  background: linear-gradient(160deg, #2a1800, #4a2800);
  border-color: #FFD700;
  box-shadow: 0 0 20px rgba(255,215,0,0.5), inset 0 0 10px rgba(255,215,0,0.1);
  animation: winner-pulse 0.5s ease infinite alternate;
}

@keyframes winner-pulse {
  from { box-shadow: 0 0 15px rgba(255,215,0,0.4); transform: scale(1); }
  to   { box-shadow: 0 0 30px rgba(255,215,0,0.8); transform: scale(1.04); }
}

.reel-cell.row-win {
  background: linear-gradient(160deg, #001a10, #003020);
  border-color: #00FFB3;
  box-shadow: 0 0 20px rgba(0,255,179,0.4);
}

/* Надпись на ячейке при джекпоте */
.reel-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.05) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}

/* WIN сообщение */
.slot-win-message {
  text-align: center;
  min-height: 36px;
  margin: 14px 0 8px;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  transition: 0.3s;
}

/* Контролы слота */
.slot-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.bet-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.bet-selector label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bet-btn {
  background: rgba(255,107,53,0.15);
  border: 1px solid rgba(255,107,53,0.3);
  color: #FF6B35;
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bet-btn:hover { background: rgba(255,107,53,0.3); }
.bet-amount {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #FFD700;
  min-width: 48px;
  text-align: center;
}

.spin-btn {
  background: linear-gradient(135deg, #FF6B35, #FF9A42);
  color: #fff;
  border: none;
  padding: 14px 44px;
  border-radius: 50px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: 0.25s;
  box-shadow: 0 6px 24px rgba(255,107,53,0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  max-width: 260px;
}
.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(255,107,53,0.55);
}
.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.spin-btn .spin-icon { transition: transform 0.8s; }
.spin-btn.spinning .spin-icon { animation: spin-rotate 0.4s linear infinite; }
@keyframes spin-rotate { to { transform: rotate(360deg); } }

.auto-spin-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  padding: 12px 18px;
  border-radius: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.auto-spin-btn:hover { border-color: var(--accent, #FF6B35); color: #FF6B35; }
.auto-spin-btn.active { background: rgba(255,107,53,0.1); border-color: #FF6B35; color: #FF6B35; }

/* Таблица выплат */
.paytable {
  margin-top: 20px;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.05);
}
.paytable-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 10px;
}
.paytable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}
.pt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.78rem;
}
.pt-symbols { font-size: 0.9rem; }
.pt-prize { color: #FFD700; font-weight: 700; font-family: 'Syne', sans-serif; }

/* ==============================
   ПОКЕР СТОЛ
   ============================== */
.poker-game-body {
  padding: 24px;
}

.poker-table {
  background: radial-gradient(ellipse at 50% 50%, #1a4a2e, #0d2d1a, #081508);
  border: 3px solid #8B5E3C;
  border-radius: 50px;
  padding: 32px 28px;
  position: relative;
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.5),
    0 8px 40px rgba(0,0,0,0.6);
}

/* Декоративная полоса стола */
.poker-table::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 44px;
  pointer-events: none;
}

.poker-table-label {
  text-align: center;
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.15);
  margin-bottom: 20px;
}

/* Зоны карт */
.poker-community-area {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.poker-hand-area {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

/* Карта */
.playing-card {
  width: 56px;
  height: 82px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: default;
  transform-style: preserve-3d;
  flex-shrink: 0;
}

.playing-card.red  { color: #CC0000; }
.playing-card.black { color: #111; }

.playing-card.card-back {
  background: linear-gradient(135deg, #1a0a40, #3d1d80, #1a0a40);
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 0, transparent 50%);
  background-size: 8px 8px;
  color: transparent;
}

.card-value {
  font-size: 1.1rem;
  line-height: 1;
}
.card-suit {
  font-size: 1rem;
  line-height: 1;
}
.card-corner-tl {
  position: absolute;
  top: 4px; left: 5px;
  font-size: 0.62rem;
  line-height: 1.1;
  text-align: center;
}
.card-corner-br {
  position: absolute;
  bottom: 4px; right: 5px;
  font-size: 0.62rem;
  line-height: 1.1;
  transform: rotate(180deg);
  text-align: center;
}

/* Анимация раздачи */
.playing-card.deal-anim {
  animation: card-deal 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes card-deal {
  from {
    opacity: 0;
    transform: translateY(-60px) rotate(-15deg) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

.playing-card.highlight-card {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(255,215,0,0.5);
  border: 2px solid #FFD700;
}

/* Фишки */
.poker-chips-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 14px 0;
}

.chip {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 0.6rem;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: 0.2s;
}
.chip:hover { transform: translateY(-3px); }
.chip-25  { background: radial-gradient(#4CAF50, #2E7D32); color: #fff; }
.chip-50  { background: radial-gradient(#2196F3, #1565C0); color: #fff; }
.chip-100 { background: radial-gradient(#9C27B0, #6A1B9A); color: #fff; }
.chip-500 { background: radial-gradient(#F44336, #B71C1C); color: #fff; }

/* Сообщение покера */
.poker-result-msg {
  text-align: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  min-height: 32px;
  margin: 10px 0;
  transition: 0.3s;
}

/* Покер контролы */
.poker-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.poker-btn {
  padding: 13px 32px;
  border-radius: 50px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.25s;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.poker-btn-deal {
  background: linear-gradient(135deg, #7B2FBE, #9B5DE5);
  color: #fff;
  box-shadow: 0 6px 22px rgba(123,47,190,0.4);
}
.poker-btn-deal:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(123,47,190,0.55);
}

.poker-btn-hold {
  background: rgba(0,212,170,0.12);
  color: #00D4AA;
  border: 1px solid rgba(0,212,170,0.3);
}
.poker-btn-hold:hover:not(:disabled) {
  background: rgba(0,212,170,0.22);
}

.poker-btn-fold {
  background: rgba(255,68,68,0.1);
  color: #FF4444;
  border: 1px solid rgba(255,68,68,0.3);
}

.poker-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Звёзды победы */
.win-stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 99999;
  overflow: hidden;
}
.star-particle {
  position: absolute;
  font-size: 1.5rem;
  animation: star-fall 1.5s ease-out forwards;
}
@keyframes star-fall {
  0%   { transform: translateY(-20px) rotate(0deg) scale(0); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(300px) rotate(720deg) scale(0.3); opacity: 0; }
}

/* ==============================
   ДИСКЛЕЙМЕР ВНУТРИ ИГРЫ
   ============================== */
.game-disclaimer-bar {
  padding: 10px 24px;
  background: rgba(255,107,53,0.05);
  border-top: 1px solid rgba(255,107,53,0.1);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  border-radius: 0 0 24px 24px;
}

/* ==============================
   ПРЕВЬЮ КАРТОЧКИ ИГР (games page)
   ============================== */
.game-preview-card {
  background: #0f0f1e;
  border: 1px solid rgba(255,107,53,0.2);
  border-radius: 20px;
  overflow: hidden;
  transition: 0.3s;
  cursor: pointer;
}
.game-preview-card:hover {
  border-color: rgba(255,107,53,0.5);
  transform: translateY(-6px);
  box-shadow: 0 20px 56px rgba(255,107,53,0.18);
}

.gpc-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Слот превью */
.gpc-slots-bg {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,180,0,0.6) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,107,53,0.5) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(123,47,190,0.3) 0%, transparent 60%),
    linear-gradient(160deg, #0f0800, #2d1200, #1a0800);
}

/* Покер превью */
.gpc-poker-bg {
  background:
    radial-gradient(circle at 30% 50%, rgba(0,100,40,0.8) 0%, transparent 45%),
    radial-gradient(circle at 70% 30%, rgba(123,47,190,0.4) 0%, transparent 45%),
    linear-gradient(160deg, #030d06, #051a08, #020e04);
}

.gpc-thumb-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Мини-превью слота */
.mini-reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  padding: 6px;
  border: 1px solid rgba(255,215,0,0.3);
  box-shadow: 0 0 20px rgba(255,215,0,0.2);
}
.mini-reel-cell {
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.5);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Мини-превью покерного стола */
.mini-poker-table {
  background: radial-gradient(ellipse, #1a4a2e, #0a2010);
  border: 2px solid #5a3a1a;
  border-radius: 24px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mini-cards-row {
  display: flex;
  gap: 4px;
}
.mini-card {
  width: 22px; height: 32px;
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.mini-card.red   { color: #CC0000; }
.mini-card.black { color: #111; }
.mini-card.back  {
  background: linear-gradient(135deg, #1a0a40, #3d1d80);
  color: transparent;
}

.gpc-thumb .play-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.3s;
  z-index: 10;
}
.game-preview-card:hover .play-hover-overlay { opacity: 1; }

.play-hover-btn {
  background: linear-gradient(135deg, #FF6B35, #FF9A42);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 13px 32px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255,107,53,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gpc-badge {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 50px;
  z-index: 5;
}
.badge-hot { background: rgba(255,107,53,0.9); color: #fff; }
.badge-new { background: rgba(123,47,190,0.9); color: #fff; }
.badge-free { background: rgba(0,212,170,0.9); color: #111; }

.gpc-info {
  padding: 20px 22px 22px;
}
.gpc-info h3 {
  font-size: 1.15rem;
  margin-bottom: 7px;
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
}
.gpc-info p {
  color: rgba(255,255,255,0.5);
  font-size: 0.86rem;
  margin-bottom: 14px;
  line-height: 1.5;
}
.gpc-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.gpc-tag {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 600px) {
  .casino-game-panel { border-radius: 16px; }
  .slot-machine-body, .poker-game-body { padding: 14px; }
  .reel-cell { font-size: 1.4rem; }
  .spin-btn { padding: 12px 28px; font-size: 0.95rem; }
  .playing-card { width: 44px; height: 66px; }
  .card-value { font-size: 0.9rem; }
  .poker-table { padding: 20px 16px; border-radius: 32px; }
}
