/* Aurora X Obfuscator — theme v2 (shadcn-style, hand-crafted)
   Palette: bg #0b0b10 / card #131318 / aqua #50f5f5 / gold #d99139 */
:root {
  --bg: #0b0b10;
  --card: #131318;
  --card-2: #17171e;
  --border: #26262e;
  --border-2: #31313b;
  --text: #e6e6ea;
  --muted: #9a9aa3;
  --dim: #62626b;
  --aqua: #50f5f5;
  --aqua-2: #2ea8a8;
  --aqua-dim: rgba(80, 245, 245, 0.12);
  --gold: #d99139;
  --gold-dim: rgba(217, 145, 57, 0.13);
  --green: #3ddc84;
  --green-dim: rgba(61, 220, 132, 0.13);
  --red: #ff5d5d;
  --red-dim: rgba(255, 93, 93, 0.12);
  --radius: 12px;
  --radius-s: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
html { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, .snippet, .keytxt, .sel { -webkit-user-select: text; user-select: text; }
:focus, :focus-visible { outline: none !important; }
a { color: var(--aqua); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- auth views (login / register) ---------- */
.auth-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  gap: 18px;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 33% 68%, #cfeeff88 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 74%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 35%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 20% 82%, #cfeeff77 50%, transparent 51%),
    radial-gradient(1px 1px at 67% 88%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 8%, #fff7 50%, transparent 51%),
    linear-gradient(180deg, #0a0f1e 0%, #0b0b10 60%, #0a0d18 100%);
  background-size: 520px 520px, 520px 520px, 520px 520px, 520px 520px, 520px 520px, 520px 520px, 520px 520px, 520px 520px, 100% 100%;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; }
.wm { font-family: 'Chakra Petch', var(--font); font-weight: 700; font-size: 23px; letter-spacing: .13em; line-height: 1;
  background: linear-gradient(180deg, #ffffff 20%, #a8dce8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm b { background: linear-gradient(180deg, #8fffff 10%, #1a9aa8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.side-brand { gap: 10px; }
.side-brand .wm { font-size: 15px; letter-spacing: .11em; }
.auth-logo .wm { position: relative; top: 2px; }
.side-brand .wm { position: relative; top: 1px; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-align: center; margin: 0 0 6px; }
.auth-sub { color: var(--muted); font-size: 14px; text-align: center; margin: 0 0 20px; }
.auth-input {
  width: 100%;
  padding: 12px 14px;
  background: #0a0e17;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 12px;
}
.auth-input:focus { border-color: var(--aqua-2); }
.auth-input::placeholder { color: #77839a; }
.auth-hint { color: var(--dim); font-size: 12.5px; margin: -6px 0 14px 4px; }
.auth-err { color: var(--red); font-size: 13px; min-height: 18px; margin: -6px 0 10px; text-align: center; }
.btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(180deg, #3aeaea, #1a9aa8);
  border: 1px solid #2ea8a8;
  border-radius: 10px;
  color: #04262b;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.auth-alt { text-align: center; color: var(--muted); font-size: 13.5px; margin: 16px 0 0; }
.auth-alt a, .auth-legal a { font-weight: 600; cursor: pointer; }
.auth-legal { text-align: center; color: var(--dim); font-size: 12.5px; margin: 14px 0 0; }
.auth-foot { color: #71717c; font-size: 13px; margin-top: -4px; }
.tos-row { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; }
.tos-row input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--aqua-2); flex: none; }
.tos-row label { color: var(--muted); font-size: 13.5px; cursor: pointer; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  flex: none;
  border-right: 1px solid var(--border);
  background: #0e0e13;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a:hover { color: var(--text); background: #16161d; }
.nav a.active { color: var(--aqua); background: var(--aqua-dim); border-color: rgba(80, 245, 245, 0.25); }
.side-user { border-top: 1px solid var(--border); padding: 14px 8px 2px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a9aa8, #0d5a63);
  border: 1px solid #2ea8a8;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #bffcff;
}
.u-info { flex: 1; min-width: 0; }
.u-email { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-discord { font-size: 11px; color: var(--dim); }
.icon-btn {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  width: 32px; height: 32px; border-radius: var(--radius-s); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.icon-btn:hover { color: var(--red); border-color: var(--red); }
.icon-btn svg { width: 15px; height: 15px; }

.main { flex: 1; min-width: 0; padding: 26px 28px 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.topbar h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- cards & stats ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--border-2); }
.card h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.card .c-sub { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-grid .card { padding: 22px; }
.stat-grid .card:hover { transform: translateY(-2px); border-color: rgba(80,245,245,.3); }
.stat-label { color: var(--muted); font-size: 12.5px; margin-bottom: 9px; }
.stat-val { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; margin-top: 8px; }
.stat-delta.up { color: var(--green); background: var(--green-dim); }
.stat-delta.down { color: var(--red); background: var(--red-dim); }
.stat-delta.flat { color: var(--muted); background: #1c1c24; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 9px; }
.badge.aqua { color: var(--aqua); background: var(--aqua-dim); border: 1px solid rgba(80, 245, 245, 0.25); }
.badge.gold { color: var(--gold); background: var(--gold-dim); border: 1px solid rgba(217, 145, 57, 0.3); }
.badge.green { color: var(--green); background: var(--green-dim); }
.badge.red { color: var(--red); background: var(--red-dim); }
.badge.gray { color: var(--muted); background: #1c1c24; border: 1px solid var(--border); }

/* chart */
.chart-card svg { width: 100%; height: 210px; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------- build tab ---------- */
.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.dropzone {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-s);
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--aqua-2); background: rgba(80, 245, 245, 0.05); }
.dropzone b { color: var(--aqua); }
.src-editor {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  background: #0d111a;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: #cdd6e4;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  padding: 14px;
}
.opt-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid #1d1d25; }
.opt-row:last-of-type { border-bottom: 0; }
.opt-row input[type=checkbox] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--aqua-2); flex: none; }
.opt-name { font-weight: 600; font-size: 13.5px; }
.opt-desc { color: var(--dim); font-size: 12px; margin-top: 1px; }
.field label { display: block; color: var(--muted); font-size: 12.5px; margin: 12px 0 6px; }
.text-input, .sel {
  width: 100%;
  padding: 10px 12px;
  background: #0e131f;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.text-input:focus, .sel:focus { border-color: var(--aqua-2); }
.btn-block { width: 100%; margin-top: 16px; }
.result-card { margin-top: 16px; border-color: rgba(80, 245, 245, 0.3); }
.snippet {
  background: #0d111a;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #9fe8ea;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 10px 0;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-ghost:hover { background: #1a1a22; border-color: var(--border-2); }
.btn-ghost svg { width: 14px; height: 14px; }
.btn-ghost.danger:hover { color: var(--red); border-color: var(--red); }
.btn-ghost.small { padding: 5px 10px; font-size: 12px; }
.build-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid #1d1d25; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #15151c; }
.tbl .mono { font-family: var(--mono); font-size: 12px; color: var(--aqua); }
.tbl .dim { color: var(--dim); font-size: 12px; }
.tbl .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--dim); padding: 40px 10px; font-size: 13.5px; }

/* toast */
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a22;
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 99;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--red); color: #ffb2b2; }

/* steps editor (getkey) */
.step-row { display: grid; grid-template-columns: 26px 1fr 92px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.step-n { color: var(--dim); font-size: 12px; text-align: center; }
.step-row .text-input { padding: 8px 10px; font-size: 13px; }
.step-row input[type=number] { padding: 8px 10px; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    top: auto;
    z-index: 50;
    flex-direction: row;
    align-items: center;
    padding: 6px 8px;
    border-right: 0;
    border-top: 1px solid var(--border);
    background: rgba(14, 14, 19, 0.97);
    backdrop-filter: blur(8px);
  }
  .side-brand, .side-user { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; }
  .nav a { flex-direction: column; gap: 4px; font-size: 10.5px; padding: 7px 6px; flex: 1; text-align: center; }
  .nav a svg { width: 19px; height: 19px; }
  .main { padding: 20px 14px 110px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-val { font-size: 21px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
