/* Independent fixed HUD: no legacy daybar/dashboard positioning rules apply. */
#game-hud{position:absolute;inset:0;z-index:1500;pointer-events:none;isolation:isolate}
#game-hud #hud-location,#game-hud #hud-affection{position:absolute;top:max(8px,env(safe-area-inset-top));width:clamp(220px,27vw,330px);height:auto;padding:0;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none;pointer-events:none}
#game-hud #hud-location{left:max(10px,env(safe-area-inset-left));right:auto;aspect-ratio:721/471;display:block}
#game-hud #hud-affection{right:max(10px,env(safe-area-inset-right));left:auto;aspect-ratio:750/485;display:block}
#game-hud .mood{display:none}
#hud-affection .stats{position:absolute;inset:0;display:block;padding:0;margin:0;border:0;border-radius:0;background:transparent;backdrop-filter:none;box-shadow:none}
#hud-location>img,#hud-affection .stats>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain}
#hud-affection .stats>div{position:absolute;left:20%;right:16%;height:18%;display:flex;align-items:center;justify-content:space-between;gap:6px;white-space:nowrap}
#hud-affection .love-row{top:28%}#hud-affection .family-row{top:56%}
#hud-affection .stats span{font-size:clamp(12px,1.55vw,18px);color:#ffe7ad;text-shadow:0 1px 2px #000}
#hud-affection .stats strong{width:30%;text-align:center;font-size:clamp(18px,2.5vw,28px);color:#ffe7ad;margin:0}
#hud-location .hud-room{position:absolute;left:29%;right:10%;top:27%;text-align:center;font:clamp(16px,2.4vw,28px) serif;color:#ffe7ad;white-space:nowrap}
#clock{position:absolute;inset:0;margin:0;text-align:center;font-size:clamp(10px,1.35vw,16px);line-height:1.5;white-space:nowrap;color:#ffe7ad}
#clock .date-text{position:absolute;left:24%;width:24%;top:62%}#clock .time-text{position:absolute;left:64%;width:23%;top:62%}
#hud-buttons{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:14px;padding:0;margin:0;border:0;background:transparent;pointer-events:none}
#hud-buttons>#save,#hud-buttons>#notes-button{position:relative;inset:auto;width:clamp(64px,18dvh,96px);height:clamp(64px,18dvh,96px);flex:none;display:block;padding:0;margin:0;min-height:0;border:0;border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none;pointer-events:auto;cursor:pointer}
#save img,#notes-button img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none}
#save:focus-visible,#notes-button:focus-visible{outline:3px solid #ffe3a0;outline-offset:2px}
.game .room-viewport,.game .room-viewport .scene{touch-action:none;user-select:none}
.game .room-viewport .scene{max-width:none;min-width:0;aspect-ratio:2622/1040;transform-origin:center;will-change:transform}
.game .room-viewport{background:#b5cbe0}
.game .room-viewport #room-layer{left:27%;top:20%;width:45%;height:76%}
.scene #room-layer .hotspot{background:transparent;border:0;border-radius:12px;box-shadow:none;color:transparent;min-width:0;opacity:1;z-index:600;cursor:pointer}
.scene #room-layer .hotspot:focus-visible{outline:3px solid #ffe3a0;background:#ffe3a020}
.scene .person{cursor:pointer}.scene .person .name{pointer-events:none;font-size:calc(12px / var(--camera-scale,1));padding:calc(2px / var(--camera-scale,1)) calc(5px / var(--camera-scale,1))}
.night{pointer-events:none}#notebook::backdrop{background:#10221ccc}#toast{bottom:20px}
@media(max-height:430px){#game-hud #hud-location,#game-hud #hud-affection{width:clamp(200px,27vw,260px)}}
@media(max-height:330px){#game-hud #hud-location,#game-hud #hud-affection{width:min(31vw,220px)}#hud-buttons>#save,#hud-buttons>#notes-button{width:56px;height:56px}}

/* Decorative interaction layer */
#hud-location{overflow:visible}
#hud-location .hud-room{left:27%;right:8%;top:27%;font-family:Georgia,'Noto Serif TC',serif;font-weight:600;letter-spacing:.04em;line-height:1.15;text-shadow:0 1px 2px #24190d;overflow:hidden;text-overflow:ellipsis}
#clock{font-family:Georgia,'Noto Serif TC',serif;font-weight:600;letter-spacing:.02em;text-shadow:0 1px 2px #24190d}
#clock .date-text{left:22%;width:28%;top:62%;overflow:hidden;text-overflow:ellipsis}
#clock .time-text{left:55%;width:34%;top:62%;overflow:hidden;text-overflow:ellipsis}
#map-button{position:absolute;left:max(12px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom));width:clamp(72px,18dvh,108px);height:clamp(72px,18dvh,108px);padding:0;border:0;background:transparent;pointer-events:auto;cursor:pointer;z-index:10}
#map-button img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
#map-dialog{position:fixed;width:min(520px,82vw);padding:30px 32px 28px;border:1px solid #d7b574;border-radius:26px;background:linear-gradient(145deg,#f8efdcf5,#e8d6b9f5);color:#31463d;box-shadow:0 20px 80px #13241d99;z-index:3000}
#map-dialog h2{margin:0 0 4px;text-align:center;font:26px Georgia,'Noto Serif TC',serif;color:#394b3e}
#map-dialog>p{text-align:center;margin:0 0 18px;color:#766448;font-size:14px}
#map-dialog .map-close{position:absolute;right:14px;top:12px;width:32px;height:32px;border:0;border-radius:50%;background:#354b3e;color:#f7e8c8;font-size:22px}
.map-list{display:grid;gap:10px}.map-list button{display:flex;justify-content:space-between;align-items:center;width:100%;padding:13px 16px;border:1px solid #b99a68;border-radius:14px;background:#fff9eb;color:#3d5143;text-align:left}.map-list button:not(:disabled):hover{background:#ead7b5}.map-list button:disabled{opacity:.58;cursor:not-allowed}.map-list small{color:#8a775d}

/* Dialogue layout inspired by visual-novel presentation, with the room remaining visible. */
#dialog{inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;overflow:hidden;color:#263d34}
#dialog::backdrop{background:#15231d33;backdrop-filter:blur(1px)}
#dialog .portrait{position:absolute;left:1%;bottom:0;width:31%;height:83%;min-height:0;background:transparent;overflow:visible;z-index:2}
#dialog .portrait img{width:100%;height:100%;object-fit:contain;object-position:center bottom;background:transparent}
#dialog .portrait span{bottom:10%;left:17%;padding:8px 24px;border:1px solid #c8a86b;border-radius:16px;background:#294238f2;color:#f5e4bd;font-family:Georgia,'Noto Serif TC',serif;box-shadow:0 3px 9px #0004}
#dialog .speech{position:absolute;left:19%;right:4%;bottom:4%;min-height:22%;padding:25px 42px 20px;align-self:auto;border:2px solid #c7a66d;border-radius:26px;background:linear-gradient(115deg,#fff9edeb,#f2e6d1e8);box-shadow:0 10px 28px #1a2b2480,inset 0 0 0 5px #ffffff55;z-index:1}
#dialog .speech::before{content:'';position:absolute;inset:7px;border:1px solid #d3b98880;border-radius:18px;pointer-events:none}
#dialog .speech small{position:relative;color:#7d6647;font:14px Georgia,'Noto Serif TC',serif;letter-spacing:.08em}
#dialog .speech p{position:relative;margin:7px 0 14px;min-height:0;font:clamp(16px,2.1vw,25px)/1.65 Georgia,'Noto Serif TC',serif;color:#34483e}
#dialog #choices{position:relative;display:grid;gap:10px;max-width:720px;margin-left:auto}
#dialog #choices button{border:1px solid #b99b6b;border-radius:13px;background:#fffaf0e8;color:#3f5346;padding:10px 15px;font-size:clamp(13px,1.5vw,17px);box-shadow:0 2px 6px #40301c25}
#dialog #choices button:hover{background:#ecddbf}
#dialog #close-dialog{top:18px;right:22px;background:#2d453ae8;color:#f6e7c2;box-shadow:0 2px 7px #0004}
@media(max-width:700px) and (orientation:landscape){#dialog .portrait{left:0;width:29%;height:79%}#dialog .speech{left:16%;right:2%;bottom:2%;padding:16px 25px 12px;min-height:27%}#dialog .speech p{margin:4px 0 7px;font-size:16px}#dialog .portrait span{bottom:8%;left:12%;padding:5px 14px;font-size:12px}}
