:root {
  --bg: #07151a;
  --ink: #f4eedf;
  --muted: #a9b9b2;
  --gold: #f1d391;
  --gold2: #e3b55a;
  --ruby: #c0283a;
  --glass: rgba(18, 38, 34, .58);
  --line: rgba(255, 255, 255, .11);
  --paper: #f7f1e3;
  --paper-ink: #1d2723;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); min-height: 100%; }
body { overscroll-behavior: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#app { position: relative; z-index: 2; max-width: 520px; margin: 0 auto; min-height: 100vh; }

.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(241, 211, 145, .25); border-top-color: var(--gold); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen { padding: 14px 18px calc(22px + var(--safe-b)); display: flex; flex-direction: column; min-height: 100vh; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.center { text-align: center; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 2.2px; color: var(--gold); text-transform: uppercase; }
.h1 { font-family: var(--serif); font-weight: 600; font-size: 29px; line-height: 1.1; letter-spacing: -.3px; margin: 5px 0 0; text-shadow: 0 2px 14px rgba(0, 0, 0, .55); }
.h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.2; margin: 0; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.grow { flex: 1; }
.gap { height: 12px; }

/* ---------- archa ---------- */
.tree { position: relative; width: calc(100% + 36px); margin: 4px -18px 0; aspect-ratio: 1080 / 1240; background: url(/static/img/tree.jpg) center / cover no-repeat; overflow: hidden; }
.tree.open { background-image: url(/static/img/tree-open.jpg); }
.tree::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, var(--bg) 0%, rgba(7, 21, 26, 0) 14%, rgba(7, 21, 26, 0) 80%, var(--bg) 100%); }
.tree .glow { position: absolute; left: 50%; top: 4%; width: 26%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 120, .45), rgba(255, 214, 120, 0) 70%); animation: pulse 3.2s ease-in-out infinite; pointer-events: none; z-index: 1; }
@keyframes pulse { 50% { opacity: .55; transform: translateX(-50%) scale(1.12); } }
.orn { position: absolute; z-index: 2; background: none; padding: 0; touch-action: pan-y; }
.orn .hang { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 50% 0; transform: rotate(calc(var(--tilt, 0deg) * var(--m, 1))); }
.orn .swing { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 50% 0; animation: sway 4s ease-in-out infinite; }
.orn .thread { display: block; width: 1.2px; height: var(--t); margin: 0 auto; background: linear-gradient(180deg, rgba(120, 90, 40, .2), #d8b56a 40%, #f3dca0); box-shadow: 0 0 2px rgba(0, 0, 0, .5); }
.orn .ball { position: relative; display: block; margin-top: -1px; }
.orn .ball img { display: block; width: 100%; height: auto; pointer-events: none; filter: drop-shadow(2px 5px 4px rgba(0, 0, 0, .55)); }
.orn .ball.ice > img:first-child { filter: saturate(.7) brightness(1.05) drop-shadow(2px 5px 4px rgba(0, 0, 0, .55)); }
.orn .ball .frost { position: absolute; left: 0; top: 0; opacity: .62; filter: none; mix-blend-mode: screen; }
.orn.mine .ball > img:first-child { filter: drop-shadow(0 0 8px rgba(255, 220, 140, .85)) drop-shadow(2px 5px 4px rgba(0, 0, 0, .5)); }
.tufts { position: absolute; inset: 0; z-index: 3; pointer-events: none; -webkit-mask: url(/static/img/tree-mask.png?v=7) 0 0 / 100% 100% no-repeat; mask: url(/static/img/tree-mask.png?v=7) 0 0 / 100% 100% no-repeat; }
.tuft { position: absolute; height: auto; transform: translate(-50%, -58%); pointer-events: none; z-index: 2; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.tuft.flip { transform: translate(-50%, -58%) scaleX(-1); }
/* Topishmoqli shar: tagida kichkina oltin qulfcha osilib turadi */
.charm { position: absolute; left: 50%; top: 96%; width: 46%; margin-left: -23%; transform-origin: 50% 0; animation: charm 2.6s ease-in-out infinite; pointer-events: none; z-index: 1; }
.charm i { display: block; width: 1px; height: 0.45em; margin: 0 auto; background: linear-gradient(#f3dca0, #b8923f); font-size: 14px; }
.charm img { display: block; width: 100%; margin-top: -1px; filter: drop-shadow(1px 3px 2px rgba(0, 0, 0, .55)); animation: glint 3.4s ease-in-out infinite; }
@keyframes charm { 0%, 100% { transform: rotate(7deg); } 50% { transform: rotate(-7deg); } }
@keyframes glint { 0%, 100% { filter: drop-shadow(1px 3px 2px rgba(0, 0, 0, .55)); } 50% { filter: drop-shadow(0 0 5px rgba(255, 215, 120, .85)) drop-shadow(1px 3px 2px rgba(0, 0, 0, .55)); } }
.ball-big-wrap { position: relative; width: 84px; margin: 0 auto 58px; }
.ball-big-wrap .ball-big { margin: 0; width: 100%; }
.charm.big { width: 40%; margin-left: -20%; }
.charm.big i { font-size: 22px; }
.orn .swing.kick { animation: kick 1.8s cubic-bezier(.3, .6, .4, 1) both; }
.orn.new .swing { animation: drop 1.1s cubic-bezier(.3, 1.5, .5, 1) both, sway 4s 1.1s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(calc(var(--a) * -1)); } 50% { transform: rotate(var(--a)); } }
@keyframes kick {
  0% { transform: rotate(0); } 14% { transform: rotate(var(--k)); } 34% { transform: rotate(calc(var(--k) * -.62)); }
  54% { transform: rotate(calc(var(--k) * .36)); } 74% { transform: rotate(calc(var(--k) * -.18)); } 100% { transform: rotate(0); }
}
@keyframes drop { 0% { transform: translateY(-120%) scaleY(1.15); opacity: 0; } 60% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .orn .swing { animation: none !important; } }
.more { position: absolute; right: 9%; bottom: 13%; z-index: 3; background: rgba(7, 21, 26, .75); border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; font-size: 12px; font-weight: 800; color: var(--gold); }

.hero-title { position: relative; z-index: 3; margin-bottom: -28px; }

/* ---------- komponentlar ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 22px; }
.count { display: flex; gap: 7px; }
.count div { flex: 1; text-align: center; padding: 9px 0 8px; }
.count b { font-family: var(--serif); font-weight: 600; font-size: 23px; display: block; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.count small { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.stats { display: flex; gap: 8px; }
.stat { flex: 1; padding: 10px 12px; display: flex; align-items: center; gap: 9px; }
.stat img { width: 24px; height: 28px; object-fit: contain; }
.stat b { font-size: 17px; display: block; line-height: 1.1; }
.stat small { font-size: 11px; color: var(--muted); }

.btn { height: 54px; border-radius: 17px; font-weight: 800; font-size: 15.5px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.gold { background: linear-gradient(180deg, #f6dc9b 0%, #e3b55a 55%, #c9953a 100%); color: #2b1c03; box-shadow: 0 10px 24px -10px rgba(227, 181, 90, .75), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.ruby { background: linear-gradient(180deg, #e0474a, #a8182a); color: #fff; box-shadow: 0 10px 24px -10px rgba(168, 24, 42, .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.ghost { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: var(--ink); }
.btn.small { height: 44px; font-size: 14px; border-radius: 14px; }
.link { color: var(--gold); font-weight: 700; font-size: 14px; text-align: center; padding: 10px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

/* ---------- tilak yozish ---------- */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 22px; padding: 14px; }
.lbl { font-weight: 800; font-size: 11.5px; color: #7a6c51; margin: 14px 2px 7px; letter-spacing: .5px; text-transform: uppercase; display: flex; justify-content: space-between; }
.lbl:first-child { margin-top: 0; }
.lbl span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pick { position: relative; aspect-ratio: .86; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: transparent; transition: background .15s, box-shadow .15s; }
.pick img { width: 72%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.pick.sel { background: #fff; box-shadow: 0 0 0 2px var(--ruby), 0 6px 14px -6px rgba(0, 0, 0, .3); }
.pick[disabled] { opacity: .3; }
.pick .price { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; font-weight: 800; color: #6b4a07; background: linear-gradient(180deg, #fbe7b0, #ebc46c); padding: 2px 6px; border-radius: 99px; }
.premium-note { margin-top: 10px; font-size: 12.5px; line-height: 1.4; color: #6a5a3a; background: #efe5cf; border-radius: 12px; padding: 9px 11px; }
textarea, .input { width: 100%; background: #fff; border: 1.5px solid #e9dfca; border-radius: 14px; padding: 11px 12px; font-size: 15px; line-height: 1.45; color: var(--paper-ink); outline: none; resize: none; }
textarea:focus, .input:focus { border-color: #c9953a; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { padding: 7px 11px; border-radius: 99px; background: #efe5cf; color: #4a3f2a; font-size: 13px; font-weight: 700; }
.chip.sel { background: var(--paper-ink); color: #fff; }
.tog { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 700; width: 100%; text-align: left; }
.sw { width: 44px; height: 26px; border-radius: 99px; background: #cfc4ad; position: relative; flex-shrink: 0; transition: background .2s; }
.sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.sw.on { background: #2c7a56; }
.sw.on::after { left: 21px; }
.tog small { display: block; font-weight: 500; color: #7a6c51; font-size: 12px; }
.riddle-box { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.err { color: #ff9b9b; font-size: 13.5px; text-align: center; min-height: 18px; margin: 8px 0 0; }

/* ---------- modal ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(3, 10, 12, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s ease; }
.sheet { width: 100%; max-width: 520px; background: #0f2620; border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: up .3s cubic-bezier(.2, .9, .3, 1); max-height: 92vh; overflow: auto; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .ball-big { display: block; width: 84px; margin: 0 auto 8px; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .55)); }
.wish-text { font-family: var(--serif); font-size: 19px; line-height: 1.45; margin: 10px 0 4px; }
.advice { margin-top: 12px; padding: 11px 13px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.advice small { display: block; color: var(--gold); font-weight: 800; font-size: 11.5px; margin-bottom: 3px; letter-spacing: .3px; }
.dark-input { width: 100%; height: 50px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); padding: 0 14px; font-size: 16px; color: var(--ink); outline: none; }
.dark-input:focus { border-color: var(--gold2); }

/* ---------- ro'yxatlar ---------- */
.section { margin-top: 18px; }
.section h3 { font-size: 13px; font-weight: 800; letter-spacing: .4px; margin: 0 0 9px 2px; color: var(--muted); text-transform: uppercase; }
.wish-row { display: flex; gap: 12px; padding: 12px; align-items: flex-start; width: 100%; text-align: left; margin-bottom: 8px; }
.wish-row img { width: 30px; flex-shrink: 0; margin-top: 2px; }
.wish-row b { font-size: 13px; color: var(--gold); display: block; margin-bottom: 2px; }
.wish-row p { margin: 0; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.adv-group { padding: 12px 14px; margin-bottom: 8px; }
.adv-group b { font-size: 13px; display: block; margin-bottom: 6px; }
.adv-group div { font-size: 14px; line-height: 1.45; padding: 3px 0; border-top: 1px solid var(--line); }
.adv-group div:nth-child(2) { border-top: 0; }
.adv-group span { color: var(--muted); font-size: 12px; }

.channels { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.channel { display: flex; align-items: center; gap: 10px; padding: 14px; font-weight: 700; text-decoration: none; color: var(--ink); }
.channel::after { content: '→'; margin-left: auto; color: var(--gold); }

#toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translate(-50%, 30px); z-index: 40; background: rgba(15, 38, 32, .96); border: 1px solid var(--line); color: var(--ink); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; max-width: 88vw; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- karta to'lovi ---------- */
.cardbox { display: block; width: 100%; text-align: center; padding: 14px; }
.cardbox small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.cardbox b { display: block; font-size: 22px; letter-spacing: 1.5px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; color: var(--gold); }
.cardbox span { font-size: 13px; color: var(--muted); }
label.btn { cursor: pointer; }
label.btn.busy { opacity: .6; pointer-events: none; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.admin-grid div { padding: 11px 8px; text-align: center; border-radius: 16px; }
.admin-grid b { display: block; font-size: 17px; color: var(--gold); }
.admin-grid small { font-size: 11px; color: var(--muted); }
.order { padding: 12px; margin-bottom: 10px; }
.order-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.order-head span { color: var(--gold); font-weight: 800; }
.receipt { display: block; width: 100%; max-height: 320px; object-fit: contain; background: rgba(0, 0, 0, .25); border-radius: 12px; margin: 10px 0; min-height: 60px; }
.top-row { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }

/* ---------- paketlar ---------- */
.pick .price.own { background: linear-gradient(180deg, #bdf0cf, #6fcf97); color: #0c4a2a; }
.pack-offer { display: block; width: 100%; text-align: left; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1.5px dashed #c9953a; color: #4a3f2a; }
.pack-offer b { display: block; font-size: 13.5px; }
.pack-offer span { font-size: 12px; color: #7a6c51; }
.pack-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin-bottom: 8px; text-align: left; }
.pack-row img { width: 38px; }
.pack-row div { flex: 1; }
.pack-row b { display: block; font-size: 15px; }
.pack-row small { color: #8fd6a8; font-size: 12px; font-weight: 700; }
.pack-row span { text-align: right; font-weight: 800; color: var(--gold); font-size: 15px; }
.pack-row s { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.admin-grid div:last-child { grid-column: 1 / -1; }
.section label { display: block; margin: 10px 0 5px; }
.section [data-s-save] { margin-top: 6px; width: 100%; }
