@font-face {
  font-family: 'uRegular';
  src: url(https://wavecdn.b-cdn.net/fonts/UnitPro-Regular.woff2) format('woff2'),
    url(https://wavecdn.b-cdn.net/fonts/UnitPro-Regular.woff) format('woff'),
    url(https://wavecdn.b-cdn.net/fonts/UnitPro-Regular.ttf) format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'uMedi';
  src: url(https://wavecdn.b-cdn.net/fonts/UnitPro-Medium.woff2) format('woff2'),
    url(https://wavecdn.b-cdn.net/fonts/UnitPro-Medium.woff) format('woff'),
    url(https://wavecdn.b-cdn.net/fonts/UnitPro-Medium.ttf) format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --reborn-green: #34bc7d;
  --reborn-green-light: #71d1a4;
  --reborn-teal: #003f46;
  --reborn-heading: #222b47;
  --reborn-text: #222b47;
  --reborn-white: #ffffff;
  --reborn-gray--light: #f9f9fa;
  --reborn-header-teal: #014045;
  --font: 'uRegular', Helvetica, Arial, sans-serif;
  --radius-btn: 4px;
  --reborn-cta: #ed4911;
  --gizzmo-cta: #ed4911;
  --gizzmo-cta-hover: #d03f0c;
  --reborn-cta-hover: #d03f0c;
  --reborn-header-height: 64px;
  --mag-page-yellow: #fdf1d5;
  --mag-page-yellow-deep: #f5e6c0;
  --mag-page-bg-image: url('./images/bg-pattern.png');
  --mag-page-bg-size: 320px auto;
  --mag-sprite-w: calc(9.5rem + 25px);
  --mag-sprite-h: calc(12.75rem + 32px);
  /* lens hole in SVG: r=69, centre (96,96) in viewBox 238×272 */
  --mag-frame-vb-w: 238;
  --mag-frame-vb-h: 272;
  /* lens hole centre in SVG viewBox 238×272 */
  --mag-lens-hole-cx: 96;
  --mag-lens-hole-cy: 96;
  /* rim outer radius in SVG units — used to align the visible rim, not the
     larger CSS lens viewport, with the card edge */
  --mag-rim-outer-r: 82;
  /* rim inner hole radius in SVG units — used to clip the lens to exactly
     the visible hole so magnified text can never appear outside the rim */
  --mag-rim-hole-r: 69;
  /* rim hole radius converted to pixels, taking the SVG's xMidYMid meet
     scaling into account (the SVG fits its container by the smaller axis) */
  --mag-clip-r: calc(
    var(--mag-rim-hole-r) *
      min(
        var(--mag-sprite-w) / var(--mag-frame-vb-w),
        var(--mag-sprite-h) / var(--mag-frame-vb-h)
      )
  );
  /* distance from card top to the lens centre that puts the visible rim 8px
     below the card top edge */
  --mag-glass-top-gap: calc(
    8px + var(--mag-rim-outer-r) * var(--mag-sprite-h) / var(--mag-frame-vb-h)
  );
  /* Text reveal circle only — glass sprite size unchanged above */
  --mag-text-view-boost: 2.75rem;
  --mag-lens-viewport: calc(7.6rem + 30px + var(--mag-text-view-boost));
  --mag-lens-size: var(--mag-lens-viewport);
  --mag-lens-offset-x: calc(
    var(--mag-sprite-w) * var(--mag-lens-hole-cx) / var(--mag-frame-vb-w) -
      var(--mag-lens-viewport) / 2
  );
  --mag-lens-offset-y: calc(
    var(--mag-sprite-h) * var(--mag-lens-hole-cy) / var(--mag-frame-vb-h) -
      var(--mag-lens-viewport) / 2
  );
  --mag-text-scale: 1.25;
}

@media (min-width: 768px) {
  :root {
    --reborn-header-height: 62px;
    --mag-sprite-w: calc(12.5rem + 30px);
    --mag-sprite-h: calc(16.75rem + 40px);
    --mag-text-view-boost: 3.25rem;
    --mag-lens-viewport: calc(8.625rem + 30px + var(--mag-text-view-boost));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--reborn-text);
  background: var(--reborn-gray--light);
}

body.has-reborn-header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
  background-color: var(--mag-page-yellow);
  background-image: var(--mag-page-bg-image);
  background-repeat: repeat;
  background-position: 0 50px;
  background-size: 370px auto;
  background-attachment: fixed;
}

body.magnify-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

body.has-reborn-header .page {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
}

.page__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: transparent;
}

.site-topbar {
  flex-shrink: 0;
  width: 100%;
  background: #0b1123;
}

.site-topbar__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  height: 62px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 5px 24px 0;
}

.site-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #ffffff;
  opacity: 0.7;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.15s ease-in-out;
}

.site-topbar__link:hover,
.site-topbar__link:focus-visible {
  opacity: 1;
  color: #ffffff;
}

.site-topbar__link--back {
  justify-self: start;
}

.site-topbar__link--phone {
  justify-self: end;
}

.site-topbar__icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.site-topbar__link-text {
  white-space: nowrap;
}

.site-topbar__logo {
  justify-self: center;
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.site-topbar__logo img {
  display: block;
  width: 168px;
  height: auto;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .site-topbar__inner {
    padding: 5px 16px 0;
    gap: 14px;
  }

  .site-topbar__link {
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  .site-topbar__inner {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    height: 64px;
    padding: 0 14px;
  }

  .site-topbar__link-text {
    display: none;
  }

  .site-topbar__logo img {
    width: 154px;
  }
}


@media (max-width: 767px) {
  .magnify-game__instruction {
    margin-top: 0;
  }
}

/* —— Game —— */
.magnify-game {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 0.5rem 0 1rem;
}

.magnify-game__title {
  position: relative;
  z-index: 2;
  margin: 0;
  margin-top: 20px;
  font-family: 'uMedi', var(--font);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--reborn-heading);
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.magnify-game__instruction {
  position: relative;
  z-index: 2;
  padding: 0 8px;
  min-height: calc(1.125rem * 1.25);
  max-width: 285px;
  font-family: var(--font);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--reborn-text);
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.magnify-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: min(355px, calc(100dvh - var(--reborn-header-height) - 8rem));
  max-height: 355px;
  padding: 3rem 2.25rem;
  border-radius: 1.125rem;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(255, 255, 255, 0.7) 0%,
      rgba(255, 253, 247, 0) 75%
    ),
    linear-gradient(180deg, #fffdf7 0%, #fff6e1 100%);
  border: 1px solid rgba(255, 220, 150, 0.22);
  box-shadow:
    0 20px 50px rgba(55, 60, 75, 0.18),
    0 8px 24px rgba(55, 60, 75, 0.1),
    0 2px 6px rgba(55, 60, 75, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
  perspective: 920px;
  transform-style: preserve-3d;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.magnify-scene--exiting {
  overflow: hidden;
}

.magnify-prize {
  font-family: 'uMedi', var(--font);
  font-size: clamp(1.1rem, 4.8vw, 1.65rem);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.magnify-prize--source {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.2rem;
  width: max-content;
  min-width: min(100%, 19rem);
  max-width: calc(100% - 2.5rem);
  margin: 0;
  padding: 0 0.5rem;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transform: translate(-50%, -50%);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.magnify-prize__line {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

.magnify-prize__line--offer,
.magnify-prize__line--detail {
  color: var(--reborn-heading);
}

.magnify-prize__offer {
  display: inline-block;
  white-space: nowrap;
}

.magnify-prize__green,
.green {
  font-family: 'uMedi', var(--font);
  font-weight: 700;
  color: var(--gizzmo-cta);
}

.magnify-prize__value {
  display: inline-block;
  font-size: 1.15em;
  line-height: 1;
  letter-spacing: -0.01em;
}

.magnify-scene--won .magnify-prize--source,
.magnify-scene--won .magnify-prize--lens,
.magnify-scene--won .magnify-prize--lens-pinned,
.magnify-scene--won .magnify-exit-clip-layer {
  visibility: hidden;
}

.magnify-glass {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: var(--mag-glass-top-gap);
  width: var(--mag-sprite-w);
  height: var(--mag-sprite-h);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  /* left/top = lens centre */
  transform: translate(
    -50%,
    calc(var(--mag-lens-offset-y) * -1 - var(--mag-lens-size) / 2)
  );
}

.magnify-glass--dragging {
  cursor: grabbing;
}

.magnify-glass__zoom {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 36%;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.magnify-glass--exiting {
  z-index: 20;
  pointer-events: none;
  cursor: default;
}

.magnify-exit-clip-layer {
  position: absolute;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
  clip-path: circle(var(--exit-clip-r) at var(--exit-clip-x) var(--exit-clip-y));
  animation: magnify-exit-clip-grow 0.9s cubic-bezier(0.14, 0.88, 0.2, 1) forwards;
}

.magnify-prize--lens-pinned {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.2rem;
  width: max-content;
  min-width: min(100%, 19rem);
  max-width: calc(100% - 2.5rem);
  margin: 0;
  padding: 0 0.5rem;
  color: var(--reborn-heading);
  text-align: center;
  transform: translate(-50%, -50%) scale(var(--mag-text-scale));
  transform-origin: center center;
  filter: none;
}

.magnify-glass--exiting .magnify-glass__lens {
  animation: magnify-lens-grow 0.9s cubic-bezier(0.14, 0.88, 0.2, 1) forwards;
}

.magnify-glass--exiting .magnify-glass__frame {
  transform-origin: calc(var(--mag-lens-offset-x) + var(--mag-lens-size) / 2)
    calc(var(--mag-lens-offset-y) + var(--mag-lens-size) / 2);
  animation: magnify-frame-exit 0.9s cubic-bezier(0.14, 0.88, 0.2, 1) forwards;
}

@keyframes magnify-lens-grow {
  0% {
    width: var(--mag-lens-size);
    height: var(--mag-lens-size);
    left: var(--mag-lens-offset-x);
    top: var(--mag-lens-offset-y);
  }

  100% {
    width: calc(var(--mag-lens-size) * var(--exit-clip-scale, 5));
    height: calc(var(--mag-lens-size) * var(--exit-clip-scale, 5));
    left: calc(
      var(--mag-lens-offset-x) - var(--mag-lens-size) * (var(--exit-clip-scale, 5) - 1) / 2
    );
    top: calc(
      var(--mag-lens-offset-y) - var(--mag-lens-size) * (var(--exit-clip-scale, 5) - 1) / 2
    );
  }
}

@keyframes magnify-exit-clip-grow {
  0% {
    clip-path: circle(var(--exit-clip-r) at var(--exit-clip-x) var(--exit-clip-y));
  }

  100% {
    clip-path: circle(
        calc(var(--exit-clip-r) * var(--exit-clip-scale, 5)) at var(--exit-clip-x)
          var(--exit-clip-y)
      );
  }
}

@keyframes magnify-frame-exit {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: scale(var(--exit-clip-scale, 5));
    opacity: 0;
  }
}

.magnify-glass--won {
  visibility: hidden;
  pointer-events: none;
}

.magnify-glass__lens {
  position: absolute;
  z-index: 1;
  top: var(--mag-lens-offset-y);
  left: var(--mag-lens-offset-x);
  box-sizing: border-box;
  width: var(--mag-lens-viewport);
  min-width: var(--mag-lens-viewport);
  max-width: var(--mag-lens-viewport);
  height: var(--mag-lens-viewport);
  min-height: var(--mag-lens-viewport);
  max-height: var(--mag-lens-viewport);
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  contain: strict;
  transform: translateZ(0);
  clip-path: circle(var(--mag-clip-r) at 50% 50%);
  -webkit-clip-path: circle(var(--mag-clip-r) at 50% 50%);
  -webkit-mask-image: radial-gradient(
    circle var(--mag-clip-r) at center,
    #000 0 100%,
    transparent 100%
  );
  mask-image: radial-gradient(
    circle var(--mag-clip-r) at center,
    #000 0 100%,
    transparent 100%
  );
  background: rgba(255, 255, 255, 0.04);
  border: none;
  box-shadow: none;
}

.magnify-glass__lens-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  transform-origin: center center;
  filter: blur(0);
  pointer-events: none;
  transition: filter 0.2s ease;
}

.magnify-glass--dragging .magnify-glass__lens-text {
  filter: blur(0.5px);
}

.magnify-glass__lens::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    circle at 32% 26%,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.06) 42%,
    transparent 68%
  );
}

.magnify-glass__frame {
  position: absolute;
  z-index: 8;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.16))
    drop-shadow(0 14px 26px rgba(0, 0, 0, 0.22));
}

.magnify-prize--lens {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: max-content;
  max-width: none;
  margin: 0;
  padding: 0 0.35rem;
  box-sizing: border-box;
  color: var(--reborn-heading);
  text-align: center;
  opacity: 1;
  pointer-events: none;
  flex-shrink: 0;
}

.magnify-prize--lens .magnify-prize__line {
  width: auto;
}

/* —— Win popup —— */
.game__title {
  margin: 0 0 20px;
  font-family: 'uMedi', var(--font);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--reborn-heading);
  text-align: center;
}

.game__subtitle {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.25;
  color: var(--reborn-text);
}

.btn {
  display: block;
  width: 100%;
  max-width: 328px;
  margin: 0 auto;
  padding: 18px 32px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: 'uMedi', var(--font);
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  color: var(--reborn-white);
  background: var(--reborn-cta);
}

.btn--primary:hover:not(:disabled) {
  background: var(--reborn-cta-hover);
}

.btn--primary__gizzmo {
  color: var(--reborn-white);
  background: var(--gizzmo-cta);
}

.btn--primary__gizzmo:hover:not(:disabled) {
  background: var(--gizzmo-cta-hover);
}

.btn--primary__gizzmo:active:not(:disabled) {
  opacity: 0.92;
}

.win-popup__cta {
  color: var(--reborn-white);
  background: var(--gizzmo-cta);
}

.win-popup__cta:hover {
  background: var(--gizzmo-cta-hover);
}

.win-popup__cta:active {
  opacity: 0.92;
}


body.has-win-popup {
  overflow: hidden;
}

.win-popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.win-popup[hidden] {
  display: none;
}

.win-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(55, 60, 75, 0.55);
  backdrop-filter: blur(4px);
}

