:root {
  --bg: #180c10;
  --bg-elev: rgba(38, 20, 26, 0.88);
  --border: rgba(255, 224, 185, 0.16);
  --text: #fff7ed;
  --muted: #d6b8a8;
  --accent: #e11d48;
  --accent-2: #ef4444;
  --gold: #fbbf24;
  --gold-deep: #b45309;
  --green: #22c55e;
  --radius: 20px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

body.theme-snowy {
  --bg: #0c1728;
  --bg-elev: rgba(18, 34, 58, 0.88);
  --border: rgba(186, 230, 253, 0.18);
  --accent: #2563eb;
  --accent-2: #3b82f6;
}

body.theme-candy {
  --bg: #240a16;
  --bg-elev: rgba(50, 16, 33, 0.88);
  --border: rgba(253, 164, 175, 0.22);
  --accent: #e11d48;
  --accent-2: #fb7185;
}

body.is-golden {
  --bg: #1d1205;
  --bg-elev: rgba(46, 29, 8, 0.9);
  --border: rgba(251, 191, 36, 0.42);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 50% -10%, rgba(225, 29, 72, 0.22), transparent 55%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.theme-snowy {
  background: radial-gradient(circle at 50% -10%, rgba(56, 189, 248, 0.2), transparent 55%), var(--bg);
}

body.is-golden {
  background: radial-gradient(circle at 50% -10%, rgba(251, 191, 36, 0.28), transparent 58%), var(--bg);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(18, 9, 12, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-icon { font-size: 1.25rem; }

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.nav-link:hover { color: var(--text); }

.nav-pill {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.inapp-banner {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: #451a03;
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  color: #fef3c7;
  font-size: 0.84rem;
}
.inapp-banner button {
  background: transparent;
  border: 0;
  color: #fde68a;
  font-size: 1rem;
  cursor: pointer;
}

.container {
  position: relative;
  z-index: 5;
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.hidden { display: none !important; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card + .card { margin-top: 16px; }

.hero-head {
  text-align: center;
  margin-bottom: 18px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: #fde68a;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 5.2vw, 2.35rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 0 auto;
  max-width: 460px;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Cozy Fireplace Stage */
.stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 7, 10, 0.7), rgba(40, 16, 12, 0.88));
  padding: 18px 14px 16px;
  margin-bottom: 16px;
  text-align: center;
}

body.is-golden .stage {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.22);
  background: linear-gradient(180deg, rgba(66, 38, 5, 0.85), rgba(32, 18, 4, 0.94));
}

.fairy-lights {
  display: flex;
  justify-content: space-around;
  margin-bottom: 10px;
  padding: 0 10px;
}

.bulb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: twinkle 2.4s ease-in-out infinite;
}
.bulb:nth-child(4n+1) { background: #fbbf24; box-shadow: 0 0 12px #fbbf24; }
.bulb:nth-child(4n+2) { background: #f87171; box-shadow: 0 0 12px #f87171; animation-delay: 0.6s; }
.bulb:nth-child(4n+3) { background: #34d399; box-shadow: 0 0 12px #34d399; animation-delay: 1.2s; }
.bulb:nth-child(4n)   { background: #60a5fa; box-shadow: 0 0 12px #60a5fa; animation-delay: 1.8s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.mantel-shelf {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #5c3317, #8b4513, #5c3317);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  margin: 0 8px;
}

body.is-golden .mantel-shelf {
  background: linear-gradient(90deg, #92400e, #fbbf24, #b45309, #fde68a, #92400e);
}

.stocking-wrap {
  display: inline-block;
  transform-origin: top center;
  animation: sway 4.5s ease-in-out infinite;
  margin-top: -4px;
}
.stocking-wrap.shake {
  animation: shake 0.48s ease-in-out;
}

@keyframes sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.6deg); }
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-9deg); }
  45% { transform: rotate(9deg); }
  70% { transform: rotate(-6deg); }
  88% { transform: rotate(4deg); }
}

.stage-title {
  margin: 4px 0 2px;
  font-size: 1.45rem;
  font-weight: 900;
}

.stage-meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fde68a;
  cursor: pointer;
}

.golden-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b45309, #fbbf24);
  color: #1c0f02;
  font-size: 0.76rem;
  font-weight: 900;
  margin-bottom: 6px;
}

