/* SOEST 3D 0.5.6.1 · TABLET VIEW
   Hybrid-Layout: kompakter HUD, Touch-Steuerung bei grobem Pointer, große Edit-Panels als Arbeitsfläche. */

html,body{height:var(--so3d-vh,100dvh);min-height:0}
#game-shell{top:0;left:0;right:0;bottom:auto;height:calc(var(--so3d-vh,100dvh) - 24px - var(--so3d-safe-bottom))}
.credits-bar{height:calc(24px + var(--so3d-safe-bottom));padding-bottom:var(--so3d-safe-bottom);gap:9px;font-size:7px;overflow:hidden;white-space:nowrap}
.credits-bar span:first-child{max-width:48vw;overflow:hidden;text-overflow:ellipsis}
.cesium-viewer-bottom{bottom:4px!important}

.topbar{left:max(8px,env(safe-area-inset-left,0px));right:max(8px,env(safe-area-inset-right,0px));top:calc(7px + var(--so3d-safe-top));min-height:48px;height:48px;padding:5px 7px;gap:7px}
.brand{min-width:132px;gap:7px}.brand strong{font-size:14px}.brand small{font-size:7px;white-space:nowrap}
.top-actions{display:flex;flex-wrap:nowrap;justify-content:flex-end;gap:4px;max-width:calc(100vw - 155px);overflow:hidden}
.hud-btn{min-height:36px;padding:6px 7px;font-size:8px;white-space:nowrap}
.control-mode-switch{gap:2px}.control-mode-switch .control-mode-btn{padding:6px 6px;font-size:8px}
.top-actions #btn-quality,.top-actions #btn-mesh-mode{display:none}

