@font-face {
  font-family: 'Noto Sans Myanmar';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/noto-sans-myanmar.woff2') format('woff2');
}

:root {
  --night-1: #120a24;
  --night-2: #1f1038;
  --night-3: #38184c;
  --cream: #fff6e2;
  --paper: #fff8e9;
  --paper-2: #ffefcf;
  --ink: #3a2418;
  --ink-soft: #6b5442;
  --gold: #ffcf6b;
  --gold-deep: #d98b23;
  --flame: #ff7a33;
  --ember: #ffab3d;
  --red: #c0392b;
  --line: rgba(120, 74, 26, 0.18);
  --shadow: 0 24px 50px rgba(6, 2, 16, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--cream);
  font-family: 'Noto Sans Myanmar', 'Myanmar Sangam MN', 'Padauk', 'Noto Sans', system-ui,
    -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  background:
    radial-gradient(900px 620px at 82% -8%, rgba(255, 171, 61, 0.16) 0%, transparent 62%),
    radial-gradient(700px 520px at 8% 22%, rgba(150, 96, 190, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 42%, var(--night-3) 78%, #4a1e46 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.night {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Moon */
.moon {
  position: absolute;
  top: -70px;
  right: -58px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fffbe4 0 34%, #ffe7ad 55%, rgba(255, 209, 130, 0) 74%);
  box-shadow: 0 0 90px rgba(255, 213, 130, 0.28);
  opacity: 0.6;
}

/* Stars */
.stars {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 16%, #fff6d8 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 27% 8%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 44% 19%, #fff9e6 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 63% 11%, #ffe7b5 50%, transparent 51%),
    radial-gradient(1.7px 1.7px at 78% 23%, #fff6d8 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 90% 9%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 8% 41%, #fff6d8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 36% 36%, #ffe9b0 50%, transparent 51%);
  animation: twinkle 5.5s ease-in-out infinite alternate;
}

.stars-two {
  background-image:
    radial-gradient(1.3px 1.3px at 18% 27%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 31%, #fff6d8 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 71% 17%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 84% 39%, #fff6d8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 5% 12%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 48% 5%, #fff9e6 50%, transparent 51%);
  animation-delay: -2.6s;
  animation-duration: 7s;
}

@keyframes twinkle {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 0.95;
  }
}

/* Hanging lanterns */
.lantern {
  position: absolute;
  top: 0;
  width: 46px;
  transform-origin: 50% 0;
  animation: sway 7s ease-in-out infinite alternate;
}

.lantern-one {
  left: 7%;
}

.lantern-two {
  right: -24px;
  animation-delay: -2.4s;
  animation-duration: 8.5s;
  opacity: 0.65;
}

.lantern-string {
  display: block;
  width: 1px;
  height: 74px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 217, 138, 0.55), rgba(255, 217, 138, 0.08));
}

.lantern-two .lantern-string {
  height: 34px;
}

.lantern-body {
  position: relative;
  display: block;
  width: 44px;
  height: 54px;
  margin: 0 auto;
  border-radius: 48% 48% 50% 50% / 38% 38% 62% 62%;
  background: radial-gradient(circle at 38% 32%, #fff0bd 0 12%, #ffb45a 40%, #e2682f 74%, #a83f22 100%);
  box-shadow: 0 0 26px rgba(255, 150, 60, 0.55), 0 0 60px rgba(255, 120, 40, 0.28);
}

.lantern-body::before,
.lantern-body::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 16px;
  height: 1px;
  background: rgba(92, 38, 16, 0.5);
  transform: translateX(-50%);
}

.lantern-body::before {
  top: 6px;
}

.lantern-body::after {
  bottom: 6px;
}

@keyframes sway {
  from {
    transform: rotate(-4deg);
  }
  to {
    transform: rotate(4deg);
  }
}

/* Thadingyut fire balloons */
.fire-balloon {
  position: absolute;
  bottom: -32vh;
  width: 72px;
  animation: rise linear infinite;
  opacity: 0.9;
}

.balloon-one {
  left: 1%;
  animation-duration: 42s;
  animation-delay: -9s;
  transform: scale(0.82);
  opacity: 0.75;
}

.balloon-two {
  right: 1%;
  animation-duration: 36s;
  animation-delay: -24s;
  transform: scale(0.64);
  opacity: 0.5;
}

.balloon-three {
  left: 40%;
  animation-duration: 50s;
  animation-delay: -33s;
  transform: scale(0.5);
  opacity: 0.4;
}

.envelope {
  position: relative;
  display: block;
  width: 58px;
  height: 68px;
  margin: 0 auto;
  border-radius: 50% 50% 46% 46%;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22) 0 38%, transparent 39%),
    radial-gradient(circle at 34% 26%, #fff3c4 0 6%, #ffb347 30%, #e2662c 70%, #a63c21 100%);
  box-shadow: inset -6px -8px 16px rgba(0, 0, 0, 0.18), 0 0 30px rgba(255, 140, 50, 0.35);
}

.flame {
  position: relative;
  z-index: 2;
  width: 12px;
  height: 18px;
  margin: -5px auto 0;
  border-radius: 50% 50% 48% 48% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 72%, #fff8d2 0 18%, #ffc23d 46%, #ff6a1f 78%, rgba(255, 90, 20, 0) 100%);
  filter: blur(0.4px);
  box-shadow: 0 0 20px rgba(255, 170, 50, 0.9), 0 0 40px rgba(255, 110, 30, 0.5);
  animation: flicker 0.55s ease-in-out infinite alternate;
}

.basket {
  position: relative;
  width: 16px;
  height: 11px;
  margin: 5px auto 0;
  border-radius: 2px 2px 5px 5px;
  background: linear-gradient(180deg, #6b3a20, #43200f);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.basket::before,
.basket::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 1px;
  height: 7px;
  background: rgba(255, 214, 150, 0.45);
}

.basket::before {
  left: 3px;
}

.basket::after {
  right: 3px;
}

@keyframes rise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.9);
  }
  50% {
    transform: translate3d(18px, -74vh, 0) scale(0.9);
  }
  100% {
    transform: translate3d(-10px, -148vh, 0) scale(0.9);
  }
}

