:root {
  --gold: #f6cf72;
  --gold-bright: #fff0a6;
  --teal: #aa62ff;
  --coral: #e4493f;
  --ink: #fff8ed;
  --muted: #c8b9cc;
  --powers: url("../assets/images/atlases/ninja-skills-atlas.png");
  --ninja-wild: url("../assets/images/characters/ninja-wild.png");
  --frame-art: url("../assets/images/frames/ninja-reel-frame-v2.png");
  --control-height: 135px;
  --reel-gap: clamp(3px, 0.34vw, 6px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow: hidden;
  color: var(--ink);
  background: #050408;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible + .toggle-track {
  outline: 3px solid rgba(170, 98, 255, 0.8);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
  filter: grayscale(0.65) brightness(0.65);
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 3, 9, 0.62), transparent 24%, transparent 76%, rgba(5, 3, 9, 0.62));
}

.brand {
  display: block;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 9px 15px rgba(0, 0, 0, 0.68)) drop-shadow(0 0 14px rgba(170, 98, 255, 0.34));
}

.start-auto {
  min-width: 172px;
  min-height: 45px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  color: #101516;
  background: linear-gradient(180deg, #fff0a6, #dba449);
  box-shadow: inset 0 1px 0 #fff9d7, 0 10px 24px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

.stage {
  position: relative;
  min-height: 0;
}

.topbar {
  position: absolute;
  inset: 4px 12px auto 18px;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.brand {
  width: clamp(210px, 15vw, 290px);
}

.round-status {
  display: grid;
  min-width: 104px;
  padding: 8px 12px;
  border: 1px solid rgba(246, 207, 114, 0.62);
  border-radius: 6px;
  background: rgba(13, 8, 18, 0.84);
  box-shadow: inset 0 0 14px rgba(170, 98, 255, 0.16);
  text-align: center;
  text-transform: uppercase;
}

.round-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.round-status strong {
  color: var(--gold);
  font-size: 22px;
}

.round-status b {
  font-size: 30px;
}

.slot-area {
  position: relative;
  display: grid;
  place-items: start center;
  width: 100%;
  height: 100%;
  padding-top: clamp(14px, 2.1vh, 24px);
}

.reels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.reel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.reel::before,
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  height: 9%;
  pointer-events: none;
}

.reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.52), transparent);
}

.reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent);
}

.reel-strip {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-rows: calc((100% - (3 * var(--reel-gap))) / 4);
  gap: var(--reel-gap);
  will-change: transform, filter;
}

.reel-strip.is-spinning {
  animation: reelStripSpin var(--spin-speed, 340ms) linear infinite;
  filter: blur(3px) brightness(1.08) saturate(1.1);
}

.reel-strip.is-stopping {
  animation: reelStopBounce 270ms cubic-bezier(0.18, 0.9, 0.22, 1.18) both;
}

.reel.is-landed {
  animation: reelLandFlash 260ms ease both;
}

.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transform: translateZ(0);
  transition: filter 150ms ease, opacity 150ms ease;
}

.cell::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 3;
  border: 0 solid transparent;
  pointer-events: none;
}

.cell.is-marked::after {
  border: 3px solid var(--gold-bright);
  box-shadow: inset 0 0 16px rgba(246, 207, 114, 0.65), 0 0 13px rgba(170, 98, 255, 0.65);
}

.cell.is-marked::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 5;
  width: 11px;
  height: 11px;
  border: 1px solid #fff4bb;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.symbol-art,
.pay-thumb,
.stacked-art {
  position: absolute;
  inset: -1%;
  background-repeat: no-repeat;
}

.stacked-art {
  inset: 3%;
  background-image: var(--ninja-wild);
  background-position: center;
  background-size: auto 100%;
}

.cell.is-win {
  z-index: 4;
  filter: brightness(1.3) saturate(1.15);
  animation: symbolWin 620ms ease both;
  box-shadow: inset 0 0 22px rgba(255, 239, 166, 0.65), 0 0 20px rgba(170, 98, 255, 0.75);
}

