/* bonus-d one-screen page, variant l3-3 "jackpot reels": a slot machine under warm stage light
   in one viewport. Stage light, stray coins and stars around a chrome-and-gold machine whose four
   reels land on "1" "5" "0" "%", then the offer, the ticket and the button. Base styles are the
   landed frame: without JS and under reduced motion the page is complete and still. page.mjs adds
   the spin and the payout (transform and opacity only). The machine itself is in machine.css;
   colours and sizes come from tokens.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  -webkit-text-size-adjust: 100%;
}
/* One poster screen: no text selection, no iOS long-press menu, no tap flash, no image drag.
   The button stays a normal focusable link. */
html,
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  overflow-x: clip;
}
/* fallback: a select-all that gets through still paints nothing */
::selection {
  background: transparent;
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
  -webkit-user-drag: none;
}
h1 {
  margin: 0;
}

/* ------------------------------------------------------------------ button */

/* The one action of the page: a yellow plate slanted like the face's italic, standing on its
   amber side. Press pushes the plate down onto the side; the label is turned back upright. */
.cta-wrap {
  position: relative;
  display: grid;
  width: max-content;
  min-width: min(100%, var(--cta-w));
  margin-top: clamp(1.5rem, 4svh, 2.75rem);
  margin-bottom: var(--cta-edge-h);
}
.cta-edge {
  position: absolute;
  inset: 0;
  background: var(--cta-edge);
  transform: translateY(var(--cta-edge-h)) skewX(var(--skew));
  box-shadow: 0 1rem 2rem -0.75rem var(--cta-drop);
  pointer-events: none;
}
.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--cta-h);
  padding: 0 1.2em;
  overflow: clip;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-cta);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transform: skewX(var(--skew));
  transition: transform 150ms var(--ease-out);
}
.cta__label {
  position: relative;
  display: flex;
  align-items: center;
  transform: skewX(calc(var(--skew) * -1));
}
/* moved toward the pointer by page.mjs (fine pointer only), a little more than the plate */
.cta__mag {
  display: flex;
  align-items: center;
  gap: 0.28em;
}
.cta__text {
  text-box: trim-both cap alphabetic;
}
.cta__arrow {
  flex: none;
  width: 0.78em;
  height: 0.78em;
  transition: transform 150ms var(--ease-out);
}
.cta__glint {
  position: absolute;
  inset: 0 auto 0 0;
  width: 32%;
  background: linear-gradient(90deg, transparent, var(--cta-glint), transparent);
  opacity: 0;
}
/* Idle cue after the entrance: a thin yellow ring leaves the plate and fades. Hidden at rest,
   so reduced motion and a stopped animation both show nothing extra. */
.cta-ring {
  position: absolute;
  inset: 0;
  border: var(--ring-w) solid var(--cta-ring);
  transform: skewX(var(--skew));
  opacity: 0;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .cta:hover {
    transform: translateY(-3px) skewX(var(--skew));
  }
  .cta:hover .cta__arrow {
    transform: translateX(0.12em);
  }
}
.cta:active {
  transform: translateY(var(--cta-edge-h)) skewX(var(--skew));
  transition-duration: var(--t-press);
}
.cta:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  /* starts when the intro flag (html[data-intro]) is removed, so the loops never run under the
     entrance; no fill mode, the rest state is the base. If the flag is never set the loops
     start at once. */
  html:not([data-intro]) .cta-ring {
    animation: ring var(--t-pulse) var(--ease-out) infinite;
  }
  html:not([data-intro]) .cta {
    animation: pulse var(--t-pulse) ease-in-out infinite;
  }
}
@keyframes ring {
  0% {
    opacity: 1;
    scale: 1;
  }
  45%,
  100% {
    opacity: 0;
    scale: 1.1 1.5;
  }
}
@keyframes pulse {
  0%,
  30%,
  100% {
    scale: 1;
  }
  12% {
    scale: 1.03;
  }
}

/* ------------------------------------------------------------------ the screen */

.hero {
  position: relative;
  height: 100svh;
  min-height: 30rem;
  overflow: clip;
  isolation: isolate;
  background: var(--ground);
  /* centre of the reels in the hero, measured by page.mjs; a fair guess without JS */
  --cx: 50%;
  --cy: 38%;
  /* --g: font size of a reel glyph, the one size the whole machine is built from. Portrait: the
     width minus the frame over four reels (a reel is --reel-k g); every height: what is left of the
     screen after the offer and the button, over the machine's height in g. */
  --g: min(
    calc((100vw - var(--m-frame-x)) / (4 * var(--reel-k))),
    calc((100svh - var(--m-fixed-y)) / var(--m-k-y)),
    var(--g-max)
  );
  /* half the cabinet width and the free side strip next to it (desktop flanks) */
  --mach-half: calc(2 * var(--reel-k) * var(--g) + var(--m-frame) + 1.5 * var(--reel-gap));
  --side: calc(50vw - var(--mach-half));
}
.stage {
  position: absolute;
  inset: 0;
}
/* Floodlight pool from above and the dark floor under the button, plus a fine grain so the
   ground never reads as an empty fill. */
