.omt-scroll-story {
  --omt-story-gold: #ffc400;
  position: relative;
  width: 100%;
  height: 1500vh;
  min-height: 1500vh;
  padding: 0;
  margin: 0;
  overflow: clip;
  color: #fff;
  background: radial-gradient(circle at 50% 38%, #153d9f 0, #071b5d 34%, #03092e 66%, #010316 100%);
}

.omt-scroll-story,
.omt-scroll-story * { box-sizing: border-box; }

/* ── Stage ── */
.omt-scroll-story__stage {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  perspective: 1800px;
  background: radial-gradient(circle at 50% 48%, rgba(0, 103, 255, .20), transparent 38%), #02051c;
}

/* ── Background decorations ── */
.omt-scroll-story__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.22), transparent 18%, transparent 75%, rgba(0,0,0,.28));
}

.omt-scroll-story__grid {
  position: absolute;
  left: -20%; right: -20%; bottom: -36%;
  height: 70%;
  z-index: 1;
  transform: rotateX(66deg);
  transform-origin: center bottom;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(74,123,255,.15) 0 1px, transparent 1px 7vw),
    repeating-linear-gradient(0deg,  rgba(74,123,255,.12) 0 1px, transparent 1px 7vh);
}

/* ── Hidden legacy elements ── */
.omt-scroll-story__chart,
.omt-scroll-story__lid { display: none; }

/* ── Intro text ── */
.omt-scroll-story__intro {
  position: absolute;
  top: 49%;
  left: 50%;
  z-index: 90;
  width: min(96vw, 1400px);
  text-align: center;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

/* logo above the headline */
.omt-scroll-story__intro-logo {
  display: block;
  width: clamp(120px, 14vw, 200px);
  height: auto;
  margin: 0 auto 28px;
  filter: drop-shadow(0 0 20px rgba(255,196,0,.55));
}

.omt-scroll-story__kicker {
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .35em;
  opacity: .68;
}

.omt-scroll-story__intro h1 {
  margin: 0;
  color: var(--omt-story-gold);
  font-family: 'ClashDisplay-Bold', 'ClashDisplay-Medium', sans-serif;
  font-size: clamp(24px, 4.4vw, 76px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-align: center !important;
  text-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.omt-scroll-story__intro h1 span { display: inline-block; white-space: nowrap; }

.omt-scroll-story__intro p {
  margin: 22px 0 0;
  font-size: clamp(14px, 1.35vw, 20px);
  color: #fff;
  opacity: .72;
}

/* ── Yellow glow behind intro text ── */
.omt-scroll-story__intro-glow {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 89;
  width: min(120vw, 1400px);
  height: min(120vw, 1400px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255,196,0,.22) 0%,
    rgba(255,160,0,.10) 30%,
    transparent 68%
  );
  filter: blur(32px);
  pointer-events: none;
  opacity: 1;
  will-change: opacity;
}

/* ── Board container ── */
.omt-scroll-story__box {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 30;
  /*width: min(82vw, 960px);*/
   width: min(82vw, 1000px);
  /*height: min(54vw, 620px);*/
  height: min(54vw, 900px);
  transform: translate(-50%, -50%) scale(0.88);
  transform-style: preserve-3d;
  opacity: 0;
  will-change: transform, opacity;
}

/* ── Board base — perspective root, matches reference file ── */
.omt-scroll-story__box-base {
  position: absolute;
  inset: 0;
  perspective: 2000px;
  perspective-origin: 50% 50%;
}

/* ── Fixed right half — always visible ── */
.omt-scroll-story__board-fixed {
  position: absolute;
  right: 0; top: 0;
  width: 50%; height: 100%;
  border-radius: 0 16px 16px 0;
  background: url('../img/home-06/showcase/1 Light color Game board.png') right center / 200% 100% no-repeat;
  z-index: 1;
}

/* ── Left wing — hinged at right edge (board centre) ── */
.omt-scroll-story__board-wing {
  position: absolute;
  left: 0; top: 0;
  width: 50%; height: 100%;
  transform-origin: right center;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  z-index: 2;
  will-change: transform;
}

/* shared face styles */
.omt-scroll-story__board-inside,
.omt-scroll-story__board-outside {
  position: absolute;
  inset: 0;
  border-radius: 16px 0 0 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* inside face — game board left half, visible when wing is open (rotateY=0) */
.omt-scroll-story__board-inside {
  background: url('../img/home-06/showcase/1 Light color Game board.png') left center / 200% 100% no-repeat;
  z-index: 1;
}

/* outside face — cover / back, visible when wing is folded (rotateY=180deg) */
.omt-scroll-story__board-outside {
  inset: -2.5% 0 -2.5% -3%;
  background: url('../img/home-06/showcase/Game-Board-light.png') center / 100% 100% no-repeat;
  transform: rotateY(180deg);
  z-index: 1;
}

/* ── Gold spine / fold line ── */
.omt-scroll-story__board-fold {
  position: absolute;
  left: calc(50% - 2px); top: 4%; bottom: 4%;
  width: 4px;
  background: linear-gradient(90deg, #00112966, #ffd54b99, #05102455);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  will-change: opacity;
}

/* ── Glow — emanates from board centre as it opens ── */
.omt-scroll-story__glow {
  position: absolute;
  left: 10%; right: 10%; bottom: 5%;
  z-index: 4;
  height: 50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,205,0,.90), rgba(28,98,255,.35) 42%, transparent 72%);
  filter: blur(28px);
  opacity: 0;
  pointer-events: none;
}

/* ── Card / coin assets ── */
.omt-scroll-story__assets {
  position: absolute;
  inset: 0;
  z-index: 65;
  transform-style: preserve-3d;
  pointer-events: none;
}

.omt-scroll-story__asset {
  position: absolute;
  top: 54%; left: 50%;
  width: auto; height: auto; max-width: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.02);
  filter: drop-shadow(0 22px 28px rgba(0,0,0,.55));
  will-change: transform, opacity;
}

.omt-scroll-story__card    { width: clamp(90px,  9.2vw, 155px); }
.omt-scroll-story__special { width: clamp(95px,  10vw,  170px); }
.omt-scroll-story__coin    { width: clamp(66px,  6.7vw, 114px); aspect-ratio: 1; object-fit: contain; }

/* ── Final overlay (full-screen gateway) ── */
.omt-scroll-story__final {
  position: absolute;
  inset: 0;
  z-index: 110;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  background: transparent;
}

/* Gateway image — starts far away, zooms in (JS drives z/scale) */
.omt-scroll-story__final-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  perspective: 2000px;
  will-change: transform;
}

