/* AMOURANTHRTX Datacenter · dark neon RGB · no plastic chrome · raised SDF */
:root {
  --bg: #050607;
  --bg2: #0a0c0b;
  --ink: #e8e4df;
  --mute: #8a9188;
  --line: #1e2822;
  --neon-r: #ff2a6d;
  --neon-g: #05f2a0;
  --neon-b: #2de2e6;
  --neon-y: #f9f871;
  --shell: #c8d4cc;
  --danger: #ff4d6d;
  --ok: #05f2a0;
  --font: "Segoe UI", system-ui, ui-sans-serif, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  --stripe: repeating-linear-gradient(
    90deg,
    var(--neon-r) 0 3px,
    var(--neon-g) 3px 6px,
    var(--neon-b) 6px 9px,
    transparent 9px 18px
  );
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
}

/* no OS window chrome simulation · full bleed app */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: 6px 42px 1fr 22px;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(5,242,160,.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(255,42,109,.1), transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(45,226,230,.08), transparent 40%),
    var(--bg2);
}

/* RGB neon stripe · top edge only · not a titlebar */
.neon-stripe {
  background: var(--stripe);
  box-shadow: 0 0 12px rgba(5,242,160,.35), 0 0 20px rgba(255,42,109,.2);
  z-index: 5;
}

/* raised SDF mast · NOT plastic titlebar · no drop shadow blob */
.mast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #121816 0%, #0c100e 100%);
  /* raised SDF shell feel · hard edges */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.mast::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 48px; height: 1px;
  pointer-events: none;
}

.brand {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.brand b {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--shell);
}
.brand span {
  font-size: 10px; color: var(--mute); letter-spacing: .08em;
  font-family: var(--mono);
}

