/* Day 300 — a little, hand-drawn pixel world. */
.milestone-haunted{overflow:visible}
.milestone-pumpkin{position:absolute;top:-25px;left:50%;transform:translateX(-50%);width:32px;height:29px;image-rendering:pixelated;pointer-events:none}
#ghostChapter{position:fixed;inset:0;z-index:110;overflow:hidden;background:#000;color:#eee5d3;font-family:'Silkscreen',monospace;isolation:isolate}
#ghostChapter[hidden],#ghostChapter [hidden]{display:none!important}
#ghostStage{display:block;width:100%;height:100%;image-rendering:pixelated;image-rendering:crisp-edges}
#ghostChapter button{font:inherit;cursor:pointer;border-radius:0;touch-action:manipulation;-webkit-appearance:none}
#ghostChapter button:focus-visible{outline:2px solid #ffe2a4;outline-offset:5px}
.ghost-hud{position:absolute;top:0;left:0;right:0;padding:26px 32px;display:flex;align-items:center;justify-content:flex-end;gap:14px;font-size:10px;letter-spacing:1px;background:linear-gradient(#080910bb,transparent);animation:ghostUIIn .8s steps(8) both}
.ghost-tools{display:flex;gap:10px}
.ghost-tool{min-height:40px;background:#12111bd9;color:#a39aaa;border:1px solid #494050;padding:8px 12px;font-size:8px!important;letter-spacing:1px;box-shadow:2px 2px 0 #0006}
.ghost-tool:hover{color:#f5dfb9;border-color:#b4986b;background:#201c26}
.ghost-intro-caption{position:absolute;bottom:9%;left:20px;right:20px;text-align:center;font-size:12px;line-height:2;letter-spacing:2px;color:#aa9ba9;text-shadow:2px 2px #050409}
.ghost-dialogue{position:absolute;bottom:max(30px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(820px,calc(100% - 48px));display:flex;gap:23px;padding:24px 26px 19px;background:#13111eee;border:3px solid #a89a8b;box-shadow:0 0 0 3px #17131f,0 0 0 5px #534959,8px 9px 0 #03020b80,inset 0 0 0 3px #292332;animation:ghostUIIn .35s steps(5) both}
.ghost-portrait{width:88px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;border-right:2px solid #3c3345;padding-right:20px;color:#8b7f95;font-size:9px;letter-spacing:2px}
#ghostPortrait{width:72px;height:84px;image-rendering:pixelated}
.ghost-dialogue-main{min-width:0;flex:1}
.ghost-speaker-line{display:flex;justify-content:space-between;gap:12px;color:#e7ba7c;font-size:13px;letter-spacing:2px}
#ghostLineCount{font-size:10px;color:#8a7c98;white-space:nowrap}
#ghostDialogueText{font-size:clamp(14px,1.45vw,18px);line-height:1.95;letter-spacing:.4px;min-height:92px;margin:16px 0 10px;color:#e9e1ef}
.ghost-dialogue-footer{display:flex;align-items:center;justify-content:space-between;gap:8px}
#ghostDialogueHint{font-size:9px;color:#9c8ea8;letter-spacing:1px}
#ghostNext{color:#dabe8e;background:none;border:0;padding:10px 0 10px 12px;font-size:12px!important;min-height:44px;letter-spacing:1px}
#ghostNext span{padding-left:12px;animation:pixelBlink 1.2s steps(1) infinite}
.ghost-choices{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.ghost-choices button{min-height:50px;padding:13px 20px;border:2px solid #5c506a;background:#201a2b;color:#c3b4d0;font-size:12px!important;letter-spacing:1px}
.ghost-choices #ghostAccept{background:#dbc08c;color:#302335;border-color:#f6dbac;box-shadow:3px 3px 0 #6f5260}
.ghost-choices #ghostAccept:hover{background:#ffe4af}
.ghost-choices #ghostWait:hover{border-color:#b4a5c2}
.ghost-pause-btn{display:flex;align-items:center;gap:8px}
.ghost-pause-btn svg{width:9px;height:11px;flex-shrink:0}
.ghost-pause{position:absolute;inset:0;z-index:9;display:flex;align-items:center;justify-content:center;background:#07060dd9;animation:ghostUIIn .2s steps(3) both}
.ghost-pause-panel{display:flex;flex-direction:column;gap:12px;min-width:min(310px,78vw);padding:26px 24px;background:#13111ef5;border:3px solid #a89a8b;box-shadow:0 0 0 3px #17131f,0 0 0 5px #534959,8px 9px 0 #03020b80,inset 0 0 0 3px #292332}
.ghost-pause-title{margin:0 0 8px;text-align:center;color:#e7ba7c;font-size:13px;letter-spacing:4px}
.ghost-pause-item{min-height:48px;padding:13px 16px;border:2px solid #5c506a;background:#201a2b;color:#c3b4d0;font-size:12px;letter-spacing:2px;text-align:center}
.ghost-pause-item:hover{border-color:#b4a5c2;color:#f5dfb9;background:#2a2237}
#ghostResume{background:#dbc08c;color:#302335;border-color:#f6dbac;box-shadow:3px 3px 0 #6f5260}
#ghostResume:hover{background:#ffe4af;color:#302335}
@media(max-width:600px){.ghost-pause-panel{min-width:min(280px,84vw);padding:22px 18px;gap:10px}.ghost-pause-title{font-size:11px}.ghost-pause-item{font-size:11px;min-height:46px}}
.ghost-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}
@keyframes ghostUIIn{from{opacity:0}to{opacity:1}}
@media(max-width:600px){
 .milestone-body{padding:28px 15px}.milestone-options{gap:8px}.milestone-btn{padding:16px 5px;min-height:127px}.milestone-number{font-size:27px}.milestone-days{font-size:7px}
 .ghost-hud{padding:17px 15px;align-items:flex-start}.ghost-tools{gap:5px}.ghost-tool{font-size:6px!important;padding:8px;min-height:36px;letter-spacing:0}
 .ghost-dialogue{width:calc(100% - 30px);bottom:max(20px,env(safe-area-inset-bottom));padding:17px 15px 13px;gap:12px}.ghost-portrait{width:47px;padding-right:11px;gap:9px;font-size:7px}.ghost-portrait canvas{width:42px!important;height:49px!important}.ghost-speaker-line{font-size:11px;letter-spacing:1px}#ghostLineCount{font-size:8px}#ghostDialogueText{font-size:13px;line-height:1.95;min-height:104px;margin-top:12px}#ghostDialogueHint{font-size:7px;letter-spacing:0}#ghostNext{font-size:11px!important;min-height:42px}.ghost-choices{gap:8px}.ghost-choices button{font-size:11px!important;padding:12px 13px;min-height:46px}.ghost-choices #ghostAccept{flex:1}.ghost-intro-caption{font-size:10px;bottom:14%}
}
@media(max-height:540px) and (min-width:601px){.ghost-hud{padding:12px 20px}.ghost-dialogue{bottom:17px;padding:12px 18px;gap:15px;width:min(760px,calc(100% - 40px))}.ghost-portrait{width:65px}#ghostPortrait{width:48px;height:56px}.ghost-portrait span{display:none}#ghostDialogueText{min-height:46px;font-size:13px;margin:10px 0 0}.ghost-speaker-line{font-size:11px}}
@media(prefers-reduced-motion:reduce){#ghostChapter *,#ghostChapter *::before{animation:none!important;transition:none!important}}

/* The only arrival UI is a small prompt anchored to the actual front door. */
.ghost-door{position:absolute;transform:translateX(-50%);min-width:44px;min-height:44px;background:transparent;border:0;color:#f0d29a;padding:0;outline-offset:4px}
.ghost-door-hint{position:absolute;left:50%;bottom:calc(100% + 14px);transform:translateX(-50%);display:flex;align-items:center;gap:8px;white-space:nowrap;background:#181420ed;border:2px solid #b39468;box-shadow:3px 3px 0 #080911;padding:10px 13px;font-size:11px;letter-spacing:1px;line-height:1.2;pointer-events:auto}
.ghost-door-hint kbd{font:inherit;font-size:10px;padding:3px 4px;color:#efe3cb;border:1px solid #897a71;box-shadow:1px 1px #655645}
.ghost-door-arrow{position:absolute;left:50%;top:100%;width:10px;height:8px;transform:translateX(-50%);background:#b39468;clip-path:polygon(0 0,100% 0,100% 25%,80% 25%,80% 50%,60% 50%,60% 75%,40% 75%,40% 50%,20% 50%,20% 25%,0 25%)}
.ghost-door:hover .ghost-door-hint,.ghost-door:focus-visible .ghost-door-hint{background:#302333;color:#ffe9ba;border-color:#efd29a}
#ghostChapter .ghost-door:focus-visible{outline:2px dashed #d9bd8270;outline-offset:4px}
.ghost-door[aria-disabled="true"]{cursor:wait}
.ghost-door[aria-disabled="true"] .ghost-door-hint{color:#bbaa91;border-color:#73665f}
@media(max-width:600px){.ghost-door-hint{font-size:10px;padding:10px 12px;gap:6px}.ghost-door-hint kbd{display:none}}
@media(max-height:540px) and (min-width:601px){.ghost-door-hint{font-size:9px;padding:6px 8px;bottom:calc(100% + 10px)}.ghost-door-hint kbd{font-size:6px;padding:2px 3px}}
.ghost-choices #ghostReplyTrick,.ghost-choices #ghostTakeCandy{background:#dbc08c;color:#302335;border-color:#f6dbac;box-shadow:3px 3px 0 #6f5260}
.ghost-choices #ghostReplyTrick:hover,.ghost-choices #ghostTakeCandy:hover{background:#ffe4af}
.ghost-next-house{position:absolute;right:max(24px,5vw);top:55%;display:flex;flex-direction:column;align-items:center;gap:12px;min-width:92px;min-height:76px;padding:12px;background:#11121b85;border:0;color:#e8c58d;text-shadow:2px 2px #17111c;animation:ghostUIIn .5s steps(5) both}
.ghost-next-house svg{width:48px;height:32px;filter:drop-shadow(3px 3px 0 #14101e);animation:ghostWay 1.2s steps(3) infinite}
.ghost-next-house span{font-size:10px;letter-spacing:1px}
.ghost-next-house:hover{color:#ffe5b7;background:#302433c0}
@keyframes ghostWay{0%,100%{transform:translateX(0)}50%{transform:translateX(5px)}}
@media(max-width:600px){.ghost-next-house{right:16px;top:56%;min-width:78px;gap:9px}.ghost-next-house svg{width:36px;height:24px}.ghost-next-house span{font-size:6px}.ghost-choices #ghostReplyTrick,.ghost-choices #ghostTakeCandy{width:100%}}

/* Closing credits: a slow roll once the sky goes quiet. */
.ghost-credits{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:7;outline:none;opacity:0;animation:ghostCreditsIn 1.8s ease forwards}
.ghost-credits-roll{position:absolute;top:50%;left:0;right:0;padding:0 clamp(18px,6vw,90px);text-align:center;transform:translateY(64vh);animation:ghostCreditsRoll 26s cubic-bezier(.22,.55,.26,1) forwards}
.ghost-credits-roll p{margin:0 0 42px;font-family:'Silkscreen',monospace;font-weight:700;font-size:clamp(13px,1.45vw,19px);line-height:2.1;letter-spacing:2px;color:#fff4e2;text-shadow:2px 0 0 #1b0f24,-2px 0 0 #1b0f24,0 2px 0 #1b0f24,0 -2px 0 #1b0f24,5px 5px 0 #0b0712}
.ghost-credits-lead{color:#ffae2b!important;font-size:clamp(15px,1.8vw,25px)!important;letter-spacing:3px!important;text-shadow:2px 0 0 #3d1704,-2px 0 0 #3d1704,0 2px 0 #3d1704,0 -2px 0 #3d1704,5px 5px 0 #0b0712,0 0 22px #ff9d1c66!important}
.ghost-credits-love{color:#ff4f8b!important;font-size:clamp(16px,2vw,28px)!important;letter-spacing:5px!important;text-shadow:2px 0 0 #3c0a21,-2px 0 0 #3c0a21,0 2px 0 #3c0a21,0 -2px 0 #3c0a21,5px 5px 0 #0b0712,0 0 24px #ff3d7c66!important}
.ghost-credits-sign{color:#c6a0ff!important;font-size:clamp(12px,1.25vw,16px)!important;letter-spacing:3px!important;margin-bottom:0!important;text-shadow:2px 0 0 #210f36,-2px 0 0 #210f36,0 2px 0 #210f36,0 -2px 0 #210f36,4px 4px 0 #0b0712!important}
@keyframes ghostCreditsIn{to{opacity:1}}
@keyframes ghostCreditsRoll{from{transform:translateY(64vh)}to{transform:translateY(-50%)}}
@media(max-width:600px){.ghost-credits-roll p{margin-bottom:28px;line-height:1.95;letter-spacing:1.5px}}
@media(max-height:620px){.ghost-credits-roll p{margin-bottom:22px;line-height:1.8;font-size:clamp(11px,1.1vw,15px)}}
@media(prefers-reduced-motion:reduce){.ghost-credits-roll{animation:none;transform:translateY(-50%)}}
