.mast {padding-top:env(safe-area-inset-top)}
body {padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
footer {padding-bottom:calc(20px + env(safe-area-inset-bottom))}
.photo-source {display:grid;justify-items:start;gap:6px}
.photo-picker {
 position:relative;display:inline-flex;align-items:center;gap:8px;min-height:44px;
 max-width:100%;cursor:pointer;
}
.photo-picker i {width:20px;height:20px}
.photo-picker input[type=file] {
 position:absolute;inset:0;opacity:0;width:100%;height:100%;padding:0;cursor:pointer;
}
.photo-picker:focus-within {outline:3px solid #ac6638;outline-offset:3px}
.photo-source-status {font-size:14px;font-weight:400;color:var(--muted);overflow-wrap:anywhere}
.wardrobe-photo-pickers + .photo-source-status {margin:0}
.install-steps {display:grid;gap:8px;margin:0 0 14px;padding-left:1.4em}
.home-scene-tools {
 position:absolute;top:12px;left:12px;z-index:4;display:flex;align-items:center;gap:7px;pointer-events:none;
}
.game .home-scene-tools .scenehud {position:static}
.scene-feedback {position:relative;pointer-events:auto;min-height:28px;padding:2px 7px;font-size:12px;line-height:1.35;white-space:nowrap}
.cottage-update-notice {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;margin:0 0 12px;background:#fff5dc}
.cottage-update-notice[hidden],.cottage-update-notice button[hidden] {display:none}
.cottage-update-notice button {min-height:40px;flex-shrink:0}
@media(max-width:720px) {
 dialog {max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
 .wardrobe-photo-pickers button {min-height:44px}
 .home-scene-tools {top:5px;left:5px;gap:5px}
 .scene-feedback {min-height:22px;padding:1px 5px;font-size:11px}
 .cottage-update-notice button {min-height:44px}
}
@media(pointer:coarse) {
 .scene-feedback::after {content:"";position:absolute;inset:-4px 0 auto;height:44px}
}

.orientation-switch {position:relative;min-height:26px;height:26px;font-size:12px;line-height:1.35;padding:3px 8px;white-space:nowrap;flex-shrink:0}
.cottage-footer-label,.cottage-footer-actions {display:flex;align-items:center;gap:8px;min-width:0}
.cottage-footer-label strong {display:flex;align-items:center;gap:5px;color:var(--dark);white-space:nowrap}
.cottage-footer-description,.cottage-menu-button,.cottage-record-footer {display:none}
.cottage-footer-actions {flex:1;justify-content:flex-end}
.cottage-footer-actions #hint {min-width:0}
.cottage-menu-actions {display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:8px}
.game.yard {display:flex;flex-direction:column}
:root:not([data-cottage-layout=landscape]) .game.yard .yard-controls {
 order:-1;margin:0;border-width:0 0 1px;box-shadow:none;border-radius:0;
}
:root:is([data-cottage-turn=right],[data-cottage-turn=left]),
:root[data-cottage-layout=landscape] {overflow:hidden;overscroll-behavior:none}
:root:is([data-cottage-turn=right],[data-cottage-turn=left]) #cottage-shell {
 position:fixed;inset:0 auto auto 0;width:100dvh;height:100dvw;
 overflow:auto;overscroll-behavior:contain;transform-origin:top left;
}
:root[data-cottage-turn=right] #cottage-shell {transform:translateX(100dvw) rotate(90deg)}
:root[data-cottage-turn=left] #cottage-shell {transform:translateY(100dvh) rotate(-90deg)}
:root:is([data-cottage-turn=right],[data-cottage-turn=left]) .mast {padding-top:0}
:root:is([data-cottage-turn=right],[data-cottage-turn=left]) #dialog {
 position:fixed;inset:auto;margin:0;left:var(--cottage-dialog-x,50%);top:var(--cottage-dialog-y,50%);
 width:min(510px,calc(var(--cottage-dialog-width,100dvh) - 28px));
 max-height:calc(var(--cottage-dialog-height,100dvw) - 24px);
}
:root[data-cottage-turn=right] #dialog {transform:translate(-50%,-50%) rotate(90deg)}
:root[data-cottage-turn=left] #dialog {transform:translate(-50%,-50%) rotate(-90deg)}

:root[data-cottage-layout=landscape] #cottage-shell > :is(.mast,footer),
:root[data-cottage-layout=landscape] #main :is(.intro,.cornertitle,.villagedock,.roomdock,.backroom,.pagehead) {display:none}
:root[data-cottage-layout=landscape] #cottage-shell {
 --cottage-safe-top:env(safe-area-inset-top);--cottage-safe-bottom:env(safe-area-inset-bottom);
 --cottage-shell-height:100dvh;
 position:fixed;inset:0 auto auto 0;width:100dvw;height:var(--cottage-shell-height);
 overflow:hidden;padding:var(--cottage-safe-top) env(safe-area-inset-right) var(--cottage-safe-bottom) env(safe-area-inset-left);
}
:root[data-cottage-layout=landscape][data-cottage-turn=right] #cottage-shell {
 --cottage-safe-top:env(safe-area-inset-right);--cottage-safe-bottom:env(safe-area-inset-left);
 --cottage-shell-height:100dvw;
 width:100dvh;padding-inline:env(safe-area-inset-top) env(safe-area-inset-bottom);
}
:root[data-cottage-layout=landscape] #main {
 position:relative;display:flex;flex-direction:column;overflow:hidden;
 margin:0;padding:0;width:100%;max-width:none;height:100%;min-height:0;
}
:root[data-cottage-layout=landscape] #main.cottage-scene-page {justify-content:center;container-type:size}
:root[data-cottage-layout=landscape] .game {
 --cottage-scene-ratio:1.777;
 --cottage-scene-footer-space:49px;
 --cottage-scene-height:max(0px,calc(var(--cottage-shell-height) - var(--cottage-safe-top) - var(--cottage-safe-bottom) - var(--cottage-scene-footer-space)));
 display:flex;flex-direction:column;align-items:center;min-height:0;
 width:100%;margin:0;border:0;border-radius:0;box-shadow:none;background:transparent;
}
@supports (width:1cqh) {
 :root[data-cottage-layout=landscape] .game {--cottage-scene-height:max(0px,calc(100cqh - var(--cottage-scene-footer-space)))}
}
:root[data-cottage-layout=landscape] .game.home {flex:1}
:root[data-cottage-layout=landscape] .game:is(.dates,.letters,.wardrobe) {--cottage-scene-ratio:3}
:root[data-cottage-layout=landscape] .game.yard {--cottage-scene-footer-space:119px}
:root[data-cottage-layout=landscape] .game .gameview {
 width:min(100%,calc(var(--cottage-scene-height) * var(--cottage-scene-ratio)));
 aspect-ratio:var(--cottage-scene-ratio);
}
:root[data-cottage-layout=landscape] .game.home .gameview {flex:1;min-height:0;width:100%;aspect-ratio:auto}
:root[data-cottage-layout=landscape] .game.home .stage {min-height:100%;max-height:129.5%}
:root[data-cottage-layout=landscape] .game:not(.home) .stage {
 top:0;height:100%;aspect-ratio:auto;transform:none;
}
:root[data-cottage-layout=landscape] .game .sign {z-index:6}
:root[data-cottage-layout=landscape] .yard-aim {z-index:8}
:root[data-cottage-layout=landscape] .game:not(.home) .climatehud {top:38px;bottom:auto;left:6px}
:root[data-cottage-layout=landscape] .scenefoot {
 position:relative;width:100%;min-height:48px;flex:none;flex-wrap:nowrap;align-items:center;
 padding:5px 10px;gap:8px;font-size:13px;
}
:root[data-cottage-layout=landscape] .game.home .scenefoot {
 display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
}
:root[data-cottage-layout=landscape] .cottage-footer-label {flex:1;overflow:hidden}
:root[data-cottage-layout=landscape] .cottage-footer-label strong {min-width:0;overflow:hidden}
:root[data-cottage-layout=landscape] .cottage-footer-label i {width:15px;height:15px;flex:none}
:root[data-cottage-layout=landscape] .cottage-footer-description {
 display:block;min-width:0;color:#62573f;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
:root[data-cottage-layout=landscape] .cottage-footer-actions {flex:0 1 auto;gap:6px}
:root[data-cottage-layout=landscape] .cottage-footer-actions #hint {
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:0 1 auto;
}
:root[data-cottage-layout=landscape] :is(.scene-camera,.cottage-menu-button,.cottage-record-footer button) {
 display:inline-flex;flex:none;align-items:center;min-height:30px;padding:3px 7px;margin:0;
 font-size:12px;line-height:1.35;white-space:nowrap;
}
:root[data-cottage-layout=landscape] .scene-camera i {width:14px;height:14px}
:root[data-cottage-layout=landscape] .cottage-records {
 flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:10px 12px;
}
:root[data-cottage-layout=landscape] .cottage-records .empty > [data-new] {display:none}
:root[data-cottage-layout=landscape] .cottage-record-footer {display:flex}
:root[data-cottage-layout=landscape] .yard-controls {
 display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;
 width:100%;padding:4px 8px;margin:0;border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;
}
:root[data-cottage-layout=landscape] .yard-tabs {background:transparent;border:0;flex:none}
:root[data-cottage-layout=landscape] .yard-tabs i {width:15px;height:15px}
:root[data-cottage-layout=landscape] .yard-tabs button {padding:3px 7px;font-size:12px;min-height:29px}
:root[data-cottage-layout=landscape] .yard-play {display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;min-width:0;padding:0;flex:1}
:root[data-cottage-layout=landscape] #yard-instructions {font-size:12px;margin:0;line-height:1.3}
:root[data-cottage-layout=landscape] .yard-buttons {gap:4px}
:root[data-cottage-layout=landscape] .yard-buttons button {min-height:26px;padding:2px 6px;font-size:12px}
:root[data-cottage-layout=landscape] #yard-hints {font-size:11px}
:root[data-cottage-layout=landscape] #yard-hints select {padding:1px 3px;font-size:11px}
:root[data-cottage-layout=landscape] .game.yard .scenefoot {order:1}
:root[data-cottage-layout=landscape] .game.yard .cottage-footer-actions #hint {
 max-width:min(42vw,240px);
}
:root[data-cottage-layout=landscape] .cottage-update-notice {
 position:absolute;bottom:54px;left:50%;transform:translateX(-50%);z-index:7;
 width:min(320px,calc(100% - 32px));margin:0;
}
@media(pointer:coarse) {
 .orientation-switch::after {content:"";position:absolute;inset:50% -4px auto;height:44px;transform:translateY(-50%)}
 .game .sign::before {content:"";position:absolute;inset:50% -5px auto;height:max(100%,44px);transform:translateY(-50%)}
 .game .sign:hover:not(:focus-visible){translate:0}
 .game .hit::before {content:"";position:absolute;inset:-4px}
 .game .pet::after {width:max(100%,44px);height:max(100%,44px);inset:50% auto auto 50%;transform:translate(-50%,-50%)}
}
.game .sign {z-index:6;touch-action:manipulation}
.game.memory .sign[data-act="sofa"] {
 padding:2px 6px;gap:3px;font-size:12px;line-height:1.4;border-width:1px;
 box-shadow:1px 2px 0 #382c2d65,inset 0 1px #fffaf0;
}
.game.memory .sign[data-act="sofa"] i {width:13px;height:13px}
.game .sign.seat-occupied {transform:translate(-50%,5px)}
.game .sign.seat-occupied::after {top:-5px;bottom:auto;transform:rotate(225deg)}
.game .hit {touch-action:manipulation}
.yard .yard-aim {z-index:8}

#dialog:has([data-cottage-update-card]) {
 width:min(628px,calc(100dvw - 24px));
 background:#fff6df;border-color:#8c7552;
}
:root:is([data-cottage-turn=right],[data-cottage-turn=left]) #dialog:has([data-cottage-update-card]) {
 width:min(628px,calc(var(--cottage-dialog-width,100dvh) - 24px));
}
#dialog:has([data-cottage-update-card]) .dlghead {
 position:relative;justify-content:center;text-align:center;border-bottom:0;background:transparent;
 padding:clamp(35px,8vh,65px) 28px 10px;
}
#dialog:has([data-cottage-update-card]) .dlghead h2 {font-size:clamp(27px,5.5vw,39px);line-height:1.5;color:#4c3a29}
#dialog:has([data-cottage-update-card]) .close {position:absolute;top:8px;right:8px}
#dialog:has([data-cottage-update-card]) .dlgcontent {padding:14px 22px 34px}
.cottage-update-card .actions {justify-content:center;gap:12px}
.cottage-update-card .actions button {min-height:44px;padding-inline:22px}
.cottage-update-card [role=status] {margin:12px 0 0;text-align:center}
.cottage-update-card [role=status]:empty {display:none}
