body { background:#f7efdf; color:#392920; font-family:system-ui,sans-serif; }
button { background:transparent; color:inherit; font-size:15px; margin:0; }

.button-pressed { opacity:.82; }
.body { padding:25px 25px calc(83px + env(safe-area-inset-bottom)); }
.daily { text-align:center; padding-top:38px; }
.heading,.title,.poem,.result-title,.slip { font-family:"Songti SC",serif; font-weight:700; }
.heading { font-size:41px; line-height:1.18; margin-bottom:11px; }
.title { font-size:23px; }
.muted { color:#745c4d; font-size:14px; }
.hero { display:block; width:100%; height:305px; margin:4px auto 0; mix-blend-mode:multiply; }
.primary { background:#96392d; color:#fff7e9; border-radius:6px; padding:0 16px; min-height:45px; line-height:45px; font-weight:650; }
.daily .primary { width:75%; margin:auto; }
.list { margin-top:20px; border-top:1px solid #dac9b2; }
.row { display:flex; align-items:center; justify-content:space-between; width:100%; border-radius:0; border-bottom:1px solid #dac9b2; padding:10px 0; line-height:1.4; min-height:50px; text-align:left; }
.topic { gap:12px; min-height:78px; padding:3px 0; }
.topic-copy { flex:1; }
.topic-status { color:#96392d; font-size:13px; }
.thumb { width:70px; height:70px; flex:none; mix-blend-mode:multiply; }
.thumb.wealth { filter:hue-rotate(22deg) saturate(.77); }
.thumb.love { filter:hue-rotate(-16deg); }
.thumb.peace { filter:hue-rotate(42deg) saturate(.65); }
.profile-head { text-align:center; margin-top:29px; }
.avatar { position:relative; width:77px; height:77px; margin:0 auto 11px; padding:0; overflow:hidden; border:1px solid #d1ceca; border-radius:50%; background:#efeeeb; }
.avatar-image,.avatar-silhouette { position:absolute; inset:0; width:100%; height:100%; }
.avatar-silhouette::before,.avatar-silhouette::after { content:""; position:absolute; left:50%; transform:translateX(-50%); background:#858584; }
.avatar-silhouette::before { top:17.5px; width:18.5px; height:18.5px; border-radius:50%; }
.avatar-silhouette::after { bottom:15px; width:37px; height:21px; border-radius:22.5px 22.5px 6px 6px; }
.editor { padding:10px 0; border-bottom:1px solid #dac9b2; }
.input { border:1px solid #b99e82; background:#fff9ef; border-radius:5px; min-height:42px; padding:0 11px; line-height:42px; }
.actions { display:flex; justify-content:flex-end; margin-top:10px; gap:7px; }
.nav { position:fixed; bottom:0; left:0; right:0; z-index:1; display:flex; border-top:1px solid #dac9b2; background:#f8efdf; padding:8px 0 env(safe-area-inset-bottom); }
.nav button { flex:1; border-radius:0; height:52.5px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4.5px; font-size:13px; color:#745c4d; }
.nav .selected { color:#96392d; font-weight:700; }
.nav-icon { position:relative; box-sizing:border-box; width:18.5px; height:18.5px; color:inherit; }
.nav-sun { border:1.5px dotted currentColor; border-radius:50%; }
.sun-core { position:absolute; inset:3px; border:1.5px solid currentColor; border-radius:50%; }
.cup-body { position:absolute; inset:7px 2.5px 0; border:1.5px solid currentColor; border-radius:1px 1px 3.5px 3.5px; }
.nav-cup::before,.nav-cup::after { content:""; position:absolute; bottom:11px; height:6.5px; border-left:1.5px solid currentColor; border-radius:1px; }
.nav-cup::before { left:6.5px; transform:rotate(-16deg); }
.nav-cup::after { left:11.5px; transform:rotate(13deg); }
.nav-person::before,.nav-person::after { content:""; position:absolute; left:50%; transform:translateX(-50%); border:1.5px solid currentColor; }
.nav-person::before { width:6px; height:6px; border-radius:50%; }
.nav-person::after { width:13.5px; height:6px; bottom:0; border-radius:7px 7px 2.5px 2.5px; }
.overlay { position:fixed; inset:0; z-index:2; display:flex; align-items:center; justify-content:center; padding:0 16px; background:#170e0bd9; }
.sheet { width:100%; max-height:86vh; border-radius:10px; }
.sheet-content { position:relative; padding:34px 15px 14px; text-align:center; }
.stage-sheet { background:radial-gradient(ellipse at 50% 45%,#61251c,#301410 62%,#210f0d); color:#ffedc6; border:1px solid #9c6840; }
.paper-sheet { background:#efe2ca; }
.close { position:absolute; z-index:4; top:2px; right:2px; width:42px; height:42px; padding:0; line-height:42px; color:inherit; font-size:22px; }
.stage-title { letter-spacing:3px; }
.invocation { color:#f2cb9b; margin:6px 0 0; font-size:13.5px; }
.stage { height:220px; position:relative; isolation:isolate; }
.halo,.orbit,.sparks { position:absolute; inset:0; margin:auto; }
.halo { width:210px; height:195px; border-radius:50%; background:radial-gradient(ellipse,#ffb65c85,transparent 69%); animation:breathe 2s ease-in-out infinite alternate; }
.orbit { width:163px; height:163px; border:1px solid #efb8737d; border-radius:50%; box-shadow:0 0 23px #ed944b40; transform:rotateX(52deg) translateY(40px); }
.cup-tilt { position:absolute; inset:0; display:grid; place-items:center; transition:transform .15s ease-out; }
.stage-cup { width:197px; height:197px; }
.charging .stage-cup { animation:sway 1.8s ease-in-out infinite; }
.sparks { width:185px; height:165px; pointer-events:none; }
.spark { position:absolute; width:3.5px; height:3.5px; background:#ffe6a2; border-radius:50%; box-shadow:0 0 7px #ffb94d; animation:float 1.9s ease-in-out infinite alternate; }
.spark:nth-child(1) { top:24%; left:12%; }
.spark:nth-child(2) { top:67%; left:8%; animation-delay:-.5s; }
.spark:nth-child(3) { top:10%; left:72%; animation-delay:-.8s; }
.spark:nth-child(4) { top:34%; left:92%; animation-delay:-1.1s; }
.spark:nth-child(5) { top:65%; left:84%; animation-delay:-.3s; }
.spark:nth-child(6) { top:83%; left:22%; animation-delay:-1.3s; }
.motion-hint { display:flex; align-items:center; justify-content:center; gap:9px; color:#ffedc6; font-size:14.5px; }
.phone { width:12.5px; height:21.5px; border:1px solid currentColor; border-radius:3px; animation:rock 1.45s ease-in-out infinite; }
.fallback { color:#96392d; text-decoration:underline; margin:7px auto 0; min-height:42px; line-height:42px; }
.stage-sheet .fallback { color:#ffdfa5; }
.revealing .cup-tilt { animation:retreat .52s ease-out both; }
.revealing .halo { animation:flare .7s ease-out both; }
.revealing .spark { animation:burst .65s ease-out both; }
.slip { position:absolute; inset:0; margin:auto; width:45.5px; height:137.5px; display:flex; align-items:center; justify-content:center; writing-mode:vertical-rl; text-orientation:upright; border:2px double #934c29; border-radius:2.5px; background:linear-gradient(90deg,#d89a54,#ffdfa0 28%,#f1c679); color:#7e281e; letter-spacing:3px; font-size:24px; box-shadow:0 6px 19px #13090790; animation:launch .52s cubic-bezier(.18,.72,.26,1) both; }
.fading { animation:fade .28s ease-in both; }
.result { animation:paper-open .36s ease-out both; }
.ticket { --stock:#f3dea2; position:relative; margin:0 auto; max-width:265px; padding:13px 10px 10px; color:#392920; background:var(--stock); box-shadow:0 4.5px 9px #573b262c; font-family:"Songti SC",serif; }
.ticket.wealth,.ticket.love { --stock:#efc2c4; }
.ticket.peace { --stock:#ead5ac; }
.ticket-frame { position:relative; border:3.5px double #6d4836; }
.ticket-seal { position:absolute; left:50%; top:-13px; transform:translateX(-50%); width:25px; line-height:23px; background:#8e3028; color:#fff0d3; border:2px double #df9c72; font-size:15px; font-weight:700; }
.ticket-source { border-bottom:1px solid #6d4836; padding:18.5px 5px 8.5px; font-size:21px; font-weight:700; letter-spacing:3px; }
.ticket-body { display:flex; flex-direction:row-reverse; min-height:245px; }
.ticket-meta { padding:8px 5.5px; border-left:1px solid #6d4836; writing-mode:vertical-rl; text-orientation:upright; font-size:15.5px; line-height:1.2; }
.grade { display:inline-block; color:#8e3028; margin-top:9px; }
.ticket-verses { flex:1; display:flex; flex-direction:row-reverse; gap:6.5px; min-width:0; padding:10px 7.5px; overflow-x:auto; }
.result-title,.poem { writing-mode:vertical-rl; text-orientation:upright; text-align:start; height:225px; white-space:pre-wrap; overflow-wrap:anywhere; flex:none; }
.result-title { font-size:15.5px; color:#8e3028; line-height:1.3; }
.poem { font-size:14.5px; line-height:1.45; }
.detail { text-align:left; border-top:1px solid #c9ad8d; padding:11px 0; }
.detail-label { color:#96392d; font-weight:650; margin-bottom:4px; }
.detail-text { color:#574337; line-height:1.65; white-space:pre-wrap; }
@keyframes rock { 0%,100% { transform:perspective(125px) rotateX(-42deg); } 50% { transform:perspective(125px) rotateX(42deg); } }
@keyframes sway { 0%,100% { transform:rotate(-5deg); } 50% { transform:rotate(5deg) translateY(-4px); } }
@keyframes breathe { from { opacity:.65; transform:scale(.9); } to { opacity:1; transform:scale(1.08); } }
@keyframes float { from { opacity:.35; transform:translateY(8px); } to { opacity:1; transform:translateY(-10px); } }
@keyframes burst { from { opacity:1; transform:translateY(6px) scale(2); } to { opacity:.2; transform:translateY(-22px) scale(.7); } }
@keyframes flare { 0% { opacity:.75; transform:scale(.9); } 42% { opacity:1; transform:scale(1.37); } 100% { opacity:.7; transform:scale(1.13); } }
@keyframes retreat { to { transform:translateY(21px) scale(.82); opacity:.26; } }
@keyframes launch { 0% { opacity:0; transform:translateY(52.5px) rotate(-29deg) scale(.65); } 70% { opacity:1; transform:translateY(-14px) rotate(6deg) scale(1.06); } 100% { opacity:1; transform:translateY(-5px); } }
@keyframes fade { to { opacity:0; } }
@keyframes paper-open { from { opacity:0; transform:translateY(7px) scale(.96); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) {
  .phone,.stage .stage-cup,.stage .halo,.stage .spark,.stage .cup-tilt { animation:none; transition:none; transform:none !important; }
  .stage .slip,.result { animation:appear .2s ease-out both; }
}
@keyframes appear { from { opacity:0; } to { opacity:1; } }

.shrine { position:fixed; inset:0; z-index:1; display:flex; flex-direction:column; justify-content:space-between; overflow:hidden; background:#28170f; color:#fff0cb; }
.shrine-portrait,.shrine-shade { position:absolute; inset:0; width:100%; height:100%; }
.shrine-shade { background:linear-gradient(180deg,#1a0c08dc,transparent 26%,transparent 51%,#1a0c08ef 91%); }
.shrine-header { position:relative; padding:13px 13px 0; text-align:center; }
.shrine-back { position:absolute; top:8px; left:9px; min-height:42px; padding:0 8px; line-height:42px; background:#29150fd9; border-radius:5px; color:#fff0cb; }
.shrine-name { font:700 26.5px/1.25 "Songti SC",serif; letter-spacing:2.5px; }
.shrine-label { margin-top:5px; font-size:13.5px; color:#f0ca9b; }
.shrine-draw { position:relative; align-self:center; display:flex; flex-direction:column; align-items:center; margin:0 auto calc(15px + env(safe-area-inset-bottom)); color:#fff0cb; }
.shrine-cup { width:122px; height:122px; filter:drop-shadow(0 4px 9px #160b07); }
.shrine-action { padding:0 15px; min-height:39px; line-height:39px; border:1px solid #c89552; border-radius:5px; background:#4c2318; }

.shrine-actions { position:relative; display:flex; justify-content:center; align-items:end; gap:26px; margin-bottom:calc(15px + env(safe-area-inset-bottom)); }
.shrine-actions .shrine-draw { background:transparent; margin:0; padding:0; width:122px; }
.incense-button.lit { background:transparent; color:#f0ca9b; }
.incense-button.lit .shrine-action { background:#301c15; border-color:#9a7144; }
.incense-icon { position:relative; width:122px; height:122px; }
.incense-icon-burner { position:absolute; width:89px; height:53px; bottom:5px; left:16.5px; z-index:1; }
.incense-sticks { position:absolute; display:flex; align-items:flex-end; justify-content:center; gap:13%; width:32%; }
.incense-stick { position:relative; width:6%; min-width:2px; height:91%; background:linear-gradient(90deg,#9e301d,#d99352); border-radius:4px 4px 0 0; }
.incense-stick:nth-child(2) { height:100%; }
.incense-stick::before { position:absolute; content:""; top:0; left:50%; width:190%; aspect-ratio:1; transform:translateX(-50%); background:#ffdba0; border-radius:50%; box-shadow:0 0 8px #ff682d; }
.incense-smoke { position:absolute; bottom:100%; left:0; width:9px; height:33px; border-left:1px solid #f5dfcfa8; border-radius:50%; filter:blur(0.5px); transform-origin:bottom; animation:incense-smoke 2.2s ease-out infinite; }
.incense-stick:nth-child(2) .incense-smoke { animation-delay:-.7s; }
.incense-stick:nth-child(3) .incense-smoke { animation-delay:-1.4s; }
.incense-icon-sticks { bottom:47.5px; left:34%; height:45.5px; }

.incense-scene { position:fixed; inset:0; z-index:3; overflow:hidden; background:#200e09; color:#ffe4ad; animation:appear .24s ease-out both; }
.incense-scene-portrait,.incense-scene-shade { position:absolute; inset:0; width:100%; height:100%; }
.incense-scene-portrait { opacity:.32; }
.incense-scene-shade { background:radial-gradient(ellipse at 50% 57%,#863c1c85,transparent 55%),linear-gradient(transparent,#1d0c08 95%); }
.incense-scene-title { position:absolute; top:11%; width:100%; text-align:center; font:700 32.5px "Songti SC",serif; letter-spacing:6px; }
.incense-stage { position:absolute; left:50%; top:52%; transform:translate(-50%,-50%); width:280px; height:240px; }
.incense-stage-burner { position:absolute; left:12%; bottom:0; width:76%; height:50%; z-index:2; filter:drop-shadow(0 9px 12px #160b07); }
.incense-planted { left:34%; bottom:44%; height:44%; animation:incense-plant 3.1s both; }
.incense-hand { position:absolute; left:47%; top:8%; width:87px; height:145px; z-index:1; animation:incense-insert 3.1s cubic-bezier(.25,.7,.25,1) both; }
.incense-skip { position:absolute; right:14px; bottom:calc(12px + env(safe-area-inset-bottom)); min-height:42px; line-height:42px; color:#ffe4ad; background:#321912; border:1px solid #926239; border-radius:5px; }
@keyframes incense-insert {
  0% { opacity:0; transform:translate(110px,-67.5px); }
  36% { opacity:1; transform:translate(0,-36px); }
  61%,72% { opacity:1; transform:none; }
  91%,100% { opacity:0; transform:translate(85px,5px); }
}
@keyframes incense-plant { 0%,65% { opacity:0; } 76%,100% { opacity:1; } }
@keyframes incense-smoke { from { opacity:0; transform:translateY(0) rotate(-12deg) scale(.6); } 35% { opacity:.7; } to { opacity:0; transform:translate(8.5px,-19px) rotate(25deg) scale(1.3); } }
@media (prefers-reduced-motion: reduce) {
  .incense-smoke { animation:none; opacity:.55; }
  .incense-hand { animation:incense-plant 3.1s reverse both; }
}

.shrine-motion,.shrine-layer,.shrine-fireflies { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.shrine-motion { overflow:hidden; }
.shrine-layer { transform-origin:50% 39%; }
.shrine-layer-a { animation:portrait-drift 4.8s ease-in-out infinite; }
.shrine-layer-b { animation:portrait-drift 6.4s ease-in-out -3.6s infinite reverse; transform-origin:52% 57%; }
.shrine.wealth .shrine-layer-a { animation-duration:5.3s; animation-delay:-1.8s; }
.shrine.love .shrine-layer-a { animation-duration:5.1s; animation-delay:-1.4s; }
.shrine.peace .shrine-layer-b { animation-duration:7s; animation-delay:-2.2s; }
@keyframes portrait-drift {
  0%,100% { transform:translateX(0) rotate(0); }
  28% { transform:translate(4px,-1px) rotate(.95deg); }
  72% { transform:translate(-3.5px,1px) rotate(-.8deg); }
}
.shrine-firefly { position:absolute; width:4.5px; height:4.5px; border-radius:50%; background:#ffe3a1; box-shadow:0 0 6.5px 2px #ffc05ac7; opacity:0; animation:shrine-firefly 6s linear infinite; }
.shrine-firefly:nth-child(1) { left:12%; top:69%; animation-delay:-2.4s; }
.shrine-firefly:nth-child(2) { left:21%; top:61%; animation-duration:8s; animation-delay:-8s; }
.shrine-firefly:nth-child(3) { left:84%; top:67%; animation-duration:7.5s; animation-delay:-5.1s; }
.shrine-firefly:nth-child(4) { left:76%; top:73%; animation-duration:9s; animation-delay:-7.2s; }
.shrine-firefly:nth-child(5) { left:91%; top:50%; animation-duration:7s; animation-delay:-3.3s; }
.shrine-firefly:nth-child(6) { left:8%; top:48%; animation-duration:8.5s; animation-delay:-10.1s; }
.shrine.wealth .shrine-firefly:nth-child(odd) { animation-delay:-7s; }
.shrine.love .shrine-firefly:nth-child(even) { animation-delay:-1.3s; }
.shrine.peace .shrine-firefly:nth-child(3n) { animation-delay:-9.2s; }
@keyframes shrine-firefly {
  0% { opacity:0; transform:translate(0,8px) scale(.6); }
  24% { opacity:.58; transform:translate(8.5px,-8px) scale(.8); }
  49% { opacity:1; transform:translate(-5px,-23.5px) scale(1.1); }
  72% { opacity:.58; transform:translate(8px,-38px) scale(.8); }
  100% { opacity:0; transform:translate(-2px,-57.5px) scale(.6); }
}
.shrine-paused .shrine-layer,.shrine-paused .shrine-firefly { animation-play-state:paused; }
@media (prefers-reduced-motion: reduce) {
  .shrine-motion,.shrine-fireflies { display:none; }
}

*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:0}button:active{opacity:.82}[hidden]{display:none!important}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #c89552;outline-offset:3px}
.app{max-width:480px;min-height:100dvh;margin:auto}header{text-align:center;padding:16px;border-bottom:1px solid #dac9b2;font-weight:650}
.hero{max-width:350px}.nav,.shrine,.incense-scene{max-width:480px;margin:auto}.nav{padding-bottom:max(12px,env(safe-area-inset-bottom))}
.shrine-portrait,.shrine-layer,.incense-scene-portrait{object-fit:cover}
.shrine-cup,.incense-icon-burner,.stage-cup,.incense-stage-burner,.incense-hand{object-fit:contain}
.sheet{overflow-y:auto}.overlay{z-index:4}.incense-scene{z-index:5}.stage{height:280px}.stage-cup{max-width:100%}
.slip{display:block;text-align:center;padding:18px 10px;height:170px}.ticket{width:100%}.ticket-meta{display:block}.poem,.result-title{margin:0}
.avatar{display:block}.avatar-image{object-fit:cover}.row{min-height:52px}.editor .input{width:100%}
.toast{position:fixed;bottom:110px;left:50%;transform:translateX(-50%);background:#392920;color:white;padding:12px 18px;border-radius:8px;z-index:10;max-width:90vw}
dialog:not([open]){display:none}
dialog::backdrop{background:transparent}
dialog .sheet{max-width:416px}
.revealing>.stage-cup{opacity:.24}
button:disabled{cursor:default}
h1,h2,h3,p{margin:0}
.date,.daily .muted{margin:12px 0}
:root{color-scheme:light}
@media(max-width:350px){.page{padding-inline:18px}.shrine-actions{gap:12px}.shrine-actions .shrine-draw{width:125px}.shrine-name{font-size:24px}}
.shrine-action{padding-inline:12px;white-space:nowrap;font-size:14px}
body:has(#draw[open]),body:has(#shrine:not([hidden])){overflow:hidden}
