/* =====================================================================
   v9 · ALERTA HORIZONTAL CON NOTA, OPERADOR, PIEZAS EN FRANJA SOBRE EL
        TABLERO, PALANCA F-N-R Y VOLANTE, IMAGEN DE CARGA SIN RECORTES
   ===================================================================== */
/* ---------- Alerta de problema: horizontal y baja ---------- */
#probCard { width: min(1060px, calc(100vw - 360px)); bottom: 168px; padding: 9px 12px; }
#probCard.show { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) 250px auto; gap: 12px; align-items: center; }
#probCard .pc-l { min-width: 0; }
#probCard .pc-t { margin: 4px 0 0; font-size: 14.5px; line-height: 1.2; }
#probCard .pc-s { margin: 0; padding-left: 16px; font-size: 11.5px; line-height: 1.35; max-height: 62px; overflow-y: auto; border-left: 1px solid rgba(255,138,128,.25); padding-left: 26px; }
#probCard .pc-s li { margin: 0; }
.pc-w { display: flex; gap: 6px; align-items: center; }
.pc-w input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,138,128,.4); background: rgba(0,0,0,.35); color: #fff; font: inherit; font-size: 12.5px; outline: none; }
.pc-w input:focus { border-color: #ffc414; box-shadow: 0 0 0 2px rgba(255,196,20,.2); }
.pc-w input::placeholder { color: rgba(232,214,212,.5); }
.pc-acc { height: 34px; padding: 0 11px; border-radius: 8px; cursor: pointer; border: 1px solid #ffc414; background: rgba(255,196,20,.16); color: #ffc414; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; font-weight: 700; }
.pc-acc:hover { background: #ffc414; color: #141517; }
#probCard .pc-b { gap: 8px; }
#probCard .pc-b button { width: 38px; height: 38px; font-size: 18px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (max-width: 1150px) { #probCard { width: calc(100vw - 24px); } #probCard.show { grid-template-columns: 1fr 220px auto; } #probCard .pc-s { display: none; } }

/* ---------- Nombre del operador ---------- */
#opModal { display: none; position: fixed; inset: 0; z-index: 130; align-items: center; justify-content: center; background: rgba(8,9,11,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#opModal.show { display: flex; }
.op-box { width: min(380px, calc(100vw - 32px)); padding: 18px 20px 18px; border-radius: 16px; background: rgba(20,22,25,.97); border: 1px solid var(--line-soft); box-shadow: 0 20px 60px rgba(0,0,0,.7); display: flex; flex-direction: column; gap: 8px; animation: ppIn2 .25s ease-out; }
@keyframes ppIn2 { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.op-h { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.op-h svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; }
.op-h b { font-family: var(--mono); font-size: 12px; letter-spacing: .22em; color: var(--text); }
.op-box label { font-size: 12.5px; color: var(--text-dim); }
.op-box input { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: #0e1012; color: #fff; font: inherit; font-size: 16px; outline: none; }
.op-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,196,20,.18); }
.op-box small { font-size: 11px; color: var(--text-faint); }
#opOk { margin-top: 6px; height: 42px; border-radius: 10px; cursor: pointer; border: 0; background: var(--accent); color: #141517; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; }
#opOk:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Piezas intercambiables: franja horizontal sobre el tablero ---------- */
#partsPanel { transform: none; bottom: 150px; padding: 6px 30px 6px 8px; border-radius: 12px; gap: 10px; align-items: stretch; }
#partsPanel.show { display: flex; animation: ppIn3 .2s ease-out; }
@keyframes ppIn3 { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#partsPanel .pp-g { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 0; }
#partsPanel .pp-g + .pp-g { border-left: 1px solid var(--line-faint); padding-left: 10px; }
#partsPanel .pp-g > span { font-size: 7.5px; letter-spacing: .14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#partsPanel .pp-row { flex-wrap: nowrap; gap: 4px; }
#partsPanel .ppb { flex: 1 1 0; min-width: 0; width: auto; min-height: 0; height: 56px; padding: 4px 2px 3px; gap: 1px; border-radius: 8px; }
#partsPanel .ppb svg { width: 18px; height: 18px; flex: none; }
#partsPanel .ppb b { font-size: 8px; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#partsPanel .ppb small { font-size: 7px; }
#partsPanel .pp-x { position: absolute; top: 5px; right: 5px; margin: 0; width: 20px; height: 20px; font-size: 13px; }
#partsPanel .pp-f { display: none; }

/* ---------- Palanca F-N-R / marchas (encima del joystick izquierdo) ---------- */
#shuttle { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: 112px; pointer-events: auto; text-align: center; cursor: pointer;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.6)); }
body.joy.drive #shuttle { display: block; animation: shFade .25s ease-out; }
@keyframes shFade { from { opacity: 0; } to { opacity: 1; } }
#shuttle svg { width: 112px; height: 112px; display: block; }
#shuttle small { display: block; margin-top: 1px; font-family: var(--mono); font-size: 7.5px; letter-spacing: .14em; color: var(--text-faint); }
.sh-plate { fill: #1b1e22; stroke: #3c4046; stroke-width: 1.5; }
.sh-slot { stroke: #07080a; stroke-width: 9; stroke-linecap: round; }
.sh-l { font-family: var(--mono); font-size: 15px; font-weight: 700; fill: #5d6670; }
.sh-l.on { fill: #ffc414; }
.sh-l[data-dir="R"].on { fill: #ff5a4f; }
#shLever { transition: transform .22s cubic-bezier(.3,1.5,.5,1); }
.sh-knob { fill: #2c3035; stroke: #ffc414; stroke-width: 2.5; }
.sh-gear { font-family: var(--mono); font-size: 11px; font-weight: 700; fill: #ffc414; text-anchor: middle; }
.sh-gears text { font-family: var(--mono); font-size: 13px; font-weight: 700; fill: #4a525b; text-anchor: middle; }
.sh-gears text.on { fill: #48bfff; }
.sh-cap { font-family: var(--mono); font-size: 7px; fill: #5d6670; text-anchor: middle; letter-spacing: .1em; }

/* ---------- Volante del vehículo detrás del tablero ---------- */
#wheelHud { display: none; position: absolute; left: 50%; top: -150px; width: 200px; height: 200px; margin-left: -100px; z-index: -1; pointer-events: none; opacity: .96; }
body.joy.drive #wheelHud { display: block; animation: ppIn2 .3s ease-out; }
#wheelSvg { width: 100%; height: 100%; display: block; transform-origin: 50% 50%; transition: transform .06s linear; filter: drop-shadow(0 10px 16px rgba(0,0,0,.65)); }
.wh-rim { fill: none; stroke: #3a3f46; stroke-width: 16; }
.wh-grip { fill: none; stroke: #5a616a; stroke-width: 8; stroke-dasharray: 4 5; }
.wh-spoke { fill: none; stroke: #444a52; stroke-width: 13; stroke-linecap: round; }
.wh-hub { fill: #202328; stroke: #ffc414; stroke-width: 2; }
.wh-cat { font-family: var(--mono); font-size: 13px; font-weight: 800; fill: #ffc414; text-anchor: middle; letter-spacing: .08em; }
.wh-knob { fill: #ffc414; stroke: #141517; stroke-width: 2.5; }

/* ---------- Imagen de carga: escarabajo completo, sin bordes de recorte ---------- */
.sp-img { background: radial-gradient(circle at 50% 46%, #fdb907 0%, #f8b006 58%, #eaa105 100%); overflow: hidden; }
.sp-img::after { content: ''; position: absolute; inset: 5% 14%; background: url(assets/splash-brocad.jpg) center / contain no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 74%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 74%, transparent 100%); }
