* {
  box-sizing: border-box;
}

:root {
  --gold: #f2d68a;
  --gold-dark: #b9822d;
  --blue-dark: #070b1a;
  --blue-card: rgba(10, 16, 36, 0.76);
  --white-soft: rgba(255, 255, 255, 0.86);
  --white-muted: rgba(255, 255, 255, 0.58);
  --portal-zoom: 2.25;
}

html {
  min-height: 100%;
  background: #050814;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: #fff;
  background: #050814;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.62) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,220,150,0.40) 1px, transparent 1px);
  background-size: 78px 78px, 132px 132px;
  opacity: 0.12;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 42px);
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

body.is-ready .app {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.bg-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, #080d1f 0%, #111936 46%, #050814 100%),
    url('../img/heavenly_city_bg.png') center center / cover no-repeat;
}

.bg-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) brightness(0.92);
  transform: scale(1.01);
}

.bg-video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(120, 155, 255, 0.20), transparent 34%),
    radial-gradient(circle at 82% 28%, rgba(242, 214, 138, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(5, 8, 20, 0.08) 0%, rgba(5, 8, 20, 0.10) 42%, rgba(5, 8, 20, 0.38) 100%);
  pointer-events: none;
}

.moon {
  position: fixed;
  top: clamp(24px, 6vw, 56px);
  right: clamp(24px, 10vw, 180px);
  width: clamp(86px, 12vw, 140px);
  height: clamp(86px, 12vw, 140px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff9dc, #d9bb72 58%, #715926 100%);
  box-shadow:
    0 0 50px rgba(245, 214, 139, 0.35),
    0 0 110px rgba(245, 214, 139, 0.14);
  opacity: 0.88;
}

.card {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(28px, 4vw, 38px) clamp(22px, 4vw, 32px) clamp(24px, 4vw, 30px);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(14, 22, 50, 0.82), rgba(7, 12, 29, 0.76));
  border: 1px solid rgba(242, 210, 140, 0.48);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.48),
    0 0 70px rgba(242, 214, 138, 0.10),
    inset 0 0 58px rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12), transparent 35%),
    radial-gradient(circle at top, rgba(242, 214, 138, 0.10), transparent 44%);
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.label {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(217, 181, 107, 0.15);
  border: 1px solid rgba(217, 181, 107, 0.50);
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 38px);
  line-height: 1.08;
  font-weight: 700;
  text-shadow: 0 4px 20px rgba(0,0,0,0.28);
}

.subtitle {
  margin: 0 0 24px;
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 2vw, 16px);
  line-height: 1.58;
  color: var(--white-soft);
}

.reward {
  margin: 22px 0;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.090), rgba(255,255,255,0.035));
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-family: Arial, sans-serif;
  line-height: 1.42;
}

.reward strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 18px;
}

input {
  width: 100%;
  margin-top: 8px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.105);
  color: #fff;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.16);
}

input:focus {
  border-color: rgba(242, 214, 138, 0.66);
  box-shadow:
    0 0 0 3px rgba(242, 214, 138, 0.10),
    inset 0 0 20px rgba(0,0,0,0.16);
}

input::placeholder {
  color: rgba(255,255,255,0.46);
}

button {
  width: 100%;
  margin-top: 14px;
  padding: 15px 18px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  background: linear-gradient(90deg, #c99b43, #f4d88d, #c99b43);
  color: #211500;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    0 10px 30px rgba(214, 173, 96, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.34);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.status {
  min-height: 24px;
  margin-top: 16px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  color: var(--white-soft);
}

.status.success {
  color: #b9ffd0;
}

.status.error {
  color: #ffb7b7;
}

.final {
  display: none;
  margin-top: 22px;
  padding: 20px 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(247, 217, 136, 0.13), rgba(247, 217, 136, 0.060));
  border: 1px solid rgba(247, 217, 136, 0.36);
  font-family: Arial, sans-serif;
  line-height: 1.55;
  animation: finalIn 0.45s ease both;
}

