:root {
  --cream: #FBF5E8;
  --cream-2: #F3E6C9;
  --champagne: #E9D3A0;
  --gold: #D4AF37;
  --gold-hi: #FFF3C4;
  --gold-mid: #E8C25A;
  --gold-deep: #8A6418;
  --ink: #1A140C;
  --ink-2: #3A2C16;
  --black: #0B0906;
  --radius: 18px;
  /* compact sizes: shrink with viewport height so buttons 1-3 fit on the first screen */
  --avatar: clamp(84px, 13.5vh, 128px);
  --card-h: clamp(98px, 14.6vh, 126px);
  --pop: clamp(18px, 3vh, 28px);   /* how far the art sticks out above a card */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------- Background: cream satin + curtains + faint spade pattern ---------- */
.bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 50% 18%, rgba(255,240,200,.95) 0%, rgba(255,240,200,0) 70%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(226,196,130,.45) 0%, rgba(226,196,130,0) 70%),
    linear-gradient(180deg, #FFFBF2 0%, var(--cream) 45%, var(--cream-2) 100%);
}
.pattern {
  position: absolute; inset: 0; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath fill='%238A6418' d='M28 14c4 6 10 9 10 15a6 6 0 0 1-9 5l2 6h-6l2-6a6 6 0 0 1-9-5c0-6 6-9 10-15z'/%3E%3C/svg%3E");
  background-size: 56px 56px;
}
.curtain {
  position: absolute; top: 0; bottom: 0; width: min(24vw, 230px);
  background:
    repeating-linear-gradient(90deg,
      rgba(255,252,242,.95) 0px, rgba(240,222,180,.85) 9px, rgba(205,170,100,.55) 16px,
      rgba(240,222,180,.85) 23px, rgba(255,252,242,.95) 32px);
  box-shadow: inset 0 0 40px rgba(170,130,60,.25);
}
.curtain.left  { left: 0;  border-right: 2px solid rgba(212,175,55,.45);
  -webkit-mask: linear-gradient(90deg, #000 30%, rgba(0,0,0,.25) 100%); mask: linear-gradient(90deg, #000 30%, rgba(0,0,0,.25) 100%);
  border-bottom-right-radius: 60% 18%; }
.curtain.right { right: 0; border-left: 2px solid rgba(212,175,55,.45);
  -webkit-mask: linear-gradient(270deg, #000 30%, rgba(0,0,0,.25) 100%); mask: linear-gradient(270deg, #000 30%, rgba(0,0,0,.25) 100%);
  border-bottom-left-radius: 60% 18%; }
.valance {
  position: absolute; left: 0; right: 0; top: 0; height: 38px;
  background:
    radial-gradient(circle at 50% 0, rgba(255,250,235,1) 0 18px, rgba(220,190,120,.7) 19px 21px, transparent 22px) 0 0 / 44px 38px repeat-x,
    linear-gradient(180deg, rgba(233,211,160,.9), rgba(233,211,160,0));
  opacity: .9;
}

#ketupat { position: fixed; inset: 0; z-index: 1; pointer-events: none; width: 100%; height: 100%; }

/* ---------- Page column ---------- */
.page {
  position: relative; z-index: 2;
  width: 100%; max-width: 460px; margin: 0 auto;
  padding: 10px max(16px, env(safe-area-inset-left)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
  display: flex; flex-direction: column; align-items: center;
}

/* ---------- Marquee (black strip, gold text) ---------- */
.marquee {
  position: relative; width: 100%; overflow: hidden; border-radius: 999px;
  padding: 6px 0;
  background: linear-gradient(180deg, #2A2116 0%, var(--black) 60%, #1B150D 100%);
  border: 1.5px solid var(--gold);
  box-shadow: 0 6px 16px rgba(120,86,20,.28), inset 0 1px 0 rgba(255,243,196,.35);
}
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 26px; z-index: 1; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--black), rgba(11,9,6,0)); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--black), rgba(11,9,6,0)); }
.marquee-track { display: flex; width: max-content; animation: marquee var(--marquee-duration, 18s) linear infinite; }
.marquee.is-paused .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; }
.marquee-item {
  font-weight: 700; font-size: 14px; letter-spacing: .4px; white-space: nowrap; padding: 0 12px;
  color: #F4D277; text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.marquee-sep { color: var(--gold); font-size: 11px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Header: avatar + logo | divider | subtitles ---------- */
.hero { width: 100%; display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hero-left { flex: 0 0 46%; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.hero-divider {
  flex: 0 0 2px; align-self: stretch; margin: 8px 0; border-radius: 2px;
  background: linear-gradient(180deg, rgba(212,175,55,0), #D4AF37 20%, #8A6418 50%, #D4AF37 80%, rgba(212,175,55,0));
}
.hero-right { flex: 1; min-width: 0; text-align: left; }

/* ---------- Avatar ---------- */
.avatar-wrap { position: relative; width: var(--avatar); height: var(--avatar); }
.avatar-glow {
  position: absolute; inset: -40%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,110,.55) 0%, rgba(255,214,110,0) 65%);
}
.avatar-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(from var(--ang), #8A6418, #F7E08A, #FFF8D8, #D4AF37, #8A6418, #F7E08A, #FFF8D8, #D4AF37, #8A6418);
  animation: spinAng 6s linear infinite;
  box-shadow: 0 6px 18px rgba(120,86,20,.35);
}
.avatar {
  position: relative; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: radial-gradient(circle at 50% 40%, #2B2116 0%, #0B0906 75%);
  border: 2px solid #0B0906;
}

/* ---------- Logo (slow breathing pulse) ---------- */
.title { position: relative; margin-top: 10px; width: 100%; line-height: 0; }
.title img { position: relative; width: 100%; height: auto; animation: logoPulse 3s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(60,40,10,.35)); }
.logo-glow {
  position: absolute; left: 8%; right: 8%; top: 0; bottom: 0; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,210,90,.75) 0%, rgba(255,210,90,0) 70%);
  filter: blur(6px); opacity: .25; animation: glowPulse 3s ease-in-out infinite;
}
@keyframes logoPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes glowPulse { 0%, 100% { opacity: .2; transform: scale(.95); } 50% { opacity: .75; transform: scale(1.1); } }

