/* Exploration owns measured UI regions; world art never sits beneath tools. */
.mobile-btn, .mobile-btn * {
    -webkit-user-select:none; user-select:none;
    -webkit-touch-callout:none; touch-action:none;
}
body.exploration-layout #game-container {
    position:absolute; left:env(safe-area-inset-left,0px); right:env(safe-area-inset-right,0px);
    top:var(--exploration-top,100px); bottom:var(--exploration-bottom,120px);
    width:auto; height:auto; aspect-ratio:auto; max-width:none; max-height:none;
}
body.exploration-layout #hud {
    display:grid; grid-template-columns:minmax(0,1fr) auto auto;
    grid-template-areas:'location lights tools' 'stats stats stats';
    top:4px; padding:0 8px; gap:4px 6px; align-items:center;
}
body.exploration-layout #hud .location-name { grid-area:location; width:auto; max-width:none; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:4px 6px; font-size:calc(13px * var(--ui-scale)); border:0; background:none; }
body.exploration-layout #hud .bay-light-counter { grid-area:lights; padding:4px; border:0; background:none; font-size:calc(13px * var(--ui-scale)); white-space:nowrap; }
body.exploration-layout #hud .hud-buttons { grid-area:tools; width:auto; margin:0; gap:4px; }
body.exploration-layout #hud .hud-buttons button { min-height:44px; padding:4px 8px; font-size:calc(13px * var(--ui-scale)); }
body.exploration-layout #hud .stats-container { grid-area:stats; width:100%; min-width:0; flex-wrap:wrap; gap:4px; }
body.exploration-layout #hud .stat-item { padding:3px 8px; font-size:calc(13px * var(--ui-scale)); max-width:none; }
body.exploration-layout #hud .stat-item.gold,
body.exploration-layout #hud .stat-item.lvl,
body.exploration-layout #hud .stat-item.class,
body.exploration-layout #hud .experience-meter { display:none; }
body.exploration-layout .exploration-brief {
    position:absolute; left:8px; right:8px; top:auto; bottom:80px;
    width:auto; max-width:none; max-height:none; margin:0; padding:0;
    border:0; background:var(--ink); text-shadow:none; overflow:hidden;
    pointer-events:auto; display:block;
}
body.exploration-layout .exploration-brief .exploration-chapter,
body.exploration-layout .exploration-brief .exploration-tracked,
body.exploration-layout .exploration-brief .exploration-hint { display:none; }
body.exploration-layout .exploration-objective { margin:0; }
.exploration-goal-button { display:block; width:100%; min-height:44px; padding:6px 10px; text-align:left; background:var(--panel); color:var(--paper); border:1px solid var(--line); border-radius:4px; font:inherit; font-size:calc(14px * var(--ui-scale)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.exploration-layout #mobile-controls { bottom:8px; left:12px; right:12px; gap:8px; }
body.exploration-layout .mobile-btn { width:56px; height:56px; min-height:56px; font-size:calc(18px * var(--ui-scale)); }
body.exploration-layout .mobile-btn-action { width:auto; min-width:76px; max-width:45%; padding:6px 10px; white-space:nowrap; }
body.exploration-layout .exploration-brief.hidden { display:none; }
.exploration-menu-tools { display:grid; grid-template-columns:1fr; gap:8px; }
.exploration-menu-tools button { width:100%; text-align:left; }
.exploration-menu-status { color:var(--sea); font-size:calc(14px * var(--ui-scale)); line-height:1.6; }
.exploration-goal-dialog { margin:auto; width:min(600px,calc(100% - 24px)); max-height:calc(100dvh - 32px); padding:20px; background:var(--ink); color:var(--paper); border:2px solid var(--sea); overflow:auto; font:inherit; font-size:calc(16px * var(--ui-scale)); line-height:1.7; }
.exploration-goal-dialog::backdrop { background:#031018d9; }
.exploration-sound-hint { position:absolute; top:var(--exploration-top,100px); right:8px; padding:4px 8px; background:#071b29dd; font-size:calc(12px * var(--ui-scale)); pointer-events:none; }
.exploration-sound-hint[hidden] { display:none; }
.exploration-goal-dialog p { margin:12px 0; overflow-wrap:anywhere; }
.exploration-goal-dialog button { min-height:44px; padding:8px 12px; background:var(--panel); color:var(--paper); border:1px solid var(--sea); font:inherit; }
@media (max-width:359px) {
    body.exploration-layout #hud { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:'location tools' 'stats lights'; }
    body.exploration-layout #hud .stat-item { padding:3px 4px; font-size:calc(12px * var(--ui-scale)); }
}
@media (orientation:landscape) and (max-height:500px) {
    body.exploration-layout #hud { grid-template-columns:minmax(0,1fr) auto auto auto; grid-template-areas:'location stats lights tools'; }
    body.exploration-layout #hud .stats-container { width:auto; }
    body.exploration-layout #mobile-controls { bottom:4px; }
    body.exploration-layout .mobile-btn { height:48px; min-height:48px; width:48px; }
    body.exploration-layout .mobile-btn-action { width:auto; min-width:80px; }
    body.exploration-layout .exploration-brief { bottom:60px; }
}
