/* ==========================================================================
   Portail Gameward Fortnite — d'après le design system « Nocturne ».
   Fond bleu-gris quasi neutre, un seul accent blurple utilisé en trait et en
   halo, boutons cerclés (pas pleins), mise en page calée à gauche, filets qui
   s'effacent à leurs extrémités. Tout vient des tokens ci-dessous ; on ne code
   jamais une couleur ou une taille en dur qu'un token porte déjà.
   Autonome : aucune ressource externe, pour qu'une régie ne dépende d'aucun CDN.
   ========================================================================== */

:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;

  --color-neutral-100:#f3f5fe; --color-neutral-200:#e4e7f5; --color-neutral-300:#cfd3e5;
  --color-neutral-400:#b2b6ca; --color-neutral-500:#9397ab; --color-neutral-600:#75798c;
  --color-neutral-700:#595d6c; --color-neutral-800:#3f424d; --color-neutral-900:#292b31;

  --color-accent-100:#f5f4ff; --color-accent-200:#e7e5fe; --color-accent-300:#d2cefd;
  --color-accent-400:#b5abfc; --color-accent-500:#968ae0; --color-accent-600:#796cbf;
  --color-accent-700:#5d5294; --color-accent-800:#423a6a; --color-accent-900:#2b2741;

  --ok:#4fbf8b; --warn:#e6b04a; --danger:#e35b63;
  --ok-glow: rgba(79,191,139,0.7);

  --font-heading: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --space-1:2.8px; --space-2:5.6px; --space-3:8.4px; --space-4:11.2px;
  --space-6:16.8px; --space-8:22.4px; --space-10:28px; --space-12:33.6px;

  --radius-sm:4px; --radius-md:8px; --radius-lg:14px;

  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0,0,0,0.55);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0,0,0,0.65);
  --shadow-accent: 0 0 0 1px #5d5294, 0 8px 24px rgba(0,0,0,0.5);

  --line: rgba(233,233,237,0.09);
  --line-soft: rgba(233,233,237,0.07);

  --rail: 252px;
  --topbar: 58px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Les <option> sont rendus par l'OS et prennent son thème clair par défaut :
   on impose le fond sombre et le schéma de couleurs sombre. */
select { color-scheme: dark; }
select option, select optgroup { background: #1c1e2b; color: var(--color-text); }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-heading); font-weight: 500; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--color-accent-300); text-decoration: none; }
a:hover { color: var(--color-accent-200); }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--color-accent) 35%, transparent); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #3f424d; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6;
        stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: -0.125em; }
svg.i.fill { fill: currentColor; stroke: none; }

/* --------------------------------------------------------------- ossature */

.shell { display: flex; height: 100vh; overflow: hidden; }

.rail {
  width: var(--rail); flex: 0 0 var(--rail);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1b1d2d 0%, #161826 60%);
  border-right: 1px solid var(--line);
}
.rail__brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 20px; }

.rail__logo { height: 22px; width: auto; filter: brightness(0) invert(0.96); display: block; }
.auth__logo { height: 24px; width: auto; filter: brightness(0) invert(0.96); }

.rail__mark {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--color-accent), #6f61c0);
  color: #0e0f1a; font-size: 11px; font-weight: 800;
}
.rail__brand-name { font-family: var(--font-heading); font-weight: 600; font-size: 14px; }
.rail__brand-sub { font-size: 11px; color: var(--color-neutral-500);
  letter-spacing: 0.08em; text-transform: uppercase; }
.rail__brand-sep { width: 1px; height: 18px; background: rgba(233,233,237,0.16); }

.rail__nav { display: flex; flex-direction: column; gap: 22px; padding: 12px 12px 0; overflow-y: auto; flex: 1; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navgroup__label { padding: 0 10px 8px; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--color-neutral-700); }

.navlink {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-md);
  color: var(--color-neutral-400); font-size: 14px; text-decoration: none;
}
.navlink svg.i { font-size: 17px; }
.navlink:hover { background: rgba(233,233,237,0.05); color: var(--color-text); }
.navlink[aria-current="page"] { background: rgba(145,132,217,0.13); color: var(--color-accent-200); font-weight: 500; }
.navlink[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 2px; border-radius: 2px; background: var(--color-accent);
}
.navlink--soon { color: var(--color-neutral-600); cursor: default; pointer-events: none; }
.navlink--soon:hover { background: none; color: var(--color-neutral-600); }
.navlink__soon { margin-left: auto; font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-neutral-700); }

.identity {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; margin: 12px; border-radius: var(--radius-md);
  background: rgba(233,233,237,0.035); box-shadow: var(--shadow-sm);
  border: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: calc(100% - 24px);
}
.identity:hover { background: rgba(233,233,237,0.06); }
.avatar {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent-800); color: var(--color-accent-200);
  font-size: 12px; font-weight: 500;
}
.identity__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.identity__name { font-size: 13px; font-weight: 500; }
.identity__role { font-size: 11px; color: var(--color-neutral-600); }
.identity__out { margin-left: auto; font-size: 16px; color: var(--color-neutral-600); }
.identity:hover .identity__out { color: var(--color-text); }

