@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter18pt-Medium.woff2') format('woff2'),
    url('/fonts/Inter18pt-Medium.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter18pt-Black.woff2') format('woff2'),
    url('/fonts/Inter18pt-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

:root {
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-left: env(safe-area-inset-left);
  --safe-area-right: env(safe-area-inset-right);
  --safe-area-bottom: env(safe-area-inset-bottom);
  --gold: #e6c84a;
  --purple: #54179d;
  --blue: #84a9e9;
  --field: #efefef;
  --text: #111111;
  --error: #ffdddd;
  --error-text: #7a1010;
  --success: #dcffe6;
  --success-text: #11612d;
  --cta: #e2c437;
  --design-w: 780;
  --design-h: 1686;
  --design-w-px: calc(var(--design-w) * 1px);
  --design-h-px: calc(var(--design-h) * 1px);
  --progress: 50%;
  --border-screen-radius: 12px;
  --scale: min(calc(100dvw / var(--design-w-px)),
      calc(100dvh / var(--design-h-px)));
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  font-size: 16px;
}

body {
  background: #1b1031;
}

button,
button * {
  -webkit-user-drag: none;
  user-drag: none;

  user-select: none;
  -webkit-user-select: none;

  -webkit-touch-callout: none;
}

img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.ignore-input {
  pointer-events: none;
}

.game {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);

  height: 100%;
  width: min(100vw,
      calc(100dvh * (var(--design-w) / var(--design-h))));

  overflow: hidden;
  z-index: 0;
}

#game-canvas {
  background-color: #000;
  width: 100%;
  height: 100%;
  padding: 0;
  display: block;
}

.game .rotate-message {
  position: absolute;
  inset: 0;

  display: none;
  z-index: 9999;

  width: 100%;
  height: 100%;

  background-color: #000;
}

.game .rotate-text {
  color: #fff;
  font-size: 18px;
  line-height: 50px;
  font-weight: 700;
  text-align: center;
}

.loading {
  height: 100%;
  overflow: hidden;
}

/* shared */

.screen-wrap {
  position: absolute;
  top: 0;
  left: 50%;

  width: calc(var(--design-w-px) * var(--scale));
  height: calc(var(--design-h-px) * var(--scale));

  transform: translateX(-50%);
  transform-origin: top center;

  border-radius: var(--border-screen-radius);
  overflow: hidden;

  margin: 0 auto;

  background: url('/images/background.png') center top / 100% 100% no-repeat;

  z-index: 1;
}

.screen-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 4px solid var(--gold);
  border-radius: var(--border-screen-radius);
  pointer-events: none;
  z-index: 101;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;

  width: var(--design-w-px);
  height: var(--design-h-px);

  transform: scale(var(--scale));
  transform-origin: top left;
}

.logo-wrap {
  position: relative;
  width: 100%;
  margin-top: 120px;
  text-align: center;
}

.logo {
  display: block;
  width: calc(264px * 0.9);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.title-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  transform: translate(-50%, calc(-50% - 200px));
  transform-origin: 50% 100%;
}

.title {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;

  transform-origin: 50% 10%;
  animation: titleBounce 1.5s ease-in-out infinite;
}

.offer {
  display: block;
  width: calc(724px * 0.7);
  height: auto;
  object-fit: contain;
  margin: 40px auto 0;
}

.loading .logo-wrap {
  margin-top: 80px;
}

.overlay {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  border-radius: var(--border-screen-radius);
}

.overlay.fade-in {
  animation: overlayFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.overlay.fade-out {
  animation: overlayFadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 10;
}

.back-btn img {
  display: block;
  width: 92px;
  height: 92px;
}

.terms {
  position: absolute;
  top: 22px;
  left: 20px;
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(46, 14, 94, 0.9);
  color: #d4c6eb;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.5;
}

/* loading */

.loading .loading-wrap {
  position: absolute;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: 50% 50%;
  width: 500px;
  text-align: center;
  animation:
    loadingFadeInUp 0.65s ease-out both 0.2s,
    loadingBounce 1.35s ease-in-out infinite 1s;
}

.loading .loading-label {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #000;
}

.loading .loading-bar {
  position: relative;
  width: 420px;
  height: 60px;
  margin: 0 auto;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.loading .loading-bar.done {
  animation: readyBarBounce 0.4s ease-in-out infinite;
  transform-origin: center;
}

.loading .loading-status {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.5); /* overlay */

  z-index: 9999;

  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.loading .loading-status.active {
  visibility: visible;
  opacity: 1;
}

.loading .loading-status .message {
  width: 80%;
  max-width: 500px;

  padding: 24px 28px;

  background: #ffffff;
  border-radius: 16px;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);

  color: #333;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.loading .loading-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: translateX(calc(var(--progress) - 100%));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f4dd64, #d9b42e);
  color: #2e1464;
  font-size: 32px;
  font-weight: 900;
}

.loading .loading-fill.center {
  justify-content: center;
  padding-right: 0;
  text-align: center;
}

.loading .loading-fill.done {
  background:#fff;
  color: #000;
}

.loading .challenge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  text-align: center;
  transform: translate(-50%, -80px);
}