.cell.is-trigger {
  z-index: 12;
  overflow: visible;
  filter: brightness(1.45) saturate(1.35);
  animation: triggerStrike 680ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cell.is-trigger::after {
  inset: -3px;
  border: 4px solid #fff7c8;
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.9), 0 0 12px #fff, 0 0 34px var(--teal);
}

.cell.is-mystery .symbol-art {
  opacity: 0;
}

.cell.is-mystery {
  z-index: 7;
  background:
    radial-gradient(circle at 50% 42%, #fffbd0 0 9%, #ff9db5 10% 18%, transparent 19%),
    conic-gradient(from 20deg, #ffde86, #a52e6d, #a962ff, #ffde86);
  border: 3px solid #fff1a8;
  box-shadow: inset 0 0 30px rgba(255, 103, 166, 0.9), 0 0 24px rgba(255, 228, 130, 0.85);
  animation: mysteryForm 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cell.is-mystery::before {
  content: "?";
  position: absolute;
  inset: 12%;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.82);
  color: #fffce5;
  background: radial-gradient(circle, rgba(97, 17, 83, 0.62), rgba(0, 25, 34, 0.86));
  font-family: Georgia, serif;
  font-size: clamp(34px, 4vw, 72px);
  font-weight: 900;
  text-shadow: 0 3px 0 #6f173d, 0 0 15px #fff;
}

.cell.is-revealing {
  animation: mysteryReveal 520ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.stacked-wild {
  position: absolute;
  top: calc(var(--stack-row) * 25%);
  left: 0;
  right: 0;
  z-index: 5;
  height: calc(var(--stack-height) * 25%);
  overflow: hidden;
  border: 2px solid var(--gold-bright);
  background: #130d1c;
  box-shadow: inset 0 0 20px rgba(170, 98, 255, 0.5), 0 0 18px rgba(246, 207, 114, 0.7);
  animation: stackedLand 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.line-layer {
  overflow: visible;
  pointer-events: none;
}

.active-payline {
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 13px var(--teal));
  stroke-dasharray: 1400;
  animation: drawLine 620ms ease both;
}

.reel-frame.is-spinning {
  box-shadow: none;
}

.reel-frame.is-feature-event {
  animation: featureFrame 900ms ease-out both;
}

.side-feature {
  position: absolute;
  z-index: 11;
  display: grid;
  border: 1px solid rgba(246, 207, 114, 0.65);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(25, 14, 32, 0.9), rgba(6, 4, 9, 0.94));
  box-shadow: inset 0 0 18px rgba(170, 98, 255, 0.16), 0 12px 28px rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
}

.side-feature {
  left: 0;
  top: clamp(76px, 11vh, 118px);
  bottom: clamp(50px, 6vh, 68px);
  width: min(300px, 16vw);
  min-width: 225px;
  overflow: hidden;
  border-color: rgba(246, 207, 114, 0.82);
  background: linear-gradient(180deg, rgba(22, 12, 30, 0.2), rgba(6, 4, 9, 0.94));
  box-shadow: inset 0 0 36px rgba(170, 98, 255, 0.2), 0 20px 38px rgba(0, 0, 0, 0.56);
}

.power-portrait,
.cycle-intro-portrait,
.feature-guide-portrait {
  background-image: var(--powers);
  background-position: var(--power-pos);
  background-repeat: no-repeat;
  background-size: 200% 200%;
}

.power-portrait {
  position: absolute;
  inset: 0 0 82px;
  z-index: 1;
  background-image: var(--ninja-wild);
  background-position: center;
  background-size: auto 100%;
  filter: saturate(1.08) contrast(1.04);
}

.power-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(6, 4, 9, 0.94));
}

