/* SCUM dashboard — modern dark-glass design (inspired by rust-control-center).
   Token-based, accent glows, glassmorphism, display font. */
:root {
  --bg: #080b09;
  --panel: rgba(18, 24, 20, 0.72);
  --panel-solid: #121814;
  --panel2: rgba(26, 34, 28, 0.7);
  --line: #28332b;
  --line-soft: rgba(255, 255, 255, 0.06);
  --txt: #e9f1eb;
  --muted: #8ba197;
  --acc: #43d17a;
  --acc-strong: #7bedab;
  --acc-soft: rgba(67, 209, 122, 0.14);
  --glow: rgba(67, 209, 122, 0.22);
  --amber: #f1b24a;
  --red: #ff5a52;
  --green: #43d17a;
  --radius: 16px;
  --font: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--txt);
  background:
    radial-gradient(circle at 0% 0%, var(--glow), transparent 42%),
    radial-gradient(circle at 100% 8%, var(--acc-soft), transparent 40%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3, .brand, .big, .sb-brand, .nav .brand { font-family: var(--font); letter-spacing: 0.01em; }
a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--acc-strong); text-decoration: none; }

/* ── Top nav (public) ── */
.nav {
  display: flex; align-items: center; gap: 20px; padding: 14px 26px;
  background: linear-gradient(180deg, rgba(18,24,20,0.92), rgba(10,14,11,0.82));
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.nav a { color: var(--muted); font-weight: 600; font-size: 14px; transition: color .15s; }
.nav a.active, .nav a:hover { color: var(--txt); }
.nav .brand { color: var(--txt); font-weight: 700; font-size: 20px; text-shadow: 0 0 18px var(--glow); }
.nav .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; color: var(--txt); font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 2px var(--acc-soft); }
.badge, .pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px;
  background: var(--acc-soft); color: var(--acc-strong); border: 1px solid rgba(67,209,122,0.25);
}
.badge { background: var(--panel2); color: var(--muted); border-color: var(--line); }
.inline { display: inline; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 30px 24px; }
.foot { text-align: center; color: var(--muted); padding: 36px; font-size: 13px; }
h1 { margin: 0 0 20px; font-size: 30px; font-weight: 700; }
h2 { font-size: 19px; margin: 0 0 14px; font-weight: 600; }

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 40px 34px; margin-bottom: 26px;
  background:
    radial-gradient(circle at 12% 0%, var(--glow), transparent 38%),
    radial-gradient(circle at 88% 110%, var(--acc-soft), transparent 42%),
    linear-gradient(150deg, rgba(18,24,20,0.95), rgba(8,11,9,0.96));
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.hero h1 { font-size: 38px; margin-bottom: 8px; }
.hero .sub { color: var(--muted); font-size: 16px; }
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ── Cards ── */
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cols3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.card {
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 14px 30px rgba(0,0,0,0.28);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card:hover { border-color: rgba(67,209,122,0.28); }
.cards .card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,0.4), 0 0 24px var(--acc-soft); }
.card .big { font-size: 30px; font-weight: 700; color: var(--txt); line-height: 1.1; }
.card .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin-bottom: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px currentColor; }
.dot.on { background: var(--green); color: var(--green); }
.dot.off { background: var(--red); color: var(--red); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: rgba(67,209,122,0.04); }

/* ── Buttons ── */
.btn {
  background: linear-gradient(180deg, var(--acc), #2fa85f); color: #052012; border: 0; border-radius: 10px;
  padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--font);
  letter-spacing: .02em; box-shadow: 0 6px 18px rgba(67,209,122,0.22); transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.small { padding: 6px 12px; font-size: 13px; box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); box-shadow: none; }
