/* EVERFAULT — scoped game UI. Designed to survive hostile WordPress/theme CSS. */
#everfault,
#everfault *,
#everfault *::before,
#everfault *::after { box-sizing:border-box; }

#everfault {
  --ef-bg:#050b08;
  --ef-panel:#08150f;
  --ef-panel-2:#0b1d15;
  --ef-line:#1d5a43;
  --ef-line-bright:#49d995;
  --ef-text:#baffd8;
  --ef-muted:#73a98f;
  --ef-alert:#ffd36a;
  --ef-danger:#ff6876;
  --ef-shadow:0 18px 60px rgba(0,0,0,.45);
  position:relative;
  isolation:isolate;
  width:min(100%,1280px);
  max-width:1280px;
  min-width:0;
  margin:24px auto;
  padding:clamp(12px,2vw,22px);
  overflow:hidden;
  border:1px solid rgba(73,217,149,.35);
  border-radius:12px;
  background:
    radial-gradient(circle at 50% -20%,rgba(50,255,170,.08),transparent 45%),
    linear-gradient(180deg,#07120d 0%,#040907 100%);
  color:var(--ef-text);
  font:500 14px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  box-shadow:var(--ef-shadow),inset 0 0 0 1px rgba(255,255,255,.015);
}

#everfault::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  opacity:.22;
  background:repeating-linear-gradient(180deg,rgba(255,255,255,.035) 0 1px,transparent 1px 4px);
  mix-blend-mode:screen;
}

#everfault::after {
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:radial-gradient(ellipse at center,transparent 55%,rgba(0,0,0,.38) 100%);
}

#everfault button,
#everfault select { font:inherit; }
#everfault button { appearance:none; -webkit-appearance:none; }
#everfault button:focus-visible,
#everfault select:focus-visible { outline:2px solid #baffd8; outline-offset:2px; }

.ef-terminal header,
.ef-terminal footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-width:0;
  padding:10px 8px;
  border-bottom:1px solid rgba(73,217,149,.28);
}
.ef-terminal header { font-size:clamp(14px,2vw,18px); letter-spacing:.04em; }
.ef-terminal footer { margin-top:14px; border-top:1px solid rgba(73,217,149,.22); border-bottom:0; color:var(--muted); flex-wrap:wrap; }

