/* Shared UI presentation; story illustrations, hit rectangles and gates unchanged. */
:root{
  --ds-title:#61594F;--ds-secondary:#81786E;--ds-button:#FAF6EE;
  --ds-border:#D8CFC0;--ds-accent:#B77F79;--ds-button-text:#61594F;
  --ds-hint:rgba(242,237,227,.9);--ds-hint-text:#5B5751;
}
#stage[data-ui-theme="dark"]{--ds-title:#FAF5E9;--ds-secondary:#E3D9CD;--ds-button:#F8F3E8;--ds-button-text:#61594F;--ds-accent:#B77F79}
#stage{--ui-safe:clamp(12px,2.5vw,36px);--ui-text:#61594F;--ui-border:#D8CFC0;--ui-pink:#B77F79}
#stage [data-ui-component="SceneTitle"]{
  position:absolute;left:max(var(--ui-safe),env(safe-area-inset-left));top:max(5%,env(safe-area-inset-top));right:auto;bottom:auto;
  transform:none;width:max-content;max-width:70%;margin:0;padding:0;background:none;
  text-align:left;color:var(--ds-title);opacity:1;animation:none;
  font:400 clamp(24px,2vw,38px)/1.4 var(--ui-serif);letter-spacing:.12em;text-shadow:0 1px 2px #17212a22;
}
#stage [data-ui-component="SceneTitle"] :is(h1,h2){margin:0;color:inherit;font:inherit;letter-spacing:inherit}
#stage [data-ui-component="SceneTitle"] :is(small,span){display:none}
#stage[data-ui-theme="dark"] [data-ui-component="SceneTitle"]{text-shadow:0 1px 2px #17212a66}
#stage .burial-scene.foreground .scene-title{opacity:0}
#stage>.guide,#stage .inspection-hint{
  inset:auto!important;left:var(--hint-x,22%)!important;top:var(--hint-y,70%)!important;bottom:auto!important;
  transform:translateX(-50%);width:max-content!important;height:auto!important;min-height:0!important;
  max-width:min(44%,440px)!important;margin:0!important;padding:7px 13px!important;
  background:var(--ds-hint)!important;border:0!important;border-radius:24px!important;
  color:var(--ds-hint-text)!important;box-shadow:none!important;text-shadow:none!important;pointer-events:none;
  font:400 clamp(15px,1.05vw,20px)/1.4 var(--ui-sans);letter-spacing:.03em;
}
#stage>.guide p{font:inherit!important;color:inherit!important;letter-spacing:inherit!important;text-shadow:none!important}
#stage [data-ui-component="InteractionHotspot"]{min-width:44px;min-height:44px;touch-action:manipulation;outline:none}
#stage [data-ui-component="InteractionHotspot"]>i{
  position:absolute;left:50%;top:50%;width:40px;height:40px;border:1px solid var(--ds-accent);border-radius:50%;
  background:var(--ds-hint);box-shadow:none;animation:none;transform:translate(-50%,-50%);transition:transform .18s ease,opacity .18s ease;
}
#stage [data-ui-component="InteractionHotspot"]>i:after{
  content:"";position:absolute;inset:auto;left:50%;top:50%;width:9px;height:9px;border-radius:50%;
  background:#B48C89;box-shadow:none;transform:translate(-50%,-50%);
}
#stage [data-ui-component="InteractionHotspot"]:active>i{transform:translate(-50%,-50%) scale(.9);opacity:.75}
#stage [data-ui-component="InteractionHotspot"]:focus-visible>i{outline:2px solid var(--ds-accent);outline-offset:3px}
#stage :is(.scene-prev,.scene-next,.restart,.fi-skip,.fi-continue,.peach-memory-back,.snow-branch,.burial-revisit,.poem-controls button,.inspection-quote button){
  min-height:44px;border:1px solid var(--ds-border);border-radius:24px;background:var(--ds-button);color:var(--ds-button-text);
  font:400 15px/1.5 var(--ui-sans);letter-spacing:.03em;box-shadow:none;transition:transform .18s ease,background .18s ease;
}
#stage .scene-nav>.scene-next{min-height:44px;border:1px solid var(--ds-border);border-radius:24px;background:var(--ds-button);color:var(--ds-button-text);font:400 15px/1.5 var(--ui-sans);letter-spacing:.03em;opacity:1}
#stage .scene-nav>.scene-next:disabled{opacity:1;background:rgba(248,243,232,.76);color:#81786E;border-color:#B9B0A5}
#stage :is(.scene-prev,.scene-next,.restart):not(:disabled):active{transform:scale(.97)}
#stage .restart{width:44px;height:44px;border-radius:50%;padding:0}
#stage .scene-prev{left:max(var(--ui-safe),env(safe-area-inset-left));bottom:max(var(--ui-safe),env(safe-area-inset-bottom))}
#stage .restart{right:max(var(--ui-safe),env(safe-area-inset-right));top:max(var(--ui-safe),env(safe-area-inset-top))}
#stage .story-mirror{right:max(var(--ui-safe),env(safe-area-inset-right));bottom:max(var(--ui-safe),env(safe-area-inset-bottom))}
#stage .scene-nav{right:calc(max(var(--ui-safe),env(safe-area-inset-right)) + var(--ui-mirror) + 16px);bottom:max(var(--ui-safe),env(safe-area-inset-bottom))}
#stage :is(.poem-column,.first-dialogue,.narration p,.west-dialogue p,.inspection-quote blockquote){font-family:var(--ui-serif);font-weight:400;color:var(--ds-button-text)}
#stage .poem-controls button{min-width:44px;padding:0;border:0;background:rgba(250,246,238,.8);font-size:20px}
#stage .inspection-quote{background:var(--ds-button);border-color:var(--ds-border);color:var(--ds-button-text)}
#stage .chapter-navigation{--ds-title:#61594F;--ds-secondary:#81786E;--ds-button:#FAF6EE;background:var(--ui-paper);color:var(--ds-title);font-family:var(--ui-serif)}
#stage .chapter-navigation button{font-family:var(--ui-sans);letter-spacing:.03em}
#stage .quiz-root{--ui-text:#61594F;--ui-paper:#FAF6EE;color:#61594F;font-family:var(--ui-sans)}
#stage .quiz-root :is(h1,h2,h3,blockquote){font-family:var(--ui-serif);font-weight:400;color:#61594F}
#stage .quiz-root button{font-family:var(--ui-sans);border-color:#D8CFC0;letter-spacing:.03em}
#stage .quiz-root :is(.quiz-copy,.quiz-description,.quiz-dimension){color:#81786E}
#stage .quiz-root .quiz-options button{background:#FAF6EE;color:#61594F}
#stage .quiz-root .quiz-options button.selected{border-color:#B77F79;background:#efe0d9}
#stage .family-intro{--fi-paper:#FAF6EE;--fi-ink:#61594F}
#stage .departure-final-hint,#stage .peach-memory-hint,#stage .garden-explore-hint,#stage .snow-reading-hint{background:var(--ds-hint);color:var(--ds-hint-text);font-family:var(--ui-sans);border:0;border-radius:20px;padding:7px 12px;text-shadow:none}
@media(max-height:500px){#stage>.guide,#stage .inspection-hint{font-size:15px;padding:6px 11px!important}#stage [data-ui-component="SceneTitle"]{font-size:24px}}
@media(prefers-reduced-motion:reduce){#stage [data-ui-component="InteractionHotspot"]>i{transition:none}}

/* Three-scene review: fonts and artwork anchors, not story/hitbox changes. */
@font-face{font-family:"Scene WenKai";src:url("assets/fonts/LXGWWenKai-Regular.ttf") format("truetype");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Scene Fangsong";src:url("assets/fonts/ZhuqueFangsong-Regular.ttf") format("truetype");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Scene Source Serif";src:url("assets/fonts/SourceHanSerifCN-SemiBold.otf") format("opentype");font-weight:600;font-style:normal;font-display:block}
#stage.typography-pilot [data-ui-component="SceneTitle"]{
  left:var(--scene-title-x);top:max(var(--scene-title-y),env(safe-area-inset-top));
  transform:translateX(-50%);text-align:center;font-family:"Scene WenKai",var(--ui-serif);
  font-size:clamp(23px,2vw,40px);font-weight:400;letter-spacing:.08em;text-shadow:none;
  transition:opacity .65s ease;
}
#stage.typography-pilot [data-ui-component="SceneTitle"] :is(h1,h2){font-family:inherit}
#stage.typography-pilot :is(.poem-column,.inspection-quote blockquote){
  font-family:"Scene Fangsong",FangSong,STFangsong,serif;font-weight:400;
}
#stage.typography-pilot .poem-column{letter-spacing:3px;line-height:1.65}
#stage[data-chapter-key="love-2"][data-ui-state="reading"] .burial-title{opacity:0;pointer-events:none}
/* Retain the exact drop rectangle, but do not draw on the hand or pouch. */
#stage[data-chapter-key="love-2"] .burial-bag,
#stage[data-chapter-key="love-2"] .burial-bag:is(.ready,.received){border-color:transparent;background:none;box-shadow:none;animation:none}
#stage[data-chapter-key="love-2"] .burial-bag:before,
#stage[data-chapter-key="love-2"] .burial-bag>span{display:none}
#stage[data-chapter-key="love-2"] .burial-pick>i{top:-8%;width:24px;height:24px;background:rgba(242,237,227,.75)}
#stage[data-chapter-key="love-2"] .burial-pick>i:after{width:5px;height:5px}
/* Move only the visible marker, never the jade's original hit rectangle. */
#stage[data-chapter-key="love-5"] .jade-hit>i{left:-12%;top:15%;width:32px;height:32px}
#stage[data-chapter-key="love-5"] .jade-hit:before{
  content:"";position:absolute;left:-12%;top:15%;width:60%;height:1px;
  background:rgba(183,127,121,.36);transform:rotate(34deg);transform-origin:left center;pointer-events:none;
}
#stage[data-chapter-key="love-5"] .original-verse{top:24%;}
#stage[data-chapter-key="family-1"] .inspection-chest>span{display:none}
#stage[data-chapter-key="family-1"] .garden-inspection:has(.inspection-quote:not([hidden])) .inspection-hint{visibility:hidden}
/* Entry-only title contract, piloted in west/burial; no artwork or hitbox changes. */
#stage .scene-entry-title{position:absolute;inset:0;z-index:85;display:grid;place-items:center;
  pointer-events:none;background:rgba(247,243,234,.14);color:var(--ds-title)}
