/* External fortune styles: compatible with the unchanged style-src self policy. */
.fortune-context-actions{position:fixed;z-index:21;bottom:calc(env(safe-area-inset-bottom,0px) + 118px);left:50%;transform:translateX(-50%);width:min(320px,calc(100vw - 32px));pointer-events:none;text-align:center}.fortune-primary{width:100%;min-height:44px;padding:11px 20px;border:1px solid #eed38d91;border-radius:12px;color:#fff4cf;background:#32483ae6;box-shadow:0 0 16px #e2c16940;font:inherit;pointer-events:auto}.fortune-flow-status{margin:0 0 6px;background:#142923e6;color:#fff4d8;border-radius:8px;font-size:12px;padding:8px;pointer-events:auto}.fortune-card-badge{position:fixed;z-index:20;top:calc(env(safe-area-inset-top,0px) + 64px);left:16px;max-width:calc(100vw - 32px);padding:7px 10px;color:#f5d99c;background:#23372ce8;border:1px solid #b69a66;border-radius:9px;font:12px serif}.fortune-card-badge button{min-width:44px;min-height:44px;border:0;color:inherit;background:transparent;font:inherit}.fortune-card-dialog,.fortune-reading-dialog,.fortune-selection-dialog{width:min(520px,calc(100vw - 32px));box-sizing:border-box;padding:24px;background:#f1e8d0;color:#3b3528;border:1px solid #b69a66;border-radius:16px;max-height:calc(100dvh - 32px);overflow:auto;font-family:serif}.fortune-card-dialog::backdrop,.fortune-reading-dialog::backdrop,.fortune-selection-dialog::backdrop{background:#071e1bbd}.fortune-card-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.fortune-journey-ui dialog button{min-height:44px;font:inherit;cursor:pointer}.fortune-hanji-card{aspect-ratio:.67;border:1px solid #b8a06a;border-radius:5px;background:linear-gradient(120deg,#f4ebd2,#e9dbb6);color:#4c432e;padding:8px}.fortune-hanji-card:disabled{opacity:.5;cursor:default}.fortune-reading-text{white-space:pre-wrap;line-height:1.85}.fortune-journey-ui a:focus-visible,.fortune-journey-ui button:focus-visible{outline:3px solid #f6c76f;outline-offset:3px}.fortune-recovery,.fortune-reading-choices button{display:block;box-sizing:border-box;width:100%;padding:12px 16px;margin:8px 0;min-height:44px;border:1px solid #b69a66;border-radius:8px;color:#fff7df;background:#344f40;font:inherit;text-decoration:none;pointer-events:auto}.fortune-recovery{text-align:center}.fortune-journey-ui [hidden]{display:none!important}@media(max-width:360px){.fortune-card-choices{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-height:480px){.fortune-context-actions{bottom:calc(env(safe-area-inset-bottom,0px) + 95px)}.fortune-card-badge{top:48px}}

*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#071521;color:#f8ebce;font-family:system-ui,sans-serif}#stage{position:fixed;inset:0}canvas{display:block;width:100%;height:100%;touch-action:none}.hud{position:fixed;inset:0;pointer-events:none;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}.panel{background:#0a1724df;border:1px solid #e7c8893d;border-radius:18px;padding:14px 18px;box-shadow:0 8px 32px #0005;max-width:340px}.panel h1{font-size:18px;margin:0 0 6px}.panel p{font-size:13px;line-height:1.5;margin:0;color:#ddd5bf}.buttons{position:absolute;right:20px;top:max(18px,env(safe-area-inset-top));display:flex;gap:8px;pointer-events:auto}button{font:inherit;color:#fff3d6;background:#112232e8;border:1px solid #f1d49555;border-radius:14px;min-height:44px;padding:0 14px;cursor:pointer}.nav{position:absolute;right:max(18px,env(safe-area-inset-right));bottom:max(78px,calc(env(safe-area-inset-bottom) + 62px));display:grid;gap:8px;pointer-events:auto}.nav a{display:block;min-height:44px;padding:12px 15px;color:#fff3d6;text-decoration:none;text-align:center;background:#112232e8;border:1px solid #f1d49555;border-radius:14px;font-size:13px}.bottom{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);pointer-events:auto;text-align:center;width:min(90%,480px)}.hint{display:inline-block;padding:10px 16px;border-radius:99px;background:#0a1724e8;font-size:13px}.error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:min(90%,400px);text-align:center;pointer-events:auto}.controls{position:absolute;bottom:max(76px,calc(env(safe-area-inset-bottom) + 60px));left:max(20px,env(safe-area-inset-left));display:grid;grid-template-columns:repeat(3,48px);gap:4px;pointer-events:auto}.controls button{padding:0;min-height:48px}.controls .up{grid-column:2}.controls .left{grid-column:1}.controls .down{grid-column:2}.controls .right{grid-column:3}@media(max-width:520px){.panel{max-width:210px;padding:12px}.panel h1{font-size:15px}.panel p{font-size:12px}.buttons button{padding:0 10px}}

dialog{width:min(90vw,420px);border:1px solid #d5b877;border-radius:20px;background:#142234;color:#fff2d2;padding:24px;box-shadow:0 20px 80px #0009}dialog::backdrop{background:#020a12bd}dialog h2{margin:0 0 10px}dialog p{line-height:1.6}.dialog-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}.dialog-actions a{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border:1px solid #e5c99288;border-radius:14px;color:#fff2d2;text-decoration:none}#study-open{margin-bottom:8px;background:#7c4e22;border-color:#e3bc79}
#personal-readings{display:grid;gap:8px}.reading-choice{text-align:left;width:100%}

#rest-open{margin-bottom:8px;background:#415b45;border-color:#b2c5a2}
.scroll-eyebrow{color:#dec89d;font-size:13px;letter-spacing:.08em}.scroll-basis{font-size:12px;color:#d8cab2}#scroll-action{color:#f3d69b}

.nav{display:block;max-height:min(68dvh,460px);overflow:auto}.nav summary{display:flex;align-items:center;justify-content:center;min-height:44px;padding:0 14px;cursor:pointer;list-style:none;background:#112232e8;border:1px solid #f1d49555;border-radius:14px}.nav summary::-webkit-details-marker{display:none}.nav nav{display:grid;gap:8px;margin-top:8px}.nav nav button{width:100%}@media(max-height:650px){.hint{font-size:11px;padding:6px 10px}.controls{grid-template-columns:repeat(3,44px)}.controls button{min-height:44px}.nav{bottom:max(70px,calc(env(safe-area-inset-bottom) + 55px));max-height:55dvh}}

#flower-list{display:flex;flex-wrap:wrap;gap:6px;max-height:28dvh;overflow:auto}#flower-list button{min-height:44px;font-size:13px}

.fallback-links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:16px}.fallback-links a{display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border:1px solid #f1d49555;border-radius:12px;color:#fff3d6;text-decoration:none}

.controls button{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
@supports(height:100dvh){html,body{height:100dvh}}
.buttons{right:max(20px,env(safe-area-inset-right))}

/* 이 별도 확인용 화면에서는 서버 연동 기능을 노출하지 않는다. */
#scroll-open, #personalize, #friend, #flower-open, #flower-page, #theme-share, .nav a:not([data-garden-report]), #study-dialog a, #personal-dialog a, #scroll-dialog a, #flower-dialog a { display: none !important; }

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:600px){.buttons{right:max(16px,env(safe-area-inset-right))}}

#study-books,#study-samples{display:grid;gap:8px;margin:8px 0 16px}
#study-books a,#study-samples a{display:block;min-height:44px;padding:11px 14px;color:#fff3d6;text-decoration:none;border:1px solid #f1d49555;border-radius:12px;background:#112232e8}

.sound-toggle{display:grid;place-items:center;width:44px;padding:0!important}.sound-toggle[aria-pressed="false"] .sound-waves,.sound-toggle[aria-pressed="true"] .sound-muted{display:none}.sound-toggle:focus-visible{outline:2px solid #f1d495;outline-offset:3px}

/* A direct, quiet healing dock. Contextual navigation stays in the top menu. */
[hidden]{display:none!important}
button:focus-visible,.nav summary:focus-visible{outline:2px solid #f1d495;outline-offset:3px}
button:disabled{cursor:wait;opacity:.45}
.nav{top:max(18px,env(safe-area-inset-top));left:max(18px,env(safe-area-inset-left));right:auto;bottom:auto;max-width:min(240px,calc(100vw - 36px));max-height:calc(100dvh - 150px)}
.nav:not([open]){overflow:visible}
.nav nav{padding:3px 0}
.nav nav button{margin:0!important}
.controls{bottom:max(112px,calc(env(safe-area-inset-bottom) + 104px))}
.bottom{bottom:max(16px,calc(env(safe-area-inset-bottom) + 8px));width:min(560px,calc(100% - max(24px,env(safe-area-inset-left)) - max(24px,env(safe-area-inset-right))));display:flex;flex-direction:column;align-items:center;gap:12px;pointer-events:none}
.healing-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;width:100%;justify-content:center;pointer-events:auto}
.healing-actions[hidden],.healing-actions > [hidden]{display:none!important}
.healing-action{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:76px;padding:10px 7px;font-size:13px;line-height:1.25;word-break:keep-all;background:#0d2230e8;border-color:#d7c08b66;box-shadow:0 4px 18px #0004;touch-action:manipulation}
.healing-action svg{width:22px;height:22px;flex:none}
.healing-action span{min-height:2.5em;display:flex;align-items:center;justify-content:center;text-align:center}
.healing-action[aria-pressed="true"]{color:#fff5dc;background:#3e4c40ef;border-color:#f1d495;box-shadow:0 0 0 1px #e5c99244,0 4px 20px #0004}
.status-toast{max-width:min(100%,460px);margin:0;padding:10px 15px;border:1px solid #d7c08b40;border-radius:14px;background:#0a1724ed;color:#f8ebce;font-size:13px;line-height:1.45;overflow-wrap:anywhere;text-align:center;pointer-events:none}
@media(max-width:900px),(pointer:coarse){.controls{display:none}}
@media(max-width:600px){
  .nav{left:max(12px,env(safe-area-inset-left));top:max(16px,env(safe-area-inset-top))}
  .nav summary{padding:0 12px;font-size:13px}
  .bottom{width:calc(100% - max(12px,env(safe-area-inset-left)) - max(12px,env(safe-area-inset-right)));gap:10px}
  .healing-actions{gap:6px}
  .healing-action{min-height:76px;padding:9px 4px;font-size:12px;border-radius:14px}
  .healing-action svg{width:21px;height:21px}
}
@media(max-height:500px){
  .healing-action{min-height:48px;padding:7px 8px;flex-direction:row;gap:6px;font-size:12px}
  .healing-action span{min-height:0}
  .healing-action svg{width:18px;height:18px}
  .nav{max-height:calc(100dvh - 116px)}
  .status-toast{font-size:12px;padding:7px 11px}
}

/* Quiet, low-profile controls: four actions and More share one bottom row. */
.bottom{width:min(620px,calc(100% - 340px));gap:8px}
.healing-actions{grid-template-columns:repeat(4,minmax(0,1fr)) 70px;gap:8px;align-items:end}
.healing-action,.nav summary{min-height:44px;height:44px;border-radius:12px;background:#10232b52;border:1px solid #e4d9b83d;box-shadow:none;color:#fff3d6;text-shadow:0 1px 3px #000b;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
.healing-action{flex-direction:row;gap:6px;padding:5px 7px;font-size:12px;line-height:1.2}
.healing-action svg{width:17px;height:17px}
.healing-action span{min-height:0}
.healing-action[aria-pressed="true"]{background:#5569536b;border-color:#e8d5a494;box-shadow:inset 0 0 0 1px #e8d5a426}
.nav{position:relative;inset:auto;max-width:none;width:100%;max-height:none;overflow:visible;display:block}
.nav summary{padding:0 8px;font-size:12px;gap:4px}
/* Native details state keeps the visible and accessible label in sync. */
.nav:not([open]) .more-label-open,.nav[open] .more-label-closed{display:none}
.nav nav{position:absolute;right:0;bottom:calc(100% + 8px);width:min(224px,calc(100vw - 24px));max-height:min(420px,calc(100dvh - max(12px,env(safe-area-inset-top,0px)) - max(16px,calc(env(safe-area-inset-bottom,0px) + 8px)) - 52px));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;align-content:start;scroll-padding-block:10px;margin:0;padding:10px;gap:7px;border:1px solid #d7c08b45;border-radius:14px;background:#0b1b26d9;box-shadow:0 6px 24px #0003;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.nav nav button{min-height:44px;font-size:13px;background:#1a30448c}
.controls{left:auto;right:max(16px,env(safe-area-inset-right));bottom:max(16px,calc(env(safe-area-inset-bottom) + 8px));grid-template-columns:repeat(3,44px);gap:4px}
.controls button{min-height:44px;height:44px;background:#10232b52;border-color:#e4d9b83d;border-radius:12px;text-shadow:0 1px 3px #000b;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
@media(max-width:900px),(pointer:coarse){
 .bottom{width:min(620px,calc(100% - max(12px,env(safe-area-inset-left)) - max(12px,env(safe-area-inset-right))))}
 .controls{display:none}
}
@media(max-width:600px){
 .healing-actions{grid-template-columns:repeat(4,minmax(0,1fr)) 60px;gap:5px}
 .healing-action{padding:4px;font-size:11px}
 .healing-action svg{display:none}
 .nav summary{padding:0 5px;font-size:11px;gap:3px}
}

/* Completion light stays in this small corner; never over the avatar or actions. */
.healing-progress{--energy:0%;position:absolute;top:max(20px,env(safe-area-inset-top));left:max(18px,env(safe-area-inset-left));width:150px;pointer-events:none}
.energy-heading{display:flex;justify-content:space-between;margin-bottom:6px;padding:0 1px;font-size:11px;line-height:14px;color:#fff0c6;text-shadow:0 1px 4px #000}
.energy-track{position:relative;height:9px;border:1px solid #e6dcb350;border-radius:8px;background:#08192399;box-shadow:0 1px 7px #0005}
.energy-fill{position:absolute;inset:0 auto 0 0;width:var(--energy);max-width:100%;border-radius:inherit;background:linear-gradient(90deg,#6fc8c4,#b8ead1 45%,#ffe5a1 80%,#fff5cf);box-shadow:0 0 6px #b5e3b94d;transition:width 1.05s cubic-bezier(.16,.75,.25,1)}
.energy-sweep{position:absolute;inset:-1px;overflow:hidden;border-radius:inherit;opacity:0}
.energy-sweep::after{content:"";position:absolute;width:35%;height:100%;background:linear-gradient(90deg,transparent,#fffbe8,transparent);transform:translateX(-120%)}
.energy-sparks{position:absolute;left:clamp(8px,var(--energy),142px);top:3px;width:1px;height:1px;transition:left 1.05s cubic-bezier(.16,.75,.25,1)}
.energy-sparks i{position:absolute;width:3px;height:3px;background:#fff2ba;opacity:0;border-radius:1px;box-shadow:0 0 5px #ffed9c;--sx:8px;--sy:-13px;--delay:0ms}
.energy-sparks i:nth-child(2){--sx:-7px;--sy:-10px;--delay:90ms}.energy-sparks i:nth-child(3){--sx:11px;--sy:9px;--delay:170ms}.energy-sparks i:nth-child(4){--sx:-5px;--sy:12px;--delay:260ms}
.is-charging .energy-fill{animation:energy-glow 1.25s ease-out}
.is-charging .energy-sweep{animation:energy-shimmer 1.1s ease-out}.is-charging .energy-sweep::after{animation:energy-flow 1.1s ease-out}
.is-charging .energy-sparks i{animation:energy-spark 850ms var(--delay) ease-out}
@keyframes energy-glow{0%{filter:brightness(1)}35%{filter:brightness(1.8);box-shadow:0 0 12px #fff3a9cc,0 0 20px #80dace66}100%{filter:brightness(1)}}
@keyframes energy-shimmer{0%,100%{opacity:0}20%,65%{opacity:.85}}
@keyframes energy-flow{to{transform:translateX(390%)}}
@keyframes energy-spark{0%{opacity:0;transform:translate(0,0) scale(.5)}25%{opacity:1}100%{opacity:0;transform:translate(var(--sx),var(--sy)) scale(0)}}
@media(max-width:600px){.healing-progress{left:max(12px,env(safe-area-inset-left));top:max(20px,env(safe-area-inset-top));width:140px}.energy-sparks{left:clamp(8px,var(--energy),132px)}}
@media(prefers-reduced-motion:reduce){.energy-fill,.energy-sparks{transition:none}.is-charging .energy-fill,.is-charging .energy-sweep,.is-charging .energy-sweep::after,.is-charging .energy-sparks i{animation:none}.energy-sweep,.energy-sparks{display:none}}

/* Player choice stays inside More; no extra floating selector or NPC controls. */
.avatar-settings:empty{display:none}
.avatar-settings{padding-bottom:9px;border-bottom:1px solid #e4d9b82b}
.avatar-picker{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:#fff3d6}
.avatar-picker select{color-scheme:dark;min-width:108px;min-height:44px;max-width:65%;padding:0 34px 0 10px;border:1px solid #e4d9b855;border-radius:10px;appearance:none;-webkit-appearance:none;background:#142c3b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23fff3d6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center/12px 8px;color:#fff3d6;font:inherit;font-size:13px;cursor:pointer}
.avatar-picker select:focus-visible{outline:2px solid #f1d495;outline-offset:3px}
.avatar-picker-status{display:block;margin-top:7px;font-size:11px;line-height:1.45;color:#e6dac0;overflow-wrap:anywhere}
.avatar-picker-status:empty{display:none}

/* Keep the platform arrow visible in Windows high-contrast mode. */
@media(forced-colors:active){.avatar-picker select{appearance:auto;-webkit-appearance:auto;background-image:none;padding-right:10px}}

/* One contextual trip above the dock; the open More panel clears its 44px row. */
.area-travel{align-self:flex-end;pointer-events:auto;min-height:44px;padding:0 14px;font-size:12px;border-radius:12px;background:#10232bb3;border:1px solid #e4d9b85c;color:#fff3d6;text-shadow:0 1px 3px #000b;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);touch-action:manipulation}

.ambient-volume{display:flex;align-items:center;gap:10px;padding:10px 12px;color:#e8dbc2;font-size:13px}.ambient-volume input{min-width:80px;width:110px;accent-color:#e9ac66;touch-action:pan-y;min-height:36px}

/* Nearby actions sit centrally just above the permanent dock, not inside More. */
.healing-actions{grid-template-columns:repeat(3,minmax(0,1fr)) 70px}
.context-actions{display:flex;justify-content:center;align-items:center;gap:8px;max-width:100%;pointer-events:auto}
.context-actions[hidden],.context-actions button[hidden]{display:none!important}
.context-actions .context-action{display:flex;align-items:center;justify-content:center;min-height:44px;min-width:112px;max-width:100%;padding:0 16px;border-radius:14px;background:#28372fe8;border:1px solid #c8c09c99;color:#fff3d6;font:inherit;font-size:13px;box-shadow:0 3px 14px #07181340;text-align:center;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.context-actions .context-action:active{background:#51634d}
.context-actions .context-action:focus-visible{outline:2px solid #efce91;outline-offset:3px}
@media(hover:hover) and (pointer:fine){.context-actions .context-action:hover{background:#40523f}}
@media(max-width:600px){.healing-actions{grid-template-columns:repeat(3,minmax(0,1fr)) 60px}}
@media(max-height:480px){.bottom{gap:6px}.area-travel{min-height:36px}.context-actions .context-action{min-height:44px}}

/* The study offers destinations; the scene offers actions on arrival. No More menu. */
.healing-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
.study-travel{width:min(420px,100%);pointer-events:auto;text-align:center}
.study-travel[hidden]{display:none!important}
.study-travel p{margin:0 0 7px;color:#fff3d6;font-size:14px;text-shadow:0 1px 4px #000}
.study-destinations{display:flex;justify-content:center;gap:6px}
.study-destinations button{flex:1;min-height:44px;min-width:0;padding:7px 9px;border-radius:12px;background:#28372fe8;border:1px solid #c8c09c99;color:#fff3d6;font:inherit;font-size:13px;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.study-destinations button[hidden]{display:none!important}
.study-destinations button:disabled{color:#b4b8ad;border-style:dashed;opacity:.65;cursor:default}
.study-travel .travel-note{font-size:11px;color:#d4d9cc;margin:5px 0 0}
.study-destinations button:not(:disabled):active{background:#51634d}
@media(hover:hover) and (pointer:fine){.study-destinations button:not(:disabled):hover{background:#40523f}}
@media(max-height:480px){.study-travel p{margin-bottom:4px}.study-travel .travel-note{margin-top:3px}}

/* Two contextual button rows maximum, directly above the permanent action row.
   Mint glow is static: no blinking or color-only state communication. */
.context-zone{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;pointer-events:none}
.context-zone [hidden]{display:none!important}
.context-zone .area-travel{align-self:center}
.context-zone .context-caption,.travel-state p{margin:0;color:#dcfff3;font-size:12px;line-height:1.35;text-shadow:0 1px 4px #071b17;text-align:center}
.context-zone button:not(:disabled),.context-zone .fortune-recovery{border:1px solid #7ef6cf;color:#defff4;background:#133c35ed;box-shadow:0 0 11px #48e8b52e,inset 0 0 8px #48e8b50d;min-height:44px;pointer-events:auto;touch-action:manipulation}
.context-zone button:focus-visible,.context-zone a:focus-visible{outline:3px solid #b8ffe7;outline-offset:3px}
.context-zone button:not(:disabled):active{background:#27604f}
.context-zone .context-action,.context-zone .area-travel{border-radius:12px}
.travel-state{display:flex;flex-direction:column;align-items:center;gap:6px;width:min(320px,100%);pointer-events:auto}
.travel-state button{padding:8px 20px;min-width:136px;border-radius:12px;font:inherit;font-size:13px}
#fortune-action-slot{width:min(420px,100%)}
.bottom .fortune-context-actions{position:static;transform:none;width:100%;display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin:0;pointer-events:none}
.bottom .fortune-context-actions .fortune-flow-status{grid-column:1/-1;margin:0;padding:6px;font-size:12px}
.bottom .fortune-context-actions .fortune-primary{grid-column:1/-1;width:100%;padding:8px 12px;border-radius:12px;font:inherit;font-size:13px}
.bottom .fortune-context-actions .fortune-recovery{margin:0;padding:8px;font-size:12px;border-radius:12px}
@media(prefers-reduced-motion:reduce){.context-zone *{animation:none!important;transition:none!important}}
@media(forced-colors:active){.context-zone button:not(:disabled){border:2px solid ButtonText;box-shadow:none}}

.fortune-journey-ui .fortune-card-badge{position:fixed;top:calc(env(safe-area-inset-top,0px) + 64px);left:max(12px,env(safe-area-inset-left,0px));z-index:20;display:flex;flex-wrap:wrap;gap:2px;width:184px;max-width:calc(100vw - 32px);padding:0;border:0;background:transparent;box-shadow:none}
.fortune-journey-ui .fortune-owned-icon{display:flex;align-items:center;justify-content:center;text-align:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:7px;border:2px solid transparent;border-radius:8px;background:linear-gradient(110deg,#e9dcaf,#b79c65);background-clip:content-box;color:#392f1d;font:18px serif;pointer-events:auto;touch-action:manipulation}
.fortune-journey-ui .fortune-owned-icon[aria-pressed="true"]{border-color:#c0ffe6;box-shadow:0 0 8px #9ee8c4}.fortune-journey-ui .fortune-owned-icon:focus-visible{outline:3px solid #fff5be;outline-offset:1px}.fortune-journey-ui .fortune-owned-icon:disabled{opacity:.6}

/* Direct 3D target equivalents for keyboard and assistive technology. No visible destination menu. */
.scene-semantic-target{position:absolute;width:1px;height:1px;min-width:0;min-height:0;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;pointer-events:none}
/* Transparent HUD layout/gaps must not swallow a visible floor tap. */
.travel-state,.context-actions,.healing-actions,.controls,.fortune-journey-ui .fortune-card-badge{pointer-events:none}
.travel-state button,.context-actions button,.healing-actions button,.controls button,.fortune-journey-ui .fortune-card-badge button{pointer-events:auto}

/* Contextual actions stay centered above the permanent dock. Keep native
   44px targets; only gaps and padding tighten in short landscape viewports. */
.context-actions{display:flex;flex-wrap:wrap;justify-content:center;width:min(420px,100%);gap:6px;--context-action-gap:6px}
.context-actions .context-action{flex:0 1 calc((100% - var(--context-action-gap))/2);min-width:0;width:auto;text-align:center}
.context-actions:not(:has(> .context-action:not([hidden]) ~ .context-action:not([hidden]))) > .stone-action-trigger[data-active="true"]:not([hidden]){flex-basis:min(180px,100%)}
@media(max-height:480px){
 .bottom{bottom:max(8px,calc(env(safe-area-inset-bottom,0px) + 8px));gap:4px}
 .context-zone,.context-actions,.travel-state{gap:4px}
 .context-actions{--context-action-gap:4px}
 .context-zone .context-caption,.travel-state p{font-size:11px;line-height:1.25}
 .context-actions .context-action{height:44px;min-height:44px;padding:0 10px;font-size:12px}
 .bottom .fortune-context-actions{gap:4px}
 .bottom .fortune-context-actions .fortune-primary,.bottom .fortune-context-actions .fortune-recovery{padding:4px 8px}
 .healing-action{height:44px;min-height:44px;padding:4px 6px}
}

/* v27 animal follow-up: keep permanent controls one row; pet is nearby only. */
.healing-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
.context-actions #healing-cat{gap:6px}
.context-actions .context-action span{min-width:0;text-align:center}
.context-actions #healing-cat svg{width:18px;height:18px;flex:none}
.context-actions #healing-cat[aria-pressed="true"]{background:#51634d;border-color:#e8d5a4}

/* Reading anywhere: the antique binding frames a quiet, bright hanji page. */
.fortune-reading-dialog{width:min(780px,calc(100vw - 24px));padding:24px 28px 18px;border:1px solid #796443;border-left:8px solid #61513a;border-radius:5px 12px 12px 5px;background:linear-gradient(90deg,#e7dcc5 0,#faf6eb 22px,#fffdf7 48%);color:#302c25;box-shadow:0 18px 64px #08171166,inset 2px 0 0 #d8bf8a;overscroll-behavior:contain;scrollbar-gutter:stable;transform-origin:15% 50%}
.fortune-reading-dialog[open]{animation:fortune-reader-unfold .28s ease-out}
.fortune-reading-dialog::before{content:"";display:block;position:absolute;top:0;right:32px;width:14px;height:34px;background:#8d594b;clip-path:polygon(0 0,100% 0,100% 100%,50% 80%,0 100%);pointer-events:none}
.fortune-reading-dialog>h2{padding-right:24px;font-size:clamp(21px,5vw,28px);line-height:1.45;word-break:keep-all}
.fortune-reading-text{font-family:"Apple SD Gothic Neo","Malgun Gothic",sans-serif;font-size:17px;line-height:1.9;overflow-wrap:anywhere;word-break:keep-all;letter-spacing:0;max-width:66ch;margin:24px auto;background:transparent}
.fortune-reading-dialog>p[role=status]:empty{display:none}
.fortune-reading-close{min-width:64px;min-height:44px;color:#302c25;background:#f7f1e5;border:1px solid #aa9676;border-radius:6px;padding:8px 16px;position:sticky;bottom:0}
.fortune-reading-dialog :focus-visible{outline:3px solid #62502d;outline-offset:3px}
@keyframes fortune-reader-unfold{from{opacity:.25;transform:perspective(900px) rotateY(-5deg)}to{opacity:1;transform:none}}
@media(max-width:480px){.fortune-reading-dialog{padding:20px 16px 14px;border-left-width:5px;max-height:calc(100dvh - 16px)}.fortune-reading-text{font-size:17px;line-height:1.85;margin:18px auto}}
@media(prefers-reduced-motion:reduce){.fortune-reading-dialog[open]{animation:none}}

/* Confirmed explicit card receipt only. Decorative layer never captures touch. */
.fortune-receipt-flight{position:fixed;left:0;top:0;z-index:24;display:grid;place-items:center;box-sizing:border-box;border:1px solid #f7d88a;border-radius:3px;background:linear-gradient(180deg,var(--fortune-kind-color) 0 24%,#fff6d5 24%,#c5a660 100%);color:#473720;font:16px serif;line-height:1;pointer-events:none!important;user-select:none;transform-origin:center;will-change:transform,opacity;box-shadow:0 0 calc(8px + 15px * var(--receipt-glow,0)) #ffe6a8,0 0 4px #fff7da;overflow:hidden}
.fortune-journey-ui .fortune-owned-icon.fortune-receipt-arrived{border-color:#ffedb0;box-shadow:0 0 14px #ffe3a8,inset 0 0 7px #fff5ce}
@media(prefers-reduced-motion:reduce){.fortune-receipt-flight{display:none}}

/* Same existing bookshelf hue on fan, choice, receipt and inventory; text stays visible. */
.fortune-journey-ui .fortune-hanji-card{border-top:6px solid var(--fortune-kind-color,#b8a06a)}
.fortune-journey-ui .fortune-owned-icon{background-image:linear-gradient(180deg,var(--fortune-kind-color) 0 24%,#e9dcaf 24%,#b79c65 100%)}

/* One discovered action in the existing conditional row, no permanent control. */
#bell-ring[hidden]{display:none!important}


/* Opt-in contextual map entry. Existing permanent controls/legacy hidden menu
   are untouched. Product and review factories remain disconnected by default. */
.garden-map-entry{pointer-events:auto;min-height:44px;align-self:center;max-width:100%;background:#28372fe8;border-color:#c8c09c99}
.garden-map-entry-status:empty{display:none}.garden-map-entry-status{font-size:12px;max-width:280px;text-align:center}
.garden-map-entry:focus-visible,.garden-map-surface button:focus-visible{outline:2px solid #efce91;outline-offset:3px}
.garden-map-surface{position:fixed;z-index:22;left:max(16px,env(safe-area-inset-left));top:max(72px,calc(env(safe-area-inset-top) + 56px));width:min(340px,calc(100vw - 32px));max-height:calc(100dvh - 230px);overflow:auto;padding:14px;background:#0a1724f0;border:1px solid #e7c88966;border-radius:16px;pointer-events:auto;overscroll-behavior:contain}
.garden-map-surface[hidden]{display:none!important}.garden-map-surface h2{font-size:16px}.garden-map-surface p{font-size:13px;line-height:1.6}.garden-map-surface button{margin:4px;min-height:44px}.garden-map-surface button:disabled,.garden-map-entry:disabled{opacity:.55;cursor:default}
@media(max-height:480px){.garden-map-surface{top:max(8px,env(safe-area-inset-top));max-height:calc(100dvh - 140px);width:min(320px,calc(100vw - 180px))}}
/* The relationship's accessible close uses canvas CSS pixels. Keep its parent
   origin at the canvas, not the catalogue panel. Only real panels block taps. */
.garden-map-surface{inset:0;width:100%;max-height:none;padding:0;overflow:visible;background:none;border:0;border-radius:0;pointer-events:none}
.garden-map-close{position:absolute;left:max(16px,env(safe-area-inset-left));top:max(16px,env(safe-area-inset-top));pointer-events:auto}
.garden-map-surface .friend-map-catalogue,.garden-map-surface .friend-map-panel{position:absolute;left:max(16px,env(safe-area-inset-left));top:max(72px,calc(env(safe-area-inset-top) + 56px));width:min(340px,calc(100vw - 32px));max-height:calc(100dvh - 230px);overflow:auto;padding:14px;background:#0a1724f0;border:1px solid #e7c88966;border-radius:16px;pointer-events:auto;overscroll-behavior:contain}
.garden-map-surface .friend-map-panel{left:auto;right:max(16px,env(safe-area-inset-right))}.garden-map-surface [hidden]{display:none!important}
.group-title-editor{position:fixed;z-index:1001;box-sizing:border-box;pointer-events:auto}
.group-title-editor button,.group-title-editor input{box-sizing:border-box;width:100%;height:100%;min-height:44px;font:inherit}.group-title-editor button{border:0;background:transparent;color:transparent;cursor:text}.group-title-editor button:focus-visible{outline:2px solid #f1d58f}.group-title-editor input{padding:7px;color:#fff9e8;background:#132638;border:1px solid #e7c889}.group-title-editor p{position:absolute;top:100%;left:0;width:max(220px,100%);box-sizing:border-box;margin:4px 0 0;padding:5px 8px;border-radius:8px;background:#0a1724f0;color:#fff9e8}
@media(max-height:480px){.garden-map-surface .friend-map-catalogue,.garden-map-surface .friend-map-panel{top:max(64px,env(safe-area-inset-top));max-height:calc(100dvh - 150px);width:min(320px,calc(100vw - 180px))}}

/* Normal garden controls: same-origin styles preserve the unchanged style-src self policy. */
.garden-flow-launch{position:absolute;left:12px;top:76px;z-index:35;pointer-events:auto;min-height:44px;padding:10px 16px;background:#f9f7ed;color:#283b35;border:1px solid #8a9d8b;border-radius:18px;font:inherit}
.garden-flow-dialog{position:fixed;inset:0;margin:auto;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 48px);box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:22px;border:1px solid #8a9d8b;border-radius:18px;background:#f9f7ed;color:#283b35;font:15px/1.55 sans-serif;pointer-events:auto}
.garden-flow-dialog::backdrop{background:#12282270}.garden-flow-dialog h2{margin:0 0 12px;font-size:21px}.garden-flow-dialog section{margin:16px 0}.garden-flow-dialog button,.garden-flow-dialog input,.garden-flow-dialog select{font:inherit;min-height:44px;box-sizing:border-box;max-width:100%;padding:9px 12px}.garden-flow-dialog button{margin:4px 6px 4px 0;border:1px solid #8a9d8b;border-radius:10px;background:#fff;color:#283b35}.garden-flow-dialog input,.garden-flow-dialog select{width:100%}.garden-flow-dialog label{display:block}.garden-flow-dialog [role=status]{white-space:pre-line}.garden-flow-dialog :focus-visible,.garden-flow-launch:focus-visible{outline:3px solid #527561;outline-offset:3px}
.public-garden-scene-panel{position:fixed;z-index:45;top:76px;right:12px;width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 160px);overflow:auto;box-sizing:border-box;padding:14px;background:#f9f7ed;color:#283b35;border:1px solid #8a9d8b;border-radius:12px;pointer-events:auto;font:14px/1.5 sans-serif}.public-garden-scene-panel:not(:has(> div:not([hidden]))){display:none}.public-garden-scene-panel button{min-height:44px;margin:4px;padding:8px}
@media(max-width:640px){.public-garden-scene-panel{top:auto;bottom:max(176px,calc(env(safe-area-inset-bottom) + 160px));right:12px;left:12px;width:auto;max-height:calc(100dvh - 260px)}}@media(max-height:520px){.public-garden-scene-panel{top:12px;bottom:auto;max-height:calc(100dvh - 24px)}}
[data-care-targeting="true"] .public-garden-scene-panel{display:none!important}

/* Keep all visible contextual actions centered, including a single cat action. */
.bottom .context-actions,.bottom .fortune-context-actions{justify-content:center;align-items:center;margin-inline:auto}
.bottom .context-actions>button,.bottom .fortune-context-actions>button{justify-content:center;text-align:center}
.bottom .area-travel{align-self:center}
.bottom .healing-actions{order:20}
.bottom .context-zone{order:10}
/* Optional explicit bridge contract: contextual actions → map → status → permanent actions.
   Keep map/status order independent of async insertion, without fixed positioning. */
.bottom > .garden-map-entry{order:11;align-self:center;text-align:center}
.bottom > .garden-map-entry-status{order:12;align-self:center;text-align:center}
/* Small, contextual input/share surfaces, not the full garden dashboard. */
.garden-entry-dialog,.garden-share-dialog{max-width:min(360px,calc(100vw - 40px));border:0;background:rgba(14,25,27,.9);color:#f3efdd;border-radius:20px;padding:24px;text-align:center;box-shadow:0 12px 60px #0006}
.garden-entry-dialog::backdrop,.garden-share-dialog::backdrop{background:#07121633}
.garden-entry-dialog button,.garden-share-dialog button{min-height:44px;margin:6px;padding:10px 18px;border-radius:22px}
.garden-share-dialog input{box-sizing:border-box;width:100%;min-height:44px;color:inherit;background:#ffffff0d;border:1px solid #ffffff33;border-radius:10px;padding:8px}
.garden-plant-context{align-self:center;text-align:center}
.garden-world-notice{position:absolute;bottom:180px;left:50%;transform:translateX(-50%);max-width:min(360px,calc(100vw - 40px));padding:10px 14px;border-radius:16px;background:#142c2bdb;color:#f2eddb;text-align:center;pointer-events:none;z-index:35;font-size:13px;line-height:1.55}
.garden-world-notice[hidden]{display:none}

.group-create-modal{max-height:86dvh;overflow-y:auto;pointer-events:auto}
/* Profile-ready spatial creation; CSP self stylesheet, no inline restoration. */
.spatial-create-form{display:grid;gap:10px;text-align:center}
.spatial-create-consent{font-size:12px;line-height:1.5;margin:0;opacity:.85}
.spatial-create-notice-toggle{cursor:pointer;min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;width:44px;border-radius:50%;list-style:none}
.spatial-create-notice{position:relative;max-width:100%;padding:0 12px;border-radius:16px;background:rgba(29,38,42,.94);color:#fff;overflow-wrap:anywhere}
.spatial-create-actions{display:flex;justify-content:center;gap:12px}
.group-create-modal.spatial-create-panel{box-sizing:border-box;width:min(340px,calc(100vw - 32px));max-height:80dvh;overflow:auto;padding:18px;border:1px solid #c9d7c24d;border-radius:20px;background:#172721f5;color:#f6f4e6}

.garden-entry-retry{position:absolute;left:50%;top:max(96px,20%);transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);padding:12px;border-radius:14px;background:#20302ee8;color:white;text-align:center;pointer-events:auto;z-index:45}
.garden-entry-retry[hidden]{display:none}
.garden-entry-retry button{min-height:44px;margin-inline:auto}

/* Only the explicit ready-relation confirmation; birth/group forms retain their layout. */
.garden-flow-dialog.garden-recovery-confirm{width:min(340px,calc(100vw - 32px));padding:16px;text-align:center}
.garden-flow-dialog.garden-recovery-confirm h2{font-size:18px;margin:0 0 8px}
.garden-flow-dialog.garden-recovery-confirm section{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:8px 0 0}
.garden-flow-dialog.garden-recovery-confirm section p{flex-basis:100%;margin:0 0 4px}
.garden-flow-dialog.garden-recovery-confirm section button{margin:0;min-height:44px}
.garden-flow-dialog.garden-recovery-confirm [role=status]:empty{display:none}

/* Fortune selection: a floating card fan, not a form/button dashboard. */
.fortune-journey-ui .fortune-card-stage{position:fixed;inset:0;margin:0;width:100%;max-width:none;height:100%;max-height:none;padding:0;border:0;border-radius:0;background:radial-gradient(ellipse at 50% 54%,#365e684d,transparent 62%);color:#fff4d8;overflow:hidden;text-align:center}
.fortune-card-stage::backdrop{background:#071b24d9;backdrop-filter:blur(5px)}
.fortune-card-stage h2{margin:calc(env(safe-area-inset-top,0px) + 38px) 55px 0;font-size:22px;font-weight:500;letter-spacing:.12em}
.fortune-card-stage>p:first-of-type{margin:28px 12px 0;font-size:15px;color:#eee2c5}
.fortune-card-stage .fortune-card-stage-close{position:absolute;right:16px;top:calc(env(safe-area-inset-top,0px) + 22px);width:44px;height:44px;border:0;background:transparent;color:#f8eddb;font-size:30px}
.fortune-card-stage .fortune-card-choices{position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);width:min(550px,94vw);height:min(320px,46dvh);display:flex;align-items:center;justify-content:center;gap:0}
.fortune-card-stage .fortune-hanji-card{position:relative;flex:0 0 clamp(52px,16vw,125px);height:clamp(124px,29vw,216px);margin:0 -4.5%;padding:17px 4px 8px;border:1px solid #e2c88a;border-top:1px solid #e2c88a;border-radius:9px;background:linear-gradient(145deg,#31434e,#172c35);box-shadow:0 8px 24px #0005,inset 0 0 0 5px #d8b47118;color:#f4e2b8;font-size:clamp(11px,2.5vw,15px);writing-mode:vertical-rl;letter-spacing:.18em;transform-origin:50% 125%;transform:rotate(var(--card-angle,0deg));transition:transform .22s,filter .22s}
.fortune-card-stage .fortune-hanji-card::before,.fortune-selected-card::before{content:attr(data-glyph);display:block;font-size:clamp(24px,6vw,44px);line-height:1.3;color:var(--fortune-kind-color);text-shadow:0 0 16px var(--fortune-kind-color)}
.fortune-card-stage .fortune-hanji-card:nth-child(1){--card-angle:-25deg}.fortune-card-stage .fortune-hanji-card:nth-child(2){--card-angle:-18deg}.fortune-card-stage .fortune-hanji-card:nth-child(3){--card-angle:-11deg}.fortune-card-stage .fortune-hanji-card:nth-child(4){--card-angle:-4deg}.fortune-card-stage .fortune-hanji-card:nth-child(5){--card-angle:4deg}.fortune-card-stage .fortune-hanji-card:nth-child(6){--card-angle:11deg}.fortune-card-stage .fortune-hanji-card:nth-child(7){--card-angle:18deg}.fortune-card-stage .fortune-hanji-card:nth-child(8){--card-angle:25deg}
.fortune-card-stage .fortune-hanji-card:not(:disabled):hover,.fortune-card-stage .fortune-hanji-card:focus-visible,.fortune-card-stage .fortune-hanji-card.is-picked{z-index:2;transform:rotate(var(--card-angle)) translateY(-22px);filter:brightness(1.3)}
.fortune-card-stage .fortune-hanji-card:disabled{opacity:.65}.fortune-card-stage .fortune-hanji-card.is-picked{opacity:1}
.fortune-card-stage>p[role=status],.fortune-card-stage>.fortune-recovery{position:absolute;bottom:calc(env(safe-area-inset-bottom,0px) + 32px);left:10%;width:80%;font-size:13px}
.fortune-card-stage[data-card-phase] .fortune-card-choices,.fortune-card-stage[data-card-phase]>p:first-of-type{visibility:hidden}
.fortune-selected-card{position:fixed;left:0;top:0;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:30px;border:1px solid #e3cd93;border-radius:12px;background:radial-gradient(ellipse,#435460,#172b36);box-shadow:0 0 65px #e6cf7940,inset 0 0 0 8px #d8b47120;color:#f4e2b8;font-size:23px;letter-spacing:.2em;pointer-events:none;will-change:transform}
.fortune-selected-card::before{font-size:64px}.fortune-card-stage[data-card-phase=flight]{background:transparent}.fortune-card-stage[data-card-phase=flight] h2{visibility:hidden}
@media(prefers-reduced-motion:reduce){.fortune-card-stage .fortune-hanji-card{transition:none}}
@media(max-height:480px){.fortune-card-stage h2{margin-top:12px}.fortune-card-stage>p:first-of-type{margin-top:8px}.fortune-card-stage .fortune-card-choices{top:58%;height:170px}.fortune-card-stage .fortune-hanji-card{height:128px}}
.fortune-selected-card{animation:fortune-card-reveal .32s cubic-bezier(.2,.7,.2,1) both}
@keyframes fortune-card-reveal{from{scale:.72;filter:brightness(1.4)}to{scale:1;filter:brightness(1)}}
@media(prefers-reduced-motion:reduce){.fortune-selected-card{animation:none}}

/* Card material v2: actual bookshelf cover colours, satin face + gilt ornament.
   Reader paper rules above are deliberately untouched. */
.fortune-card-stage .fortune-hanji-card,.fortune-selected-card{
 background-color:var(--fortune-kind-color,#33464a);
 background-image:linear-gradient(135deg,#ffffff25,transparent 42%,#00000038);
 color:#fff0cd;border-color:#ddc58f;
 box-shadow:0 10px 26px #0005,inset 0 0 0 4px #ddc58f24,inset 0 0 0 6px #ddc58f80;
}
.fortune-card-stage .fortune-hanji-card::before,.fortune-selected-card::before{color:#f5dfaa;text-shadow:0 1px 2px #0005}
.fortune-card-stage .fortune-hanji-card::after,.fortune-selected-card::after{content:'◇';position:absolute;bottom:12px;left:50%;transform:translateX(-50%);font-size:19px;color:#ddc58f;writing-mode:horizontal-tb;pointer-events:none}
.fortune-selected-card{box-shadow:0 0 65px #e6cf7930,inset 0 0 0 7px #ddc58f24,inset 0 0 0 9px #ddc58f80}
.fortune-selected-card::after{bottom:24px;font-size:30px}
.fortune-journey-ui .fortune-owned-icon{background-color:var(--fortune-kind-color,#33464a);background-image:linear-gradient(135deg,#ffffff25,transparent 42%,#00000038);color:#fff0cd;border:1px solid #ddc58f99;box-shadow:inset 0 0 0 2px #ddc58f24}
.fortune-receipt-flight{background-color:var(--fortune-kind-color,#33464a);background-image:linear-gradient(135deg,#ffffff25,transparent 42%,#00000038);color:#fff0cd}

.fortune-card-stage .fortune-hanji-card[data-kind=today],.fortune-card-stage .fortune-hanji-card[data-kind=today]::before,.fortune-selected-card[data-kind=today],.fortune-selected-card[data-kind=today]::before,.fortune-journey-ui .fortune-owned-icon[data-kind=today]{color:#352b1b;text-shadow:none}

/* Four leaves per arc keep the crests and hit areas clear on narrow screens. */
@media (max-width:540px), (pointer:coarse) and (max-width:900px) {
 .fortune-card-stage .fortune-card-choices {
  top:50%;
  width:min(360px,calc(100% - max(16px,env(safe-area-inset-left,0px)) - max(16px,env(safe-area-inset-right,0px))));
  height:auto;
  flex-wrap:wrap;
  gap:14px 3.5%;
 }
 .fortune-card-stage .fortune-hanji-card {
  --fan-angle:0deg;
  --fan-drop:0px;
  flex:0 0 22%;
  min-width:0;
  box-sizing:border-box;
  height:clamp(94px,22dvh,128px);
  margin:0;
  padding:10px 4px;
  transform-origin:center;
  transform:translateY(var(--fan-drop)) rotate(var(--fan-angle));
 }
 .fortune-card-stage .fortune-hanji-card:nth-child(4n+1 of :not([hidden])) {--fan-angle:-9deg;--fan-drop:7px}
 .fortune-card-stage .fortune-hanji-card:nth-child(4n+2 of :not([hidden])) {--fan-angle:-3deg}
 .fortune-card-stage .fortune-hanji-card:nth-child(4n+3 of :not([hidden])) {--fan-angle:3deg}
 .fortune-card-stage .fortune-hanji-card:nth-child(4n of :not([hidden])) {--fan-angle:9deg;--fan-drop:7px}
 .fortune-card-stage .fortune-hanji-card:nth-last-child(1 of :not([hidden])):nth-child(4n+1 of :not([hidden])) {--fan-angle:0deg;--fan-drop:0px}
 .fortune-card-stage .fortune-hanji-card:nth-last-child(1 of :not([hidden])):nth-child(4n+2 of :not([hidden])) {--fan-angle:9deg;--fan-drop:7px}
 .fortune-card-stage .fortune-hanji-card:nth-last-child(2 of :not([hidden])):nth-child(4n+2 of :not([hidden])) {--fan-angle:0deg}
 .fortune-card-stage .fortune-hanji-card:nth-last-child(1 of :not([hidden])):nth-child(4n+3 of :not([hidden])) {--fan-angle:9deg;--fan-drop:7px}
 .fortune-card-stage .fortune-hanji-card:not(:disabled):hover,
 .fortune-card-stage .fortune-hanji-card:focus-visible,
 .fortune-card-stage .fortune-hanji-card.is-picked {
  transform:translateY(var(--fan-drop)) rotate(var(--fan-angle));
 }
 @media (max-height:480px) {
  .fortune-card-stage .fortune-card-choices {top:58%}
  .fortune-card-stage .fortune-hanji-card {font-size:11px;letter-spacing:.12em}
  .fortune-card-stage .fortune-hanji-card::before {font-size:24px}
 }
}

/* Relationship entry only: one scroll surface, no horizontal overflow. */
.group-create-modal:has(> .relationship-entry-form){box-sizing:border-box;width:min(420px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));margin:auto;padding:18px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scroll-padding-block:18px}
.relationship-entry-form{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;max-width:100%;overflow-wrap:anywhere}
.relationship-entry-form>*{min-width:0;max-width:100%}
.relationship-entry-form h2,.relationship-entry-form p{margin:0}
.relationship-entry-form label{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;min-width:0}
.relationship-entry-form input:not([type=checkbox]),.relationship-entry-form select{box-sizing:border-box;display:block;width:100%;min-width:0;max-width:100%;min-height:44px;padding:10px;border:1px solid #c4d4bd66;border-radius:10px;background:#172721;color:#f6f4e6;font:16px/1.4 system-ui,sans-serif}
.relationship-entry-form label:has(input[type=checkbox]){display:flex;align-items:center;gap:10px;min-height:44px}
.relationship-entry-form input[type=checkbox]{flex:0 0 auto;width:20px;height:20px;margin:0}
.relationship-entry-form details{position:relative;max-width:100%;border-radius:12px;background:#172721;color:#f6f4e6;padding:0 10px}
.relationship-entry-form summary{display:flex;align-items:center;justify-content:center;width:44px;min-height:44px;cursor:pointer;list-style:none}
.relationship-entry-form details p{margin-block:10px}
.relationship-entry-form button{justify-self:center;max-width:100%;min-height:44px;padding:10px 18px;white-space:normal;text-align:center}
.relationship-entry-form [role=status]:empty{display:none}
.relationship-entry-form :focus-visible{outline:2px solid #f0d494;outline-offset:2px}

/* One explicit relationship-link action, kept in the scene without a modal backdrop. */
.garden-flow-dialog.garden-recovery-confirm{inset: auto 16px max(170px,calc(23dvh + env(safe-area-inset-bottom))) 16px;z-index:45;margin:0 auto;width:min(330px,calc(100vw - 32px));max-height:42dvh;padding:12px 14px;overflow:visible;border:1px solid #c5decf66;border-radius:22px;background:#16362feb;color:#f0f7ee;box-shadow:0 8px 24px #071c2638;backdrop-filter:blur(8px)}
.garden-flow-dialog.garden-recovery-confirm::after{content:"";position:absolute;bottom:-9px;left:calc(50% - 9px);width:16px;height:16px;background:#16362feb;border-right:1px solid #c5decf66;border-bottom:1px solid #c5decf66;transform:rotate(45deg);pointer-events:none}
.garden-flow-dialog.garden-recovery-confirm h2{display:none}
.garden-flow-dialog.garden-recovery-confirm section{margin:0;gap:6px}
.garden-flow-dialog.garden-recovery-confirm section button{background:#e5efdf;color:#193d32;border-color:#bdd4b8;border-radius:22px;text-align:center}
.garden-flow-dialog.garden-recovery-confirm section button:last-child{background:transparent;color:#e2ebdf;border-color:transparent}
.garden-flow-dialog.garden-recovery-confirm [role=status]{font-size:12px;margin:6px 0 0}
@media(max-height:500px){.garden-flow-dialog.garden-recovery-confirm{bottom:100px;max-height:60dvh;overflow:auto}}

/* Shared select breathing room; excludes listboxes/multiple selectors. */
select:not([multiple]):not([size]){appearance:none;-webkit-appearance:none;padding-inline-end:38px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%23756755' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 12px center!important;background-size:14px 10px!important;}
@media(forced-colors:active){select:not([multiple]):not([size]){appearance:auto;-webkit-appearance:auto;background-image:none!important;}}

/* Mobile exit: keep the native button and existing navigation, show a door/arrow. */
#exit .exit-icon{display:none;pointer-events:none}
#exit:focus-visible{outline:2px solid #f1d495;outline-offset:3px}
@media(max-width:600px),(hover:none) and (pointer:coarse){
 #exit{display:grid;place-items:center;width:44px;min-width:44px;min-height:44px;padding:0}
 #exit .exit-icon{display:block}
 #exit .exit-label{display:none}
}

/* Nearby actions share a centered wrapping row, including narrow touch screens. */
.context-actions{flex-wrap:wrap;justify-content:center}

/* Context actions stay on one row. Keep readable 44px controls; on narrow
   screens scroll horizontally instead of wrapping or shrinking the labels. */
.bottom #context-actions.context-actions{
 display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center;
 box-sizing:border-box;width:100%;max-width:100%;min-width:0;gap:6px;
 overflow-x:auto;overflow-y:hidden;padding:6px 4px;scroll-padding-inline:4px;
 overscroll-behavior-x:contain;touch-action:pan-x;pointer-events:auto;
 scrollbar-width:thin;scrollbar-color:#9cc9b6 transparent;
}
.bottom #context-actions.context-actions>button{
 flex:0 0 auto;box-sizing:border-box;width:auto;min-width:96px;max-width:none;
 height:auto;min-height:44px;padding:10px 14px;white-space:nowrap;
 font-size:13px;line-height:1.4;justify-content:center;text-align:center;
 touch-action:pan-x;
}
/* Hidden siblings must not prevent centering the visible action set. */
.bottom #context-actions.context-actions>button:not([hidden]){margin-inline:0}
.bottom #context-actions.context-actions>button:not([hidden]):not(:has(~button:not([hidden]))){margin-inline-end:auto}
.bottom #context-actions.context-actions>button:not([hidden]):not(button:not([hidden])~button){margin-inline-start:auto}

/* Wunari outline brand control: same 44px target, quiet pointer feedback. */
#constellation-overview-open{transition:background-color .15s,border-color .15s}#constellation-overview-open:hover,#constellation-overview-open[aria-expanded="true"]{background:#20384a;border-color:#f1d495}#constellation-overview-open:active{background:#30485a}
.nav nav select{width:100%;min-height:44px;padding:0 12px;color:#fff3d6;background:#1a3044;border:1px solid #f1d49555;border-radius:12px;font:inherit;font-size:13px}
.personal-constellation-overlay{position:fixed;inset:0;z-index:100;background:#101b2bf2;display:grid;grid-template-rows:auto minmax(0,1fr);padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
.personal-constellation-overlay{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;border-radius:0;overflow:hidden}
.personal-constellation-overlay:not([open]){display:none}
.personal-constellation-reset{display:grid;place-items:center;flex:0 0 44px;width:44px;padding:0;margin-inline-start:auto;touch-action:manipulation}
.personal-constellation-overlay [data-constellation-stage]{position:relative}
.personal-constellation-overlay [data-constellation-stage] canvas{touch-action:none;cursor:grab}
.constellation-back-wrap{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:3;pointer-events:none}
.constellation-back-wrap[hidden]{display:none}
.constellation-back{pointer-events:auto;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 18px;border:1px solid #e2c88a;border-radius:999px;background:#0b1723e6;color:#ffeac0;font:700 14px/1 system-ui,-apple-system,'Noto Sans KR',sans-serif;cursor:pointer;box-shadow:0 8px 20px #01050b66}
.constellation-back::before{content:'↩';font-size:15px}
.constellation-back:focus-visible{outline:3px solid #f2d899;outline-offset:2px}
.personal-constellation-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.personal-constellation-header h2{font-size:18px;margin:0}.personal-constellation-overlay [data-constellation-stage],.personal-constellation-overlay canvas{width:100%;height:100%;min-height:160px}
.personal-constellation-invite{margin-left:auto}.personal-constellation-invite button{min-height:40px;padding:8px 12px;border:1px solid #d6bf88;border-radius:10px;background:#1c3043;color:#f9f0d9}
.personal-garden-invite-dialog{max-width:min(420px,calc(100vw - 32px));padding:24px;border:1px solid #d6bf88;border-radius:18px;background:#142a35;color:#f9f0d9;box-shadow:0 24px 70px #0009}
.personal-garden-invite-dialog::backdrop{background:#07111bcc}
.personal-garden-invite-dialog h2{margin:0 0 12px;font-size:20px}
.personal-garden-invite-dialog p{line-height:1.6}
.personal-garden-invite-dialog a{display:block;margin:18px 0;overflow-wrap:anywhere;color:#f9dd9e}
.personal-garden-invite-dialog button{margin-right:8px;min-height:44px;padding:8px 15px}

/* Permanent actions: tea, wish, photo, and an accessible icon-only More control. */
.bottom .healing-actions{grid-template-columns:repeat(3,minmax(0,1fr)) 44px}
.healing-actions .nav summary{width:44px;min-width:44px;padding:0}
.healing-actions .nav[open]>summary{background:#49381e;border-color:#e8bf7b;color:#ffe0a6}
.healing-actions .nav summary .more-icon{display:block;width:24px;height:24px;flex:none}
.healing-actions .nav:not([open]) summary .more-icon-open,.healing-actions .nav[open] summary .more-icon-closed{display:none}

/* Opaque first paint covers the unfinished canvas and inactive HUD. */
.garden-loading{position:fixed;inset:0;z-index:100;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 38%,#173531 0,#102924 34%,#0b201f 74%,#09191a 100%);padding:24px;pointer-events:auto}
.garden-loading[hidden]{display:none!important}
.garden-loading-content{width:min(100%,360px);text-align:center;color:#f7ead0}
.garden-loading-scene{display:block;width:100%;height:auto;margin:0 auto 12px}
.garden-loading-title{margin:0 0 18px;font-size:clamp(25px,6vw,34px);line-height:1.2;letter-spacing:.05em;font-family:serif}
.garden-loading-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;width:min(148px,65%);margin:0 auto}
.garden-loading-steps i{height:3px;border-radius:4px;background:#b6c7b34a}
.garden-loading[data-step="1"] i:nth-child(-n+1),.garden-loading[data-step="2"] i:nth-child(-n+2),.garden-loading[data-step="3"] i:nth-child(-n+3),.garden-loading[data-step="4"] i{background:#e3cb8f}
.garden-loading-status{min-height:1.5em;margin:12px 0 0;color:#e3dbca;font-size:14px;word-break:keep-all}
@media(prefers-reduced-motion:no-preference){.garden-loading-status{transition:color .12s linear}}

/* Diagnostics are visible only in an explicitly opened local timing view. */
.garden-loading-timing{position:fixed;z-index:105;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));width:min(310px,calc(100vw - 24px));padding:12px 14px;border:1px solid #d0b87970;border-radius:12px;background:#112525f5;color:#f7ead0;font:13px/1.45 system-ui,sans-serif}
.garden-loading-timing ol{margin:8px 0;padding-inline-start:20px}.garden-loading-timing p{margin:5px 0}.garden-loading-timing small{display:block}.garden-loading-timing button{margin-top:7px;min-height:44px;padding:0 12px}

.healing-actions .nav [data-public-garden-disclosure] > summary{width:100%;min-width:0;padding:0 10px;font-size:13px}
[data-public-garden-disclosure] p{margin:8px 0;font-size:13px;line-height:1.5;text-align:left}
[data-public-garden-disclosure] a:focus-visible{outline:2px solid #f1d495;outline-offset:2px}