.atoms {
  display: flex; gap: 6px; margin-left: 8px;
}
.atom {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: #0e1210;
  color: var(--mute);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.atom[data-on="1"] {
  color: var(--bg);
  background: var(--neon-g);
  border-color: var(--neon-g);
  box-shadow: 0 0 10px rgba(5,242,160,.45);
}
.atom.wan[data-on="1"] {
  background: var(--neon-b);
  border-color: var(--neon-b);
  box-shadow: 0 0 10px rgba(45,226,230,.4);
  color: #041018;
}
/* BGF · measure · apart from SDF */
.atom.bgf[data-on="1"] {
  background: var(--neon-y);
  border-color: var(--neon-y);
  box-shadow: 0 0 10px rgba(249,248,113,.4);
  color: #141208;
}
.atom.bgf:hover { border-color: var(--neon-y); color: var(--neon-y); }
/* SDF · place/shell · apart from BGF */
.atom.sdf[data-on="1"] {
  background: #c4788a;
  border-color: #c4788a;
  box-shadow: 0 0 10px rgba(196,120,138,.45);
  color: #0a0608;
}
.atom.sdf:hover { border-color: #e8a0b0; color: #e8a0b0; }
.atom[data-on="0"] {
  opacity: 0.45;
  filter: grayscale(0.35);
}
.field-atoms {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.atom:hover { border-color: var(--neon-g); color: var(--neon-g); }
.widget#wid-bgf .wv { color: var(--neon-y); }
.widget#wid-sdf .wv { color: #e8a0b0; }
.widget.off {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.mast-actions {
  margin-left: auto;
  display: flex; gap: 8px; align-items: center;
}
.pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.pill:hover {
  border-color: var(--neon-r);
  color: var(--neon-r);
  box-shadow: 0 0 8px rgba(255,42,109,.35);
}
.pill.ok:hover {
  border-color: var(--neon-g);
  color: var(--neon-g);
  box-shadow: 0 0 8px rgba(5,242,160,.35);
}

/* body grid */
.stage {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  min-height: 0;
  gap: 0;
}

/* raised SDF panels · hard shell · no soft shadow plastic */
.panel {
  position: relative;
  border-right: 1px solid var(--line);
  background: #0b0f0d;
  min-height: 0;
  overflow: auto;
  /* SDF raised rim */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 -1px 0 rgba(0,0,0,.5);
}
.panel:last-child { border-right: 0; border-left: 1px solid var(--line); }
.panel-h {
  position: sticky; top: 0; z-index: 2;
  padding: 10px 12px;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--neon-b);
  background: linear-gradient(180deg, #101614, #0b0f0d);
  border-bottom: 1px solid var(--line);
  /* cheby-ish corner cuts = raised SDF, not rounded plastic */
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.panel-h .dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 8px;
  background: var(--neon-g);
  box-shadow: 0 0 6px var(--neon-g);
  vertical-align: middle;
}

/* sockets + plugs */
.socket {
  margin: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #0a0e0c;
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.socket.live {
  border-color: rgba(5,242,160,.5);
  box-shadow: inset 0 0 0 1px rgba(5,242,160,.15);
}
.socket .sid {
  font-family: var(--mono); font-size: 10px; color: var(--neon-y);
  letter-spacing: .06em;
}
.socket .skind {
  font-size: 10px; color: var(--mute); margin-top: 2px;
}
.plug {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed #2a3830;
  background: #080b0a;
  cursor: grab;
  font-size: 12px;
}
.plug:active { cursor: grabbing; }
.plug .pname { color: var(--ink); font-weight: 600; }
.plug .pmeta {
  font-family: var(--mono); font-size: 10px; color: var(--mute); margin-top: 3px;
}
.plug.seated {
  border-style: solid;
  border-color: var(--neon-g);
  box-shadow: 0 0 12px rgba(5,242,160,.2);
}
.plug .hot {
  float: right;
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--neon-r);
  text-transform: uppercase;
}

/* center viewport */
.viewport {
  position: relative;
  min-height: 0;
  background: #000;
  display: grid;
  grid-template-rows: 1fr auto;
}
#gl {
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  cursor: crosshair;
}
.hud {
  position: absolute;
  left: 10px; top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  color: var(--neon-g);
  text-shadow: 0 0 6px rgba(5,242,160,.5);
  pointer-events: none;
  white-space: pre;
}
.bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: #0a0e0c;
}
.bar label {
  font-size: 10px; color: var(--mute); letter-spacing: .08em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.bar input[type="range"] {
  width: 100px; accent-color: var(--neon-g);
}
.bar input[type="number"] {
  width: 56px;
  background: #050707;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 5px;
}

/* detail rail */
.kv {
  margin: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
}
.kv row, .kv .row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #141a16;
}
.kv .k { color: var(--mute); }
.kv .v { color: var(--neon-b); word-break: break-all; }
.log {
  margin: 10px;
  padding: 8px;
  max-height: 180px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
  color: var(--mute);
  background: #060908;
  border: 1px solid var(--line);
}
.log .ok { color: var(--ok); }
.log .err { color: var(--danger); }
.log .rgb { color: var(--neon-r); }

.foot {
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  border-top: 1px solid var(--line);
  background: #080a09;
  letter-spacing: .06em;
}
.foot .live {
  color: var(--neon-g);
  text-shadow: 0 0 6px rgba(5,242,160,.5);
}
.foot .rgb-bit {
  margin-left: auto;
  display: flex; gap: 4px;
}
.foot .rgb-bit i {
  display: block; width: 10px; height: 6px;
}
.foot .rgb-bit i:nth-child(1) { background: var(--neon-r); }
.foot .rgb-bit i:nth-child(2) { background: var(--neon-g); }
.foot .rgb-bit i:nth-child(3) { background: var(--neon-b); }

/* free widgets strip */
.widgets {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px 12px;
}
.widget {
  min-width: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #0a0e0c;
  font-size: 11px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}
.widget:hover {
  border-color: var(--neon-b);
  color: var(--neon-b);
}
.widget .wv {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--neon-g);
  margin-top: 4px;
}

/* drag over socket */
.socket.drag-over {
  border-color: var(--neon-r);
  background: #120a0e;
}
