:root {
  --bg: #070b12;
  --bg2: #0c1220;
  --panel: #111a2b;
  --panel2: #16233a;
  --border: #1e2c44;
  --text: #dde6f2;
  --muted: #7d8ca3;
  --accent: #00e676;
  --accent2: #00bcd4;
  --danger: #ff5252;
  --warn: #ffb300;
  --purple: #b388ff;
  --pink: #ff5c8a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
}

a { color: var(--accent2); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
.mono { font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace; }

/* ---------- auth ---------- */
#auth {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: url('/hero.jpg') center/cover no-repeat;
  position: relative;
}
#auth::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,11,18,.82) 0%, rgba(7,11,18,.92) 100%);
}
.auth-card {
  position: relative; z-index: 1;
  background: rgba(17,26,43,.9);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 34px;
  width: 100%; max-width: 420px;
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.auth-card h1 { font-size: 26px; margin-bottom: 4px; }
.auth-card .tag { color: var(--accent); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%; padding: 12px 13px; background: rgba(7,11,18,.7);
  border: 1px solid var(--border); border-radius: 9px; color: var(--text); font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,230,118,.12); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border: none; border-radius: 9px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: #06150c; transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent2); color: var(--accent2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.cyan { background: var(--accent2); color: #04222a; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.error { color: var(--danger); font-size: 13px; margin: 8px 0; min-height: 18px; }
.auth-switch { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.auth-switch a { cursor: pointer; }

/* ---------- layout ---------- */
#game { display: none; }
header.top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 14px 24px; background: rgba(12,18,32,.85);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.brand { font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.brand .logo { font-size: 24px; }
.brand span { color: var(--accent); }
.stats { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.stat { font-size: 12.5px; color: var(--muted); }
.stat b { color: var(--text); font-size: 15px; }
.stat.money b { color: var(--accent); }
.stat.rep b { color: var(--purple); }
.stat.ip b { color: var(--accent2); }

nav.tabs {
  display: flex; gap: 4px; padding: 0 24px; background: rgba(12,18,32,.85);
  border-bottom: 1px solid var(--border); overflow-x: auto; position: sticky; top: 62px; z-index: 9;
}
nav.tabs button {
  background: none; border: none; color: var(--muted); padding: 14px 16px; font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 7px;
}
nav.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
nav.tabs button:hover { color: var(--text); }

main { padding: 24px; max-width: 1480px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: minmax(0,2.4fr) minmax(300px,1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-bottom: 18px;
}
.card h2 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h2 .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: auto; }

/* ---------- avatars ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.1);
}
.avatar.lg { width: 52px; height: 52px; font-size: 28px; }

/* ---------- targets ---------- */
.target-list { display: flex; flex-direction: column; gap: 9px; }
.target {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px;
  transition: border-color .12s, transform .12s;
}
.target:hover { border-color: var(--accent2); transform: translateY(-1px); }
.target .icon { font-size: 26px; flex: 0 0 auto; }
.target .info { flex: 1; min-width: 0; }
.target .name { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.target .meta { font-size: 12px; color: var(--muted); }
.diff { color: var(--warn); }
.reward { color: var(--accent); }
.type-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; padding: 2px 7px; border-radius: 4px;
  background: var(--panel2); color: var(--muted);
}
.type-badge.player { color: var(--accent2); }
.trap { color: var(--danger); font-size: 12px; }
.online-dot { color: var(--accent); font-size: 11px; }

/* difficulty stars */
.stars { color: var(--warn); letter-spacing: 1px; font-size: 12px; }

/* ---------- hack panel ---------- */
.hack-panel { border: 1px solid var(--accent2); background: linear-gradient(180deg, rgba(0,188,212,.05), var(--panel)); }
.bar-wrap { margin: 10px 0 16px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.bar {
  height: 18px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--border); overflow: hidden; position: relative;
}
.bar .fill { height: 100%; width: 0%; transition: width .35s ease; }
.bar.breach .fill { background: linear-gradient(90deg, #00c853, var(--accent)); }
.bar.trace .fill { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.bar.trace.hot .fill { animation: pulse 0.6s infinite; }
@keyframes pulse { 50% { filter: brightness(1.5); } }
.hack-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.hack-result { margin-top: 12px; padding: 14px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--border); }
.hack-result .loot { color: var(--purple); font-style: italic; margin-top: 8px; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.files-panel { margin-bottom: 14px; }
.file-row { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; margin-bottom: 5px; }
.file-row .fi { font-size: 15px; }
.file-row .fn { flex: 1; font-family: 'SF Mono', Consolas, monospace; font-size: 12.5px; }
.file-row .fl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.file { background: #0a0f18; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.file .fn { font-family: 'SF Mono', Consolas, monospace; color: var(--accent2); font-size: 13px; margin-bottom: 4px; }
.file .fc { color: var(--muted); font-size: 13px; font-style: italic; }
.console {
  background: #05080f; border: 1px solid var(--border); border-radius: 9px;
  font-family: 'SF Mono', Consolas, monospace; font-size: 13px; padding: 14px;
  height: 260px; overflow-y: auto; margin-bottom: 16px; color: #9fe8c0;
}
.console .line { white-space: pre-wrap; }
.console .line.dim { color: #4a5a6e; }
.console .cursor::after { content: '▋'; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- inventory ---------- */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.inv-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 11px; padding: 15px;
  display: flex; flex-direction: column; gap: 6px; transition: border-color .12s;
}
.inv-card:hover { border-color: var(--accent); }
.inv-card .top { display: flex; align-items: center; gap: 9px; }
.inv-card .ic { font-size: 24px; }
.inv-card .nm { font-weight: 600; }
.inv-card .tier { font-size: 10px; color: var(--warn); letter-spacing: 1px; }
.inv-card .ds { font-size: 12px; color: var(--muted); }

/* ---------- software store ---------- */
.sw-group { margin-bottom: 20px; }
.sw-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sw-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 11px; padding: 14px;
  display: flex; flex-direction: column; gap: 7px;
}
.sw-card.owned { border-color: var(--accent); }
.sw-card .top { display: flex; align-items: center; gap: 9px; }
.sw-card .ic { font-size: 24px; }
.sw-card .nm { font-weight: 600; }
.sw-card .ds { font-size: 12px; color: var(--muted); flex: 1; }
.sw-card .pr { color: var(--accent); font-weight: 700; }

/* ---------- botnet ---------- */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 11px; }
.bot-cell {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 11px; padding: 15px; text-align: center;
}
.bot-cell .ic { font-size: 24px; }
.bot-cell .n { font-size: 26px; font-weight: 700; color: var(--accent); }
.bot-cell .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.c2-bar { height: 11px; border-radius: 6px; background: var(--bg2); overflow: hidden; margin-top: 6px; border: 1px solid var(--border); }
.c2-bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); }

/* ---------- logs / activity ---------- */
.logs { font-family: 'SF Mono', Consolas, monospace; font-size: 12.5px; display: flex; flex-direction: column; gap: 5px; }
.log-line { color: var(--muted); border-left: 2px solid var(--border); padding-left: 9px; }
.log-line .ts { color: #4a5a6e; margin-right: 6px; }
.activity { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.activity .item {
  padding: 9px 11px; background: var(--bg2); border-radius: 8px; border: 1px solid var(--border);
  display: flex; gap: 8px; align-items: baseline;
}
.activity .item .t { color: #4a5a6e; font-size: 11px; flex: 0 0 auto; }

/* ---------- leaderboard ---------- */
.lb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lb-table th, .lb-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.lb-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.lb-table .rank { color: var(--accent2); font-weight: 700; width: 40px; }
.lb-table .who { display: flex; align-items: center; gap: 8px; }

/* ---------- misc ---------- */
.toast-wrap { position: fixed; bottom: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  padding: 12px 15px; border-radius: 9px; font-size: 13px; max-width: 340px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: slidein .2s ease;
}
.toast.bad { border-left-color: var(--danger); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
h2.section { font-size: 19px; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.news-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-item .h { font-weight: 600; }
.news-item .b { font-size: 13px; color: var(--muted); }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