.omt-scroll-story__final-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  filter: brightness(1.12) saturate(1.1) contrast(1.04);
}

/* Very light overlay — lets the image stay bright (matches v2 cover-img treatment) */
.omt-scroll-story__final-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(0,6,20,.10) 70%, rgba(0,5,18,.28) 100%),
    linear-gradient(180deg, rgba(0,0,0,.18) 0%, transparent 38%, transparent 68%, rgba(0,0,0,.22) 100%);
}

/* Text centered over the image — matches v2 .mxd-hero-02__outro */
.omt-scroll-story__final-text {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
  width: min(68%, 1080px);
  padding-inline: 24px;
  text-align: center;
  pointer-events: none;
  mix-blend-mode: normal;
}

/* the <p> tag that holds the text */
.omt-scroll-story__final-text p#omt-story-final-h2 {
  margin: 0;
  color: #F8C800;
  -webkit-text-fill-color: #F8C800;
  font-family: 'ClashDisplay-Bold', sans-serif !important;
  font-size: clamp(64px, 6vw, 96px);
  font-weight: 700 !important;
  line-height: 1.02;
  letter-spacing: -.012em;
  word-spacing: .08em;
  text-wrap: balance;
  text-rendering: geometricPrecision;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
  text-shadow: 0 4px 26px rgba(0,0,0,.28);
}

/* word wrappers from SplitText */
.omt-scroll-story__final-text .omt-hero-word {
  display: inline-block !important;
  margin-right: .16em !important;
  white-space: nowrap;
  font-family: inherit !important;
  font-weight: inherit !important;
}

/* char spans from SplitText */
.omt-scroll-story__final-text .omt-hero-char {
  display: inline-block;
  opacity: 0;
  font-family: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit;
}

/* subtitle below main text */
.omt-scroll-story__final-text p:not(#omt-story-final-h2) {
  margin: 20px 0 0;
  font-family: inherit;
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 400;
  line-height: 1.6;
  color: #fff;
  -webkit-text-fill-color: #fff;
  letter-spacing: .02em;
  opacity: .75;
}

/* ── UI chrome ── */
.omt-scroll-story__hint,
.omt-scroll-story__phase,
.omt-scroll-story__progress { position: absolute; z-index: 120; }

.omt-scroll-story__hint {
  bottom: 22px; left: 24px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .02em;
  text-decoration: none;
}

.omt-scroll-story__hint span {
  display: inline-block;
  margin-left: 7px;
  animation: omt-story-bob .8s ease-in-out infinite alternate;
}

@keyframes omt-story-bob { to { transform: translateY(7px); } }

.omt-scroll-story__phase {
  right: 28px; bottom: 24px;
  font-size: 11px;
  letter-spacing: .16em;
  opacity: .55;
}

.omt-scroll-story__progress { display: none; }

.omt-scroll-story__progress b {
  display: block;
  width: 100%; height: 0;
  border-radius: inherit;
  background: var(--omt-story-gold);
}