.power-flame { --power-accent: #ff5947; }
.power-clone { --power-accent: #f4c742; }
.power-illusion { --power-accent: #b06cff; }
.power-chain { --power-accent: #e3b45c; }

.message-strip {
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(650px, 49vw);
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid rgba(246, 207, 114, 0.28);
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 7, 10, 0.76);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  text-align: center;
  font-size: 14px;
  font-weight: 900;
}

.info-dot {
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 20px;
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 62;
  overflow: hidden;
  pointer-events: none;
}

.energy-orb {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--power-accent);
  box-shadow: 0 0 9px #fff, 0 0 25px var(--power-accent), 0 0 50px var(--power-accent);
  animation: energyFlight 720ms cubic-bezier(0.3, 0.05, 0.4, 1) both;
}

.cycle-intro {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(250px, 38vw) minmax(300px, 540px);
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  overflow: visible;
  background: transparent;
  pointer-events: none;
}

.cycle-intro.show {
  visibility: visible;
  animation: cycleIntroLayer 1800ms ease both;
}

.cycle-intro-portrait {
  width: min(42vw, 520px);
  aspect-ratio: 1;
  justify-self: end;
  background-position: var(--power-pos, 0% 0%);
  filter: drop-shadow(0 0 30px var(--power-accent));
  animation: powerEntrance 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cycle-intro-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  min-height: 250px;
  padding: 20px 42px 20px 22px;
  border-left: 3px solid var(--power-accent);
  text-transform: uppercase;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

.cycle-intro-copy span {
  color: var(--power-accent);
  font-size: 15px;
  font-weight: 900;
}

.cycle-intro-copy strong {
  color: #fff7cf;
  font-size: clamp(38px, 5vw, 82px);
  line-height: 0.95;
}

.cycle-intro-copy small {
  max-width: 480px;
  margin-top: 15px;
  color: #e8dff0;
  font-size: clamp(13px, 1.2vw, 19px);
  font-weight: 900;
  line-height: 1.35;
}

.feature-callout {
  position: fixed;
  top: 24%;
  right: clamp(110px, 9vw, 185px);
  z-index: 66;
  display: grid;
  min-width: 210px;
  padding: 12px 22px;
  visibility: hidden;
  opacity: 0;
  border-left: 4px solid var(--power-accent);
  color: #fff;
  background: linear-gradient(90deg, rgba(6, 4, 9, 0.96), rgba(12, 7, 18, 0.72));
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.65);
  text-transform: uppercase;
  pointer-events: none;
}

.feature-callout.show {
  visibility: visible;
  animation: featureCallout 1050ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.feature-callout span {
  color: var(--power-accent);
  font-size: 12px;
  font-weight: 900;
}

.feature-callout strong {
  color: #fff7cf;
  font-size: 42px;
  line-height: 1;
}

.reel-frame.event-flame {
  --frame-effect-glow: rgba(255, 89, 71, 0.9);
  box-shadow: none;
}

.reel-frame.event-clone {
  --frame-effect-glow: rgba(244, 199, 66, 0.9);
  box-shadow: none;
}

.reel-frame.event-illusion {
  --frame-effect-glow: rgba(176, 108, 255, 0.9);
  box-shadow: none;
}

.reel-frame.event-chain {
  --frame-effect-glow: rgba(227, 180, 92, 0.92);
  box-shadow: none;
}

.control-deck {
  display: contents;
}

.number-stepper button,
.menu-close {
  display: grid;
  place-items: center;
  border: 2px solid rgba(246, 207, 114, 0.76);
  color: var(--gold);
  background: rgba(15, 9, 20, 0.94);
  box-shadow: inset 0 0 12px rgba(170, 98, 255, 0.12);
  cursor: pointer;
}

.meter-source {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.number-stepper button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 29px;
  line-height: 1;
}

.game-menu {
  width: min(78vw, 1180px);
  height: min(82vh, 760px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(246, 207, 114, 0.42);
  border-radius: 4px;
  color: #fff;
  background: #151819;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.72);
}

.game-menu::backdrop {
  background: rgba(4, 3, 7, 0.8);
  backdrop-filter: blur(2px);
}

.menu-surface {
  position: relative;
  display: grid;
  grid-template-rows: 54px 1fr 66px;
  width: 100%;
  height: 100%;
}

.menu-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #101314;
}

.menu-tabs button {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #847f72;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

.menu-tabs button.is-active {
  color: #fff;
  background: #1b1f20;
  border-bottom-color: var(--gold);
}

.menu-panel {
  display: none;
  overflow: auto;
  padding: 42px clamp(30px, 6vw, 90px) 30px;
}

.menu-panel.is-active {
  display: block;
}

.menu-panel h2 {
  margin: 0 0 28px;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
}

.menu-panel h3 {
  margin: 24px 0 5px;
  color: var(--gold);
  text-transform: uppercase;
}

.menu-panel p {
  color: #d8dedf;
  line-height: 1.55;
}

.panel-intro {
  max-width: 780px;
  margin: -14px auto 24px;
  text-align: center;
}

.setting-list {
  display: grid;
  gap: 26px;
  width: min(520px, 100%);
  margin: 60px auto 0;
}

.setting-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 48px;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.setting-row input {
  position: absolute;
  opacity: 0;
}

.toggle-track {
  position: relative;
  flex: 0 0 78px;
  width: 78px;
  height: 38px;
  border: 2px solid #555;
  border-radius: 20px;
  background: #0b0e0f;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 28px;
  height: 28px;
  border: 2px solid #888;
  border-radius: 50%;
  background: #191d1e;
  transition: transform 180ms ease, background 180ms ease;
}

.setting-row input:checked + .toggle-track::after {
  background: var(--gold);
  border-color: var(--gold-bright);
  transform: translateX(37px);
}

.auto-settings {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(520px, 100%);
  margin: 0 auto;
}

.field-label {
  margin-top: 8px;
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
}

.number-stepper {
  display: grid;
  grid-template-columns: 48px minmax(150px, 1fr) 48px;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.number-stepper strong {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #1a1d1e;
  color: var(--gold);
  font-size: 21px;
}

.total-cost {
  min-width: 170px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gold-bright);
  background: #0e1112;
  text-align: center;
  font-size: 34px;
}

.start-auto {
  margin-top: 18px;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pay-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 8px;
  border: 1px solid rgba(246, 207, 114, 0.2);
  background: #0d1517;
}

.pay-thumb {
  position: relative;
  width: 78px;
  aspect-ratio: 1;
  overflow: hidden;
}

.pay-item strong {
  display: block;
  color: var(--gold);
  text-transform: uppercase;
}

.pay-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.feature-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.feature-guide-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  overflow: hidden;
  border: 1px solid var(--power-accent);
  background: #0b1518;
}

.feature-guide-portrait {
  width: 92px;
  height: 104px;
  background-position: var(--power-pos);
}

.feature-guide-item strong,
.feature-guide-item small {
  display: block;
  padding-right: 8px;
}

.feature-guide-item strong {
  color: var(--power-accent);
  font-size: 15px;
  text-transform: uppercase;
}

.feature-guide-item small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.3;
}

.menu-close {
  align-self: center;
  justify-self: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 900;
}

.big-win {
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.big-win.show {
  visibility: visible;
  animation: bigWinLayer 1900ms ease both;
}

.big-win-card {
  display: grid;
  min-width: min(520px, 86vw);
  padding: 25px 34px;
  border: 2px solid var(--gold-bright);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(4, 66, 70, 0.98), rgba(0, 11, 16, 0.98));
  box-shadow: 0 0 45px rgba(246, 207, 114, 0.5), 0 25px 80px rgba(0, 0, 0, 0.7);
  text-align: center;
  text-transform: uppercase;
}

.big-win-card span {
  color: var(--gold);
  font-size: clamp(38px, 5vw, 76px);
  font-weight: 900;
  text-shadow: 0 4px 0 #5c2c11, 0 0 20px rgba(246, 207, 114, 0.55);
}

.big-win-card strong {
  color: #fff;
  font-size: clamp(38px, 4.5vw, 70px);
}

.big-win-card.is-feature strong {
  color: var(--teal);
}

@keyframes reelStripSpin {
  from { transform: translateY(calc(-200% - (2 * var(--reel-gap)))); }
  to { transform: translateY(0); }
}

@keyframes reelStopBounce {
  0% { transform: translateY(-17%); filter: blur(2px); }
  62% { transform: translateY(3.8%); filter: blur(0); }
  82% { transform: translateY(-1.4%); }
  100% { transform: translateY(0); }
}

@keyframes reelLandFlash {
  0% { box-shadow: inset 0 0 0 rgba(255, 255, 255, 0); }
  45% { box-shadow: inset 0 0 25px rgba(255, 240, 166, 0.5); }
  100% { box-shadow: inset 0 0 0 rgba(255, 255, 255, 0); }
}

@keyframes symbolWin {
  0% { transform: scale(0.94); }
  50% { transform: scale(1.055); }
  100% { transform: scale(1); }
}

@keyframes stackedLand {
  from { opacity: 0; transform: translateY(-20%) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drawLine {
  from { stroke-dashoffset: 1400; opacity: 0; }
  20% { opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes featureFrame {
  0% { transform: scale(1); filter: brightness(1); }
  42% { transform: scale(1.008); filter: brightness(1.32); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes triggerStrike {
  0% { transform: scale(0.9); }
  38% { transform: scale(1.08); }
  100% { transform: scale(1.02); }
}

@keyframes mysteryForm {
  0% { opacity: 0; transform: rotateY(80deg) scale(0.74); }
  100% { opacity: 1; transform: rotateY(0) scale(1); }
}

@keyframes mysteryReveal {
  0% { transform: rotateY(0); filter: brightness(1); }
  45% { transform: rotateY(90deg); filter: brightness(2); }
  100% { transform: rotateY(0); filter: brightness(1.3); }
}

@keyframes energyFlight {
  0% { opacity: 0; transform: translate(var(--from-x), var(--from-y)) scale(0.3); }
  16% { opacity: 1; }
  72% { opacity: 1; transform: translate(var(--to-x), calc(var(--from-y) - 90px)) scale(1); }
  100% { opacity: 0; transform: translate(var(--to-x), var(--to-y)) scale(0.25); }
}

@keyframes cycleIntroLayer {
  0% { opacity: 0; }
  13%, 78% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes powerEntrance {
  0% { opacity: 0; transform: translateX(-16%) scale(1.12); filter: brightness(2); }
  40% { opacity: 1; }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: brightness(1); }
}

@keyframes featureCallout {
  0% { opacity: 0; transform: translateX(70px); }
  22%, 75% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(24px); }
}

@keyframes bigWinLayer {
  0% { opacity: 0; transform: scale(0.88); }
  16%, 78% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

html {
  overflow: hidden;
  overscroll-behavior: none;
  background: #050408;
}

.game-shell {
  position: relative;
  display: block;
  width: var(--app-viewport-width, 100vw);
  height: var(--app-viewport-height, 100svh);
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    linear-gradient(180deg, rgba(8, 4, 13, 0.12), rgba(3, 2, 6, 0.74)),
    url("../assets/images/backgrounds/ninja-fortress-bg.png") center / cover no-repeat;
}

.game-board {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--control-height);
  width: var(--stage-design-width, 1920px);
  height: var(--stage-design-height, 1080px);
  overflow: hidden;
  isolation: isolate;
  container-type: size;
  background: transparent;
  transform: translate3d(var(--stage-x, 0px), var(--stage-y, 0px), 0) scale(var(--stage-scale, 1));
  transform-origin: 0 0;
}

.game-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 3, 9, 0.58), transparent 24%, transparent 76%, rgba(5, 3, 9, 0.58));
}

.fx-layer,
.cycle-intro,
.feature-callout,
.big-win {
  position: absolute;
}

html[data-stage-layout="landscape"] .game-board {
  --control-height: 135px;
  --reel-gap: 6px;
}

html[data-stage-layout="landscape"] .stage {
  min-height: 0;
  padding: 0;
}

html[data-stage-layout="landscape"] .topbar {
  inset: 14px 330px auto 26px;
}

html[data-stage-layout="landscape"] .brand {
  width: 310px;
}

html[data-stage-layout="landscape"] .round-status {
  min-width: 170px;
  padding: 10px 16px;
}

html[data-stage-layout="landscape"] .round-status span {
  font-size: 14px;
}

html[data-stage-layout="landscape"] .round-status strong {
  font-size: 28px;
}

html[data-stage-layout="landscape"] .round-status b {
  font-size: 40px;
}

html[data-stage-layout="landscape"] .slot-area {
  height: 100%;
  padding: 58px 0 62px;
}

html[data-stage-layout="landscape"] .reel-frame {
  width: 1240px;
  padding: 9px;
}

html[data-stage-layout="landscape"] .side-feature {
  top: 110px;
  bottom: 66px;
  left: 8px;
  display: grid;
  width: 300px;
  min-width: 0;
  overflow: visible;
  border: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
}

html[data-stage-layout="landscape"] .power-portrait {
  inset: 28px -16px 58px -22px;
  background-position: center top;
  background-size: auto 100%;
  filter: saturate(1.1) contrast(1.04) drop-shadow(0 18px 20px rgba(0, 0, 0, 0.64));
}

html[data-stage-layout="landscape"] .power-portrait::after {
  background: linear-gradient(180deg, transparent 68%, rgba(6, 4, 9, 0.46) 88%, transparent);
}

html[data-stage-layout="landscape"] .message-strip {
  bottom: 6px;
  width: 680px;
  min-height: 48px;
  font-size: 15px;
}

html[data-stage-layout="landscape"] .feature-callout {
  top: 75%;
  right: auto;
  left: 42%;
  width: 20%;
  min-width: 0;
  border-top: 4px solid var(--power-accent);
  border-left: 0;
  text-align: center;
}

html[data-stage-layout="landscape"] .game-menu {
  width: 1180px;
  height: 760px;
}

html[data-stage-layout="portrait"] .game-board {
  --control-height: 330px;
  --reel-gap: 7px;
  width: var(--stage-design-width, 1080px);
  height: var(--stage-design-height, 1920px);
  background-position: center top;
}

html[data-stage-layout="portrait"] .stage {
  min-height: 0;
  padding: 0;
}

html[data-stage-layout="portrait"] .topbar {
  inset: 34px 34px auto 38px;
  align-items: flex-start;
}

html[data-stage-layout="portrait"] .brand {
  width: 430px;
}

html[data-stage-layout="portrait"] .round-status {
  min-width: 220px;
  padding: 16px 20px;
  border-radius: 10px;
}

html[data-stage-layout="portrait"] .round-status span {
  font-size: 22px;
}

html[data-stage-layout="portrait"] .round-status strong {
  font-size: 38px;
}

html[data-stage-layout="portrait"] .round-status b {
  font-size: 54px;
}

html[data-stage-layout="portrait"] .slot-area {
  height: 100%;
  padding: 500px 0 250px;
}

html[data-stage-layout="portrait"] .reel-frame {
  z-index: 5;
  width: 1040px;
  padding: 10px;
  border-width: 4px;
}

html[data-stage-layout="portrait"] .side-feature {
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  z-index: 1;
  display: grid;
  width: 1080px;
  height: 1410px;
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
}

html[data-stage-layout="portrait"] .power-portrait {
  inset: 6px 20px auto auto;
  width: 720px;
  height: 535px;
  background-image: var(--ninja-wild);
  background-position: center 18%;
  background-size: auto 158%;
  filter: saturate(1.12) contrast(1.04) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.62));
}

html[data-stage-layout="portrait"] .power-portrait::after {
  display: none;
}

html[data-stage-layout="portrait"] .message-strip {
  top: 1320px;
  bottom: auto;
  width: 980px;
  min-height: 76px;
  gap: 18px;
  padding: 12px 24px;
  border-radius: 9px;
  font-size: 23px;
}

html[data-stage-layout="portrait"] .info-dot {
  flex-basis: 45px;
  width: 45px;
  height: 45px;
  font-size: 29px;
}

html[data-stage-layout="portrait"] .feature-callout {
  top: 63%;
  right: auto;
  left: 15%;
  width: 70%;
  min-width: 0;
  border-top: 5px solid var(--power-accent);
  border-left: 0;
  text-align: center;
}

html[data-stage-layout="portrait"] .game-menu {
  width: min(1000px, 94vw);
  height: min(1600px, 86vh);
}

html[data-stage-layout="portrait"] .cycle-intro {
  grid-template-columns: 1fr;
  align-content: center;
}

html[data-stage-layout="portrait"] .cycle-intro-portrait {
  width: 760px;
  justify-self: center;
}

html[data-stage-layout="portrait"] .cycle-intro-copy {
  min-height: 0;
  margin: -110px 70px 0;
  padding: 34px 45px;
  border-top: 5px solid var(--power-accent);
  border-left: 0;
  text-align: center;
}

html[data-stage-layout="portrait"] .cycle-intro-copy span {
  font-size: 27px;
}

html[data-stage-layout="portrait"] .cycle-intro-copy strong {
  font-size: 92px;
}

html[data-stage-layout="portrait"] .cycle-intro-copy small {
  max-width: 900px;
  font-size: 28px;
}

.reel-frame {
  --frame-inner-left: 8.85%;
  --frame-inner-right: 8.91%;
  --frame-inner-top: 11.90%;
  --frame-inner-bottom: 11.90%;
  position: relative;
  aspect-ratio: 1672 / 941;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reel-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  border: 0;
  background: var(--frame-art) center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.reel-frame.is-feature-event::before {
  filter:
    drop-shadow(0 8px 10px rgba(0, 0, 0, 0.62))
    drop-shadow(0 0 18px var(--frame-effect-glow, rgba(246, 207, 114, 0.72)));
}

.reels,
.line-layer {
  position: absolute;
  z-index: 30;
  top: var(--frame-inner-top);
  right: var(--frame-inner-right);
  bottom: var(--frame-inner-bottom);
  left: var(--frame-inner-left);
  width: auto;
  height: auto;
}

.line-layer {
  right: var(--frame-inner-right);
  bottom: var(--frame-inner-bottom);
  width: calc(100% - var(--frame-inner-left) - var(--frame-inner-right));
  height: calc(100% - var(--frame-inner-top) - var(--frame-inner-bottom));
}

.reels {
  z-index: 1;
  isolation: isolate;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 224, 145, 0.16), transparent 9%, transparent 91%, rgba(0, 0, 0, 0.5)),
    linear-gradient(90deg, #1a101d, #09060d 50%, #1a101d);
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(170, 98, 255, 0.22);
}

.reel {
  border-right: 1px solid rgba(246, 207, 114, 0.25);
  border-left: 1px solid rgba(246, 207, 114, 0.25);
  background: linear-gradient(180deg, #211524, #0b0710 48%, #160e1a);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.74);
}

.cell {
  border: 1px solid rgba(220, 177, 93, 0.34);
  background:
    radial-gradient(circle at 50% 44%, rgba(116, 69, 132, 0.2), transparent 56%),
    linear-gradient(180deg, rgba(30, 19, 35, 0.98), rgba(8, 6, 12, 0.98));
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.62);
}

.symbol-art {
  inset: 2%;
  background-position: center;
  background-size: auto 136%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.62));
}