.pool {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, var(--pool) 0%, var(--pool-0) 100%),
    radial-gradient(ellipse 90% 45% at 50% 100%, var(--floor) 0%, var(--floor-0) 100%);
}
.grain {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: var(--grain-o);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}
/* Dark corners over everything: the eye lands in the middle. */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: radial-gradient(
    ellipse 75% 72% at 50% 44%,
    var(--vignette-0) 55%,
    var(--vignette) 100%
  );
  pointer-events: none;
}
/* Warm spot behind the number; the core breathes slowly. */
.spot {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: max(120vmin, 52rem);
  aspect-ratio: 1.35;
  translate: -50% -50%;
  pointer-events: none;
}
.spot__core {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    closest-side,
    var(--spot) 0%,
    var(--spot-mid) 45%,
    var(--spot-0) 100%
  );
}
@media (prefers-reduced-motion: no-preference) {
  .spot__core {
    animation: breathe var(--t-breathe) ease-in-out infinite alternate;
  }
}
@keyframes breathe {
  from {
    opacity: 0.7;
    scale: 0.94;
  }
  to {
    opacity: 1;
    scale: 1.05;
  }
}

/* Impact rays behind the number: thin amber spokes, faded at the core and at the rim. They are
   the trace of the hit in the final frame and turn very slowly in the quiet loop. The fade is a
   mask on the turning wheel, not on the box round it: the mask is round, so it turns with the
   wheel unchanged, and it is drawn once into the wheel's layer instead of being composited over
   a screen and a half on every frame of the turn. */
.rays {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: max(150vmin, 60rem);
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
}
.rays__wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--ray) 0deg 3deg, var(--ray-0) 3deg 12deg);
  mask-image: radial-gradient(
    closest-side,
    transparent 14%,
    var(--black) 34%,
    var(--black) 52%,
    transparent 100%
  );
}
@media (prefers-reduced-motion: no-preference) {
  /* idle loop: waits for the intro flag to go, like the other loops (page.css:145) */
  html:not([data-intro]) .rays__wheel {
    animation: spin var(--t-rays) linear infinite;
  }
}
@keyframes spin {
  to {
    rotate: 1turn;
  }
}

.burst {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.flash,
.wave {
  position: absolute;
  left: var(--ix, var(--cx));
  top: var(--iy, var(--cy));
  translate: -50% -50%;
  opacity: 0;
}
/* sparks are made by page.mjs and placed with x/y from the hero's top left */
.spark {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}
.flash {
  width: max(100vmin, 46rem);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--flash), var(--flash-0));
}
.wave {
  width: max(80vmin, 30rem);
  aspect-ratio: 1;
  border: clamp(0.5rem, 1.1vmin, 1rem) solid var(--wave);
  border-radius: 50%;
}
.wave--2 {
  border-width: clamp(0.25rem, 0.55vmin, 0.5rem);
}
/* Spark from the hit: a short hot line that flies out along its own angle and burns down.
   Origin on the left end, so the rotation points it away from the impact. */
.spark {
  width: clamp(1.75rem, 3.2vmin, 3rem);
  height: clamp(2px, 0.35vmin, 4px);
  translate: 0 -50%;
  transform-origin: 0 50%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--spark-0), var(--spark-1) 45%, var(--spark-2));
}
.spark--dot {
  translate: -50% -50%;
  width: clamp(4px, 0.6vmin, 7px);
  height: clamp(4px, 0.6vmin, 7px);
  border-radius: 50%;
  background: var(--spark-2);
}

/* The machine, the offer and the button in one centred column, a little above the true centre. */
.copy {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  align-content: center;
  height: 100%;
  padding: var(--copy-top) var(--pad) var(--copy-bottom);
  text-align: center;
}
/* "150%" for screen readers: the reels show it, the h1 says it */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.offer {
  display: grid;
  justify-items: center;
  font-weight: 900;
  text-transform: uppercase;
}