/* Forms & Buttons */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fde68a;
  display: flex;
  justify-content: space-between;
}

.input, .textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(10, 6, 8, 0.55);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus, .textarea:focus {
  border-color: var(--gold);
}
.textarea {
  min-height: 92px;
  resize: vertical;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-opt {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.theme-opt.active {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  font-size: 0.96rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.35);
}
.btn-gold {
  background: linear-gradient(135deg, #d97706, #fbbf24);
  color: #1c0f02;
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-sm { padding: 8px 12px; font-size: 0.84rem; border-radius: 10px; }
.btn-lg { padding: 14px 18px; font-size: 1.03rem; width: 100%; }

.btn-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

/* Gifts Grid */
.drops-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 440px) {
  .drops-grid { grid-template-columns: repeat(2, 1fr); }
}

.drop-tile {
  position: relative;
  border-radius: 15px;
  padding: 14px 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}
.drop-tile:hover { transform: translateY(-2px); border-color: rgba(253, 230, 138, 0.5); }

.drop-tile.wrap-gold {
  background: linear-gradient(145deg, rgba(180, 83, 9, 0.45), rgba(251, 191, 36, 0.18));
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
}
.drop-tile.wrap-frost {
  background: linear-gradient(145deg, rgba(14, 116, 144, 0.45), rgba(186, 230, 253, 0.18));
  border-color: rgba(125, 211, 252, 0.75);
  box-shadow: 0 0 18px rgba(125, 211, 252, 0.25);
}
.drop-tile.wrap-aurora {
  background: linear-gradient(145deg, rgba(88, 28, 135, 0.52), rgba(16, 185, 129, 0.25));
  border-color: rgba(110, 231, 183, 0.75);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.28);
}

.drop-tile.empty-slot {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.drop-emoji { font-size: 2rem; line-height: 1.1; margin-bottom: 6px; display: block; }
.drop-from { font-size: 0.84rem; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-status { font-size: 0.72rem; color: var(--muted); margin-top: 2px; display: block; }
.drop-song-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 999px;
}

/* Prompts, Icons & Wraps */
.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { background: rgba(251, 191, 36, 0.18); }

.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.icon-btn {
  padding: 8px 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.icon-btn span:first-child { font-size: 1.35rem; }
.icon-btn.active { border-color: var(--gold); background: rgba(251, 191, 36, 0.18); }

.wrap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.wrap-btn {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wrap-btn.active { border-color: var(--gold); background: rgba(251, 191, 36, 0.16); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  margin: 10px 0;
  cursor: pointer;
}
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--gold); }

/* Upsell Cards */
.upsell-card {
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.35), rgba(38, 20, 26, 0.92));
}
.upsell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.upsell-title { font-size: 1.08rem; font-weight: 900; margin: 0; color: #fde68a; }
.trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 10px;
  justify-content: center;
}

.pack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.pack-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.pack-btn.best {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.14);
}
.pack-price { font-size: 1.05rem; font-weight: 900; color: #fde68a; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: #221016;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.note-reveal-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font-size: 1.05rem;
  margin: 12px 0;
  white-space: pre-wrap;
}

.lyrics-box {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.86rem;
  white-space: pre-wrap;
  margin-top: 10px;
  color: #fef3c7;
}

/* Steps / SEO section */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr; }
}
.step-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.step-num {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.step-item h3 { margin: 0 0 4px; font-size: 0.95rem; }
.step-item p { margin: 0; font-size: 0.84rem; color: var(--muted); }

/* Misc */
.muted { color: var(--muted); }
.small-note { font-size: 0.82rem; color: var(--muted); }

.footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 20px 16px 40px;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: #14532d;
  border: 1px solid #4ade80;
  color: #f0fdf4;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.loading-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--gold);
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.legal-card h1 { margin-top: 0; }
.legal-card h2, .legal-card h3 { color: #fde68a; margin-top: 20px; }
.legal-card a { color: #fbbf24; }

.badge-demo {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
}
.demo-price {
  font-size: 2rem;
  font-weight: 900;
  color: #fde68a;
  margin: 14px 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 560px) {
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-box span { font-size: 0.8rem; color: var(--muted); }
.stat-box b { font-size: 1.45rem; }