.subtitle { font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--ink); letter-spacing: .1px; }
.subtitle2 { margin-top: 6px; font-size: 13.5px; font-weight: 600; line-height: 1.35; letter-spacing: .2px; color: var(--gold-deep); }

/* ---------- Buttons: glossy black, gold frame, light flowing around the border ---------- */
.buttons { width: 100%; display: flex; flex-direction: column; gap: 0; margin-top: 14px; }
.card {
  position: relative; display: block; width: 100%; height: var(--card-h);
  margin-top: calc(var(--pop) + 6px);
  border-radius: var(--radius);
  padding: 2px;                              /* = border thickness */
  background:
    conic-gradient(from var(--ang),
      #7A5714 0deg, #C9A24A 40deg, #FFF4C8 70deg, #FFFFFF 78deg, #FFF4C8 86deg, #C9A24A 115deg,
      #7A5714 180deg, #C9A24A 220deg, #FFF4C8 250deg, #FFFFFF 258deg, #FFF4C8 266deg, #C9A24A 295deg, #7A5714 360deg);
  animation: spinAng 4.5s linear infinite;
  box-shadow: 0 10px 22px rgba(70,48,10,.28), 0 0 0 1px rgba(255,240,190,.4);
  transition: transform .15s ease;
  cursor: pointer; text-align: left; border: 0; color: inherit;
}
.card:nth-child(2) { animation-delay: -1.1s; }
.card:nth-child(3) { animation-delay: -2.2s; }
.card:nth-child(4) { animation-delay: -3.3s; }
.card:active { transform: scale(.98); }
.card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@keyframes spinAng { to { --ang: 360deg; } }

.card-inner {
  position: relative; display: block; width: 100%; height: 100%; border-radius: calc(var(--radius) - 2px); overflow: hidden;
  background:
    radial-gradient(ellipse 70% 120% at 85% 50%, rgba(212,175,55,.22) 0%, rgba(212,175,55,0) 60%),
    linear-gradient(155deg, #2A2218 0%, #0E0B08 45%, #050403 70%, #1E1810 100%);
  box-shadow: inset 0 1px 0 rgba(255,243,196,.25), inset 0 0 0 1px rgba(212,175,55,.25);
}
.card.flip .card-inner {
  background:
    radial-gradient(ellipse 70% 120% at 15% 50%, rgba(212,175,55,.22) 0%, rgba(212,175,55,0) 60%),
    linear-gradient(205deg, #2A2218 0%, #0E0B08 45%, #050403 70%, #1E1810 100%);
}
/* diagonal sheen sweeping across the black surface */
.card-inner::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 34%; left: -50%;
  background: linear-gradient(100deg, rgba(255,240,190,0) 0%, rgba(255,240,190,.16) 45%, rgba(255,255,255,.28) 50%, rgba(255,240,190,.16) 55%, rgba(255,240,190,0) 100%);
  transform: skewX(-18deg);
  animation: sheen 5.5s ease-in-out infinite;
}
.card:nth-child(2) .card-inner::after { animation-delay: 1.2s; }
.card:nth-child(3) .card-inner::after { animation-delay: 2.4s; }
.card:nth-child(4) .card-inner::after { animation-delay: 3.6s; }
@keyframes sheen { 0%, 55% { left: -50%; } 100% { left: 130%; } }

.card-text {
  position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 60%;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 8px 6px 8px 16px;
}
.card.flip .card-text { left: auto; right: 0; width: 55%; align-items: flex-start; text-align: left; padding: 8px 12px 8px 4px; }
.label {
  font-weight: 800; font-size: 19px; line-height: 1.12; letter-spacing: .1px;
  background: linear-gradient(180deg, #FFF8DC 0%, #F6D77A 50%, #D9A93B 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.6));
}
.label.small { font-size: 15.5px; letter-spacing: .3px; }
.cta {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  min-height: 28px; padding: 3px 12px 3px 4px; border-radius: 999px;
  font-weight: 700; font-size: 11.5px; letter-spacing: .5px; color: #2A1E08; white-space: nowrap;
  background: linear-gradient(180deg, #FFF3C4 0%, #EBC55C 55%, #C9962C 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.7);
}
.card.flip .cta { align-self: flex-start; }
.cta svg { width: 21px; height: 21px; flex-shrink: 0; }
.cta .arrow { font-size: 15px; line-height: 1; margin-left: 1px; }
.card.is-popup .cta { animation: ctaPulse 1.8s ease-in-out infinite; }
@keyframes ctaPulse { 0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,.45), 0 0 0 0 rgba(255,214,110,.7); } 50% { box-shadow: 0 2px 6px rgba(0,0,0,.45), 0 0 0 6px rgba(255,214,110,0); } }

/* artwork pops out above the card top */
.card-art {
  position: absolute; z-index: 2; bottom: 2px; right: 4px;
  height: calc(var(--card-h) + var(--pop)); width: 44%;
  display: flex; align-items: flex-end; justify-content: center; pointer-events: none;
}
.card.flip .card-art { right: auto; left: 4px; }
.card-art img {
  max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
  border-bottom-left-radius: calc(var(--radius) - 2px); border-bottom-right-radius: calc(var(--radius) - 2px);
}
.card-art.float img { animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.sparkle {
  position: absolute; width: 10px; height: 10px; z-index: 3; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, rgba(255,230,150,.9) 30%, transparent 62%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: twinkle 2.4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.5); } 50% { opacity: 1; transform: scale(1.2); } }


/* ---------- Bonus popup ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px max(16px, env(safe-area-inset-left)); }
.modal[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(26,18,6,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .2s ease; }
.modal-sheet {
  position: relative; width: 100%; max-width: 400px; max-height: calc(100dvh - 40px); overflow: auto;
  border-radius: 20px; background: #FFFCF4; border: 2px solid var(--gold);
  box-shadow: 0 24px 50px rgba(0,0,0,.45);
  animation: popIn .28s cubic-bezier(.2,.9,.3,1.2);
}
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid rgba(255,243,196,.7); background: rgba(0,0,0,.55); color: #FFF3C4; font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-banner {
  display: flex; align-items: center; justify-content: center; padding: 26px 22px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(212,175,55,.35), rgba(212,175,55,0) 70%),
    linear-gradient(155deg, #2A2218 0%, #0B0906 60%, #1E1810 100%);
  border-bottom: 2px solid var(--gold);
}
.modal-banner img { width: 82%; height: auto; }
.modal-body { padding: 16px 18px 20px; }
.modal-tag {
  display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: #fff; background: linear-gradient(180deg, #D6342C, #A11B16);
}
.modal-title { margin-top: 8px; font-size: 18px; font-weight: 800; line-height: 1.3; color: var(--ink); }
.bonus-list { list-style: none; margin-top: 12px; display: grid; gap: 8px; counter-reset: b; }
.bonus-list li {
  counter-increment: b; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: linear-gradient(180deg, #FFF8E6, #F7EBCD); border: 1px solid rgba(212,175,55,.45);
}
.bonus-list li::before {
  content: counter(b); flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #FFF3C4;
  background: radial-gradient(circle at 35% 30%, #3A2E1C, #0B0906); border: 1.5px solid var(--gold);
}
.modal-cta {
  display: flex; align-items: center; justify-content: center; margin-top: 16px; min-height: 46px; border-radius: 999px;
  font-weight: 800; font-size: 14px; letter-spacing: .6px; color: #FFF3C4;
  background: linear-gradient(180deg, #2A2218, #0B0906); border: 2px solid var(--gold);
  box-shadow: 0 6px 16px rgba(70,48,10,.35);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* ---------- Small / short screens ---------- */
@media (max-width: 370px) {
  .label { font-size: 17px; }
  .label.small { font-size: 14px; }
  .cta { font-size: 10.5px; padding-right: 10px; }
  .subtitle { font-size: 14.5px; }
  .subtitle2 { font-size: 12.5px; }
  .card-text { padding-left: 13px; }
  .card.flip .card-text { padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
