/* ============================================================
   MapleForestJourney — Games Stylesheet
   ============================================================ */

/* ─── Game Shell ────────────────────────────────────────────── */
.game-page {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--forest-900) 0%, var(--forest-800) 60%, var(--bark-800) 100%);
  padding-top: var(--nav-height);
  color: var(--neutral-50);
}

.game-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.game-header { text-align: center; margin-bottom: 40px; }
.game-header h1 { color: var(--neutral-50); font-size: 2.2rem; margin-bottom: 8px; }
.game-header p { color: var(--neutral-400); font-size: 0.95rem; }

/* ─── Currency Bar ──────────────────────────────────────────── */
.currency-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.currency-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.currency-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--neutral-500); }
.currency-value { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; color: var(--maple-300); }

.currency-actions { display: flex; gap: 10px; }

.btn-game {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition-base);
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
}

.btn-game-primary {
  background: linear-gradient(135deg, var(--maple-700), var(--maple-500));
  color: #fff;
  box-shadow: 0 2px 8px rgba(212,98,10,0.35);
}
.btn-game-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212,98,10,0.45); }
.btn-game-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-game-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--neutral-200);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-game-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.btn-game-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-game-success {
  background: linear-gradient(135deg, var(--success), #3DAA62);
  color: #fff;
  box-shadow: 0 2px 8px rgba(45,139,78,0.35);
}
.btn-game-success:hover:not(:disabled) { transform: translateY(-1px); }
.btn-game-success:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Game Table / Board ────────────────────────────────────── */
.game-board {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 24px;
}

/* ─── Blackjack Cards ───────────────────────────────────────── */
.bj-table {
  background: radial-gradient(ellipse at center, #1E5A2A 0%, #0F3015 100%);
  border-radius: var(--radius-xl);
  padding: 36px;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.3);
}

.bj-zone { width: 100%; }
.bj-zone-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bj-score {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--maple-300);
}

.bj-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 120px;
  align-items: center;
}

.bj-divider {
  width: 100%;
  border: none;
  border-top: 1px dashed rgba(255,255,255,0.15);
  margin: 4px 0;
}

.playing-card {
  width: 72px;
  height: 108px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  padding: 6px;
  position: relative;
  animation: cardDeal 0.3s ease;
  flex-shrink: 0;
  user-select: none;
}

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

.playing-card.face-down {
  background: linear-gradient(135deg, #1B3A0F 25%, #2D5A1B 25%, #2D5A1B 50%, #1B3A0F 50%, #1B3A0F 75%, #2D5A1B 75%);
  background-size: 20px 20px;
  border: 3px solid rgba(255,255,255,0.15);
}

.card-rank { font-size: 0.85rem; font-weight: 700; line-height: 1; }
.card-suit { font-size: 0.7rem; line-height: 1; }
.card-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 1.6rem; }

.card-red { color: #C0392B; }
.card-black { color: #1A1A1A; }

.bj-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.bj-bet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.bj-chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px dashed rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-base);
  color: #fff;
}

