:root {
  --bg: #070b18;
  --bg2: #0d1428;
  --panel: rgba(16, 22, 44, 0.78);
  --panel-solid: #121a33;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3f5ff;
  --muted: #a3acc9;
  --gold: #ffcf6b;
  --gold-2: #ffb43b;
  --red: #ff4d63;
  --green: #3ddc97;
  --radius: 18px;
  --display: 'Rubik', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 14px 24px; cursor: pointer;
  font-weight: 800; font-size: 16px; text-decoration: none; transition: transform .15s, filter .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #2b1a00; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn-sm { padding: 9px 14px; font-size: 14px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 13px; }
.input {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); outline: none; transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--gold); background: rgba(255, 255, 255, .09); }
textarea.input { resize: vertical; min-height: 150px; line-height: 1.6; }
.pin { letter-spacing: .5em; font-variant-numeric: tabular-nums; font-size: 20px; text-align: center; }
.err { color: #ff8a98; font-size: 14px; min-height: 1.2em; margin: 4px 0 10px; }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 18px; text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.nav a.mine { font-weight: 700; font-size: 14px; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.08); }

/* ---------- landing ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font-size: 14px; font-weight: 700; margin-bottom: 18px; font-variant-numeric: tabular-nums; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.section { padding: 56px 0; }
.section-head { margin-bottom: 26px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.section-head p { color: var(--muted); margin: 10px 0 0; }

.badge { flex: none; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: rgba(61, 220, 151, .15); color: var(--green); }
.badge.paid { background: rgba(255, 207, 107, .15); color: var(--gold); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 26px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.note { font-size: 14px; color: var(--muted); background: rgba(255, 207, 107, .08); border: 1px solid rgba(255, 207, 107, .22); padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 22px; border-radius: var(--radius); background: var(--panel-solid); border: 1px solid var(--line); }
.step .n { font-family: var(--display); font-size: 28px; color: var(--gold); }
.step h3 { font-size: 18px; margin: 8px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

.footer { color: var(--muted); font-size: 14px; padding: 36px 0 48px; border-top: 1px solid var(--line); margin-top: 40px; }

/* ---------- maker (landing: pick + live preview) ---------- */
.maker {
  display: grid; gap: 22px 44px; padding: 12px 0 56px; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  grid-template-areas: "intro preview" "pick preview" "fill preview";
  grid-template-rows: auto auto 1fr;
}
.maker-intro { grid-area: intro; }
.maker-intro h1 { font-size: clamp(32px, 4.6vw, 54px); }
.maker-intro h1 em { font-style: normal; color: var(--gold); }
.maker-intro .lead { color: var(--muted); font-size: 17px; max-width: 32em; margin: 16px 0 0; }
.maker-intro .lead a { color: var(--text); font-weight: 700; }
.maker-preview { grid-area: preview; position: sticky; top: 16px; }
.maker-pick { grid-area: pick; }
.maker-fill { grid-area: fill; }
.step-h { font-size: 20px; margin: 10px 0 4px; }
.step-p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.maker-form { margin-top: 12px; }

.preview-card { border-radius: 28px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-solid); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.preview-card .scene { aspect-ratio: 5 / 7; max-height: calc(var(--vh, 100vh) - 130px); width: 100%; }
.preview-card .scene.swap .tree-svg { animation: swap .45s cubic-bezier(.2, 1, .3, 1); }
@keyframes swap { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.preview-cap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; }
.preview-cap b { display: block; font-size: 17px; }
.preview-cap small { color: var(--muted); font-size: 13.5px; }

.picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pick {
  position: relative; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; text-align: left;
  border: 2px solid transparent; background: var(--panel-solid); transition: transform .15s, border-color .15s;
}
.pick:hover { transform: translateY(-2px); }
.pick[aria-selected="true"] { border-color: var(--gold); }
.pick .scene { aspect-ratio: 5 / 7; }
.pick .lbl { display: block; padding: 7px 8px 8px; }
.pick .lbl b { display: block; font-size: 12.5px; line-height: 1.25; min-height: 2.5em; }
.pick .lbl small { font-size: 12px; font-weight: 800; color: var(--green); }
.pick .lbl small.paid { color: var(--gold); }
.pick .check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #2b1a00; display: none; place-items: center; font-weight: 900; font-size: 13px; }
.pick[aria-selected="true"] .check { display: grid; }

/* ---------- scene (any skin) ---------- */
.scene { position: relative; overflow: hidden; container-type: size; }
.blur-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(28px); transform: scale(1.1); }
.preview-card .blur-bg, .pick .blur-bg, .skin-big .blur-bg, .mini-skins .blur-bg { filter: blur(22px); }
.scene .tree-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snow i { position: absolute; top: -10px; border-radius: 50%; background: #fff; animation: fall linear infinite; will-change: transform; }
.light-theme .snow i { background: #fff; box-shadow: 0 0 2px rgba(80, 120, 160, .5); }
@keyframes fall { to { transform: translate3d(var(--dx, 0), calc(100cqh + 20px), 0); } }

.tree-svg.fx, .tree-svg.orn-layer { pointer-events: none; }
.tree-svg.orn-layer .orn, .tree-svg.orn-layer .star-empty { pointer-events: auto; }
/* Only whole layers fade or move, so the phone's GPU does the work */
.fx { will-change: opacity; animation: fxtw 3.4s ease-in-out infinite; }
.fx-1 { animation-delay: -1.1s; }
.fx-2 { animation-delay: -2.3s; }
.fx-flicker { animation: flicker 5s infinite; }
@keyframes fxtw { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes flicker { 0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; } 20%, 63% { opacity: .45; } }
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; left: -40%; width: 180%; height: 38%;
  background: linear-gradient(180deg, transparent, var(--c) 42%, var(--c2) 62%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  filter: blur(18px); will-change: transform;
  transform: rotate(var(--r)) translateX(-7%) skewX(-18deg);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora { to { transform: rotate(var(--r)) translateX(7%) skewX(14deg) scaleY(1.15); } }
.star-glow { filter: drop-shadow(0 0 6px rgba(255, 230, 150, .9)); }
.glow-orn .orn .sway { filter: drop-shadow(0 0 5px rgba(255, 255, 255, .55)); }
/* Swaying ornaments only on desktop (it repaints the ornament layer every frame) */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .sway { transform-box: fill-box; transform-origin: 50% 0; animation: sway 4.5s ease-in-out infinite; }
}
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
/* Thumbnails stay still; animations pause while a dialog is open */
.pick .fx, .pick .aurora i, .pick .sway { animation: none; }
.modal-open .fx, .modal-open .aurora i, .modal-open .snow i, .modal-open .sway { animation-play-state: paused; }

.orn, .star-empty { cursor: pointer; outline: none; }
.orn:hover > g, .orn:focus-visible > g { transform-origin: 50% 0; }
.orn:focus-visible { filter: drop-shadow(0 0 6px #fff); }
.orn.new > g { animation: drop .7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes drop { from { transform: translateY(-60px) scale(.4); opacity: 0; } }

/* ---------- tree page ---------- */
/* The tree page never scrolls: in Instagram's browser any scroll collapses its bars, the window resizes and the tree "zooms".
   --vh is the window height locked once at load (tree.js), so the tree keeps one size. */
html.lock, html.lock body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.tree-page { display: flex; flex-direction: column; }
.tree-page .scene-full { position: fixed; inset: 0; }
.tree-page { overflow-x: hidden; }
.tree-page .scene-full .tree-svg { inset: 178px 0 auto 0; width: 100%; height: calc(var(--vh, 100%) - 282px); }
/* Picture designs: the SVG box gets the picture's exact 5:7 shape, centered, so the picture fills it.
   On phones that's the full width. Only the top edge fades into the blurred copy behind the title. */
.tree-page .scene-full .tree-svg.pic { left: 50%; right: auto; width: min(100%, calc((var(--vh, 100dvh) - 282px) * 5 / 7)); transform: translateX(-50%); }
.tree-page .tree-svg.pic-scene.pic { -webkit-mask-image: linear-gradient(180deg, transparent, #000 7%); mask-image: linear-gradient(180deg, transparent, #000 7%); }
@media (min-width: 700px) {
  .tree-page .scene-full .tree-svg.pic { width: min(100%, calc((var(--vh, 100dvh) - 290px) * 5 / 7)); }
  /* wide screens: the picture can't reach the sides, so let its edges melt into the blur */
  .tree-page .tree-svg.pic-scene.pic {
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 7%), linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 7%), linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-composite: source-in; mask-composite: intersect;
  }
}
@media (min-width: 700px) { .tree-page .scene-full .tree-svg { top: 170px; height: calc(var(--vh, 100%) - 290px); } }
.tree-top { position: relative; z-index: 2; text-align: center; padding: 18px 16px 0; }
.tree-top .who { font-family: var(--display); font-size: clamp(26px, 6vw, 40px); text-shadow: 0 2px 20px rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.tree-top .sub { font-size: 14px; font-weight: 700; opacity: .85; margin-top: 4px; }
.light-theme .tree-top { color: #0d2236; }
.light-theme .tree-top .who { text-shadow: 0 2px 16px rgba(255, 255, 255, .6); }
.topbar { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 0; }
.topbar .logo { font-size: 15px; }
.light-theme .topbar { color: #0d2236; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; font-weight: 800; font-size: 13.5px; border: 1px solid rgba(255,255,255,.14); font-variant-numeric: tabular-nums; }
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  display: grid; gap: 8px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .55) 40%);
}
.bottom-bar .row { display: flex; gap: 8px; width: min(520px, 100%); margin: 0 auto; }
.bottom-bar .btn { flex: 1; }
.owner-strip { width: min(520px, 100%); margin: 0 auto; display: flex; gap: 8px; }
.owner-strip .btn { flex: 1; font-size: 14px; padding: 11px 12px; }
.small-link { text-align: center; font-size: 13.5px; color: #fff; opacity: .85; }
.small-link a, .small-link button { color: #fff; font-weight: 800; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* ---------- modal ---------- */
.modal {
  border: 1px solid var(--line); border-radius: 24px; padding: 0; width: min(460px, calc(100% - 24px));
  background: var(--panel-solid); color: var(--text); max-height: calc(var(--vh, 100dvh) - 24px); overflow: hidden auto; overscroll-behavior: contain;
}
.modal > .modal-body { padding: 24px; }
.modal.wide { width: min(560px, calc(100% - 24px)); }
.modal::backdrop { background: rgba(3, 6, 15, .8); }
.modal h2 { font-size: 22px; margin-bottom: 6px; padding-right: 32px; }
.modal .muted { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); cursor: pointer; font-size: 22px; line-height: 1; }
.orn-pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.orn-pick button { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--line); background: rgba(255,255,255,.05); cursor: pointer; display: grid; place-items: center; padding: 0; }
.orn-pick button[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 207, 107, .12); }
.orn-pick svg { width: 70%; height: 70%; overflow: visible; }
.star-opt { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px dashed rgba(255, 207, 107, .5); background: rgba(255, 207, 107, .06); margin-bottom: 14px; cursor: pointer; }
.star-opt input { width: 20px; height: 20px; accent-color: var(--gold); }
.star-opt b { display: block; font-size: 14.5px; }
.star-opt small { color: var(--muted); }
/* letter window: decorations */
.pay-note { font-size: 13.5px; color: #ffb3c1; background: rgba(255, 77, 99, .1); border: 1px solid rgba(255, 77, 99, .3); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.specials { display: grid; gap: 8px; margin-bottom: 10px; }
.choice { position: relative; border: 2px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 16px; cursor: pointer; color: inherit; text-align: left; padding: 10px; }
.choice[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 207, 107, .1); }
.specials .choice { display: flex; gap: 12px; align-items: center; }
.specials .choice .art { flex: 0 0 64px; height: 64px; }
.choice .art { display: grid; place-items: center; }
.choice .art svg { width: 100%; height: 100%; overflow: visible; }
.choice-text b { display: block; font-size: 15px; }
.choice-text small { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: block; margin-top: 2px; }
.choice .tag { position: absolute; top: -9px; right: 12px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #2b1a00; }
.style-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.style-chip { border: 2px solid var(--line); background: #1b1640; border-radius: 12px; padding: 6px 2px; cursor: pointer; color: #fff; display: grid; justify-items: center; gap: 2px; }
.style-chip[aria-pressed="true"] { border-color: var(--gold); }
.style-chip .art { width: 40px; height: 40px; }
.style-chip small { font-size: 11px; font-weight: 700; }
.photo-row { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(255, 207, 107, .5); }
.photo-row small { color: var(--muted); }
.orn-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.orn-grid .choice { display: grid; grid-template-rows: 36px auto auto; justify-items: center; align-content: center; gap: 1px; padding: 6px 3px; }
.orn-grid .choice .art { width: 36px; height: 36px; }
.orn-grid small { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.1; }
.orn-grid em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--gold); line-height: 1.2; }
.orn-grid em.free { color: var(--green); }
.anon { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.anon input { width: 20px; height: 20px; accent-color: var(--gold); }
.chip-btn { cursor: pointer; }
.pay-pill { width: min(520px, 100%); margin: 0 auto; border: 1px solid rgba(255, 207, 107, .55); background: rgba(40, 30, 8, .85); color: #ffe7a3; border-radius: 12px; padding: 9px 12px; font-weight: 800; font-size: 13.5px; cursor: pointer; }
.chip-star { cursor: pointer; border-color: rgba(255, 207, 107, .6); color: #ffe7a3; }
.letter-paper.super { background: #fff6d6; box-shadow: inset 0 0 0 2px #f5c542, 0 10px 30px rgba(0,0,0,.3); }
.polaroid { background: #fff; padding: 10px 10px 34px; margin: 0 auto 16px; width: min(260px, 100%); transform: rotate(-2deg); box-shadow: 0 8px 20px rgba(0,0,0,.25); text-align: center; }
.polaroid img { width: 100%; display: block; }
@media (max-width: 560px) { .orn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* sale prices in the small tiles: old price above the new one, so the tile never gets wider than its column */
.orn-grid .price-tag { white-space: normal; }
.orn-grid .price-tag .was { display: block; margin: 0; }
.choice { min-width: 0; }
.choice-text { min-width: 0; }
.counter { text-align: right; font-size: 12.5px; color: var(--muted); margin-top: -8px; margin-bottom: 8px; }

.letter-paper {
  background: #fffaf0; color: #2a2118; border-radius: 16px; padding: 24px 22px; margin-top: 8px;
  font-size: 17px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.3);
  background-image: repeating-linear-gradient(180deg, transparent 0 28px, rgba(120, 90, 50, .08) 28px 29px);
}
.letter-paper .from { margin-top: 16px; text-align: right; font-weight: 800; }
.envelope-anim { animation: open .5s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes open { from { transform: translateY(20px) scale(.96); opacity: 0; } }

.pay-rows { display: grid; gap: 8px; margin: 12px 0 16px; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.pay-row span { color: var(--muted); font-size: 13.5px; }
.pay-row b { font-size: 16px; overflow-wrap: anywhere; }
.pay-row.hl { border-color: rgba(255, 207, 107, .6); background: rgba(255, 207, 107, .08); }
.pay-row.hl b { color: var(--gold); font-size: 20px; letter-spacing: .04em; }
.pay-row .cp { flex: none; border: 0; border-radius: 8px; padding: 6px 10px; background: rgba(255,255,255,.1); cursor: pointer; font-size: 13px; font-weight: 700; }
.qr { width: 190px; margin: 0 auto 14px; border-radius: 14px; background: #fff; padding: 8px; }
.status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; margin-bottom: 12px; }
.status.wait { background: rgba(255, 207, 107, .1); border: 1px solid rgba(255, 207, 107, .3); }
.status.ok { background: rgba(61, 220, 151, .1); border: 1px solid rgba(61, 220, 151, .35); }
.status.bad { background: rgba(255, 77, 99, .1); border: 1px solid rgba(255, 77, 99, .35); }

.mini-skins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.mini-skins button { padding: 0; border-radius: 14px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--bg2); text-align: center; }
.mini-skins button[aria-pressed="true"] { border-color: var(--gold); }
.mini-skins .scene { aspect-ratio: 5 / 7; }
.mini-skins small { display: block; padding: 6px 4px; font-weight: 700; font-size: 12px; }
.mini-skins small em { font-style: normal; color: var(--gold); }

.owner-strip .gear { flex: 0 0 48px; padding: 11px 0; }
.skin-big-wrap { position: relative; margin-bottom: 12px; }
.skin-big { aspect-ratio: 5 / 7; max-height: calc(var(--vh, 100vh) * .44); width: 100%; border-radius: 16px; }
.skin-big-cap { position: absolute; left: 10px; bottom: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px; font-weight: 800; }
.story-box { margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); display: grid; gap: 10px; }
.story-head { display: flex; justify-content: space-between; align-items: baseline; }
.story-head small { color: var(--muted); }
.story-thumb { width: 150px; aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.05); display: grid; place-items: center; text-align: center; padding: 0; }
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-thumb .muted { font-size: 12px; padding: 8px; }
.story-viewer img { display: block; width: min(300px, 100%); margin: 0 auto 14px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); -webkit-touch-callout: default; }
.story-styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.story-styles button { border: 2px solid var(--line); background: rgba(255,255,255,.04); border-radius: 12px; padding: 5px 4px 6px; cursor: pointer; color: inherit; display: grid; gap: 4px; justify-items: center; }
.story-styles button[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 207, 107, .1); }
.story-styles .mini { width: 100%; aspect-ratio: 9 / 16; border-radius: 8px; background: rgba(255,255,255,.06) center / cover no-repeat; }
.story-styles small { font-size: 11.5px; font-weight: 700; }
.small-save { text-align: center; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.share-box { display: flex; gap: 8px; margin-bottom: 12px; }
.share-box input { flex: 1; min-width: 0; }
.warn-note { font-size: 13.5px; color: #ffd3d9; background: rgba(255, 77, 99, .1); border: 1px solid rgba(255, 77, 99, .35); padding: 11px 13px; border-radius: 12px; margin-bottom: 12px; line-height: 1.45; }
.save-box { border: 2px dashed #ffcf6b; background: rgba(255, 207, 107, .08); border-radius: 16px; padding: 14px; display: grid; gap: 8px; margin-bottom: 12px; }
.save-title { font-weight: 800; font-size: 17px; color: #ffe7a3; }
.save-box p { margin: 0; font-size: 13.5px; color: var(--muted); }
.save-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 9px 12px; }
.save-row span { color: var(--muted); font-size: 13px; font-weight: 700; }
.save-row b { font-size: 15px; overflow-wrap: anywhere; text-align: right; }
.save-row.pinrow b { font-family: var(--display); font-size: 26px; letter-spacing: .2em; color: var(--gold); }
.pin-show { text-align: center; padding: 16px; border-radius: 16px; background: rgba(255, 207, 107, .08); border: 1px dashed rgba(255, 207, 107, .5); margin-bottom: 14px; }
.pin-show b { font-family: var(--display); font-size: 32px; letter-spacing: .25em; color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px); opacity: 0; z-index: 100;
  background: #fff; color: #111; padding: 11px 18px; border-radius: 999px; font-weight: 800; font-size: 14.5px;
  transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.top { top: 27%; bottom: auto; }

.loading { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .maker { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "preview" "pick" "fill"; grid-template-rows: none; gap: 18px; }
  .maker-preview { position: static; width: min(100%, 380px); margin: 0 auto; }
  .preview-card .scene { max-height: calc(var(--vh, 100vh) * .56); }
  .picker { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding-bottom: 6px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
  .picker::-webkit-scrollbar { display: none; }
  .pick { flex: 0 0 104px; scroll-snap-align: start; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .card { padding: 20px; }
  .orn-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .snow { display: none; }
}

/* Launch sale */
.sale { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; color: var(--text, #fff);
  background: linear-gradient(135deg, rgba(255, 207, 107, .18), rgba(255, 120, 120, .14)); border: 1px solid rgba(255, 207, 107, .4); }
.sale b { color: var(--gold); }
.sale.compact { margin: 0 0 12px; padding: 9px 12px; font-size: 13px; }
.price-tag { white-space: nowrap; }
.price-tag .was { opacity: .55; font-weight: 600; margin-right: 2px; text-decoration-thickness: 1.5px; }

/* Owner buttons: dark frosted glass so they stay readable on light and dark trees */
.owner-strip .btn { background: rgba(10, 16, 34, .78); color: #fff; border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 18px rgba(0, 0, 0, .28); font-weight: 800; }
.owner-strip .btn:hover { background: rgba(10, 16, 34, .9); }
.owner-strip .btn.share { border-color: var(--gold); color: var(--gold); }
/* chosen tree-top style: small bounce on the big card */
.choice .art.pop svg { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .choice .art.pop svg { animation: none; } }

/* ---------- "hang a letter" window: 1) pick a decoration (tabs) 2) write 3) sticky summary + button ---------- */
.hang h2 { margin-bottom: 14px; }
.step-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; margin: 4px 0 12px; }
.step-title:not(:first-of-type) { margin-top: 26px; }
.step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #2b1a00; font-size: 13px; font-weight: 800; }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); margin-bottom: 12px; }
.tab { position: relative; border: 0; border-radius: 10px; padding: 10px 6px; background: none; color: var(--muted); font-weight: 800; font-size: 14.5px; cursor: pointer; transition: background .15s, color .15s; }
.tab[aria-selected="true"] { background: var(--panel-solid); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.tab-flex { color: #ffe7a3; }
.tab-flex[aria-selected="true"] { background: linear-gradient(180deg, #3a2a08, #2a1e06); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 207, 107, .55), 0 2px 8px rgba(0, 0, 0, .35); }
.tab.has-pick::after { content: ''; position: absolute; top: 7px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.tab-panel { display: grid; gap: 8px; }
.tab-panel > .sale.compact { margin: 0; }
.panel-note { margin: 0 0 2px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.sub-h { font-weight: 800; font-size: 14px; margin: 10px 0 2px; }
.tab-panel .orn-grid, .hang .orn-grid { margin-bottom: 0; }
.orn-grid.free3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.orn-grid .tile { grid-template-rows: 36px auto auto; }
.orn-grid.free3 .tile { padding: 12px 4px 10px; gap: 4px; }
.orn-grid.free3 small { font-size: 12.5px; }
/* list rows: picture | name + one line | price */
.row-choice { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; }
.row-choice .art { width: 56px; height: 56px; }
.row-choice .choice-text b { font-size: 15px; }
.choice-price { font-weight: 800; font-size: 14px; color: var(--gold); text-align: right; }
.choice-price .price-tag { white-space: normal; display: grid; justify-items: end; }
.choice-price .was { font-size: 12px; margin: 0; }
.choice .tag.full { background: rgba(255, 255, 255, .2); color: #fff; }
.choice:disabled { opacity: .45; cursor: not-allowed; }
.style-row { margin: -2px 0 4px; }
.style-chip .art { width: 44px; height: 40px; }
/* name visibility */
.segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0 10px; }
.seg { border: 2px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 12px; padding: 9px 4px; font-weight: 800; font-size: 13px; line-height: 1.25; cursor: pointer; overflow-wrap: anywhere; }
.seg[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 207, 107, .12); color: #ffe7a3; }
.field-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.field-hint.lock { margin-top: 12px; }
.hang textarea.input { min-height: 120px; }
.hang .counter { margin-top: 4px; }
/* sticky bottom: always shows what you picked and what it costs */
.hang-foot { position: sticky; bottom: -24px; z-index: 2; margin: 18px -24px -24px; padding: 12px 24px calc(16px + env(safe-area-inset-bottom));
  background: var(--panel-solid); border-top: 1px solid var(--line); box-shadow: 0 -10px 24px rgba(0, 0, 0, .35); display: grid; gap: 8px; }
.hang-foot .err { margin: 0; min-height: 0; }
.hang-foot .err:empty { display: none; }
.sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sum-l { display: grid; min-width: 0; }
.sum-l small { color: var(--muted); font-size: 12px; font-weight: 700; }
.sum-l b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-price { font-weight: 800; color: var(--gold); white-space: nowrap; }
.sum-price.free { color: var(--green); }
.sum-note { color: var(--muted); font-size: 12.5px; }
/* fireworks show over the tree (plays once, then removed) */
.fw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.orn.flex { cursor: pointer; }

/* small yes/no question windows (free letter, delete) */
.ask { text-align: center; padding-top: 4px; }
.ask-emoji { font-size: 56px; line-height: 1; margin-bottom: 12px; }
.ask-q { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.3; margin: 0 8px 10px; }
.ask .muted { margin-bottom: 14px; }
.ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.del-btn { margin-top: 12px; color: #ffb3c1; border-color: rgba(255, 77, 99, .35); }
.del-link { display: block; margin: 6px 0 18px auto; background: none; border: 0; padding: 4px 0; color: #ff8a98; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.ask .err:empty { display: none; }
/* New Year reveal of a "secret friend" (letter sent with name hidden until New Year) */
.letter-paper .reveal { margin-top: 10px; text-align: right; font-size: 14.5px; color: #7a4b00; animation: open .6s .3s cubic-bezier(.2, 1.2, .4, 1) both; }
.letter-paper .reveal b { background: #ffe08a; padding: 1px 8px; border-radius: 999px; }
/* Flex teaser card on the free tab + "me too" button in the tap window */
.flex-teaser { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 4px; padding: 10px 14px 10px 10px;
  border-radius: 16px; border: 1px solid rgba(255, 207, 107, .55); background: linear-gradient(135deg, rgba(255, 207, 107, .16), rgba(255, 120, 120, .1)); color: inherit; text-align: left; cursor: pointer; }
.flex-teaser .art { width: 64px; height: 42px; }
.teaser-text b { display: block; font-size: 14.5px; color: #ffe7a3; }
.teaser-text small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.teaser-go { font-size: 28px; line-height: 1; color: var(--gold); font-weight: 800; }
.flex-teaser:active { transform: scale(.98); }
.me-too { margin-top: 14px; }

/* payment instructions: receipt-style amount, then a 3-step timeline (no boxes inside boxes) */
.pg { margin: 2px 0 6px; }
.pg-amount { text-align: center; padding: 6px 0 18px; margin-bottom: 18px; border-bottom: 1px dashed var(--line); }
.pg-amount small { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.pg-amount-row { display: inline-flex; align-items: center; gap: 12px; }
.pg-amount b { font-family: var(--display); font-size: 36px; color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pg-steps { list-style: none; margin: 0; padding: 0; counter-reset: pg; }
.pg-steps li { position: relative; padding: 0 0 20px 40px; counter-increment: pg; }
.pg-steps li::before { content: counter(pg); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #2b1a00; font-weight: 900; font-size: 14px; }
.pg-steps li:not(:last-child)::after { content: ''; position: absolute; left: 12px; top: 30px; bottom: 4px; width: 2px; background: rgba(255, 207, 107, .25); border-radius: 2px; }
.pg-steps li:last-child { padding-bottom: 4px; }
.pg-h { font-weight: 800; font-size: 15.5px; line-height: 1.3; margin: 2px 0 10px; }
.pg-list { border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.pg-kv { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 12px; min-height: 46px; }
.pg-kv + .pg-kv { border-top: 1px solid var(--line); }
.pg-kv span { color: var(--muted); font-size: 13px; }
.pg-kv b { font-size: 14.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.3; }
.pg-kv:last-child b { font-size: 13.5px; letter-spacing: .01em; }
.pg-copy { flex: none; border: 0; border-radius: 999px; padding: 6px 12px; background: rgba(255, 207, 107, .14); color: var(--gold); font-weight: 800; font-size: 12.5px; cursor: pointer; }
.pg-copy:active { transform: scale(.95); }
.pg-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; border: 2px dashed rgba(255, 207, 107, .7); border-radius: 14px; background: rgba(255, 207, 107, .07); }
.pg-code b { font-family: var(--display); font-size: 28px; letter-spacing: .06em; color: var(--gold); font-variant-numeric: tabular-nums; }
.pg-warn { margin-top: 8px; font-size: 13px; font-weight: 700; color: #ff9aa8; }
.pg-warn::before { content: '⚠️ '; }
.pg-note { margin: -2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.status.big { font-size: 15.5px; padding: 16px; }
.status.big b { font-size: 17px; }
.pg-again { margin: 4px 0 6px; }
.pg-again summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; padding: 6px 0; }
.pg-again .pg { margin-top: 12px; }
/* "waiting for confirmation" on the tree: visible gold bar */
.wait-pill { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font-size: 14px; padding: 11px 14px; border-width: 2px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.wait-pill b { flex: none; color: var(--gold); }
/* "I paid" button: calm outline, not a bright call to action (people tapped it before paying) */
.btn-paid { background: transparent; color: var(--text); border: 2px solid rgba(255, 255, 255, .28); font-weight: 800; }
.btn-paid:hover { border-color: rgba(255, 255, 255, .45); }
.paid-hint { margin: 0; text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; }