.loading .challenge h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 900;
  animation: fadeInUp 0.65s ease-out both;
}

.loading .challenge p {
  margin: 10px auto 0;
  max-width: 620px;
  font-size: 32px;
  line-height: 1.16;
  font-weight: 700;
  animation: fadeInUp 0.65s ease-out both 0.1s;
}

.loading .prize-wrap {
  margin: 10px auto 0;
  position: relative;
  display: inline-block;
  overflow: hidden;
  transform-origin: center center;
  animation:
    fadeInUp 0.65s ease-out both 0.4s,
    prizeBounce 1.6s ease-in-out infinite 0.4s;
}

.loading .prize {
  display: block;
  width: calc(667px * 0.8);
  height: calc(107px * 0.8);
}

.loading .prize-wrap::after {
  content: "";
  position: absolute;
  left: calc(15px * 0.8);
  top: calc(17px * 0.8);
  width: calc(637px * 0.8);
  height: calc(73px * 0.8);
  background: linear-gradient(110deg,
      transparent 35%,
      rgba(255, 255, 255, 0) 44%,
      rgba(255, 255, 255, 0.9) 50%,
      rgba(255, 255, 255, 0) 56%,
      transparent 65%);
  mix-blend-mode: screen;
  opacity: 0.9;
  pointer-events: none;
  -webkit-mask: url("/images/prize-info-no-glow.png") center / 100% 100% no-repeat;
  mask: url("/images/prize-info-no-glow.png") center / 100% 100% no-repeat;
  animation: prizeShine 3s ease-in-out infinite;
}

.loading .ball {
  --ballMoveFactor: 0.1;

  position: absolute;
  right: 86px;
  bottom: 120px;
  width: calc(964px * 0.9);
  height: calc(494px * 0.9);
  background: url('/images/ball.png') center / contain no-repeat;
  transform-origin: 87% 30%;
  animation:
    ballFadeIn 0.65s ease-out both 0.3s,
    ballSpeedMove 0.4s cubic-bezier(.6, .85, .28, 1) infinite;
}

.loading .logo-wrap {
  animation: fadeInUp 0.65s ease-out both;
}

/* entry */
.entry {
  position: absolute;
  inset: 0;

  width: 100vw;
  height: 100dvh;

  display: flex;
  justify-content: center;
  align-items: flex-start;

  overflow-y: auto;
  overflow-x: hidden;
}

.entry .logo-wrap,
.entry .score-box,
.entry .form-wrap,
.entry .field-row,
.entry .submit-wrap {
  opacity: 0;
  transform: translateY(calc(60px * var(--scale)));
}

.entry::-webkit-scrollbar {
  display: none;
}

.entry .screen-wrap {
  position: relative;

  flex: 0 0 auto;

  left: auto;
  right: auto;
  top: auto;

  width: min(100vw,
      calc(100dvh * (var(--design-w) / var(--design-h))));

  max-width: 100%;
  height: auto;

  margin: 0;
  padding: 0;

  transform: none;
  translate: 0 0;

  overflow: visible;
  z-index: 2;

  overflow: hidden;
}

.entry .screen {
  position: relative;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* top align */
  align-items: stretch;

  width: 100%;
  min-height: 100dvh;
  height: auto;

  margin: 0;
  padding: 0;

  transform: none;
  transform-origin: initial;

  overflow: visible;
}