.btn.ghost:hover { border-color: var(--acc); color: var(--acc-strong); }
.btn.danger { background: linear-gradient(180deg, var(--red), #b3322c); color: #fff; box-shadow: 0 6px 18px rgba(255,90,82,0.22); }
.btn.steam { background: linear-gradient(180deg, #2a475e, #1b2838); color: #fff; box-shadow: none; }
.btn.discord { background: linear-gradient(180deg, #5865f2, #4350c8); color: #fff; box-shadow: 0 6px 18px rgba(88,101,242,0.28); }

/* ── Forms ── */
input, select, textarea {
  background: rgba(8,11,9,0.6); border: 1px solid var(--line); color: var(--txt); border-radius: 10px;
  padding: 10px 12px; font: inherit; width: 100%; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
.muted { color: var(--muted); }
.center { text-align: center; }
code { background: rgba(8,11,9,0.6); padding: 2px 6px; border-radius: 6px; font-size: 13px; color: var(--acc-strong); }

.login-box { max-width: 400px; margin: 70px auto; text-align: center; }
.login-box .btn { display: block; margin: 12px 0; padding: 14px; font-size: 15px; }

/* ── Admin sidebar ── */
body.admin { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: 0 0 240px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(18,24,20,0.95), rgba(10,14,11,0.92));
  border-right: 1px solid var(--line); backdrop-filter: blur(12px);
}
.sb-brand { font-weight: 700; font-size: 18px; padding: 20px; border-bottom: 1px solid var(--line); text-shadow: 0 0 16px var(--glow); }
.sb-nav { display: flex; flex-direction: column; padding: 12px 10px; flex: 1; overflow-y: auto; gap: 2px; }
.sb-group { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); opacity: .6; padding: 14px 14px 5px; }
.sb-nav a { color: var(--muted); padding: 10px 14px; font-size: 14px; font-weight: 600; border-radius: 10px; transition: all .15s; }
.sb-nav a:hover { color: var(--txt); background: var(--panel2); }
.sb-nav a.active { color: var(--acc-strong); background: var(--acc-soft); box-shadow: inset 3px 0 0 var(--acc); }
.sb-foot { padding: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.admin-main { flex: 1; padding: 30px 34px; overflow-x: hidden; }

/* ── Map ── */
#leaflet-map { height: 76vh; border: 1px solid var(--line); border-radius: var(--radius); background: #060a07; box-shadow: 0 14px 36px rgba(0,0,0,0.4); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-solid); color: var(--txt); border: 1px solid var(--line); }
.leaflet-popup-content { color: var(--txt); font-weight: 600; }
.leaflet-container .leaflet-tooltip { background: rgba(8,11,9,0.85); color: var(--txt); border: 1px solid var(--line); }
.map-toolbar { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.map-toolbar label { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--txt); cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 14px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }
.stub { padding: 50px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ── Animated counters ── */
.count-up { font-variant-numeric: tabular-nums; }

/* ── Theme presets (switchable, like rust-control-center) ── */
[data-theme="ember"] { --acc: #ff6b4a; --acc-strong: #ffac8a; --acc-soft: rgba(255,107,74,0.15); --glow: rgba(255,107,74,0.24); }
[data-theme="ocean"] { --acc: #42a5ff; --acc-strong: #8fcaff; --acc-soft: rgba(66,165,255,0.15); --glow: rgba(66,165,255,0.24); }
[data-theme="toxic"] { --acc: #b6f441; --acc-strong: #d4ff85; --acc-soft: rgba(182,244,65,0.15); --glow: rgba(182,244,65,0.22); }
[data-theme="amber"] { --acc: #f1b24a; --acc-strong: #ffd488; --acc-soft: rgba(241,178,74,0.15); --glow: rgba(241,178,74,0.24); }
[data-theme="violet"] { --acc: #a87bff; --acc-strong: #c9adff; --acc-soft: rgba(168,123,255,0.16); --glow: rgba(168,123,255,0.26); }

.theme-select {
  background: rgba(8,11,9,0.6); border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; width: auto; min-width: 0; cursor: pointer;
}

/* ── Player profile modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2,4,3,0.7); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; border-radius: 22px; padding: 0;
  background:
    radial-gradient(circle at 18% 0%, var(--glow), transparent 38%),
    linear-gradient(150deg, rgba(18,24,20,0.98), rgba(8,11,9,0.99));
  border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: modal-in 180ms ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-hero { padding: 24px 26px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-hero h2 { font-size: 24px; margin: 0; }
.modal-close { background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-body { padding: 22px 26px; }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.insight {
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), rgba(8,11,9,0.5);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.insight .v { font-family: var(--font); font-size: 22px; font-weight: 700; }
.insight .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.story { margin-top: 16px; display: grid; gap: 8px; }
.story-row { display: flex; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,11,9,0.4); }
.story-row .k { color: var(--muted); }

/* ── Top-3 podium ── */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 26px; }
.podium-card {
  position: relative; overflow: hidden; border-radius: 18px; padding: 22px 18px; text-align: center;
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.012)), var(--panel);
  border: 1px solid var(--line); box-shadow: 0 16px 36px rgba(0,0,0,0.34);
}
.podium-card .rank { font-family: var(--font); font-size: 34px; font-weight: 700; line-height: 1; }
.podium-card .pname { font-weight: 700; font-size: 17px; margin: 8px 0 2px; }
.podium-card .pval { color: var(--muted); font-size: 14px; }
.podium-card.p1 { border-color: rgba(241,201,72,0.5); box-shadow: 0 20px 44px rgba(0,0,0,0.4), 0 0 36px rgba(241,201,72,0.14); padding-top: 30px; }
.podium-card.p1 .rank { color: #f1c948; text-shadow: 0 0 22px rgba(241,201,72,0.5); }
.podium-card.p2 .rank { color: #cfd6dd; }
.podium-card.p3 .rank { color: #d8915a; }
.podium-card .glow { position: absolute; inset: -40% 30% auto; height: 120px; background: radial-gradient(circle, var(--glow), transparent 70%); opacity: .5; }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } }

/* ── Leaderboard rows with bars ── */
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.lb-rank { width: 22px; text-align: center; font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.lb-bar { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--acc), transparent); margin-top: 2px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; }
.section-title .line { flex: 1; height: 1px; background: var(--line); }

/* ── Live feed ── */
.feed { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(8,11,9,0.35); font-size: 14px; }
.feed-item .ico { font-size: 16px; }
.feed-item .t { color: var(--muted); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }
