/* bonus-d one-screen page, l3-1 "speed tunnel": a hexagonal tunnel of glowing frames runs from a
   vanishing point behind a 3D "150%" toward the viewer, sport objects rush out of it, the offer,
   a ticket, the button. Base styles are the final frame: without JS and under reduced motion the
   page is complete and still. page.mjs adds the motion (transform and opacity only). Colours and
   sizes come from tokens.css; the tunnel, the streaks and the objects live in tunnel.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 number in the hero = the vanishing point of the tunnel, measured by page.mjs;
     a fair guess without JS */
  --cx: 50%;
  --cy: 36%;
  /* width of "150" plus the raised small "%" in em of the number */
  --num-ratio: 1.5;
  --pct-size: 0.45em;
  --num-size: min(calc(72vw / var(--num-ratio)), 43svh);
}
.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.stage {
  position: absolute;
  inset: 0;
}
/* Dark rim over everything: the eye lands on the tunnel's end and the number in front of it. A
   fine grain rides on the same layer, so the ground never reads as an empty fill. */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  background:
    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.065 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(
      ellipse 78% 74% at var(--cx) var(--cy),
      var(--vignette-0) 50%,
      var(--vignette) 100%
    );
  pointer-events: none;
}

.burst {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.flash,
.wave {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  translate: -50% -50%;
  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);
}

/* The copy block sits a little above the true centre (optical centre of the screen). */
.copy {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  align-content: center;
  height: 100%;
  padding: var(--copy-top, var(--s-6)) var(--pad) var(--copy-bottom, calc(var(--s-6) + 4svh));
  text-align: center;
}
.offer {
  display: grid;
  justify-items: center;
  font-weight: 900;
  text-transform: uppercase;
}

/* "150%": flat yellow face, a lit top (a second copy with a fading fill laid over it), a deep
   extrusion to the bottom right that burns from amber to orange, and a hot glow around it. */
.num {
  position: relative;
  display: block;
  color: var(--accent);
  font-size: var(--num-size);
  line-height: 0.8;
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-shadow: var(--extrude);
}
.d {
  position: relative;
  display: inline-block;
}
/* small "%" with its top on the cap line of the digits (cap height 0.66 em in this face) */
.num__pct {
  display: inline-block;
  margin-left: 0.04em;
  font-size: var(--pct-size);
  letter-spacing: 0;
  translate: 0 calc((0.66em / 0.45 - 0.66em) * -1);
}
.num__hi {
  position: absolute;
  top: 0;
  left: 0;
  color: transparent;
  text-shadow: none;
  pointer-events: none;
}
.num__hi > * {
  background: linear-gradient(180deg, var(--num-hi) 4%, var(--num-hi-0) 42%);
  background-clip: text;
}
/* odometer, built by page.mjs for the count: each digit gets a strip 0-9,0 that rolls up */
.is-rolling .d {
  color: transparent;
  text-shadow: none;
  clip-path: inset(0.02em -0.4em 0.02em);
}
.is-rolling .num__hi {
  opacity: 0;
}
.d__strip {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  translate: -50% 0;
  color: var(--accent);
  text-shadow: var(--extrude);
  /* a layer of its own: the roll moves it without repainting the extrusion every frame */
  will-change: transform;
}
.d__strip > span {
  display: block;
}
/* light pass: a skewed window slides over the number, the copy inside slides back */
.glint {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.3em;
  overflow: clip;
  opacity: 0;
  text-shadow: none;
  transform-origin: 0 0;
  transform: translateX(calc(var(--gx, -1) * 1em)) skewX(-16deg);
  mask-image: linear-gradient(90deg, transparent, var(--black) 46% 54%, transparent);
}
.glint__text {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--glint-ink);
  transform-origin: 0 0;
  transform: skewX(16deg) translateX(calc(var(--gx, -1) * -1em));
}
/* the offer lines scale with the number, so the block keeps one proportion on every screen */
.offer__lead {
  display: block;
  margin-top: 0.5em;
  font-size: max(var(--fs-offer-min), calc(var(--num-size) * var(--k-offer-lead)));
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow:
    0 0.06em 0.3em var(--lead-shade),
    0 0 0.8em var(--lead-shade);
}

/* "+ 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(--num-size) * 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 .tunnel,
.is-pending .flyers,
.is-pending .bokeh {
  opacity: 0;
}

/* Portrait (phone and tablet): the number runs nearly edge to edge. */
@media (max-aspect-ratio: 1 / 1) {
  .hero {
    --num-size: min(calc((100vw - 1.5rem) / var(--num-ratio)), 38svh);
    --cy: 38%;
  }
}
@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 number and the ticket stay left to right (inline-block digits would
   reorder). Words keep their own direction. The arrow points the reading way; scale composes with
   the hover transform. */
[dir="rtl"] :is(.num, .offer__free) {
  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;
}
