/* Newness Thadingyut — oil lamps lighting up the Newness ē, in Newness Black + Orange */
:root {
  --ink: #1d1d1b;
  --night-top: #070707;
  --night-mid: #12110f;
  --night-low: #2a1a08;
  --card: rgba(29, 29, 27, 0.88);
  --card-line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #b5b5b0;
  --brand: #ff9c01;
  --brand-hover: #f08c00;
  --danger: #ff7a6b;
  --font: "Poppins", "Noto Sans Myanmar", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--night-top);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

.kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brand);
}
.hl { color: var(--brand); }
.kicker .my { letter-spacing: 0; font-size: 13px; }

/* ---------- Sky ---------- */
.sky {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night-mid) 55%, var(--night-low) 100%);
}
.stars { position: absolute; inset: 0; }
.star {
  position: absolute; border-radius: 50%; background: #fff;
  animation: twinkle var(--t, 4s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }
.moon {
  position: absolute; top: 9%; right: 12%;
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e6, #f3dfb2 60%, #d9bd84);
  box-shadow: 0 0 60px 18px rgba(255, 228, 170, .15);
  opacity: .9;
}
.horizon-glow {
  position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 156, 1, .22), transparent 70%);
}
.fireworks { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.ground {
  position: fixed; left: 0; bottom: 0; width: 100%; height: 22vh; min-height: 120px;
  z-index: 1; pointer-events: none;
}

/* ---------- Oil lamp (ဆီမီးခွက်) ---------- */
.diya-svg { display: block; width: 100%; height: auto; overflow: visible; }
.diya-svg .fl { transform-origin: 30px 28px; animation: flicker .9s ease-in-out infinite alternate; }
@keyframes flicker {
  0% { transform: scale(1, 1); opacity: .92; }
  100% { transform: scale(.86, 1.12); opacity: 1; }
}

/* ---------- Top & bottom bars ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 48px);
  pointer-events: none;
}
.brand-logo { width: 140px; height: auto; }
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px) calc(14px + env(safe-area-inset-bottom));
  align-items: center;
  font-size: 13px; color: var(--muted); line-height: 1.8;
  pointer-events: none;
}
.bottombar .btn { pointer-events: auto; }
.bar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn-sm { padding: 8px 18px; font-size: 13.5px; }

#lampCount { color: #fff; font-weight: 500; }
#lampCount b { color: var(--brand); font-size: 1.15em; }

/* ---------- Stage ---------- */
.stage {
  position: relative; z-index: 4;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 76px 16px 64px;
  text-align: center;
}
.title {
  margin: 4px 0 6px;
  font-size: clamp(22px, 3.8vw, 40px);
  font-weight: 700;
  line-height: 1.6;
}

/* The ē logo made of lamps. Spots are % positions inside the logo box. */
.logo-box {
  position: relative;
  height: min(46vh, 112vw);
  aspect-ratio: 208 / 256;
  margin: 10px 0 14px;
}
.logo-box > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .08;
  transition: opacity 1.5s, filter 1.5s;
}
body.complete .logo-box > img {
  opacity: .22;
  filter: drop-shadow(0 0 30px rgba(255, 156, 1, .9)) sepia(1) saturate(6) hue-rotate(-12deg);
}
.lamp {
  position: absolute;
  width: 10%;
  transform: translate(-50%, -62%);
  border: 0; padding: 0; background: none; cursor: pointer;
}
.lamp::before {
  content: ""; position: absolute; left: -90%; right: -90%; top: -100%; bottom: -40%;
  background: radial-gradient(circle, rgba(255, 170, 50, .42), transparent 62%);
  opacity: 0; transition: opacity .8s;
  pointer-events: none;
}
.lamp.lit::before { opacity: 1; }
.lamp:not(.lit) .fl { display: none; }
.lamp:not(.lit) .lip { fill: #3b2414; }
.lamp:not(.lit) { opacity: .75; }
.lamp:hover { filter: brightness(1.3); }
.lamp:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 8px; }
.lamp.ignite { animation: ignite 1.4s ease-out; }
@keyframes ignite {
  0% { filter: brightness(3) drop-shadow(0 0 18px #ffcf6b); transform: translate(-50%, -62%) scale(1.6); }
  100% { filter: none; transform: translate(-50%, -62%) scale(1); }
}
.lamp.mine::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: var(--brand);
}
/* Lamps lit after the logo is full sit along the ground */
.extra-lamps { position: fixed; left: 0; right: 0; bottom: 0; height: 22vh; z-index: 2; pointer-events: none; }
.extra-lamps .lamp { width: 30px; pointer-events: auto; }

/* The little flame that flies to your lamp */
.spark {
  position: fixed; z-index: 25; width: 22px; height: 34px; margin: -17px 0 0 -11px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 70%, #fffbe6, #ffd166 45%, rgba(255, 122, 0, 0) 75%);
  filter: drop-shadow(0 0 12px #ffb04a);
  pointer-events: none;
}

.hint-line { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600; font-size: 15px; line-height: 1.6;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--brand); color: var(--ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid var(--card-line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  animation: fadein .25s ease-out;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: relative;
  width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto;
  padding: 28px 24px 24px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--card-line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: up .3s ease-out;
}
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { margin: 6px 0 16px; font-size: 21px; line-height: 1.7; font-weight: 700; }
.sheet .lead { margin: 0 0 16px; color: var(--muted); line-height: 1.8; }
.sheet .lead b { font-weight: 600; }
.close {
  position: absolute; top: 12px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer;
}
.close:hover { background: rgba(255, 255, 255, .1); }

.counter { margin: 0; text-align: right; font-size: 12px; color: var(--muted); }
.suggest-label { margin: 10px 0 8px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.suggestion {
  text-align: left;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-line);
  background: rgba(255, 255, 255, .04);
  color: #e9e9e4; line-height: 1.7; font-size: 13px;
  cursor: pointer;
}
.suggestion:hover { border-color: var(--brand); background: rgba(255, 156, 1, .1); }

.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
input, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-line);
  background: rgba(0, 0, 0, .35);
  color: #fff; font-size: 16px; line-height: 1.7;
  outline: none;
}
textarea { resize: vertical; margin-bottom: 4px; }
input:focus, textarea:focus { border-color: var(--brand); }
#phoneInput { font-size: 20px; letter-spacing: .06em; }

.row { display: flex; gap: 10px; margin-top: 18px; }
.row .btn { flex: 1; }
.error { margin: 10px 0 0; color: var(--danger); font-size: 14px; line-height: 1.7; }

.result { text-align: center; padding: 8px 0 4px; }
.result .emoji { font-size: 48px; line-height: 1.2; }
.result .amount { margin: 6px 0; font-size: clamp(38px, 10vw, 52px); font-weight: 700; color: var(--brand); line-height: 1.2; }
.result .amount small { font-size: .4em; color: #fff; font-weight: 600; margin-left: 6px; }
.result p { margin: 8px 0; color: var(--muted); line-height: 1.8; }
.result h2 { margin: 6px 0; }
.result .btn { margin-top: 16px; }

/* ---------- Thank-you card ---------- */
#claimModal .sheet { max-width: 460px; }
.result h2 { font-size: 20px; }
.ty-frame { display: flex; justify-content: center; margin: 12px 0 10px; }
.ty-card {
  display: block;
  width: auto; max-width: 100%;
  max-height: min(56vh, 520px);
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 156, 1, .15);
}
.ty-loading {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 4 / 5; max-height: min(56vh, 520px);
  border-radius: 14px; background: rgba(255, 255, 255, .04);
  color: var(--muted); padding: 20px; line-height: 1.8;
}
.ty-amount { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ty-amount b { color: var(--brand); font-weight: 700; font-size: 17px; }
.ty-note { font-size: 13px; }
.ty-actions { margin-top: 14px; }
.ty-actions .btn { margin-top: 0; }
.btn-link { background: none; color: var(--muted); padding: 8px 12px; margin-top: 6px !important; font-weight: 500; font-size: 14px; }
.btn-link:hover { color: #fff; }

/* ---------- Reading a wish ---------- */
.wish-read {
  position: fixed; z-index: 15;
  left: 50%; top: 72px; transform: translateX(-50%);
  width: min(92vw, 380px);
  padding: 22px 22px 18px 92px;
  min-height: 110px;
  border-radius: 20px;
  background: rgba(253, 246, 232, .97);
  color: var(--ink);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(255, 156, 1, .2);
  animation: up .25s ease-out;
}
.wish-read-lamp { position: absolute; left: 20px; top: 26px; width: 52px; }
.wish-read-text { margin: 0; font-size: 16px; line-height: 1.85; font-weight: 500; }
.wish-read-meta { margin: 8px 0 0; font-size: 12.5px; color: #6b6b66; }
.wish-read .close { color: var(--ink); top: 6px; right: 6px; }
.wish-read .close:hover { background: rgba(0, 0, 0, .06); }

.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 30;
  padding: 10px 18px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--card-line);
  font-size: 14px; line-height: 1.7;
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .topbar .kicker { font-size: 10px; letter-spacing: .2em; }
  .bottombar .hint { display: none; }
  .bottombar { justify-content: space-between; }
  .moon { width: 46px; height: 46px; top: 12%; }
  .sheet { padding: 24px 18px 18px; }
  .suggestions { flex-wrap: nowrap; overflow-x: auto; margin: 0 -18px 6px; padding: 0 18px 6px; scrollbar-width: none; }
  .suggestion { white-space: nowrap; flex: none; }
  .row .btn { white-space: nowrap; padding: 12px 14px; }
}
@media (max-height: 700px) and (max-width: 640px) {
  .moon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .star, .diya-svg .fl, .lamp.ignite { animation: none; }
}
