/* Nexta Diwali — public styles (mobile-first, no framework). */
:root {
  --bg: #070b14;
  --ink: #fff4e4;
  --muted: #c9bfd6;
  --gold: #ffb85c;
  --gold-2: #ffd27a;
  --ember: #ff7a3d;
  --panel: rgba(22, 16, 38, 0.92);
  --line: rgba(255, 220, 170, 0.16);
  --wa: #1fbf5c;
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Noto Serif", "Times New Roman", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.is-experience { overflow: hidden; height: 100%; overscroll-behavior: none; }
[x-cloak] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 0; border-radius: 999px; padding: .8rem 1.4rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, opacity .2s; }
.btn svg { width: 1.25em; height: 1.25em; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.08rem; min-height: 56px; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(180deg, #ffc777, var(--gold)); color: #2a1406; box-shadow: 0 8px 30px rgba(255, 160, 60, .35), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-primary:hover { box-shadow: 0 10px 38px rgba(255, 160, 60, .5), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-glow { position: relative; }
.btn-glow::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 1.5px solid rgba(255, 200, 120, .55); animation: ring 2.4s ease-out infinite; pointer-events: none; }
.btn-whatsapp { background: var(--wa); color: #fff; box-shadow: 0 8px 26px rgba(31, 191, 92, .35); }
.text-btn { background: none; border: 0; color: var(--muted); padding: .55rem .8rem; cursor: pointer; font-size: .95rem; text-decoration: none; border-radius: 999px; }
.text-btn:hover { color: var(--ink); }
.text-btn--gold { color: var(--gold-2); font-weight: 600; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 8, 20, .45); backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 999px; padding: .45rem .9rem; cursor: pointer; font-size: .85rem; white-space: nowrap; }

@keyframes ring { 0% { opacity: .9; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.12); } }
@keyframes flicker { 0%, 100% { transform: scaleY(1) translateY(0); } 25% { transform: scaleY(1.06) translateY(-1px) skewX(2deg); } 50% { transform: scaleY(.95); } 75% { transform: scaleY(1.04) skewX(-2deg); } }
@keyframes pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes rise { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-110vh); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }

/* ------------------------------------------------------- 3D experience */
.xp { position: fixed; inset: 0; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.45) 100%); }