.telemetry{left:max(8px,env(safe-area-inset-left,0px));top:calc(63px + var(--so3d-safe-top));width:218px;padding:8px;max-height:calc(var(--so3d-vh,100dvh) - 102px - var(--so3d-safe-bottom))}
.hud-hub{width:218px;gap:5px}.telemetry-row{padding:5px 0;font-size:9px}.telemetry-row strong{font-size:9px;max-width:112px}
.hud-section>summary{min-height:36px;padding:7px 8px}.hud-section-body{padding:5px}.hud-actions{gap:5px}.hud-actions .wide-btn{min-height:36px;font-size:8px}
.mobile-quick-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.mobile-quick-actions button{min-height:36px;border:1px solid rgba(85,255,155,.22);background:rgba(5,24,14,.9);color:#dfffea;font-size:7px;font-weight:850;padding:5px 3px}
.mobile-quick-actions button:nth-child(1),.mobile-quick-actions button:nth-child(2),.mobile-quick-actions button:nth-child(3),.mobile-quick-actions button:nth-child(6),.mobile-quick-actions button:nth-child(7){display:none}

.multiplayer-panel{right:max(8px,env(safe-area-inset-right,0px));top:calc(63px + var(--so3d-safe-top));width:228px;padding:7px}
.chat-log{height:76px}.multiplayer-head input{width:94px}.chat-form button{display:none}
.mission-card,.controls-hint{display:none}

.artifact-editor-panel,.world-repair-panel,.ground-wand-panel{position:fixed;z-index:70;left:238px;right:max(8px,env(safe-area-inset-right,0px));top:calc(63px + var(--so3d-safe-top));width:auto;max-width:none;max-height:calc(var(--so3d-vh,100dvh) - 102px - var(--so3d-safe-bottom));padding:9px}
.artifact-manager-panel{left:auto;right:max(8px,env(safe-area-inset-right,0px));top:auto;bottom:calc(32px + var(--so3d-safe-bottom));width:min(360px,calc(100vw - 24px));max-width:none;max-height:52dvh}
.ground-wand-panel.collapsed{left:auto;right:max(8px,env(safe-area-inset-right,0px));top:calc(63px + var(--so3d-safe-top));bottom:auto;width:250px;max-width:calc(100vw - 16px);max-height:none}
.ground-wand-modes{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.ground-wand-modes button{min-height:34px;font-size:7px}
.ground-wand-quickbar{grid-template-columns:1fr 1fr}.ground-wand-presets{grid-template-columns:repeat(3,1fr)}

@media (pointer:coarse){
  .touch-look{display:block;position:absolute;z-index:11;right:0;top:56px;bottom:calc(88px + var(--so3d-safe-bottom));width:55%;touch-action:none;pointer-events:auto}
  .touch-controls{display:flex;position:absolute;z-index:12;left:max(10px,env(safe-area-inset-left,0px));right:max(10px,env(safe-area-inset-right,0px));bottom:calc(8px + var(--so3d-safe-bottom));justify-content:space-between;align-items:flex-end;pointer-events:none;gap:12px}
  .touch-controls button{pointer-events:auto;touch-action:none;border:1px solid rgba(85,255,155,.25);background:rgba(5,16,10,.80);color:#dfffea;min-width:48px;min-height:44px;border-radius:4px}
  .touch-pad>button{display:block;margin:0 auto 5px}.touch-pad div{display:flex;gap:5px}
  .touch-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;width:min(220px,38vw)}.touch-actions button{font-size:8px;padding:5px;min-width:0}
  body.ground-pick-armed .touch-look{pointer-events:none!important;opacity:.12}
}

@media (pointer:coarse) and (orientation:landscape){
  .telemetry{max-height:calc(var(--so3d-vh,100dvh) - 196px - var(--so3d-safe-bottom))}
}

@media (max-width:900px){
  .brand small{display:none}.brand{min-width:104px}
  .top-actions #btn-camera{display:none}
  .telemetry{width:202px}.hud-hub{width:202px}
  .multiplayer-panel{display:none}
  .artifact-editor-panel,.world-repair-panel,.ground-wand-panel{left:218px}
}

@media (orientation:portrait) and (max-width:820px){
  .top-actions{max-width:calc(100vw - 118px)}
  .top-actions #btn-pause{display:none}
  .telemetry{width:192px}.hud-hub{width:192px}
  .artifact-editor-panel,.world-repair-panel,.ground-wand-panel{left:8px;right:8px;top:auto;bottom:calc(30px + var(--so3d-safe-bottom));max-height:min(68dvh,calc(var(--so3d-vh,100dvh) - 92px - var(--so3d-safe-bottom)));border-radius:7px 7px 0 0}
  .ground-wand-panel.collapsed{left:auto;right:8px;top:calc(63px + var(--so3d-safe-top));bottom:auto}
}

@media (max-height:540px) and (orientation:landscape){
  .topbar{height:44px;min-height:44px;top:4px}.telemetry{top:54px;max-height:calc(var(--so3d-vh,100dvh) - 84px)}
  .brand small{display:none}.top-actions #btn-pause{display:none}
  .artifact-editor-panel,.world-repair-panel,.ground-wand-panel{top:54px;max-height:calc(var(--so3d-vh,100dvh) - 84px)}
  .start-panel{max-height:88dvh;overflow:auto;padding:12px}.start-panel h1{font-size:28px}.start-panel .lead{margin:7px 0 10px;font-size:11px}.mode-card{min-height:82px;padding:10px}.start-facts{display:none}
}

/* 0.5.6.8 · Tablet UX pass */
.chat-form button{display:block;min-height:40px;padding:7px 6px;font-size:8px;flex:0 0 auto}
@media (pointer:coarse){
  .multiplayer-head input,.chat-form input{font-size:16px}
  .mobile-quick-actions button{min-height:40px;font-size:8px}
  .touch-controls button{min-height:46px;min-width:50px}
  .touch-actions button{font-size:9px}
  .hud-actions .wide-btn,.artifact-size-row button,.artifact-action-row button{min-height:40px}
}

/* 0.5.6.8 · finaler Tablet-Lesbarkeits-Pass. */
.credits-bar{font-size:8px}.brand small{font-size:8px}.hud-btn,.control-mode-switch .control-mode-btn{font-size:9px}
.telemetry-row,.telemetry-row strong{font-size:10px}.hud-section>summary{font-size:10px}.hud-actions .wide-btn{font-size:9px}
.mobile-quick-actions button{font-size:9px}.ground-wand-modes button{font-size:9px}

/* 0.5.6.8 · Admin-Leitstand Tablet */
.admin-control-overlay{padding:8px}.admin-control-shell{width:100%;height:calc(var(--so3d-vh,100dvh) - 16px)}.admin-control-tabs button{min-height:42px;font-size:10px}

/* 0.5.7.1 · kontextabhängiger Bus-Button */
.bus-interaction-prompt{display:none!important}
.touch-actions .touch-bus-interact{grid-column:1/-1;min-height:52px!important;font-size:10px!important;font-weight:900;border-color:rgba(85,255,155,.72)!important;background:rgba(5,45,25,.94)!important}
body.bus-passenger .touch-pad{opacity:.18;pointer-events:none}
body.bus-passenger #touch-jump,body.bus-passenger #touch-mode,body.bus-passenger #touch-road{opacity:.26;pointer-events:none}

.touch-actions .touch-bus-interact:disabled{opacity:.72!important;border-color:rgba(255,220,90,.48)!important;color:#ffe99a!important;background:rgba(35,30,7,.92)!important}

/* 0.5.7.3 · Lichttaste */
.touch-actions #touch-light{font-weight:850;border-color:rgba(255,239,170,.46);}
