/* ═══════════════════════════════════════
   GAMES PAGE - PREMIUM OVERHAUL
═══════════════════════════════════════ */

:root {
  --gold: #C9A84C;
  --gold-glow: rgba(201,168,76,0.3);
  --red: #b0003a;
  --red-deep: #4a0018;
  --neon-red: #ff1f5a;
  --felt-dark: #0e0007;
  --glass-bg: rgba(20, 5, 12, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* ── HERO ── */
.games-bg-blur {
  position: absolute;
  inset: 0;
  background: var(--bg) url('../img/games-hero-bg.webp') center center / cover no-repeat;
  filter: blur(14px) brightness(0.35);
  transform: scale(1.08);
  z-index: 0;
}

/* ── GAMES GRID ── */
.games-grid-container {
  padding: 4rem 2rem 10rem;
  position: relative;
  z-index: 10;
}

.games-grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* ── GAME CARD BASE ── */
.game-card {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(20, 5, 12, 0.98), rgba(8, 0, 3, 0.92));
  border: 1px solid var(--glass-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.02);
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
}

.game-card-bg {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  opacity: 0.15;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
  top: -200px;
  right: -150px;
  /* Removed GPU heavy filter: blur() in favor of performant radial-gradient */
}

.game-card:hover .game-card-bg {
  opacity: 0.3;
}

.blur-red { background: radial-gradient(circle, var(--neon-red) 0%, transparent 65%); }
.blur-gold { background: radial-gradient(circle, var(--gold) 0%, transparent 65%); }
.blur-purple { background: radial-gradient(circle, #9b2cff 0%, transparent 65%); }
.blur-blue { background: radial-gradient(circle, #00e1ff 0%, transparent 65%); }
.blur-silver { background: radial-gradient(circle, #ffffff 0%, transparent 65%); }

.game-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── HEADER ── */
.game-header {
  padding: 2.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.game-title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.game-num {
  font-family: var(--font-heading);
  color: var(--red);
  font-size: 1.2rem;
  opacity: 0.8;
}

.game-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.05em;
}

.game-rule {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
}

/* ── TABLE AREA ── */
.game-table {
  padding: 2rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dealer-msg {
  text-align: center;
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
  min-height: 1.4em;
}

.dealer-msg::before {
  content: '✦';
  color: var(--gold);
  margin-right: 0.5rem;
  font-size: 0.8rem;
  font-style: normal;
}

.game-score-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.score-pill {
  background: rgba(255,255,255,0.05);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.05);
}

.score-val {
  color: var(--gold);
  margin-left: 0.4rem;
}

.game-felt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 1.5rem 0;
  position: relative;
}

/* ── RESULT TEXT ── */
.game-result-container {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.game-result, .poker-rank, .roulette-result {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  transition: all 0.3s ease;
}

.result-win { color: #5ad585; text-shadow: 0 0 15px rgba(90,213,133,0.4); }
.result-lose { color: var(--red); }
.result-bust { color: var(--red); }
.result-bj { color: var(--gold); text-shadow: 0 0 15px rgba(201,168,76,0.4); }
.result-push { color: #fff; }

/* ── CONTROLS ── */
.game-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.stretch-ctrl { width: 100%; }

.ctrl-group {
  display: flex;
  gap: 0.5rem;
}

.noct-btn {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='26' viewBox='0 0 22 26'%3E%3Cpath d='M7 0 C6 0 5 1 5 2 L5 13 C4 12 3 12 2 12 C1 12 0 13 0 14 C0 15 1 16 2 17 L7 22 C9 24 11 25 14 25 C18 25 22 21 22 17 L22 10 C22 9 21 8 20 8 C19 8 18 9 18 10 L18 8 C18 7 17 6 16 6 C15 6 14 7 14 8 L14 7 C14 6 13 5 12 5 C11 5 10 6 10 7 L10 2 C10 1 9 0 8 0 Z' fill='%23B0003A' stroke='%23100008' stroke-width='0.8' stroke-linejoin='round'/%3E%3C/svg%3E") 7 0, pointer;
  transition: all 0.3s ease;
}

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

.noc-solid {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  box-shadow: 0 4px 15px rgba(176,0,58,0.3);
}

.noc-solid:hover:not(:disabled) {
  background: #d10045;
  border-color: #d10045;
  box-shadow: 0 6px 20px rgba(176,0,58,0.5);
  transform: translateY(-2px);
}

.noc-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-glow);
}

.noc-outline:hover:not(:disabled) {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.noc-ghost {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.1);
}

.noc-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

.full-width { width: 100%; }

/* ═══════════════════════════════════════
   PLAYING CARDS AESTHETIC
═══════════════════════════════════════ */
.bj-zones {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.bj-zone {
  display: flex;
  justify-content: center;
}

.bj-hand, .poker-hand {
  display: flex;
  gap: 15px; /* Clean standard casino look */
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  min-height: 110px;
  flex-wrap: wrap; /* allow wrapping if many cards */
}

.card {
  width: 76px;
  height: 108px;
  position: relative;
  transition: opacity 0.3s, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
  border-radius: 6px;
  animation: dealIn 0.4s forwards;
  flex-shrink: 0;
}

.card:hover { transform: translateY(-10px) scale(1.05); z-index: 10; box-shadow: 0 15px 30px rgba(0,0,0,0.5); }

@keyframes dealIn {
  from { opacity: 0; transform: translateY(-40px) rotateX(20deg) scale(0.8); }
  to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

.card-inner {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.card.flipped .card-inner { transform: rotateY(180deg); }

.card-back, .card-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 6px;
}

.card-back {
  background: linear-gradient(135deg, #160813, #0a0208);
  border: 1px solid rgba(176,0,58,0.6);
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(176,0,58,0.15) 5px, rgba(176,0,58,0.15) 6px),
    repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(176,0,58,0.15) 5px, rgba(176,0,58,0.15) 6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back::after {
  content: '✦';
  color: rgba(176,0,58,0.5);
  font-size: 20px;
}

.card-front {
  background: #fbfbfb;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.card-front.red-suit { color: #d0002b; }
.card-front.black-suit { color: #111; }
.card-front.royal { background: linear-gradient(135deg, #fbfbfb 0%, #e6d8ce 100%); }

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card-corner.card-br { transform: rotate(180deg); margin-top: auto; align-self: flex-end; }

.card-rank {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.card-suit-sym { font-size: 11px; }

.card-center-sym {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* ═══════════════════════════════════════
   ROULETTE AESTHETIC
═══════════════════════════════════════ */
.roulette-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.roulette-wheel-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.roulette-pointer {
  color: var(--gold);
  font-size: 1.5rem;
  position: absolute;
  top: -15px;
  filter: drop-shadow(0 0 5px var(--gold));
  z-index: 10;
}

#roulette-wheel {
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.05),
    0 0 0 8px rgba(0,0,0,0.8),
    0 20px 50px rgba(0,0,0,0.7);
  background: radial-gradient(circle at center, #111, #000);
}

.roulette-side { width: 100%; }

.roulette-history-board {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.roulette-history-board span {
  font-size: 0.65rem;
  font-family: var(--font-heading);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.roulette-past {
  display: flex;
  gap: 0.5rem;
  min-height: 38px;
}

.roulette-past-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.2), 0 5px 15px rgba(0,0,0,0.5);
}

.num-red { background: linear-gradient(135deg, #ff3366, #990022); }
.num-black { background: linear-gradient(135deg, #444, #111); }
.num-green { background: linear-gradient(135deg, #33cc66, #006622); border-color: var(--gold); }

.roulette-controls {
  flex-direction: column;
  gap: 1.5rem;
}

.bet-row {
  display: flex;
  gap: 1rem;
}

.noct-chip {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='26' viewBox='0 0 22 26'%3E%3Cpath d='M7 0 C6 0 5 1 5 2 L5 13 C4 12 3 12 2 12 C1 12 0 13 0 14 C0 15 1 16 2 17 L7 22 C9 24 11 25 14 25 C18 25 22 21 22 17 L22 10 C22 9 21 8 20 8 C19 8 18 9 18 10 L18 8 C18 7 17 6 16 6 C15 6 14 7 14 8 L14 7 C14 6 13 5 12 5 C11 5 10 6 10 7 L10 2 C10 1 9 0 8 0 Z' fill='%23B0003A' stroke='%23100008' stroke-width='0.8' stroke-linejoin='round'/%3E%3C/svg%3E") 7 0, pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.noct-chip::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
}

.noct-chip:hover { transform: scale(1.1) translateY(-2px); }

.noct-chip.selected {
  border-style: solid;
  border-color: var(--gold);
  transform: scale(1.15) translateY(-5px);
  box-shadow: 0 10px 25px rgba(201,168,76,0.3);
}

.rb-red { background: radial-gradient(circle at 30% 30%, #e6204a, #80001a); }
.rb-green { background: radial-gradient(circle at 30% 30%, #20e65b, #00661e); }
.rb-black { background: radial-gradient(circle at 30% 30%, #333, #0a0a0a); }

.chip-val {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: #fff;
  letter-spacing: 0.05em;
  z-index: 2;
}

/* ═══════════════════════════════════════
   BINGO AESTHETIC
═══════════════════════════════════════ */
.bingo-felt-area {
  flex-direction: column;
  gap: 1.5rem;
}

.bingo-display-board {
  text-align: center;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 1rem 2rem;
  min-width: 150px;
}

.bingo-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.5rem;
}

.bingo-called-num {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  min-height: 3rem;
  line-height: 1;
}

.bingo-board-wrapper {
  background: rgba(255,255,255,0.02);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.bingo-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 260px;
}

.bingo-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  color: rgba(255,255,255,0.6);
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.02);
}

.bingo-header {
  background: transparent;
  border-color: transparent;
  color: var(--gold);
  font-size: 1.1rem;
  box-shadow: none;
}

.bingo-cell.called {
  background: rgba(176,0,58,0.2);
  border-color: rgba(176,0,58,0.5);
  color: #fff;
  transform: scale(0.95);
  box-shadow: inset 0 0 10px rgba(176,0,58,0.3);
}

.bingo-cell.bingo-win {
  background: rgba(201,168,76,0.3);
  border-color: var(--gold);
  color: #fff;
  text-shadow: 0 0 10px #fff;
  box-shadow: 0 0 15px rgba(201,168,76,0.4);
  animation: pulseGold 1.5s infinite;
}

@keyframes pulseGold {
  0% { box-shadow: 0 0 15px rgba(201,168,76,0.4); }
  50% { box-shadow: 0 0 25px rgba(201,168,76,0.8); }
  100% { box-shadow: 0 0 15px rgba(201,168,76,0.4); }
}

/* ═══════════════════════════════════════
   SCRATCH CARD AESTHETIC
═══════════════════════════════════════ */
.scratch-ticket-container {
  position: relative;
  width: 340px;
  height: 190px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  border: 2px solid rgba(255,255,255,0.05);
}

.scratch-underlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f0512, #0d0008);
  gap: 0.5rem;
}

.scratch-trophy {
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.5;
}

.scratch-prize-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0 0.5rem;
  text-shadow: 0 0 20px rgba(201,168,76,0.5);
}
.scratch-prize-value.long {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

#scratch-canvas {
  position: absolute;
  inset: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='26' viewBox='0 0 22 26'%3E%3Cpath d='M7 0 C6 0 5 1 5 2 L5 13 C4 12 3 12 2 12 C1 12 0 13 0 14 C0 15 1 16 2 17 L7 22 C9 24 11 25 14 25 C18 25 22 21 22 17 L22 10 C22 9 21 8 20 8 C19 8 18 9 18 10 L18 8 C18 7 17 6 16 6 C15 6 14 7 14 8 L14 7 C14 6 13 5 12 5 C11 5 10 6 10 7 L10 2 C10 1 9 0 8 0 Z' fill='%23B0003A' stroke='%23100008' stroke-width='0.8' stroke-linejoin='round'/%3E%3C/svg%3E") 7 0, pointer;
  z-index: 5;
}

/* ═══════════════════════════════════════
   RESPONSIVE DESIGN
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .game-header {
    padding: 2rem;
  }
  
  .game-table {
    padding: 1.5rem 2rem 2rem;
  }
}

@media (max-width: 480px) {
  .games-grid-container {
    padding: 2rem 1rem 5rem;
  }
  
  .hero-title { font-size: 2.8rem; }
  
  .game-card { border-radius: 16px; }
  .game-header { padding: 1.5rem; }
  .game-table { padding: 1rem 1.5rem 1.5rem; }
  
  .scratch-ticket-container {
    width: 280px;
    height: 160px;
  }
  
  #scratch-canvas { width: 280px; height: 160px; }
}
