/* ═══════════════════════════════════════════════════════════════
   DARKNET WEB PANEL — LAYOUT
   Setup, Panel, Topbar, Sidebar, Main shell
   ═══════════════════════════════════════════════════════════════ */

/* ─── Ambient Background Orbs ─── */
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  animation: orb 12s ease-in-out infinite;
}
.o1 {
  width: 500px; height: 500px;
  background: radial-gradient(ellipse, rgba(255,45,120,.12), transparent 70%);
  top: -150px; left: -150px;
}
.o2 {
  width: 350px; height: 350px;
  background: radial-gradient(ellipse, rgba(217,70,239,.09), transparent 70%);
  bottom: -100px; right: -80px;
  animation-delay: -4s;
}
.o3 {
  width: 250px; height: 250px;
  background: radial-gradient(ellipse, rgba(147,51,234,.07), transparent 70%);
  top: 40%; left: 60%;
  animation-delay: -7s;
}

/* ─── SETUP SCREEN ─── */
#setup {
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: 24px;
  padding: max(24px, env(safe-area-inset-top, 24px)) 24px max(24px, env(safe-area-inset-bottom, 24px));
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 25% 20%, rgba(255,45,120,.09), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(217,70,239,.07), transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(147,51,234,.05), transparent 40%),
    var(--bg);
}
#setup::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,45,120,.018) 2px, rgba(255,45,120,.018) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,45,120,.012) 40px, rgba(255,45,120,.012) 41px);
  pointer-events: none;
  z-index: 0;
  animation: gridFlicker 8s infinite;
}

.setup-card {
  background: linear-gradient(160deg, rgba(18,0,34,.97), rgba(10,0,22,.98));
  border: 1px solid var(--border2);
  border-radius: 28px;
  padding: 44px 48px 40px;
  width: 100%;
  max-width: 480px;
  box-shadow:
    0 0 0 1px rgba(255,45,120,.07),
    0 60px 120px rgba(0,0,0,.9),
    inset 0 1px 0 rgba(255,45,120,.1),
    var(--glow-lg);
  animation: fadeUp 0.7s var(--ease);
  position: relative;
  overflow: hidden;
  z-index: 2;
}
.setup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff2d78, #ff6b9d, #d946ef, #9333ea, #d946ef, #ff2d78);
  background-size: 300%;
  animation: shimmer 2.5s linear infinite;
  border-radius: 28px 28px 0 0;
}
.setup-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoPulse 6s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
}

/* Cat stage */
.cat-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 180px;
  margin-bottom: 24px;
  position: relative;
}
.cat-sh {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 96px; height: 14px;
  background: rgba(255,45,120,.22);
  border-radius: 50%;
  filter: blur(10px);
  animation: catShadow 1.4s ease-in-out infinite;
}
.cat-wrap {
  animation: catBounce 1.4s cubic-bezier(.36,.07,.19,.97) infinite;
  cursor: pointer;
  position: relative;
}
.cat-wrap:hover .cat-svg {
  filter: drop-shadow(0 0 32px rgba(255,45,120,.9)) drop-shadow(0 0 60px rgba(217,70,239,.5));
}
.cat-svg {
  width: 152px; height: 152px;
  filter: drop-shadow(0 0 20px rgba(255,45,120,.55)) drop-shadow(0 0 45px rgba(255,45,120,.25));
}

/* Setup card particles */
.cp {
  position: absolute;
  border-radius: 50%;
  animation: particle var(--dur, 2s) ease-out infinite;
  animation-delay: var(--del, 0s);
}

/* Setup typography */
.setup-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--gold2);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', sans-serif;
}
.setup-eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 2px;
}

.setup-h {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  line-height: 1.1;
  font-family: 'Orbitron', sans-serif;
}

.setup-sub {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 28px;
  line-height: 1.7;
}

.s-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dim);
  font-family: 'Orbitron', sans-serif;
}

/* ─── PANEL SHELL ─── */
#panel { display: none; height: 100vh; height: 100dvh; flex-direction: column; }
#panel.open { display: flex; }

/* ─── TOPBAR ─── */
.tb {
  background: linear-gradient(90deg, rgba(12,0,24,1), rgba(18,0,36,1));
  border-bottom: 1px solid var(--border);
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  padding-left: max(18px, env(safe-area-inset-left, 18px));
  padding-right: max(18px, env(safe-area-inset-right, 18px));
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  overflow: hidden;
}
.tb::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,45,120,.9), rgba(217,70,239,.7), transparent);
}

.tb-dots { display: flex; gap: 7px; }
.td {
  width: 13px; height: 13px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.18s;
}
.td:hover { filter: brightness(1.4); transform: scale(1.15); }
.td-r { background: #ff5f57; box-shadow: 0 0 6px rgba(255,95,87,.5); }
.td-y { background: #febc2e; box-shadow: 0 0 6px rgba(254,188,46,.4); }
.td-g { background: #28c840; box-shadow: 0 0 6px rgba(40,200,64,.4); }

.tb-logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-family: 'Orbitron', sans-serif;
  white-space: nowrap;
}

.tb-pills { display: flex; gap: 5px; margin-right: auto; }
.pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  font-family: 'Orbitron', sans-serif;
}
.p-t  { background: rgba(255,45,120,.15); color: var(--gold2); border: 1px solid rgba(255,45,120,.25); }
.p-on { background: rgba(0,229,160,.1);   color: var(--mint);  border: 1px solid rgba(0,229,160,.2); }
.p-off{ background: rgba(255,69,96,.09);  color: var(--rose);  border: 1px solid rgba(255,69,96,.2); }

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: statusBlink 2s infinite;
}