@keyframes flicker {
  from {
    transform: scaleY(0.9) scaleX(1.05);
    opacity: 0.85;
  }
  to {
    transform: scaleY(1.1) scaleX(0.94);
    opacity: 1;
  }
}

/* Rising embers */
.embers {
  position: absolute;
  inset: 0;
}

.embers i {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffd27a;
  box-shadow: 0 0 10px rgba(255, 170, 60, 0.9);
  animation: ember-rise linear infinite;
}

.embers i:nth-child(1) {
  left: 12%;
  animation-duration: 12s;
  animation-delay: -2s;
}

.embers i:nth-child(2) {
  left: 28%;
  animation-duration: 16s;
  animation-delay: -7s;
}

.embers i:nth-child(3) {
  left: 47%;
  animation-duration: 13s;
  animation-delay: -4s;
}

.embers i:nth-child(4) {
  left: 63%;
  animation-duration: 18s;
  animation-delay: -11s;
}

.embers i:nth-child(5) {
  left: 78%;
  animation-duration: 14s;
  animation-delay: -6s;
}

.embers i:nth-child(6) {
  left: 92%;
  animation-duration: 17s;
  animation-delay: -13s;
}

@keyframes ember-rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-88vh) translateX(24px) scale(0.4);
    opacity: 0;
  }
}

/* Layout */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom));
}

.hero {
  text-align: center;
  padding: 4px 0 14px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 246, 226, 0.08);
  border: 1px solid rgba(255, 207, 107, 0.4);
  color: #ffe1a1;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 22px rgba(255, 180, 70, 0.18);
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 190, 90, 0.9);
  vertical-align: middle;
  animation: sparkle 2.6s ease-in-out infinite;
}

h1 {
  margin: 0 0 8px;
  color: #fff4d6;
  font-size: clamp(1.5rem, 6.2vw, 2.05rem);
  line-height: 1.7;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow: 0 0 26px rgba(255, 176, 70, 0.32), 0 2px 0 rgba(0, 0, 0, 0.35);
}

