/* ── Game pages shared ── */
.game-page {
  padding: 1.5rem 0 3rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs span[aria-current] {
  color: var(--color-primary);
}

.game-layout {
  display: grid;
  gap: 1.5rem;
}

.game-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.game-balance-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.game-balance {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.balance-pulse {
  animation: balancePulse 0.5s ease;
}

@keyframes balancePulse {
  0%, 100% { transform: scale(1); color: var(--color-primary); }
  50% { transform: scale(1.08); color: var(--color-accent-warm); text-shadow: 0 0 12px rgba(74, 222, 128, 0.5); }
}

.game-arena {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.bet-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bet-btn {
  padding: 0.5rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.bet-btn:hover,
.bet-btn.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(74, 222, 128, 0.1);
}

.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.responsible-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.responsible-bar strong {
  color: var(--color-accent-warm);
}

/* History panel */
.history-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.history-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.history-panel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.history-stats div {
  text-align: center;
  padding: 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.history-stat-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-stats strong {
  font-family: var(--font-mono);
  color: var(--color-primary);
  font-size: 0.9375rem;
}

.history-table-wrap {
  max-height: 220px;
  overflow-y: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.history-table th,
.history-table td {
  padding: 0.375rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.history-table th {
  color: var(--color-text-muted);
  font-weight: 500;
}

.history-win td:last-child {
  color: var(--color-primary);
}

.history-loss td:last-child {
  color: var(--color-text-muted);
}

.history-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 1rem !important;
}

/* Win toast */
.win-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 3000;
  background: linear-gradient(135deg, var(--color-surface), var(--color-bg-alt));
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2.5rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(74, 222, 128, 0.35);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.win-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.win-toast-mult {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.win-toast-amt {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  color: var(--color-accent-warm);
}

.win-amount-pop {
  animation: amountPop 0.6s ease;
}

@keyframes amountPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.win-toast-loss {
  border-color: var(--color-border);
  box-shadow: var(--shadow);
}

.win-toast-loss .win-toast-mult {
  color: var(--color-text-muted);
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 2500;
  pointer-events: none;
}

/* Hero background image */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(15, 20, 25, 0.92) 0%, rgba(15, 20, 25, 0.75) 45%, rgba(15, 20, 25, 0.4) 100%);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-grid-single {
  max-width: 640px;
}

/* Game card images */
.game-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.games-grid-3 {
  grid-template-columns: 1fr;
}

/* ── PLINKO ── */
.plinko-wrap {
  position: relative;
}

#plinko-canvas {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #1a2332 0%, #0f1419 100%);
  contain: strict;
}

.plinko-slots {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  max-width: 520px;
  margin: 0.5rem auto 0;
}

.plinko-slot {
  text-align: center;
  padding: 0.375rem 0.125rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.plinko-slot.mult-low { color: #4ade80; border-color: rgba(74, 222, 128, 0.4); }
.plinko-slot.mult-mid { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.plinko-slot.mult-high { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }

.plinko-slot.is-winner {
  animation: slotGlow 0.8s ease infinite alternate;
  transform: scale(1.08);
}

@keyframes slotGlow {
  from { box-shadow: 0 0 8px rgba(74, 222, 128, 0.4); }
  to { box-shadow: 0 0 20px rgba(74, 222, 128, 0.8); }
}

/* ── SLOTS ── */
.slots-machine {
  max-width: 560px;
  margin: 0 auto;
  perspective: 800px;
}

.slots-frame {
  background: linear-gradient(145deg, #2a3548, #1a2332);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.3);
  transform: rotateX(2deg);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  --reel-cell-h: 72px;
}

.reel {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  overflow: hidden;
  position: relative;
}

.reel-viewport {
  height: calc(var(--reel-cell-h) * 3);
  overflow: hidden;
  position: relative;
  contain: layout style paint;
}

.reel-viewport::before,
.reel-viewport::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  z-index: 2;
  pointer-events: none;
}

.reel-viewport::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(15, 20, 25, 0.85), transparent);
}

.reel-viewport::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(15, 20, 25, 0.85), transparent);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 0, 0);
  will-change: transform, filter;
  backface-visibility: hidden;
}

.reel-symbol {
  height: var(--reel-cell-h);
  min-height: var(--reel-cell-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.reel-symbol.is-win {
  animation: cellGlow 0.6s ease infinite alternate;
  background: rgba(74, 222, 128, 0.2);
  z-index: 1;
}

@keyframes cellGlow {
  from { box-shadow: inset 0 0 8px rgba(74, 222, 128, 0.3); }
  to { box-shadow: inset 0 0 16px rgba(74, 222, 128, 0.6); }
}

.reel.is-spinning .reel-strip {
  filter: blur(5px);
}

.reel.is-stopping .reel-strip {
  filter: blur(2px);
}

.reel.is-stopped .reel-strip {
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .reel-strip {
    transition: none !important;
  }
  .reel.is-spinning .reel-strip,
  .reel.is-stopping .reel-strip {
    filter: none;
  }
}

.slots-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.slots-info strong {
  color: var(--color-primary);
  font-family: var(--font-mono);
}

.lines-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.lines-selector input[type="range"] {
  width: 120px;
  accent-color: var(--color-primary);
}

.paytable-toggle {
  margin-top: 0.75rem;
}

.paytable {
  display: none;
  margin-top: 0.75rem;
  padding: 1rem;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
}

.paytable.is-open {
  display: block;
}

.paytable table {
  width: 100%;
  border-collapse: collapse;
}

.paytable th,
.paytable td {
  padding: 0.375rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

/* ── WHEEL ── */
.wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.wheel-container {
  position: relative;
  width: min(320px, 80vw);
  height: min(320px, 80vw);
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--color-accent-warm);
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: filter 0.3s;
}

.wheel-container.is-spinning #wheel-canvas {
  filter: drop-shadow(0 0 20px rgba(74, 222, 128, 0.5));
}

.wheel-result {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  color: var(--color-accent-warm);
  min-height: 1.5rem;
}

.wheel-history-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  justify-content: center;
}

.wheel-history-chip {
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.wheel-history-chip.chip-high {
  border-color: var(--color-accent-warm);
  color: var(--color-accent-warm);
}

.wheel-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden;
}

.wheel-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: particleOrbit 2s linear infinite;
}

@keyframes particleOrbit {
  from { transform: rotate(0deg) translateX(140px); opacity: 0.8; }
  to { transform: rotate(360deg) translateX(140px); opacity: 0.2; }
}

@media (min-width: 640px) {
  .games-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-layout {
    grid-template-columns: 1fr 300px;
  }
}

@media (min-width: 900px) {
  .games-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .games-grid:not(.games-grid-3) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .history-stats {
    grid-template-columns: 1fr;
  }
}
