:root {
  --gold: #ffd166;
  --gold-dim: #b8860b;
  --neon-pink: #ff2e88;
  --neon-blue: #00e5ff;
  --win-green: #2ee6a8;
  --text: #fef6e4;
  --bg-dark: #0d0221;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, #2a0e5c 0%, var(--bg-dark) 70%);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: var(--text);
}

.game-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(6, 2, 15, 0.85);
  border-bottom: 2px solid var(--gold-dim);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

.nav-logo {
  font-weight: bold;
  color: var(--gold);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

.nav-link {
  color: #cfc4ef;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.nav-link.active {
  background: linear-gradient(160deg, var(--gold), var(--gold-dim));
  color: #241645;
  font-weight: bold;
}

.nav-credits {
  font-weight: bold;
  color: var(--gold);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.page-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
}

/* Cinematic vignette over the whole site, edges only — center stays clear. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}

/* ---------- Buy Bonus button ---------- */

.btn.buy-bonus {
  grid-column: span 4;
  order: -1;
  background: linear-gradient(160deg, #ff4d6d, #7a1030);
  color: #fff;
  border: 2px solid var(--gold);
  font-size: 1rem;
  padding: 12px;
  letter-spacing: 1px;
}
.btn.buy-bonus:hover { box-shadow: 0 0 12px #ff4d6d; }

/* ---------- Shared confirm dialog ---------- */

.confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}

.confirm-box {
  background: var(--cabinet, #1a0b3d);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 22px 24px;
  width: 320px;
  max-width: 90vw;
  text-align: center;
}
.confirm-box p { margin: 0 0 18px; font-size: 0.95rem; line-height: 1.4; color: var(--text); }
.confirm-buttons { display: flex; gap: 10px; }
.confirm-buttons .btn { flex: 1; }

/* ---------- Shared win celebration effects ---------- */

.settle-bounce { animation: settle-bounce 0.35s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes settle-bounce {
  0%   { transform: scale(1.4); }
  55%  { transform: scale(0.86); }
  100% { transform: scale(1); }
}

.cabinet.shake { animation: cabinet-shake 0.4s ease; }
@keyframes cabinet-shake {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(-6px, 2px); }
  40%      { transform: translate(6px, -2px); }
  60%      { transform: translate(-4px, 2px); }
  80%      { transform: translate(4px, -1px); }
}

.confetti-piece {
  position: fixed;
  top: 42%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 50;
  animation: confetti-fly 1.3s cubic-bezier(.25, .8, .4, 1) forwards;
}
@keyframes confetti-fly {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

.big-win-banner {
  position: fixed;
  top: 38%;
  left: 50%;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold), 0 0 44px var(--neon-pink), 0 4px 0 rgba(0, 0, 0, 0.5);
  z-index: 60;
  pointer-events: none;
  white-space: nowrap;
  animation: big-win-pop 1.8s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
@keyframes big-win-pop {
  0%   { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  25%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  82%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.06); opacity: 0; }
}

.floating-win {
  position: fixed;
  z-index: 55;
  font-weight: bold;
  font-size: 1.3rem;
  color: var(--win-green);
  text-shadow: 0 0 10px var(--win-green);
  pointer-events: none;
  animation: float-up 1.1s ease-out forwards;
}
@keyframes float-up {
  0%   { transform: translate(-50%, 0); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(-50%, -60px); opacity: 0; }
}

@keyframes title-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.35); }
}
