:root {
  --bg: #030d0a;
  --panel: #061914;
  --text: #d3ffe7;
  --muted: #7affc3;
  --accent: #00ff9c;
  --danger: #ff3b6b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(0,255,156,0.06), transparent),
              radial-gradient(800px 400px at 90% 20%, rgba(0,255,156,0.04), transparent),
              var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.4px;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.header { text-align: center; margin: 16px 0 24px; }
.glitch {
  font-size: 48px;
  margin: 0;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 18px rgba(0,255,156,0.35);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  clip-path: inset(0);
}
.glitch::before { left: -2px; text-shadow: -2px 0 var(--accent); animation: glitch 2.3s infinite linear alternate-reverse; }
/* .glitch::after  { left:  2px; text-shadow:  2px 0 #1af1ff; animation: glitch 1.8s infinite linear alternate; } */

.sub { color: var(--muted); margin: 6px 0 0; opacity: 0.85; }

.terminal {
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.08)), var(--panel);
  border: 1px solid rgba(0,255,156,0.2);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 8px 40px rgba(0,255,156,0.06);
}
.output {
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  line-height: 1.6;
}
.prompt { margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.caret { color: var(--accent); }
.cursor { animation: blink 1s steps(2) infinite; color: var(--muted); }

.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.card { background: rgba(0,0,0,0.2); border: 1px solid rgba(0,255,156,0.18); border-radius: 10px; padding: 14px; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; }
.value { font-size: 18px; margin-top: 6px; }

#cpu-percent, #mem-percent { font-feature-settings: "tnum" 1; }

.dashboard { margin-top: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid-9 { grid-template-columns: repeat(3, 1fr); }
.grid-9 { grid-auto-rows: 1fr; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.panel { background: rgba(0,0,0,0.2); border: 1px solid rgba(0,255,156,0.18); border-radius: 12px; padding: 16px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.panel-header { color: var(--muted); font-size: 12px; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 1.2px; }
.rows { display: grid; gap: 6px; }
.mini { color: var(--muted); font-size: 12px; opacity: 0.9; }

.gauge { position: relative; display: grid; place-items: center; padding: 6px 0 0; }
.gauge svg { width: 100%; height: auto; filter: drop-shadow(0 2px 10px rgba(0,255,156,0.08)); }
.gauge-value { position: absolute; bottom: 2px; font-size: 22px; text-shadow: 0 0 10px rgba(0,255,156,0.2); }

.spark { height: 46px; margin-top: 10px; background: linear-gradient(180deg, rgba(0,255,156,0.08), rgba(0,255,156,0.02)); border-radius: 8px; position: relative; overflow: hidden; }
.spark::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(0,255,156,0.08) 0, rgba(0,255,156,0.08) 1px, transparent 1px, transparent 6px); opacity: 0.6; }
.sparkline { position: absolute; inset: 0; }

.progress { height: 10px; background: rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #1af1ff); box-shadow: 0 0 16px rgba(0,255,156,0.3) inset; transition: width 0.3s ease; }

.bars { display: grid; gap: 6px; }
.bars .bar { height: 8px; background: rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; position: relative; }
.bars .bar > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #1af1ff); transition: width 0.3s ease; }
.bar-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }

@media (max-width: 980px) { .grid-9 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-9 { grid-template-columns: 1fr; } }

/* Bars & progress */
.bars { display: grid; grid-template-columns: 1fr; gap: 6px; }
.bar { height: 10px; background: rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #1af1ff); box-shadow: 0 0 12px rgba(0,255,156,0.35) inset; transition: width 300ms ease; }
.bar-label { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 2px; }

.progress { height: 8px; background: rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; width: 0%; background: linear-gradient(90deg, #1af1ff, var(--accent)); transition: width 300ms ease; }

/* Invalid state */
.panel.invalid { border-color: rgba(255,59,107,0.45); box-shadow: 0 0 24px rgba(255,59,107,0.12) inset; }
.panel.invalid .panel-header { color: var(--danger); }
.analysis { min-height: 72px; white-space: pre-wrap; opacity: 0.95; line-height: 1.5; }

#scan-overlay { position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,255,156,0.08) 0px, rgba(0,255,156,0.08) 1px, transparent 1px, transparent 3px); mix-blend-mode: overlay; animation: scan 6s linear infinite; }

@keyframes glitch {
  0%   { clip-path: inset(0 0 95% 0); }
  10%  { clip-path: inset(0 0 80% 0); }
  20%  { clip-path: inset(0 0 60% 0); }
  30%  { clip-path: inset(0 0 40% 0); }
  40%  { clip-path: inset(0 0 20% 0); }
  50%  { clip-path: inset(0 0 0 0); }
  60%  { clip-path: inset(20% 0 0 0); }
  70%  { clip-path: inset(40% 0 0 0); }
  80%  { clip-path: inset(60% 0 0 0); }
  90%  { clip-path: inset(80% 0 0 0); }
  100% { clip-path: inset(95% 0 0 0); }
}

@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

@keyframes scan {
  0% { background-position: 0 -20px; }
  100% { background-position: 0 20px; }
}

/* Scrollbar subtle neon */
.output::-webkit-scrollbar { width: 10px; }
.output::-webkit-scrollbar-thumb { background: rgba(0,255,156,0.28); border-radius: 8px; }

