/* ==============================================================
   GAMES — page styles for slots, wheel, dice, cards
   Each game page sets its theme via class on .game-shell,
   which overrides --tone-1, --tone-2 used throughout.
   ============================================================== */

.game-shell {
  position: relative;
  padding: 90px 0 120px;
  --tone-1: #ff1654;
  --tone-2: #00e5ff;
  --tone-soft: rgba(255, 22, 84, 0.18);
  overflow: hidden;
}
.game-shell::before {
  content: '';
  position: absolute; inset: -10% -10% auto -10%; height: 60%;
  background:
          radial-gradient(60% 90% at 30% 20%, var(--tone-soft), transparent 70%),
          radial-gradient(70% 80% at 75% 30%, rgba(0, 229, 255, 0.10), transparent 75%);
  z-index: 0; pointer-events: none;
}
.game-shell > * { position: relative; z-index: 1; }

/* ---- Theme overrides ---- */
.theme-aurora    { --tone-1: #ff2d6f; --tone-2: #ff7ab0; --tone-soft: rgba(255, 45, 111, .22); }
.theme-diamond   { --tone-1: #ffc857; --tone-2: #ffa117; --tone-soft: rgba(255, 200, 87, .18); }
.theme-sevens    { --tone-1: #00e5ff; --tone-2: #6ef0ff; --tone-soft: rgba(0, 229, 255, .20); }
.theme-stardust  { --tone-1: #b56bff; --tone-2: #ff5dca; --tone-soft: rgba(181, 107, 255, .20); }
.theme-velvet    { --tone-1: #c1102f; --tone-2: #1ec27a; --tone-soft: rgba(193, 16, 47, .20); }
.theme-cosmic    { --tone-1: #00e5ff; --tone-2: #ffc857; --tone-soft: rgba(0, 229, 255, .14); }
.theme-phoenix   { --tone-1: #ff7a18; --tone-2: #ffd166; --tone-soft: rgba(255, 122, 24, .22); }
.theme-crimson   { --tone-1: #ff1654; --tone-2: #ffc857; --tone-soft: rgba(255, 22, 84, .22); }
.theme-neon      { --tone-1: #00e5ff; --tone-2: #ff1654; --tone-soft: rgba(0, 229, 255, .15); }
.theme-galaxy    { --tone-1: #b56bff; --tone-2: #00e5ff; --tone-soft: rgba(181, 107, 255, .20); }

/* ---- Game header ---- */
.game-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 40px; margin-bottom: 40px; flex-wrap: wrap;
}
.game-head .eyebrow { color: var(--tone-1); }
.game-head h1 {
  font-family: var(--ff-display);
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 0.96; letter-spacing: -0.025em; font-weight: 800;
  margin: 14px 0 18px;
  background: linear-gradient(135deg, #fff 0%, var(--tone-1) 60%, var(--tone-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.game-head p { color: var(--ink-2); max-width: 480px; line-height: 1.55; }

.scoreboard {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.score-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 20px;
  min-width: 110px;
}
.score-pill .label {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-3);
}
.score-pill .value {
  font-family: var(--ff-display); font-size: 28px; font-weight: 700;
  color: #fff; margin-top: 6px; display: block;
}

/* ---- Game stage (the table) ---- */
.game-stage {
  background:
          radial-gradient(80% 90% at 50% 0%, rgba(255, 255, 255, 0.04), transparent 70%),
          linear-gradient(180deg, rgba(14, 23, 57, 0.45), rgba(7, 7, 13, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 56px 40px;
  box-shadow:
          inset 0 1px 0 rgba(255, 255, 255, 0.06),
          0 30px 80px -40px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}
.game-stage::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 50% 35%, var(--tone-soft), transparent 65%);
  pointer-events: none;
}
.game-stage > * { position: relative; }

.result-line {
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 13px; letter-spacing: 0.08em;
  color: var(--ink-2);
  min-height: 22px;
  margin-top: 28px;
}
.result-line.win  { color: var(--tone-2); }
.result-line.lose { color: rgba(255, 120, 140, 0.85); }

/* ---- Big action button ---- */
.action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tone-1), var(--tone-2));
  color: #07070d;
  font-family: var(--ff-display);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer;
  box-shadow:
          0 0 0 1px rgba(255, 255, 255, 0.12),
          0 18px 40px -16px var(--tone-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 22px 50px -16px var(--tone-soft); }
.action-btn:active { transform: translateY(0); }
.action-btn .kbd {
  font-family: var(--ff-mono); font-size: 11px;
  background: rgba(7, 7, 13, 0.4);
  padding: 3px 7px; border-radius: 6px;
}

.call-row {
  display: flex; gap: 10px; justify-content: center; margin-top: 24px;
  flex-wrap: wrap;
}
.call-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--ink-1);
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--ff-mono); font-size: 12px;
  letter-spacing: 0.10em; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
}
.call-btn:hover { border-color: var(--tone-1); color: #fff; }
.call-btn.active {
  background: var(--tone-1); border-color: var(--tone-1); color: #07070d; font-weight: 700;
}

/* ============================================================
   SLOTS
   ============================================================ */
.slots-rig {
  position: relative;
  margin: 0 auto;
  max-width: 580px;
}
.slots-frame {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(7, 7, 13, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px;
  padding: 14px;
  box-shadow:
          inset 0 0 0 1px rgba(255, 255, 255, 0.04),
          inset 0 30px 60px rgba(0, 0, 0, 0.5);
}
.reel-window {
  position: relative;
  height: 276px; /* 3 rows × 92px */
  overflow: hidden;
  background: linear-gradient(180deg, rgba(7, 7, 13, 0.95), rgba(20, 20, 30, 0.7));
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.reel-window::before, .reel-window::after {
  content: ''; position: absolute; left: 0; right: 0; height: 60px; z-index: 2;
  pointer-events: none;
}
.reel-window::before { top: 0; background: linear-gradient(180deg, rgba(7, 7, 13, 0.95), transparent); }
.reel-window::after  { bottom: 0; background: linear-gradient(0deg, rgba(7, 7, 13, 0.95), transparent); }
.reel-strip {
  display: flex; flex-direction: column;
  will-change: transform;
}
.reel-cell {
  height: 92px;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}
.reel-cell.hit {
  animation: cellHit 1.2s ease;
  transform: scale(1.15);
}
@keyframes cellHit {
  0% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 0 transparent); }
  30% { transform: scale(1.25); filter: brightness(1.5) drop-shadow(0 0 24px var(--tone-1)); }
  100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 0 transparent); }
}
.payline {
  position: absolute; left: 14px; right: 14px;
  top: calc(14px + 92px); height: 92px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(90deg, transparent, var(--tone-soft), transparent);
  pointer-events: none;
  z-index: 1;
}
.win-flash {
  position: absolute; inset: -10px;
  border-radius: 32px;
  pointer-events: none;
  opacity: 0;
}
.win-flash.on {
  animation: winFlash 1.4s ease;
}
@keyframes winFlash {
  0%   { opacity: 0; box-shadow: 0 0 0 0 var(--tone-1); }
  20%  { opacity: 1; box-shadow: 0 0 80px 10px var(--tone-1), 0 0 0 2px var(--tone-2) inset; }
  100% { opacity: 0; box-shadow: 0 0 0 0 transparent; }
}
.slots-controls {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  margin-top: 32px;
}

/* ============================================================
   WHEEL
   ============================================================ */
.wheel-rig {
  position: relative;
  max-width: 520px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.wheel-pointer {
  position: absolute;
  top: -8px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid var(--tone-1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  z-index: 5;
}
.wheel-disc {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: rgba(7, 7, 13, 0.9);
  box-shadow:
          inset 0 0 0 6px rgba(255, 255, 255, 0.06),
          inset 0 0 0 7px rgba(7, 7, 13, 0.9),
          0 0 60px -10px var(--tone-soft);
  transform: rotate(0deg);
}
.wheel-disc .sector {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wheel-disc .sector-label {
  position: absolute;
  font-family: var(--ff-display);
  font-size: clamp(13px, 1.3vw, 18px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65), 0 0 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
}
/* Brief flash applied to the disc on landing, instead of a per-sector hit. */
.wheel-disc.hit {
  animation: discHit 1.2s ease;
}
@keyframes discHit {
  0%, 100% { box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.06), inset 0 0 0 7px rgba(7, 7, 13, 0.9), 0 0 60px -10px var(--tone-soft); }
  40%      { box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.18), inset 0 0 0 7px rgba(7, 7, 13, 0.9), 0 0 90px 8px var(--tone-1); }
}
.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  width: 22%; height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2a2a3a, #07070d);
  box-shadow:
          inset 0 0 0 2px rgba(255, 255, 255, 0.08),
          0 6px 20px rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display); font-weight: 800;
  color: var(--tone-1); font-size: 22px;
  z-index: 4;
}

.wheel-controls {
  margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 18px;
}

/* ============================================================
   DICE
   ============================================================ */
.dice-rig {
  display: flex; gap: 36px; justify-content: center; align-items: center;
  perspective: 1000px;
  min-height: 200px;
  margin-bottom: 12px;
}
.die {
  position: relative;
  width: 110px; height: 110px;
  transform-style: preserve-3d;
  will-change: transform;
}
.die .face {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fff, #d8d8e0);
  border-radius: 18px;
  box-shadow:
          inset 0 0 0 2px rgba(0, 0, 0, 0.06),
          inset 0 -8px 16px rgba(0, 0, 0, 0.10),
          0 10px 30px rgba(0, 0, 0, 0.4);
  display: grid;
  padding: 16px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.die .face .pip {
  background: var(--tone-1);
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}
.die .face.f1 { transform: translateZ(55px); }
.die .face.f2 { transform: rotateY(180deg) translateZ(55px); }
.die .face.f3 { transform: rotateY(90deg)  translateZ(55px); }
.die .face.f4 { transform: rotateY(-90deg) translateZ(55px); }
.die .face.f5 { transform: rotateX(90deg)  translateZ(55px); }
.die .face.f6 { transform: rotateX(-90deg) translateZ(55px); }

/* Pip layouts using grid-area per pip count */
.die .face.f1 .pip:nth-child(1) { grid-area: 2 / 2; }
.die .face.f2 .pip:nth-child(1) { grid-area: 1 / 1; }
.die .face.f2 .pip:nth-child(2) { grid-area: 3 / 3; }
.die .face.f3 .pip:nth-child(1) { grid-area: 1 / 1; }
.die .face.f3 .pip:nth-child(2) { grid-area: 2 / 2; }
.die .face.f3 .pip:nth-child(3) { grid-area: 3 / 3; }
.die .face.f4 .pip:nth-child(1) { grid-area: 1 / 1; }
.die .face.f4 .pip:nth-child(2) { grid-area: 1 / 3; }
.die .face.f4 .pip:nth-child(3) { grid-area: 3 / 1; }
.die .face.f4 .pip:nth-child(4) { grid-area: 3 / 3; }
.die .face.f5 .pip:nth-child(1) { grid-area: 1 / 1; }
.die .face.f5 .pip:nth-child(2) { grid-area: 1 / 3; }
.die .face.f5 .pip:nth-child(3) { grid-area: 2 / 2; }
.die .face.f5 .pip:nth-child(4) { grid-area: 3 / 1; }
.die .face.f5 .pip:nth-child(5) { grid-area: 3 / 3; }
.die .face.f6 .pip:nth-child(1) { grid-area: 1 / 1; }
.die .face.f6 .pip:nth-child(2) { grid-area: 1 / 3; }
.die .face.f6 .pip:nth-child(3) { grid-area: 2 / 1; }
.die .face.f6 .pip:nth-child(4) { grid-area: 2 / 3; }
.die .face.f6 .pip:nth-child(5) { grid-area: 3 / 1; }
.die .face.f6 .pip:nth-child(6) { grid-area: 3 / 3; }

.dice-sum {
  text-align: center;
  font-family: var(--ff-display); font-weight: 800;
  font-size: 18px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
}
.dice-sum span { color: var(--tone-1); font-size: 38px; margin-left: 10px; }
.dice-controls { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 20px; }

/* ============================================================
   CARDS (Higher / Lower)
   ============================================================ */
.cards-rig {
  display: flex; gap: 36px; justify-content: center; align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.card-face {
  position: relative;
  width: 200px; height: 280px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f7f7, #e6e6ec);
  box-shadow:
          0 20px 40px -10px rgba(0, 0, 0, 0.5),
          inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  color: #07070d;
  font-family: var(--ff-display);
  display: flex; align-items: center; justify-content: center;
}
.card-face.tone-red    { color: var(--tone-1); }
.card-face.tone-cyan   { color: #008fa3; }
.card-face.tone-gold   { color: #b48715; }
.card-face.tone-magenta { color: #a020a0; }
.card-face.tone-dark   { color: #0e1739; }
.card-face .card-corner {
  position: absolute;
  font-size: 18px; font-weight: 700; line-height: 1.05;
  text-align: center;
}
.card-face .card-corner.top { top: 14px; left: 14px; }
.card-face .card-corner.bot { right: 14px; bottom: 14px; transform: rotate(180deg); }
.card-face .card-corner i { font-style: normal; font-size: 22px; }
.card-face .card-pip { font-size: 110px; line-height: 1; }
.card-face.hidden {
  background:
          repeating-linear-gradient(45deg, var(--tone-1) 0 12px, var(--tone-2) 12px 24px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.card-face.hidden .card-back {
  font-family: var(--ff-display); font-weight: 800; font-size: 36px;
  color: #07070d;
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 22px; border-radius: 14px;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}
.card-face.flip-in {
  animation: cardFlip 0.7s cubic-bezier(.4, 1.6, .55, .94);
}
@keyframes cardFlip {
  0%   { transform: rotateY(180deg) scale(0.8); opacity: 0; }
  50%  { transform: rotateY(90deg)  scale(0.95); opacity: 0.5; }
  100% { transform: rotateY(0)      scale(1);   opacity: 1; }
}
.card-arrow {
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.18em;
  color: var(--ink-3); text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.card-arrow .glyph {
  font-size: 28px; color: var(--tone-1);
}
.cards-controls {
  display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 14px;
}

/* ============================================================
   Quick links — back to all games
   ============================================================ */
.game-back {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 36px;
  font-family: var(--ff-mono); font-size: 12px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.18s ease;
}
.game-back:hover { color: var(--tone-2); }

/* Other games rail at the bottom */
.other-games {
  margin-top: 80px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 50px;
}
.other-games h3 {
  font-family: var(--ff-display); font-size: 24px; font-weight: 700;
  margin-bottom: 24px;
}
.other-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.other-rail a {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 4px;
  color: #fff;
  transition: all 0.18s ease;
}
.other-rail a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--tone-1);
  transform: translateY(-2px);
}
.other-rail a .tag {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--tone-2);
}
.other-rail a span:last-child {
  font-family: var(--ff-display); font-weight: 600; font-size: 15px;
}

/* ---- Mobile ---- */
@media (max-width: 700px) {
  .game-shell { padding: 60px 0 80px; }
  .game-stage { padding: 32px 18px; border-radius: 22px; }
  .reel-window { height: 240px; }
  .reel-cell   { height: 80px; font-size: 44px; }
  .die         { width: 80px; height: 80px; }
  .die .face.f1 { transform: translateZ(40px); }
  .die .face.f2 { transform: rotateY(180deg) translateZ(40px); }
  .die .face.f3 { transform: rotateY(90deg)  translateZ(40px); }
  .die .face.f4 { transform: rotateY(-90deg) translateZ(40px); }
  .die .face.f5 { transform: rotateX(90deg)  translateZ(40px); }
  .die .face.f6 { transform: rotateX(-90deg) translateZ(40px); }
  .card-face   { width: 150px; height: 210px; }
  .card-face .card-pip { font-size: 80px; }
}