/* Puzzle de fluxo: metal envelhecido, válvulas de latão e leitura espiritual em ciano. */
:root { color-scheme: dark; --bg:#0b1012; --panel:#121c20; --paper:#e6e6da; --muted:#9caeb3; --cyan:#7ce6ed; --gold:#cfb07a; --line:#33444a; --green:#98e9af; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:radial-gradient(ellipse at 45% 0%,#1a3038 0,transparent 58%),var(--bg); color:var(--paper); font:14px/1.55 'Segoe UI',Arial,sans-serif; }
button,select { font:inherit; }
button,a,select { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.36; }
button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid var(--cyan); outline-offset:5px; }
a { color:inherit; }
h1,h2,p { margin:0; }
.lab-shell { max-width:1440px; margin:auto; padding:0 30px; }
.lab-header { min-height:130px; display:flex; align-items:center; gap:26px; border-bottom:1px solid var(--line); }
.brand { flex:0 0 145px; line-height:0; }
.brand img { width:145px; height:auto; }
.header-title { flex:1; }
.eyebrow { color:var(--gold); font-size:10px; font-weight:750; letter-spacing:.17em; text-transform:uppercase; }
h1 { font-size:clamp(19px,2.5vw,29px); line-height:1.2; margin-top:6px; font-weight:650; letter-spacing:-.03em; }
.lab-header nav { display:flex; flex-wrap:wrap; gap:22px; font-size:12px; }
.lab-header nav a { text-decoration:none; color:var(--muted); }
.lab-header nav a:hover { color:var(--cyan); }
.session-bar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:17px 0 23px; }
.session-bar label { font-size:11px; color:var(--muted); }
.session-bar select { max-width:290px; min-height:38px; color:var(--paper); background:#10191d; border:1px solid var(--line); border-radius:3px; padding:7px 30px 7px 12px; }
.connection-label { flex:1; min-width:150px; color:var(--muted); font-size:11px; }
.connection-label::before { content:''; display:inline-block; width:6px; height:6px; margin-right:8px; border-radius:50%; background:var(--green); }
.connection-label.offline::before { background:#e3a174; }
.text-button { border:0; background:none; color:var(--muted); font-size:12px; padding:8px 4px; }
.text-button:hover { color:var(--cyan); }
.circuit-bar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:0 0 18px; padding:12px 15px; background:#152025; border:1px solid var(--line); border-radius:4px; }
.circuit-bar label { font-size:11px; color:var(--muted); }.circuit-bar select { border:1px solid #56655f; background:#1a2c2a; color:var(--paper); border-radius:3px; padding:8px 12px; max-width:100%; }.circuit-bar>span { margin-left:auto; font-size:11px; color:var(--gold); }
.session-error { color:#ffd2be; background:#3c201b; border:1px solid #8d5140; padding:14px 18px; margin:0 0 20px; border-radius:4px; }
.lab-workspace { display:grid; grid-template-columns:minmax(0,1fr) 305px; gap:22px; align-items:start; }
.apparatus { position:relative; min-width:0; padding:23px 25px 25px; overflow:hidden; border:1px solid #566166; border-radius:7px; background:repeating-linear-gradient(117deg,transparent 0 4px,#ffffff02 4px 5px),linear-gradient(145deg,#263036,#141e23 60%); box-shadow:0 24px 65px #0005,inset 0 0 0 5px #10171b,inset 0 0 0 6px #465158; }
.apparatus::before,.apparatus::after { content:'+'; position:absolute; top:7px; color:#788184; font-size:14px; line-height:1; }
.apparatus::before { left:9px; }.apparatus::after { right:9px; }
.apparatus-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:18px; }
.live-label { color:#e1b47c; font-size:10px; text-transform:uppercase; letter-spacing:.09em; }
.live-label i { width:6px; height:6px; display:inline-block; margin-right:6px; background:#e1b47c; border-radius:50%; box-shadow:0 0 10px #e1b47c77; }
.is-solved .live-label { color:var(--green); }.is-solved .live-label i { background:var(--green); }
.diagnostic-screen { background:linear-gradient(155deg,#081519,#0b1b22); border:1px solid #38616a; border-radius:4px; text-align:center; padding:20px 12px 16px; box-shadow:inset 0 0 30px #0008,0 0 18px #65e7ef08; }
.screen-kicker { font-size:11px; color:#a4babd; margin-bottom:7px; }
.diagnostic-screen h2 { font-size:clamp(21px,2.7vw,32px); font-weight:600; color:#d5f8fa; line-height:1.15; letter-spacing:-.03em; }
.target-readout { display:flex; align-items:center; justify-content:center; gap:10px; margin-top:17px; font-size:11px; }
.target-readout>span { color:var(--muted); margin-right:3px; text-transform:uppercase; letter-spacing:.12em; }
.target-readout b { display:flex; align-items:center; gap:14px; min-width:66px; justify-content:center; border:1px solid #2a4650; border-radius:3px; padding:4px 10px; color:#9ab5bd; font-weight:500; }
.target-readout strong { font:600 21px/1.3 ui-monospace,Consolas,monospace; color:var(--cyan); }
.target-readout b.at-target { border-color:#537559; background:#152e24; }.target-readout b.at-target strong { color:var(--green); }
.tank-array { position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; gap:20px; padding:27px 12px 58px; height:335px; }
.pipework { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.pipe-shadow,.pipe-metal,.pipe-flow { fill:none; stroke-linejoin:round; }
.pipe-shadow { stroke:#0a0e0f; stroke-width:21; }.pipe-metal { stroke:#9d835a; stroke-width:13; }
.pipe-flow { stroke:var(--cyan); stroke-width:4; opacity:0; stroke-dasharray:11 8; }
.pipe-flow.active { opacity:1; animation:flow 400ms linear infinite; filter:drop-shadow(0 0 5px #85e8ef); }
.pipe-flow.reverse { animation-direction:reverse; }
@keyframes flow { to { stroke-dashoffset:-38; } }
.tank { z-index:1; display:flex; align-items:center; flex-direction:column; position:relative; }
.tank-label { display:flex; align-items:center; justify-content:space-between; width:min(100%,146px); margin-bottom:9px; gap:5px; }
.tank-label b { font-size:16px; color:var(--paper); }
.tank-label span { font-size:9px; color:#b4c0c0; text-transform:uppercase; letter-spacing:.06em; }
.tank-glass { position:relative; width:min(100%,130px); height:200px; border:5px solid #746751; border-radius:19px 19px 13px 13px; background:linear-gradient(90deg,#9cdae80c,#040e16b8 20%,#040e16ad 70%,#9cdae829); box-shadow:inset 3px 0 0 #deeffe18,inset -3px 0 0 #deeffe18,0 5px 16px #0007; }
.tank-b .tank-glass { height:158px; }.tank-c .tank-glass { height:120px; }
.tank-glass::before,.tank-glass::after { content:''; position:absolute; z-index:3; left:-11px; right:-11px; height:13px; background:linear-gradient(#c3a876,#665539 50%,#b9a173 55%,#57482f); border:1px solid #c5b08c; box-shadow:0 2px 3px #0008; }
.tank-glass::before { top:3px; border-radius:12px 12px 2px 2px; }.tank-glass::after { bottom:3px; border-radius:2px 2px 6px 6px; }
.tank-energy { position:absolute; inset:16px 7px 16px; border-radius:6px; overflow:hidden; }
.energy-fill { position:absolute; left:0; right:0; bottom:0; height:0; background:linear-gradient(90deg,#0b768f,#58e7f1 45%,#159fba 85%); box-shadow:0 0 20px #65eaf5a0; opacity:.6; transition:height 550ms cubic-bezier(.22,.61,.36,1); }
.energy-fill::before { content:''; position:absolute; inset:0; background:repeating-linear-gradient(-20deg,transparent 0 12px,#b2fbff60 13px 14px,transparent 15px 29px); }
.energy-segments { display:flex; position:absolute; inset:0; flex-direction:column-reverse; gap:4px; padding:3px 8px; }
.energy-segments i { flex:1; min-height:0; border:1px solid #b7f3fa20; border-radius:2px; background:#10303938; transition:background 450ms,border-color 450ms; }
.energy-segments i.charged { background:#b8ffff65; border-color:#b8ffffb0; box-shadow:0 0 6px #7ef3fa33; }
.target-line { position:absolute; z-index:2; left:-5px; right:-5px; border-top:1px dashed #ead5a4; bottom:var(--target); opacity:.8; }
.tank-readout { margin-top:10px; background:linear-gradient(150deg,#c0b89a,#d2c7a6); color:#162025; padding:4px 10px; border:3px solid #776246; border-radius:4px; min-width:93px; text-align:center; box-shadow:0 3px 5px #0005; }
.tank-readout strong { font:750 27px/1 ui-monospace,Consolas,monospace; }.tank-readout span { font:600 15px ui-monospace,Consolas,monospace; opacity:.65; }
.tank.at-target .tank-readout { border-color:#739d7b; background:#d3e4cb; }
.machine-rule { display:flex; align-items:center; gap:10px; padding:11px 13px; border:1px solid #81704e; color:#dfd4b7; font-size:12px; background:#191d1d; border-radius:3px; }
.machine-rule>span { font-size:21px; color:var(--gold); }
.valve-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:17px; }
.valve-control { min-width:0; border:1px solid #47504c; border-radius:4px; padding:13px 8px 12px; background:linear-gradient(145deg,#26312f80,#111918); text-align:center; }
.valve-title { color:#c8d2cf; font-size:10px; text-transform:uppercase; letter-spacing:.09em; margin-bottom:10px; }
.valve-directions { display:flex; border:1px solid #52615b; border-radius:3px; overflow:hidden; margin:0 auto 8px; max-width:160px; }
.direction-button { flex:1; padding:7px 2px; border:0; color:#b8c7c3; background:#17201d; font-size:11px; white-space:nowrap; }
.direction-button+button { border-left:1px solid #52615b; }
.direction-button[aria-pressed=true] { background:#38514b; color:#d9ffef; }
.wheel-button { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; border:0; background:none; color:var(--gold); padding:1px 4px 0; width:100%; border-radius:3px; }
.wheel-button svg { display:block; width:75px; height:75px; filter:drop-shadow(0 4px 3px #0008); transition:transform 600ms cubic-bezier(.16,.61,.3,1); }
.wheel-button:not(:disabled):hover svg { filter:drop-shadow(0 0 9px #dbba6e60); }
.wheel-button span { font-size:11px; color:#ded4bc; min-height:18px; }.wheel-button:disabled span { color:var(--muted); }
.result-banner { margin-top:18px; display:flex; align-items:center; gap:15px; border:1px solid #618a67; background:#183326; padding:15px; border-radius:4px; }
.result-banner>span { font-size:28px; color:var(--green); }.result-banner strong { color:var(--green); font-size:18px; }.result-banner p { color:#c0d7c7; font-size:12px; }
.lab-sidebar { display:grid; gap:16px; }
.briefing-card,.history-card,.diagram-card { border:1px solid var(--line); background:linear-gradient(145deg,#1a272b,#101a1e); border-radius:5px; padding:21px; }
.briefing-card h2 { margin:9px 0 14px; font-size:24px; line-height:1.2; font-weight:550; letter-spacing:-.03em; }
.briefing-card>p:not(.eyebrow):not(.capacity-note) { color:#b3c2c5; font-size:13px; }.briefing-card strong { color:#e4eeee; }
.briefing-card ol { margin:17px 0; padding-left:19px; font-size:12px; color:#b4c4c5; }.briefing-card li { padding-left:3px; margin-bottom:8px; }.briefing-card li::marker { color:var(--gold); }
.capacity-note { border-top:1px solid var(--line); padding-top:13px; font-size:11px; color:var(--muted); display:flex; flex-wrap:wrap; gap:9px; }.capacity-note b { color:#d6dfda; white-space:nowrap; }
.history-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }.history-heading h2 { font-size:14px; font-weight:600; }.history-heading>span { border:1px solid #5f6863; border-radius:3px; padding:1px 7px; min-width:29px; text-align:center; font:14px ui-monospace,Consolas,monospace; color:var(--gold); }
.history-summary { font-size:11px; color:var(--muted); margin:9px 0 16px; }
.history-list { list-style:none; padding:0; margin:0; max-height:345px; overflow:auto; scrollbar-width:thin; scrollbar-color:#596e70 #111d21; }
.history-list li { display:grid; grid-template-columns:23px 1fr; gap:9px; padding:11px 0; border-top:1px solid #304046; }.history-list li:first-child { border-color:#69807a; }
.step-number { color:#7c959c; font:11px/1.9 ui-monospace,Consolas,monospace; }.step-title { font-size:13px; color:#d0e6e5; }.step-title small { font-size:10px; color:var(--muted); margin-left:8px; }
.step-state { display:flex; gap:12px; color:#a7bbbf; font:11px ui-monospace,Consolas,monospace; margin-top:5px; }.step-author { display:block; font-size:10px; color:#89a09e; margin-top:6px; }
.retomar-passo { border:0; padding:5px 0 0; font-size:10px; color:#c3b080; background:none; }.retomar-passo:not(:disabled):hover { color:var(--cyan); }
.initial-state { display:flex; flex-wrap:wrap; gap:6px; justify-content:space-between; color:#8da4ab; font-size:10px; padding:13px 0; border-top:1px solid #304046; }.initial-state b { color:#bdcccc; font-weight:500; }
.history-actions { display:flex; gap:8px; margin-top:6px; }.history-actions button { flex:1; border:1px solid #63716b; background:#23332e; color:#d4e2d9; font-size:11px; padding:9px 6px; border-radius:3px; }.history-actions button:last-child { background:none; border-color:#394c4e; color:var(--muted); }.history-actions button:not(:disabled):hover { border-color:var(--cyan); }
.permissions-note { margin-top:10px; font-size:10px; color:var(--muted); }
.diagram-card { padding:12px 16px; }.diagram-card summary { cursor:pointer; font-size:11px; color:#b1c2c2; }.diagram-card img { width:100%; height:auto; display:block; margin-top:12px; border-radius:3px; }
.lab-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:24px 0 30px; font-size:10px; color:#8aa0a5; }.lab-footer>span:first-child { color:#bac8c8; text-transform:uppercase; letter-spacing:.1em; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
dialog { max-width:440px; width:calc(100% - 36px); background:#18252a; border:1px solid #75817a; border-radius:5px; color:var(--paper); padding:27px; box-shadow:0 20px 90px #000b; }dialog::backdrop { background:#04090dce; backdrop-filter:blur(3px); }dialog h2 { font-size:23px; margin:8px 0 12px; }dialog form>p:not(.eyebrow) { color:#afc0c3; font-size:13px; }.dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:25px; }.dialog-actions button { background:#263b39; color:var(--paper); border:1px solid #718781; border-radius:3px; padding:10px 13px; font-size:12px; }.dialog-actions .danger-button { background:#5b2e29; border-color:#ac7561; }
body #estado-conexao { display:none; }
/* O painel mantém controles grandes e três mostradores legíveis no celular. */
@media (max-width:1050px) { .lab-shell{padding:0 20px}.lab-workspace{grid-template-columns:minmax(0,1fr) 270px;gap:16px}.apparatus{padding:22px 18px}.lab-header{gap:18px}.lab-header nav{gap:13px}.lab-header nav a:first-child{display:none}.valve-grid{gap:8px}.briefing-card,.history-card{padding:17px} }
@media (max-width:820px) { .lab-workspace{grid-template-columns:1fr}.lab-sidebar{grid-template-columns:1fr 1fr;align-items:start}.diagram-card{grid-column:1/-1}.lab-header{min-height:110px}.brand{flex-basis:115px}.brand img{width:115px}.lab-header nav{font-size:11px}.lab-sidebar .history-list{max-height:265px} }
@media (max-width:520px) { .lab-shell{padding:0 12px}.lab-header{gap:13px;flex-wrap:wrap;padding:16px 0}.brand{flex-basis:92px}.brand img{width:92px}.header-title .eyebrow{font-size:8px;letter-spacing:.1em}.header-title h1{font-size:20px}.lab-header nav{width:100%;justify-content:flex-end;margin-top:-3px}.session-bar{gap:9px;padding:13px 0 17px}.session-bar label{font-size:10px}.session-bar select{flex:1;max-width:none;min-width:0;font-size:12px}.connection-label{flex-basis:60%;font-size:10px}.text-button{font-size:10px}.apparatus{padding:23px 13px 17px}.apparatus-heading .eyebrow{font-size:8px;letter-spacing:.1em}.live-label{font-size:8px}.diagnostic-screen{padding:17px 6px 14px}.screen-kicker{font-size:10px}.target-readout{gap:6px}.target-readout b{min-width:57px;gap:10px;padding:3px 7px}.tank-array{height:294px;padding:22px 4px 53px;gap:19px}.tank-label{justify-content:center}.tank-label span{display:none}.tank-glass{height:175px;width:84px;max-width:100%;border-width:4px}.tank-b .tank-glass{height:139px}.tank-c .tank-glass{height:107px}.tank-glass::before,.tank-glass::after{left:-7px;right:-7px;height:10px}.tank-energy{inset:14px 3px}.energy-segments{padding:2px 5px;gap:3px}.tank-readout{min-width:71px;padding:4px 5px;border-width:2px}.tank-readout strong{font-size:24px}.tank-readout span{font-size:12px}.machine-rule{font-size:11px;padding:9px}.valve-grid{gap:6px;margin-top:13px}.valve-control{padding:11px 3px}.valve-title{font-size:9px;letter-spacing:.04em}.direction-button{font-size:10px;padding:8px 1px}.wheel-button svg{width:65px;height:65px}.wheel-button span{font-size:10px}.lab-sidebar{grid-template-columns:1fr}.diagram-card{grid-column:auto}.history-list{max-height:300px}.lab-footer{font-size:9px}.briefing-card h2 br{display:none}.briefing-card h2{font-size:22px}.result-banner strong{font-size:17px} }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important} }
