/* =====================================================================
   Elektráreň v3 — riadiaca sála
   =====================================================================
   Tmavý pult z lakovaného plechu, budíky s krémovým ciferníkom, hlásiče
   ako podsvietené dlaždice. Fonty ako v1 (Orbitron / Rajdhani / Share
   Tech Mono), aby appka ostala v rodine.
   ===================================================================== */
:root {
    --bg: #0b0e14;
    --desk: #1a1e25;
    --desk-2: #22272f;
    --plate: #2b313a;
    --line: rgba(255,255,255,0.08);
    --text: #dfe6ee;
    --muted: #8a94a3;
    --cyan: #59d7ff;
    --green: #7dff9a;
    --amber: #ffb648;
    --red: #ff5a52;
    --blue: #63a7ff;
    --face: #e9e4d2;
    --face-ink: #22252a;
    --mono: 'Share Tech Mono', ui-monospace, Consolas, monospace;
    --sans: 'Rajdhani', 'Segoe UI', sans-serif;
    --display: 'Orbitron', var(--sans);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px;
    overflow: hidden; display: flex; flex-direction: column;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

/* ---------------------------------------------------------------- horná lišta */
#top {
    display: flex; align-items: center; gap: 18px; padding: 8px 16px; flex: 0 0 auto;
    background: linear-gradient(#141821, #0e1118); border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: 0.14em; color: var(--cyan); font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; margin-top: 3px; text-transform: uppercase; }
.plants { display: flex; gap: 4px; margin-left: 8px; }
.ptab {
    background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 6px 10px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted);
}
.ptab.active { color: var(--text); border-color: rgba(89,215,255,0.4); background: rgba(89,215,255,0.08); }
.top-right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chips { display: flex; gap: 4px; }
.chip {
    background: var(--desk-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font-size: 12px; font-weight: 600;
    letter-spacing: 0.06em; text-decoration: none; color: var(--text); transition: background .15s, border-color .15s;
}
.chip:hover { background: #2b313b; }
.chip.active { border-color: var(--cyan); color: var(--cyan); background: rgba(89,215,255,0.1); }
.chip.danger:hover { border-color: var(--red); color: var(--red); }
.chip.link { color: var(--muted); }
.chip.auto { border-color: rgba(125,255,154,0.35); }
.chip.auto.active { border-color: var(--green); color: var(--green); background: rgba(125,255,154,0.1); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-intro { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
body.loading #view3d::after { content: 'Načítavam…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--display); letter-spacing: 0.2em; background: rgba(5,7,13,0.6); }
.ptab { font-size: 12px; padding: 5px 8px; }

/* ---------------------------------------------------------------- rozloženie */
main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#view3d { position: relative; flex: 0 0 46%; min-height: 240px; background: #05070d; overflow: hidden; }
#view3d canvas { display: block; width: 100% !important; height: 100% !important; }
#desk {
    flex: 1 1 auto; overflow: auto; padding: 10px 12px 18px;
    background:
        radial-gradient(1200px 300px at 50% 0, rgba(89,215,255,0.06), transparent 60%),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 6px),
        linear-gradient(#1c2129, #14181f);
    border-top: 3px solid #2f3540; box-shadow: inset 0 8px 20px rgba(0,0,0,0.5);
}

/* HUD nad 3D */
.hud { position: absolute; pointer-events: none; font-family: var(--mono); }
.hud-tl { left: 14px; top: 12px; }
.hud-tr { right: 14px; top: 12px; text-align: right; }
.hud-bl { left: 14px; bottom: 12px; pointer-events: auto; }
.hud-status { font-family: var(--display); font-weight: 700; letter-spacing: 0.12em; font-size: 15px; padding: 4px 10px; border-radius: 4px; display: inline-block; margin-bottom: 8px; background: rgba(0,0,0,0.45); border: 1px solid var(--line); }
.hud-status.idle { color: var(--muted); }
.hud-status.warn { color: var(--amber); border-color: rgba(255,182,72,0.4); }
.hud-status.run { color: var(--cyan); border-color: rgba(89,215,255,0.4); }
.hud-status.ok { color: var(--green); border-color: rgba(125,255,154,0.4); }
.hud-status.scram { color: #fff; background: rgba(255,60,50,0.8); border-color: var(--red); animation: blink 0.9s steps(2) infinite; }
.hud-status.melt { color: #fff; background: #7a1010; }
.hud-row { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); text-shadow: 0 1px 2px #000; }
.hud-row b { font-size: 22px; color: #fff; min-width: 70px; text-align: right; font-weight: 400; }
.hud-clock { font-size: 22px; color: #fff; text-shadow: 0 1px 3px #000; }
.hud-hint { color: var(--muted); font-size: 11px; margin-top: 4px; }
#cams .chip { background: rgba(20,24,32,0.75); backdrop-filter: blur(6px); }

/* Koniec bloku. Do 14. 9. to bolo prekrytie cez celý 3D pohľad — lenže
   odvtedy sa za ním odohráva to najzaujímavejšie (výbuch, povodeň), tak je
   z toho panel pri spodnej hrane s priehľadom na scénu. */
#melt { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); display: none; max-width: min(620px, calc(100% - 24px)); text-align: center;
        background: rgba(48,10,8,0.92); border: 1px solid #ff5a52; border-radius: 8px; padding: 10px 18px 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); animation: meltIn .5s ease-out both; }
#melt .melt-note { color: #b9a8a6; font-size: 11.5px; line-height: 1.4; margin-top: 6px; }
#melt .melt-reset { margin-top: 9px; background: #2a1412; border: 1px solid #ff5a52; color: #ffb4ae; padding: 6px 14px; border-radius: 5px; font: inherit; font-size: 12px; cursor: pointer; }
#melt .melt-reset:hover { background: #3d1c19; }
@keyframes meltIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
#melt.show { display: block; }
#melt h2 { font-family: var(--display); color: #ff7a6a; letter-spacing: 0.15em; margin: 0 0 4px; font-size: 17px; }
#melt p { color: #ffd8d0; line-height: 1.5; margin: 0; font-size: 13px; }

/* ---------------------------------------------------------------- pult */
.desk-row1 { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.5fr) minmax(240px, 0.8fr) minmax(220px, 0.7fr); gap: 12px; margin-bottom: 12px; }
.desk-row2 { display: grid; grid-template-columns: repeat(4, minmax(300px, 1fr)); gap: 12px; }
.plate {
    display: inline-block; font-family: var(--display); font-size: 10px; letter-spacing: 0.2em; color: #cfd6e0; padding: 3px 9px;
    background: linear-gradient(#3a414c, #2a2f38); border: 1px solid #454c58; border-radius: 3px; margin-bottom: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 1px 2px #000;
}
.panel {
    background: linear-gradient(#242a33, #1d2229); border: 1px solid #333a45; border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 6px 18px rgba(0,0,0,0.45);
    display: flex; flex-direction: column; min-width: 0;
}
.panel-h { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #333a45; background: linear-gradient(#2b323c, #242a33); border-radius: 8px 8px 0 0; }
.panel-title { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.18em; color: var(--cyan); }
.panel-sub { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.panel-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.cols { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.cols.bottom { border-top: 1px dashed var(--line); padding-top: 10px; }
.grp { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grp.row { flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.grp.stack { align-items: center; }
.grp.reads { display: grid; grid-template-columns: repeat(2, minmax(100px, 1fr)); gap: 6px; flex: 1; }
.grp.prot { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.grp-title { grid-column: 1 / -1; width: 100%; font-size: 10px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.gauges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }

/* ---------------------------------------------------------------- budík */
.gauge { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gauge svg { filter: drop-shadow(0 3px 4px rgba(0,0,0,0.6)); }
.g-bezel { fill: #3a3f47; stroke: #0d0f12; stroke-width: 1.5; }
.g-face { fill: var(--face); stroke: #1a1c20; stroke-width: 1; }
.g-zone { fill: none; stroke-width: 5; opacity: 0.85; }
.g-zone.red { stroke: #d63a2f; } .g-zone.amber { stroke: #e2a12b; } .g-zone.green { stroke: #3ea660; } .g-zone.blue { stroke: #3c7ed6; }
.g-tick { stroke: var(--face-ink); stroke-width: 1.4; } .g-tick.minor { stroke-width: 0.7; opacity: 0.7; }
.g-num { font-family: var(--mono); font-size: 8px; fill: var(--face-ink); }
.g-label { font-family: var(--sans); font-weight: 700; font-size: 7px; letter-spacing: 0.1em; fill: #4a4f57; }
.g-unit { font-family: var(--mono); font-size: 8px; fill: #6a7078; }
.g-needle { fill: #c8281e; filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.4)); transition: none; }
.g-hub { fill: #2a2d33; stroke: #6a6e75; stroke-width: 1; }
.g-digital { font-family: var(--mono); font-size: 12px; color: var(--green); background: #0b120e; border: 1px solid #23342a; border-radius: 3px; padding: 1px 6px; min-width: 76px; text-align: center; box-shadow: inset 0 0 8px rgba(125,255,154,0.15); }
.gauge.over .g-digital { color: var(--red); border-color: #5a2320; }

/* ---------------------------------------------------------------- gombík */
.knob { display: flex; flex-direction: column; align-items: center; gap: 2px; user-select: none; touch-action: none; }
.knob.disabled { opacity: 0.4; pointer-events: none; }
.k-scale { fill: none; stroke: #4a5160; stroke-width: 3; }
.k-fill { fill: none; stroke: var(--cyan); stroke-width: 3; }
.k-tick { stroke: #7a8494; stroke-width: 1; }
.k-body { fill: url(#kb); fill: #2a2f37; stroke: #0e1013; stroke-width: 1.5; }
.k-cap { fill: #3b414b; stroke: #555c68; stroke-width: 1; }
.k-ptr { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.k-grip { fill: transparent; cursor: ns-resize; }
.knob.active .k-cap { fill: #465062; }
.knob.big .k-cap { fill: #4b3b2a; stroke: #7a5c3a; }
.k-label { font-size: 10px; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; }
.k-read { font-family: var(--mono); font-size: 12px; color: var(--cyan); }

/* ---------------------------------------------------------------- páka */
.lever { display: flex; flex-direction: column; align-items: center; gap: 2px; user-select: none; touch-action: none; }
.lever.disabled .l-handle { opacity: 0.45; pointer-events: none; }
.l-slot { fill: #0e1116; stroke: #3a414c; }
.l-tick { stroke: #7a8494; stroke-width: 1; }
.l-num { font-family: var(--mono); font-size: 8px; fill: var(--muted); }
.l-actual { fill: var(--green); }
.l-handle rect { fill: #c94b3f; stroke: #5a1f1a; stroke-width: 1; cursor: ns-resize; }
.l-handle line { stroke: rgba(255,255,255,0.5); stroke-width: 1; pointer-events: none; }
.lever.active .l-handle rect { fill: #e35b4e; }
.l-label { font-size: 10px; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }
.l-read { font-family: var(--mono); font-size: 12px; color: var(--green); }
.l-read b { color: #fff; font-weight: 400; }

/* ---------------------------------------------------------------- prepínač */
.sw { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 78px; }
.sw.disabled { opacity: 0.4; pointer-events: none; }
.sw-lamp { width: 10px; height: 10px; border-radius: 50%; background: #2a2f37; border: 1px solid #0b0d10; box-shadow: inset 0 1px 2px rgba(0,0,0,0.8); }
.sw-lamp.run { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sw-lamp.start { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: blink 0.6s steps(2) infinite; }
.sw-paddle {
    width: 34px; height: 46px; border-radius: 6px; border: 1px solid #0b0d10; position: relative; padding: 0;
    background: linear-gradient(#20242b, #14171c); box-shadow: inset 0 0 0 1px #3a414c, 0 2px 4px #000;
}
.sw-paddle::after {
    content: ''; position: absolute; left: 4px; right: 4px; height: 20px; border-radius: 4px; top: 22px;
    background: linear-gradient(#6a7280, #3c434e); box-shadow: 0 2px 3px #000, inset 0 1px 0 rgba(255,255,255,0.3); transition: top .12s;
}
.sw.on .sw-paddle::after { top: 4px; background: linear-gradient(#8de1ff, #3b93b8); }
.sw-on, .sw-off { font-size: 8px; letter-spacing: 0.12em; color: #5a6270; font-weight: 700; line-height: 1; }
.sw.on .sw-on { color: #fff; text-shadow: 0 0 6px rgba(141,225,255,0.8); } .sw:not(.on) .sw-off { color: #fff; }
.sw-label { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-align: center; font-weight: 600; line-height: 1.2; }

/* ---------------------------------------------------------------- tlačidlo */
.pb {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 84px; padding: 7px 10px;
    border-radius: 6px; border: 1px solid #0b0d10; background: linear-gradient(#3b424d, #2a3038);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 3px 0 #15181d, 0 4px 6px rgba(0,0,0,0.6); user-select: none; touch-action: none;
    transition: transform .05s, box-shadow .05s;
}
.pb:active, .pb.down { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 #15181d, 0 1px 2px rgba(0,0,0,0.6); background: linear-gradient(#2f353e, #262b33); }
.pb.down .pb-cap { color: var(--cyan); }
.pb.lit { background: linear-gradient(#3ea660, #2b7a45); }
.pb-cap { font-weight: 700; letter-spacing: 0.12em; font-size: 11px; }
.pb-sub { font-size: 9px; color: var(--muted); letter-spacing: 0.08em; }
.pb.ack { min-width: 120px; background: linear-gradient(#5b5f3b, #3f4229); }

/* SCRAM pod krytom */
.covered { position: relative; width: 96px; height: 96px; }
.covered-btn {
    position: absolute; inset: 8px; border-radius: 50%; border: 3px solid #5a1a14; background: radial-gradient(circle at 40% 35%, #ff6b5e, #b6251b 65%, #7c150e);
    color: #fff; font-family: var(--display); font-weight: 700; letter-spacing: 0.12em; font-size: 13px; box-shadow: 0 6px 0 #4a120d, 0 8px 12px rgba(0,0,0,0.7);
    transition: transform .08s, box-shadow .08s;
}
.covered-btn.pressed { transform: translateY(5px); box-shadow: 0 1px 0 #4a120d, 0 2px 4px rgba(0,0,0,0.7); }
.covered-lid {
    position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(rgba(240,220,60,0.85), rgba(200,170,30,0.85));
    border: 2px solid #6a5a10; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; cursor: pointer;
    color: #3a3000; font-size: 10px; font-weight: 700; letter-spacing: 0.15em; transform-origin: top; transition: transform .25s ease;
    background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0,0,0,0.12) 8px 16px);
}
.covered.open .covered-lid { transform: rotateX(78deg) translateY(-4px); pointer-events: none; opacity: 0.7; }

/* ---------------------------------------------------------------- kontrolka */
.lamp { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 72px; }
.lamp-dot { width: 18px; height: 18px; border-radius: 50%; background: #23272e; border: 2px solid #0b0d10; box-shadow: inset 0 2px 4px rgba(0,0,0,0.8); }
.lamp.green.on .lamp-dot, .lamp.green.blink .lamp-dot { background: var(--green); box-shadow: 0 0 12px var(--green), inset 0 -2px 4px rgba(0,0,0,0.3); }
.lamp.red.on .lamp-dot, .lamp.red.blink .lamp-dot { background: var(--red); box-shadow: 0 0 12px var(--red), inset 0 -2px 4px rgba(0,0,0,0.3); }
.lamp.amber.on .lamp-dot, .lamp.amber.blink .lamp-dot { background: var(--amber); box-shadow: 0 0 12px var(--amber), inset 0 -2px 4px rgba(0,0,0,0.3); }
.lamp.blink .lamp-dot { animation: blink 0.7s steps(2) infinite; }
.lamp-label { font-size: 9px; letter-spacing: 0.1em; color: var(--muted); text-align: center; font-weight: 600; line-height: 1.2; }

/* ---------------------------------------------------------------- displej */
.readout { background: #0b0f0c; border: 1px solid #23342a; border-radius: 4px; padding: 4px 8px; min-width: 100px; box-shadow: inset 0 0 10px rgba(125,255,154,0.08); }
.readout.wide { grid-column: span 1; }
.ro-label { font-size: 9px; letter-spacing: 0.14em; color: #6f8a77; font-weight: 600; }
.ro-value { font-family: var(--mono); font-size: 17px; color: var(--green); line-height: 1.1; white-space: nowrap; }
.ro-unit { font-size: 10px; color: #6f8a77; }
.readout.warn .ro-value { color: var(--amber); }

/* ---------------------------------------------------------------- hlásiče */
.annun-wrap, .chart-wrap, .log-wrap, .mimic-wrap { min-width: 0; }
.mimic { display: block; width: 100%; aspect-ratio: 640 / 260; max-height: 300px; background: #0b0f14; border: 1px solid #333a45; border-radius: 6px; box-shadow: inset 0 0 30px rgba(0,0,0,0.6); }
.annun { background: #14171d; border: 1px solid #333a45; border-radius: 6px; padding: 8px; }
.annun-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.annun-tile {
    height: 40px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px 4px;
    font-size: 9px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.15; border-radius: 3px;
    color: #4a515c; background: linear-gradient(#20242b, #191c22); border: 1px solid #0b0d10; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    transition: background .1s, color .1s;
}
.annun-tile.blank { visibility: hidden; }
.annun-tile.on.red { background: linear-gradient(#ff6a60, #d8332a); color: #fff; box-shadow: 0 0 14px rgba(255,90,82,0.5); }
.annun-tile.on.amber { background: linear-gradient(#ffc76a, #e39a22); color: #2a1a00; box-shadow: 0 0 14px rgba(255,182,72,0.5); }
.annun-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.annun-horn { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.annun-horn.on { color: var(--red); animation: blink 0.45s steps(2) infinite; }

/* ---------------------------------------------------------------- zapisovač, denník */
.strip { background: #0c1410; border: 1px solid #23342a; border-radius: 6px; padding: 6px; height: 158px; display: flex; flex-direction: column; gap: 4px; }
.strip canvas { flex: 1; width: 100%; min-height: 0; display: block; }
.strip-legend { display: flex; gap: 10px; font-family: var(--mono); font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.strip-legend i { display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: middle; }
.log { background: #0e1116; border: 1px solid #333a45; border-radius: 6px; padding: 6px 8px; height: 158px; overflow: auto; font-family: var(--mono); font-size: 11px; line-height: 1.45; }
.ev span { color: var(--muted); margin-right: 8px; }
.ev.alarm { color: var(--amber); } .ev.scram { color: var(--red); font-weight: 700; } .ev.ok { color: var(--green); } .ev.info { color: #b9c3cf; }

/* ---------------------------------------------------------------- pomocník, toast */
#help {
    position: fixed; top: 52px; right: 12px; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 70px); overflow: auto; z-index: 20;
    background: rgba(20,24,32,0.96); border: 1px solid #3a4250; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,0.7); backdrop-filter: blur(10px);
    transform: translateX(110%); transition: transform .3s ease; padding: 12px 14px 14px;
}
#help.open { transform: none; }
#help header { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); letter-spacing: 0.14em; font-size: 12px; color: var(--cyan); margin-bottom: 8px; }
#help header button { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); }
#steps { margin: 0; padding-left: 22px; line-height: 1.45; }
#steps li { margin: 5px 0; color: var(--text); }
#steps li.done { color: var(--green); text-decoration: line-through; text-decoration-color: rgba(125,255,154,0.5); }
#steps li.done::marker { color: var(--green); }
.help-notes { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 13px; line-height: 1.45; color: #c9d2dd; }
.help-notes p { margin: 6px 0; }
.help-notes .muted { color: var(--muted); font-size: 12px; }
/* Lišta pohľadov: vnútro budovy a ukážka konca sa odlíšia farbou, aby sa
   nezmiešali s obyčajnými pohľadmi na areál. */
#cams .chip.inside.active, #cams .chip.inside:hover { border-color: #63c8ff; color: #9bdcff; }
#cams .chip.demo { border-color: rgba(255,90,82,0.45); color: #ff9a92; }
#cams .chip.demo:hover, #cams .chip.demo.active { border-color: #ff5a52; color: #ffc0bb; background: rgba(60,18,16,0.5); }

#toast {
    position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; z-index: 30; pointer-events: none;
    background: rgba(30,34,44,0.95); border: 1px solid var(--amber); color: var(--amber); padding: 8px 14px; border-radius: 6px; font-weight: 600; letter-spacing: 0.04em;
    transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

body.horn #desk { animation: hornGlow 0.9s ease-in-out infinite; }
@keyframes hornGlow { 0%, 100% { box-shadow: inset 0 8px 20px rgba(0,0,0,0.5); } 50% { box-shadow: inset 0 8px 20px rgba(0,0,0,0.5), inset 0 0 0 3px rgba(255,90,82,0.35); } }
@keyframes blink { to { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
    .hud-status.scram, .lamp.blink .lamp-dot, .annun-horn.on, .sw-lamp.start, body.horn #desk { animation: none; }
}

/* ---------------------------------------------------------------- responzívne */
@media (max-width: 1500px) { .desk-row2 { grid-template-columns: repeat(2, minmax(300px, 1fr)); } }
@media (max-width: 1500px) { .desk-row1 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .desk-row1 { grid-template-columns: 1fr 1fr; } .mimic-wrap { grid-column: 1 / -1; } }
@media (max-width: 760px) {
    body { overflow: auto; }
    #top { flex-wrap: wrap; gap: 8px; }
    .plants { display: none; }
    .top-right { margin-left: 0; }
    main { display: block; }
    #view3d { height: 46vh; }
    #desk { overflow: visible; }
    .desk-row1, .desk-row2 { grid-template-columns: 1fr; }
    .annun-grid { grid-template-columns: repeat(3, 1fr); }
    .hud-hint { display: none; }
}

/* ---------------------------------------------------------------- zásuvky: nastavenia, hra */
.drawer {
    position: fixed; top: 52px; right: 12px; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 70px); overflow: auto; z-index: 20;
    background: rgba(20,24,32,0.97); border: 1px solid #3a4250; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,0.7); backdrop-filter: blur(10px);
    transform: translateX(110%); transition: transform .3s ease; padding: 12px 14px 14px;
}
.drawer.open { transform: none; }
.drawer > header { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); letter-spacing: 0.14em; font-size: 12px; color: var(--cyan); margin-bottom: 8px; }
.drawer > header button { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); }
.set-group { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.set-group h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; cursor: pointer; }
.set-row.set-sub { padding-left: 14px; border-left: 2px solid var(--line); }
.set-row.disabled { opacity: 0.4; pointer-events: none; }
.set-left { display: flex; flex-direction: column; gap: 2px; }
.set-label { font-weight: 600; }
.set-hint { color: var(--muted); font-size: 12px; line-height: 1.3; }
.set-check { width: 20px; height: 20px; accent-color: var(--cyan); flex: 0 0 auto; }
.set-select { background: var(--desk-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-family: inherit; font-weight: 600; }
.set-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.set-note { color: var(--muted); font-size: 12px; }
.chip.fault { border-color: rgba(255,182,72,0.4); }
.chip.fault.active { border-color: var(--amber); color: var(--amber); background: rgba(255,182,72,0.12); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fault-wrap { position: relative; }
.fault-menu { position: absolute; top: 34px; right: 0; width: 320px; display: none; flex-direction: column; gap: 4px; padding: 8px; z-index: 30; background: rgba(20,24,32,0.98); border: 1px solid #3a4250; border-radius: 8px; box-shadow: 0 16px 40px rgba(0,0,0,0.7); }
.fault-menu.open { display: flex; }
.fault-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--desk-2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-family: inherit; color: var(--text); }
.fault-item:hover { border-color: var(--amber); }
.fault-item b { font-size: 13px; } .fault-item span { color: var(--muted); font-size: 11px; }
.fault-item.muted { color: var(--muted); }
.game-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.game-sec h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.missions { margin: 0; padding-left: 20px; line-height: 1.45; }
.missions li.done { color: var(--green); }
.missions li.fail { color: var(--red); text-decoration: line-through; }
.score-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-family: var(--mono); }
.score-row b { font-size: 22px; color: var(--green); }
.score-det { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.board { margin-top: 8px; font-family: var(--mono); font-size: 12px; }
.board-h { color: var(--muted); letter-spacing: 0.1em; font-size: 10px; margin-bottom: 4px; }
.board-r { display: grid; grid-template-columns: 24px 60px 1fr; gap: 6px; padding: 2px 0; } .board-r b { color: var(--green); }
.eco div { display: flex; justify-content: space-between; padding: 3px 0; font-family: var(--mono); font-size: 13px; }
.eco div span { color: var(--muted); font-family: var(--sans); } .eco .tot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.eco b.pos { color: var(--green); } .eco b.neg, .disp-top .neg b { color: var(--red); }
.disp-top { display: flex; gap: 12px; font-family: var(--mono); font-size: 12px; margin-bottom: 8px; flex-wrap: wrap; } .disp-top span { color: var(--muted); } .disp-top b { color: var(--text); }
.disp-row { display: grid; grid-template-columns: 1fr 100px 64px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.disp-row i { display: block; height: 8px; background: var(--green); border-radius: 2px; }
.disp-row.me i { background: var(--cyan); } .disp-row.me span { color: var(--cyan); font-weight: 700; }
.disp-row.out span { color: var(--red); } .disp-row.out i { background: var(--red); }
.disp-row b { font-family: var(--mono); font-weight: 400; text-align: right; }
.hud-eco { font-family: var(--mono); font-size: 13px; color: var(--amber); margin-top: 4px; text-shadow: 0 1px 2px #000; }
.walk-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: none; background: rgba(0,0,0,0.5); color: var(--text); padding: 4px 10px; border-radius: 6px; font-family: var(--mono); font-size: 12px; pointer-events: none; }
.walk-hint.show { display: block; }
.chip.walk.active { border-color: var(--amber); color: var(--amber); }
.muted { color: var(--muted); }
.hud-fps { color: var(--muted); font-size: 11px; margin-top: 4px; font-family: var(--mono); }
.apk-link { color: var(--cyan); font-weight: 600; }