.info {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.85;
  text-align: center;
  text-wrap: pretty;
}

/* Slots */
.slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(18, 10, 36, 0.55);
  border: 1px solid rgba(255, 207, 107, 0.45);
  box-shadow: 0 0 24px rgba(255, 170, 60, 0.14), inset 0 0 18px rgba(255, 190, 90, 0.08);
  color: #f2dfbd;
  font-size: 0.9rem;
}

.slots strong {
  color: var(--gold);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 2px;
  text-shadow: 0 0 14px rgba(255, 190, 90, 0.5);
}

.slots-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 rgba(255, 171, 61, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(255, 171, 61, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 171, 61, 0);
  }
}

/* Prize pool */
.prizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 22px;
}

.chip {
  flex: 1 1 28%;
  min-width: 92px;
  padding: 9px 8px;
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 246, 226, 0.07);
  border: 1px solid rgba(255, 207, 107, 0.38);
  box-shadow: inset 0 0 18px rgba(255, 190, 90, 0.06);
}

.chip strong {
  display: block;
  color: #ffe3a4;
  font-size: 0.98rem;
  line-height: 1.4;
  white-space: nowrap;
}

.chip span {
  display: block;
  color: #cbb28c;
  font-size: 0.68rem;
}

/* Gift stage */
.stage {
  text-align: center;
  padding: 4px 0 18px;
  min-height: 268px;
}

.gift {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 176px;
  height: 176px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: gift-float 3.4s ease-in-out infinite;
}

.gift:focus-visible {
  outline: 3px solid rgba(255, 207, 107, 0.8);
  outline-offset: 6px;
  border-radius: 50%;
}

.gift-halo {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 80, 0.42) 0%, rgba(255, 140, 40, 0.16) 45%, transparent 70%);
  filter: blur(6px);
  animation: halo-pulse 2.4s ease-in-out infinite;
}

.gift-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 18px rgba(255, 176, 70, 0.35));
  transition: transform 0.18s ease;
}

.gift:hover .gift-svg {
  transform: scale(1.04) rotate(-1.5deg);
}

.gift:active .gift-svg {
  transform: scale(0.96);
}

.gift.is-loading .gift-svg {
  animation: gift-shake 0.5s ease-in-out infinite;
}

@keyframes gift-float {
  50% {
    transform: translateY(-7px);
  }
}

@keyframes halo-pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes gift-shake {
  0%,
  100% {
    transform: rotate(-2deg) scale(0.98);
  }
  50% {
    transform: rotate(2deg) scale(1.02);
  }
}

.gift-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe9ae;
  box-shadow: 0 0 10px rgba(255, 210, 120, 0.9);
  animation: sparkle 2.6s ease-in-out infinite;
}

.spark-one {
  top: 22%;
  left: 12%;
}

.spark-two {
  top: 12%;
  right: 18%;
  animation-delay: -0.9s;
  width: 4px;
  height: 4px;
}

.spark-three {
  bottom: 26%;
  right: 8%;
  animation-delay: -1.7s;
  width: 3px;
  height: 3px;
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.7);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.stage-title {
  margin: 2px 0 2px;
  color: #ffe6b0;
  font-size: 1.02rem;
  font-weight: 700;
}

.stage-sub {
  margin: 0;
  color: #c9b28f;
  font-size: 0.82rem;
}

.stage-error {
  margin: 12px auto 0;
  max-width: 340px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(192, 57, 43, 0.22);
  border: 1px solid rgba(255, 130, 100, 0.42);
  color: #ffd0c2;
  font-size: 0.84rem;
}

/* Paper cards */
.card {
  position: relative;
  margin-bottom: 18px;
  padding: 20px 16px 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf0 0%, var(--paper) 48%, var(--paper-2) 100%);
  color: var(--ink);
  border: 1px solid rgba(255, 216, 150, 0.7);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  scroll-margin-top: 16px;
}

.card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid rgba(217, 139, 35, 0.16);
  pointer-events: none;
}

