/* ===========================================================
   GAME PAGES — shared hero, layout, controls, and the
   game-specific visual blocks (reels, coin-flip, scratch grid,
   dice tray). Each block is prefixed for its own component.
   =========================================================== */

.game-hero {
  padding: var(--sp-7) 0;
  border-bottom: 2px solid var(--ink);
}
.game-hero--fruit {
  background: linear-gradient(135deg, var(--theme-fruit) 0%, var(--porcelain) 65%);
}
.game-hero--sakura {
  background: linear-gradient(135deg, var(--theme-sakura-2) 0%, var(--porcelain) 65%);
}
.game-hero--gems {
  background: linear-gradient(135deg, var(--theme-gems) 0%, var(--porcelain) 65%);
}
.game-hero--egypt {
  background: linear-gradient(135deg, var(--theme-egypt-2) 0%, var(--porcelain) 65%);
}
.game-hero__inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-6);
  align-items: center;
}
.game-hero__art {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid var(--ink);
}
.game-hero h1 {
  margin-bottom: var(--sp-3);
}
@media (max-width: 680px) {
  .game-hero__inner {
    grid-template-columns: 1fr;
  }
  .game-hero__art {
    max-width: 220px;
  }
}

.game-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--sp-7);
  align-items: start;
}
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.game-panel {
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  padding: var(--sp-6);
}
.game-panel__balance {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--forest-dark);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--porcelain-deep);
}
.game-panel__balance strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  color: var(--orange-dark);
}

.game-stage {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-5);
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.game-controls__field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  font-size: 0.82rem;
  color: var(--forest-dark);
}
.game-controls__field input,
.game-controls__field select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.5em 0.7em;
  border: 2px solid var(--ink);
  border-radius: 8px;
  min-width: 120px;
}
.bet-stepper {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
}
.bet-stepper button {
  background: var(--forest-tint);
  border: none;
  border-right: 2px solid var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  width: 40px;
  cursor: pointer;
}
.bet-stepper button:last-child {
  border-right: none;
  border-left: 2px solid var(--ink);
}
.bet-stepper input {
  border: none;
  text-align: center;
  width: 90px;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
}

.game-result {
  min-height: 1.6em;
  font-weight: 600;
  color: var(--forest-dark);
  margin: 0;
}
.game-result.is-win {
  color: var(--orange-dark);
}
.game-result.is-lose {
  color: var(--ink);
}

.game-rules h2 {
  font-size: 1.15rem;
}
.paytable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: var(--sp-4) 0;
}
.paytable th,
.paytable td {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--porcelain-deep);
}
.paytable thead th {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
}

.noscript-note {
  background: var(--forest-tint);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  padding: var(--sp-5);
  margin: var(--sp-5) 0;
}

/* ---- Reels (Cherry Chrome Reels) ---- */
.reels {
  display: flex;
  gap: var(--sp-3);
}
.reels__window {
  width: 96px;
  height: 120px;
  background: var(--forest-tint);
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reels__window svg {
  width: 68px;
  height: 68px;
}
.reels__window.is-spinning svg {
  animation: reelSpin 0.12s linear infinite;
}
@keyframes reelSpin {
  0% {
    transform: translateY(-6px);
  }
  50% {
    transform: translateY(6px);
  }
  100% {
    transform: translateY(-6px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .reels__window.is-spinning svg {
    animation: none;
  }
}

/* ---- Coin flip (Sakura Streak) ---- */
.coinflip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  width: 100%;
}
.coinflip__disc {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  transition: transform 0.5s ease;
}
.coinflip__disc svg {
  width: 84px;
  height: 84px;
}
.coinflip__disc.is-flipping {
  animation: coinSpin 0.5s linear;
}
@keyframes coinSpin {
  0% {
    transform: rotateY(0deg) scale(1);
  }
  50% {
    transform: rotateY(720deg) scale(1.08);
  }
  100% {
    transform: rotateY(1080deg) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .coinflip__disc.is-flipping {
    animation: none;
  }
}
.streak-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: center;
}
.streak-ladder__rung {
  font-family: var(--font-display);
  font-size: 0.78rem;
  padding: 0.4em 0.75em;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  color: var(--forest-dark);
  background: var(--porcelain);
}
.streak-ladder__rung.is-active {
  background: var(--theme-sakura);
  color: var(--white);
  border-color: var(--ink);
}
.pick-row {
  display: flex;
  gap: var(--sp-3);
}

/* ---- Scratch grid (Prism Scratch) ---- */
.scratch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}
.scratch-cell {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}
.scratch-cell svg {
  width: 70%;
  height: 70%;
  position: absolute;
  top: 15%;
  left: 15%;
}
.scratch-cell__cover {
  position: absolute;
  inset: 0;
  background: var(--theme-gems);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 12px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scratch-cell__cover span {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.scratch-cell__cover[hidden] {
  display: none;
}

/* ---- Dice tray (Scarab Dice) ---- */
.dice-tray {
  display: flex;
  gap: var(--sp-4);
}
.die {
  width: 68px;
  height: 68px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--porcelain);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 10px;
  gap: 2px;
}
.die.is-rolling {
  animation: diceShake 0.1s linear infinite;
}
@keyframes diceShake {
  0% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg);
  }
  100% {
    transform: rotate(-4deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .die.is-rolling {
    animation: none;
  }
}
.die__pip {
  border-radius: 50%;
  background: var(--theme-egypt-2);
  align-self: center;
  justify-self: center;
  width: 10px;
  height: 10px;
}
.bet-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.bet-type-grid label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: var(--sp-3);
  font-size: 0.88rem;
  cursor: pointer;
}
.bet-type-grid input {
  accent-color: var(--orange);
}
