/* Royal Slots — stage based on hero neon lounge */

.game-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.slot-stage {
  position: relative;
  flex: 1;
  padding: clamp(1.25rem, 3vw, 2.5rem) 1.25rem 2.5rem;
  overflow: hidden;
  isolation: isolate;
}

.slot-stage__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    url("hero-bg.png") center 35% / cover no-repeat;
  transform: scale(1.04);
  filter: saturate(1.05) brightness(0.55);
}

.slot-stage__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 5, 26, 0.72) 0%, rgba(5, 5, 26, 0.45) 40%, rgba(5, 5, 26, 0.85) 100%),
    radial-gradient(ellipse 70% 55% at 50% 40%, transparent 15%, rgba(5, 5, 26, 0.55) 100%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(180, 40, 200, 0.18), transparent 60%);
}

.slot-stage__inner {
  position: relative;
  z-index: 2;
  width: min(1240px, 100%);
  margin: 0 auto;
}

.slot-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.slot-heading h1 {
  font: 800 clamp(28px, 4vw, 42px) / 1.05 Outfit, sans-serif;
  margin: 0;
  letter-spacing: -1px;
}

.slot-heading h1 span {
  background: linear-gradient(90deg, #ff72da, #ffd56a 55%, #63ddff);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.slot-back {
  text-decoration: none;
}

.slot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/* —— Side wager panel —— */
.slot-side {
  justify-self: end;
  width: min(220px, 100%);
}

.slot-side__panel {
  padding: 1rem 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(255, 214, 120, 0.18), transparent 55%),
    linear-gradient(165deg, rgba(42, 20, 72, 0.95), rgba(10, 6, 28, 0.98));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(255, 63, 207, 0.15);
}

.slot-side__crest {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.slot-side__crest-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.6), transparent);
}

.slot-side__crest-label {
  font: 800 0.62rem Outfit, sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #f0d060;
}

.slot-console__row {
  margin-bottom: 0.65rem;
  padding: 0.7rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.28);
}

.slot-console__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e0c060;
}

.slot-side__balance,
.slot-side__win,
.bet-value {
  font: 800 1.25rem Outfit, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #ffe08a;
  text-shadow: 0 0 14px rgba(240, 208, 96, 0.45);
  text-align: center;
}

.bet-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.bet-value {
  flex: 1;
  min-width: 0;
  padding: 0.3rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(12, 6, 4, 0.9);
}

.chip-btn {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 2px solid #d4af37;
  background: radial-gradient(circle at 32% 28%, #7a4aa0, #2a1438 55%, #12081c);
  color: #ffe9a8;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

.chip-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slot-side__note {
  margin: 0.5rem 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: #9aa0c4;
  text-align: center;
}

/* —— Machine —— */
.slot-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slot-machine {
  position: relative;
  width: 100%;
  max-width: 720px;
  isolation: isolate;
  filter:
    drop-shadow(0 22px 36px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 28px rgba(255, 63, 207, 0.22));
}

.slot-drum__art {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
  mix-blend-mode: lighten;
}

/* 5 reels — aligned to white windows in automat.png (17.3%–81.9% × 35%–52%) */
.reels {
  position: absolute;
  z-index: 2;
  left: 17.25%;
  width: 64.65%;
  top: 38.5%;
  height: 17.3%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.75%;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.reel {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reel-strip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transform: translateY(0);
  will-change: transform;
}

.reel.spinning .reel-strip {
  bottom: auto;
}

.reel-cell {
  box-sizing: border-box;
  flex: 0 0 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.reel.spinning .reel-cell {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}

.reel-symbol {
  display: block;
  width: auto;
  height: 88%;
  max-width: 92%;
  object-fit: contain;
  background: transparent;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.reel.win-flash .reel-symbol {
  animation: winPulse 0.55s ease 2;
}

@keyframes winPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.85)); }
}

@keyframes balancePulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); color: #fff6c8; }
}

.balance-pulse {
  animation: balancePulse 0.7s ease;
  display: inline-block;
}

/* HUD numbers over automat.png panel displays */
.slot-hud__value {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Outfit, sans-serif;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffe08a;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.slot-hud__balance {
  left: 20%;
  top: 73.6%;
  width: 13%;
  height: 5%;
  font-size: clamp(11px, 2.05vw, 17px);
}

.slot-hud__bet {
  left: 45.2%;
  top: 73.6%;
  width: 9.2%;
  height: 5%;
  font-size: clamp(12px, 2.2vw, 19px);
  color: #fff6c8;
}

.slot-hud__record {
  left: 71%;
  top: 73.6%;
  width: 12.5%;
  height: 5%;
  font-size: clamp(11px, 2.05vw, 17px);
}

.bet-hotspot {
  position: absolute;
  z-index: 4;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  width: 5.2%;
  aspect-ratio: 1;
  top: 71.6%;
}

.bet-hotspot--minus { left: 38.4%; }
.bet-hotspot--plus { left: 54%; }

.bet-hotspot:disabled,
.spin-hotspot:disabled {
  cursor: not-allowed;
}

/* Invisible hotspot over the machine's Spin button */
.spin-hotspot {
  position: absolute;
  z-index: 4;
  left: 43.5%;
  bottom: 6.5%;
  width: 13%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.spin-result {
  margin: 0.85rem 0 0.65rem;
  min-height: 1.2em;
  text-align: center;
  font-size: 0.9rem;
  color: #ffb7e9;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.spin-btn {
  width: min(100%, 360px);
  margin: 0 auto;
}

.spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* —— Hits feed —— */
.combo-chat {
  justify-self: start;
  width: min(260px, 100%);
  height: 320px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  background:
    linear-gradient(165deg, rgba(36, 16, 68, 0.94), rgba(8, 4, 18, 0.97));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.combo-chat__head {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(0, 0, 0, 0.22);
}

.combo-chat__title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c9a227;
}

.combo-chat__feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.combo-chat__empty {
  margin: auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: #a89bb8;
}

.combo-chat__msg {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.32);
  animation: comboIn 0.35s ease;
}

.combo-chat__label {
  font: 700 0.82rem Outfit, sans-serif;
  color: #ffe9a8;
}

.combo-chat__amount {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f0d060;
}

@keyframes comboIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-footer {
  display: block;
  padding: 18px max(4vw, 24px);
  grid-template-columns: none;
}

/* —— Responsive —— */
@media (max-width: 980px) {
  .slot-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .slot-side,
  .slot-main,
  .combo-chat {
    justify-self: stretch;
    width: 100%;
    max-width: min(640px, 100%);
    margin-inline: auto;
  }

  .slot-side__panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .slot-side__crest,
  .slot-side__note {
    grid-column: 1 / -1;
  }

  .combo-chat {
    height: 220px;
    max-height: 220px;
  }

  .spin-btn {
    position: sticky;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 8;
  }
}

@media (max-width: 520px) {
  .slot-side__panel {
    grid-template-columns: 1fr;
  }

  .reel-symbol {
    height: 86%;
    max-width: 94%;
  }
}
