/* Game-specific styles */
.hero-with-bg {
  position: relative;
  overflow: hidden;
}

.hero-with-bg .hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.hero-with-bg .container {
  position: relative;
  z-index: 1;
}

.product-with-bg {
  position: relative;
  overflow: hidden;
  padding: var(--space-2xl) 0;
}

.product-with-bg .product-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  z-index: 0;
}

.product-with-bg .container {
  position: relative;
  z-index: 1;
}

.cards-grid--five {
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .cards-grid--five {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-grid--five {
    grid-template-columns: repeat(3, 1fr);
  }
}

.game-page {
  padding: var(--space-xl) 0 var(--space-2xl);
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.game-toolbar .bet-controls {
  margin: 0;
}

.slot-canvas-host {
  width: 100%;
  max-width: 480px;
  min-height: 0;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--color-border-glow);
  box-shadow:
    var(--shadow-gold),
    inset 0 0 40px rgba(139, 92, 246, 0.08);
  padding-left: 0 !important;
}

.slot-canvas-host canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
}

.paytable-mini {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto var(--space-md);
  text-align: center;
}

/* Roulette */
.roulette-layout {
  display: grid;
  gap: var(--space-xl);
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .roulette-layout {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }
}

.roulette-wheel-wrap {
  position: relative;
  width: min(280px, 90vw);
  margin: 0 auto;
  aspect-ratio: 1;
}

.roulette-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid var(--color-primary);
  transform: rotate(0deg);
  will-change: transform;
  position: relative;
  overflow: hidden;
}

.roulette-ball {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transform: rotate(0deg);
  transform-origin: 50% 420%;
  will-change: transform;
}

.roulette-table {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.7rem;
  max-width: 100%;
  margin-bottom: 20px;
}

.roulette-cell {
  min-width: 36px;
  min-height: var(--touch-min);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text);
  cursor: pointer;
  padding: 2px;
  font-weight: 600;
  transition:
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.roulette-cell[data-bet="red"] {
  background: #5c1a1a;
}

.roulette-cell[data-bet="black"] {
  background: #1a1a1a;
}

.roulette-cell.has-bet {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.roulette-cell.is-winner {
  box-shadow: 0 0 12px var(--color-success);
  animation: pulse-win 0.6s ease 2;
}

@keyframes pulse-win {
  50% {
    filter: brightness(1.4);
  }
}

.chip-selector {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.chip-selector button.is-active {
  border-color: var(--color-primary);
}

/* Video Poker */
.poker-cards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  min-height: 160px;
  margin: var(--space-xl) 0;
  perspective: 800px;
}

.poker-card {
  width: 88px;
  height: 124px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #fff, #e8e8e8);
  color: #111;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition:
    transform 0.35s ease,
    box-shadow 0.2s ease;
  box-shadow: var(--shadow-md);
  min-height: var(--touch-min);
}

.poker-card .poker-suit {
  display: block;
  font-size: 1.25rem;
}

.poker-card.is-held {
  transform: translateY(12px);
  box-shadow: 0 0 0 3px var(--color-primary);
}

.poker-card-held {
  display: none;
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  background: var(--color-primary);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}

.poker-card.is-held .poker-card-held {
  display: block;
}

.poker-card.is-dealing {
  animation: deal-in 0.45s ease backwards;
}

@keyframes deal-in {
  from {
    opacity: 0;
    transform: translateY(-40px) rotateY(90deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateY(0);
  }
}

.poker-paytable {
  width: 100%;
  max-width: 360px;
  margin: 0 auto var(--space-lg);
  font-size: 0.85rem;
  border-collapse: collapse;
}

.poker-paytable th,
.poker-paytable td {
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-sm);
  text-align: left;
}

.poker-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Glass panels & gold pulse button */
.glass-panel {
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border-glow);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.btn-gold-pulse {
  background: var(--color-gold-gradient);
  color: #1a0f00;
  font-weight: 800;
  min-height: 52px;
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  animation: gold-pulse 2s ease-in-out infinite;
}

.btn-gold-pulse:disabled {
  opacity: 0.45;
  animation: none;
  cursor: not-allowed;
}

@keyframes gold-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(240, 180, 41, 0.45);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 6px 28px rgba(192, 132, 252, 0.55);
  }
}

