/* =========================================================
   MYRQAI VOID VAULT — GLASS TRANSPARENT FRAMES + RADIANT BACKGROUND (Option A Ready)
   ✅ Keeps radiant background + transparent glass frames
   ✅ Option A support: "Recovered Logs" panel + Log Modal (IDs/classes from your void.html)
   ✅ Single stacking/z-index truth
   ✅ MENU open state, shake class, modal layering
   ✅ Fix: ACTIVE FRAGMENT + SYNCHRONICITY overlap / fragments not visible
   ✅ Fix: left column frames not getting “cut off” / clipped
   ✅ Overlays never steal clicks (except completion overlay when active)
   ✅ No class name changes required
   ✅ NEW: supports HUD FX layer (#hudFx) + body fallback (works with your vault-engine.js + void.html)
   ========================================================= */

/* =========================
   THEME TOKENS
   ========================= */
:root{
  --bg:#050607;
  --ink: rgba(225,255,245,.92);
  --muted: rgba(225,255,245,.62);

  --neon: #00ff9c;
  --neon2:#00ffcc;
  --danger:#ff2d6d;

  --line: rgba(0,255,156,.14);
  --line2: rgba(0,255,156,.22);

  /* glass */
  --glass: rgba(0,0,0,.10);
  --glass2: rgba(0,0,0,.18);

  --shadow: 0 18px 40px rgba(0,0,0,.55);
  --radius: 22px;

  --container: 1220px;
  --gap: 18px;
  --pad: 18px;
  --topbar-h: 72px;

  /* background image support (set by JS) */
  --bg-image: none;

  /* BG visibility */
  --bg-opacity: .34;
  --bg-blur: 0px;
  --bg-scale: 1.07;

  /* radiant glow strength */
  --bg-glow-a: .22;
  --bg-glow-b: .14;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  overflow-x:hidden;
  overflow-y:auto;
  min-height:100vh;
  min-height:100dvh;

  background:
    radial-gradient(1200px 600px at 30% 10%, rgba(0,255,156,.08), transparent 60%),
    radial-gradient(900px 500px at 80% 80%, rgba(0,120,255,.06), transparent 55%),
    var(--bg);

  scrollbar-gutter: stable;

  /* ✅ single stacking truth */
  position: relative;
  isolation: isolate;
}

/* =========================================================
   BACKGROUND IMAGE LAYER (VISIBLE + RADIANT)
   ========================================================= */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  filter: blur(var(--bg-blur)) saturate(1.18) contrast(1.08);
  transform: scale(var(--bg-scale));
  transition: opacity 800ms ease;
  pointer-events:none;
}
body.bg-ready::before{ opacity: var(--bg-opacity); }

/* glow above image, below UI */
body::after{
  content:"";
  position: fixed;
  inset:-18%;
  z-index: 1;
  background:
    radial-gradient(55% 45% at 22% 28%, rgba(0,255,156,var(--bg-glow-a)), transparent 60%),
    radial-gradient(52% 46% at 78% 66%, rgba(0,255,204,var(--bg-glow-b)), transparent 62%),
    radial-gradient(44% 38% at 70% 18%, rgba(0,120,255,.10), transparent 62%),
    linear-gradient(180deg, rgba(0,0,0,.40), rgba(0,0,0,.72));
  opacity: .92;
  transform: translate3d(0,0,0);
  pointer-events:none;
  animation: voidDrift 14s ease-in-out infinite;
  will-change: transform;
}

@keyframes voidDrift{
  0%   { transform: translate3d(-1.2%, -0.8%, 0) scale(1.02); }
  50%  { transform: translate3d( 1.0%,  0.6%, 0) scale(1.03); }
  100% { transform: translate3d(-1.2%, -0.8%, 0) scale(1.02); }
}

/* =========================================================
   BACKGROUND OVERLAYS
   ========================================================= */
#matrix{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  opacity: .50;
  pointer-events: none;
}

.vignette{
  position: fixed; inset:0;
  z-index: 3;
  pointer-events:none;
  background: radial-gradient(
    circle at 50% 35%,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.62) 72%,
    rgba(0,0,0,.82) 100%
  );
}

