/* Vigie : style propre (pas celui de wiski.pro). Bleu nuit + ambre « lanterne de vigie », Sora + Inter. */
:root {
  --bg: #0a1020;
  --bg-alt: #0e1629;
  --surface: #121b31;
  --surface-2: #1a2642;
  --line: #22304f;
  --line-strong: #2e3f66;
  --text: #e9eef8;
  --muted: #95a3c0;
  --amber: #f5b942;
  --amber-2: #ffcf6b;
  --ink: #1a1203; /* texte sur ambre */
  --steel: #6f8fc9;
  --success: #3ddc97;
  --danger: #ff7a85;
  --warn: #ffa95c;
  --r: 14px;
  --r-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg); color: var(--text);
  font: 400 1rem/1.65 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-family: 'Sora', sans-serif; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
code { font: 500 0.88em 'JetBrains Mono', ui-monospace, monospace; color: var(--amber-2); }
::selection { background: rgba(245,185,66,0.35); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.icon { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em; }
.container { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(10,16,32,0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 980px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.15rem 'Sora', sans-serif; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 62% 34%, rgba(245,185,66,0.32), transparent 60%), linear-gradient(180deg, #16213b, #0a1020);
  border: 1px solid var(--line-strong); color: var(--amber); font-size: 1.05rem;
}
.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.topnav a:hover, .topnav a[aria-current] { color: var(--text); background: var(--surface); }
@media (max-width: 720px) { .topnav a:not(.garde) { display: none; } .topbar-in { gap: 12px; } }

/* En-tête de page */
.page-hero { position: relative; padding: 72px 0 32px; overflow: hidden; }
.page-hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(245,185,66,0.16), transparent 70%),
    radial-gradient(500px 300px at 0% 0%, rgba(111,143,201,0.14), transparent 70%);
}
.page-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 100px;
  color: var(--amber); font-size: 0.82rem; font-weight: 600;
}
.page-title { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; line-height: 1.08; margin-bottom: 18px; }
.gradient-text { color: var(--amber); }
.page-lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; }

