/* Navigation is never inside a scrolling list. Keep useful touch targets even
   when headings and decorative spacing get smaller in landscape. */
:root{--panel-top:max(8px,env(safe-area-inset-top));--panel-bottom:max(8px,env(safe-area-inset-bottom));--panel-left:max(12px,env(safe-area-inset-left));--panel-right:max(12px,env(safe-area-inset-right))}
.scarab-hunt{position:absolute;left:50%;top:calc(var(--panel-top) + 58px);transform:translateX(-50%);display:flex;align-items:center;gap:9px;padding:8px 12px;border:1px solid #d9ac5555;border-radius:8px;background:#151b1ee8;color:#ffdc85;pointer-events:none;max-width:calc(100% - 300px)}
.scarab-hunt[hidden]{display:none}.scarab-hunt strong{font-size:11px;line-height:1.3;display:block}.scarab-hunt small{display:block;font:9px var(--mono);margin-top:4px;color:#d3c5a3}.scarab-hunt>span{font-size:23px;line-height:1}
@media(max-width:700px){.scarab-hunt{left:calc(var(--panel-left) + 82px);transform:none;max-width:calc(100% - 270px);padding:6px 8px;gap:5px}.scarab-hunt strong{font-size:9px}.scarab-hunt small{font-size:8px}.scarab-hunt>span{font-size:20px}}
.arena-menu-button{position:absolute;top:var(--panel-top);left:var(--panel-left);min-height:44px;padding:9px 14px;border:1px solid #9cbb9040;border-radius:8px;background:#0e1b19e8;color:#c9e3bb;font-size:12px;pointer-events:auto;touch-action:manipulation}
/* Direction-only overlay; no hit targets or delayed CSS rotation. */
.edge-guides{position:absolute;inset:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);pointer-events:none;user-select:none;z-index:3}
.edge-guide{position:absolute;left:-28px;top:-28px;width:56px;height:56px;pointer-events:none}
.edge-guide[hidden]{display:none}
.edge-guide-face{position:absolute;inset:0;width:56px;height:56px;color:#ffe19b}
.edge-guide-arrow{position:absolute;inset:0;width:56px;height:56px;fill:currentColor;stroke:#302819;stroke-width:1.3;stroke-linejoin:round}
.edge-guide-badge{position:absolute;left:12px;top:12px;width:32px;height:32px;display:grid;place-items:center;border:1px solid #f5ce7899;border-radius:50%;background:#111a1eed}
.edge-guide-badge svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.scarab-guide-icon{background:#111a1eed url('./assets/golden-scarab-v1.png') center / 27px 27px no-repeat}
.scarab-guide small{position:absolute;top:46px;left:8px;min-width:40px;text-align:center;font:9px var(--mono);line-height:13px;color:#ffe4a6;border-radius:4px;background:#111a1eed}
.modal.panel-shell{overflow:hidden;padding:24px;max-width:calc(100% - var(--panel-left) - var(--panel-right));max-height:calc(100dvh - var(--panel-top) - var(--panel-bottom));gap:12px}
.modal.panel-shell[open]{display:flex;flex-direction:column}
.dialog-navigation,.dialog-actions{flex:none;min-width:0}.dialog-navigation{display:flex;align-items:center;min-height:40px;padding-right:42px}
.dialog-menu-button{min-height:40px;padding:8px 13px;border:1px solid #91b78540;border-radius:7px;background:#1a2a23;color:#c8e1b8;font-size:11px}
.dialog-content{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;scrollbar-width:thin}
.dialog-actions{display:flex;align-items:stretch;gap:10px;border-top:1px solid #8cb47622;padding-top:12px;background:inherit}
.dialog-actions>button{flex:1;min-width:0;width:auto;min-height:44px;margin:0!important;padding:11px 14px;font-size:12px;line-height:1.25}
.dialog-actions>.secondary-button{display:grid;place-items:center;border:1px solid #77966b50;border-radius:7px;background:#182720;color:#c6dbba}
.dialog-actions>.mesh-controls{margin:0;width:100%}.dialog-actions .mesh-controls button{min-height:40px}
.modal.panel-shell>.close-modal.icon-button{top:24px;right:20px;width:40px;height:40px;z-index:2}
.dialog-content .eyebrow{margin-top:0}.skin-modal .dialog-actions>.play-button{font-size:12px}
@media(orientation:landscape) and (max-height:540px){
 .modal.panel-shell{padding:12px 16px;border-radius:12px;gap:7px;width:640px}
 .modal.panel-shell>.close-modal.icon-button{top:10px;right:12px}
 .dialog-navigation{min-height:40px}.dialog-menu-button{min-height:40px;padding:7px 12px;font-size:11px}
 .dialog-actions{gap:9px;padding-top:8px}.dialog-actions>button{font-size:11px;letter-spacing:.5px;padding:9px 12px;min-height:44px}.dialog-actions>button svg{width:19px;height:19px}
 .dialog-content .eyebrow{font-size:7px;letter-spacing:.7px;margin:0 0 5px;line-height:1.5}
 .dialog-content h2{font-size:28px;line-height:1.05;margin:0 0 7px}.dialog-content .modal-intro{font-size:10px;line-height:1.4;margin:0 0 8px}
 /* End of round: score and statistics share a row, both actions stay visible. */
 .result-modal .dialog-content{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.3fr);grid-template-areas:'eyebrow eyebrow' 'title title' 'reason reason' 'score stats' 'score adventure';gap:5px 18px;align-items:center}
 #result-eyebrow{grid-area:eyebrow;justify-content:center;margin:0;font-size:7px}
 #result-heading{grid-area:title;margin:0;font-size:30px}
 #death-reason{grid-area:reason;margin:0 0 4px;font-size:10px;overflow-wrap:anywhere}
 .result-score{grid-area:score;margin:0;padding:9px 12px 9px 0;border:0;border-right:1px solid #91ad7038;min-width:0}
 .result-score>span:first-child{font-size:7px;letter-spacing:1px}.result-score>strong{font-size:clamp(36px,12vh,55px);line-height:1.1;overflow-wrap:anywhere}.record-badge{font-size:7px;letter-spacing:.5px}
 .result-stats{grid-area:stats;gap:10px;margin:0;min-width:0}.result-stats>div{min-width:0}.result-stats strong{font-size:23px;line-height:1.1;margin:0 0 4px;overflow-wrap:anywhere}.result-stats span{font-size:7px;letter-spacing:.4px}
 .result-adventure{grid-area:adventure;margin:0;padding:6px 0 0;font-size:9px;line-height:1.5;border-bottom:0;overflow-wrap:anywhere}
 .compact-modal.panel-shell{width:460px}.compact-modal .dialog-content h2{font-size:32px;margin:8px 0}.compact-modal .modal-intro{margin:0 0 8px}.compact-modal .dialog-content .eyebrow{justify-content:center}
 /* Settings fit horizontally instead of three tall stacked rows. */
 .settings-modal .dialog-content{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px 10px}
 .settings-modal .dialog-content>.eyebrow,.settings-modal .dialog-content>h2,.settings-modal .local-note{grid-column:1/-1;margin:0}
 .settings-modal .setting-row{display:flex;flex-wrap:wrap;align-content:space-between;min-height:88px;padding:8px 10px;border:1px solid #72946c33;border-radius:7px;gap:7px}
 .settings-modal .setting-row>span:first-child{flex-basis:100%}.setting-row strong{font-size:11px;margin-bottom:4px}.setting-row small{font-size:9px;line-height:1.35}.settings-modal .setting-row input{right:9px;bottom:8px}
 .settings-modal .switch{width:38px;height:22px}.settings-modal .switch:after{width:14px;height:14px}.settings-modal .setting-row input:checked+.switch:after{transform:translateX(16px)}
 .settings-modal .local-note{gap:8px;margin-top:3px}.settings-modal .local-note p{font-size:9px;line-height:1.4;margin:0}
 /* Help, collection and 3D viewer keep their own bounded content pane. */
 #help-dialog .help-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}#help-dialog .help-list>div{gap:6px;margin:5px 0}
 #help-dialog .help-list p{font-size:9px;line-height:1.4}#help-dialog .help-list strong{font-size:10px;margin-bottom:4px}#help-dialog .help-list>div>span{font-size:9px}
 #help-dialog .power-guide{font-size:8px;gap:10px;margin:8px 0;padding:7px 0}#help-dialog .small-note{font-size:8px;line-height:1.4;margin:6px 0}
 .skin-modal.panel-shell{width:900px}.skin-modal .customizer{grid-template-columns:155px minmax(0,1fr);gap:13px;margin:8px 0}
 .skin-modal .head-showcase{display:block;position:sticky;top:0;min-height:0}.skin-modal .head-showcase canvas{width:100%;margin:16px 0 0;transform:none}.skin-modal .showcase-copy{padding:7px 10px 12px}.skin-modal .showcase-copy h3{font-size:23px;margin:4px 0}.skin-modal .showcase-copy p{font-size:9px;line-height:1.4;min-height:0}.skin-modal .gaze-hint{font-size:8px;margin-top:7px}.skin-modal .showcase-label{font-size:6px;top:8px;left:10px}
 .skin-modal .mesh-view-button{font-size:10px;min-height:40px;padding:7px 9px;margin:4px auto}.skin-modal .model-library{margin-bottom:12px;padding-bottom:10px}.skin-modal .model-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none;overflow:visible}.skin-modal .model-card{min-height:66px;grid-template-columns:40px minmax(0,1fr);padding:6px;gap:3px 6px}.skin-modal .model-card img{width:40px;height:45px}.skin-modal .model-card strong{font-size:10px}.skin-modal .head-categories{flex-wrap:wrap}.skin-modal .head-categories button{flex-basis:40%;padding:8px 5px}.skin-modal .color-label{margin-top:13px}
 .mesh-modal.panel-shell{width:780px}.mesh-modal .dialog-content{display:flex;flex-direction:column;gap:5px}.mesh-modal .dialog-content>h2{font-size:23px;margin:0}.mesh-modal .dialog-content>.eyebrow{font-size:6px;margin:0}
 .mesh-modal canvas{height:calc(100dvh - 192px);min-height:84px;max-height:310px;flex-shrink:0}.mesh-modal .dialog-content p{font-size:8px;line-height:1.35;margin:0}.mesh-modal .dialog-actions{padding-top:5px}.mesh-modal .mesh-controls{gap:10px}.mesh-modal .mesh-controls button{padding:7px 12px;font-size:10px;min-height:40px}
}
@media(orientation:landscape) and (max-height:300px){
 .modal.panel-shell{padding:8px 12px;gap:4px}.modal.panel-shell>.close-modal.icon-button{top:6px;right:8px}.dialog-actions{padding-top:5px}
 #result-heading{font-size:25px}.result-score{padding-top:5px;padding-bottom:5px}.result-score>strong{font-size:36px}.result-stats strong{font-size:20px}.result-modal .dialog-content{gap:3px 12px}
 .settings-modal .setting-row{min-height:77px;padding:6px 8px}.settings-modal .dialog-content{gap:4px 8px}
}
@media(orientation:landscape) and (max-height:540px){
 .skin-modal .head-showcase canvas{height:75px;width:100%;object-fit:contain;margin:8px 0 0}.skin-modal .gaze-hint{display:none}.skin-modal .showcase-copy{padding:5px 9px 8px}.skin-modal .showcase-copy h3{font-size:20px;margin:3px 0}.skin-modal .showcase-copy p{font-size:8px;line-height:1.3}.skin-modal .head-showcase:has(.mesh-view-button:not([hidden])) .showcase-copy p{display:none}
}