.pay-thumb,
.pay-thumb.is-wild {
  background-position: center;
  background-size: cover;
}

.cell.is-wild .symbol-art {
  inset: 2%;
  background-position: center;
  background-size: auto 136%;
}

.loop-cell .symbol-art {
  inset: 2%;
}

.cell.is-dimmed {
  filter: brightness(0.62) saturate(0.72);
}

.cell.is-focus-dim {
  filter: brightness(0.34) saturate(0.5);
  opacity: 0.78;
}

[hidden] {
  display: none !important;
}

.entry-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  overflow: hidden;
  background: #050408;
  opacity: 1;
  visibility: visible;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.entry-loader::before,
.entry-loader::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.entry-loader::before {
  inset: -8px;
  z-index: 0;
  background: url("../assets/images/backgrounds/ninja-fortress-bg.png") center / cover no-repeat;
  filter: blur(2px);
  transform: scale(1.01);
}

.entry-loader::after {
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(5, 2, 10, 0.08), rgba(3, 1, 7, 0.24));
}

.entry-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.entry-loader-panel {
  position: absolute;
  left: var(--stage-x, 0px);
  top: var(--stage-y, 0px);
  z-index: 1;
  display: block;
  width: var(--stage-design-width, 1920px);
  height: var(--stage-design-height, 1080px);
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  transform: scale(var(--stage-scale, 1));
  transform-origin: top left;
}

