/* Khmer localisation and single-spin overrides. Loaded after main.css so it can
   override the original rules without editing the minified sheet. */

/* ---------- typography -------------------------------------------------------
   Pinup-Black stays first so Latin digits and "USD" keep the display weight the
   layout was built around; Khmer has no glyphs there and falls through to Noto.
   Khmer stacks marks above and below the baseline, so every heading that main.css
   set to line-height 1 (or left at the 1.15 default) needs more room or the
   subscripts get clipped. */
body,
.main__titles,
.wheel__spinner-center,
.lights__content,
.bonus__kicker,
.bonus__title,
.bonus__amount {
  font-family: Pinup-Black, 'Noto Sans Khmer', sans-serif;
}

.title__link,
.bonus__note,
.bonus__fine,
.bonus__close {
  font-family: 'Kantumruy Pro', Roboto, sans-serif;
}

.main__titles .title__first-first,
.main__titles .title__first-second,
.main__titles .title__second-first,
.main__titles .title__second-second,
.lights__content-title,
.lights__content-subtitle,
.wheel__spinner-center,
.title__link {
  line-height: 1.55;
}

/* Khmer is a cluster script — letter-spacing splits the marks off their bases. */
.main__titles,
.lights__content,
.bonus {
  letter-spacing: normal;
}

/* ---------- preloader --------------------------------------------------------
   The original preloader was the Pin-up "P" GIF. Replaced with a neutral spinner. */
.preloader.hide { opacity: 0; }

.preloader__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border: 5px solid rgba(255, 255, 255, .16);
  border-top-color: #fdcd19;
  border-radius: 50%;
  animation: preloader-spin .9s linear infinite;
}

@keyframes preloader-spin { to { transform: rotate(360deg); } }

/* Removing the logo also removed the header's only pointer affordance. */
.header__left-logo { cursor: default; }

/* ---------- wheel -----------------------------------------------------------
   The face itself is swapped in main.css (img/wheel-az.png -> img/wheel-km.png), so
   the new Khmer artwork still shows if this stylesheet ever fails to load.

   One spin only. The USD 30 segment is centred at -22.5deg, so ending on
   1822.5deg (5 full turns + 22.5) parks it exactly under the pointer. */
@keyframes spinToPrize {
  0%   { transform: rotate(-3deg); }
  100% { transform: rotate(1822.5deg); }
}

.main__wheel.is-spinning .wheel__spinner-img,
.main__wheel.is-done .wheel__spinner-img {
  animation-name: spinToPrize;
  animation-duration: 5.4s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(.16, .78, .04, 1);
}

/* The spin button is spent once the prize is decided — it stops pulsing and shows the
   amount instead of an invitation to spin again. Full opacity: fading it out made the
   centre of the wheel look broken rather than disabled. */
.main__wheel.is-done .wheel__spinner-center {
  pointer-events: none;
  animation: none;
  font-size: 1.9vh;
}

@media (max-width: 900px) {
  .main__wheel.is-done .wheel__spinner-center { font-size: 2.6vw; }
}

/* ---------- prize dialog ----------------------------------------------------
   No inputs by design: one button, straight to the offer link. */
.bonus {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .35s ease-out;
}

.bonus[hidden] { display: none; }
.bonus.is-open { opacity: 1; }

.bonus__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.bonus__card {
  position: relative;
  width: 100%;
  max-width: 430px;
  box-sizing: border-box;
  padding: 34px 28px 26px;
  text-align: center;
  background: linear-gradient(180deg, #1b2016 0%, #090c07 100%);
  border: 3px solid transparent;
  border-radius: 16px;
  /* gold edge, matching the prize cards in the original design */
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-image:
    linear-gradient(180deg, #1b2016 0%, #090c07 100%),
    linear-gradient(135deg, #fdcd19 0%, #fff3b0 45%, #c9971a 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
  transform: translateY(18px) scale(.96);
  transition: transform .35s cubic-bezier(.2, .9, .2, 1);
}

.bonus.is-open .bonus__card { transform: none; }

.bonus__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  color: #8d9384;
  background: none;
  border: 0;
  cursor: pointer;
}

.bonus__close:hover { color: #fff; }

.bonus__kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.6;
  color: #00cfa6;
}

.bonus__title {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.5;
  font-weight: 400;
  color: #fff;
}

.bonus__amount {
  margin: 0 0 16px;
  font-size: 58px;
  line-height: 1.15;
  color: #fdcd19;
  text-shadow: 0 0 26px rgba(253, 205, 25, .5);
}

.bonus__note {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.75;
  color: #c3c9b8;
}

.bonus__cta {
  display: block;
  padding: 17px 18px;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: #ff2400;
  border-radius: 8px;
  animation: bonus-cta-pulse 1.9s ease-in-out infinite;
}

.bonus__cta:hover { background: #ff3d1d; }

@keyframes bonus-cta-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 36, 0, .5); }
  50%      { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(255, 36, 0, 0); }
}

.bonus__fine {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #7d8375;
}

@media (max-width: 600px) {
  .bonus__card { padding: 30px 20px 22px; }
  .bonus__amount { font-size: 46px; }
  .bonus__title { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .bonus__cta,
  .preloader__spinner { animation: none; }
  .main__wheel.is-spinning .wheel__spinner-img,
  .main__wheel.is-done .wheel__spinner-img { animation-duration: .01s; }
}