.tb-btn {
  height: 30px;
  padding: 0 10px;
  background: rgba(255,45,120,.1);
  border: 1px solid rgba(255,45,120,.28);
  border-radius: 8px;
  color: #d090b8;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  white-space: nowrap;
  gap: 4px;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.5px;
}
.tb-btn:hover {
  color: var(--text);
  border-color: var(--border2);
  background: rgba(255,45,120,.14);
  box-shadow: var(--glow-sm);
}

/* ─── BODY SHELL ─── */
.body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sb {
  width: 280px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0e0020, #06000f);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s var(--ease);
  position: relative;
}
.sb::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,45,120,.6), rgba(217,70,239,.4), transparent);
  pointer-events: none;
}

.sb-search {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-sbox {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,45,120,.05);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sb-sbox:focus-within {
  border-color: var(--gold);
  box-shadow: var(--glow-sm);
}
.sb-sbox input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 13px;
}
.sb-sbox input::placeholder { color: var(--dim); }

.sb-filters {
  display: flex;
  gap: 5px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sbf {
  flex: 1;
  padding: 7px 4px;
  background: rgba(255,45,120,.07);
  border: 1px solid rgba(255,45,120,.25);
  border-radius: 9px;
  color: #c07090;
  font-family: 'Exo 2', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.sbf.fa   { background: var(--gold-dim); border-color: rgba(255,45,120,.35); color: var(--gold2); }
.sbf.fon  { background: rgba(0,229,160,.1); border-color: rgba(0,229,160,.3); color: var(--mint); }
.sbf.foff { background: rgba(255,69,96,.08); border-color: rgba(255,69,96,.22); color: var(--rose); }
.sbf.fpin { background: rgba(192,132,252,.09); border-color: rgba(192,132,252,.25); color: var(--lilac); }

.sb-list { flex: 1; overflow-y: auto; }

.sec-sep {
  padding: 9px 14px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 1;
  font-family: 'Orbitron', sans-serif;
}
.sec-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.sec-sep.on-sep { color: var(--mint); }

.dev-item {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,45,120,.04);
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
}
.dev-item.is-new { animation: connNew 0.4s var(--ease); }
.dev-item:hover { background: rgba(255,45,120,.05); }
.dev-item.sel {
  background: rgba(255,45,120,.09);
  border-left: 3px solid var(--gold);
}
.dev-item.sel .dev-n { color: var(--gold2); }

.dev-av {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bg4), var(--bg5));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  position: relative;
}
.av-badge {
  position: absolute;
  bottom: -3px; right: -3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg2);
}

.dev-meta { flex: 1; min-width: 0; }
.dev-n {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dev-i {
  font-size: 10px;
  color: #8a6080;
  font-family: 'Share Tech Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.dev-note {
  font-size: 9px;
  color: var(--gold);
  background: rgba(255,45,120,.08);
  border: 1px solid rgba(255,45,120,.18);
  border-radius: 5px;
  padding: 1px 6px;
  margin-top: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.dev-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.dev-batt {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: 'Share Tech Mono', monospace;
}
.new-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255,45,120,.18);
  color: var(--gold2);
}

.sb-footer {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.sfbtn {
  flex: 1;
  padding: 9px 4px;
  background: rgba(255,45,120,.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--sub);
  font-family: 'Exo 2', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.sfbtn:hover {
  color: var(--text);
  border-color: rgba(255,45,120,.35);
  background: rgba(255,45,120,.12);
}
.sfbtn.del:hover {
  color: var(--rose);
  border-color: rgba(255,69,96,.35);
  background: rgba(255,69,96,.08);
}

.sb-brand {
  text-align: center;
  padding: 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dim);
  font-family: 'Orbitron', sans-serif;
}

/* ─── SIDEBAR COLLAPSE ─── */
.sb-collapsed .sb { width: 50px !important; }
.sb-collapsed .dev-meta,
.sb-collapsed .dev-right,
.sb-collapsed .sb-search,
.sb-collapsed .sb-filters,
.sb-collapsed .sb-footer,
.sb-collapsed .sb-brand { display: none !important; }
.sb-collapsed .dev-item { padding: 9px; justify-content: center; }

/* ─── MAIN AREA ─── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── TABS ─── */
.tabs {
  display: flex;
  padding: 0 18px;
  background: linear-gradient(90deg, rgba(8,0,18,.98), rgba(12,0,28,.98));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 2px;
  overflow-x: auto;
}
.tabs::-webkit-scrollbar { height: 0; }

.tab {
  padding: 15px 16px;
  font-size: 11px;
  font-weight: 600;
  color: #a06080;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: 0.5px;
  font-family: 'Orbitron', sans-serif;
}
.tab:hover { color: var(--gold3); background: rgba(255,45,120,.06); }
.tab.active {
  color: var(--gold2);
  border-bottom-color: var(--gold);
  background: rgba(255,45,120,.08);
  text-shadow: 0 0 12px rgba(255,45,120,.5);
}

/* ─── TAB BODY ─── */
.tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom, 22px));
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.pane { display: none; }
.pane.active { display: block; animation: fadeUp 0.22s ease; }

/* ─── Font size modifiers ─── */
.fsz-sm .msg-txt, .fsz-sm .am-txt { font-size: 11px !important; }
.fsz-lg .msg-txt, .fsz-lg .am-txt { font-size: 17px !important; }