#stage .scene-entry-title[hidden]{display:none!important}
#stage .scene-entry-title h2{margin:0;padding:0;max-width:80%;text-align:center;
  font:600 clamp(25px,2vw,40px)/1.6 "Scene Source Serif",var(--ui-serif);letter-spacing:.16em;text-shadow:none}
#stage.entry-title-pilot :is(.west-title,.burial-title){display:none!important}
#stage.entry-title-pilot :is(.poem-column,.west-dialogue p){font-family:"Scene Fangsong",FangSong,STFangsong,serif;font-weight:400}
#stage.entry-title-pilot .poem-column{letter-spacing:3px;line-height:1.65}
#stage.entry-title-pilot>.guide{transition:opacity .25s ease}
#stage>.guide[hidden],#stage .west-dialogue[hidden]{display:none!important}
#stage.entry-title-pilot .west-dialogue{transition-property:opacity,transform}
#stage.entry-title-pilot .burial-pick>i{display:none}
#stage.entry-title-pilot .west-flower-hit>i{left:118%;top:60%}
#stage.entry-title-pilot .west-book-hit>i{left:-65%;top:50%}
#stage.entry-title-pilot[data-scene-phase="idle"] [data-ui-component="InteractionHotspot"]>i{opacity:0}
/* Hint has a reserved lower-left lane, above every draggable petal and the pouch. */
#stage.entry-title-pilot[data-view="burial"]>.guide{left:max(var(--ui-safe),env(safe-area-inset-left))!important;
  top:65%!important;transform:translateY(-50%);max-width:27%!important}
@media(max-height:500px){
  #stage.typography-pilot [data-ui-component="SceneTitle"]{font-size:23px;letter-spacing:.06em}
  #stage[data-chapter-key="love-5"]{--scene-title-y:3%!important}
  #stage[data-chapter-key="love-5"] .original-verse{top:19%;}
  #stage.typography-pilot .poem-column{letter-spacing:3px;line-height:1.5}
}