.bj-chip:hover { transform: scale(1.1); }
.bj-chip-10 { background: #C0392B; }
.bj-chip-25 { background: #2980B9; }
.bj-chip-50 { background: #1B3A0F; }
.bj-chip-100 { background: #8B6914; }

.bj-message {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bj-message.win { background: rgba(45,139,78,0.3); color: #7EE8A2; border: 1px solid rgba(45,139,78,0.4); }
.bj-message.lose { background: rgba(192,57,43,0.3); color: #F1948A; border: 1px solid rgba(192,57,43,0.4); }
.bj-message.push { background: rgba(180,120,20,0.3); color: var(--maple-300); border: 1px solid rgba(180,120,20,0.4); }
.bj-message.neutral { background: rgba(255,255,255,0.05); color: var(--neutral-300); }

/* ─── Slots ─────────────────────────────────────────────────── */
.slots-machine {
  background: radial-gradient(ellipse at 50% 0%, rgba(180,70,10,0.3), transparent 60%),
              linear-gradient(180deg, var(--bark-800) 0%, var(--bark-900) 100%);
  border-radius: var(--radius-xl);
  padding: 36px;
  border: 2px solid rgba(255,180,60,0.2);
  box-shadow: 0 0 40px rgba(180,70,10,0.15), inset 0 0 40px rgba(0,0,0,0.3);
}

.slots-title-bar {
  text-align: center;
  margin-bottom: 28px;
}

.slots-title-bar h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--maple-300);
  text-shadow: 0 0 20px rgba(245,160,48,0.4);
}

.slots-reels-wrapper {
  background: rgba(0,0,0,0.4);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  border: 2px solid rgba(255,180,60,0.15);
}

.slots-reels {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.slots-reel {
  width: 100px;
  height: 120px;
  background: rgba(0,0,0,0.5);
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slots-reel-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.slots-reel.spinning .slots-reel-inner {
  animation: reelSpin 0.8s linear infinite;
}

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

.slots-payline {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(245,160,48,0.6), transparent);
  pointer-events: none;
}

.slots-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.slots-bet-controls { display: flex; align-items: center; gap: 8px; }
.slots-bet-label { font-size: 0.75rem; color: var(--neutral-400); text-transform: uppercase; letter-spacing: 0.1em; }
.slots-bet-val { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--maple-300); min-width: 60px; text-align: center; }

.btn-bet-adj {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--neutral-200);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-bet-adj:hover { background: rgba(255,255,255,0.2); }

.btn-spin {
  padding: 14px 40px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--maple-700), var(--maple-500));
  color: #fff;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  border: none;
  box-shadow: 0 4px 16px rgba(212,98,10,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: var(--transition-base);
}
.btn-spin:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,98,10,0.5); }
.btn-spin:disabled { opacity: 0.4; cursor: not-allowed; }

.slots-result {
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-top: 16px;
}

.slots-paytable {
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

.slots-paytable h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neutral-400);
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.paytable-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem;
}

.paytable-row:last-child { border-bottom: none; }
.paytable-symbols { letter-spacing: 4px; }
.paytable-mult { color: var(--maple-300); font-weight: 600; }

/* ─── Dice Game ─────────────────────────────────────────────── */
.dice-arena {
  background: radial-gradient(ellipse at 50% 0%, rgba(27,90,60,0.4), transparent 60%),
              linear-gradient(180deg, #0D2A18 0%, #06150C 100%);
  border-radius: var(--radius-xl);
  padding: 36px;
  border: 2px solid rgba(106,175,74,0.15);
}

.dice-tray {
  background: rgba(0,0,0,0.4);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.06);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.die {
  width: 72px;
  height: 72px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.8);
  cursor: pointer;
  transition: var(--transition-base);
  user-select: none;
  position: relative;
  border: 3px solid transparent;
}

.die:hover { transform: translateY(-3px); }

.die.held {
  border-color: var(--maple-500);
  background: var(--maple-100);
  box-shadow: 0 4px 16px rgba(212,98,10,0.4);
}

.die.rolling {
  animation: dieRoll 0.5s ease;
}

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

.die-held-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--maple-400);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.dice-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.rolls-left { font-size: 0.85rem; color: var(--neutral-400); }
.rolls-left span { color: var(--maple-300); font-weight: 700; font-size: 1.1rem; }

.dice-scoring {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.score-cell {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.score-cell:hover:not(.scored):not(.disabled) {
  background: rgba(106,175,74,0.15);
  border-color: var(--forest-400);
}

.score-cell.scored {
  background: rgba(45,90,27,0.25);
  border-color: rgba(45,90,27,0.4);
  cursor: default;
}

.score-cell.disabled { opacity: 0.4; cursor: not-allowed; }

.score-cell.preview:not(.scored) {
  border-color: var(--maple-400);
  background: rgba(212,98,10,0.15);
}

.score-cell-name { font-size: 0.75rem; color: var(--neutral-400); text-transform: uppercase; letter-spacing: 0.07em; }
.score-cell-value { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; color: var(--forest-300); }
.score-cell.scored .score-cell-value { color: var(--maple-300); }

.dice-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-top: 12px;
}

.dice-total-label { font-size: 0.8rem; color: var(--neutral-400); text-transform: uppercase; letter-spacing: 0.1em; }
.dice-total-value { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--maple-300); font-weight: 700; }

/* ─── Responsive Game ───────────────────────────────────────── */
@media (max-width: 600px) {
  .slots-reels { gap: 6px; }
  .slots-reel { width: 80px; }
  .slots-symbol { width: 80px; font-size: 2.8rem; }

  .bj-table { padding: 20px 16px; }
  .playing-card { width: 60px; height: 90px; }
  .card-center { font-size: 1.2rem; }

  .die { width: 60px; height: 60px; font-size: 1.8rem; }
  .dice-scoring { grid-template-columns: repeat(3, 1fr); }
  .game-board { padding: 20px 16px; }
}