.final h2 {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}

.final p {
  margin: 10px 0 0;
  color: var(--white-soft);
}

.footer {
  margin-top: 22px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.52);
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  overflow: hidden;
  background: #030714;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.portal-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #030714;
  transform: scale(1);
  filter: brightness(1);
  transition:
    transform 1.65s cubic-bezier(.16,.84,.28,1),
    filter 1.65s ease;
}

.portal-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.portal-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.preloader.is-entering .portal-layer {
  transform: scale(var(--portal-zoom));
  filter: brightness(2.25) blur(1.2px);
}

.loader-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(18px, 4vw, 32px) clamp(34px, 5vw, 48px);
  background:
    linear-gradient(180deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.10) 42%, rgba(0,0,0,0.62) 100%);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

.preloader.is-entering .loader-overlay {
  opacity: 0;
  transform: translateY(16px);
}

.loader-phrase {
  position: absolute;
  left: 50%;
  bottom: clamp(92px, 13vh, 126px);
  width: min(820px, calc(100vw - 48px));
  transform: translateX(-50%);
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 600;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 2px 14px rgba(0,0,0,0.9),
    0 0 20px rgba(255,255,255,0.12);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.loader-phrase.is-changing {
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}

.loader-bottom {
  width: min(680px, calc(100vw - 56px));
  margin: 0 auto;
}

.loader-percent {
  margin-bottom: 10px;
  text-align: right;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.85);
}

.loader-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    0 0 22px rgba(0,0,0,0.45),
    inset 0 0 12px rgba(0,0,0,0.25);
}

.loader-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #b88a34, #f5d98c, #fff6c9);
  box-shadow:
    0 0 18px rgba(245, 217, 140, 0.65),
    0 0 34px rgba(245, 217, 140, 0.28);
}

.heaven-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at center,
      rgba(255,255,255,1) 0%,
      rgba(255,250,220,0.98) 18%,
      rgba(255,240,170,0.82) 34%,
      rgba(255,255,255,0.32) 58%,
      rgba(255,255,255,0) 78%
    );
  transform: scale(0.84);
}

.preloader.is-entering .heaven-flash {
  animation: portalFlash 1.75s ease forwards;
}

@keyframes portalFlash {
  0% {
    opacity: 0;
    transform: scale(0.84);
  }

  34% {
    opacity: 0.72;
    transform: scale(1.02);
  }

  66% {
    opacity: 1;
    transform: scale(1.18);
  }

  100% {
    opacity: 0;
    transform: scale(1.36);
  }
}

@keyframes finalIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .loader-bottom {
    width: calc(100vw - 36px);
  }
}

@media (max-height: 620px) {
  .app {
    align-items: flex-start;
  }

  .card {
    margin: 20px 0;
  }

  .loader-phrase {
    bottom: 82px;
  }

  .loader-overlay {
    padding-bottom: 26px;
  }
}


.start-gate {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 12%, rgba(242, 214, 138, 0.18), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(120, 155, 255, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(4, 7, 18, 0.96), rgba(8, 13, 31, 0.94));
  opacity: 1;
  visibility: visible;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.start-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-gate-card {
  width: min(460px, 100%);
  padding: 30px 24px;
  border-radius: 26px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(14, 22, 50, 0.84), rgba(7, 12, 29, 0.78));
  border: 1px solid rgba(242, 210, 140, 0.46);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.52),
    0 0 70px rgba(242, 214, 138, 0.10),
    inset 0 0 58px rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.start-gate-label {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(217, 181, 107, 0.15);
  border: 1px solid rgba(217, 181, 107, 0.50);
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.start-gate-card h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 34px);
  line-height: 1.1;
}

.start-gate-card p {
  margin: 0 0 20px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--white-soft);
}

.start-gate-card button {
  max-width: 100%;
}
