#kezhi-world {position:absolute;inset:0;z-index:5;overflow:hidden;background:#344b3c center/cover no-repeat;color:#fff1d5;touch-action:none;user-select:none;container-type:inline-size;}
#kezhi-world[hidden],#kezhi-world [hidden] {display:none!important;}
html:has(#stage.kezhi-active),body:has(#stage.kezhi-active) {overscroll-behavior:none;}
.kezhi-active:not(.prologue-active) :is(#game,#joystick,#dash,#interact,#interact-hint,#task,.location,#dialogue,#momo-bubble,#distance) {visibility:hidden!important;pointer-events:none!important;}
.prologue-active #kezhi-world {display:none!important;}
/* Override the shared two-ID :not() rule only inside this chapter. */
#stage.kezhi-active:not(.prologue-active).story-active > #kezhi-world {visibility:visible!important;pointer-events:none;}
#stage.kezhi-active:not(.prologue-active) #story {background:linear-gradient(0deg,#102b2740,transparent 40%);}
.kezhi-surface {position:absolute;z-index:2;}
.kezhi-transition,.kezhi-memory-flash {position:absolute;inset:0;pointer-events:none;background:center/cover no-repeat;}
.kezhi-transition {z-index:1;}.kezhi-memory-flash {z-index:9;box-shadow:inset 0 0 80px #f3e8c847;}
#kezhi-world button {font-family:var(--ui-font-body);cursor:pointer;touch-action:none;}
#kezhi-world .kezhi-hotspot {position:absolute;min-width:44px;min-height:44px;border:0;border-radius:40%;padding:0;background:transparent;box-shadow:none;}
.kezhi-hotspot::after {content:'';position:absolute;inset:10%;border:1px solid #f0dca48c;border-radius:45%;opacity:0;box-shadow:0 0 16px #f1d99c38;transition:opacity .25s;}
.kezhi-hotspot:is(:hover,:active,:focus-visible)::after {opacity:1;}
#kezhi-world .kezhi-hotspot:focus-visible {outline:2px solid #f6dca980;outline-offset:3px;}
#kezhi-world.debug-hotspots .kezhi-hotspot {outline:2px dashed #ffd875aa;background:#ebc66e18;}
#kezhi-world.debug-hotspots .kezhi-hotspot::before {content:attr(aria-label);font-size:22px;color:#fff4d8;background:#173b38cc;}
.kezhi-hint {position:absolute;z-index:8;left:3%;right:3%;top:3%;margin:0;text-align:center;font:500 clamp(28px,2.1cqw,30px)/1.4 var(--ui-font-body);color:#fff3d9;text-shadow:0 2px 5px #15281e,0 0 14px #162c23;pointer-events:none;}
.kezhi-poetry {position:absolute;z-index:10;left:6%;right:6%;bottom:24%;padding:14px 20px;color:#fff3d5;text-align:center;font:500 clamp(30px,2.5cqw,38px)/1.5 var(--ui-font-title);text-shadow:0 2px 7px #10271d;background:radial-gradient(ellipse,#173a32c4,transparent 76%);pointer-events:none;}
#kezhi-world .kezhi-poetry p {margin:8px 0;font:inherit;color:inherit;}
#kezhi-world .kezhi-poetry[data-kind=concept] strong {display:block;font-size:clamp(36px,3cqw,42px);color:#ffe1a1;}
#kezhi-world .kezhi-poetry small {font-size:26px;color:#f2dba9;}
.kezhi-panel {position:absolute;inset:0;z-index:8;pointer-events:none;}
.kezhi-panel button {pointer-events:auto;}
.kezhi-actions {position:absolute;left:50%;bottom:7%;transform:translateX(-50%);z-index:10;}
#kezhi-world :is(.kezhi-actions,.kezhi-panel,.kezhi-video-action) button:not(.kezhi-echo) {min-height:58px;padding:14px 30px;font:600 clamp(26px,2cqw,30px)/1.35 var(--ui-font-body);color:#fff3d9;background:#193f36e8;border:1px solid #dbc18b;border-radius:4px;}
#kezhi-world button:focus-visible {outline:3px solid #efd291;outline-offset:4px;}
.sweep-stroke .kezhi-surface::after {content:'';position:absolute;left:22%;top:62%;width:50%;height:10%;border-bottom:7px solid #e7d0a160;border-radius:50%;pointer-events:none;animation:sweep-ink .6s both;}
.wine-pouring .kezhi-surface::after,.cup-warmth .kezhi-surface::after {content:'';position:absolute;left:29%;top:64%;width:12%;height:10%;border:2px solid #f9dea46b;border-radius:50%;pointer-events:none;animation:cup-warmth 1s both;}
.wine-pouring .kezhi-surface::after {left:62%;top:45%;width:10%;height:20%;}
.kezhi-whole-poem {position:absolute;left:12%;right:12%;top:2%;max-height:96%;overflow:auto;padding:10px 28px;text-align:center;background:#f2e9d3f7;color:#254c42;pointer-events:auto;box-sizing:border-box;}
#kezhi-world .kezhi-whole-poem h2 {font:500 clamp(36px,2.8cqw,42px)/1.3 var(--ui-font-title);margin:0;}
#kezhi-world .kezhi-whole-poem>p {font-size:26px;line-height:1.3;margin:2px 0 6px;color:#416453;}

#kezhi-world .kezhi-whole-poem button {margin-top:14px;}
#kezhi-world > video {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#192c20;z-index:20;}
.kezhi-video-action {position:absolute;z-index:21;left:8%;right:8%;bottom:8%;text-align:center;}
.kezhi-video-action p {font-size:28px;}
#stage.kezhi-active #kezhi-world .ui-completion {position:absolute;inset:9% 10% auto;max-height:83%;overflow:auto;padding:28px;text-align:center;pointer-events:auto;background:#163e34e8;color:#fff1d5;box-sizing:border-box;}
#stage.kezhi-active #kezhi-world .ui-completion :is(p,small) {font-size:clamp(26px,2cqw,30px);}
#stage.kezhi-active #kezhi-world .ui-completion :is(.ui-completion-title,.ui-mark) {font-size:clamp(36px,3cqw,42px);}
.kezhi-save-error {position:absolute;inset:35% 10% auto;padding:25px;text-align:center;background:#193f36f0;font-size:28px;pointer-events:auto;}
@keyframes sweep-ink {from{opacity:.8;transform:translateX(-6%) rotate(-5deg);}to{opacity:0;transform:translateX(8%) rotate(3deg);}}
@keyframes cup-warmth {from{opacity:.8;transform:scale(.8);}to{opacity:0;transform:scale(1.3);}}
@media(prefers-reduced-motion:reduce) {#kezhi-world * {animation:none!important;transition:none!important;}}

/* V3 uses the shared dialogue frame, nameplate and portrait geometry. Only its backdrop
   opacity and the requested reading size are scoped to this chapter. */
#stage.kezhi-active:not(.prologue-active) #story-text {font-size:clamp(30px,2.2cqw,34px);}
.kezhi-entry::before {content:'';position:absolute;inset:0;z-index:15;pointer-events:none;background:radial-gradient(ellipse,#283f35aa,#06110f);animation:kezhi-arrive .45s both;}
.kezhi-context,.kezhi-receipt {position:absolute;right:3%;top:4%;z-index:11;pointer-events:none;color:#fff1d5;text-shadow:0 2px 6px #193b30;font:500 26px/1.5 var(--ui-font-body);animation:kezhi-context 3s both;}
.kezhi-receipt {top:auto;bottom:4%;font-size:22px;}
.kezhi-focus::after {content:'';position:absolute;inset:0;background:#081e19;opacity:.25;pointer-events:none;z-index:3;}
#kezhi-world .kezhi-poetry {top:50%;bottom:auto;transform:translateY(-50%);padding:18px 24px;box-sizing:border-box;}
#kezhi-world .kezhi-original {font:500 clamp(38px,3cqw,44px)/1.5 var(--ui-font-title);color:#fff2cf;letter-spacing:.06em;}
#kezhi-world .kezhi-original p {margin:0;}
#kezhi-world .kezhi-poetry small {display:block;font:500 26px/1.45 var(--ui-font-body);color:#ddcba7;margin-bottom:12px;letter-spacing:.06em;}
#kezhi-world .kezhi-poetry[data-kind=focus] {background:none;}
#kezhi-world .kezhi-meaning {margin-top:32px;color:#d2d6c6;font:400 clamp(26px,2cqw,30px)/1.4 var(--ui-font-body);letter-spacing:0;}
#kezhi-world .kezhi-meaning p {margin:12px 0;}
#kezhi-world .kezhi-meaning small {color:#c8cdbd;margin-bottom:10px;}
#kezhi-world .kezhi-meaning em {font-style:normal;color:#dedecb;}
#kezhi-world .kezhi-poetry[data-kind=analysis] {font:400 clamp(26px,2cqw,30px)/1.6 var(--ui-font-body);color:#d2d6c6;max-width:80%;margin:auto;}
#kezhi-world .kezhi-poetry[data-kind=concept] {font-size:clamp(26px,2cqw,30px);}
#kezhi-world .kezhi-poetry[data-kind=concept] strong {font-size:clamp(34px,2.8cqw,40px);}
#kezhi-world .kezhi-poetry.into-scroll {animation:kezhi-into-scroll .45s both;transform-origin:95% 0;}
#kezhi-world .kezhi-poetry[data-kind=recap] {left:16%;right:16%;padding:28px;background:linear-gradient(90deg,#d6c39d,#f2e9d3 5% 95%,#d6c39d);border-block:2px solid #b99d68;box-shadow:0 8px 30px #16342840;text-shadow:none;}
#kezhi-world .kezhi-poetry[data-kind=recap] .kezhi-original {color:#254c42;}
#kezhi-world .kezhi-poetry[data-kind=recap] small {color:#526750;}
#kezhi-world .kezhi-call {position:absolute;inset:auto;left:54%;top:50%;transform:translate(-50%,-50%);border:0;background:transparent;padding:18px 24px;color:#ffefd2;font:500 clamp(28px,2.2cqw,32px)/1.4 var(--ui-font-body);text-shadow:0 2px 6px #17382a;}
#kezhi-world .kezhi-whole-poem .kezhi-echo {display:block;width:100%;border:0;border-radius:0;padding:0;margin:0;background:transparent;box-shadow:none;color:#254c42;font:500 clamp(38px,2.8cqw,44px)/1.28 var(--ui-font-title);letter-spacing:.06em;min-height:0;}
.kezhi-echo span {display:block;}
#kezhi-world .kezhi-echo:is(:hover,:focus-visible) {color:#6b4d24;background:#d7bc7a20;}
#kezhi-world .kezhi-whole-poem .kezhi-echo-hint {font:400 26px/1.3 var(--ui-font-body);margin:8px 0;}
#kezhi-world .kezhi-whole-poem button[data-kezhi=reflect] {margin-top:4px;}
#kezhi-world button:disabled {opacity:.55;cursor:default;}
.kezhi-memory-flash {z-index:7;}
@keyframes kezhi-arrive {from{opacity:1;}to{opacity:0;}}
@keyframes kezhi-context {0%{opacity:0;}15%,85%{opacity:1;}100%{opacity:0;}}
@keyframes kezhi-into-scroll {from{opacity:1;scale:1;translate:0 0;}to{opacity:0;scale:.3;translate:30% -45%;}}
@media(max-width:900px) {.kezhi-whole-poem{left:3%;right:3%;}}
/* Local Chapter4 cue only: the sweep target no longer draws a hotspot ring. */
#kezhi-world [data-gesture=sweep]::after {display:none;}
.kezhi-sweep-cue {position:absolute;left:58%;bottom:6%;z-index:3;transform:translateX(-50%);text-align:center;pointer-events:none;transition:opacity .35s;}
.kezhi-sweep-cue img {display:block;width:clamp(80px,8cqw,120px);height:auto;margin:auto;transform-origin:55% 88%;animation:kezhi-broom-sway 1s ease-in-out infinite;}
#kezhi-world .kezhi-sweep-cue p {font:600 clamp(28px,2.3cqw,30px)/1.4 var(--ui-font-body);margin:8px 0 0;color:#fff1cf;white-space:nowrap;text-shadow:0 2px 5px #183a2d,0 0 10px #183a2d;}
.kezhi-sweep-cue.sweep-cue-dismissed {opacity:0;}
@keyframes kezhi-broom-sway {0%,100%{rotate:-8deg;filter:drop-shadow(0 0 3px #c4c58d55);}50%{rotate:8deg;filter:drop-shadow(0 0 6px #e2c88088);}}
/* Three labelled reading levels. The 64% ink wash only surrounds the text. */
.kezhi-focus::after {opacity:.12;}
#kezhi-world.kezhi-focus .kezhi-poetry:is([data-kind=focus],[data-kind=concept]) {left:14%;right:14%;max-height:96%;overflow:auto;padding:16px 24px;background:#0c2c27a3;border:1px solid #ccb47d66;border-radius:4px;}
#kezhi-world.kezhi-focus .kezhi-original {font-size:clamp(40px,3.1cqw,46px);font-weight:600;line-height:1.4;color:#fff1cd;}
#kezhi-world.kezhi-focus .kezhi-poetry small {font-size:clamp(28px,2.2cqw,32px);font-weight:600;line-height:1.2;margin-bottom:6px;color:#f0dfb6;}
#kezhi-world.kezhi-focus .kezhi-meaning {margin-top:16px;color:#eee6d2;font-size:clamp(30px,2.5cqw,34px);font-weight:500;line-height:1.35;}
#kezhi-world.kezhi-focus .kezhi-meaning p {margin:7px 0;}
#kezhi-world.kezhi-focus .kezhi-meaning em {color:#eee6d2;}
.kezhi-intertext-concept {margin-top:12px;padding-top:10px;border-top:1px solid #d9bf8038;}
#kezhi-world .kezhi-intertext-concept strong,#kezhi-world.kezhi-focus [data-kind=concept] strong {display:block;color:#f2d89f;font:600 clamp(34px,2.7cqw,38px)/1.2 var(--ui-font-title);}
#kezhi-world .kezhi-intertext-concept p {font:500 clamp(26px,2.1cqw,30px)/1.3 var(--ui-font-body);margin:4px 0;color:#e6e0ce;}
@media(prefers-reduced-motion:reduce){.kezhi-sweep-cue img{animation:none;}}
#kezhi-world [data-gesture=sweep] {border-radius:2px;}

/* World-space cues: three small stars instead of an abstract hotspot ring. */
#kezhi-world .kezhi-hotspot::after {display:none;}
.kezhi-sparkles {position:absolute;left:50%;top:50%;width:64px;height:64px;transform:translate(-50%,-50%);pointer-events:none;transition:opacity .25s;}
.kezhi-sparkles i {position:absolute;font:normal 40px/1 serif;color:#ffe3a0;text-shadow:0 0 6px #f4ce7b99,0 2px 3px #183d32;animation:kezhi-sparkle .95s ease-in-out infinite;}
.kezhi-sparkles i:nth-child(2) {left:34px;top:24px;font-size:28px;color:#b1e0ca;animation-delay:-.3s;}
.kezhi-sparkles i:nth-child(3) {left:5px;top:43px;font-size:22px;animation-delay:-.6s;}
.hotspot-complete {pointer-events:none!important;}
.hotspot-complete .kezhi-sparkles {opacity:0;}
#kezhi-world[data-state=KITCHEN] .kezhi-poetry[data-kind=analysis] {animation:kezhi-kitchen-note 2s both;}
@keyframes kezhi-kitchen-note {0%{opacity:0;}10%,85%{opacity:1;}100%{opacity:0;}}
@keyframes kezhi-sparkle {0%,100%{opacity:.65;scale:.92;}50%{opacity:1;scale:1.08;}}
.kezhi-broom {position:absolute;left:50%;bottom:8%;translate:-50% 0;transform-origin:55% 90%;pointer-events:none;transition:rotate .12s;z-index:4;}
.kezhi-broom img {display:block;width:clamp(100px,9cqw,140px);height:auto;filter:drop-shadow(0 3px 5px #18332780);}
.kezhi-sweep-instruction {position:absolute;left:0;right:0;bottom:1%;margin:0;text-align:center;pointer-events:none;font:600 clamp(28px,2.3cqw,30px)/1.4 var(--ui-font-body);color:#fff1cf;text-shadow:0 2px 5px #183a2d;transition:opacity .35s;}
.kezhi-sweep-instruction.dismissed {opacity:0;}
/* Equal margins and a bounded text column keep each semantic line intact. */
#kezhi-world.kezhi-focus .kezhi-poetry[data-kind=focus] {left:50%;right:auto;width:min(900px,92%);transform:translate(-50%,-50%);text-align:center;margin:0;padding:16px 24px;background:#0c2c27a3;}
#kezhi-world.kezhi-focus :is(.kezhi-original,.kezhi-meaning,.kezhi-intertext-concept) {width:100%;margin-left:auto;margin-right:auto;text-align:center;box-sizing:border-box;}
#kezhi-world.kezhi-focus :is(.kezhi-original,.kezhi-meaning) p {white-space:nowrap;letter-spacing:0;}
.kezhi-poem-pair {font:500 clamp(32px,2.6cqw,40px)/1.3 var(--ui-font-title);margin:5px 0;}
.kezhi-poem-pair span {display:block;white-space:nowrap;}
.kezhi-summary {display:grid;grid-template-columns:1fr 1fr;gap:12px;text-align:left;max-width:900px;margin:18px auto;}
.kezhi-summary section {border-top:1px solid #b59b6580;padding-top:8px;}
.kezhi-summary strong {font-size:28px;color:#325146;}
#kezhi-world .kezhi-summary p {font:400 26px/1.4 var(--ui-font-body);color:#325146;margin:5px 0;}
@media(max-width:700px){#kezhi-world.kezhi-focus :is(.kezhi-original,.kezhi-meaning) p {white-space:normal;}.kezhi-summary{grid-template-columns:1fr;}}
