/* Entry, ceremony choreography and custom settings. */
.entering .orb-surface{animation:arrival-orb 1.2s .1s cubic-bezier(.2,.7,.2,1) both}
.entering .orbit-one{animation:arrival-orbit 1.3s .35s ease both}.entering .orbit-two{animation:arrival-orbit 1.5s .4s ease both}
@keyframes arrival-orb{from{opacity:0;transform:scale(.55)}55%{opacity:1}to{opacity:1;transform:scale(1)}}
@keyframes arrival-orbit{from{opacity:0;scale:.7}to{opacity:.4;scale:1}}
.ritual-actions{display:flex;justify-content:center;align-items:center;gap:16px}.ritual-actions .text-button{margin:0;padding-inline:6px}
#cancelRitual{font-size:12px;opacity:.65}.orb-stage{perspective:800px}.composition{backface-visibility:hidden;transform-style:preserve-3d}
.orb:active{transition-duration:90ms}.orb-surface{transition:box-shadow .6s,filter .5s}.holding .orb{transform:scale(.93);transition:transform 1.8s}.holding .touch-mark{opacity:.45;transform:scale(.96)}.holding.charged .orb{transform:scale(1.04);transition-duration:.5s}.holding.charged .orb-light{opacity:1}.holding.charged .orb-spark{opacity:1;transform:scale(1.2)}.holding.charged .touch-mark{opacity:0}
.sealing .orb{animation:receive-paper 1.2s ease both}.sealing .touch-mark,.gathering .touch-mark,.brewing .touch-mark,.releasing .touch-mark,.echo .touch-mark{opacity:0;transform:scale(.7)}
.sealing .orb-spark,.gathering .orb-spark,.brewing .orb-spark,.releasing .orb-spark{opacity:1;transform:scale(1);transition:opacity .4s,transform .8s}
.sealing .orb-surface,.gathering .orb-surface,.brewing .orb-surface,.releasing .orb-surface,.echo .orb-surface{animation:none}
.sealing .guide-path{opacity:1}.sealing .guide-path span{animation:guide-flow 1.1s ease both}
@keyframes receive-paper{0%{transform:scale(.97)}60%{transform:scale(.94)}82%{transform:scale(1.065)}100%{transform:scale(1)}}
.gathering .orb{animation:gather-core 1.8s cubic-bezier(.2,.7,.3,1) both}.gathering .orb-light{transform:scale(1.8);opacity:1;transition:transform 1.8s,opacity 1.8s}.gathering .orb-aura{animation:gather-aura 1.8s ease both}.gathering .orbit-one{animation:gather-orbit-one 1.8s ease both}.gathering .orbit-two{animation:gather-orbit-two 1.8s ease both}.gathering .particle{animation:gather-particle 1.5s var(--delay) cubic-bezier(.55,0,.6,.4) both;width:4px;height:4px;background:#e9cfef;box-shadow:0 0 8px #cfaaf4}.gathering .little-star{opacity:0;transform:scale(.4);transition:opacity 1.4s,transform 1.4s}
@keyframes gather-core{from{transform:scale(1)}to{transform:scale(.86)}}@keyframes gather-aura{0%{opacity:.3;transform:scale(1.2)}70%{opacity:1}100%{opacity:.9;transform:scale(.72)}}@keyframes gather-orbit-one{to{transform:rotate(24deg) scale(.76);opacity:.7}}@keyframes gather-orbit-two{to{transform:rotate(-24deg) scale(.72);opacity:.55}}@keyframes gather-particle{0%{opacity:0;transform:translate(var(--x),var(--y)) scale(.8)}25%{opacity:.9}100%{opacity:0;transform:translate(0,0) scale(.3)}}
.brewing .orb{animation:heart-breath 1.2s cubic-bezier(.25,.7,.25,1) both}.brewing .orb-light{opacity:1;transform:scale(1.6)}.brewing .orb-spark{animation:heart-star 1.2s ease both}.brewing .orb-aura{animation:heart-aura 1.2s ease both}.brewing .orbit-one{transform:rotate(24deg) scale(.76);opacity:.3}.brewing .orbit-two{transform:rotate(-24deg) scale(.72);opacity:.2}.brewing .orb-surface{box-shadow:inset 3px 4px 12px #fff9,0 0 35px #ffe7c866,0 0 80px #d9b8ee40}
@keyframes heart-breath{0%{transform:scale(.86)}35%{transform:scale(.86)}80%{transform:scale(1.08)}100%{transform:scale(1.03)}}@keyframes heart-star{0%,30%{opacity:.5;transform:scale(.7)}85%{opacity:1;transform:scale(1.35)}100%{opacity:1;transform:scale(1.1)}}@keyframes heart-aura{0%{opacity:.5;transform:scale(.72)}85%{opacity:1;transform:scale(1.25)}100%{opacity:.8;transform:scale(1.2)}}
.releasing .orb{animation:lift-wish 2s cubic-bezier(.3,0,.25,1) both;pointer-events:auto}.releasing .ripple{animation:ripple 1.9s .05s ease-out both}.releasing .orb-aura{animation:release-aura 2s ease both}.releasing .particle{animation:depart-particle 1.6s var(--delay) ease-out both}.releasing .release-trail{animation:departure-trail 2s ease both}.releasing .orb-shadow{opacity:0;transform:scale(.4);transition:opacity 1s,transform 1s}.releasing .orbit{opacity:0;transition:opacity .8s}
@keyframes lift-wish{0%{transform:translateY(0) scale(1.03);opacity:1}22%{transform:translateY(-10px) scale(.87);opacity:1}50%{transform:translateY(-40px) scale(.26);opacity:1}100%{transform:translateY(-175px) scale(.018);opacity:0}}@keyframes release-aura{0%{opacity:.8;transform:scale(1.2)}40%{opacity:.7;transform:translateY(-20px) scale(.85)}100%{opacity:0;transform:translateY(-75px) scale(.4)}}@keyframes depart-particle{0%{opacity:0;transform:translate(0,0)}20%{opacity:.6}100%{opacity:0;transform:translate(calc(var(--x) * .5),calc(var(--y) - 65px))}}@keyframes departure-trail{0%,25%{opacity:0;transform:scaleY(0)}55%{opacity:.5;transform:scaleY(.4)}100%{opacity:0;transform:scaleY(1)}}
.echo .orb,.echo .orbit,.echo .orb-shadow,.echo .little-star,.echo .orb-aura{opacity:0;pointer-events:none}.echo-seed{position:absolute;left:50%;top:50%;width:9px;height:9px;border-radius:50%;background:#fff4d7;box-shadow:0 0 20px #f4d1dd,0 0 40px #cbb6ed;opacity:0;pointer-events:none;transform:translate(-50%,-50%)}.echo-wave{position:absolute;inset:25%;border-radius:50%;border:1px solid #baa2d0;opacity:0;pointer-events:none}.echo .echo-seed{animation:returning-light 1s ease both}.echo .echo-wave{animation:returning-wave 1s .1s ease both}
@keyframes returning-light{0%{opacity:0;transform:translate(-50%,-145px) scale(.3)}25%{opacity:1;transform:translate(-50%,-145px) scale(.6)}65%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) scale(4)}}@keyframes returning-wave{0%{opacity:0;transform:scale(1.7)}35%{opacity:.4}100%{opacity:0;transform:scale(.2)}}
.done .response{animation:letter-unfold 950ms cubic-bezier(.2,.8,.2,1) both}.done .response-mark{animation:letter-detail .7s .15s both}.done .wish-date{animation:letter-detail .7s .3s both}.done #wishEcho{animation:letter-detail .7s .48s both}.done .blessing{animation:letter-detail .8s .72s both}.done .response button{animation:letter-detail .6s .95s both}
@keyframes letter-unfold{from{opacity:0;transform:translateY(9px) scale(.87,.55)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes letter-detail{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
.storing .composition,.storing .orb-stage,.storing .guide-path,.storing .cue-wrap{display:none}.storing .experience{display:block;max-width:530px;min-height:0;padding:22px}.storing .response{position:relative;opacity:1}.received{animation:receive-record 1s ease}.received svg{animation:receive-record-icon 1s ease}@keyframes receive-record{0%,100%{background:transparent}40%{background:#bea5df40}}@keyframes receive-record-icon{0%,100%{transform:scale(1)}45%{transform:scale(1.15)}}
.list-entering .wish-card{animation:letter-detail .45s both}.list-entering .wish-card:nth-child(2){animation-delay:.06s}.list-entering .wish-card:nth-child(3){animation-delay:.12s}.list-entering .wish-card:nth-child(n+4){animation-delay:.18s}.wish-fulfilled{animation:fulfilled 1.3s ease!important}.wish-released{animation:released 1.2s ease!important}@keyframes fulfilled{0%,100%{background:transparent;box-shadow:inset 0 0 0 1px transparent}45%{background:#f4d59e20;box-shadow:inset 0 0 0 1px #ddb56f70}}@keyframes released{0%{opacity:.4;transform:translateY(5px)}100%{opacity:1;transform:translateY(0)}}
/* Fully styled theme, language and switch controls. Native dialog supplies focus containment only. */
#settingsDialog{position:fixed;inset:80px 4vw auto auto;margin:0;width:min(420px,calc(100% - 32px));padding:25px;border-radius:26px;background:var(--dialog);border:1px solid var(--line);box-shadow:0 25px 85px #22113326;max-height:calc(100svh - 105px)}[dir=rtl] #settingsDialog{inset:80px auto auto 4vw}
#settingsDialog[open]{animation:settings-in .35s cubic-bezier(.2,.8,.2,1) both;transform-origin:top right}#settingsDialog.closing{animation:settings-out .22s ease both}dialog::backdrop{background:#16102126;backdrop-filter:blur(7px);animation:backdrop-in .3s ease}dialog.closing::backdrop{animation:backdrop-out .22s ease both}.dialog-head{margin-bottom:24px}.dialog-head h2{font-family:ui-serif,'Songti SC',Georgia,serif;font-size:25px;font-weight:450}.dialog-head .icon-button{width:36px;height:36px;font-size:23px;background:var(--surface)}
.theme-field>span{font-size:14px;color:var(--muted)}.theme-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:12px 0 15px}.theme-card{padding:7px 7px 10px;min-width:0;border-radius:15px;border:1px solid var(--line);background:transparent;transition:background .25s,border-color .25s,transform .2s;position:relative}.theme-card:active{transform:scale(.96)}.theme-card[aria-pressed=true]{border-color:var(--primary);background:#ad87d018}.theme-card[aria-pressed=true]:after{content:'';position:absolute;inset-inline-end:11px;top:11px;width:5px;height:5px;border-radius:50%;background:var(--primary)}.theme-card>span:last-child{display:block;font-size:12px;line-height:1.4;overflow-wrap:anywhere;margin-top:9px}.theme-mini{display:block;height:62px;width:100%;border-radius:9px;position:relative;overflow:hidden}.mini-light{background:linear-gradient(130deg,#f6d9ec,#dae4fc)}.mini-dark{background:linear-gradient(130deg,#43324f,#242c42)}.mini-system{background:linear-gradient(90deg,#efdbee 50%,#33314a 50%)}.theme-mini i{position:absolute;inset:15px auto auto 10%;width:35%;height:25px;border-radius:4px;background:#fff8;box-shadow:0 4px 8px #3423480d}.theme-mini b{position:absolute;inset:17px 12% auto auto;width:25px;height:25px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#ffeacd,#d3b0e2 60%,#839dc3);box-shadow:0 3px 8px #3727442a}.mini-dark i{background:#ffffff17}.setting-row{min-height:69px}.language-row{border-bottom:0}.language-toggle{display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 12px;border-radius:12px;font-size:14px;background:var(--surface);border:1px solid var(--line);max-width:65%;text-align:start}.language-toggle>span:first-child{overflow-wrap:anywhere}.language-toggle>span:last-child{transition:transform .25s}.language-toggle[aria-expanded=true]>span:last-child{transform:rotate(180deg)}.language-options{max-height:240px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:14px;padding:5px;animation:language-in .25s ease}.language-options button{display:block;width:100%;text-align:start;min-height:42px;font-size:14px;border-radius:9px;padding:10px 13px;transition:background .2s}.language-options button:hover{background:var(--surface)}.language-options button[aria-pressed=true]{background:#a987cc25;color:var(--primary)}.custom-switch{width:46px;height:28px;border-radius:20px;padding:4px;background:#aaa0b6;position:relative;flex:0 0 46px;transition:background .25s}.custom-switch:before{content:'';position:absolute;inset:-8px 0}.custom-switch i{display:block;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 2px 4px #0002;transform:translateX(0);transition:transform .3s cubic-bezier(.2,.8,.2,1)}.custom-switch[aria-checked=true]{background:#9575b6}.custom-switch[aria-checked=true] i{transform:translateX(18px)}[dir=rtl] .custom-switch[aria-checked=true] i{transform:translateX(-18px)}.privacy{font-size:12px;line-height:1.7}.theme-changing .atmosphere{animation:theme-dissolve .6s ease}.theme-changing .composition,.theme-changing .response,.theme-changing dialog{transition:background-color .4s,color .4s,border-color .4s}.archive-dialog[open]{animation:settings-in .35s ease both}.archive-dialog.closing{animation:settings-out .22s ease both}
@keyframes settings-in{from{opacity:0;transform:translateY(-8px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes settings-out{to{opacity:0;transform:translateY(-8px) scale(.96)}}@keyframes backdrop-in{from{opacity:0}to{opacity:1}}@keyframes backdrop-out{to{opacity:0}}@keyframes language-in{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}@keyframes theme-dissolve{0%{opacity:.45}100%{opacity:1}}
@media(max-width:650px){#settingsDialog,[dir=rtl] #settingsDialog{inset:auto 0 0;margin:0 auto;width:100%;max-width:520px;max-height:87svh;border-radius:27px 27px 0 0;padding:24px 25px max(26px,env(safe-area-inset-bottom));transform-origin:bottom center}#settingsDialog:before{content:'';position:absolute;top:9px;left:calc(50% - 18px);height:4px;width:36px;background:var(--line);border-radius:4px}#settingsDialog[open]{animation:sheet-in .4s cubic-bezier(.2,.8,.2,1) both}#settingsDialog.closing{animation:sheet-out .22s ease both}.theme-mini{height:70px}.theme-card>span:last-child{font-size:13px}.theme-cards{gap:10px}.storing .experience{padding:12px}.ritual-actions{gap:10px}.ritual-actions .text-button{font-size:13px}.echo-wave{inset:23%}}@keyframes sheet-in{from{opacity:.6;transform:translateY(45px)}to{opacity:1;transform:translateY(0)}}@keyframes sheet-out{to{opacity:0;transform:translateY(45px)}}
@media(prefers-reduced-motion:reduce){.entering *,.ritual *,.received,.received svg,.list-entering .wish-card,dialog[open],dialog.closing,dialog::backdrop,.language-options,.theme-changing .atmosphere{animation:none!important;transition:none!important}.sealing .composition,.gathering .composition,.brewing .composition,.releasing .composition,.echo .composition{visibility:hidden}.echo-seed,.echo-wave,.particle{display:none}.done .response,.done .response>*{opacity:1!important;transform:none!important}}
.low-motion .particle{display:none}.low-motion .orb-aura{animation:none}.paused *{animation-play-state:paused!important}