/* the offer lines scale with the number, so the block keeps one proportion on every screen */
.offer__lead {
  display: block;
  margin-top: 0.55em;
  font-size: max(var(--fs-offer-min), calc(var(--g) * var(--k-offer-lead)));
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* "+ FreeBet $250" as a bet ticket: yellow outline, a perforated stub for the "+", tilted with
   the slant of the page. Second in line after the number, so outline only, never a fill. */
.offer__free {
  display: block;
  margin-top: 0.3em;
  font-size: max(var(--fs-free-min), calc(var(--g) * var(--k-offer-free)));
  line-height: 0.95;
  white-space: nowrap;
}
.tag {
  display: inline-flex;
  align-items: stretch;
  border: max(2px, 0.045em) solid var(--tag-line);
  background: var(--tag-fill);
  transform: rotate(-2.5deg) skewX(var(--skew));
}
.tag__stub,
.tag__main {
  display: flex;
  align-items: center;
  padding: 0.16em 0.32em 0.14em;
}
.tag__stub {
  padding-inline: 0.26em;
  color: var(--accent);
  border-right: max(2px, 0.04em) dashed var(--tag-cut);
}
.tag__stub > span,
.tag__main > span {
  display: block;
  transform: skewX(calc(var(--skew) * -1));
  text-box: trim-both cap alphabetic;
}

/* Before the intro starts (set by the inline script, never under reduced motion). */
.is-pending .copy,
.is-pending .deco,
.is-pending .flanks,
.is-pending .spot,
.is-pending .rays {
  opacity: 0;
}

@media (max-width: 47.99rem) {
  .cta-wrap {
    width: calc(100% - 1rem);
  }
}
/* Under 375 px the plate gives up its min width (the number column runs past the gutters, so the
   plate would too) and narrows its sides; the label size follows the viewport (--fs-cta). */
@media (max-width: 23.43rem) {
  .cta-wrap {
    min-width: 0;
  }
  .cta {
    padding-inline: 0.8em;
  }
  /* the Armenian label is the longest (about 8.4 em): one more step down */
  :lang(hy) .cta {
    font-size: min(var(--fs-cta), 8.5vw);
  }
}

/* ------------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  .cta,
  .cta__arrow {
    transition: none;
  }
  /* no lift on hover, but :active must still win so a press stays visible */
  @media (hover: hover) and (pointer: fine) {
    .cta:hover:not(:active) {
      transform: skewX(var(--skew));
    }
  }
}

/* ------------------------------------------------------------------ languages (js/i18n.mjs) */

/* Guard: the inline head script sets data-locale-pending, i18n.mjs removes it once the copy is
   in the visitor's language. Only the translatable text waits; the stage and "150%" paint as is. */
html[data-locale-pending] :is(.offer__lead, .cta__text) {
  visibility: hidden;
}
/* RTL (ar, he, fa): the machine and the ticket stay left to right, so the reels still read "150%"
   and the lever stays on the right. Words keep their own direction. The arrow points the reading
   way; scale composes with the hover transform. */
[dir="rtl"] :is(.machine, .offer__free, .vh) {
  direction: ltr;
}
[dir="rtl"] .cta__arrow {
  scale: -1 1;
}
/* The translated words take the copy stack (tokens.css): the CJK, vi and az faces sit only here. */
:is(.offer__lead, .cta__text) {
  font-family: var(--font-copy);
}
/* Georgian: no caps (uppercase maps to Mtavruli, U+1C90, not in the subset and not used in copy). */
:lang(ka) :is(.offer__lead, .cta__text) {
  text-transform: none;
}
/* The Arabic label (ar) runs wider than the plate at 375 px: it steps down. fa fits as is. */
:lang(ar) .cta {
  font-size: var(--fs-cta-wide);
}
/* The Armenian label keeps the full size and takes narrower side padding. */
:lang(hy) .cta {
  padding-inline: 0.8em;
}
/* Scripts with no italic tradition: upright, no synthetic slant. The CJK and Korean faces have
   no italic either, so the inherited italic would be a synthetic oblique. */
:is(
    :lang(ar),
    :lang(fa),
    :lang(he),
    :lang(hi),
    :lang(bn),
    :lang(th),
    :lang(hy),
    :lang(ka),
    :lang(zh-Hans),
    :lang(zh-Hant),
    :lang(ja),
    :lang(ko)
  )
  :is(.offer__lead, .cta__text) {
  font-style: normal;
  font-synthesis-style: none;
}
/* Arabic and Hebrew: no tracking between joined letters. */
:is(:lang(ar), :lang(fa), :lang(he)) :is(.offer__lead, .cta__text) {
  letter-spacing: 0;
}
/* Hebrew: the space comes from Sofia (narrow) while Heebo letters keep wide side bearings, so a
   word gap reads like a letter gap ("קבל בונוס" looked like one word). */
:lang(he) :is(.offer__lead, .cta__text) {
  word-spacing: 0.14em;
}
/* Marks above and below the line: room for them, no tracking. */
:is(:lang(ar), :lang(fa), :lang(hi), :lang(bn), :lang(th)) :is(.offer__lead, .cta__text) {
  line-height: 1.4;
  letter-spacing: 0;
}
:is(:lang(ar), :lang(fa), :lang(hi), :lang(bn), :lang(th), :lang(ka), :lang(hy), :lang(he))
  .cta__text {
  text-box: none;
}
:is(:lang(zh-Hans), :lang(zh-Hant), :lang(ja), :lang(ko)) :is(.offer__lead, .cta__text) {
  letter-spacing: 0.04em;
  line-height: 1.15;
}
:lang(ko) :is(.offer__lead, .cta__text) {
  word-break: keep-all;
}