.ef-campaign-bar {
  display:grid;
  grid-template-columns:auto minmax(180px,1fr) auto;
  align-items:center;
  gap:14px;
  min-width:0;
  margin:14px 0;
  padding:12px 14px;
  border:1px solid rgba(73,217,149,.25);
  background:rgba(0,22,13,.5);
}
.ef-campaign-bar label { color:#8cecb7; font-weight:700; }
.ef-campaign-bar select {
  width:100%;
  min-width:0;
  color:var(--ef-text);
  background:#06110c;
  border:1px solid rgba(73,217,149,.38);
  border-radius:5px;
  padding:10px 12px;
}
.ef-campaign-bar span { white-space:nowrap; }

.ef-terminal main {
  display:grid;
  grid-template-columns:minmax(0,1.18fr) minmax(300px,.82fr);
  gap:16px;
  min-width:0;
}

.ef-grid-panel,
.ef-card {
  min-width:0;
  border:1px solid rgba(73,217,149,.28);
  background:linear-gradient(180deg,rgba(9,29,21,.96),rgba(5,18,13,.96));
  box-shadow:inset 0 0 30px rgba(0,255,150,.025);
}
.ef-grid-panel { padding:clamp(12px,2vw,20px); }
.ef-panel-title,
.ef-card > b {
  display:block;
  margin-bottom:12px;
  color:#a6ffd0;
  font-size:clamp(16px,2vw,21px);
  letter-spacing:.04em;
}

.ef-grid {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:clamp(6px,1vw,10px);
  width:100%;
  max-width:720px;
  margin:0 auto;
  aspect-ratio:1/1;
}

.ef-node {
  position:relative;
  display:grid;
  place-items:center;
  min-width:0;
  min-height:0;
  width:100%;
  height:100%;
  padding:0;
  border:1px solid rgba(73,217,149,.24);
  border-radius:9px;
  color:#8ff4bd;
  background:
    radial-gradient(circle at 50% 50%,rgba(68,255,166,.06),transparent 46%),
    #081b13;
  cursor:pointer;
  transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease,background .12s ease;
  overflow:hidden;
}
.ef-node::before {
  content:"";
  width:22%;
  aspect-ratio:1;
  min-width:9px;
  border-radius:50%;
  background:currentColor;
  box-shadow:0 0 14px currentColor;
  opacity:.95;
}
.ef-node::after {
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.015),inset 0 0 24px rgba(0,255,150,.025);
  pointer-events:none;
}
.ef-node:hover:not(:disabled) { transform:translateY(-1px); border-color:#72ffb1; box-shadow:0 0 22px rgba(73,217,149,.14); }
.ef-node:disabled { cursor:not-allowed; }
.ef-node.fault { color:var(--ef-alert); border-color:rgba(255,211,106,.65); animation:ef-pulse 1.4s ease-in-out infinite; }
.ef-node.fault::before { width:30%; box-shadow:0 0 20px rgba(255,211,106,.8); }
.ef-node.blueprint { color:#d7ffe9; border-color:#d7ffe9; background:#102a1e; box-shadow:0 0 24px rgba(140,255,196,.12),inset 0 0 24px rgba(140,255,196,.06); }
.ef-node.welded { color:#54b988; border-color:rgba(84,185,136,.3); }
.ef-node.welded::before { width:17%; border-radius:2px; }

.ef-help {
  margin-top:12px;
  padding:12px 14px;
  border:1px dashed rgba(73,217,149,.25);
  color:#8fc6a9;
  line-height:1.6;
  background:rgba(0,15,9,.35);
}
.ef-help b { color:#ffd36a; }

.ef-side { display:grid; gap:12px; min-width:0; align-content:start; }
.ef-card { padding:16px; overflow:hidden; }

#ef-systems { display:grid; gap:12px; min-width:0; }
.ef-system-row {
  display:grid;
  grid-template-columns:minmax(58px,72px) minmax(80px,1fr) 34px;
  align-items:center;
  gap:9px;
  min-width:0;
}
.ef-system-row > span { min-width:0; color:#b8ffd6; }
.ef-system-row > b { text-align:right; color:#b8ffd6; }
.ef-meter { width:100%; min-width:0; height:12px; overflow:hidden; border:1px solid rgba(73,217,149,.24); border-radius:99px; background:#020604; }
.ef-meter-fill { display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,#18a94b,#61f59b); box-shadow:0 0 12px rgba(49,255,123,.35); transition:width .25s ease; }
.ef-system-row.warn .ef-meter-fill { background:linear-gradient(90deg,#b87318,#ffd36a); }
.ef-system-row.danger .ef-meter-fill { background:linear-gradient(90deg,#a41d32,#ff6876); }

#ef-inventory {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  min-width:0;
}
.ef-piece,
.ef-actions button {
  width:100%;
  min-width:0;
  border:1px solid rgba(73,217,149,.34);
  border-radius:7px;
  padding:11px 12px;
  color:#b8ffd6;
  background:linear-gradient(180deg,#0c2419,#07150f);
  cursor:pointer;
  transition:transform .12s ease,border-color .12s ease,background .12s ease,box-shadow .12s ease;
}
.ef-piece:hover:not(:disabled),
.ef-actions button:hover:not(:disabled) { transform:translateY(-1px); border-color:#8bffc0; box-shadow:0 0 18px rgba(73,217,149,.1); }
.ef-piece.selected { border-color:#e7fff2; box-shadow:0 0 0 1px #e7fff2 inset,0 0 20px rgba(255,255,255,.07); }
.ef-piece:disabled,
.ef-actions button:disabled { opacity:.4; cursor:not-allowed; transform:none; }

.ef-selection {
  margin-top:10px;
  padding:9px 10px;
  border-left:2px solid rgba(73,217,149,.45);
  color:#8fc6a9;
  background:rgba(0,20,12,.35);
}
.ef-selection strong { color:#baffd8; }

.ef-card.ef-shift-card { display:grid; gap:8px; }
#ef-timer { font-size:clamp(28px,5vw,44px); font-weight:800; letter-spacing:.06em; color:#e1ffed; text-shadow:0 0 18px rgba(73,217,149,.18); }
#ef-message { min-height:42px; color:#8fc6a9; }

.ef-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; min-width:0; }
.ef-actions button:first-child { grid-column:1/-1; border-color:#65e9a3; }
#ef-audio { grid-column:1/-1; }

.ef-login { width:min(100%,720px); margin:30px auto; padding:40px 24px; text-align:center; border:1px solid rgba(73,217,149,.3); background:#07100d; color:#b8ffd6; }
.ef-login a { color:#baffd8; }

.ef-status-active { color:#8bffc0; }
.ef-status-danger { color:#ff6876; }

@keyframes ef-pulse { 0%,100%{box-shadow:0 0 0 rgba(255,211,106,0)} 50%{box-shadow:0 0 26px rgba(255,211,106,.16)} }

@media (max-width:1120px) {
  .ef-terminal main { grid-template-columns:1fr; }
  .ef-side { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .ef-side > .ef-card:nth-child(3), .ef-side > .ef-actions { grid-column:1/-1; }
  .ef-actions { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .ef-actions button:first-child { grid-column:auto; }
  #ef-audio { grid-column:auto; }
}

@media (max-width:700px) {
  #everfault { margin:10px 0; padding:10px; border-left:0; border-right:0; border-radius:0; }
  .ef-campaign-bar { grid-template-columns:1fr; gap:7px; }
  .ef-campaign-bar span { white-space:normal; }
  .ef-side { grid-template-columns:1fr; }
  .ef-side > .ef-card:nth-child(3), .ef-side > .ef-actions { grid-column:auto; }
  .ef-actions { grid-template-columns:1fr 1fr; }
  .ef-actions button:first-child, #ef-audio { grid-column:1/-1; }
  #ef-inventory { grid-template-columns:1fr 1fr; }
  .ef-system-row { grid-template-columns:60px minmax(0,1fr) 34px; }
  .ef-grid { gap:5px; }
}

@media (max-width:420px) {
  .ef-grid-panel,.ef-card { padding:11px; }
  #ef-inventory,.ef-actions { grid-template-columns:1fr; }
  .ef-actions button:first-child,#ef-audio { grid-column:auto; }
  .ef-node { border-radius:6px; }
}
