/* WASP-ESPORT Analytics — thème issu de la charte graphique WASP (wasp-esport-docs/charte). */
@font-face { font-family: "Poppins"; font-weight: 300; font-display: swap; src: url("vendor/poppins-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("vendor/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("vendor/poppins-latin-700-normal.woff2") format("woff2"); }
/* Lovelo (titres P1) : ajoutée dès réception du fichier et de sa licence ; repli sur Poppins Bold en capitales. */

:root {
  --anthracite: #1c1c1c;   /* fond */
  --nuit: #0f033a;         /* surfaces */
  --blanc: #e5e5e5;        /* texte */
  --jaune: #ffd300;        /* accent principal */
  --jaune-clair: #ffe87b;
  --violet: #9666ff;       /* texte secondaire (4,6:1) */
  --violet-profond: #3b0783; /* fonds et bordures uniquement */
  --muted: #a9a4c2;
  --danger: #ff7a7a;
  --ok: #7be0a6;
  --radius: 14px;
  --gap: 16px;
  --font: "Poppins", system-ui, sans-serif;
  --font-title: "Lovelo", "Poppins", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--anthracite);
  /* motif hexagonal discret (charte : « présence subtile ») */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%233b0783' stroke-opacity='.35' stroke-width='1'/%3E%3C/svg%3E");
  color: var(--blanc); font-family: var(--font); font-weight: 300; font-size: 16px; line-height: 1.5;
}
a { color: var(--jaune-clair); }
a:hover { color: var(--jaune); }
:focus-visible { outline: 2px solid var(--jaune); outline-offset: 2px; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 24px;
  background: linear-gradient(100deg, rgba(255, 211, 0, .16), rgba(59, 7, 131, .55) 45%, var(--nuit));
  border-bottom: 1px solid var(--violet-profond);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px);
}
.brand { font-family: var(--font-title); font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; color: var(--jaune); text-decoration: none; }
.brand span { color: var(--blanc); margin-left: .3em; }
.brand small { font-family: var(--font); font-weight: 300; letter-spacing: 0; color: var(--blanc); font-size: .8rem; margin-left: .4em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { color: var(--blanc); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 400; }
.nav a:hover { background: rgba(150, 102, 255, .18); color: var(--blanc); }
.session { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.session .button { padding: 6px 14px; }
.nav a[aria-current="page"] { background: var(--jaune); color: var(--anthracite); font-weight: 700; }

.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }
.hero h1, .login h1 { font-family: var(--font-title); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 4px; }
.hero p { margin: 0 0 16px; color: var(--muted); }
h2 { font-weight: 700; font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-weight: 700; font-size: 1rem; margin: 0; }
h3 a { color: var(--blanc); text-decoration: none; }

.grid { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.card {
  background: rgba(15, 3, 58, .86); border: 1px solid rgba(150, 102, 255, .25); border-radius: var(--radius);
  padding: 18px; margin-bottom: var(--gap); backdrop-filter: blur(6px); min-width: 0;
}
.grid > .card { margin-bottom: 0; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head .sync { margin-left: auto; font-size: .75rem; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; }
.kpis dt { font-size: .8rem; color: var(--muted); font-weight: 400; }
.kpis dd { margin: 0; }
.big { font-size: 1.6rem; font-weight: 700; color: var(--jaune); font-variant-numeric: tabular-nums; line-height: 1.2; }
.delta { font-size: .8rem; font-weight: 400; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; margin: 0; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: baseline; }
.dot-twitch { background: #9666ff; }
.dot-tiktok { background: #ffd300; }
.dot-instagram { background: #ff8a3d; }
.dot-x { background: #e5e5e5; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: var(--gap); }
.segmented { display: inline-flex; border: 1px solid var(--violet-profond); border-radius: 999px; overflow: hidden; background: var(--nuit); }
.segmented button { background: none; border: 0; color: var(--blanc); font: inherit; font-weight: 400; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.segmented button[aria-pressed="true"] { background: var(--jaune); color: var(--anthracite); font-weight: 700; }
.select { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
select, input[type="date"], input[type="file"] {
  font: inherit; color: var(--blanc); background: var(--nuit); border: 1px solid rgba(150, 102, 255, .45);
  border-radius: 10px; padding: 8px 10px; min-height: 40px; max-width: 100%;
}
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 400; }
.form small { color: var(--muted); font-weight: 300; }
.button { display: inline-block; background: var(--jaune); color: var(--anthracite); border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--jaune-clair); color: var(--anthracite); }
.button.ghost { background: transparent; color: var(--jaune); border: 1px solid var(--jaune); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 400; color: var(--muted); border-bottom: 1px solid var(--violet-profond); padding: 8px; white-space: nowrap; }
td { border-bottom: 1px solid rgba(59, 7, 131, .6); padding: 8px; vertical-align: top; }
.n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 400; white-space: nowrap; }
td.warn { color: var(--danger); font-weight: 700; }
.badge { display: inline-block; font-size: .72rem; font-weight: 400; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.badge-success, .badge-active { color: var(--ok); }
.badge-partial, .badge-running, .badge-expired { color: var(--jaune-clair); }
.badge-failed, .badge-error, .badge-revoked, .badge-rejected { color: var(--danger); }
.badge-not_configured { color: var(--muted); }

.chart { width: 100%; height: 320px; }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--nuit); border-left: 4px solid var(--jaune); }
.notice-error { border-left-color: var(--danger); }
.notice-success { border-left-color: var(--ok); }
.methodology summary { cursor: pointer; font-weight: 700; }
.methodology li { margin: 6px 0; }
.login { max-width: 560px; margin: 8vh auto; text-align: center; }

@media (max-width: 640px) {
  .page { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .grid.two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .big { font-size: 1.3rem; }
  .chart { height: 260px; }
}