.scanlines{
  position: fixed; inset:0;
  z-index: 4;
  pointer-events:none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.035) 0px,
    rgba(255,255,255,.035) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 6px
  );
  mix-blend-mode: overlay;
  opacity: .20;
  animation: scanDrift 6s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes scanDrift{
  0%   { transform: translate3d(0, -6px, 0); opacity: .50; }
  50%  { transform: translate3d(0,  6px, 0); opacity: .68; }
  100% { transform: translate3d(0, -6px, 0); opacity: .50; }
}

/* =========================================================
   ✅ HUD FX LAYER (works with new void.html)
   - vault-engine.js toggles classes on body OR on #hudFx depending on your version
   - this supports BOTH (no matter which file is live)
   ========================================================= */
#hudFx{
  position: fixed;
  inset: 0;
  z-index: 900;       /* above scanlines/matrix, below UI */
  pointer-events:none;
  transform: translateZ(0);
  will-change: filter, transform, opacity;
}

/* Flash/shock as filter animation (if engine uses #hudFx classes) */
@keyframes hudFlashFX {
  0% { filter: none; opacity: 1; }
  35% { filter: saturate(1.35) contrast(1.18) brightness(1.10); opacity: 1; }
  100% { filter: none; opacity: 1; }
}
#hudFx.hud-flash{ animation: hudFlashFX .55s ease-out 1; }

@keyframes hudShockFX{
  0% { filter: none; opacity: 1; }
  25% { filter: saturate(1.55) contrast(1.25) brightness(1.14); opacity: 1; }
  60% { filter: saturate(1.25) contrast(1.12); opacity: 1; }
  100% { filter: none; opacity: 1; }
}
#hudFx.hud-shock{ animation: hudShockFX .85s ease-out 1; }

/* vault-hit pulses as filter animation (if engine uses #hudFx classes) */
@keyframes vaultHitFX{
  0% { filter: none; }
  40% { filter: saturate(1.25) contrast(1.15) brightness(1.08); }
  100% { filter: none; }
}
#hudFx.vault-hit{ animation: vaultHitFX .22s ease-out 1; }

@keyframes vaultHit2FX{
  0% { filter: none; }
  35% { filter: saturate(1.35) contrast(1.2) brightness(1.1); }
  70% { filter: saturate(1.15) contrast(1.08); }
  100% { filter: none; }
}
#hudFx.vault-hit-2{ animation: vaultHit2FX .32s ease-out 1; }

/* Jitter family (if engine uses #hudFx classes) */
@keyframes jitterFX {
  0%{transform:translate(0)}
  25%{transform:translate(2px,-2px)}
  50%{transform:translate(-2px,2px)}
  75%{transform:translate(1px,-1px)}
  100%{transform:translate(0)}
}
#hudFx[class*="signal-jitter-"]{ animation:jitterFX .12s linear 10; }

/* =========================================================
   TOP BAR
   ========================================================= */
.topbar{
  position: sticky;
  top:0;
  z-index: 1000;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  padding-left: max(18px, calc((100vw - var(--container))/2 + 18px));
  padding-right: max(18px, calc((100vw - var(--container))/2 + 18px));
  padding-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
}

.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  display:grid; place-items:center;
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(0,255,156,.06);
  box-shadow: 0 0 22px rgba(0,255,156,.16);
  font-size: 18px;
}
.brand-title{ font-weight: 900; letter-spacing: .16em; font-size: 12px; color: rgba(0,255,156,.95); }
.brand-sub{ font-size: 11px; letter-spacing: .10em; color: var(--muted); margin-top: 3px; }

.top-actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.chip{
  border:1px solid rgba(0,255,156,.18);
  background: rgba(0,0,0,.14);
  backdrop-filter: blur(10px);
  color: rgba(225,255,245,.92);
  padding: 10px 12px;
  border-radius: 14px;
  letter-spacing: .10em;
  font-weight: 900;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.chip:hover{
  background: rgba(0,255,156,.06);
  border-color: rgba(0,255,156,.34);
  transform: translateY(-1px);
}

/* Dropdown */
.menu{ position:relative; }
.menu-drop{
  display:none;
  position:absolute;
  right:0;
  top: calc(100% + 8px);
  min-width: 220px;
  border-radius: 16px;
  border: 1px solid rgba(0,255,156,.16);
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(14px);
  padding: 10px;
  z-index: 1200;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.menu-drop.open{ display:block; }

.menu-item{
  width: 100%;
  text-align:left;
  border: 1px solid rgba(0,255,156,.12);
  background: rgba(0,0,0,.14);
  color: rgba(225,255,245,.90);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  margin: 6px 0;
}
.menu-item:hover{ background: rgba(0,255,156,.06); }

/* =========================================================
   LAYOUT
   ========================================================= */
.shell{
  position: relative;
  z-index: 900;
  display:grid;
  grid-template-columns: 380px minmax(0,1fr);
  gap: var(--gap);
  padding: var(--pad);
  max-width: var(--container);
  margin: 0 auto;
  min-height: calc(100dvh - var(--topbar-h) - 2px);
  align-items:start;
  animation: shellBoot 520ms ease-out both;
}
@keyframes shellBoot{
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: translate3d(0,  0px, 0); }
}

/* Glass frames */
.side-card, .panel, .terminal-frame{
  border-radius: var(--radius);
  border: 1px solid rgba(0,255,156,.14);
  background: linear-gradient(180deg, rgba(0,0,0,.14), rgba(0,0,0,.08));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 950;
}

/* =========================================================
   LEFT COLUMN (FIXED: no clipping / no overlap)
   ========================================================= */
.side{
  display:flex;
  flex-direction:column;
  gap: 14px;
  height: calc(100dvh - var(--topbar-h) - (var(--pad) * 2));
  min-height: 540px;
  min-height: 0;              /* critical for nested flex sizing */
  overflow: auto;             /* ✅ sidebar scroll */
  padding-right: 6px;         /* space for scrollbar */
}

/* Optional: nicer scrollbar for the sidebar itself */
.side::-webkit-scrollbar{ width: 10px; }
.side::-webkit-scrollbar-thumb{
  background: rgba(0,255,156,.22);
  border: 2px solid rgba(0,0,0,.18);
  border-radius: 999px;
}
.side::-webkit-scrollbar-track{
  background: rgba(0,0,0,.14);
  border-radius: 999px;
}

.side-card{ padding: 16px; min-width:0; }

/* Keep first card natural (do NOT make it flex:1) */
.side-card:first-child{
  flex: 0 0 auto;
  display:flex;
  flex-direction:column;
  min-height: 0;
}

/* Titles/text */
.side-title{
  font-weight: 900;
  letter-spacing: .14em;
  font-size: 12px;
  color: rgba(0,255,156,.92);
  text-transform: uppercase;
}
.side-text{
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(225,255,245,.72);
}
.muted{ color: rgba(225,255,245,.55); }
.tiny{ font-size: 11px; }

/* Meter (never overlaps; fixed-height block) */
.meter{
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border:1px solid rgba(0,255,156,.14);
  background: rgba(0,0,0,.12);
  backdrop-filter: blur(10px);
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.meter-head{ display:flex; align-items:center; justify-content:space-between; }
.meter-title{ font-weight:900; letter-spacing:.14em; font-size:12px; color: rgba(0,255,156,.92); }
.meter-meta{ font-weight:900; color: rgba(225,255,245,.85); }
.meter-bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(0,255,156,.10);
  border:1px solid rgba(0,255,156,.14);
  margin-top:10px;
  overflow:hidden;
}
.meter-fill{
  height: 100%;
  width: 0%;
  background: rgba(0,255,156,.60);
  box-shadow: 0 0 18px rgba(0,255,156,.22) inset;
}
.meter-sub{ margin-top:8px; font-size: 11px; color: rgba(225,255,245,.55); line-height:1.4; }
.meter-sub code{
  background: rgba(0,255,156,.10);
  border:1px solid rgba(0,255,156,.14);
  padding: 1px 6px;
  border-radius: 8px;
}

/* Signals (ACTIVE FRAGMENT) */
.signals{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
  min-height: 160px;
  max-height: 320px;
  overflow:auto;
  padding-right: 6px;
  border-radius: 16px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ✅ Single mode MUST NOT hide content */
.signals.single{
  overflow:auto;
  padding-right: 6px;
}

/* Scrollbars for signals + stream */
.signals::-webkit-scrollbar,
.stream::-webkit-scrollbar{ width: 10px; }
.signals::-webkit-scrollbar-thumb,
.stream::-webkit-scrollbar-thumb{
  background: rgba(0,255,156,.22);
  border: 2px solid rgba(0,0,0,.18);
  border-radius: 999px;
}
.signals::-webkit-scrollbar-track,
.stream::-webkit-scrollbar-track{
  background: rgba(0,0,0,.14);
  border-radius: 999px;
}

/* Fragment frame */
.fragment-frame{
  border-radius: 18px;
  border: 1px solid rgba(0,255,156,.14);
  background: rgba(0,0,0,.08);
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(0,255,156,.05);
  position: relative;
  z-index: 2;
}

/* Signal card */
.signal-card{
  width:100%;
  text-align:left;
  border-radius: 16px;
  border:1px solid rgba(0,255,156,.18);
  background: rgba(0,0,0,.12);
  backdrop-filter: blur(12px);
  padding: 14px;
  color: rgba(225,255,245,.92);
  cursor:pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  position: relative;
  z-index: 2;
}
.signal-card:hover{
  transform: translateY(-2px);
  background: rgba(0,255,156,.06);
  border-color: rgba(0,255,156,.36);
  box-shadow: 0 10px 26px rgba(0,0,0,.30);
}
.signal-title{ font-weight: 900; letter-spacing:.10em; color: rgba(0,255,156,.92); margin-bottom:8px; }
.signal-meta{ font-size: 11px; letter-spacing:.12em; color: rgba(225,255,245,.55); text-transform: uppercase; }
.signal-desc{ margin-top:10px; font-size: 12px; color: rgba(225,255,245,.75); line-height:1.55; }
.signal-cta{
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: .14em;
  color: rgba(0,255,156,.88);
  text-transform: uppercase;
}

/* =========================================================
   OPTION A: RECOVERED LOGS PANEL
   ========================================================= */
.vaultlog{ margin-top: 14px; }
.vaultlog-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.vaultlog-title{
  font-weight: 900;
  letter-spacing: .14em;
  font-size: 12px;
  color: rgba(0,255,156,.92);
  text-transform: uppercase;
}
.vaultlog-meta{
  font-size: 11px;
  letter-spacing: .10em;
  color: rgba(225,255,245,.62);
  white-space: nowrap;
}
.vaultlog-list{
  max-height: 230px;
  overflow:auto;
  border: 1px solid rgba(0,255,156,.14);
  background: rgba(0,0,0,.12);
  border-radius: 16px;
  padding: 10px;
}
.vaultlog-empty{
  font-size: 12px;
  color: rgba(225,255,245,.62);
  letter-spacing: .08em;
  line-height: 1.45;
  padding: 6px 2px;
}
.vaultlog-item{
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,156,.12);
  background: rgba(0,0,0,.14);
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.vaultlog-item:hover{
  transform: translateY(-1px);
  border-color: rgba(0,255,156,.22);
  background: rgba(0,0,0,.20);
}
.vaultlog-item:last-child{ margin-bottom: 0; }
.vaultlog-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.vaultlog-id{
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(0,255,156,.92);
  font-weight: 900;
  white-space: nowrap;
}
.vaultlog-time{
  font-size: 10px;
  letter-spacing: .10em;
  color: rgba(225,255,245,.50);
  white-space: nowrap;
}
.vaultlog-name{
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(225,255,245,.86);
  opacity: .92;
}
.vaultlog-preview{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(225,255,245,.72);
  white-space: pre-wrap;
  max-height: 3.9em;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,.4));
}
.vaultlog-actions{
  display:flex;
  gap:8px;
  margin-top: 10px;
}

/* =========================================================
   CENTER PANEL + TERMINAL SPACE
   ========================================================= */
.panel{
  padding: 18px;
  min-width: 0;
  height: calc(100dvh - var(--topbar-h) - (var(--pad) * 2));
  min-height: 540px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.panel > *{ min-height: 0; }

.panel-head{ display:flex; flex-direction:column; gap:10px; flex: 0 0 auto; }

.badge{
  align-self:flex-start;
  border-radius: 999px;
  border: 1px solid rgba(0,255,156,.22);
  background: rgba(0,255,156,.06);
  padding: 6px 10px;
  letter-spacing: .16em;
  font-size: 11px;
  font-weight: 900;
  color: rgba(0,255,156,.92);
}

.title{
  margin: 0;
  font-size: 34px;
  letter-spacing: .22em;
  text-transform: uppercase;
  line-height: 1.15;
}
.title.radiant{
  position: relative;
  color: rgba(225,255,245,.96);
  text-shadow:
    0 0 18px rgba(0,255,156,.22),
    0 0 42px rgba(0,255,156,.12);
}
.title.radiant::after{
  content:"";
  position:absolute;
  inset:-6px -12px;
  background: radial-gradient(circle at 40% 40%, rgba(0,255,156,.25), transparent 55%),
              radial-gradient(circle at 70% 60%, rgba(0,120,255,.18), transparent 60%);
  filter: blur(14px);
  opacity: .55;
  z-index: -1;
  animation: aura 3.6s ease-in-out infinite;
  pointer-events:none;
}
@keyframes aura{
  0%,100%{ transform: scale(1); opacity:.45; }
  50%{ transform: scale(1.03); opacity:.70; }
}

.subtitle{
  margin:0;
  font-size: 13px;
  color: rgba(225,255,245,.74);
  line-height: 1.7;
}

/* Glitch */
.glitch{ position:relative; }
.glitch::before,
.glitch::after{
  content: attr(data-text);
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.55;
}
.glitch::before{
  transform: translate(1px,0);
  color: rgba(0,255,204,.8);
  clip-path: inset(0 0 52% 0);
  animation: glitch 3.2s infinite linear;
}
.glitch::after{
  transform: translate(-1px,0);
  color: rgba(255,45,109,.7);
  clip-path: inset(50% 0 0 0);
  animation: glitch 2.7s infinite linear;
}
@keyframes glitch{
  0%{ clip-path: inset(0 0 52% 0); }
  10%{ clip-path: inset(6% 0 42% 0); }
  20%{ clip-path: inset(12% 0 34% 0); }
  30%{ clip-path: inset(4% 0 48% 0); }
  40%{ clip-path: inset(18% 0 30% 0); }
  60%{ clip-path: inset(6% 0 44% 0); }
  80%{ clip-path: inset(14% 0 32% 0); }
  100%{ clip-path: inset(0 0 52% 0); }
}

/* Mission */
.mission{
  margin-top: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(0,255,156,.16);
  background: rgba(0,0,0,.08);
  max-height: 170px;
  overflow:auto;
}
.mission-title{ font-weight:900; letter-spacing:.14em; font-size: 12px; color: rgba(0,255,156,.92); }
.mission-steps{ margin: 10px 0 0 18px; color: rgba(225,255,245,.80); font-size: 12px; line-height: 1.7; }

/* Controls */
.controls{
  margin-top: 14px;
  display:flex;
  gap: 12px;
  align-items:stretch;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.input-wrap{ flex: 1; min-width: 260px; }

#keyInput, .pw, .ta, input{
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(0,255,156,.18);
  background: rgba(0,0,0,.12);
  backdrop-filter: blur(12px);
  color: rgba(225,255,245,.92);
  padding: 14px 14px;
  outline: none;
}
#keyInput:focus, .pw:focus, .ta:focus, input:focus{
  border-color: rgba(0,255,156,.42);
  box-shadow: 0 0 0 4px rgba(0,255,156,.08);
}

.btn{
  border-radius: 16px;
  border: 1px solid rgba(0,255,156,.18);
  background: rgba(0,0,0,.12);
  backdrop-filter: blur(12px);
  color: rgba(225,255,245,.92);
  padding: 12px 14px;
  letter-spacing: .10em;
  font-weight: 900;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{
  background: rgba(0,255,156,.07);
  border-color: rgba(0,255,156,.36);
  transform: translateY(-1px);
}
.btn.primary{
  background: linear-gradient(180deg, rgba(0,255,156,.16), rgba(0,0,0,.10));
  border-color: rgba(0,255,156,.28);
}
.btn.ghost{ background: rgba(0,0,0,.08); }
.btn.small{ padding: 10px 12px; border-radius: 14px; }

.dot{
  display:inline-block;
  width:8px;height:8px;
  border-radius:50%;
  margin-right:8px;
  background: var(--danger);
  box-shadow: 0 0 14px rgba(255,45,109,.6);
  vertical-align: middle;
}

.actions{ margin-top: 10px; display:flex; gap: 10px; flex-wrap:wrap; flex:0 0 auto; }

.status-row{
  margin-top: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex:0 0 auto;
}
.status{ font-size: 12px; color: rgba(225,255,245,.76); min-height: 18px; }
.live{ display:flex; align-items:center; gap: 8px; font-size: 11px; letter-spacing:.14em; color: rgba(0,255,156,.92); }
.pulse{
  width: 10px; height: 10px; border-radius: 999px;
  background: rgba(0,255,156,.85);
  box-shadow: 0 0 18px rgba(0,255,156,.45);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse{ 0%,100%{ transform:scale(.85); opacity:.7 } 50%{ transform:scale(1.15); opacity:1 } }

/* Terminal */
.terminal-frame{
  margin-top: 14px;
  flex: 1 1 auto;
  min-height: 360px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border: 1px solid rgba(0,255,156,.16);
  background: rgba(0,0,0,.08);
}
.terminal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,255,156,.12);
  background: rgba(0,0,0,.06);
}
.terminal-title{
  font-weight: 900;
  letter-spacing: .14em;
  font-size: 11px;
  color: rgba(0,255,156,.92);
}

.stream-top-btn{
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0,255,156,.22);
  background: rgba(0,0,0,.28);
  color: rgba(225,255,245,.92);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  letter-spacing: .08em;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.30);
  backdrop-filter: blur(10px);
}
.stream-top-btn:hover{
  border-color: rgba(0,255,156,.35);
  background: rgba(0,0,0,.42);
}

.stream{
  flex: 1 1 auto;
  min-height: 0;
  overflow:auto;
  padding: 12px;
  background: rgba(0,0,0,.05);
}

/* Stream items */
.stream-item{
  border-radius: 18px;
  border: 1px solid rgba(0,255,156,.14);
  background: rgba(0,0,0,.10);
  backdrop-filter: blur(12px);
  padding: 12px 12px;
  margin-bottom: 10px;
}
.stream-item.rare{
  border-color: rgba(170, 80, 255, .45);
  box-shadow: 0 0 24px rgba(170, 80, 255, .10);
}
.stream-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.stream-title{
  font-weight: 900;
  letter-spacing: .12em;
  color: rgba(0,255,156,.92);
  text-transform: uppercase;
  font-size: 11px;
}
.stream-meta{
  font-size: 11px;
  letter-spacing: .10em;
  color: rgba(225,255,245,.55);
  white-space: nowrap;
}
.stream-body{
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 13px;
  color: rgba(225,255,245,.84);
}

/* Footer */
.footer{
  margin-top: 12px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.tiny{ font-size:12px; color: rgba(215,255,233,.6); }

/* =========================================================
   MODALS
   ========================================================= */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  background: rgba(0,0,0,.72);
  padding: 18px;
}
.modal.show, .modal.open{ display:flex; }

.modal-card{
  width: min(640px, 96vw);
  border-radius: 22px;
  border: 1px solid rgba(0,255,156,.16);
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(16px);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
}
.modal-title{ font-weight: 900; letter-spacing: .16em; color: rgba(0,255,156,.92); text-transform: uppercase; }
.modal-text{ margin-top: 12px; color: rgba(225,255,245,.76); font-size: 13px; line-height: 1.7; }
.modal-actions{ margin-top: 14px; display:flex; gap: 10px; justify-content:flex-end; flex-wrap:wrap; }

.log-modal .modal-card{ width: min(740px, 92vw); }

.log-meta{
  margin: 6px 0 12px 0;
  font-size: 11px;
  letter-spacing: .10em;
  color: rgba(225,255,245,.62);
  text-transform: uppercase;
}
.log-meta code{
  font-family: inherit;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(0,255,156,.14);
  background: rgba(0,0,0,.30);
  color: rgba(0,255,156,.92);
}
.log-body{
  border: 1px solid rgba(0,255,156,.14);
  background: rgba(0,0,0,.35);
  border-radius: 16px;
  padding: 12px;
  white-space: pre-wrap;
  line-height: 1.45;
  color: rgba(225,255,245,.84);
  max-height: 52vh;
  overflow:auto;
}

/* Form row helpers */
.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.row .pw{ flex: 1; min-width: 0; }

.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;
}

/* Shake */
@keyframes shakeKey {
  0% { transform: translate3d(0,0,0); }
  15%{ transform: translate3d(2px,-2px,0); }
  30%{ transform: translate3d(-2px,2px,0); }
  45%{ transform: translate3d(2px,0,0); }
  60%{ transform: translate3d(-1px,1px,0); }
  75%{ transform: translate3d(1px,-1px,0); }
  100%{ transform: translate3d(0,0,0); }
}
.shake{ animation: shakeKey .42s ease-out 1; }

/* =========================================================
   ✅ BODY FALLBACK ANIMS (if your engine still toggles BODY classes)
   ========================================================= */
@keyframes jitterBody {
  0%{transform:translate(0)}
  25%{transform:translate(2px,-2px)}
  50%{transform:translate(-2px,2px)}
  75%{transform:translate(1px,-1px)}
  100%{transform:translate(0)}
}
body[class*="signal-jitter-"]{ animation:jitterBody .12s linear 10; }

@keyframes vaultHitBody {
  0% { filter: none; }
  40% { filter: saturate(1.25) contrast(1.15) brightness(1.08); }
  100% { filter: none; }
}
body.vault-hit { animation: vaultHitBody .22s ease-out 1; }

@keyframes vaultHit2Body {
  0% { filter: none; }
  35% { filter: saturate(1.35) contrast(1.2) brightness(1.1); }
  70% { filter: saturate(1.15) contrast(1.08); }
  100% { filter: none; }
}
body.vault-hit-2 { animation: vaultHit2Body .32s ease-out 1; }

/* Return to base button */
.back-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 18px;
  font-size: 12px;
  background: rgba(0,255,156,.08);
  color: rgba(225,255,245,.92);
  text-decoration: none;
  border: 1px solid rgba(0,255,156,.30);
  border-radius: 16px;
  letter-spacing: .12em;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(0,0,0,.30);
  backdrop-filter: blur(10px);
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.back-btn:hover{
  background: rgba(0,255,156,.14);
  border-color: rgba(0,255,156,.55);
  box-shadow: 0 0 26px rgba(0,255,156,.12), 0 10px 26px rgba(0,0,0,.35);
  transform: translateY(-1px);
}
.back-btn:active{ transform: translateY(0px); }

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  body::after{ animation: none !important; }
  .scanlines{ animation: none !important; }
  .shell{ animation: none !important; }
  body[class*="signal-jitter-"]{ animation: none !important; }
  .glitch::before, .glitch::after{ animation:none !important; }
  .pulse{ animation:none !important; }
  .title.radiant::after{ animation:none !important; }
  body::before{ transition:none !important; }
  #hudFx{ animation: none !important; }
}

/* Responsive */
@media (max-width: 1020px){
  .shell{ grid-template-columns: 1fr; }
  .side{ height: auto; min-height: 0; overflow: visible; padding-right: 0; }
  .panel{ height: auto; min-height: 0; overflow: visible; }
  .terminal-frame{ min-height: 56vh; min-height: 56dvh; }
  .signals{ max-height: none; }
}
@media (max-width: 520px){
  .topbar{ padding-left: 14px; padding-right: 14px; }
  .shell{ padding: 14px; }
  .title{ font-size: 26px; letter-spacing: .18em; }
  .mission{ max-height: 200px; }
}

/* Safety: ensure overlays never steal clicks */
body::before,
body::after,
#matrix,
.vignette,
.scanlines,
#hudFx{ pointer-events: none !important; }

button, input, textarea{ pointer-events: auto; }

/* =========================================================
   ✅ RECOVERED LOGS FIX (ONLY)
   ========================================================= */
#vaultLogCard{
  display:flex;
  flex-direction:column;
  max-height: 360px;
}
#vaultLogList{
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 230px;
  overflow: auto;
}
#vaultLogCard .vaultlog-actions{
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 5;

  padding-top: 10px;
  margin-top: 10px;

  background: linear-gradient(
    180deg,
    rgba(0,0,0,0),
    rgba(0,0,0,.22) 40%,
    rgba(0,0,0,.26)
  );
  border-top: 1px solid rgba(0,255,156,.10);
  backdrop-filter: blur(10px);
}