/* ----------------------------------------------------------------- contenu */

.main { flex: 1; overflow-y: auto; position: relative; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px; height: var(--topbar); padding: 0 40px;
  background: rgba(22,24,38,0.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumb { font-size: 12px; color: var(--color-neutral-600); }
.crumb--here { color: var(--color-neutral-300); }
.topbar svg.i { font-size: 12px; color: var(--color-neutral-700); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--color-neutral-500); }

.live {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  background: rgba(215,60,72,0.14); box-shadow: inset 0 0 0 1px rgba(215,60,72,0.45);
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: #f0a3a8;
}
.live__dot { width: 6px; height: 6px; border-radius: 50%; background: #e35b63; box-shadow: 0 0 8px #e35b63; }

.page { max-width: 1120px; padding: 40px 40px 72px; }

.hero {
  display: flex; align-items: flex-end; gap: 32px; padding-bottom: 28px;
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg, transparent 0, rgba(233,233,237,0.16) 48px,
    rgba(233,233,237,0.16) calc(100% - 48px), transparent 100%) 1;
}
.hero h1 { font-size: 40px; letter-spacing: -0.025em; line-height: 1.05; margin-bottom: 10px; }
.hero__lead { font-size: 14px; line-height: 1.55; color: var(--color-neutral-400); max-width: 520px; text-wrap: pretty; }
.hero__aside { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-bottom: 4px;
  font-size: 12px; color: var(--color-neutral-400); white-space: nowrap; }
.hero__sep { width: 1px; height: 12px; background: rgba(233,233,237,0.14); }

.section { padding: 32px 0 0; }
.section__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section__head h2 { font-size: 15px; }
.section__hint { font-size: 12px; color: var(--color-neutral-600); }
.section__spacer { flex: 1; }

/* ------------------------------------------------------------------- cartes */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 14px; }

.pcard {
  display: flex; flex-direction: column; gap: 14px; padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #232532 0%, #1c1e2b 100%);
  box-shadow: var(--shadow-sm); color: inherit;
  transition: box-shadow .15s;
}
a.pcard:hover { box-shadow: var(--shadow-accent); }
.pcard__top { display: flex; align-items: flex-start; gap: 12px; }
.pcard__icon {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: rgba(145,132,217,0.12); box-shadow: inset 0 0 0 1px rgba(145,132,217,0.3);
  color: var(--color-accent-300); font-size: 18px;
}
.pcard__name { font-family: var(--font-heading); font-size: 15px; font-weight: 500; }
.pcard__desc { font-size: 12.5px; line-height: 1.5; color: var(--color-neutral-500); text-wrap: pretty; margin-top: 5px; }
.pcard__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pcard__foot svg.i { margin-left: auto; font-size: 14px; color: var(--color-neutral-600); }
.pcard--off { opacity: .6; }

.state { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--color-neutral-500); }
.sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-neutral-600); flex: 0 0 auto; }
.sdot--ok { background: var(--ok); box-shadow: 0 0 8px var(--ok-glow); }
.sdot--down { background: var(--danger); box-shadow: 0 0 8px rgba(227,91,99,0.7); }

/* ------------------------------------------------------------------- badges */

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: .02em;
  background: rgba(233,233,237,0.06); color: var(--color-neutral-300);
  box-shadow: inset 0 0 0 1px rgba(233,233,237,0.12);
}
.tag--accent { background: rgba(145,132,217,0.14); color: var(--color-accent-200); box-shadow: inset 0 0 0 1px rgba(145,132,217,0.4); }
.tag--ok { background: rgba(79,191,139,0.14); color: #93d9b6; box-shadow: inset 0 0 0 1px rgba(79,191,139,0.4); }
.tag--danger { background: rgba(227,91,99,0.14); color: #f0a3a8; box-shadow: inset 0 0 0 1px rgba(227,91,99,0.4); }

/* ------------------------------------------------------------------ boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; min-height: 34px;
  background: transparent; color: var(--color-text);
  border: 1px solid rgba(233,233,237,0.18); border-radius: var(--radius-md);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: rgba(233,233,237,0.05); border-color: rgba(233,233,237,0.3); }
.btn svg.i { font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Primaire : cerclé d'accent, jamais plein. */
.btn--primary { border-color: var(--color-accent); color: var(--color-accent-200); }
.btn--primary:hover { background: rgba(145,132,217,0.12); border-color: var(--color-accent-400); }
.btn--danger { border-color: rgba(227,91,99,0.4); color: #f0a3a8; }
.btn--danger:hover { background: rgba(227,91,99,0.12); border-color: var(--danger); }
.btn--ghost { border-color: transparent; color: var(--color-neutral-400); }
.btn--ghost:hover { background: rgba(233,233,237,0.05); color: var(--color-text); }
.btn--sm { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------- champs */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; color: var(--color-neutral-300); font-weight: 500; }
.field__hint { font-size: 11.5px; color: var(--color-neutral-600); }

.input, input[type=text], input[type=password], input[type=number], select, textarea {
  background: rgba(233,233,237,0.04); color: var(--color-text);
  border: 1px solid rgba(233,233,237,0.14); border-radius: var(--radius-md);
  padding: 8px 11px; min-height: 34px; font: inherit; font-size: 13px; width: 100%;
}
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--color-accent); outline: none; }
input::placeholder { color: var(--color-neutral-600); }
select { appearance: none; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2375798c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }

.formgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 6px 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 36px; height: 20px; flex: 0 0 auto; border-radius: 999px;
  background: rgba(233,233,237,0.1); box-shadow: inset 0 0 0 1px rgba(233,233,237,0.16);
  position: relative; transition: background .14s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--color-neutral-500); transition: transform .14s, background .14s; }
