/* Polices hébergées sur le site (pas d'appel à Google : meilleur pour la vie privée et la vitesse) */
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url('/static/fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url('/static/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url('/static/fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 700; font-display: swap; src: url('/static/fonts/baloo-2-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url('/static/fonts/baloo-2-latin-800-normal.woff2') format('woff2'); }

/* Thème inspiré de l'interface de Dofus 3 : fenêtres bleu nuit, barres de titre centrées,
   boutons en capitales, onglets jaunes, cases façon inventaire. */
:root {
  --page: #0e1322;
  --win: #1b1d32;
  --win-2: #202240;
  --win-head-1: #23264a;
  --win-head-2: #1e2140;
  --row: #292c4c;
  --row-hover: #323660;
  --slot: #15172a;
  --line: #3b3f68;
  --line-soft: #2f3256;
  --text: #eceaf8;
  --muted: #a9a8d4;
  --dim: #9897c2;
  --yellow: #f0ff4f;      /* jaune-vert des noms et de la sélection */
  --yellow-2: #f7ff9a;
  --gold: #e9a227;        /* badges façon XP */
  --green: #a2ba13;
  --green-dark: #6d7f08;
  --red: #ff8076;
  --blue: #2888ab;
  --radius: 8px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  --font-title: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1000px 600px at 85% 10%, rgba(40, 136, 171, 0.35), transparent 60%),
    radial-gradient(800px 500px at 10% 90%, rgba(60, 70, 160, 0.25), transparent 60%),
    radial-gradient(600px 400px at 50% 40%, rgba(30, 90, 140, 0.18), transparent 70%),
    var(--page);
  background-attachment: fixed;
  color: var(--text);
  font: 600 14px/1.45 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
}
a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 0.5em; font-weight: 800; font-family: var(--font-title); line-height: 1.15; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }
code { background: var(--slot); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-soft); }
.caps, label, .tab, .btn, .sec-title, th {
  font-family: 'Nunito', sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── Barre du haut (style barre de raccourcis) ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  height: 52px; padding: 0 20px;
  background: rgba(20, 22, 40, 0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--yellow); font-family: var(--font-title); font-size: 1.25rem; white-space: nowrap; }
.brand .logo { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; height: 100%; }
.nav a {
  display: flex; align-items: center; padding: 0 12px; color: var(--muted);
  font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.user img { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); }

main { max-width: 1320px; margin: 0 auto; padding: 22px 18px 60px; }

