/* =====================================================================
   PBLRC Educational Arcade — Heavy Equipment Empire styles
   Construction-yellow operator-station look inside the arcade. Uses the shared tokens
   from styles.css and reuses CNC panel classes (ladder, lamps, mbtn, checks…).
   ===================================================================== */
.cabinet.c-heq { --c: var(--gold); }
.heq-hero { border-top: 4px solid #E8B000; }
.heq-hero .lobby-head svg { width: 72px; height: 72px; }

/* player layout */
.heq-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1080px) { .heq-grid { grid-template-columns: 1fr; } }
.heq-task { position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 90px); overflow: auto; }
@media (max-width: 1080px) { .heq-task { position: static; max-height: none; } }
.heq-widget { min-width: 0; }
.heq-task .prompt { font-size: .92rem; font-weight: 400; line-height: 1.5; }
.heq-task .prompt p { margin: .5rem 0 0; }
.heq-w { display: grid; gap: .7rem; min-width: 0; }
.heq-visual { overflow-x: auto; }
.heq-num { width: 100%; min-height: 40px; background: #070912; border: 1px solid var(--line); border-radius: 6px; padding: .2rem .45rem; color: var(--text); font-family: var(--mono); }
.heq-notes { width: 100%; background: #070912; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: .5rem; font: inherit; }
.heq-fs { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; display: grid; gap: .3rem; }
.heq-fs legend { font-size: .72rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); padding: 0 .3rem; }
.seg.wrap { flex-wrap: wrap; }
.plan-table select { min-width: 160px; }
.bad-row td { background: rgba(229, 57, 53, .12); }
.stat-mini.bad b { color: var(--red-lit); }
.bad { color: var(--red-lit); }

/* 3D model viewer */
.heq-model { position: relative; height: clamp(260px, 44vh, 420px); border-radius: 12px; overflow: hidden; border: 2px solid #3A3320; background: #9CC9E8; }
.heq-canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; cursor: grab; }
.heq-canvas:active { cursor: grabbing; }
.heq-partinfo { font-size: .88rem; min-height: 1.4em; }

/* operator station */
.heq-sim { background: #15140F; border: 2px solid #4A4126; border-radius: 14px; padding: .7rem; display: grid; gap: .6rem; min-width: 0; }
.heq-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.heq-head .sim-title { font-family: var(--pixel); font-size: .55rem; color: #F2C230; letter-spacing: .05em; margin-right: auto; line-height: 1.5; }
.heq-cams button { min-height: 36px; font-size: .75rem; padding: .2rem .6rem; }
.heq-hud { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); background: #0B0A06; border: 1px solid #3A3320; border-radius: 8px; padding: .4rem .6rem; }
.heq-hud b { color: #FFE8A3; font-family: var(--mono); font-weight: 600; }
.heq-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: .7rem; min-width: 0; }
@media (max-width: 900px) { .heq-body { grid-template-columns: 1fr; } }
.heq-main { display: grid; gap: .6rem; min-width: 0; }
.heq-side { display: grid; gap: .6rem; align-content: start; min-width: 0; }
.heq-stage { position: relative; height: clamp(280px, 50vh, 480px); border-radius: 10px; overflow: hidden; border: 1px solid #3A3320; background: #9CC9E8; }
.heq-sim.compact .heq-stage { height: clamp(240px, 38vh, 360px); }
.heq-alarm { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 2; padding: .45rem .6rem; border-radius: 8px; font-size: .84rem; font-weight: 700; line-height: 1.35; }
.heq-alarm.bad { background: rgba(90, 8, 8, .94); border: 2px solid var(--red); color: #FFD7D5; }
.heq-alarm.info { background: rgba(60, 45, 4, .94); border: 2px solid var(--gold); color: #FFF2C6; }
.heq-status { position: absolute; left: 8px; bottom: 8px; right: 60px; z-index: 2; font-size: .78rem; color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px #000; pointer-events: none; }
.heq-status:empty { display: none; }

.heq-sticks { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: center; justify-items: center; }
.js { display: grid; gap: .2rem; justify-items: center; }
.js-name { font-size: .64rem; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.js-pad { position: relative; width: 138px; height: 138px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #2A2618, #100E08 70%); border: 2px solid #4A4126; touch-action: none; user-select: none; }
.js-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #F7D26A, #B58600 70%); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); pointer-events: none; transition: transform .05s linear; }
.js-pad span { position: absolute; font-size: .58rem; font-weight: 700; color: #E8DFC0; text-transform: uppercase; letter-spacing: .02em; pointer-events: none; white-space: nowrap; }
.js-t { top: 6px; left: 50%; transform: translateX(-50%); } .js-b { bottom: 6px; left: 50%; transform: translateX(-50%); }
.js-lft { left: 6px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: left center; left: 14px; } .js-r { right: 6px; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: right center; right: 14px; }
.heq-travel { display: flex; gap: .8rem; }
.trav-l { display: grid; justify-items: center; gap: .2rem; font-size: .6rem; font-weight: 700; color: var(--muted); }
.trav { writing-mode: vertical-lr; direction: rtl; width: 34px; height: 120px; accent-color: var(--gold); }
@media (max-width: 560px) { .js-pad { width: 116px; height: 116px; } .heq-sticks { grid-template-columns: 1fr 1fr; } .heq-travel { grid-column: 1 / -1; order: 3; } .trav { writing-mode: horizontal-tb; direction: ltr; width: 120px; height: 30px; } }
.heq-cab { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.heq-cab .mbtn[aria-pressed="true"] { border-color: var(--green-lit); color: #CFF7D3; }
.opt-mini { font-size: .66rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.heq-cab .seg button { min-height: 38px; font-size: .7rem; padding: .2rem .5rem; }

.heq-inst { background: #050505; border: 2px solid #3A3320; border-radius: 10px; padding: .5rem; display: grid; gap: .4rem; }
.gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .2rem; }
.gauge { position: relative; display: grid; justify-items: center; text-align: center; }
.gauge svg { width: 100%; max-width: 92px; }
.g-track { fill: none; stroke: #2A2A2A; stroke-width: 8; stroke-linecap: round; }
.g-fill { fill: none; stroke: #5FD068; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .2s; }
.gauge.warn .g-fill { stroke: #FF5A52; }
.g-needle { stroke: #F2F2F2; stroke-width: 2.5; stroke-linecap: round; }
.g-hub { fill: #F2C230; }
.g-v { font-family: var(--mono); font-size: .72rem; color: #B9FFB4; margin-top: -4px; }
.gauge.warn .g-v { color: #FF8A84; }
.g-l { font-size: .56rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.hourm { display: flex; justify-content: space-between; align-items: baseline; font-size: .62rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); background: #0B0A06; border: 1px solid #3A3320; border-radius: 6px; padding: .2rem .5rem; }
.hourm b { font-family: var(--mono); font-size: .9rem; color: #FFE8A3; letter-spacing: 0; }
.lamp.bad { background: #5E1515; border-color: var(--red); color: #FFE1DF; box-shadow: 0 0 10px rgba(229, 57, 53, .55); }
.heq-card { background: #0D0C08; border: 1px solid #3A3320; border-radius: 10px; padding: .5rem .6rem; min-width: 0; }
.heq-card summary { cursor: pointer; font-size: .7rem; font-weight: 700; letter-spacing: .08em; color: #F2C230; }
.heq-card table { font-size: .78rem; }
.heq-log { list-style: none; margin: .3rem 0 0; padding: 0; max-height: 180px; overflow: auto; font-size: .76rem; display: grid; gap: .25rem; }
.heq-log li { padding: .25rem .4rem; border-radius: 6px; background: #14120C; border-left: 3px solid #555; }
.heq-log li.sev-minor { border-left-color: var(--gold); }
.heq-log li.sev-major { border-left-color: #FF8A1A; background: #2A160A; }
.heq-log li.sev-critical { border-left-color: var(--red); background: #3A0D0D; }

/* hydraulic schematic */
.hyd-wrap { min-width: 0; }
.hyd-svg { width: 100%; height: auto; display: block; }
.hs-t { fill: #F2F2F2; font: 700 12px var(--body); }
.hs-s { fill: #C9C2A6; font: 600 9px var(--body); }
.hs-tank { fill: #1C2A3A; stroke: #3E6A92; stroke-width: 1.5; }
.hs-pump { fill: #2B2B2B; stroke: #F2C230; stroke-width: 2; }
.hs-pump.spin { stroke-dasharray: 6 4; animation: spin 1s linear infinite; transform-origin: center; transform-box: fill-box; }
.hs-line { stroke: #6A6A6A; stroke-width: 3; fill: none; }
.hs-line.hs-p { stroke: #E53935; }
.hs-line.hs-w { stroke: #3E6A92; }
.hs-line.flow { stroke-dasharray: 8 6; animation: flow .6s linear infinite; }
.hs-relief { fill: #2B2B2B; stroke: #C9C2A6; }
.hs-relief.hot, .hyd-wrap.stall .hs-relief { fill: #6A1A10; stroke: #FF5A52; }
.hs-valve { fill: #24221A; stroke: #C9C2A6; }
.hs-center { fill: #3A3626; }
.hs-spool.on .hs-valve { stroke: #F2C230; stroke-width: 2; }
.hs-spool .spool-a, .hs-spool .spool-b { opacity: .5; }
.hs-cyl { fill: #1A1A1A; stroke: #8A8A8A; }
.hs-piston { fill: #D9E1E8; }
.hs-rod { fill: #D9E1E8; }
.hs-load { fill: #7A5634; stroke: #C9C2A6; }
.hs-read { margin-top: .2rem; }
@keyframes flow { to { stroke-dashoffset: -14; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hs-line.flow, .hs-pump.spin { animation: none; } }
html.reduce-motion .hs-line.flow, html.reduce-motion .hs-pump.spin { animation: none; }

/* bench */
.bench-svg svg { width: 100%; height: auto; background: #0B0A06; border: 1px solid #3A3320; border-radius: 10px; }
.bench-ctls { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem .9rem; }
.bench-ctl { display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; font-size: .8rem; }
.bench-ctl input { grid-column: 1 / -1; width: 100%; accent-color: var(--gold); }
.bench-ctl b { font-family: var(--mono); color: var(--gold); }
.bench-ctl.locked { opacity: .65; }

/* maintenance calendar */
.cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
@media (max-width: 560px) { .cal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cal-day { min-height: 74px; text-align: left; display: grid; align-content: start; gap: .15rem; padding: .35rem; border-radius: 8px; border: 1px solid var(--line); background: #0D1022; cursor: pointer; font-size: .7rem; }
.cal-day b { font-size: .72rem; color: var(--muted); }
.cal-day.down { background: #2A1010; border-color: var(--red); }
.cal-day.fail { box-shadow: inset 0 0 0 2px var(--red); }
.cal-chip { display: inline-block; font-size: .62rem; padding: 0 .3rem; border-radius: 4px; background: rgba(255, 193, 7, .16); border: 1px solid rgba(255, 193, 7, .45); color: #FFE8A3; }
.cal-h { font-family: var(--mono); font-size: .64rem; color: var(--green-lit); }
.cal-day.down .cal-h { color: var(--red-lit); }
.heq-res { display: grid; gap: .5rem; }

/* diagnosis, purchasing, business */
.heq-complaint { background: #14120C; border-color: #4A4126; }
.cmp-t th, .cmp-t td { white-space: nowrap; font-size: .8rem; }
.cmp-t input, .cmp-t select { min-width: 92px; min-height: 34px; }
.cmp-t tr.tot th, .cmp-t tr.tot td { font-weight: 700; background: rgba(255, 193, 7, .08); }
.heq-event { border-left: 4px solid var(--gold); }
.empire .panel { margin: 0; }
.empire table { font-size: .78rem; }
.heq-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .3rem; margin: .3rem 0 .6rem; }
