:root {
  --bg: #f4f5f7;
  --card: rgba(255, 255, 255, 0.84);
  --line: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #111827;
  --accent: #2563eb;
  --safe: #16a34a;
  --suspect: #d97706;
  --danger: #dc2626;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 45%, #e8edf5 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
input, textarea, button { font: inherit; }

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(28px);
  opacity: .45;
  pointer-events: none;
}
.orb-1 { width: 280px; height: 280px; background: #dbeafe; top: -60px; right: -40px; }
.orb-2 { width: 220px; height: 220px; background: #e2e8f0; bottom: 80px; left: -60px; }

.topbar, .shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 32px 0 18px;
}
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 8px 0 0; font-size: clamp(30px, 5vw, 52px); line-height: 1; }
h2 { margin: 0; font-size: 18px; }

.shell { padding-bottom: 48px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 20px;
}
.leaderboard-section { margin-top: 28px; }
.panel-head, .row, .profile, .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head { margin-bottom: 16px; }
.stack { display: grid; gap: 12px; }
.cta-inline, .filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  color: var(--text);
  border-radius: 18px;
  padding: 12px 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: rgba(37, 99, 235, .35); box-shadow: 0 0 0 4px rgba(37, 99, 235, .08); }
.row > label { flex: 1; }
.primary-btn, .secondary-btn, .ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.primary-btn:disabled, .secondary-btn:disabled, .ghost-btn:disabled, .filter-btn:disabled, .icon-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.primary-btn, .secondary-btn:hover, .ghost-btn:hover, .filter-btn:hover, .icon-btn:hover {
  transform: translateY(-1px);
}
.primary-btn { background: var(--primary); color: #fff; }
.secondary-btn, .ghost-btn {
  background: rgba(255,255,255,.74);
  border: 1px solid var(--line);
  color: var(--text);
}
.filter-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}
.filter-btn.active {
  background: var(--primary);
  color: #fff;
}
.hint, .muted { color: var(--muted); font-size: 13px; }
.empty {
  border: 1px dashed rgba(100,116,139,.35);
  border-radius: 20px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
.hidden { display: none !important; }
.profile { justify-content: flex-start; margin-bottom: 16px; }
.profile img {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}
.big { font-size: 22px; font-weight: 700; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  margin-top: 8px;
}
.badge.safe { background: var(--safe); }
.badge.suspect { background: var(--suspect); }
.badge.danger { background: var(--danger); }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.metric {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
}
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.metric strong { font-size: 18px; }
.records, .announcement-list, .leaderboard {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.record, .announcement {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
}
.record .top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.record .meta, .announcement .meta { color: var(--muted); font-size: 12px; }
.announcement .title { font-weight: 700; margin-bottom: 6px; }
.leaderboard-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
}
.rank-chip {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #334155);
  color: #fff;
  font-weight: 700;
}
.leaderboard-main strong { display: block; font-size: 16px; margin-bottom: 4px; }
.leaderboard-side { text-align: right; }
.leaderboard-side strong { display: block; font-size: 24px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(8px);
  z-index: 40;
}
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
.modal-card {
  width: min(640px, 100%);
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.icon-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .grid, .metrics, .row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .leaderboard-item { grid-template-columns: 1fr; }
  .leaderboard-side { text-align: left; }
}
