/* Roblox Stats — thème « Studio Pro » (sombre). */
:root {
  --bg: #0a0d12;
  --bg-2: #0e1219;
  --panel: #121720;
  --panel-2: #181e29;
  --panel-3: #1f2633;
  --line: #222a37;
  --line-2: #2c3544;
  --text: #e8edf4;
  --text-2: #b4bfcd;
  --muted: #7d8999;
  --accent: #3ddc84;
  --accent-soft: rgba(61, 220, 132, .12);
  --on-accent: #052e16;
  --good: #3ddc84;
  --good-soft: rgba(61, 220, 132, .12);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .12);
  --bad: #ff5c7a;
  --bad-soft: rgba(255, 92, 122, .12);
  --s1: #3ddc84;
  --s2: #ffb547;
  --s3: #2dd4bf;
  --s4: #a594ff;
  --s5: #7d8999;
  --blue: #4cc2ff;
  --grid: #1a212c;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -12px rgba(0, 0, 0, .6);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(1200px 600px at 80% -200px, rgba(61, 220, 132, .06), transparent 60%), var(--bg); background-attachment: fixed; }
.hidden { display: none !important; }
#theme { display: none; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 9px; padding: 8px 14px; font-weight: 650; cursor: pointer; transition: filter .15s; }
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
button.ghost:hover { color: var(--text); border-color: var(--line-2); }
.small { font-size: 12px; }
select, input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; outline: none; }
select:focus, input:focus { border-color: var(--accent); }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1.2em; margin: 0; }
b, strong { font-weight: 650; }

/* ---------- connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px; width: min(380px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow); }
.login-box p { margin: -6px 0 4px; }
.login-box label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }

/* ---------- marque */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 15px; letter-spacing: -.01em; padding: 2px 4px; }
.logo { width: 20px; height: 20px; border-radius: 5px; background: var(--accent); transform: rotate(12deg); box-shadow: inset 0 0 0 6px var(--accent), inset 0 0 0 10px var(--bg-2); flex: none; }

/* ---------- structure */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.game-pick { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.game-pick img, .game-pick .ph { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--panel-3); display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.gp-text { min-width: 0; display: grid; }
.game-pick select { border: 0; padding: 0; background: transparent; font-weight: 650; font-size: 14px; width: 100%; cursor: pointer; text-overflow: ellipsis; }
.game-pick select option { background: var(--panel-2); }
.gl { font-size: 12px; color: var(--muted); }
.gl .on { color: var(--accent); font-weight: 600; }
.gl .on::before { content: "● "; }
nav { display: grid; gap: 2px; }
nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 4px; }
nav a { color: var(--text-2); padding: 8px 10px; border-radius: 9px; display: flex; gap: 10px; align-items: center; font-weight: 500; }
nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
nav a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
nav a svg { width: 16px; height: 16px; flex: none; opacity: .8; }
nav a.on svg { opacity: 1; color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
main { padding: 22px 28px 56px; min-width: 0; max-width: 1600px; }

/* ---------- en-tête */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; font-weight: 750; }
.subtitle { margin: 2px 0 0; color: var(--muted); max-width: 640px; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-l { color: var(--muted); font-size: 12px; padding: 0 8px 0 10px; }
.seg button { background: transparent; color: var(--muted); padding: 6px 11px; font-weight: 550; border-radius: 7px; }
.seg button.on { background: var(--panel-3); color: var(--text); }

/* bannière du jeu : miniature en fond */
.gamebar { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); margin-bottom: 14px; flex-wrap: wrap; min-height: 112px; }
.gamebar .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: saturate(1.1); }
.gamebar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 13, 18, .95) 0%, rgba(10, 13, 18, .7) 45%, rgba(10, 13, 18, .2) 100%); }
.gamebar > :not(.thumb) { position: relative; z-index: 1; }
.gamebar .icon { width: 64px; height: 64px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .12); object-fit: cover; background: var(--panel-3); }
.gamebar .t { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.gamebar .s { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.gamebar .big { margin-left: auto; text-align: right; }
.gamebar .big .v { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.gamebar .big .l { color: var(--text-2); font-size: 12px; margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.on { color: var(--accent); }
.status.on::before { background: var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); } 70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

/* « En bref » */
.brief { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.brief h2 { margin: 0 0 8px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.brief ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.brief li { position: relative; padding-left: 18px; color: var(--text-2); }
.brief li b { color: var(--text); }
.brief li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--s5); }
.brief li.good::before { background: var(--good); box-shadow: 0 0 8px rgba(61, 220, 132, .5); }
.brief li.bad::before { background: var(--bad); box-shadow: 0 0 8px rgba(255, 92, 122, .5); }
.brief li.warn::before { background: var(--warn); }

/* ---------- grilles et cartes */
.grid { display: grid; gap: 12px; margin-bottom: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); }
.card h3 { margin: 0; font-size: 13px; font-weight: 650; color: var(--text-2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 .r { color: var(--muted); font-weight: 500; font-size: 12px; }
.card .how { margin: 3px 0 12px; color: var(--muted); font-size: 12.5px; }
.kpi { position: relative; padding-bottom: 12px; }
.kpi .l { color: var(--muted); font-size: 12px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 750; letter-spacing: -.025em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.15; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kpi .cmp { font-size: 12px; margin-top: 4px; color: var(--muted); }
.kpi .cmp .up { color: var(--good); font-weight: 650; }
.kpi .cmp .down { color: var(--bad); font-weight: 650; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .spark { display: block; width: 100%; height: 34px; margin-top: 8px; }
.verdict { font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 6px; letter-spacing: 0; }
.verdict.good { color: var(--good); background: var(--good-soft); }
.verdict.ok { color: var(--warn); background: var(--warn-soft); }
.verdict.bad { color: var(--bad); background: var(--bad-soft); }
.chart { width: 100%; min-height: 230px; }
.empty { color: var(--muted); padding: 28px; text-align: center; }
.note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* aide « ? » */
.help { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); font-size: 10px; font-weight: 700; cursor: help; flex: none; }
.help:hover, .help:focus { border-color: var(--accent); color: var(--accent); outline: none; }
.help .tip { display: none; position: absolute; z-index: 20; top: 22px; left: -8px; width: 260px; padding: 10px 12px; background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; font-size: 12.5px; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.help:hover .tip, .help:focus .tip { display: block; }

/* ---------- tableaux */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 550; font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr:hover td { background: #151b25; }
.scroll { overflow-x: auto; }
.mono { font-family: var(--mono); font-size: 12px; }
pre.mono { white-space: pre-wrap; margin: 6px 0 0; }
details summary { cursor: pointer; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--panel-3); color: var(--text-2); }
.tag.server { color: var(--warn); background: var(--warn-soft); }
.tag.client { color: var(--blue); background: rgba(76, 194, 255, .1); }
.tag.ok { color: var(--accent); background: var(--accent-soft); }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 22px; }
.thumb-sm { width: 28px; height: 28px; border-radius: 7px; vertical-align: middle; margin-right: 8px; object-fit: cover; background: var(--panel-3); }

/* ---------- barres horizontales */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 120px 1fr 120px; gap: 10px; align-items: center; font-size: 13px; }
.bar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar .track, .bar .fill { display: block; }
.bar .track { height: 10px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--s4)); border-radius: 99px; }
.bar .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- parcours (funnel) */
.funnel .step { display: grid; grid-template-columns: 26px minmax(140px, 220px) 1fr 120px 150px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.funnel .step:last-child { border-bottom: 0; }
.funnel .head { color: var(--muted); font-size: 12px; }
.funnel .step .track, .funnel .step .fill { display: block; }
.funnel .step .track { height: 24px; background: var(--panel-3); border-radius: 7px; overflow: hidden; }
.funnel .step .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--s3)); border-radius: 7px; }
.funnel .step.worst .fill { background: linear-gradient(90deg, var(--bad), #ff8a5c); }
.funnel .step.worst { box-shadow: inset 3px 0 0 var(--bad); padding-left: 6px; }
.funnel .step.worst .lost { color: var(--bad); font-weight: 650; }
.funnel .step .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- cartes de chaleur */
.heat td.c { text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; }
.hgrid { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 11px; }
.hgrid .h { color: var(--muted); text-align: center; }
.hgrid .d { color: var(--muted); align-self: center; }
.hgrid .c { aspect-ratio: 1.6; border-radius: 4px; background: var(--panel-3); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters label { display: flex; gap: 6px; align-items: center; color: var(--text-2); }

/* ---------- uPlot */
.uplot { font-family: var(--font); }
.u-legend { color: var(--muted); font-size: 12px; }
.u-legend .u-series:first-child { display: none; }
.u-legend .u-marker { border-radius: 3px; }

/* ---------- mes jeux */
.gcards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.gcard { display: grid; gap: 14px; }
.gc-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; }
.gc-head img, .gc-head .ph { width: 48px; height: 48px; border-radius: 11px; object-fit: cover; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.gc-name { font-weight: 700; font-size: 15px; }
.gc-ccu { text-align: right; }
.gc-ccu .v { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.gc-ccu .l { font-size: 11px; color: var(--muted); }
.gc-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.gc-rows > div { display: grid; }
.gc-rows span { font-size: 12px; color: var(--muted); }
.gc-rows b { font-size: 18px; font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.gc-rows .cmp { font-size: 11.5px; color: var(--muted); }
.gc-rows .cmp .up { color: var(--good); font-weight: 650; }
.gc-rows .cmp .down { color: var(--bad); font-weight: 650; }
.gc-foot .spark { display: block; width: 100%; height: 36px; margin-top: 4px; }
.gc-open { font-weight: 600; font-size: 13px; }

/* ---------- accès */
.newpw p { margin: 4px 0; color: var(--text-2); }
.pwbox { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.pwbox code { font-family: var(--mono); font-size: 15px; background: var(--panel-3); border: 1px solid var(--line-2); padding: 8px 12px; border-radius: 8px; user-select: all; letter-spacing: .03em; }
#whoami { padding: 0 4px; }

@media (max-width: 1100px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, 1fr); }
  nav .sec { display: none; }
  main { padding: 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 90px 1fr 100px; }
  .funnel .step { grid-template-columns: 22px 1fr 90px; }
  .funnel .step .track, .funnel .step .hide-m { display: none; }
  .gamebar .big { margin-left: 0; text-align: left; width: 100%; }
  .hgrid { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .hgrid .h:nth-child(odd) { visibility: hidden; }
  .help .tip { left: auto; right: -8px; }
}