.btn-icon {
  min-width: var(--touch-min);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Slot UI */
.slot-canvas-host {
  box-shadow:
    0 0 40px rgba(192, 132, 252, 0.2),
    inset 0 0 30px rgba(240, 180, 41, 0.08);
}

.slot-ui {
  margin: var(--space-lg) auto;
  max-width: 520px;
}

.slot-controls-row,
.slot-actions-row,
.auto-spin-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.bet-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: 20px;
}

.bet-stepper input {
  width: 72px;
  text-align: center;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
}

.bet-step-btns .is-active,
.auto-spin-row.is-active .auto-label {
  color: var(--color-primary);
}

.game-history {
  max-width: 520px;
  margin: var(--space-xl) auto 0;
}

.game-history h2 {
  margin: 0 0 var(--space-md);
  font-size: 1.1rem;
  color: var(--color-primary);
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.game-result {
  text-align: center;
  min-height: 1.5em;
  color: var(--color-primary);
}

/* Roulette enhanced */
.roulette-win-banner {
  display: none;
  text-align: center;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 24px rgba(240, 180, 41, 0.8);
  margin-bottom: var(--space-md);
  animation: win-pop 0.5s ease;
}

.roulette-win-banner.is-visible {
  display: block;
}

@keyframes win-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.roulette-particles {
  position: relative;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.roulette-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 1.25rem;
  animation: particle-fly 1s ease forwards;
}

@keyframes particle-fly {
  to {
    transform: translate(var(--px), var(--py));
    opacity: 0;
  }
}

.roulette-wheel-section {
  display: flex;
  justify-content: center;
  padding: var(--space-xl);
}

.roulette-wheel-wrap {
  position: relative;
  width: min(260px, 80vw);
  aspect-ratio: 1;
}

.roulette-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid #ffd700;
  box-shadow:
    0 0 30px rgba(192, 132, 252, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  transform: rotate(0deg);
  will-change: transform;
  position: relative;
  overflow: hidden;
}

.roulette-wheel-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
}

