/* Full-bleed onsen; every light/motion layer is local to the generated scene. */
.tho-root {
    --tho-ink: #42483b;
    --tho-paper: #fffef3;
    --tho-focus: #f8df9c;
    position: absolute; inset: 0; z-index: 80; isolation: isolate;
    overflow: hidden; background: #273e3c; color: var(--tho-ink);
    font-family: var(--app-font-family, sans-serif); touch-action: none;
    animation: tho-enter .65s ease both;
}
.tho-root *, .tho-root *::before, .tho-root *::after { box-sizing: border-box; }
.tho-root [hidden] { display: none !important; }
.tho-root[data-closing="true"] { animation: tho-leave .3s ease both; pointer-events: none; }
.tho-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.tho-plane { position: absolute; }
.tho-art { position: absolute; inset: 0; overflow: hidden; }
.tho-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; transition: opacity 1s ease; }
.tho-time-shade { position: absolute; inset: 0; pointer-events: none; background: #473d42; opacity: var(--tho-time-shade, 0); transition: opacity 1.5s ease; }
.tho-root[data-ready="false"] .tho-plane { opacity: 0; }
.tho-plane { transition: opacity .7s ease; }
.tho-control {
    position: absolute; z-index: 8; display: grid; place-items: center;
    width: 46px; height: 46px; padding: 0; border: 1px solid #79745b33; border-radius: 50%;
    background: var(--tho-paper); color: var(--tho-ink); cursor: pointer; touch-action: manipulation;
    top: calc(12px + max(var(--thg-safe-area-top, env(safe-area-inset-top, 0px)), var(--thg-viewport-inset-top, 0px)));
    box-shadow: 0 2px 8px #102a2726; -webkit-tap-highlight-color: transparent;
}
.tho-root .tho-back { left: calc(12px + max(var(--thg-safe-area-left, 0px), var(--thg-viewport-inset-left, 0px))); font: 34px/1 sans-serif; padding-bottom: 4px; }
.tho-settings { right: calc(12px + max(var(--thg-safe-area-right, 0px), var(--thg-viewport-inset-right, 0px))); }
.tho-settings svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.tho-control:active { transform: scale(.94); }
.tho-root button:focus-visible { outline: 3px solid var(--tho-focus); outline-offset: 4px; }
.tho-item { position: absolute; z-index: 5; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 14px; transform: translate(-50%, -50%); background: transparent; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.tho-item:focus-visible { background: #fff9d117; }
.tho-item[aria-busy="true"] { cursor: progress; }
/* Lamp strength follows the painted period and dusk; by day the panes still read clearly as "on". */
.tho-root { --tho-glow: calc(.22 + .5 * var(--tho-dusk, 0)); --tho-panes: .62; }
.tho-root[data-loaded-period="night"] { --tho-glow: 1; --tho-panes: .96; }
.tho-fx { position: absolute; left: 0; width: 100%; pointer-events: none; }
.tho-water, .tho-mist { position: absolute; inset: 0; pointer-events: none; }
/* Children of a clipped node cannot blend through it, so the whole water-light group is screen-blended. */
.tho-water { overflow: hidden; mix-blend-mode: screen; }
.tho-shimmer { position: absolute; left: 8%; top: 35%; width: 86%; height: 38%; opacity: .55;
    background: radial-gradient(ellipse 32% 20% at 30% 34%, #5f8d9640, transparent 72%), radial-gradient(ellipse 26% 16% at 72% 26%, #6f9ca43d, transparent 72%), radial-gradient(ellipse 36% 22% at 52% 70%, #557f8833, transparent 72%);
    animation: tho-water-drift 17s ease-in-out infinite alternate;
}
.tho-ripple { position: absolute; border: 1px solid #d5f8eb58; border-radius: 50%; transform: translate(-50%, -50%); opacity: 0; animation: tho-ring 9s linear infinite; }
.tho-ripple::after { content: ''; position: absolute; inset: 17%; border: .7px solid #c9f6e92e; border-radius: 50%; }
.tho-impact { border-color: #e5fff47d; animation-duration: 3.6s; }
.tho-stream { position: absolute; width: 4px; transform-origin: top center; pointer-events: none; overflow: hidden; border-radius: 60%; background: linear-gradient(90deg, #c7e9dc1a, #e8f9ee8a 43%, #adceca42); }
.tho-stream-thread { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 5%, #effff177 23%, transparent 42%, #d6ede950 76%, transparent); animation: tho-flow .9s linear infinite; }
.tho-stream-thread-second { left: 50%; opacity: .5; animation-delay: -.45s; animation-duration: 1.3s; }
/* The canvas draws the real stream and ripples; these CSS stand-ins remain only for data-fx="css". */
.tho-root[data-fx="canvas"] .tho-ripple, .tho-root[data-fx="canvas"] .tho-stream { display: none; }
/* Low mist banks hugging the water; slow drift and breathing keep the pool hazy between rising wisps. */
.tho-wisp { position: absolute; transform: translate(-50%, -50%); opacity: .4; border-radius: 50%;
    background: radial-gradient(ellipse 50% 46% at 50% 56%, #f6f9f79c, #f2f6f546 46%, transparent 74%), radial-gradient(ellipse 30% 40% at 25% 50%, #f7faf866, transparent 72%), radial-gradient(ellipse 28% 38% at 76% 44%, #f4f8f766, transparent 72%);
    animation: tho-mist 23s ease-in-out infinite alternate;
}
.tho-wisp:nth-child(2n) { animation-duration: 29s; animation-direction: alternate-reverse; }
.tho-wisp:nth-child(3n) { animation-duration: 19s; }
.tho-root[data-loaded-period="night"] .tho-wisp { background: radial-gradient(ellipse 50% 46% at 50% 56%, #dbe7ee9a, #d2e0e846 46%, transparent 74%), radial-gradient(ellipse 30% 40% at 25% 50%, #dfeaf062, transparent 72%), radial-gradient(ellipse 28% 38% at 76% 44%, #d9e5ec62, transparent 72%); }
/* Lantern light: the outer node owns blend mode and on/off strength, the inner <i> the shared flame flicker. */
.tho-lamp-spill, .tho-lantern-halo, .tho-reflection { position: absolute; pointer-events: none; transform: translate(-50%, -50%); opacity: var(--tho-glow); transition: opacity .65s ease; }
.tho-lamp-spill i, .tho-lantern-halo i, .tho-reflection i { position: absolute; inset: 0; border-radius: 50%; animation: tho-flicker 6.4s ease-in-out infinite; }
.tho-lamp-spill { mix-blend-mode: soft-light; }
.tho-lamp-spill i { background: radial-gradient(closest-side, #ffc078, #ffb86eb3 25%, #ffae6352 50%, #ffa85a1a 75%, transparent); }
.tho-lantern-halo { mix-blend-mode: screen; }
.tho-lantern-halo i { background: radial-gradient(closest-side, #ffe3a8b8, #ffd08c7a 8%, #ffc07848 20%, #ffb06a29 38%, #ffa95c12 58%, #ffa55806 80%, transparent); }
.tho-reflection i { background: radial-gradient(closest-side, #ffcf8abf, #ffbf7059 38%, #ffb4601c 68%, transparent); animation: tho-flicker 6.4s ease-in-out infinite, tho-reflect 3.6s ease-in-out infinite alternate; }
.tho-lantern-light { position: absolute; overflow: visible; pointer-events: none; opacity: var(--tho-panes); transition: opacity .65s ease; }
.tho-lantern-light g { animation: tho-flicker 6.4s ease-in-out infinite; }
.tho-root[data-lantern-on="false"] .tho-lantern-halo,
.tho-root[data-lantern-on="false"] .tho-lantern-light,
.tho-root[data-lantern-on="false"] .tho-lamp-spill,
.tho-root[data-lantern-on="false"] .tho-reflection { opacity: 0; }
.tho-loading { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 40px); text-align: center; color: #f5f5e9; font-size: 14px; line-height: 1.7; }
.tho-loading p { margin: 0 0 16px; }
.tho-loading.tho-loading-inline { top: 80px; transform: translateX(-50%); padding: 10px 16px; border-radius: 16px; background: var(--tho-paper); color: var(--tho-ink); width: max-content; font-size: 12px; }
.tho-loading.tho-loading-inline p { margin: 0; }
.tho-clock-note { position: absolute; z-index: 6; top: calc(23px + max(var(--thg-safe-area-top, 0px), var(--thg-viewport-inset-top, 0px))); left: 50%; transform: translateX(-50%); max-width: calc(100% - 132px); margin: 0; padding: 4px 10px; border-radius: 16px; background: var(--tho-paper); color: var(--tho-ink); font-size: 12px; line-height: 1.5; pointer-events: none; }
.tho-retry { min-width: 100px; min-height: 44px; background: var(--tho-paper); color: var(--tho-ink); border: 0; border-radius: 24px; padding: 10px 18px; font: inherit; }
.tho-notice { position: absolute; z-index: 9; bottom: calc(20px + max(var(--thg-safe-area-bottom, env(safe-area-inset-bottom, 0px)), var(--thg-viewport-inset-bottom, 0px))); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); margin: 0; padding: 10px 18px; border-radius: 20px; background: #fdfbf0; color: #434d42; font-size: 13px; line-height: 1.6; text-align: center; pointer-events: none; }
.tho-root[data-paused="true"] *, .tho-root[data-paused="true"] *::after { animation-play-state: paused !important; }
.tho-root[data-reduced-motion="true"] .tho-wisp { animation: none; opacity: .42; }
.tho-root[data-reduced-motion="true"] .tho-ripple { animation: none; opacity: .15; }
.tho-root[data-reduced-motion="true"] .tho-shimmer, .tho-root[data-reduced-motion="true"] .tho-stream-thread,
.tho-root[data-reduced-motion="true"] .tho-lamp-spill i, .tho-root[data-reduced-motion="true"] .tho-lantern-halo i,
.tho-root[data-reduced-motion="true"] .tho-reflection i, .tho-root[data-reduced-motion="true"] .tho-lantern-light g { animation: none; }
@keyframes tho-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes tho-leave { from { opacity: var(--tho-exit-opacity, 1); } to { opacity: 0; } }
@keyframes tho-ring { 0% { transform: translate(-50%, -50%) scale(.25); opacity: 0; } 16% { opacity: .46; } 85%, 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
@keyframes tho-water-drift { from { transform: translate(-1.5%, 0) scale(.97); opacity: .4; } to { transform: translate(2%, 1.2%) scale(1.04); opacity: .7; } }
@keyframes tho-flow { from { transform: translateY(-12%) scaleY(.88); opacity: .35; } to { transform: translateY(12%) scaleY(1); opacity: .8; } }
@keyframes tho-mist { 0% { transform: translate(-60%, -46%) scale(.95, .9); opacity: .24; } 50% { opacity: .58; } 100% { transform: translate(-40%, -60%) scale(1.08, 1.12); opacity: .32; } }
/* Gentle, irregular flame breathing shared by every lantern-light layer. */
@keyframes tho-flicker { 0%, 100% { opacity: 1; } 9% { opacity: .9; } 13% { opacity: .98; } 27% { opacity: .93; } 34% { opacity: .86; } 38% { opacity: .97; } 55% { opacity: .92; } 63% { opacity: 1; } 76% { opacity: .9; } 81% { opacity: .96; } 90% { opacity: .93; } }
@keyframes tho-reflect { from { transform: scale(.88, 1.05); } to { transform: scale(1.1, .95); } }
@media (prefers-reduced-motion: reduce) { .tho-root, .tho-root * { animation: none !important; transition: none !important; } .tho-wisp { opacity: .42; } .tho-ripple { opacity: .15; } }
@media (max-height: 400px) { .tho-control { top: calc(8px + max(var(--thg-safe-area-top, 0px), var(--thg-viewport-inset-top, 0px))); } .tho-notice { bottom: 8px; padding: 6px 14px; } }
/* Reuse the garden's modal palette for the two explicit entry choices. */
.thg-root .thgp-facility-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.thg-root .thgp-facility-heading button { min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; font-size: 24px; background: transparent; }
.thg-root .thgp-facility-dialog .thgp-facility-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.thg-root .thgp-facility-actions button { min-height: 46px; width: 100%; }
.thg-root .thgp-facility-actions button:first-child { color: var(--thg-action-text); background: var(--thg-action); border-color: var(--thg-action); }
