:root {
  --bg: #0e1022;
  --card: rgba(255, 255, 255, 0.055);
  --card2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f2f4fb;
  --muted: #a6adc5;
  --accent: #7aa5ff;
  --green: #4ade80;
  --yellow: #facc15;
  --orange: #fb923c;
  --red: #f87171;
  --purple: #c084fc;
}

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

body {
  background:
    radial-gradient(800px 500px at 10% 0%, rgba(99, 102, 241, 0.35), transparent 55%),
    radial-gradient(700px 450px at 90% 10%, rgba(168, 85, 247, 0.28), transparent 55%),
    radial-gradient(700px 500px at 50% 100%, rgba(14, 165, 233, 0.18), transparent 60%),
    linear-gradient(180deg, #0c0e1e, #131530);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { font-size: 18px; font-weight: 700; white-space: nowrap; }
.logo span { color: var(--accent); }
.search { display: flex; flex: 1; max-width: 560px; gap: 8px; }
.search input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: #7c84a3; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(122, 165, 255, 0.15); }
.search button {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.search button:hover { filter: brightness(1.12); }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px 16px 20px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 800px) { .row { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.row .card { margin-bottom: 0; }
.card h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hidden { display: none !important; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 70px 0 50px; }
.hero h1 { font-size: 30px; line-height: 1.25; margin-bottom: 14px; }
.hero p { color: var(--muted); max-width: 540px; margin: 0 auto 6px; line-height: 1.5; font-size: 14px; }
.hero .example { color: var(--accent); }

/* ---------- loading / error ---------- */
.loading { text-align: center; padding: 70px 0; color: var(--muted); font-size: 14px; }
.spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  backdrop-filter: blur(18px);
  border-radius: 16px;
  padding: 14px 18px;
  color: var(--red);
  font-size: 14px;
}

/* ---------- profile ---------- */
.profile-card { display: flex; gap: 14px; align-items: center; }
.profile-card img {
  width: 74px; height: 74px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.profile-card .name { font-size: 20px; font-weight: 700; }
.profile-card .sub { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.5; }
.profile-card .links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.profile-card .links a { color: var(--accent); font-size: 12px; text-decoration: none; }
.profile-card .links a:hover { text-decoration: underline; }

/* ---------- verdict ---------- */
.verdict-card { display: flex; gap: 18px; align-items: center; }
.gauge { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.gauge svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.gauge svg circle:first-child { stroke: rgba(255, 255, 255, 0.12); }
.gauge .num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 25px; font-weight: 800;
  line-height: 1;
}
.gauge .num small { font-size: 9px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.verdict-label { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.verdict-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.lv-clean { color: var(--green); }
.lv-questionable { color: var(--yellow); }
.lv-suspicious { color: var(--orange); }
.lv-cheater { color: var(--red); }
.lv-banned { color: var(--red); }

/* ---------- reasons ---------- */
.reason {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}
.reason:last-child { border-bottom: none; padding-bottom: 0; }
.reason:first-of-type { padding-top: 0; }
.reason .pts {
  min-width: 36px;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
  font-size: 13px;
}
.reason .pts.p-high { color: var(--red); }
.reason .pts.p-mid { color: var(--orange); }
.reason .pts.p-low { color: var(--yellow); }
.reason .title { font-weight: 600; }
.reason .detail { color: var(--muted); font-size: 12px; }
.reason-empty { color: var(--green); font-size: 13px; }

/* ---------- stat grid ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 12px; }
.stat .v { font-size: 17px; font-weight: 700; line-height: 1.2; }
.stat .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-top: 1px; }
.v.good { color: var(--green); }
.v.warn { color: var(--yellow); }
.v.bad { color: var(--red); }
.v.hot { color: var(--orange); }
.v.epic { color: var(--purple); }

/* ---------- chart ---------- */
.chart-note { color: var(--muted); font-size: 11px; margin-top: 6px; }

/* ---------- teammates ---------- */
.mates { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 8px; }
.mate {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px 8px;
  transition: background 0.15s, border-color 0.15s;
}
.mate:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.2); }
.mate img { width: 28px; height: 28px; border-radius: 8px; }
.mate .mn { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mate .mm { font-size: 10px; color: var(--muted); }
.mate.banned { border-color: rgba(248, 113, 113, 0.5); }
.mate.banned .mn { color: var(--red); }

.badge {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  text-transform: uppercase;
}
.badge.ok { background: rgba(74, 222, 128, 0.12); color: var(--green); }

/* ---------- minicharts ---------- */
.minicharts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
@media (max-width: 700px) { .minicharts { grid-template-columns: 1fr; } }
.minichart h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.minichart svg { width: 100%; height: 80px; display: block; }
.minichart.wide svg { height: 120px; }
.minichart.wide { margin-bottom: 2px; }

/* ---------- lobby ---------- */
.lobby-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
}
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pcard { display: flex; align-items: center; gap: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.pcard:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.09); }
.pcard .pava { width: 46px; height: 46px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); }
.pcard .pmid { flex: 1; min-width: 0; }
.pcard .pname { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .plabel { font-size: 12px; font-weight: 600; }
.pcard .pstats { font-size: 11px; color: var(--muted); margin-top: 1px; }
.pcard .pscore { font-size: 24px; font-weight: 800; flex-shrink: 0; }

/* ---------- recent chips ---------- */
#recent { margin-top: 26px; }
.recent-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); }
.chip img { width: 22px; height: 22px; border-radius: 50%; }
.chip b { font-weight: 800; }

.keyhint {
  color: var(--muted); font-size: 11px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 8px;
  line-height: 1.5;
}
.keyhint code { color: var(--accent); }