.switch input:checked + .switch__track { background: rgba(145,132,217,0.3); box-shadow: inset 0 0 0 1px var(--color-accent-600); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: var(--color-accent-300); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .4; }
.switch__label { font-size: 13px; }
.switch__label small { display: block; color: var(--color-neutral-600); font-size: 11.5px; margin-top: 1px; }

.fieldset { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 16px 16px; margin-top: 18px; }
.fieldset > legend { padding: 0 6px; font-size: 11px; color: var(--color-neutral-400);
  font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.fieldset__hint { color: var(--color-neutral-600); font-size: 11.5px; margin-bottom: 8px; }
.switchgrid { display: grid; gap: 2px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ----------------------------------------------------------------- tableaux */

.tablewrap { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; background: var(--color-surface); }
.tscroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-neutral-600);
  font-weight: 500; background: rgba(233,233,237,0.02); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(233,233,237,0.025); }
td.right { text-align: right; white-space: nowrap; }
.cell-main { font-weight: 500; }
.cell-sub { color: var(--color-neutral-600); font-size: 11.5px; }

.mono { font-family: var(--font-mono); font-size: 11.5px; }
.urlbox { display: flex; align-items: center; gap: 8px; background: rgba(233,233,237,0.03);
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 4px 4px 4px 10px; }
.urlbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
  font-family: var(--font-mono); font-size: 11px; color: var(--color-neutral-400); }

.empty { padding: 28px; text-align: center; color: var(--color-neutral-600); font-size: 13px; }

/* ----------------------------------------------------------------- notices */

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-md);
  background: rgba(145,132,217,0.08); box-shadow: inset 0 0 0 1px rgba(145,132,217,0.22);
  font-size: 12.5px; line-height: 1.5; color: var(--color-neutral-300); }
.notice svg.i { font-size: 16px; color: var(--color-accent-300); margin-top: 1px; }

/* ------------------------------------------------------------------ tiroir */

.drawer { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 1fr min(540px, 100%); }
.drawer[hidden] { display: none; }
.drawer__scrim { background: rgba(10,11,18,0.66); backdrop-filter: blur(2px); }
.drawer__panel { background: linear-gradient(180deg,#1b1d2d,#161826 40%); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; }
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__title { flex: 1; min-width: 0; }
.drawer__title h2 { font-size: 17px; }
.drawer__body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer__foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* ------------------------------------------------------------------ toasts */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #232532; box-shadow: var(--shadow-md); border-radius: var(--radius-md);
  padding: 11px 15px; font-size: 13px; max-width: 380px; animation: rise .18s ease-out; }
.toast--bad { box-shadow: 0 0 0 1px rgba(227,91,99,0.5), 0 6px 18px rgba(0,0,0,.55); color: #f0a3a8; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------------------------------------------- connexion */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth__card { width: 100%; max-width: 380px; background: linear-gradient(165deg,#232532,#1c1e2b);
  box-shadow: var(--shadow-md); border-radius: var(--radius-lg); padding: 32px 28px; }
.auth__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth__title { font-size: 20px; margin-bottom: 6px; }
.auth__lead { font-size: 13px; color: var(--color-neutral-500); margin-bottom: 22px; line-height: 1.5; }
.auth__err { font-size: 12.5px; color: #f0a3a8; margin-top: 12px; min-height: 1em; }
.auth__foot { margin-top: 18px; font-size: 11.5px; color: var(--color-neutral-600); line-height: 1.5; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .shell { flex-direction: column; height: auto; }
  .rail { width: 100%; flex: none; flex-direction: row; align-items: center; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--line); }
  .rail__nav { flex-direction: row; gap: 8px; padding: 8px; }
  .navgroup { flex-direction: row; align-items: center; }
  .navgroup__label { display: none; }
  .identity { width: auto; margin: 8px; }
  .identity__text { display: none; }
  .page { padding: 24px 20px 56px; }
  .topbar { padding: 0 20px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero h1 { font-size: 30px; }
  .hero__aside { margin-left: 0; }
  .drawer { grid-template-columns: 0 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