.entry-loader-logo,
.entry-loader-character,
.entry-loader-promo {
  position: absolute;
  display: block;
  height: auto;
}

.entry-loader-logo {
  z-index: 3;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.82));
}

.entry-loader-character {
  z-index: 2;
  max-height: 101.2%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.58));
}

.entry-loader-promo {
  z-index: 1;
  aspect-ratio: 16 / 9;
  background: var(--frame-art) center / 100% 100% no-repeat;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

.loading-reels {
  position: absolute;
  left: 8.85%;
  right: 8.91%;
  top: 11.9%;
  bottom: 11.9%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  width: auto;
  height: auto;
  overflow: hidden;
  background: rgba(5, 3, 8, 0.94);
  box-shadow: inset 0 0 28px #000;
}

.loading-reels img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  filter: saturate(1.08) brightness(0.94);
}

.entry-loader-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.entry-loader.is-error .entry-loader-copy {
  left: 50%;
  top: 50%;
  z-index: 8;
  display: grid;
  width: min(720px, 82%);
  height: auto;
  overflow: visible;
  padding: 32px;
  clip-path: none;
  white-space: normal;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 116, 81, 0.7);
  border-radius: 24px;
  background: rgba(10, 7, 18, 0.94);
  color: #fff;
}

.entry-loader-copy strong {
  color: #ff9a7c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
}