.entry .screen-wrap.show,
.entry .screen-wrap .show {
  animation: modalShow 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.entry .screen-wrap.hide,
.entry .screen-wrap .hide {
  animation: modalHide 0.5s cubic-bezier(0.7, 0, 1, 0.5) both;
}

.entry .logo-wrap {
  margin-top: calc(80px * var(--scale));
  animation: fadeInUp 0.5s ease-out forwards;
}

.entry .offer {
  width: calc(724px * 0.7 * var(--scale));
}

.entry .back-btn img {
  width: calc(92px * var(--scale));
  height: calc(92px * var(--scale));
}

.entry .form-wrap {
  position: relative;
  width: 100%;
  margin-top: calc(20px * var(--scale));
  padding: calc(26px * var(--scale)) 0 calc(80px * var(--scale));
  animation: fadeInUp 0.6s ease-out forwards 0.2s;
}

.entry .score-box {
  width: calc(100% - 248px * var(--scale));
  min-height: calc(66px * var(--scale));
  margin: 0 auto calc(10px * var(--scale));
  border: calc(2px * var(--scale)) solid rgba(181, 128, 229, 0.55);
  border-radius: calc(14px * var(--scale));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(38px * var(--scale));
  color: #fff;
  background: rgba(83, 22, 156, 0.4);
  font-weight: 700;
  animation: fadeInUp 0.5s ease-out forwards 0.1s;
}

.entry .score-label {
  font-size: calc(35px * var(--scale));
  line-height: 1;
}

.entry .score-value {
  font-size: calc(43px * var(--scale));
  line-height: 1;
  font-weight: 900;
  letter-spacing: calc(0.5px * var(--scale));
}

.entry form {
  width: 100%;
}

.entry .field-row {
  padding: calc(30px * var(--scale)) 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.entry .field-row:nth-child(1) {
  animation-delay: 0.25s;
}

.entry .field-row:nth-child(2) {
  animation-delay: 0.3s;
}

.entry .field-row:nth-child(3) {
  animation-delay: 0.35s;
}

.entry .field-row:nth-child(4) {
  animation-delay: 0.4s;
}

.entry .field-row:nth-child(5) {
  animation-delay: 0.45s;
}

.entry .field-row:nth-child(6) {
  animation-delay: 0.5s;
}

.entry .checks .field-row:nth-child(1) {
  animation-delay: 0.6s;
}

.entry .checks .field-row:nth-child(2) {
  animation-delay: 0.65s;
}

.entry .checks .field-row:nth-child(3) {
  animation-delay: 0.7s;
}

.entry .field-row.band {
  position: relative;
}

.entry .field-row.band::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(117px * var(--scale));
  background: url("/images/line-item.png") repeat-x bottom / auto calc(117px * var(--scale));
  pointer-events: none;
  z-index: 0;
}

.entry .field-row.band>* {
  position: relative;
  z-index: 1;
}

.entry .field-inner {
  width: calc(100% - 100px * var(--scale));
  margin: 0 auto;
}

.static-field,
.text-field {
  width: 100%;
  min-height: calc(64px * var(--scale));
  border: 0;
  border-radius: calc(12px * var(--scale));
  background: var(--field);
  color: #000;
  text-align: center;

  font-size: calc(34px * var(--scale)) !important;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;

  outline: none;
  padding: calc(10px * var(--scale)) calc(18px * var(--scale));

  appearance: none;
  -webkit-appearance: none;
}

.entry .text-field:focus {
  box-shadow: 0 0 0 calc(4px * var(--scale)) rgba(84, 23, 157, 0.2);
}

.entry .error-message {
  display: none;
  margin: calc(12px * var(--scale)) auto;
  width: calc(100% - 100px * var(--scale));
  box-sizing: border-box;
  border-radius: calc(10px * var(--scale));
  padding: calc(10px * var(--scale)) calc(14px * var(--scale));
  background: var(--error);
  color: var(--error-text);
  font-size: calc(24px * var(--scale));
  font-weight: 700;
  text-align: center;
}

.entry .field-row.error .text-field,
.entry .checkbox-row.error .checkbox-input {
  border: calc(3px * var(--scale)) solid rgba(122, 16, 16, 0.65);
}

.entry .field-row.error .error-message,
.entry .checkbox-row.error .error-message {
  display: block;
}

.entry .checks {
  padding: calc(8px * var(--scale)) 0 calc(8px * var(--scale));
  position: relative;
  z-index: 2;
}

.entry .checkbox-row {
  width: 100%;
  margin-left: calc(10px * var(--scale));
  display: grid;
  grid-template-columns: calc(52px * var(--scale)) 1fr;
  gap: calc(22px * var(--scale));
  align-items: center;
  position: relative;
}

.entry .checkbox-wrap {
  width: calc(52px * var(--scale));
  height: calc(52px * var(--scale));
  display: flex;
  align-items: center;
  justify-content: center;
}

.entry .checkbox-input {
  appearance: none;
  -webkit-appearance: none;
  width: calc(34px * var(--scale));
  height: calc(34px * var(--scale));
  margin: 0;
  border: calc(3px * var(--scale)) solid rgba(0, 0, 0, 0.45);
  border-radius: calc(8px * var(--scale));
  background: #ffffff;
  cursor: pointer;
  display: inline-block;
  position: relative;
  box-shadow: 0 calc(1px * var(--scale)) calc(4px * var(--scale)) rgba(0, 0, 0, 0.12);
}

.entry .checkbox-input:checked {
  background: #ffffff;
  border-color: var(--purple);
}

.entry .checkbox-input:checked::after {
  content: "";
  position: absolute;
  left: calc(9px * var(--scale));
  top: calc(3px * var(--scale));
  width: calc(8px * var(--scale));
  height: calc(16px * var(--scale));
  border-right: calc(4px * var(--scale)) solid var(--purple);
  border-bottom: calc(4px * var(--scale)) solid var(--purple);
  transform: rotate(45deg);
}

.entry .checkbox-input:focus-visible {
  outline: calc(3px * var(--scale)) solid rgba(84, 23, 157, 0.25);
  outline-offset: calc(2px * var(--scale));
}

.entry .checkbox-label {
  font-size: calc(29px * var(--scale));
  line-height: 1.25;
  color: #000;
}

.entry .checkbox-label a {
  color: inherit;
}

.entry .form-status {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 50;
}

.entry .form-status.is-visible {
  display: flex;
}

.entry .form-status.result .result-content,
.entry .form-status.progress .progress-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(30px * var(--scale));
  text-align: center;
}