/* ── Fenêtres ── */
.win {
  background: var(--win); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.win + .win, .win-gap { margin-top: 16px; }
.win-head {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 6px 12px;
  background: linear-gradient(var(--win-head-1), var(--win-head-2));
  border-bottom: 1px solid var(--line-soft);
  font-weight: 800; font-size: .78rem; text-align: center; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.win-head .win-ico { opacity: .9; }
.win-head .win-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; }
.win-head .win-left { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; align-items: center; }
.win-body { padding: 14px; }
.win-body.tight { padding: 10px; }
.win.sub { box-shadow: none; background: var(--win-2); }
.win.sub .win-head { min-height: 32px; font-size: .74rem; background: #23264a; }

/* ── Éléments ── */
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.84rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.sep { height: 1px; background: var(--line-soft); margin: 12px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #3a3c55; color: var(--text); border: 1px solid #4f5274;
  padding: 7px 14px; border-radius: 4px; cursor: pointer; font-size: 0.76rem;
  transition: border-color .12s, background .12s;
}
.btn:hover { border-color: var(--yellow); text-decoration: none; background: #44476a; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; border-color: #4f5274; }
/* Bouton principal façon « JOUER » : vert-jaune, forme hexagonale */
.btn.primary {
  background: linear-gradient(#d4ea3a, #a2ba13 55%, #7f930b); border: none; color: #1c2204;
  font-family: var(--font-title); font-size: .95rem; letter-spacing: .06em; padding: 8px 22px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.btn.primary:hover { background: linear-gradient(#e2f54f, #b3cb1c 55%, #8ea30f); }
.btn.small.primary { font-size: .8rem; padding: 5px 16px; }
.btn.success { border-color: var(--green); color: #e6f59c; }
.btn.gold { background: linear-gradient(#f6c14a, #d88a14); border-color: #ffd77a; color: #3a2200; }
.btn.danger { border-color: #a5463f; color: #ffb3ac; }
.btn.danger:hover { border-color: var(--red); }
.btn.link { background: none; border: none; color: var(--muted); padding: 4px 6px; }
.btn.link:hover { color: var(--yellow); }
.btn.discord { background: #5865f2; border-color: #7c86ff; color: #fff; }
.btn.small { padding: 4px 9px; font-size: .72rem; }
.btn.icon { padding: 5px 8px; }

input, select, textarea {
  background: var(--slot); color: var(--text); border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 10px; font: inherit; font-size: 0.9rem; width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yellow); }
label { display: block; font-size: 0.72rem; color: var(--muted); margin: 12px 0 5px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: .05em;
  font-size: 0.7rem; font-weight: 800; background: var(--slot); border: 1px solid var(--line);
}
.badge.open { color: #3a2200; background: linear-gradient(#f6c14a, #d88a14); border-color: #ffd77a; }
.badge.running { color: #1c2204; background: linear-gradient(#d4ea3a, #a2ba13); border-color: #e6f59c; }
.badge.done { color: var(--muted); }
.badge.new { background: #d27be0; color: #2a0f30; border-color: #e7a6f0; }

.md p { margin: 0 0 6px; }
.md blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.md strong { color: #fff; }

/* Onglets façon « Annuaire / Raids » */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.tab { padding: 8px 0; color: var(--text); font-size: .8rem; font-weight: 700; border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; }
.tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }

/* Lignes de liste façon annuaire */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-head { display: grid; gap: 10px; padding: 0 14px 4px; color: var(--muted); font-size: .72rem; }
.list-row {
  display: grid; gap: 10px; align-items: center;
  background: var(--row); border: 1px solid var(--line-soft); border-radius: 4px; padding: 10px 14px; color: var(--text);
}
a.list-row:hover { background: var(--row-hover); border-color: var(--yellow); text-decoration: none; }
.list-row strong, .tpl-item strong { font-family: var(--font-title); font-weight: 800; color: var(--yellow); font-size: 1.02rem; }
.list-row .actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.raid-cols { grid-template-columns: 64px 1fr 150px 110px 120px 130px; }
@media (max-width: 860px) { .raid-cols { grid-template-columns: 56px 1fr 120px; } .raid-cols .hide-sm { display: none; } }

.emblem {
  width: 56px; height: 56px; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: var(--slot); border: 1px solid var(--line); font-size: 1.6rem;
}
.emblem img { width: 100%; height: 100%; object-fit: cover; }

.progress { height: 6px; background: var(--slot); border-radius: 999px; overflow: hidden; border: 1px solid var(--line-soft); }
.progress > div { height: 100%; background: linear-gradient(90deg, #8fa60f, #f0ff4f); }

.empty { text-align: center; padding: 34px 20px; color: var(--muted); }

/* Bandeau du raid */
.banner {
  position: relative; min-height: 170px; display: flex; align-items: flex-end;
  background: linear-gradient(135deg, #23305a, #141728); border-bottom: 1px solid var(--line);
}
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(18, 20, 31, 0.92)); }
.banner .in { position: relative; z-index: 1; padding: 16px 18px; width: 100%; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.banner h1 { margin: 6px 0 2px; font-size: 2rem; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.banner .meta { color: #d9dcea; text-shadow: 0 1px 4px rgba(0,0,0,.7); }

/* Cases d'inventaire / icônes de classe */
.slot {
  width: 40px; height: 40px; flex: none; border-radius: 4px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #2a2d4e, var(--slot)); border: 1px solid var(--line);
  font-size: 1.25rem; overflow: hidden;
}
.slot img { width: 36px; height: 36px; object-fit: contain; }
.slot.sm { width: 30px; height: 30px; font-size: 1rem; }
.slot.sm img { width: 26px; height: 26px; }
.class-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.class-count { position: relative; }
.class-count .n {
  position: absolute; top: -2px; left: 3px; font-size: .7rem; font-weight: 800; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}

/* Tableau de compo */
.board { display: grid; grid-template-columns: 270px 1fr; gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.side-cols { display: flex; flex-direction: column; gap: 14px; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.col .win-head .count { position: absolute; right: 10px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.col.full .win-head .count { color: var(--green); }
.col.over .win-head .count { color: var(--red); }
.col.validated { border-color: var(--green); }
.col.validated .win-head { background: linear-gradient(#5d6b12, #46520a); color: #f0ff9a; }
.drop { min-height: 58px; display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.drop:empty::after { content: 'Glisse des persos ici'; color: var(--dim); font-size: 0.78rem; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 4px; }
.readonly .drop:empty::after { content: '—'; border: none; }

.char {
  display: flex; align-items: center; gap: 9px;
  background: var(--row); border: 1px solid var(--line-soft); border-radius: 4px; padding: 4px 6px 4px 4px;
  font-size: 0.86rem; user-select: none;
}
.editable .char { cursor: grab; }
.editable .char:hover { border-color: var(--line); background: var(--row-hover); }
.char .txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.char .txt strong { font-family: var(--font-title); font-weight: 800; color: var(--yellow); font-size: .95rem; }
.char .who { color: var(--muted); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char .x { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.char .x:hover { color: var(--red); }
.char.maybe { opacity: 0.6; border-style: dashed; }
.char.mine { border-color: var(--yellow); }
.sortable-ghost { opacity: 0.3; }
.sortable-chosen, .sortable-fallback { box-shadow: var(--shadow); }

.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { background: var(--row); border: 1px solid var(--line-soft); border-radius: 3px; padding: 2px 9px; font-size: 0.84rem; }

/* Déroulé */
.steps-track { display: flex; gap: 4px; margin: 4px 0 14px; }
.steps-track span { flex: 1; height: 6px; border-radius: 2px; background: var(--slot); border: 1px solid var(--line-soft); }
.steps-track span.done { background: var(--green); border-color: var(--green); }
.steps-track span.current { background: var(--gold); border-color: var(--gold); }
.run-steps { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
@media (max-width: 700px) { .run-steps { columns: 1; } }
.run-steps li { padding: 3px 0; color: var(--muted); break-inside: avoid; }
.run-steps li.current { color: var(--yellow); font-weight: 700; }
.run-steps li.done { color: #c9d86a; }
.group-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.gstat { background: var(--row); border: 1px solid var(--line-soft); border-radius: 4px; padding: 10px; }
.gstat.ok { border-color: var(--green); background: #2c3434; }
.gstat .consigne { font-size: 0.84rem; color: var(--muted); margin-top: 4px; }
.tips { background: var(--slot); border: 1px solid var(--line-soft); border-radius: 4px; padding: 10px 12px; }
details > summary { cursor: pointer; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .76rem; }

/* Modale */
dialog {
  background: var(--win); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  width: min(920px, 96vw); max-height: 92vh; padding: 0; box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(8, 10, 18, 0.7); }
dialog .dlg-body { padding: 16px 18px; overflow: auto; max-height: calc(92vh - 110px); }
dialog .dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--win-2); }

/* Éditeur d'étapes */
.step-ed { background: var(--row); border: 1px solid var(--line-soft); border-radius: 4px; padding: 12px; margin-bottom: 10px; }
.step-ed .head { display: flex; gap: 8px; align-items: center; }
.step-ed .handle { cursor: grab; color: var(--dim); font-size: 1.2rem; padding: 0 4px; }
.step-ed .num { color: var(--yellow); min-width: 1.6em; font-weight: 800; }
.step-ed details { margin-top: 10px; }
.tools-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; margin-top: 6px; }
.tools-pick label { display: inline-flex; gap: 5px; align-items: center; margin: 0; color: var(--text); text-transform: none; letter-spacing: 0; font-family: inherit; font-size: .85rem; }
.tools-pick input { width: auto; }

/* Modèles */
.layout-side { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .layout-side { grid-template-columns: 1fr; } }
.tpl-item { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; background: var(--row); }
.tpl-item + .tpl-item { margin-top: 6px; }
.tpl-item:hover { background: var(--row-hover); }
.tpl-item.active { border-color: var(--yellow); }
.tpl-item .emblem { width: 44px; height: 44px; font-size: 1.2rem; }
.img-pick { display: flex; gap: 12px; align-items: center; }
.img-pick .preview { width: 180px; height: 90px; border-radius: 4px; border: 1px solid var(--line); background: var(--slot) center/cover no-repeat; display: grid; place-items: center; color: var(--dim); font-size: .8rem; }

/* Outils */
.tool { scroll-margin-top: 70px; }
.lo-grid { display: grid; grid-template-columns: repeat(4, 64px); gap: 8px; margin: 12px 0; }
.lo-cell {
  width: 64px; height: 64px; border-radius: 6px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, #2a3350, #1a1f30);
  cursor: pointer; position: relative; font-size: 1.6rem; display: grid; place-items: center; transition: background 0.12s;
}
.lo-cell.on { background: radial-gradient(circle, #fff3c4 0%, #f3c94e 55%, #8a6a22 100%); border-color: var(--yellow-2); }
.lo-cell.press::after {
  content: attr(data-n); position: absolute; top: -8px; right: -8px; background: var(--red); color: #fff;
  width: 22px; height: 22px; border-radius: 50%; font-size: 0.78rem; display: grid; place-items: center; font-weight: 700;
}
.lo-cell.press { outline: 2px solid var(--red); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--row); color: var(--text); cursor: pointer; font: inherit; font-size: .85rem; }
.chip:hover:not(:disabled) { border-color: var(--yellow); }
.chip.sel { border-color: var(--yellow); background: #3a3f2a; color: var(--yellow); }
.chip:disabled { cursor: default; }
.order { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-weight: 700; }
.order .arrow { color: var(--dim); }

table.tbl { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 0.88rem; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .72rem; text-align: left; padding: 2px 10px; }
.tbl td { background: var(--row); padding: 7px 10px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.tbl td:first-child { border-left: 1px solid var(--line-soft); border-radius: 4px 0 0 4px; }
.tbl td:last-child { border-right: 1px solid var(--line-soft); border-radius: 0 4px 4px 0; }
.tbl tr.hl td { background: #343a2a; border-color: #8a9420; }

.bn-wrap { display: flex; gap: 24px; flex-wrap: wrap; }
.bn-grid { display: grid; gap: 2px; margin-top: 6px; }
.bn-grid div { width: 30px; height: 30px; display: grid; place-items: center; font-size: 0.75rem; border-radius: 3px; }
.bn-grid .hdr { color: var(--muted); }
.bn-grid .cell { background: #1f3550; border: 1px solid #2b4867; cursor: pointer; }
.bn-grid .cell.ship { background: #5d6378; }
.bn-grid .cell.hit { background: var(--red); }
.bn-grid .cell.miss { background: #2a4560; color: var(--muted); }

.sync { display: inline-block; font-size: 0.82rem; padding: 7px 12px; border-radius: 4px; background: var(--row); border: 1px solid var(--line); }
.sync.on { border-color: var(--green); color: #c4ef8a; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--win); border: 1px solid var(--line); border-left: 4px solid var(--green); padding: 10px 16px; border-radius: 4px;
  box-shadow: var(--shadow); z-index: 100; max-width: 90vw;
}
.toast.err { border-left-color: var(--red); }
.hidden { display: none !important; }
.hero-login { text-align: center; padding: 40px 20px; }
.groups > .win, .side-cols > .win, .grid-2 > .win, .layout-side > .win { margin-top: 0; }

/* Sondage (grille façon Doodle) */
.poll-wrap { overflow-x: auto; }
table.poll { border-collapse: separate; border-spacing: 3px; min-width: 100%; }
.poll th, .poll td { text-align: center; padding: 6px 8px; border-radius: 4px; }
.poll th.pslot { background: var(--row); border: 1px solid var(--line-soft); min-width: 92px; font-weight: 800; line-height: 1.15; }
.poll th.pslot .day { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.poll th.pslot .hour { color: var(--yellow); font-family: var(--font-title); font-size: 1.05rem; }
.poll th.pslot.best { border-color: var(--yellow); box-shadow: inset 0 0 0 1px var(--yellow); }
.poll th.pslot.chosen { border-color: var(--green); background: #2c3434; }
.poll td.name { text-align: left; white-space: nowrap; font-weight: 700; background: var(--row); }
.poll td.name .n { color: var(--dim); font-size: .78rem; font-weight: 600; }
.poll td.cell { background: var(--slot); border: 1px solid var(--line-soft); }
.poll td.cell.yes { background: #4b5a12; border-color: var(--green); color: #f0ff9a; font-weight: 900; }
.poll tr.me td.name { color: var(--yellow); }
.poll tr.me td.cell { cursor: pointer; }
.poll tr.me td.cell:hover { border-color: var(--yellow); }
.poll tfoot td { font-weight: 800; color: var(--muted); }
.poll tfoot td.best { color: var(--yellow); }
.admin-cols { grid-template-columns: 56px 1.4fr 90px 120px 1.4fr 130px 140px; }
@media (max-width: 860px) { .admin-cols { grid-template-columns: 56px 1fr 120px; } .admin-cols .hide-sm { display: none; } }
.user-cols { grid-template-columns: 44px 1fr 220px 240px; }
@media (max-width: 860px) { .user-cols { grid-template-columns: 44px 1fr 160px; } .user-cols .hide-sm { display: none; } }
.lex-term { font-family: var(--font-title); color: var(--yellow); font-weight: 800; }
.lex td { vertical-align: top; }


/* ── Accessibilité ── */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--yellow); color: #1c2204; padding: 8px 14px; border-radius: 4px; font-weight: 800; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ── Pied de page ── */
.site-foot { max-width: 1320px; margin: 0 auto; padding: 18px 18px 40px; color: var(--dim); font-size: .82rem; text-align: center; border-top: 1px solid var(--line-soft); }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 8px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--yellow); }
.site-foot p { margin: 0; }

/* ── Pages légales ── */
.legal { max-width: 860px; margin: 0 auto; }
.legal h1 { font-size: 1.7rem; color: var(--yellow); }
.legal h2 { margin-top: 1.4em; color: var(--text); }
.legal p, .legal li { color: #d9d8ee; line-height: 1.6; }
.legal ul { padding-left: 1.2em; }

/* ── Bandeau cookies ── */
.cookie-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90;
  width: min(760px, calc(100vw - 24px)); display: flex; gap: 14px; align-items: center;
  background: var(--win); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.cookie-banner p { margin: 0; font-size: .86rem; flex: 1; }
@media (max-width: 560px) { .cookie-banner { flex-direction: column; align-items: stretch; } }

/* ── Mobile ── */
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 12px; gap: 10px; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; flex-direction: column; height: auto; display: none; padding-bottom: 6px; }
  .topbar.open .nav { display: flex; }
  .nav a { padding: 10px 6px; border-bottom: 1px solid var(--line-soft); }
  .nav a.active { border-bottom-color: var(--yellow); }
  .user { order: 2; }
  .user span { display: none; }
  main { padding: 14px 10px 40px; }
  .win-head { font-size: .72rem; padding: 6px 8px; }
  .win-head .win-actions { position: static; transform: none; margin-left: auto; flex-wrap: wrap; }
  .win-head:has(.win-actions) { justify-content: space-between; text-align: left; }
  .win-body { padding: 12px; }
  .banner h1 { font-size: 1.4rem; }
  .raid-cols, .admin-cols, .user-cols { grid-template-columns: 48px 1fr; }
  .raid-cols .actions, .admin-cols .actions, .user-cols .actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
  .list-head { display: none; }
  .tbl { font-size: .8rem; }
  .lex th:nth-child(2), .lex td:nth-child(2) { display: none; }
  .lo-grid { grid-template-columns: repeat(4, 56px); }
  .lo-cell { width: 56px; height: 56px; }
  .bn-grid div { width: 24px; height: 24px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .img-pick { flex-direction: column; align-items: flex-start; }
}
.tool-body { overflow-x: auto; }

/* Statistiques (page Admin) */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat-tile { background: var(--row); border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 12px; }
.stat-num { font-family: var(--font-title); font-weight: 800; font-size: 1.7rem; color: var(--text); line-height: 1.1; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bar-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bar { width: 100%; background: var(--green); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--yellow); }
.bar-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--slot); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; font-size: .75rem; z-index: 5; }
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { display: block; }
.bars .bar-col:first-child .bar-tip { left: 0; transform: none; }
.bars .bar-col:last-child .bar-tip { left: auto; right: 0; transform: none; }