/* Blocs */
main > section { padding: 14px 0; }
.panel { display: flex; flex-direction: column; gap: 16px; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.section-title { font-size: 1.35rem; font-weight: 700; }
.options-title { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.88rem; }
.link { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.feature { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r); }
.feature h3 { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.feature h3 .icon { color: var(--amber); }
.feature p { color: var(--muted); font-size: 0.92rem; }

/* Champs */
input, select, textarea {
  width: 100%; padding: 12px 14px; color: var(--text); font: inherit; font-size: 0.95rem;
  background: var(--bg-alt); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--amber); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 8px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px;
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font: 600 0.95rem 'Inter', sans-serif; color: var(--text); transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: var(--amber-2); }
.btn-outline { border-color: var(--line-strong); background: transparent; }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #2a0509; }
.btn-sm { padding: 8px 14px; font-size: 0.86rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-icon {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer;
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); }
.form-note { min-height: 1.2em; font-size: 0.9rem; color: var(--danger); }
.form-note.ok { color: var(--success); }

/* Accueil : commandes, étapes, listes, permissions, FAQ */
.cmd-group + .cmd-group { margin-top: 14px; }
.cmd { display: grid; grid-template-columns: minmax(200px, 36%) 1fr; gap: 2px 18px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.cmd small { grid-column: 2; color: var(--muted); font-size: 0.8rem; }
@media (max-width: 560px) { .cmd { grid-template-columns: 1fr; } .cmd small { grid-column: 1; } }
.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 16px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; }
.steps li::before {
  content: counter(step); width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; background: var(--amber); color: var(--ink); font: 700 0.9rem 'Sora', sans-serif;
}
.steps strong { display: block; }
.steps small { display: block; color: var(--muted); font-size: 0.88rem; }
.limits { color: var(--muted); font-size: 0.93rem; display: flex; flex-direction: column; gap: 8px; padding-left: 18px; }
.limits strong { color: var(--text); }
.perm-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.perm-table th, .perm-table td { text-align: left; padding: 9px 12px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.perm-table th { font-weight: 600; white-space: nowrap; }
.perm-table td { color: var(--muted); }
@media (max-width: 560px) { .perm-table th { white-space: normal; } }
details.faq { border-top: 1px solid var(--line); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { color: var(--muted); font-size: 0.92rem; margin-top: 8px; }

/* Pied de page */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 0.86rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a:hover { color: var(--text); }

/* Dashboard */
.center-panel { text-align: center; align-items: center; }
.center-panel p { color: var(--muted); max-width: 480px; }
.option-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--surface-2); color: var(--amber); }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 10px; }
.who .guild-icon { width: 34px; height: 34px; border-radius: 50%; }
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.guild { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r); }
.guild:hover { border-color: var(--amber); }
.guild strong { display: block; line-height: 1.3; word-break: break-word; }
.guild small { color: var(--muted); font-size: 0.8rem; }
.guild-icon {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--surface-2); font: 700 0.9rem 'Sora', sans-serif;
}
.guild-icon img, .avatar { width: 100%; height: 100%; display: block; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 10px 16px; border: none; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 0.92rem 'Inter', sans-serif; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--amber); border-bottom-color: var(--amber); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters > * { flex: 1 1 200px; width: auto; padding: 10px 14px; }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: none; }
.row p { font-size: 0.92rem; word-break: break-word; }
.row .hint { font-size: 0.82rem; }
.tag { justify-self: start; padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.tag.ban, .tag.kick, .tag.mute { color: var(--danger); background: rgba(255,122,133,0.12); }
.tag.unban, .tag.unmute { color: var(--success); background: rgba(61,220,151,0.12); }
.tag.warn { color: var(--warn); background: rgba(255,169,92,0.12); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 16px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-sm); }
.tile b { display: block; font: 800 1.9rem/1.2 'Sora', sans-serif; }
.tile span { color: var(--muted); font-size: 0.84rem; }
/* Sanctions par semaine : une série, une couleur, valeur au survol */
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; align-items: end; height: 150px; }
.bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.bar i { display: block; width: 100%; min-height: 2px; background: var(--amber); border-radius: 4px 4px 0 0; }
.bar:hover i, .bar:focus-visible i { background: var(--amber-2); }
.bar:hover::after, .bar:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 4px 10px; border-radius: 8px; white-space: nowrap; font-size: 0.78rem;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
}
.bar-axis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-top: 6px; text-align: center; font-size: 0.72rem; color: var(--muted); }
.results { display: flex; flex-direction: column; gap: 8px; }
.result { position: relative; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bg-alt); overflow: hidden; }
.result-bar { position: absolute; inset: 0 auto 0 0; background: rgba(245,185,66,0.16); }
.result.top .result-bar { background: rgba(245,185,66,0.28); }
.result-line { position: relative; display: flex; justify-content: space-between; gap: 12px; }
.result-label { font-weight: 600; word-break: break-word; }
.result-pct { font: 700 0.95rem 'Sora', sans-serif; }
.rule { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rule select, .rule input { width: auto; flex: 1 1 130px; padding: 10px 14px; }
.add-choice { align-self: flex-start; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 0.86rem; cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--amber); background: rgba(245,185,66,0.08); }
.checks input { width: auto; accent-color: var(--amber); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: background 0.2s ease; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 0.2s ease; }
.switch input:checked + i { background: var(--amber); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); background: var(--ink); }
.switch input:focus-visible + i { outline: 2px solid var(--amber); outline-offset: 3px; }
.panel.danger { border-color: rgba(255,122,133,0.35); }

@media (max-width: 560px) {
  .page-hero { padding-top: 48px; }
  .panel { padding: 18px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Démarrage (onboarding) */
.progres { height: 10px; border-radius: 100px; background: var(--surface-2); overflow: hidden; }
.progres i { display: block; height: 100%; background: var(--amber); border-radius: 100px; transition: width 0.6s ease; }
.progres.fini i { background: var(--success); }
.etapes { display: flex; flex-direction: column; gap: 10px; }
.etape { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 16px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r); }
.etape.fait { border-color: rgba(61,220,151,0.35); }
.etape h3 { font-size: 1rem; line-height: 1.4; }
.etape p { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.etape p strong { color: var(--text); }
.etape .btn-row { margin-top: 10px; align-items: center; }
.puce {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--line-strong); color: var(--muted); font: 700 0.9rem 'Sora', sans-serif;
}
.etape.fait .puce { background: var(--success); border-color: transparent; color: #04241a; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 8px; height: 14px; border-radius: 2px; animation: tombe 1.8s ease-in forwards; }
@keyframes tombe { to { transform: translateY(110vh) rotate(600deg); } }