.entry-loader-copy p {
  font-size: 24px;
}

.entry-loader-progress {
  position: absolute;
  z-index: 5;
  display: block;
  aspect-ratio: 699 / 42;
  opacity: 1;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.entry-loader.is-ready .entry-loader-progress,
.entry-loader.is-error .entry-loader-progress {
  opacity: 0;
  visibility: hidden;
}

.entry-loader-track {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 3px solid #d8ae50;
  border-radius: 999px;
  background: linear-gradient(180deg, #29133e, #09050f 72%);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.92), 0 0 0 3px rgba(53, 27, 7, 0.86);
}

.entry-loader-track span {
  position: absolute;
  left: 1.2%;
  top: 17%;
  display: block;
  width: 0;
  max-width: 97.6%;
  height: 66%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6b23bd, #bb69ff 48%, #ffe36a);
  box-shadow: 0 0 22px rgba(170, 98, 255, 0.78);
  transition: width 120ms linear;
}

.entry-loader-progress > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.entry-confirm-btn {
  position: absolute;
  z-index: 6;
  display: grid;
  aspect-ratio: 355 / 100;
  place-items: center;
  padding: 0;
  border: 4px solid #ffe49a;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff0a6, #dba449 58%, #8b521c);
  color: #160b02;
  font-size: 42px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 5px rgba(69, 31, 8, 0.92), 0 16px 28px rgba(0, 0, 0, 0.58), 0 0 28px rgba(170, 98, 255, 0.44);
  cursor: pointer;
  animation: entryConfirmIn 220ms ease-out both;
}

.entry-confirm-btn:active {
  transform: scale(0.96);
}

.entry-confirm-btn:focus-visible {
  outline: 0;
  filter: drop-shadow(0 0 18px rgba(255, 220, 107, 0.72));
}

@keyframes entryConfirmIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html[data-stage-layout="landscape"] .entry-loader-logo {
  left: 19.2%;
  top: 8.1%;
  width: 25.2%;
}

html[data-stage-layout="landscape"] .entry-loader-progress {
  left: 20.8%;
  top: 82.5%;
  width: 24.2%;
}

html[data-stage-layout="landscape"] .entry-loader-character {
  right: 1.2%;
  bottom: -1.2%;
  width: 39.6%;
}

html[data-stage-layout="landscape"] .entry-loader-promo {
  left: 10.3%;
  top: 31%;
  width: 44.2%;
}

html[data-stage-layout="landscape"] .entry-confirm-btn {
  left: 23.3%;
  top: 81.8%;
  width: 18.5%;
}

html[data-stage-layout="portrait"] .entry-loader-logo {
  left: 3.1%;
  top: 14.7%;
  width: 44.3%;
}

html[data-stage-layout="portrait"] .entry-loader-progress {
  left: 16.8%;
  bottom: 16.4%;
  width: 66.4%;
}

html[data-stage-layout="portrait"] .entry-loader-character {
  right: 2.4%;
  top: 3.4%;
  width: 47.2%;
}

html[data-stage-layout="portrait"] .entry-loader-promo {
  left: 1.9%;
  top: 31.9%;
  width: 96.2%;
}

html[data-stage-layout="portrait"] .entry-confirm-btn {
  left: 25.5%;
  bottom: 13.9%;
  width: 49.1%;
}