.roulette-pocket-label {
  position: absolute;
  left: 50%;
  top: 6%;
  width: 1.4em;
  margin-left: -0.7em;
  text-align: center;
  font-size: clamp(5px, 2.2vw, 9px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  transform-origin: 50% 470%;
  transform: rotate(var(--pocket-angle));
  pointer-events: none;
}

.roulette-ball-track {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  pointer-events: none;
}

.roulette-ball {
  position: absolute;
  top: 0;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: radial-gradient(circle at 30% 30%, #fff, #ccc);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transform-origin: 50% 680%;
  will-change: transform;
}

.chip-selector {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.roulette-chip {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px dashed rgba(255, 255, 255, 0.5);
  background: radial-gradient(circle at 30% 30%, #ffd700, #c084fc);
  color: #000;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-height: var(--touch-min);
  min-width: var(--touch-min);
}

.roulette-chip.is-active {
  box-shadow:
    0 0 0 3px var(--color-primary),
    0 4px 16px rgba(240, 180, 41, 0.6);
  transform: scale(1.08);
}

.roulette-cell {
  position: relative;
  border-radius: var(--radius-sm);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.roulette-cell:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(240, 180, 41, 0.3);
}

.roulette-cell.is-red-num {
  background: linear-gradient(145deg, #8b1a1a, #5c1010);
}

.roulette-cell.is-black-num {
  background: linear-gradient(145deg, #2a2a2a, #111);
}

.roulette-cell.is-zero {
  background: linear-gradient(145deg, #0d7a4a, #065a36);
}

.roulette-chip-on-cell {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-color, #f0b429);
  color: #000;
  transform: translateY(-20px);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s;
}

.roulette-chip-on-cell.is-dropped {
  transform: translateY(0);
  opacity: 1;
}

.roulette-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

/* Poker enhanced */
.poker-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.poker-felt {
  position: relative;
  background: linear-gradient(160deg, #1a4d2e 0%, #0f2e1f 100%);
  border-radius: var(--radius-lg);
  border: 3px solid rgba(255, 215, 0, 0.45);
  padding: var(--space-xl) var(--space-md);
  margin-bottom: var(--space-lg);
  min-height: 220px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.4s ease;
}

.poker-felt.is-win-flash {
  box-shadow:
    inset 0 0 80px rgba(63, 185, 80, 0.35),
    0 0 40px rgba(63, 185, 80, 0.25);
}

.poker-combo-display {
  text-align: center;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  color: #ffd700;
  min-height: 1.5em;
  margin: 0 0 var(--space-md);
}

.poker-win-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.poker-win-fx.is-active {
  animation: felt-flash 0.6s ease;
}

@keyframes felt-flash {
  50% {
    opacity: 1;
    background: radial-gradient(
      circle,
      rgba(255, 215, 0, 0.2),
      transparent 70%
    );
  }
}

.poker-cards {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  min-height: 140px;
}

.poker-card {
  flex: 0 0 auto;
  min-width: 80px;
  width: 88px;
  height: 124px;
}

.poker-card.is-red .poker-suit,
.poker-card.is-red .poker-rank {
  color: #c41e3a;
}

.poker-card.is-black .poker-suit,
.poker-card.is-black .poker-rank {
  color: #111;
}

.poker-card:hover:not(.is-held) {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.poker-card.is-held {
  transform: translateY(10px);
  box-shadow: 0 0 0 3px #3fb950;
}

.poker-card.is-winner-card {
  box-shadow:
    0 0 0 3px #ffd700,
    0 0 20px rgba(255, 215, 0, 0.5);
}

.poker-card-inner {
  display: block;
  width: 100%;
  height: 100%;
}

.poker-rank {
  display: block;
  font-size: 1.4rem;
  line-height: 1.1;
}

.poker-controls-sticky {
  position: sticky;
  bottom: calc(var(--disclaimer-height) + var(--space-md));
  z-index: 50;
}

.btn-poker-main {
  min-height: 60px;
  min-width: 100px;
}

.poker-paytable-modal {
  opacity: 0;
  visibility: hidden;
}

.poker-paytable-modal.is-open {
  opacity: 1;
  visibility: visible;
  display: flex;
}

.poker-paytable tr.is-active {
  background: rgba(240, 180, 41, 0.2);
  animation: row-blink 0.8s ease 3;
}

@keyframes row-blink {
  50% {
    background: rgba(240, 180, 41, 0.4);
  }
}

@media (max-width: 768px) {
  .roulette-layout {
    grid-template-columns: 1fr;
  }

  .poker-controls-sticky {
    bottom: var(--disclaimer-height);
  }

  .roulette-cell {
    min-width: var(--touch-min);
    min-height: var(--touch-min);
  }
}

@media (max-width: 480px) {
  .game-page .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .slot-canvas-host,
  .slot-ui,
  .game-history,
  .paytable-mini {
    max-width: 100%;
  }

  .slot-controls-row,
  .slot-actions-row,
  .auto-spin-row {
    gap: var(--space-sm);
  }

  .bet-stepper input {
    width: 56px;
    font-size: 0.9rem;
  }

  .bet-step-btns .btn {
    padding: var(--space-sm);
    min-width: 2.5rem;
  }

  .roulette-wheel-section {
    padding: var(--space-md);
  }

  .roulette-wheel-wrap {
    width: min(220px, calc(100vw - 2.5rem));
  }

  .roulette-table {
    font-size: 0.65rem;
    gap: 3px;
  }

  .roulette-cell {
    min-width: 28px;
    min-height: 36px;
    padding: 1px;
  }

  .roulette-chip {
    width: 44px;
    height: 44px;
  }

  .poker-felt {
    padding: var(--space-md) var(--space-sm);
  }

  .poker-card {
    width: clamp(52px, 16vw, 88px);
    height: auto;
    aspect-ratio: 88 / 124;
    min-width: 52px;
  }

  .poker-cards {
    gap: var(--space-sm);
    min-height: 110px;
  }

  .poker-rank {
    font-size: 1.1rem;
  }

  .btn-poker-main {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 360px) {
  .roulette-cell {
    min-width: 24px;
    min-height: 32px;
    font-size: 0.6rem;
  }

  .poker-card {
    width: clamp(48px, 15vw, 72px);
    min-width: 48px;
  }
}