.reveal {
  animation: pop-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  padding-top: 24px;
}

.congrats {
  margin: 0;
  text-align: center;
  color: #8a4b12;
  font-size: 0.98rem;
  font-weight: 700;
}

.reveal-info {
  padding: 0 2px;
  font-size: 0.86rem;
  line-height: 1.9;
}

.amount {
  margin: 0;
  text-align: center;
  font-size: clamp(2.9rem, 14vw, 3.9rem);
  line-height: 1.25;
  font-weight: 700;
  color: #b04a1a;
  background: linear-gradient(180deg, #e08a16 0%, #c2581c 55%, #9e301c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.01em;
}

.amount small {
  font-size: 1.05rem;
  font-weight: 700;
  margin-left: 4px;
}

.amount-sub {
  margin: -2px 0 0;
  text-align: center;
  color: #8a4b12;
  font-size: 0.95rem;
  font-weight: 700;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  color: #b9843c;
}

.divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185, 132, 60, 0.45), transparent);
}

.divider-gem {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(150deg, #ffe3a4, #d98b23);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(255, 190, 90, 0.65);
}

/* Form */
.field {
  display: block;
  margin-bottom: 14px;
}

.label {
  display: block;
  margin-bottom: 6px;
  color: #4a3020;
  font-size: 0.9rem;
  font-weight: 700;
}

.label em {
  color: #c0392b;
  font-style: normal;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: #fffdf7;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input:focus,
textarea:focus {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(217, 139, 35, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: #b8a894;
}

.hint {
  display: block;
  margin-top: 5px;
  color: #7c6650;
  font-size: 0.75rem;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button[type='submit'] {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(150deg, #e6642f 0%, #c0392b 52%, #a02720 100%);
  color: #fff6e2;
  font: inherit;
  font-size: 1.04rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(150, 45, 30, 0.35), inset 0 1px 0 rgba(255, 210, 150, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  touch-action: manipulation;
}

button[type='submit']:active {
  transform: translateY(2px) scale(0.996);
  box-shadow: 0 6px 14px rgba(150, 45, 30, 0.3);
}

button[type='submit']:disabled {
  cursor: progress;
  filter: saturate(0.7) brightness(1.03);
  opacity: 0.82;
}

.form-error {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(192, 57, 43, 0.09);
  border: 1px solid rgba(192, 57, 43, 0.28);
  color: #9b2f24;
  font-size: 0.86rem;
  line-height: 1.6;
}

.fineprint {
  margin: 12px 0 0;
  text-align: center;
  color: #7c6650;
  font-size: 0.73rem;
}

/* Success */
.success {
  text-align: center;
  padding-top: 28px;
  border-color: rgba(255, 207, 107, 0.85);
  box-shadow: var(--shadow), 0 0 34px rgba(255, 180, 70, 0.22);
  animation: pop-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.result-note {
  margin: 12px auto 0;
  max-width: 350px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.8;
}

.claim-meta {
  margin: 10px 0 0;
  color: #7c6650;
  font-size: 0.75rem;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

/* State */
.state {
  text-align: center;
  padding: 30px 20px;
}

.state-emoji {
  margin: 0 0 6px;
  font-size: 2.6rem;
  line-height: 1.2;
}

.state h2 {
  margin: 0 0 6px;
  color: #7a3c10;
  font-size: 1.12rem;
  line-height: 1.7;
}

.state p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.foot {
  margin-top: 8px;
  text-align: center;
  color: #b9a184;
  font-size: 0.76rem;
}

#fireworks {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

@media (min-width: 700px) {
  .shell {
    max-width: 460px;
    padding-top: 40px;
  }

  .card {
    padding: 24px 24px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stars,
  .lantern,
  .fire-balloon,
  .embers i,
  .flame,
  .gift,
  .gift-halo,
  .gift-spark,
  .slots-dot {
    animation: none;
    opacity: 1;
  }

  .gift,
  .gift-svg,
  .gift-halo {
    transform: none;
  }

  .reveal,
  .success {
    animation: none;
  }

  button[type='submit'],
  .gift-svg {
    transition: none;
  }
}