/* =========================================================
   ✅ PHASE + HUD FX (BODY-based overlay flash)
   (kept for compatibility if engine uses body.hud-flash/hud-shock)
   ========================================================= */
.rank-pop{
  animation: rankPop .36s ease-out 1;
  will-change: transform, filter;
}
@keyframes rankPop{
  0%   { transform: translate3d(0,0,0) scale(1);   filter:none; }
  40%  { transform: translate3d(0,-1px,0) scale(1.22); filter: saturate(1.2) brightness(1.06); }
  100% { transform: translate3d(0,0,0) scale(1);   filter:none; }
}

/* body flash overlay (doesn't steal clicks) */
body.hud-flash::before,
body.hud-shock::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  background:
    radial-gradient(800px 420px at 30% 30%, rgba(0,255,156,.16), transparent 62%),
    radial-gradient(720px 420px at 72% 65%, rgba(0,255,204,.12), transparent 62%),
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.22));
  mix-blend-mode: screen;
}

body.hud-flash::before{ animation: hudFlash .62s ease-out 1; }
@keyframes hudFlash{
  0%   { opacity: 0; transform: translate3d(0,0,0); }
  25%  { opacity: .95; }
  100% { opacity: 0; }
}

body.hud-shock::before{
  background:
    radial-gradient(900px 520px at 30% 30%, rgba(0,255,156,.22), transparent 62%),
    radial-gradient(820px 520px at 72% 65%, rgba(0,255,204,.18), transparent 62%),
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.30));
  animation: hudShock .9s ease-out 1;
}
@keyframes hudShock{
  0%   { opacity: 0; transform: translate3d(0,0,0); filter: none; }
  20%  { opacity: 1; filter: saturate(1.25) contrast(1.1) brightness(1.05); }
  55%  { opacity: .55; }
  100% { opacity: 0; filter: none; }
}

/* =========================================================
   ✅ COMPLETION OVERLAY (ACCESS GRANTED)
   - appears when #completionOverlay gets .show
   ========================================================= */
#completionOverlay{
  position: fixed;
  inset: 0;
  z-index: 99999; /* above modals */
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  background:
    radial-gradient(900px 520px at 50% 40%, rgba(0,255,156,.10), transparent 60%),
    radial-gradient(800px 520px at 65% 60%, rgba(0,255,204,.08), transparent 64%),
    linear-gradient(180deg, rgba(0,0,0,.72), rgba(0,0,0,.88));
  backdrop-filter: blur(6px);
}

#completionOverlay.show{
  opacity: 1;
  pointer-events: auto;
  animation: completionFade .55s ease-out 1;
}
@keyframes completionFade{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

#completionOverlay::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.045) 0px,
    rgba(255,255,255,.045) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 7px
  );
  opacity: .22;
  mix-blend-mode: overlay;
  animation: completionScan 3.2s ease-in-out infinite;
}
@keyframes completionScan{
  0%{ transform: translate3d(0,-10px,0); opacity: .16; }
  50%{ transform: translate3d(0, 10px,0); opacity: .30; }
  100%{ transform: translate3d(0,-10px,0); opacity: .16; }
}

#completionOverlay .completion-box{
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 26px 22px;
  border-radius: 22px;
  border: 1px solid rgba(0,255,156,.22);
  background: rgba(0,0,0,.45);
  box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 60px rgba(0,255,156,.10);
  backdrop-filter: blur(14px);
  min-width: min(560px, 92vw);
  animation: completionPulse 1.55s ease-in-out infinite;
  cursor: pointer;
}

#completionOverlay .completion-box h1{
  margin: 0;
  letter-spacing: .22em;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 54px);
  color: rgba(225,255,245,.96);
  text-shadow:
    0 0 18px rgba(0,255,156,.25),
    0 0 48px rgba(0,255,156,.12);
}

#completionOverlay .completion-box p{
  margin: 14px 0 0 0;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(225,255,245,.70);
}

@keyframes completionPulse{
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(0,-2px,0) scale(1.03); }
  100% { transform: translate3d(0,0,0) scale(1); }
}