/* TOCA3 HUD V13: desktop-only layout controls. Load after progress-ui.css. */
.hud-editor-v13{
 z-index:205;bottom:12px;left:50%;width:min(610px,calc(100vw - 32px));
 gap:7px;padding:11px 13px;box-shadow:0 9px 35px #000b;
 border:1px solid #eac86c;background:rgba(14,20,30,.97);
 color:#f2f5fa;font:12px/1.45 system-ui,Arial,sans-serif;
 max-height:calc(100vh - 16px);overflow-y:auto;overscroll-behavior:contain;
}
.hud-editor-v13 .hud-editor-grip{width:100%;border:1px dashed #b6c8db88;border-radius:6px;background:#34485a88;padding:6px 9px;cursor:grab;touch-action:none;user-select:none;font-weight:700;color:#f6d17e;letter-spacing:.02em}
.hud-editor-v13 .hud-editor-grip:active{cursor:grabbing}
.hud-editor-v13 .hud-editor-grip small{float:right;color:#c6d3dc;font-weight:400}
.hud-editor-v13 .hud-picker-controls{width:100%;display:flex;align-items:center;justify-content:center;gap:9px;flex-wrap:wrap}
.hud-editor-v13 .hud-picker-controls label{color:#d4e1ed}
.hud-editor-v13 .hud-picker-controls select{min-width:185px;max-width:260px;width:38%;height:34px;padding:3px 7px;border-radius:5px;border:1px solid #8397ab;color:#f1f8ff;background:#1c3043;cursor:pointer}
.hud-editor-v13 .hud-editor-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;width:100%}
.hud-editor-v13 [data-hud-visibility]{color:#f4ded9;border-color:#d8a79e;background:#59383b}
.hud-editor-v13 [data-hud-visibility]:not(:disabled):hover{background:#74494a}
.hud-editor-v13 [data-hud-dock]{color:#dbe9f7}
.hud-user-hidden[data-hud-piece]{display:none!important}
body.hud-editing .hud-user-hidden[data-hud-piece]{display:block!important;opacity:.42!important;filter:grayscale(.6);outline-color:#dd8c8c!important}
body.hud-editing .hud-user-hidden[data-hud-selected=true]{outline-color:#7ce6bc!important}
.hud-editor-v13 strong{font-size:15px;color:#f5cb68;letter-spacing:.3px}
.hud-editor-v13 span{color:#cbd4e0}
.hud-editor-v13 .hud-scale-controls{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;flex-wrap:wrap}
.hud-editor-v13 .hud-scale-controls label{display:flex;align-items:center;gap:6px;min-width:145px;font-size:12px}
.hud-editor-v13 .hud-scale-controls label b{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f8d987}
.hud-editor-v13 .hud-scale-controls input[type=range]{width:135px;max-width:30vw;accent-color:#f8c344;cursor:ew-resize}
.hud-editor-v13 .hud-scale-controls output{width:46px;text-align:right;font:700 12px ui-monospace,Consolas,monospace;color:#fff}
.hud-editor-v13 .hud-opacity-controls{display:flex;align-items:center;justify-content:center;gap:9px;width:100%}
.hud-editor-v13 .hud-opacity-controls label{min-width:70px;font-size:12px;color:#f2f5fa}
.hud-editor-v13 .hud-opacity-controls input[type=range]{width:185px;max-width:42vw;accent-color:#7ce6bc;cursor:ew-resize}
.hud-editor-v13 .hud-opacity-controls output{width:46px;text-align:right;font:700 12px ui-monospace,Consolas,monospace;color:#fff}
.hud-editor-v13 button{border-radius:5px;min-height:31px;padding:6px 12px;color:#fff;background:#2f4558;border:1px solid #90a9ba;font-size:12px}
.hud-editor-v13 button:hover:not(:disabled){background:#425b72}
.hud-editor-v13 button:disabled{cursor:not-allowed;opacity:.45}
.hud-editor-v13 [data-layout-done]{background:#316956;border-color:#70b59a;font-weight:700}
.hud-editor-v13 [data-layout-reset]{background:#543f2d;border-color:#d5a364}
.hud-editor-v13 [data-hud-step]{font-size:18px;font-weight:800;width:34px;padding:2px 0}
.hud-resize-handle{position:fixed;width:34px;height:34px;display:grid;place-items:center;z-index:211;
 background:#ffd16b;color:#1a1e25;border:2px solid #1b2531;border-radius:8px;box-shadow:0 4px 12px #000a;
 cursor:nwse-resize;touch-action:none;user-select:none;font:700 21px system-ui;line-height:1;padding:0}
.hud-resize-handle[hidden]{display:none!important}
.hud-editing [data-hud-piece]{outline:2px dashed #f4c85a!important;outline-offset:2px;
 cursor:grab;user-select:none;touch-action:none}
.hud-editing [data-hud-piece][data-hud-selected=true]{outline:3px solid #7ce6bc!important;outline-offset:3px}
.hud-editing [data-hud-piece][data-hud-selected=true]::after{background:#215743!important;color:#fff!important}
/* The existing status CSS hides these when settings turn them off. Editor mode
   intentionally previews their outlines without changing the original hidden flag. */
body.hud-editing #fpsCounter[hidden],body.hud-editing #proximityRadar[hidden],
body.hud-editing #tireHeat[hidden],body.hud-editing #rearMirrorFrame[hidden],
body.hud-editing #raceNotices[hidden],
body.hud-editing #sectorDeltaPanel[hidden],body.hud-editing #raceContextBoard[hidden],
body.hud-editing .hud-custom-hidden[data-hud-piece]{display:block!important;visibility:visible!important}
body.hud-editing #proximityRadar[hidden],body.hud-editing #minimap[data-hud-piece]{
 background:rgba(31,40,53,.55);border:1px solid #e7d38f55}
body.hud-editing #sectorDeltaPanel[data-hud-piece]:empty::before{content:'Delta por sectores';display:block;padding:11px;color:#ddd}
body.hud-editing #raceContextBoard[data-hud-piece]:empty::before{content:'Tabla de pilotos';display:block;padding:11px;color:#ddd}
/* Critical camera/pause/texture controls remain above movable HUD pieces in
   normal play; the editor is independent and has a compact bottom bar. */
body.racing:not(.hud-editing) .controls{z-index:120!important}
body.hud-editing .controls{z-index:119!important;display:flex!important}
body.hud-editing #pauseBtn,body.hud-editing #camBtn{pointer-events:auto!important}
@media(min-width:701px) and (max-height:570px){
 .hud-editor-v13{width:min(780px,calc(100vw - 26px));bottom:6px;gap:4px;padding:6px 9px}
 .hud-editor-v13 .hud-editor-grip{padding:3px 7px}
}