.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) 14px 10px; z-index: 5; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar-actions { position: absolute; right: 12px; top: max(12px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 6px; }
.brand-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem .35rem .4rem; border-radius: 999px; text-decoration: none; font-size: .88rem; font-weight: 500; color: var(--ink); background: rgba(10, 8, 20, .35); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.logo-mark { width: 24px; height: 24px; }
.xp .brand-badge { margin-right: auto; margin-left: 0; }
@media (min-width: 640px) { .xp .brand-badge { margin: 0 auto; } }

/* hint pill anchored to a 3D object */
.hint { position: absolute; left: 0; top: 0; z-index: 4; border: 0; background: none; padding: 0; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .4s; will-change: transform; }
.hint.is-visible { opacity: 1; pointer-events: auto; }
.hint-pill { position: absolute; left: 0; top: 0; transform: translate(-50%, -150%); display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; background: var(--gold); color: #2a1406; font-weight: 600; font-size: .9rem; padding: .5rem .9rem; border-radius: 999px; box-shadow: 0 6px 22px rgba(255, 150, 50, .45); animation: pulse 1.6s ease-in-out infinite; }
.hint-pill svg { width: 18px; height: 18px; }
.hint-ring { position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 2px solid rgba(255, 210, 140, .9); animation: ring 1.6s ease-out infinite; }

/* loading / intro */
.intro { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; text-align: center; padding: 24px; background: radial-gradient(80% 60% at 50% 40%, #1b1236 0%, #0a0918 60%, #05060d 100%); }
.intro-inner { max-width: 440px; }
.intro-diya { width: 120px; margin: 0 auto 8px; }
.diya-flame { transform-origin: 60px 60px; transform-box: view-box; animation: flicker .9s ease-in-out infinite; }
.diya-glow { animation: pulse 2s ease-in-out infinite; }
.intro-kicker { margin: 0; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.intro-title { font-family: var(--serif); font-weight: 700; font-size: clamp(1.6rem, 6.5vw, 2.4rem); line-height: 1.2; margin: .4rem 0 1.4rem; }
.intro-title .name { color: var(--gold-2); }
.intro-note { color: var(--muted); font-size: .9rem; margin-top: 1rem; }
.loader-bar { width: 220px; height: 4px; margin: 0 auto; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--gold-2)); border-radius: inherit; transition: width .4s ease; }
.loader-text { color: var(--muted); font-size: .85rem; margin-top: .8rem; }

/* finale */
.finale { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 18px 18px calc(18px + var(--safe-b)); background: linear-gradient(180deg, transparent, rgba(5, 4, 12, .55) 45%, rgba(5, 4, 12, .8)); }
.finale .btn { width: min(560px, 100%); }
.wish { max-width: 520px; text-align: center; font-family: var(--serif); font-style: italic; color: #ffe8c8; text-shadow: 0 2px 12px rgba(0,0,0,.8); margin: 0 0 .7rem; font-size: clamp(.95rem, 3.6vw, 1.1rem); animation: pop .8s ease both; }

/* bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(3, 2, 10, .55); backdrop-filter: blur(3px); z-index: 8; }
.sheet { position: fixed; z-index: 9; left: 0; right: 0; bottom: 0; margin: 0 auto; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 14px 20px calc(22px + var(--safe-b)); box-shadow: 0 -20px 60px rgba(0,0,0,.5); backdrop-filter: blur(16px); }
@media (min-width: 700px) { .sheet { bottom: 50%; transform: translateY(50%); border-radius: 24px; border-bottom: 1px solid var(--line); } }
.sheet-enter, .sheet-leave { transition: opacity .3s ease, translate .35s cubic-bezier(.2, .8, .2, 1); }
.sheet-enter-start { opacity: 0; translate: 0 40px; }
.sheet-enter-end { opacity: 1; translate: 0 0; }
.sheet-grip { width: 42px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); margin: 0 auto 12px; }
.sheet-close { position: absolute; right: 10px; top: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.sheet-title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; margin: .2rem 2rem .4rem 0; }
.sheet-sub { margin: 0 0 1.1rem; color: var(--muted); font-size: .95rem; line-height: 1.5; }

/* form */
.create-form { display: grid; gap: 1rem; }
.field { display: grid; gap: .45rem; }
.field-label { font-size: .85rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.input { width: 100%; font-size: 1.1rem; padding: .95rem 1rem; color: var(--ink); background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.14); border-radius: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 184, 92, .18); }
.input::placeholder { color: rgba(255,255,255,.35); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tpl-picker { border: 0; padding: 0; margin: 0; }
.tpl-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .45rem; }
.tpl-option { position: relative; cursor: pointer; text-align: center; }
.tpl-option input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-swatch { position: relative; display: block; height: 64px; border-radius: 12px; border: 2px solid transparent; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.tpl-swatch i { position: absolute; width: 7px; height: 9px; border-radius: 3px 3px 4px 4px; box-shadow: 0 0 10px 3px rgba(255, 180, 90, .6); }
.tpl-swatch i:nth-child(1) { left: 22%; top: 30%; } .tpl-swatch i:nth-child(2) { left: 58%; top: 18%; } .tpl-swatch i:nth-child(3) { left: 78%; top: 52%; }
.tpl-option input:checked + .tpl-swatch { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,184,92,.25); }
.tpl-option input:focus-visible + .tpl-swatch { outline: 2px solid #fff; outline-offset: 2px; }
.tpl-name { display: block; font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.form-error { margin: 0; color: #ffb3a6; background: rgba(255, 90, 60, .1); border: 1px solid rgba(255, 120, 90, .3); padding: .6rem .8rem; border-radius: 10px; font-size: .9rem; }
.fine-print { text-align: center; color: var(--muted); font-size: .8rem; margin: 0; }
.spinner-row { display: inline-flex; align-items: center; gap: .5rem; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(42, 20, 6, .3); border-top-color: #2a1406; border-radius: 50%; animation: spin .8s linear infinite; }

/* share panel */
.share { text-align: center; }
.share-burst { font-size: 2.4rem; animation: pop .6s ease both; }
.share .sheet-title { margin-right: 0; }
.share-link { display: flex; align-items: center; gap: .5rem; padding: .45rem .45rem .45rem .9rem; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px dashed rgba(255, 210, 140, .35); margin-bottom: 1rem; text-align: left; }
.share-url { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; color: var(--gold-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: .55rem; margin-top: .9rem; }
.share-btn { display: grid; justify-items: center; gap: .35rem; padding: .7rem .2rem; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; font-size: .78rem; color: var(--muted); }
.share-btn:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.sb-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .95rem; }
.sb-fb { background: #1877f2; } .sb-x { background: #111; border: 1px solid #333; } .sb-tg { background: #229ed9; font-size: .8rem; } .sb-mail { background: #6b5cff; } .sb-more { background: #444; }
.share-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; flex-wrap: wrap; gap: .4rem; }

/* 2D fallback */
.fallback, .noscript { position: absolute; inset: 0; z-index: 3; overflow: hidden; display: flex; flex-direction: column; }
.fb-scene { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 20px 20px; background: linear-gradient(180deg, #0d1030 0%, #3b2d5c 60%, #b98a8e 100%); }
.fb-stars { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 8%, #fff, transparent), radial-gradient(1.5px 1.5px at 70% 15%, #fff, transparent), radial-gradient(1px 1px at 85% 35%, #fff, transparent), radial-gradient(1px 1px at 50% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 20% 45%, #fff, transparent); animation: twinkle 3s ease-in-out infinite; }
.fb-lanterns i { position: absolute; bottom: -30px; width: 14px; height: 18px; border-radius: 5px 5px 7px 7px; background: #ffd08a; box-shadow: 0 0 18px 6px rgba(255, 170, 70, .6); animation: rise 14s linear infinite; }
.fb-lanterns i:nth-child(1) { left: 8%; animation-delay: 0s; } .fb-lanterns i:nth-child(2) { left: 24%; animation-delay: 3s; } .fb-lanterns i:nth-child(3) { left: 42%; animation-delay: 7s; } .fb-lanterns i:nth-child(4) { left: 60%; animation-delay: 1.5s; } .fb-lanterns i:nth-child(5) { left: 76%; animation-delay: 5s; } .fb-lanterns i:nth-child(6) { left: 90%; animation-delay: 9s; } .fb-lanterns i:nth-child(7) { left: 52%; animation-delay: 11s; }
.fb-title { position: relative; font-family: var(--serif); font-size: clamp(2.4rem, 11vw, 4.6rem); margin: 0; line-height: 1.05; color: #fff1d6; text-shadow: 0 0 18px rgba(255, 200, 120, .8), 0 0 40px rgba(255, 150, 60, .5); }
.fb-title small { display: block; font-size: .5em; color: var(--gold-2); margin-top: .3em; }
.fb-wish { position: relative; max-width: 460px; font-family: var(--serif); font-style: italic; color: #ffe8c8; }
.fb-diyas { position: relative; display: flex; gap: 6px; margin-top: 2rem; }
.fb-diya { width: 64px; }
.fallback-actions, .noscript .btn { padding: 18px 18px calc(18px + var(--safe-b)); display: flex; justify-content: center; background: #0a0918; }
.noscript .btn { margin: 16px; }

/* ---------------------------------------------------------- pages */
.is-page { min-height: 100vh; background: radial-gradient(90% 60% at 50% 0%, #2a1a48 0%, #0d0a1c 55%, #070b14 100%) fixed; }
.page { max-width: 620px; margin: 0 auto; padding: 18px 18px 40px; }
.page--center { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.page-header { display: flex; justify-content: center; padding: 6px 0 10px; }
.hero { text-align: center; padding: 10px 0 18px; }
.hero-diya { width: 110px; margin: 0 auto; }
.hero-title { font-family: var(--serif); font-size: clamp(1.8rem, 7vw, 2.6rem); line-height: 1.15; margin: .3rem 0 .6rem; }
.hero-sub { color: var(--muted); line-height: 1.6; margin: 0 auto; max-width: 480px; }
.gold { color: var(--gold-2); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.card .sheet-title { display: none; }
.card .sheet-sub { display: none; }
.card .share .sheet-title, .card .share .sheet-sub { display: block; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 26px 0 10px; }
.step { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px; text-align: center; }
.step b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,184,92,.15); color: var(--gold-2); }
.step h3 { font-size: .9rem; margin: .5rem 0 .25rem; }
.step p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.4; word-break: break-word; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.center { text-align: center; }
.page-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 10px 0 24px; }
.page-footer a { text-decoration: none; }
@media (max-width: 420px) { .steps { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
