/* Raster art from the selected wooden-cabinet concept; live text and flames are layered separately. */
#candleVault{position:fixed;inset:0;z-index:45;display:grid;place-items:center;background:#15251e;overscroll-behavior:contain;color:#f8e6be}
.candle-stage{height:100dvh;width:min(100vw,46.2581dvh);position:relative;flex:none;container-type:inline-size;background:url('./candle-cabinet.webp') center/100% 100% no-repeat;isolation:isolate}
.candle-stage button{font-family:var(--display,'Gowun Batang',serif);cursor:pointer;box-shadow:none;-webkit-tap-highlight-color:transparent}
.candle-stage .candle-hotspot{position:absolute;border:0;background:transparent;border-radius:10px;z-index:5;color:transparent}
.candle-hotspot:focus-visible,.candle-slot:focus-visible{outline:3px solid #ffd77d;outline-offset:3px}
#candleVaultClose{left:81%;top:6.1%;width:17%;height:5.8%;min-height:44px}
#candleVaultNew{left:17%;top:82.2%;width:66%;height:7.5%;min-height:44px}
.candle-paging{position:absolute;left:20%;right:20%;top:16.75%;height:3.2%;display:flex;align-items:center;justify-content:space-between;gap:4px;z-index:6;font:12px/1.2 var(--body,sans-serif);color:#f8ddb0}
.candle-paging button{min-height:44px;min-width:44px;background:transparent;border:0;padding:0 4px;color:#f8ddb0;font-size:13px}
.candle-paging button:disabled{opacity:.28;cursor:default}
#candlePage{white-space:nowrap;text-align:center;font-size:12px}
.candle-slot{position:absolute;width:45%;height:30.4569%;border:0;border-radius:0;padding:0;background:transparent;color:#4d2a13;display:block;overflow:visible;z-index:2;box-shadow:none}
.candle-slot.col-0{left:3.75%}.candle-slot.col-1{left:51.25%}
.candle-slot.row-0{bottom:72.5888%}.candle-slot.row-1{bottom:39.4247%}.candle-slot.row-2{bottom:7.2758%}
.candle-body-art{position:absolute;left:14%;width:72%;bottom:-10.5%;aspect-ratio:1161/1355;display:block;pointer-events:none}
.candle-body-art>.candle-wax,.focus-candle>.candle-wax{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;max-width:none}
.candle-flame{position:absolute;left:50%;top:23%;width:40%;height:auto;max-width:none;transform:translate(-48%,-92%);transform-origin:48% 92%;pointer-events:none;animation:candle-dance 1.25s ease-in-out infinite alternate;will-change:transform,opacity}
.candle-copy{position:absolute;left:25%;top:28%;width:55%;height:53%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-align:center;overflow:hidden;pointer-events:none;text-shadow:none}
.candle-copy strong{flex-shrink:0;font:700 clamp(12px,3.25cqw,16px)/1.2 var(--display,'Gowun Batang',serif);max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.candle-copy .wax-wish{flex-shrink:0;font:clamp(10px,2.75cqw,13px)/1.25 var(--body,'Gowun Dodum',sans-serif);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;white-space:pre-line;word-break:keep-all;overflow-wrap:anywhere}
.candle-time{position:absolute;left:17%;right:17%;top:104%;font:clamp(10px,3cqw,14px)/1.25 var(--body,'Gowun Dodum',sans-serif);color:#fbe5bc;white-space:nowrap;text-align:center;text-shadow:0 1px 2px #3d210c;pointer-events:none}
.candle-slot.is-empty .candle-time{color:#d5b786;opacity:.65}
.candle-slot.is-empty:focus-visible,.candle-slot.is-empty:hover{background:transparent}
@keyframes candle-dance{0%{transform:translate(-48%,-92%) rotate(-3deg) scale(.93,.98);opacity:.88}37%{transform:translate(-48%,-92%) rotate(2deg) scale(1.05,1.04);opacity:1}74%{transform:translate(-48%,-92%) rotate(-1deg) scale(.97,1.09);opacity:.95}100%{transform:translate(-48%,-92%) rotate(4deg) scale(.91,1.02);opacity:1}}
#candleFocus{position:absolute;left:10%;right:10%;top:20.5%;bottom:19%;z-index:8;background:#302015 url('./candle-wood.webp') center/cover;border:2px solid #9e7037;border-radius:12px;box-shadow:0 10px 30px #100800aa;display:flex;align-items:center;justify-content:center}
#candleFocus .focus-candle{position:relative;width:100%;aspect-ratio:1161/1355;container-type:inline-size}
#candleFocus .candle-copy{top:31%;height:43%;gap:8px}
#candleFocus .candle-copy strong{font-size:clamp(16px,6cqw,23px);white-space:normal;overflow-wrap:anywhere;flex:none}
#candleFocus .wax-wish{font-size:clamp(12px,4.5cqw,17px);line-height:1.55;display:block;overflow-y:auto;white-space:pre-wrap;pointer-events:auto;-webkit-line-clamp:unset;line-clamp:unset}
#candleFocusClose{position:absolute;right:4%;top:3%;z-index:4;min-height:40px;min-width:48px;border:1px solid #bc8f50;border-radius:7px;color:#ffe5b6;background:#6a4123 url('./candle-wood.webp') center/cover;font-size:13px}
#candleFocusTime{position:absolute;left:10%;right:10%;bottom:3%;text-align:center;font:14px var(--body,sans-serif);color:#ffe5b6}
#candleDialog{box-sizing:border-box;width:min(380px,calc(100vw - 28px));max-height:88dvh;overflow-y:auto;overscroll-behavior:contain;border:5px solid #835327;border-radius:12px;padding:20px 20px 16px;background:#f6e6c5 url('./candle-paper.webp') center/100% 100% no-repeat;color:#563b24;box-shadow:0 12px 40px #100c0899}
#candleDialog::backdrop{background:#14251ce0}
#candleDialog h2{font:700 22px/1.3 var(--display,'Gowun Batang',serif);margin:0}
#candleDialog .candle-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}
#candleClose{min-width:44px;min-height:40px;padding:6px 8px;background:transparent;color:#704e30;border:0;font-size:13px}
#candleForm{display:grid;gap:7px;margin:0}
#candleForm label{font:14px var(--body,sans-serif);color:#876447}
#candleForm input,#candleForm textarea{box-sizing:border-box;width:100%;border:0;border-bottom:1px solid #aa865a;background:#fff9e973;border-radius:3px;padding:10px 8px;font:16px/1.5 var(--body,sans-serif);color:#49301e}
#candleForm textarea{min-height:92px;max-height:24dvh;resize:vertical}
#candleDialog .candle-note{font:12px/1.5 var(--body,sans-serif);color:#8a6e4c;margin:9px 0 3px}
#candleSubmit{min-height:46px;padding:11px 14px;margin-top:6px;color:#ffebbf;background:#79502d url('./candle-wood.webp') center/cover;border:1px solid #986b3a;border-radius:9px;font:700 18px var(--display,serif)}
#candleSubmit:disabled{opacity:.65;cursor:wait}
#candleStatus{font:13px/1.5 var(--body,sans-serif);min-height:1.5em;margin:9px 0 0;white-space:pre-line;color:#755235}
#candleEntryView{background:transparent;color:#7c5835;border:0;min-height:38px;margin-top:8px;font:13px var(--body,sans-serif);text-decoration:underline}
#candleActions{position:fixed;right:12px;bottom:calc(var(--chat-h,70px) + env(safe-area-inset-bottom,0px) + 92px);z-index:13;display:flex;gap:6px;flex-direction:column}
#candleActions button{min-height:40px;padding:9px 14px;font:14px var(--body,sans-serif);color:#fff0cd;background:#865b32 url('./candle-wood.webp') center/cover;border:1px solid #b78952;border-radius:9px;box-shadow:0 2px 4px #33200d55}
body.candle-vault-open #rightMenu,body.candle-vault-open #joy,body.candle-vault-open #ctxBtn,body.candle-vault-open #candleActions,body.candle-vault-open #chatBar,body.candle-vault-open #dockActions{visibility:hidden;pointer-events:none}
@media(prefers-reduced-motion:reduce){.candle-flame{animation:none;will-change:auto}}
#candleVault[hidden],#candleFocus[hidden],#candleActions[hidden]{display:none}
.candle-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#candleFocusArt{width:100%;display:block}
.candle-copy{color:#4d2a13}
body.candle-vault-open{overflow:hidden}

#candleVault:focus{outline:none}

#candleFocusPray{position:absolute;bottom:9%;left:18%;width:64%;min-height:38px;border:1px solid #b38243;border-radius:7px;background:#704521 url('./candle-wood.webp') center/cover;color:#ffe5b6;font:13px var(--body,sans-serif)}

.candle-paging button{font-weight:700;text-shadow:0 1px 2px #35200e}

/* One continuous touch rail, clipped inside the fixed wooden frame. */
#candleSlots{position:absolute;left:10%;right:10%;top:19.9%;bottom:21%;display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior:contain;touch-action:pan-x pinch-zoom;cursor:grab;-webkit-user-select:none;user-select:none}
#candleSlots::-webkit-scrollbar{display:none}
.candle-leaf{position:relative;flex:0 0 100%;height:100%;scroll-snap-align:start;scroll-snap-stop:always}
#candleSlots.is-dragging{scroll-snap-type:none;cursor:grabbing}
#candleSlots.is-dragging button{cursor:grabbing}
#candleSlots:focus-visible{outline:2px solid #ffd77d;outline-offset:-2px}
.candle-swipe-hint{position:absolute;top:19%;left:20%;right:20%;z-index:1;text-align:center;pointer-events:none;font:clamp(8px,2.4cqw,11px)/1 var(--body,sans-serif);color:#e8c590;text-shadow:0 1px 3px #211007}