.entry .form-status.result .result-message,
.entry .form-status.progress .progress-message {
  color: #fff;
  font-size: calc(32px * var(--scale));
  font-weight: 700;
  text-align: center;
  margin-bottom: calc(30px * var(--scale));
}

.entry .submit-wrap {
  width: calc(614px * var(--scale));
  height: calc(147px * var(--scale));
  margin: calc(10px * var(--scale)) auto calc(30px * var(--scale));
  position: relative;
  overflow: visible;
  animation: fadeInUp 0.5s ease-out forwards 1.2s;
}

.entry .default-btn {
  position: relative;
  width: calc(600px * var(--scale));
  height: calc(147px * var(--scale));
  padding: 0;
  border: none;
  background: url("/images/button-default.png") no-repeat center / contain;
  cursor: pointer;
}

.entry .default-btn::before {
  content: "";
  position: absolute;
  top: calc(-120px * var(--scale));
  right: calc(-100px * var(--scale));
  bottom: calc(-120px * var(--scale));
  left: calc(-120px * var(--scale));
  background: url("/images/button-default-glow.png") no-repeat center / contain;
  pointer-events: none;
  z-index: -1;
}

.entry .default-btn .label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: calc(32px * var(--scale));
  color: #fff;
  white-space: nowrap;
}

/* terms */

.entry .terms-panel {
  width: calc(100% - 60px * var(--scale));
  margin: calc(100px * var(--scale)) auto calc(40px * var(--scale));
  background: #ffffff;
  border-radius: calc(20px * var(--scale));
  overflow: hidden;
  box-shadow: 0 calc(10px * var(--scale)) calc(40px * var(--scale)) rgba(0, 0, 0, 0.3);
}

.entry .terms-content {
  height: 100%;
  overflow-y: auto;
  padding: calc(30px * var(--scale));
  color: #111;
  font-size: calc(20px * var(--scale));
  line-height: 1.5;
}

.entry .terms-content h1 {
  margin-top: 0;
  margin-bottom: calc(20px * var(--scale));
  font-size: calc(32px * var(--scale));
  font-weight: 900;
  text-align: center;
}

.entry .terms-content p {
  margin-bottom: calc(18px * var(--scale));
  font-size: calc(24px * var(--scale));
}

/* animations */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(calc(36px * var(--scale)));
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes ballFadeIn {
  from {
    opacity: 0;
    translate: 0 36px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes loadingBounce {

  0%,
  100% {
    scale: 1;
  }

  45% {
    scale: 1.02;
  }

  70% {
    scale: 0.98;
  }
}

@keyframes loadingFadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(calc(36px * var(--scale)));
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes prizeBounce {

  0%,
  100% {
    scale: 1;
  }

  45% {
    scale: 1.02;
  }

  70% {
    scale: 0.99;
  }
}

@keyframes ballSpeedMove {
  0% {
    translate: 0 0;
    scale: 1;
  }

  40% {
    translate: calc(-12px * var(--ballMoveFactor)) calc(-10px * var(--ballMoveFactor));
    scale: 1.03 0.97;
  }

  60% {
    translate: calc(-16px * var(--ballMoveFactor)) calc(-13px * var(--ballMoveFactor));
    scale: 1.02 0.98;
  }

  100% {
    translate: 0 0;
    scale: 1;
  }
}

@keyframes prizeShine {
  0% {
    background-position: -240px 0;
  }

  100% {
    background-position: 260px 0;
  }
}

@keyframes modalShow {
  from {
    transform: translateY(100vh);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes modalHide {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100vh);
  }
}

@keyframes overlayFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes readyBarBounce {
  0%, 100% {
    transform: translateX(0) scaleX(1);
  }

  50% {
    transform: translateX(0) scaleX(1.04);
  }
}

@keyframes titleBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-16px) scale(1.04);
  }
}

@media (max-width: 768px) {
  :root {
    --safe-area-top: calc(env(safe-area-inset-top) + 10px);
  }
}