.win-popup__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 750px;
  padding: 36px 24px;
  border-radius: 16px;
  background: var(--reborn-white);
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 63, 70, 0.2);
}

.win-popup__header {
  margin: 0 0 24px;
}

.win-popup__header .game__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: 'uMedi', var(--font);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--reborn-heading);
}

.win-popup__header #winPopupSuccessTitle {
  font: inherit;
  color: inherit;
}

.win-popup__prize-box {
  width: 100%;
  max-width: 23.75rem;
  margin: 0 auto 1.5rem;
  padding: 1.5rem 1.25rem 2rem;
  border: 1px solid #e0e3e8;
  border-radius: 0.625rem;
  background: #f0f1f3;
  box-shadow: inset 0 1px 2px rgba(55, 60, 75, 0.06);
}

.win-popup__prize-value {
  margin: 0 0 6px;
  font-family: 'uMedi', var(--font);
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  line-height: 1.05;
  color: var(--reborn-heading);
}

.win-popup__prize-detail {
  margin-top: 1.25rem;
  margin-bottom: 0;
  font-family: 'uMedi', var(--font);
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  line-height: 1.3;
  color: var(--reborn-heading);
}

.win-popup__disclaimer {
  margin: 1.5rem auto 0;
  padding: 0 2px;
  max-width: 36rem;
  font-family: var(--font);
  font-size: 0.75rem;
  line-height: 1.4;
  color: #8a8f9a;
  text-align: center;
}

.win-popup__disclaimer a {
  color: inherit;
  text-decoration: none;
}

.win-popup__disclaimer a:hover,
.win-popup__disclaimer a:focus {
  text-decoration: underline;
}

.win-popup__disclaimer[hidden] {
  display: none;
}

.win-popup__disclaimer sup {
  font-size: 0.65em;
  vertical-align: super;
}

@media (min-width: 768px) {
  .win-popup__disclaimer {
    margin-top: 2.5rem;
    padding: 0;
  }

  body.has-reborn-header .page {
    padding: 24px;
  }

  .win-popup__header .game__title,
  .win-popup__header #winPopupSuccessTitle {
    font-size: 32px;
    line-height: 1.3;
  }

  .magnify-game__title {
    font-size: 32px;
    line-height: 1.3;
  }

  .magnify-scene {
    min-height: 24rem;
    max-height: 32rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .magnify-prize {
    transition: none;
  }

  .magnify-glass--exiting .magnify-glass__lens,
  .magnify-exit-clip-layer {
    animation: none;
  }

  .magnify-glass--exiting .magnify-glass__frame {
    animation: none;
    opacity: 0;
  }
}
