
@font-face { font-family: "Outfit"; src: url("/fonty/Outfit.ttf") format("truetype"); }
@font-face { font-family: "VT323"; src: url("/fonty/VT323-Regular.ttf") format("truetype"); }
@font-face { font-family: "Mr Dafoe"; src: url("/fonty/MrDafoe-Regular.ttf") format("truetype"); }
:root {
  --bg: #0b0918; --panel1: #1c1834; --panel2: #141127; --line: #2a2540; --screw: #3a3456;
  --text: #fff5fb; --muted: #8d84b5; --dim: #5b5480;
  --pink: #ff2e88; --cyan: #3de8ff; --violet: #a970ff; --amber: #ffc43d; --green: #3dff8a; --red: #ff3d6e; --gold: #ffd76a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: radial-gradient(1200px 700px at 50% 45%, #171330, var(--bg)); color: var(--text);
  font-family: "Outfit", system-ui, sans-serif; overflow: auto; }
html { height: auto; overflow: auto; background: #0b0918; }
body { height: auto; min-height: 100vh; overflow: visible; background-attachment: fixed; }
#stage { position: relative; margin: 0 auto; }
#board { position: absolute; left: 0; top: 0; width: 1680px; height: 1020px; transform-origin: 0 0; }
.lcd { font-family: "VT323", monospace; }

/* ---------- wires ---------- */
#wires { position: absolute; inset: 0; width: 1680px; height: 1020px; pointer-events: none; }
.wire { fill: none; stroke: var(--line); stroke-width: 2; }
.wire-glow { fill: none; stroke-width: 6; opacity: .07; }
.wire.err { stroke: var(--red); animation: errblink .35s steps(2) 6; }
@keyframes errblink { 50% { stroke: var(--line); } }

/* ---------- panels ---------- */
.mod { position: absolute; background: linear-gradient(180deg, var(--panel1), var(--panel2)); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 10px 14px 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -10px 22px rgba(0,0,0,.28), 0 10px 30px rgba(0,0,0,.35);
  cursor: pointer; transition: border-color .25s, box-shadow .25s; }
.mod::before, .mod::after { content: ""; position: absolute; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--screw);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6); }
.mod::before { left: 7px; } .mod::after { right: 7px; }
.mod:hover { border-color: rgba(255,46,136,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px rgba(255,46,136,.25), 0 0 26px rgba(255,46,136,.18); }
.mod.flash { border-color: var(--fc, var(--pink)); box-shadow: 0 0 22px var(--fc, var(--pink)); }
.hd { display: flex; align-items: center; gap: 8px; margin: 0 4px 6px; }
.hd .nm { font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.hd .sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd .st { white-space: nowrap; margin-left: auto; font-size: 10px; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }
.badge { font-size: 10px; font-weight: 800; border-radius: 5px; padding: 2px 6px; letter-spacing: .06em; color: #0b0918; }
.led { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.led.g { background: var(--green); box-shadow: 0 0 6px var(--green), 0 0 12px rgba(61,255,138,.6); }
.led.a { background: var(--amber); box-shadow: 0 0 6px var(--amber), 0 0 12px rgba(255,196,61,.6); }
.led.r { background: var(--red); box-shadow: 0 0 6px var(--red), 0 0 12px rgba(255,61,110,.7); animation: ledblink 1s steps(2) infinite; }
.led.off { background: var(--screw); }
@keyframes ledblink { 50% { opacity: .25; } }
.c-g { color: var(--green); } .c-a { color: var(--amber); } .c-r { color: var(--red); } .c-m { color: var(--muted); } .c-p { color: var(--pink); } .c-c { color: var(--cyan); }

.gz svg { flex: none; }
.gz { display: flex; align-items: flex-end; justify-content: space-around; gap: 6px; height: 118px; }
.ro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; margin-top: 6px; padding: 6px 6px 0; border-top: 1px solid rgba(255,255,255,.06); }
.ro div { min-width: 0; }
.ro b { display: block; font-family: "VT323", monospace; font-weight: 400; font-size: 20px; line-height: 1; white-space: nowrap; }
.ro span { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro i { font-style: normal; font-size: 12px; margin-left: 3px; }

/* ---------- app panels ---------- */
.app .left { position: absolute; left: 14px; top: 42px; width: 220px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.big { display: flex; align-items: baseline; gap: 10px; }
.big b { font-family: "VT323", monospace; font-weight: 400; font-size: 54px; line-height: .8; }
.big span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.mini b { display: block; font-family: "VT323", monospace; font-weight: 400; font-size: 20px; line-height: 1; }
.mini span { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.srcs { display: flex; flex-direction: column; gap: 3px; }
.srcs div { display: grid; grid-template-columns: 62px 1fr 30px; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.srcs i { height: 5px; border-radius: 3px; background: #0b0918; position: relative; overflow: hidden; }
.srcs i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--col, var(--cyan)); box-shadow: 0 0 6px var(--col, var(--cyan)); }
.srcs em { font-style: normal; font-family: "VT323", monospace; font-size: 15px; color: var(--text); text-align: right; }
.field { position: absolute; left: 250px; top: 40px; width: 334px; height: 212px; border-radius: 10px; background:
  radial-gradient(circle at 50% 50%, rgba(255,255,255,.03), transparent 70%), repeating-linear-gradient(0deg, transparent 0 22px, rgba(255,255,255,.025) 22px 23px),
  repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.025) 22px 23px), #0b0918;
  border: 1px solid rgba(255,255,255,.06); box-shadow: inset 0 0 30px rgba(0,0,0,.6); overflow: hidden; }
.field .cap { position: absolute; left: 10px; bottom: 6px; font-size: 9.5px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.dot { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); transition: opacity .5s, transform .5s; cursor: pointer; animation: drift var(--d, 7s) ease-in-out infinite alternate; }
.dot.anon { width: 11px; height: 11px; background: #9fe9f5; box-shadow: 0 0 8px var(--cyan); }
.dot.user { width: 24px; height: 24px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; color: #fff; background: #2b1530;
  border: 2px solid var(--pc); box-shadow: 0 0 10px var(--pc); }
.dot.in { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
.dot.out { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
.dot:hover { z-index: 5; outline: 2px solid #fff; outline-offset: 2px; }
@keyframes drift { from { margin: 0 0 0 0; } to { margin: var(--dy, 6px) 0 0 var(--dx, 8px); } }

.auth { text-align: center; }
.auth .row { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
.auth .row div b { display: block; font-family: "VT323", monospace; font-weight: 400; font-size: 24px; line-height: 1; }
.auth .row div span { font-size: 9.5px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- header ---------- */
#hdr { position: absolute; left: 40px; right: 40px; top: 14px; height: 62px; display: flex; align-items: center; gap: 18px; }
.logo { font-family: "Mr Dafoe", cursive; font-size: 44px; color: #ffd0e5; line-height: 1; transform: rotate(-4deg); white-space: nowrap;
  text-shadow: 0 0 4px #ff5ca5, 0 0 12px var(--pink), 0 0 26px var(--pink); padding-right: 6px; }
.mock { font-size: 10px; font-weight: 800; letter-spacing: .16em; color: var(--amber); border: 1px dashed var(--amber); border-radius: 6px; padding: 3px 7px; }
.lcdbox { background: #070612; border: 1px solid rgba(255,255,255,.07); border-radius: 8px; padding: 4px 12px; box-shadow: inset 0 0 14px rgba(0,0,0,.8);
  display: flex; gap: 16px; align-items: center; cursor: pointer; }
.lcdbox div span { display: block; font-size: 9px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.lcdbox div b { font-family: "VT323", monospace; font-weight: 400; font-size: 24px; line-height: 1; color: var(--green); text-shadow: 0 0 8px rgba(61,255,138,.5); }
#ann { margin-left: auto; display: grid; grid-template-columns: repeat(6, 102px); gap: 4px; }
.an { height: 25px; border-radius: 4px; background: #100d20; border: 1px solid #2a2540; font-size: 9.5px; font-weight: 800; letter-spacing: .08em;
  display: flex; align-items: center; justify-content: center; text-transform: uppercase; color: var(--dim); cursor: pointer; text-align: center; line-height: 1; }
.an.g { color: var(--green); border-color: rgba(61,255,138,.35); text-shadow: 0 0 6px rgba(61,255,138,.6); }
.an.a { color: #1a1200; background: var(--amber); border-color: var(--amber); box-shadow: 0 0 10px rgba(255,196,61,.5); }
.an.r { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 0 12px rgba(255,61,110,.7); animation: ledblink 1s steps(2) infinite; }
#master { width: 74px; height: 54px; border-radius: 8px; border: 2px solid #3a2a00; background: #2a1d00; color: #6b5200; font-weight: 900; font-size: 11px;
  letter-spacing: .1em; line-height: 1.1; cursor: pointer; font-family: inherit; }
#master.on { background: var(--amber); color: #1a1200; box-shadow: 0 0 18px var(--amber); animation: ledblink 1.2s steps(2) infinite; }

/* ---------- log ---------- */
#log { position: absolute; left: 40px; right: 40px; top: 980px; height: 36px; border-radius: 10px; background: #070612; border: 1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 0 14px rgba(0,0,0,.8); display: flex; align-items: center; gap: 22px; padding: 0 14px; overflow: hidden; white-space: nowrap; }
#log .t { font-size: 10px; letter-spacing: .16em; color: var(--muted); font-weight: 800; }
#log .e { font-family: "VT323", monospace; font-size: 19px; transition: opacity .4s; }
#log .e:nth-child(n+4) { opacity: .6; } #log .e:nth-child(n+6) { opacity: .35; }
#log .e small { color: var(--dim); font-size: 16px; margin-right: 6px; }

/* ---------- popover + modal (own, no native) ---------- */
#pop { position: absolute; z-index: 30; min-width: 220px; background: #1c1834; border: 1px solid rgba(255,46,136,.5); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 0 20px rgba(255,46,136,.3), 0 12px 30px rgba(0,0,0,.6); font-size: 12px; display: none; }
#pop b { font-size: 13px; } #pop .k { color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
#pop table { border-collapse: collapse; margin-top: 6px; width: 100%; } #pop td { padding: 2px 0; } #pop td:last-child { text-align: right; font-family: "VT323", monospace; font-size: 16px; }
#scrim { position: fixed; inset: 0; background: rgba(5,4,12,.72); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 50; }
#scrim.on { display: grid; }
#dlg { width: 720px; max-height: 92vh; overflow: auto; background: linear-gradient(180deg, var(--panel1), var(--panel2)); border: 1px solid rgba(255,46,136,.35);
  border-radius: 16px; padding: 18px 22px 18px; box-shadow: 0 0 40px rgba(255,46,136,.2), 0 30px 80px rgba(0,0,0,.7); }
#dlg .top { display: flex; align-items: center; gap: 10px; }
#dlg h2 { margin: 0; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; }
#dlg .sub { color: var(--muted); font-size: 12px; }
.x { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; border: 1px solid #3a3456; background: #0b0918; cursor: pointer; position: relative; }
.x::before, .x::after { content: ""; position: absolute; left: 8px; right: 8px; top: 15px; height: 2px; background: var(--pink); box-shadow: 0 0 6px var(--pink); border-radius: 2px; }
.x::before { transform: rotate(45deg); } .x::after { transform: rotate(-45deg); }
.seg { display: flex; background: #0b0918; border-radius: 8px; padding: 3px; gap: 2px; width: max-content; }
.seg span { padding: 4px 12px; border-radius: 6px; font-size: 12px; color: var(--muted); font-weight: 700; cursor: pointer; }
.seg span.on { background: var(--pink); color: #fff; box-shadow: 0 0 8px rgba(255,46,136,.6); }
.chartbox { margin-top: 12px; background: #070612; border-radius: 12px; border: 1px solid rgba(255,255,255,.06); padding: 10px 12px 6px; }
.chartbox .row { display: flex; align-items: center; gap: 10px; }
.chartbox .row .k { font-size: 10px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.mt { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; margin-top: 14px; }
.mt div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.mt span { font-size: 12px; color: var(--muted); } .mt b { font-family: "VT323", monospace; font-weight: 400; font-size: 20px; }
.mt i { grid-column: 1 / 3; height: 4px; border-radius: 2px; background: #0b0918; position: relative; overflow: hidden; }
.mt i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--col); box-shadow: 0 0 6px var(--col); }
.al { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.al div { display: flex; gap: 10px; align-items: center; font-size: 13px; background: #0b0918; border-radius: 8px; padding: 7px 10px; }
.al small { margin-left: auto; color: var(--dim); font-family: "VT323", monospace; font-size: 16px; }
.h3 { margin: 16px 0 0; font-size: 10px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; font-weight: 800; }
.btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.btn { border: 1px solid #3a3456; background: #0b0918; color: var(--text); border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn.p { background: var(--pink); border-color: var(--pink); box-shadow: 0 0 12px rgba(255,46,136,.5); }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
