/* ============================================
   ASTRL Games - Game Page Styles
   ============================================ */

/* ---- Game Layout ---- */
.game-page-wrapper {
  min-height: calc(100vh - var(--nav-height) - var(--notice-height));
  padding: var(--space-xl) 0 var(--space-3xl);
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.game-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.game-header h1 i {
  color: var(--primary-light);
}

.game-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.credit-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.credit-display i {
  color: var(--accent);
}

.credit-display .credit-amount {
  color: var(--text-primary);
  min-width: 60px;
  text-align: right;
}

.btn-free-credits {
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-free-credits:hover {
  background: var(--accent-light);
  box-shadow: var(--shadow-glow-accent);
  transform: translateY(-1px);
}

/* ---- Game Container ---- */
.game-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 700px;
  margin: 0 auto;
}

/* ---- Bet Controls ---- */
.bet-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.bet-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.bet-input {
  width: 120px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
}

.bet-input:focus {
  border-color: var(--primary);
}

.bet-quick-btns {
  display: flex;
  gap: var(--space-xs);
}

.bet-quick-btn {
  padding: 0.35rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bet-quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ---- Result Display ---- */
.game-result {
  text-align: center;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  margin-top: var(--space-xl);
  display: none;
  animation: fadeInUp 0.4s ease;
}

.game-result.show {
  display: block;
}

.game-result.win {
  background: rgba(6, 214, 160, 0.08);
  border: 1px solid rgba(6, 214, 160, 0.3);
}

.game-result.lose {
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.game-result h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.game-result.win h3 { color: var(--accent); }
.game-result.lose h3 { color: var(--danger); }

.game-result p {
  font-size: 1rem;
}

/* ---- Predictor Game ---- */
.number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.number-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.number-btn:hover {
  border-color: var(--primary);
  background: rgba(45, 91, 255, 0.1);
}

.number-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow-primary);
}

.number-btn.lucky {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-dark);
  box-shadow: var(--shadow-glow-accent);
}

.play-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 1rem;
  font-size: 1.1rem;
}

.lucky-reveal {
  text-align: center;
  margin: var(--space-xl) 0 var(--space-md);
}

.lucky-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  color: #fff;
  box-shadow: var(--shadow-glow-primary);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- Dice Game ---- */
.dice-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.dice-choice {
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.dice-choice:hover {
  border-color: var(--primary);
}

.dice-choice.selected {
  border-color: var(--primary);
  background: rgba(45, 91, 255, 0.1);
}

.dice-choice h4 {
  margin-bottom: var(--space-xs);
}

.dice-choice .payout {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.dice-choice .range {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dice-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
  margin: var(--space-2xl) 0;
  min-height: 120px;
}

.die {
  width: 90px;
  height: 90px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 12px;
  gap: 2px;
  transition: all var(--transition-base);
}

.die.rolling {
  animation: diceRoll 0.6s ease infinite;
}

@keyframes diceRoll {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(0.9); }
  100% { transform: rotate(360deg) scale(1); }
}

.dot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: transparent;
}

.dot.visible {
  background: var(--text-primary);
}

.dice-total {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  min-height: 36px;
}

/* ---- Spinner Game ---- */
.spinner-machine {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
}

.reel-window {
  width: 120px;
  height: 120px;
  background: var(--bg-surface);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  transition: transform 0.1s linear;
}

.reel-symbol {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
}

.reel.spinning .reel-symbol {
  animation: reelSpin 0.15s linear infinite;
}

@keyframes reelSpin {
  from { transform: translateY(0); }
  to { transform: translateY(-120px); }
}

.spinner-payouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}

.payout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: var(--space-xs) var(--space-sm);
}

.payout-row .symbols {
  display: flex;
  gap: 2px;
  font-size: 1.1rem;
}

.payout-row .multiplier {
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-display);
}

/* ---- Card Match Game ---- */
.match-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.match-stat {
  text-align: center;
}

.match-stat .stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.match-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  max-width: 500px;
  margin: 0 auto var(--space-xl);
}

.match-card {
  aspect-ratio: 3/4;
  cursor: pointer;
  perspective: 600px;
}

.match-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

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

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

.match-card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: 2rem;
  border: 2px solid var(--border-subtle);
}

.match-card-back {
  background: var(--gradient-primary);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
}

.match-card-front {
  background: var(--bg-surface);
  transform: rotateY(180deg);
  font-size: 2.5rem;
}

.match-card.matched .match-card-front {
  border-color: var(--accent);
  background: rgba(6, 214, 160, 0.08);
}

.match-card.matched {
  cursor: default;
}

.new-game-btn {
  display: block;
  margin: var(--space-xl) auto 0;
}

/* ---- Game Disclaimer ---- */
.game-disclaimer {
  text-align: center;
  padding: var(--space-xl) 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

.game-disclaimer i {
  margin-right: var(--space-xs);
  color: var(--warning);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .game-container {
    padding: var(--space-lg);
  }

  .number-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
  }

  .number-btn {
    font-size: 1.1rem;
  }

  .dice-choices {
    grid-template-columns: 1fr;
  }

  .die {
    width: 70px;
    height: 70px;
    padding: 8px;
  }

  .spinner-machine {
    gap: var(--space-sm);
  }

  .reel-window {
    width: 90px;
    height: 90px;
  }

  .reel-symbol {
    height: 90px;
    font-size: 2.2rem;
  }

  .card-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
  }

  .game-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-meta {
    width: 100%;
    justify-content: space-between;
  }

  .bet-controls {
    flex-direction: column;
  }
}