/* ── Responsive — Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .omt-scroll-story__box        { width: min(88vw, 780px); height: auto; aspect-ratio: 1257 / 1123; }
  .omt-scroll-story__card       { width: clamp(68px, 10.5vw, 118px); }
  .omt-scroll-story__special    { width: clamp(74px, 11.5vw, 128px); }
  .omt-scroll-story__coin       { width: clamp(50px,  8vw,   94px); }
  .omt-scroll-story__final-text h2 { font-size: clamp(36px, 5.8vw, 76px); }
  .omt-scroll-story__final-text p  { font-size: clamp(14px, 2vw,   20px); }
}

/* ── Responsive — Mobile (≤ 767px) ── */
@media (max-width: 767px) {
  .omt-scroll-story             { height: 1600vh; min-height: 1600vh; }
  .omt-scroll-story__box        { width: 94vw; height: auto; aspect-ratio: 1257 / 1123; }
  .omt-scroll-story__box-base   { perspective: 1600px; }
  .omt-scroll-story__card       { width: 21vw; }
  .omt-scroll-story__special    { width: 24vw; }
  .omt-scroll-story__coin       { width: 16vw; }
  .omt-scroll-story__phase      { display: none; }
  .omt-scroll-story__hint       { left: 12px; bottom: 16px; font-size: 12px; }
  .omt-scroll-story__final-text    { width: 94vw; }
  .omt-scroll-story__final-text h2 { font-size: clamp(26px, 7.5vw, 44px); }
  .omt-scroll-story__final-text p  { font-size: clamp(13px, 3.8vw, 18px); }
  .omt-scroll-story__glow       { left: 5%; right: 5%; height: 40%; filter: blur(18px); }
}

/* ── Responsive — Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .omt-scroll-story__box        { width: 96vw; height: auto; aspect-ratio: 1257 / 1123; }
  .omt-scroll-story__card       { width: 23vw; }
  .omt-scroll-story__special    { width: 26vw; }
  .omt-scroll-story__coin       { width: 17vw; }
  .omt-scroll-story__hint       { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .omt-scroll-story__hint span { animation: none; }
}

/* New logo placed over the gate sign of the gateway image */
.omt-scroll-story__final-bg { container-type: size; }
.omt-gw {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(100cqw, calc(100cqh * 1672 / 941)); aspect-ratio: 1672 / 941; pointer-events: none;
}
.omt-gw__patch {
  position: absolute; left: 78.6%; top: 24.7%; width: 17%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(circle, #0d132e 0%, #0d132e 52%, rgba(13,19,46,0) 70%);
}
.omt-gw .omt-gw__logo {
  position: absolute; left: 78.6%; top: 24.7%; width: 12.6%; height: auto; transform: translate(-50%, -50%);
  object-fit: contain; filter: drop-shadow(0 0 14px rgba(255,196,0,.45)); user-select: none;
}

/* Smooth scrolling: avoid effects that force a full repaint every scrolled frame */
.tp-header-2-area, .tp-header-2-area.mt-40 {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: linear-gradient(180deg, rgba(0,0,0,.9) 0%, rgba(2,2,14,.86) 60%, rgba(8,3,60,.8) 100%) !important;
}
.omt-scroll-story__intro-glow { filter: none; }
.omt-scroll-story__glow { filter: none; background: radial-gradient(ellipse, rgba(255,205,0,.55), rgba(28,98,255,.22) 42%, transparent 72%); }
.omt-scroll-story__stage { contain: layout paint; transform: translateZ(0); }
.omt-scroll-story__box, .omt-scroll-story__final, .omt-scroll-story__final-bg, .omt-scroll-story__intro, .omt-scroll-story__asset { backface-visibility: hidden; }

/* Intro heading: gently shaking "shake" */
.omt-scroll-story__intro h1 .omt-shake { display: inline-block; transform-origin: 50% 80%; text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .14em; pointer-events: auto; cursor: default; }
.omt-scroll-story__intro h1 .omt-shake:hover { animation: omtShake .55s ease-in-out infinite; }
.omt-scroll-story__intro h1 .omt-shake.is-click-shaking { animation: omtShake .12s ease-in-out 6; }
@keyframes omtShake {
  0%, 100% { transform: translate(0,0) rotate(0); }
  20% { transform: translate(-1.5px, 0) rotate(-1.8deg); }
  40% { transform: translate(1.5px, -1px) rotate(1.8deg); }
  60% { transform: translate(-1.5px, 1px) rotate(-1.4deg); }
  80% { transform: translate(1.5px, 0) rotate(1.4deg); }
}
@media (max-width: 767px) { .omt-scroll-story__intro h1 > span { white-space: normal; } }
@media (prefers-reduced-motion: reduce) { .omt-scroll-story__intro h1 .omt-shake { animation: none; } }
