/* Generated by _tools/build-pages.js from css/theme.css + css/desktop.css (the app editor styles) + css/pb-web.css */
:root {
  /* surfaces: deep slate-blue, like a war table at night */
  --ink: #101624;
  --panel: #161e30;
  --raised: #1e283e;
  --line: #2a3650;
  --hover: #24304a;

  /* text */
  --text: #ece5d3;      /* parchment */
  --muted: #8f9ab1;
  --faint: #5d6882;

  /* accent: imperial gold */
  --gold: #e0ad45;
  --gold-soft: rgba(224, 173, 69, 0.14);

  /* ages — the colour system of the whole app */
  --age-0: #6f7a90;
  --age-1: #9aa1ad;     /* dark age: iron */
  --age-2: #c98d4c;     /* feudal: bronze */
  --age-3: #6b9bd6;     /* castle: steel blue */
  --age-4: #e0ad45;     /* imperial: gold */

  /* resources */
  --food: #e0624b;
  --wood: #b5844f;
  --goldres: #e8c547;
  --stone: #a9b3c2;
  --builder: #7fb38a;

  --radius-s: 4px;
  --radius-m: 8px;
  --font: 'Barlow', system-ui, sans-serif;
  --font-cond: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }


/* CJK: strict kinsoku (no line starting with small kana or ー); in Japanese, break between phrases (Chromium 119+), not mid-word.
   keep-all is avoided: Japanese has no spaces, whole sentences would overflow */
:lang(ja), :lang(zh) { line-break: strict; }
:lang(ja) { word-break: auto-phrase; }
/* Korean has spaces: break between words, not syllables (break-word still splits a word too long for its box) */
:lang(ko) { word-break: keep-all; overflow-wrap: break-word; }



:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.ico { height: 1.55em; width: auto; aspect-ratio: 1; object-fit: contain; vertical-align: -0.42em; margin: 0 1px; } /* square slot kept while the icon loads: no hole, no jump */
.ico[src*="aoe2"], .res img[src*="aoe2"] { mix-blend-mode: lighten; border-radius: 4px; } /* AoE II icons sit on black squares: lighten lets the dark background show through */
.ico-missing { color: var(--gold); font-weight: 600; text-transform: capitalize; }
/* élément de build sans image (pastille texte de la palette) : un carré sobre avec ses initiales, à la taille de l'icône */
.ico-pill { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 5px; background: linear-gradient(160deg, #3a3326, #231f18); border: 1px solid rgba(214, 178, 94, .45); color: var(--gold); font: 700 11px/1 system-ui, sans-serif; letter-spacing: .02em; vertical-align: middle; text-transform: none; }

/* villager allocation chips */
.res {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px 1px 2px; border-radius: 20px;
  background: rgba(255,255,255,0.05);
  font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums;
}
.res img { width: 18px; height: 18px; }
.res-food b { color: var(--food); }
.res-wood b { color: var(--wood); }
.res-gold b { color: var(--goldres); }
.res-stone b { color: var(--stone); }
.res-builder b { color: var(--builder); }
.res.is-off { opacity: 0.28; }

.age-badge {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 22px; padding: 0 6px;
  border-radius: var(--radius-s);
  font-family: var(--font-cond); font-weight: 700; font-size: 13px;
  color: var(--ink);
  background: var(--age, var(--age-0));
}
.age-1 { --age: var(--age-1); }
.age-2 { --age: var(--age-2); }
.age-3 { --age: var(--age-3); }
.age-4 { --age: var(--age-4); }
.age-0 { --age: var(--age-0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- scouting card (shared by overlay and desktop) ---------- */
.sc-card { display: grid; gap: 5px; min-width: 0; }
.sc-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.sc-flag { width: 24px; height: 24px; border-radius: 3px; flex: none; }
.sc-name { font-family: var(--font-cond); font-size: 1.15rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
.sc-elo { font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); }
.sc-elo small { margin-left: 0.25em; font-size: 0.62em; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.sc-wr { font-size: 0.85em; color: var(--muted); padding: 1px 6px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.sc-mid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.85em; color: var(--muted); }
.sc-form { display: inline-flex; gap: 3px; }
.sc-form i { width: 8px; height: 8px; border-radius: 50%; background: #e6857a; }
.sc-form i.w { background: #7fc48d; }
.sc-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.sc-facts li { font-size: 0.88em; line-height: 1.3; padding: 2px 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); border-left: 3px solid var(--line); }
.sc-facts li.good { border-left-color: #7fc48d; }
.sc-facts li.bad { border-left-color: #e6857a; }
.sc-counter { margin-top: 6px; font-size: 0.88em; }
.sc-counter b { display: block; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.sc-expect { font-size: 0.88em; line-height: 1.5; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sc-expect b { color: var(--text); font-weight: 600; margin-right: 2px; }
.sc-expect .bad { color: #e6857a; font-weight: 600; }
.sc-expect .sep { font-style: normal; opacity: 0.5; margin: 0 2px; }
.sc-units { display: inline-flex; gap: 3px; vertical-align: middle; }
.sc-units img { width: 22px; height: 22px; }
.sc-units .u-txt + .u-txt::before { content: ', '; }
.ico-o { display: inline-flex; align-items: center; gap: 2px; padding: 0 5px 0 2px; border-radius: 4px; background: rgba(255,255,255,0.06); font-weight: 600; white-space: nowrap; }
.ico-o .ico { height: 1.3em !important; vertical-align: middle; margin: 0 !important; }

/* counter cheat sheet (overlay + home) */
.ct-list { display: grid; gap: 6px; }
.ct-row { display: grid; grid-template-columns: minmax(0, 0.9fr) 14px minmax(0, 1.6fr); align-items: center; gap: 6px; }
.ct-u { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-weight: 600; }
.ct-u img { width: 1.8em; height: 1.8em; flex: none; }
.ct-u span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-ans .ct-u span { white-space: normal; overflow-wrap: anywhere; } /* c172 : « Lanceiros / Piqueiros » coupé par l’ellipse dans le bilan AoE II (89 px) */
.ct-row > .ct-u span { white-space: normal; overflow-wrap: break-word; } /* threat name wraps: « Gunpowder infantry (Streltsy, Janissaries) » lost its second half */
.ct-arrow { color: var(--gold); text-align: center; }
.ct-ans { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ct-ans .ct-u { font-weight: 500; color: var(--muted); }
.ct-ans .ct-u:first-child { color: #7fc48d; font-weight: 600; }
.sc-chance { font-size: 0.85em; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.sc-chance.good { color: #7fc48d; } .sc-chance.bad { color: #e6857a; }

/* build detail footer: share button + source link */
.detail-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; }

/* Barres de défilement : une seule, fine et aux couleurs de MetaAOE, dans toutes les fenêtres (Matteo 03/11 : la barre
   Windows de base apparaissait encore à certains endroits). Pas de scrollbar-width / scrollbar-color : sous Chromium
   récent ils remplacent ce style par la barre native. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(143, 154, 177, 0.28); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; min-height: 28px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(224, 173, 69, 0.75); }
::-webkit-scrollbar-thumb:active { background-color: var(--gold, #e0ad45); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* --faint (#5d6882) is 3:1 on --panel: kept for decorations; small text that carries info uses this one (5.2:1 on --panel, 4.6:1 on --raised) */
:root { --faint-text: #8490a9; }

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: 44px 1fr;
  grid-template-columns: minmax(0, 1fr); /* a long title bar (live civ pair) shrinks, never widens the page */
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

/* ---------- title bar ---------- */
.titlebar {
  min-width: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 6px 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-cond); font-weight: 700; font-size: 16px; letter-spacing: 0.02em; }
.brand img { width: 22px; height: 22px; }
.live {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 10px; border-radius: 20px;
  background: var(--gold-soft); color: var(--gold);
  font-size: 13px; font-weight: 600;
  min-width: 0; white-space: nowrap; /* one line: a long civ pair is cut with "…", never pushes the buttons to 2 lines */
}
.live::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.live img { flex: none; width: 20px; height: 20px; border-radius: 3px; }
.live-civ { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.titlebar-actions { flex: none; white-space: nowrap; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tb-btn { background: none; border: 1px solid transparent; border-radius: var(--radius-s); padding: 4px 10px; color: var(--muted); font-weight: 500; }
.tb-btn:hover { color: var(--text); border-color: var(--line); }
.win-btn { width: 36px; height: 30px; background: none; border: 0; border-radius: var(--radius-s); color: var(--muted); font-size: 14px; }
.win-btn:hover { background: var(--hover); color: var(--text); }
.win-close:hover { background: #a3392b; color: #fff; }
/* window controls: their own group, set apart from the menu buttons (a lone « – » read as a stray dash) */
.win-ctrls { display: flex; align-items: center; gap: 2px; margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.win-btn { display: inline-grid; place-items: center; }
.win-btn svg { width: 12px; height: 12px; }

.cols { display: grid; grid-template-columns: 316px minmax(0, 1fr); min-height: 0; }

/* ---------- civ rail ---------- */
.civ-rail { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.rail-top { padding: 10px 10px 6px; display: grid; gap: 8px; }
.civ-filter { padding: 7px 10px; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); }
.civ-filter::placeholder { color: var(--faint-text); }
#civ-list { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; flex: 1; min-height: 0; }
.civ {
  width: 100%; display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 8px; margin: 1px 0;
  background: none; border: 0; border-radius: var(--radius-s);
  text-align: left; color: var(--muted); font-weight: 500;
}
.civ img { width: 28px; height: 28px; border-radius: 3px; object-fit: cover; flex: none; }
.civ-name { min-width: 0; flex: 1; overflow: hidden; line-height: 1.15; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } /* long names on 2 lines, never cut mid-rail */
.civ:hover { background: var(--hover); color: var(--text); }
.civ[aria-current='true'] { background: var(--raised); color: var(--text); box-shadow: inset 3px 0 0 var(--gold); }
.civ .np { width: 22px; height: 20px; line-height: 18px; border-radius: var(--radius-s); border: 1px solid var(--line); color: var(--muted); font-family: var(--font-cond); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; flex: none; } /* number of pro builds: fixed width, the tier letters stay aligned */
.civ .pin { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.civ .playing { font-size: 11px; font-weight: 700; color: var(--ink); background: var(--gold); padding: 0 6px; border-radius: 10px; flex: none; }
.wr { font-family: var(--font-cond); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.is-up { color: #8fcf8a !important; }
.is-down { color: #e6857a !important; }

/* ---------- builds ---------- */
.builds { display: flex; flex-direction: column; min-height: 0; }
.builds-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 16px 20px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.builds-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.builds-head > img { width: 52px; height: 52px; border-radius: 4px; }
.builds-head h1 { margin: 0; font-family: var(--font-cond); font-size: 26px; font-weight: 700; line-height: 1.1; }
.builds-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.head-stats { display: flex; gap: 18px; margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--line); }
.head-stats div { display: flex; flex-direction: column; line-height: 1.15; }
.head-stats b { font-family: var(--font-cond); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.head-stats span { font-size: 12px; color: var(--muted); }
.head-stats .head-patch { align-self: flex-end; font-size: 11px; color: var(--muted); opacity: .8; white-space: nowrap; }
.head-stats.is-none { align-items: center; }
.head-stats.is-none > span { font-size: 13px; color: var(--muted); max-width: 220px; }
.sort { display: flex; gap: 2px; }
.sort button { background: none; border: 0; padding: 5px 10px; border-radius: var(--radius-s); color: var(--muted); font-weight: 600; font-size: 13px; }
.sort button:hover { color: var(--text); }
.sort button[aria-selected='true'] { background: var(--raised); color: var(--text); }

/* shared grid for header + rows */
.cols-head, .row-main {
  display: grid;
  grid-template-columns: 44px minmax(200px, 1fr) 140px 180px 240px;
  align-items: center; gap: 14px;
}
.cols-head { padding: 8px 20px 6px; font-size: 12px; font-weight: 600; color: var(--faint-text); border-bottom: 1px solid var(--line); }
/* the detail of an open build has its own layout: the column labels would only mislead */
.builds:has(.row.is-open) .cols-head, .builds:not(:has(.row)) .cols-head { display: none; }
.build-list { overflow-y: auto; padding: 0 0 20px; flex: 1; min-height: 0; }
/* column labels stick on top of the builds only: they scroll away with them, above the community and counters blocks */
.list-builds > .cols-head { position: sticky; top: 0; z-index: 2; background: var(--ink); }
/* « Community: coming soon »: the line and its button side by side, no hole under the title */
.empty.list-soon { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 20px 16px; }
.list-soon p { margin: 0; }

.row { border-bottom: 1px solid var(--line); }
.row-main { padding: 10px 20px; cursor: pointer; }
.row:hover .row-main { background: var(--hover); }
.row.is-open .row-main { background: var(--raised); }
.row.is-on { box-shadow: inset 3px 0 0 var(--gold); }

.tier {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-s);
  font-family: var(--font-cond); font-weight: 700; font-size: 19px; color: var(--ink);
}
.tier-S { background: #ef6f5b; }
.tier-A { background: #e0ad45; }
.tier-B { background: #8fcf8a; }
.tier-C { background: #6b9bd6; }
.tier-pro { background: var(--text); font-size: 12px; letter-spacing: 0.04em; }
.tier-civ img { width: 34px; height: 34px; border-radius: var(--radius-s); object-fit: cover; display: block; }

/* list sections: "Pro builds" on top, then community builds / MetaAOE openings */
.list-sec {
  display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 16px 20px 6px;
  font-family: var(--font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line);
}
.list-sec.is-pro { color: var(--text); }
.list-sec span { color: var(--faint-text); font-variant-numeric: tabular-nums; }

.row-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title strong { font-size: 16px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-title small { color: var(--muted); font-size: 12px; }
.styles { display: flex; gap: 4px; min-height: 18px; }
.style {
  font-family: var(--font-cond); font-weight: 700; font-size: 12px; letter-spacing: 0.04em;
  padding: 1px 7px; border-radius: 3px; line-height: 16px;
}
/* timing: outlined, type: filled */
.style-early { color: #ef8a78; box-shadow: inset 0 0 0 1px #ef8a78; }
.style-mid { color: #8fb7e6; box-shadow: inset 0 0 0 1px #8fb7e6; }
.style-late { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.style-eco { background: #2f4a37; color: #a6dba1; }
.style-military { background: #4f2a2a; color: #f0a497; }

.row-ages { display: flex; gap: 6px; flex-wrap: wrap; }
.age-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px;
}
.age-chip .age-badge { min-width: 22px; height: 19px; font-size: 12px; padding: 0 4px; }
.no-ages { color: var(--faint-text); font-size: 13px; } /* build without age-up timing: a quiet word, the full reason in the tooltip */
.row-icons { display: flex; gap: 3px; }
.row-icons img { width: 36px; height: 36px; border-radius: 3px; background: rgba(255,255,255,0.04); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn-sm {
  padding: 6px 11px; border-radius: var(--radius-s); white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13px;
}
.btn-sm:hover { border-color: var(--muted); }
/* both labels share one cell: "En overlay" keeps the width of "Mettre en overlay", so the Details button never moves */
.btn-ov { display: inline-grid; background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-ov:hover { filter: brightness(1.08); border-color: var(--gold); }
.btn-ov.is-on { background: transparent; color: var(--gold); }
.btn-ov > span, .btn-ov::after { grid-area: 1 / 1; }
.btn-ov::after { content: attr(data-alt); visibility: hidden; }
.btn-sm[disabled] { opacity: 0.6; cursor: default; }

.ph { display: inline-block; width: 90px; height: 16px; border-radius: 3px; background: var(--raised); }
.ph.wide { width: 150px; height: 28px; }
.muted { color: var(--muted); }

/* expanded concise view */
.row-detail { padding: 4px 20px 18px 78px; background: var(--raised); }
.age-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 12px; align-items: start; }
.age-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  overflow: hidden;
}
.age-block > header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--age, var(--age-0)) 14%, var(--panel));
  border-bottom: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--age, var(--age-0));
}
.age-block > header b { font-family: var(--font-cond); font-size: 18px; }
.age-block > header .muted { font-size: 12px; margin-left: auto; }
.age-block > ol { list-style: none; margin: 0; padding: 0; }
.age-block > ol > li {
  display: grid; grid-template-columns: 50px 34px minmax(0, 1fr); gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  font-size: 15px; line-height: 1.55;
}
.age-block > ol > li:first-child { border-top: 0; }
.age-block > ol > li:nth-child(even) { background: rgba(255, 255, 255, 0.018); }
.st-time { font-family: var(--font-cond); font-weight: 700; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.st-vil {
  align-self: start; justify-self: end;
  min-width: 26px; padding: 0 5px; border-radius: 4px;
  background: var(--panel); border: 1px solid var(--line);
  font-family: var(--font-cond); font-weight: 700; font-size: 16px; text-align: center; font-variant-numeric: tabular-nums;
}
.st-vil:empty { visibility: hidden; }
.st-body { min-width: 0; }
.st-notes { list-style: none; margin: 0; padding: 0; user-select: text; }
.st-notes li { position: relative; padding-left: 14px; margin: 0 0 6px; }
.st-notes li::before { content: ''; position: absolute; left: 0; top: 0.7em; width: 5px; height: 5px; border-radius: 1px; background: var(--age, var(--faint)); opacity: 0.8; }
.st-notes .ico { height: 30px; vertical-align: -9px; margin: 0 2px; }
.ico.is-waiting { display: none; } /* icon still loading after 400 ms: its word stands in (js/desktop.js icoWait) */
.st-res { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.st-res .res { font-size: 14px; padding: 1px 8px 1px 3px; }
.st-res .res img { width: 20px; height: 20px; }
.st-res .res.is-off { display: none; }
/* what moved since the previous step (same cue as the overlay, quieter): gold ring + signed gap; an emptied resource stays to show its -N */
.st-res .res.is-changed { display: inline-flex; background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.st-res .res.is-off.is-changed b { color: var(--muted); }
.st-res .res-gap { margin-left: 3px; font-size: 12px; font-weight: 700; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }

.empty, .err { padding: 24px 20px; color: var(--muted); }
#history .card > .empty { padding: 8px 0; }
.err { color: #e6857a; }
.err .btn { margin-top: 10px; }
.err-hint { color: var(--muted); margin: 6px 0 0; max-width: 52ch; }
.skel { height: 54px; margin: 6px 20px; border-radius: var(--radius-s); background: linear-gradient(90deg, var(--panel), var(--raised), var(--panel)); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
@keyframes skel { to { background-position: -200% 0; } }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-s);
  background: var(--raised); border: 1px solid var(--line); color: var(--text); font-weight: 600;
}
.btn:hover { border-color: var(--muted); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-gold:hover { filter: brightness(1.08); border-color: var(--gold); }

/* narrower windows: drop the icon column first */
@media (max-width: 1230px) {
  .cols-head, .row-main { grid-template-columns: 44px minmax(180px, 1fr) 140px 240px; }
  .cols-head span:nth-child(4), .row-icons { display: none; }
}

/* ---------- dialogs ---------- */
.dlg { padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); width: min(560px, 92vw); max-height: 90vh; }
.dlg::backdrop { background: rgba(8, 11, 20, 0.7); }
.dlg-body { padding: 20px 22px; }
.dlg h2 { margin: 0 0 12px; font-family: var(--font-cond); font-size: 22px; }
.dlg-welcome { width: min(440px, 92vw); text-align: center; }
.dlg-welcome::backdrop { background: radial-gradient(90% 70% at 50% 35%, rgba(224, 173, 69, .10), transparent 65%), #0b0f1a; } /* first launch: the whole window is the language screen, nothing of the desktop shows through */
.dlg-welcome { max-height: calc(100vh - 24px); overflow-y: auto; }
.welcome-logo { width: 56px; height: 56px; margin: 4px auto 10px; display: block; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 6px; }
legend { font-weight: 700; padding: 0 8px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.lang-grid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 12px; }
fieldset .lang-grid { justify-content: flex-start; }
.lang { padding: 7px 14px; border-radius: var(--radius-s); background: var(--ink); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.lang:hover { border-color: var(--muted); }
.lang { position: relative; }
/* chosen language: solid gold + check (same total padding, so the grid never reflows on a pick); keyboard focus: thin ring only */
.lang.is-on { border-color: var(--gold); color: var(--ink); background: var(--gold); padding: 7px 9px 7px 19px; }
.lang.is-on::before { content: ''; position: absolute; left: 8px; top: 50%; width: 4px; height: 8px; margin-top: -6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lang:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.lang.is-on:focus-visible { outline-color: var(--text); }
.field-row { display: flex; gap: 8px; }
.field-row input, textarea { flex: 1; padding: 8px 10px; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); }
textarea { width: 100%; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; user-select: text; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.range { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.range input { width: 200px; accent-color: var(--gold); }
.check input { accent-color: var(--gold); }
/* dark selects (settings, history compare, plan): no white native control; color-scheme darkens the open list */
select {
  appearance: none; -webkit-appearance: none; color-scheme: dark;
  min-height: 30px; padding: 4px 30px 4px 10px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text);
  background-color: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f9ab1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select:hover { border-color: var(--muted); }
select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
select option { background: var(--panel); color: var(--text); }
select option:checked { background: var(--hover); color: var(--gold); }
.range select { min-width: 200px; }
/* settings footer: quit (discreet, left) and close (right) */
.dlg-actions.set-actions { justify-content: space-between; align-items: center; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-quit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.btn-quit { padding: 4px 0; background: none; border: 0; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.btn-quit:hover, .btn-quit:focus-visible { color: #e6857a; text-decoration-color: currentColor; outline: none; }
.btn-quit:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.set-quit small { color: var(--faint-text); font-size: 12px; }
.check-hint { margin: -6px 0 8px 28px; } /* explains the checkbox right above, aligned on its label */
.profile-results { list-style: none; padding: 0; margin: 8px 0 0; }
.profile-results button { width: 100%; text-align: left; padding: 6px 8px; background: none; border: 0; border-radius: var(--radius-s); display: flex; justify-content: space-between; color: var(--text); }
.profile-results button:hover { background: var(--hover); }
.profile-results small { color: var(--muted); }
.profile-current { margin-bottom: 8px; color: var(--gold); font-weight: 600; }
.keys { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 0; }
.keys dd { margin: 0; }
kbd { font-family: var(--font-cond); font-weight: 700; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--radius-s); background: var(--ink); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg-welcome .dlg-actions { justify-content: center; }
.error { color: #e6857a; }


/* in the flow at the bottom of the main column (js toast()): the view shrinks, nothing is covered, not even the ad */
.toast {
  flex: none; margin: 0 20px 12px; padding: 9px 16px;
  background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius-m);
  font-weight: 600; font-size: 14px; line-height: 1.4; text-wrap: pretty;
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* help tip next to a control (js coach()): seen once, closed with ×, Escape or a click elsewhere */
.coach {
  position: fixed; z-index: 50; max-width: 300px; display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px 10px 14px;
  background: var(--raised); border: 1px solid var(--gold); border-radius: var(--radius-m); box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  font-size: 14px; font-weight: 600; line-height: 1.45; text-wrap: pretty; animation: toast-in .18s ease-out;
}
.coach p { margin: 0; }
.coach kbd { font-size: 13px; white-space: nowrap; }
.coach::before { /* arrow toward the control */
  content: ''; position: absolute; left: calc(var(--ax, 50%) - 6px); top: -7px; width: 11px; height: 11px;
  background: var(--raised); border: solid var(--gold); border-width: 1px 0 0 1px; transform: rotate(45deg);
}
.coach.is-above::before { top: auto; bottom: -7px; transform: rotate(225deg); }
.coach-x { flex: none; width: 24px; height: 24px; margin: -4px 0 0; padding: 0; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.coach-x:hover, .coach-x:focus-visible { color: var(--text); background: var(--hover); }
@media (prefers-reduced-motion: reduce) { .coach { animation: none; } }

/* ad slot: fixed 300x250, always visible at the bottom of the civ rail */
.ad-slot { flex: none; padding: 6px 8px 8px; border-top: 1px solid var(--line); }
.ad-label { display: block; font-size: 11px; color: var(--faint-text); margin-bottom: 3px; }
.rail-legal { flex: none; margin: 0; padding: 6px 12px 8px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.35; color: var(--muted); text-wrap: pretty; }
.ad-slot:not([hidden]) + .rail-legal { border-top: 0; padding-top: 0; }
.ad-box { width: 300px; height: 250px; background: transparent; border-radius: 4px; overflow: hidden; }

/* Overwolf ad container: transparent, nothing inside but the SDK's ad; the no-ad placeholder (logo on a flat color, exact
   container size) sits right behind it and only shows when no ad is served. Slot that cannot be fully visible: removed. */
.ad-frame { position: relative; flex: none; background: transparent; }
.ad-frame > .ad-box { position: relative; z-index: 1; background: transparent; }
.ad-ph { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--ink); border-radius: 4px; color: var(--faint); font-family: var(--font-cond); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; pointer-events: none; }
.ad-ph img { height: min(72px, calc(100% - 30px)); width: auto; opacity: 0.45; }
.ad-ph span { opacity: 0.7; }
.ad-slot.ad-nofit { display: none; }

/* live opponent scouting, above the build list */
.scout-panel { margin: 12px 16px 0; padding: 12px 14px; border: 1px solid var(--gold); border-radius: var(--radius-m); background: linear-gradient(180deg, var(--gold-soft), transparent); font-size: 15px; }
.sp-head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 8px; font-weight: 700; }
.sp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

/* onboarding step 2 + nudge to link a profile */
.wel-perks { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; gap: 8px; text-align: left; }
.wel-perks li { padding: 8px 10px 8px 34px; border-radius: var(--radius-s); background: var(--raised); position: relative; font-size: 14px; line-height: 1.35; }
.wel-perks li::before { content: '\2713'; position: absolute; left: 11px; top: 8px; color: var(--gold); font-weight: 700; }
#wel-2 .field-row, #wel-2 .profile-results { text-align: left; }
.wel-done { color: #7fc48d; font-weight: 600; }
.link-nudge { margin: 12px 16px 0; padding: 10px 12px 10px 14px; display: flex; align-items: center; gap: 12px; border-radius: var(--radius-m); background: var(--raised); border: 1px dashed var(--gold); font-size: 14px; }
.link-nudge span { flex: 1; }
.nudge-x { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 4px 6px; }
.nudge-x:hover { color: var(--text); }

/* premium */
.tb-premium { color: var(--gold); border: 1px solid rgba(224, 173, 69, 0.45); border-radius: 999px; padding-left: 12px; padding-right: 12px; }
.tb-premium:hover { background: var(--gold-soft); }
.tb-premium.is-active::before { content: '\2605  '; }
/* Premium « bientôt » : petite carte centrée, emblème doré */
.dlg-premium { width: min(400px, 92vw); overflow: hidden; background: radial-gradient(120% 70% at 50% 0%, rgba(224, 173, 69, .16), transparent 60%), var(--panel); border-color: rgba(224, 173, 69, .35); }
.prem-body { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 28px 22px; }
.prem-emblem { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; line-height: 1; color: #1a1305; background: linear-gradient(145deg, #f7d57c, #d9a33a); box-shadow: 0 0 0 6px rgba(224, 173, 69, .12), 0 10px 26px rgba(224, 173, 69, .25); }
.prem-tag { margin-top: 14px; padding: 3px 10px; border-radius: 999px; font: 700 11px/1.4 var(--font-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(224, 173, 69, .45); background: rgba(224, 173, 69, .08); }
.dlg-premium h2 { margin: 10px 0 8px; font-size: 24px; }
.prem-lead { margin: 0; max-width: 30ch; font-size: 15px; line-height: 1.5; color: var(--muted); }
.prem-actions { justify-content: center; margin-top: 20px; }
.prem-status:empty { display: none; }
.prem-status { font-weight: 600; color: var(--gold); min-height: 1em; }

/* ---------- home: your profile, the patch meta, build of the day ---------- */
.home-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: none; color: var(--muted); font-weight: 600; font-size: 14px; text-align: left; }
.home-btn:hover { background: var(--hover); color: var(--text); }
.home-btn[aria-current='true'] { background: var(--raised); color: var(--text); border-color: var(--gold); }
.home-ico { color: var(--gold); width: 28px; text-align: center; }
.home { display: none; overflow-y: auto; padding: 18px 20px 28px; flex: 1; min-height: 0; }
.builds.is-home #home { display: block; }
.builds.is-history #history { display: block; }
.builds.is-maps #maps { display: block; }
.builds.is-history .civ-part, .builds.is-history .link-nudge, .builds.is-maps .civ-part, .builds.is-maps .link-nudge { display: none; }
.builds.is-home .civ-part { display: none; }
.home h2 { font-family: var(--font-cond); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin: 0 0 10px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; min-width: 0; }
.card.span2 { grid-column: 1 / -1; }
.pro-civs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.pro-civ { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--raised); color: var(--text); font-weight: 600; font-size: 14px; }
.pro-civ:hover { border-color: var(--gold); }
.pro-civ img { width: 26px; height: 26px; border-radius: 3px; }
.me-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.me-top b { font-family: var(--font-cond); font-size: 24px; }
.me-top .sc-elo { font-size: 22px; }
.me-top .sc-elo small { margin-left: 3px; }
.me-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 18px; margin-top: 12px; }
.me-cols h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.civ-rows { max-height: 150px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding-right: 4px; }
.civ-rows > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.civ-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.civ-line b, .civ-line em { white-space: nowrap; }
.civ-line.no-img { grid-template-columns: minmax(0, 1fr) auto auto; }
.civ-line img { width: 22px; height: 22px; border-radius: 3px; }
.civ-line span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.civ-line em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.civ-line b.is-up { color: #7fc48d; } .civ-line b.is-down { color: #e6857a; }
.map-tag { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 1px 5px; margin-right: 6px; border-radius: 3px; vertical-align: 1px; }
.map-tag.is-best { color: #7fc48d; background: rgba(127,196,141,.16); } .map-tag.is-worst { color: #e6857a; background: rgba(230,133,122,.16); }
.civ-line.is-plan { grid-template-columns: 22px minmax(0, 1fr) auto auto 8px; cursor: pointer; margin: 0 -6px; padding: 4px 6px; border-radius: var(--radius-s); }
.civ-line.is-plan:hover, .civ-line.is-plan:focus-visible, .civ-line.is-plan.is-on { background: var(--raised); outline: none; }
.civ-line.is-plan:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.civ-line.is-plan.is-on { box-shadow: inset 3px 0 0 var(--gold); }
.civ-line.is-plan::after { content: '\203A'; color: var(--gold); font-weight: 700; margin-left: 2px; }
/* narrow column (three side by side): the name gets two lines and the % sits over the game count, never « Maison d… » */
.me-cols > div { container-type: inline-size; min-width: 0; }
@container (max-width: 260px) {
  .civ-line, .civ-line.is-plan { grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0; }
  .civ-line.is-plan { grid-template-columns: 22px minmax(0, 1fr) auto 8px; }
  .civ-line img { grid-column: 1; grid-row: 1 / span 2; }
  .civ-line span { grid-column: 2; grid-row: 1 / span 2; white-space: normal; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; }
  .civ-line b { grid-column: 3; grid-row: 1; text-align: right; line-height: 1.2; }
  .civ-line em { grid-column: 3; grid-row: 2; text-align: right; font-size: 12px; line-height: 1.2; }
  .civ-line.is-plan::after { grid-column: 4; grid-row: 1 / span 2; }
  .civ-line.no-img { grid-template-columns: minmax(0, 1fr) auto; }
  .civ-line.no-img span { grid-column: 1; }
}
/* profile: rank badge, progress, civs played */
.me-rank { width: 34px; height: 34px; flex: none; object-fit: contain; }
.rank-badge { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.rank-badge .me-rank { width: 60px; height: 72px; }
.me-world { font-family: var(--font-cond); font-size: 14px; font-weight: 600; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.rank-name { font-family: var(--font-cond); font-size: 14px; font-weight: 600; line-height: 1; color: var(--muted); white-space: nowrap; }
.me-streak { font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.me-streak.is-up { color: #7fc48d; background: rgba(127, 196, 141, 0.12); }
.me-streak.is-down { color: #e6857a; background: rgba(230, 133, 122, 0.12); }
.me-prog { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.me-prog h3, .me-cols h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.me-prog h3 { flex-basis: 100%; margin: 0; }
.prog-chart { flex-basis: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.prog-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.prog-chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.prog-chart .area { fill: var(--gold-soft); }
.prog-chart circle { stroke: var(--panel); stroke-width: 1.5; fill: #e6857a; }
.prog-chart circle.w { fill: #7fc48d; }
/* hover targets over the Elo dots, with the game's Elo change */
.prog-plot { position: relative; }
.prog-dot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; cursor: default; outline: none; }
.prog-dot:hover, .prog-dot:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
.prog-dot::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; translate: -50% 0; padding: 4px 8px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); color: var(--text); font: 600 12px/1.2 var(--font-cond); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 5; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.prog-dot.w::after { color: #7fc48d; }
.prog-dot.l::after { color: #e6857a; }
.prog-dot:hover::after, .prog-dot:focus-visible::after { opacity: 1; }
.prog-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-trend { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-trend.is-up { color: #7fc48d; } .prog-trend.is-down { color: #e6857a; }
.prog-runs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-runs .up { color: #7fc48d; } .prog-runs .down { color: #e6857a; }
.hist-prog { margin: 0 0 14px; max-width: 640px; }
.prog-next { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.me-rank-s { width: 26px; height: 30px; object-fit: contain; }
.me-best { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 14px; border-radius: var(--radius-s); background: var(--gold-soft); }
.me-best img { width: 36px; height: 36px; border-radius: 4px; }
.me-best small { display: block; font-size: 11px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.me-best div > b { display: block; font-family: var(--font-cond); font-size: 18px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-best span { font-size: 13px; color: var(--muted); }
.me-best span b.is-up { color: #7fc48d; } .me-best span b.is-down { color: #e6857a; }
.civ-line.is-link { cursor: pointer; margin: 0 -6px; padding: 4px 6px; border-radius: var(--radius-s); }
.civ-line.is-link:hover, .civ-line.is-link:focus-visible { background: var(--raised); outline: none; }
.civ-line.is-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.me-retry { margin-top: 12px; }
.me-actions { display: flex; flex-wrap: wrap; gap: 0 10px; }
.me-lead { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 60ch; }
.me-cta > div:first-of-type { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; } /* no profile linked: one line + the button */
.me-cta > div:first-of-type .me-lead { margin: 0; flex: 1 1 300px; } .me-cta > div .btn { margin: 0; flex: none; }
/* first screen until a build went to the overlay and a summary opened: what the app does, one action */
.home-start { border-color: rgba(224, 173, 69, .45); background: linear-gradient(180deg, var(--gold-soft), transparent 70%), var(--panel); }
.home-start .hs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.home .home-start h2 { margin: 0; flex: 1 1 320px; font-size: 21px; line-height: 1.2; text-transform: none; letter-spacing: 0; color: var(--text); text-wrap: balance; }
.home-start .hs-head .btn { flex: none; }
.hs-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hs-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; color: var(--text); }
.hs-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font: 600 13px/1 var(--font-cond); font-variant-numeric: tabular-nums; }
.hs-steps li.done { color: var(--muted); }
.hs-steps li.done .hs-n { background: #7fc48d; border-color: #7fc48d; color: var(--ink); }
.hs-n svg { width: 14px; height: 14px; }
/* « Choisir mon build »: the civ it opens, named on the button */
#start-go { display: inline-flex; align-items: center; gap: 8px; }
#start-go img { width: 20px; height: 20px; border-radius: 3px; }
#start-go .hs-civ { padding-left: 8px; border-left: 1px solid rgba(16, 22, 36, .35); font-weight: 500; }
/* last end-of-game summary on the home */
.hsu-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.hsu-civs { display: flex; flex: none; }
.hsu-civs img { width: 36px; height: 36px; border-radius: 4px; }
.hsu-civs img + img { margin-left: -8px; box-shadow: -2px 0 0 var(--panel); }
.hsu-mid { flex: 1 1 260px; min-width: 0; }
.home .hsu-mid h2 { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
.hsu-new { padding: 1px 7px; border-radius: var(--radius-s); background: var(--gold); color: var(--ink); font-size: 11px; letter-spacing: .04em; }
.hsu-mid p { margin: 0; font-family: var(--font-cond); font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsu-mid p > span { color: var(--muted); font-weight: 500; }
#hsu-res:not(:empty) { margin-right: 8px; } #hsu-res.win { color: #7fc48d; } #hsu-res.loss { color: #e6857a; }
#hsu-sub:not(:empty) { margin-left: 10px; color: var(--muted); font: 400 13px var(--font); font-variant-numeric: tabular-nums; }
#hsu-sub .up { color: #7fc48d; } #hsu-sub .down { color: #e6857a; }
.home-sum .hsu-head .btn { flex: none; }
.hsu-pts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 12px 0 0; }
.hsu-pts > div { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--raised); }
.hsu-pts > div + div { background: var(--gold-soft); border-color: rgba(224, 173, 69, .35); }
.hsu-pts dt { color: var(--gold); font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.hsu-pts dd { margin: 0; font-size: 14px; line-height: 1.4; color: var(--text); }
.me-perks { margin: 12px 0 16px; padding-left: 18px; color: var(--text); font-size: 14px; display: grid; gap: 6px; }
.me-perks li::marker { color: var(--gold); }
#home-plan { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
#home-plan h3 { margin: 0 0 8px; font-size: 14px; color: var(--text); }
#home-plan h3 em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; }
#home-plan h4 { margin: 12px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-mu { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.plan-mu.is-up { color: #7fc48d; } .plan-mu.is-down { color: #e6857a; }
.plan-build { margin-top: 12px; }
.plan-picks { list-style: none; margin: 0; padding: 0; }
.plan-picks .plan-build { margin-top: 0; padding: 8px 0; }
.plan-picks .plan-build + .plan-build { border-top: 1px solid var(--line); }
.plan-picks .is-alt { flex-wrap: nowrap; gap: 10px; }
.plan-picks .is-alt .bod-text { min-width: 0; }
.plan-picks .is-alt .bod-text b { font-size: 16px; }
.plan-picks .is-alt .btn { flex: none; }
.plan-picks .bod-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-rank { width: 44px; text-align: center; font-family: var(--font-cond); font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bod { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bod img { width: 44px; height: 44px; border-radius: 4px; }
.bod .bod-text { flex: 1; min-width: 200px; }
.bod .bod-text b { display: block; font-family: var(--font-cond); font-size: 20px; }
.bod .bod-text span { color: var(--muted); font-size: 13px; }
.home .empty { color: var(--muted); font-size: 14px; }
.builds.is-home .link-nudge { display: none; }
/* AoE IV civ with few builds: counters under the list */
.list-extra { padding: 12px 20px 48px; } /* 48px: the last row clears the « More below » pill */
/* counters under the list: aligned columns (threat, arrow, up to 3 answers), each name in its own column */
.list-extra .ct-row, .card.span2 .ct-row { grid-template-columns: minmax(150px, 0.6fr) 14px minmax(0, 2fr); }
.list-extra .ct-ans, .card.span2 .ct-ans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
.list-extra .ct-u span { white-space: normal; overflow-wrap: break-word; line-height: 1.2; }
.card.span2 .ct-ans .ct-u span { overflow-wrap: break-word; }
/* an icon that failed to load is removed: keep its slot so every name starts at the same place */
.ct-u:not(:has(img))::before { content: ''; flex: none; width: 1.8em; height: 1.8em; }

/* game switch (AoE IV / AoE II) */
.game-switch { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line); margin-left: 6px; }
.game-switch button { border: 0; background: none; color: var(--muted); font-family: var(--font-cond); font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 999px; letter-spacing: 0.02em; }
.game-switch button[aria-pressed='true'] { background: var(--gold); color: var(--ink); }
.game-switch button:hover:not([aria-pressed='true']) { color: var(--text); }
body[data-game='aoe2'] #sort { display: none; }
body[data-game='aoe2'] .home-grid > .card:not(#home-me):not(#home-hist) { grid-column: 1 / -1; } /* AoE II: profile + last games side by side like AoE IV, the other cards full width */
body:not([data-game='aoe2']) .only-aoe2, body[data-game='aoe2'] .only-aoe4 { display: none; }

/* AoE II civ bonuses above the builds */
.civ-bonus { margin: 12px 20px 0; padding: 12px 14px; border-radius: var(--radius-m); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.cb-type { font-family: var(--font-cond); font-weight: 700; color: var(--gold); font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.cb-type::-webkit-details-marker { display: none; }
.cb-type::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.civ-bonus[open] > .cb-type { margin-bottom: 6px; }
.civ-bonus[open] > .cb-type::after { transform: rotate(45deg); }
.civ-bonus ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 14px; }
.cb-techs { margin-top: 8px; font-size: 13px; color: var(--muted); }
.cb-techs b { color: var(--text); font-weight: 600; }
.cb-lm ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 13px; }
.cb-lm li b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.civ-bonus.is-aoe4 + .no-pro { margin-top: 12px; }

/* bottom banner: fixed 728x90 under the builds and the home view */
.ad-bottom { flex: none; display: flex; justify-content: center; padding: 6px 0; border-top: 1px solid var(--line); background: var(--panel); }
.ad-728 { width: 728px; height: 90px; background: transparent; border-radius: 4px; overflow: hidden; }

.lvl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: -2px 0 10px; }
.lvl-chips button { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.lvl-chips button[aria-pressed='true'] { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.nav-row { display: flex; gap: 6px; }
.nav-row .home-btn { flex: 1 1 auto; width: auto; gap: 6px; padding: 8px; }
.nav-row .home-ico { width: auto; }
.tier-D { background: #8f9ab1; }
/* tier letter in the civ rail and meta list (MetaTFT style) */
.civ .rc { display: flex; flex-direction: column; align-items: center; gap: 1px; flex: none; width: 58px; } /* same width for every label: np and tier columns line up on all rows */
.civ .rc small { font-size: 11px; line-height: 1.05; font-weight: 600; letter-spacing: 0.02em; color: var(--faint-text, var(--muted)); text-align: center; max-width: 58px; text-wrap: balance; }
.civ .tl { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; font-family: var(--font-cond); font-weight: 700; font-size: 13px; color: var(--ink); flex: none; }

/* match history */
.hist-sum { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.hist-sum b { font-family: var(--font-cond); font-size: 24px; }
.hist-sum span { color: var(--muted); font-size: 13px; }
.hist-trends { margin-bottom: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.hist-trends h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.hist-trends h3 .hm-lead { margin-left: 6px; font-weight: 400; }
.hist-trends .hs-ins { margin: 0; }
.tf-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.tf-row .tf { display: inline-block; width: 22px; line-height: 22px; text-align: center; border-radius: 5px; font-style: normal; font-weight: 700; font-size: 11px; }
.tf-row .tf.w { background: rgba(127,196,141,.18); color: #7fc48d; } .tf-row .tf.l { background: rgba(230,133,122,.18); color: #e6857a; }
.tf-row b { margin-left: 8px; } .tf-row b.up { color: #7fc48d; } .tf-row b.down { color: #e6857a; }
.hist-trends .tf-civs { margin: 0; } .hist-trends .tf-civs h3 { margin-right: 6px; }
.hist-maps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.hist-maps h3 { margin: 0 6px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.hist-maps span, .hist-maps button { padding: 3px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font: inherit; color: inherit; }
.hist-maps button { cursor: pointer; } .hist-maps button:hover { border-color: var(--gold); }
.hist-maps .hm-up b { color: #7fc48d; } .hist-maps .hm-down b { color: #e6857a; }
.hist-maps small { color: var(--muted); margin-left: 2px; }
.hist-maps button img, .tf-civs span img { width: 18px; height: 18px; border-radius: 3px; vertical-align: -4px; margin-right: 6px; } /* civ flag in « Tes matchups » */
.hist-maps h3 .hm-lead { margin-left: 6px; font-weight: 400; } /* short visible explanation; the title keeps the full one */
.hist-bans button small { font-size: 12px; font-variant-numeric: tabular-nums; } /* civ's gap: after your record, quieter */
.hist-maps .map-skel { flex: 1; height: 27px; padding: 0; border: 0; } /* = one veto line */
.hist-list { display: grid; gap: 6px; }
.hist-preview { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.hist-preview h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.hist-preview .hp-body { pointer-events: none; user-select: none; opacity: .6; -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); }
.hist-row { display: grid; grid-template-columns: 6px 96px minmax(0, 2.2fr) minmax(0, 1fr) 56px 84px 24px; align-items: center; gap: 10px; padding: 8px 12px 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); width: 100%; font: inherit; font-size: 14px; color: inherit; text-align: left; cursor: pointer; }
.hist-row { overflow: hidden; } /* the result bar runs the full height, flush with the left edge */
.hist-row .bar { align-self: stretch; margin: -8px 0; border-radius: 0; }
.hist-row.w .bar { background: #7fc48d; } .hist-row.l .bar { background: #e6857a; }
.hist-row .hres { font-family: var(--font-cond); font-weight: 700; overflow-wrap: anywhere; }
.hist-row.w .hres { color: #7fc48d; } .hist-row.l .hres { color: #e6857a; }
.hist-sum b.up { color: #7fc48d; } .hist-sum b.down { color: #e6857a; }
.hist-row .vs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hist-row .vs img { width: 24px; height: 24px; border-radius: 3px; }
.hist-row .vs img, .hist-row .vs i { flex: none; overflow-wrap: normal; }
.hist-row .vs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-row .vs small { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hist-row .muted { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; line-height: 1.3; }
.hist-row .tbadge { font-style: normal; font-size: 11px; font-weight: 600; margin-left: 6px; padding: 1px 6px; border-radius: 8px; color: var(--accent, #c9a24a); border: 1px solid currentColor; white-space: nowrap; }
.hist-row .hd { display: block; overflow-wrap: anywhere; }
.hist-row .elo { font-variant-numeric: tabular-nums; text-align: right; }
.hist-row .elo .up { color: #7fc48d; } .hist-row .elo .down { color: #e6857a; }
.hist-row:hover { border-color: var(--gold); background: var(--hover); }
.hist-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hist-row .hchev { width: 16px; height: 16px; color: var(--faint); justify-self: center; }
.hist-row:hover .hchev { color: var(--gold); }
/* one game, opened from the history */
.hg-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hg-back { display: inline-flex; align-items: center; gap: 6px; }
.hg-back .hchev { width: 14px; height: 14px; transform: scaleX(-1); }
.hg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hg-res b { display: block; font-family: var(--font-cond); font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: 0.02em; }
.hist-game.w .hg-res b { color: #7fc48d; } .hist-game.l .hg-res b { color: #e6857a; }
.hg-res span { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.hg-res .sep, .hg-x { margin: 0 6px; color: var(--faint); font-style: normal; }
.hg-res .hg-mode { font-style: normal; } .hg-res.no-mode .hg-mode { display: none; } /* c166 : le mode sort de la ligne quand elle touche l'Elo */
.hg-elo { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-cond); font-variant-numeric: tabular-nums; font-size: 18px; }
.hg-elo b { font-size: 30px; }
.hg-elo .muted, .hg-elo small { color: var(--muted); font-style: normal; }
.hg-elo small { font-size: 13px; }
.hg-elo .up { color: #7fc48d; font-weight: 700; } .hg-elo .down { color: #e6857a; font-weight: 700; }
.hg-vs { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.hg-opps { display: grid; gap: 10px; flex: 1; min-width: 0; }
.hg-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hg-side.me { flex: 1; }
.hg-side img { width: 48px; height: 48px; border-radius: var(--radius-s); flex: none; }
.hg-side div { min-width: 0; }
.hg-side b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-side span { display: block; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hg-x { font-family: var(--font-cond); font-size: 15px; text-transform: uppercase; }
/* 1v1 en miroir (Matteo 11/11) : toi à gauche, VS au centre, l'adversaire calé à droite, drapeau vers l'extérieur */
.hg-vs:not(.team) .hg-x { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-style: normal; font-weight: 700; }
.hg-vs:not(.team) .hg-opps { flex: 1; justify-items: end; }
.hg-vs:not(.team) .hg-side.opp { flex-direction: row-reverse; text-align: right; }
.hg-vs.team { align-items: stretch; }
.hg-vs.team .hg-x { align-self: center; }
.hg-vs.team .hg-opps { align-content: start; gap: 8px; }
.hg-vs.team .hg-side img { width: 40px; height: 40px; }
.hg-vs.team .hg-side b { font-size: 15px; }
.hg-thead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.hg-thead b { font-family: var(--font-cond); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hg-thead span { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-row .vs.tv { gap: 2px; overflow: hidden; }
.hist-row .vs.tv img { width: 18px; height: 18px; }
.hist-row .vs.tv i { margin: 0 2px; }
.hist-row .vs.tv small { margin-left: 3px; }
.hg-side.ally b { font-weight: 600; }
/* short window (1280x690): the 2v2 roster on one line per player, so the first « Fix next time » line shows without scrolling (audit c44) */
@media (max-height: 740px) {
  .hg-vs.team { padding: 8px 0; }
  .hg-vs.team .hg-opps { gap: 4px; }
  .hg-vs.team .hg-side img { width: 28px; height: 28px; }
  .hg-vs.team .hg-side div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .hg-vs.team .hg-side span { flex: none; white-space: nowrap; }
  .hg-vs.team .hg-side b { flex: 0 1 auto; min-width: 0; }
  .hist-game:has(.hg-vs.team) .hg-res b { font-size: 34px; }
  .hist-game:has(.hg-vs.team) .hg-head { padding-bottom: 8px; }
}
.hg-tres { font-family: var(--font-cond); font-size: 13px; font-weight: 700; font-style: normal; letter-spacing: 0.04em; }
.hg-tres.up { color: #7fc48d; } .hg-tres.down { color: #e6857a; }
.hg-more:empty { display: none; }
.hg-more { padding-top: 14px; border-top: 1px solid var(--line); }
.hg-more h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.hg-more h3 small { margin-left: 6px; color: var(--faint-text); font-variant-numeric: tabular-nums; }
.hg-more .hist-list, .hg-more .sc-card { margin-bottom: 14px; }
.hg-sum { --me: var(--age-3); --op: #e6857a; margin-bottom: 18px; } /* toi en bleu, lui en rouge : les mêmes couleurs que la carte */
/* verdict d'une phrase, 3 moments-clés au plus (chacun déplace la carte), carte, ce qu'il faut retenir, puis le détail replié */
.hg-verdict { --vd-good: #7fc48d; --vd-bad: #ee9a55; display: grid; gap: 10px; margin: 0 0 14px; }
.hg-vd-main, .hg-vd-other { padding: 14px 16px; border-radius: var(--radius-m); background: var(--raised); border: 1px solid var(--line); }
.hg-vd-main.is-good { --vd: var(--vd-good); } .hg-vd-main.is-bad, .hg-vd-other.is-bad { --vd: var(--vd-bad); } .hg-vd-other.is-good { --vd: var(--vd-good); }
.hg-vd-main.is-good, .hg-vd-main.is-bad { background: color-mix(in srgb, var(--vd) 9%, var(--raised)); border-color: color-mix(in srgb, var(--vd) 45%, var(--line)); }
.hg-vd-other { padding: 12px 16px; border-left: 4px solid var(--vd, var(--line)); }
.hg-verdict h3, .hg-keep h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hg-verdict h3 { color: var(--vd, var(--muted)); font-size: 12.5px; }
/* audit c86-c92: no lone word at the end of a line, a number stays with its unit (hgGlue wraps them in hg-nw) */
.hist-game { text-wrap: pretty; } hg-nw, hg-nb { white-space: nowrap; } .hist-game th { text-wrap: balance; }
.hg-vd-line { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 700; color: var(--vd, var(--text)); text-wrap: balance; }
.hg-vd-moments { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.hg-vd-other .hg-vd-moments { margin-top: 4px; }
/* a win with nothing to fix: a small card as readable as the others, not a grey footnote (audit c33) */
.hg-vd-none { margin: 0; padding: 12px 16px; border-radius: var(--radius-m); background: var(--raised); border: 1px solid var(--line); border-left: 4px solid var(--vd-good); font-size: 15px; font-weight: 600; color: var(--text); }
.hg-vd-none::before { content: '✓'; margin-right: 8px; color: var(--vd-good); font-weight: 700; }
/* c148 (audit c147 #1): a loss shows its best real good fact on one line under the cause, above the fold, never inside an orange card */
.hg-vd-well { margin: 0; padding: 9px 16px; border-radius: var(--radius-m); background: color-mix(in srgb, var(--vd-good) 7%, var(--raised)); border: 1px solid color-mix(in srgb, var(--vd-good) 30%, var(--line)); border-left: 4px solid var(--vd-good); font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--text); }
.hg-vd-well .hg-well-k { margin-right: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--vd-good); white-space: nowrap; }
.hg-vd-well .hg-well-k::before { content: '✓'; margin-right: 6px; }
/* c157 : en fenêtre basse la ligne verte se serre (défaite ES 690 : bas des cartes « Aussi » 631 > 630) */
@media (max-height: 740px) { .hg-vd-well { padding: 6px 14px; } }
.hg-vd-moments li > button, .hg-vd-moments li > .row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: baseline; gap: 10px; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; line-height: 1.35; text-align: left; }
.hg-vd-moments li > .row { grid-template-columns: 48px minmax(0, 1fr); }
.hg-vd-moments li > button { cursor: pointer; }
.hg-vd-moments li > button:hover, .hg-vd-moments li > button:focus-visible, .hg-vd-moments li > button[aria-current] { border-color: var(--gold); outline: none; }
.hg-vd-moments b { font-variant-numeric: tabular-nums; color: var(--muted); }
.hg-vd-moments .is-bad b { color: var(--vd-bad); } .hg-vd-moments .is-good b { color: var(--vd-good); }
.hg-vd-moments b.nt { font-size: 15px; }
/* a list of ✓ lines with no clock: the text sits right after the tick, not after an empty time column */
.hg-vd-moments:not(:has(li > button, li > .row > b:not(.nt))) li > .row { grid-template-columns: 16px minmax(0, 1fr); }
.hg-vd-moments .is-tip > button, .hg-vd-moments .is-tip > .row { font-weight: 600; }
.hg-vd-then { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: var(--text); }
/* tiles under the header (audit c39, Mobalytics): small grey label, ONE big number, the opponent small under it */
/* c67 « Bien joué »: 1-2 real strong points, one slim green line above the tiles, quieter than the cause */
.hg-best { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; line-height: 1.3; }
.hg-best-h { color: var(--vd-good); font-weight: 700; }
.hg-best-b { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; border-radius: 999px; color: var(--text);
  background: color-mix(in srgb, var(--vd-good) 10%, var(--raised)); border: 1px solid color-mix(in srgb, var(--vd-good) 40%, var(--line)); }
.hg-best-b .hg-tile-ic { width: 20px; height: 20px; }
.hg-best-b .hg-num { font-size: 1.15em; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--vd-good); white-space: nowrap; }
/* c103 (audit c101, Mobalytics): trophies under each player's name in the 1v1 header, same measures for both; yours green
   (good for you), his orange (good for him, like the tiles), mirrored: yours after your name, his before his (toward the VS) */
.hg-vs .hg-side .hg-dist { --vd-good: #7fc48d; --vd-bad: #ee9a55; display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 5px; }
.hg-vs .hg-side.opp .hg-dist { justify-content: flex-end; }
.hg-vs .hg-side .hg-dist[hidden] { display: none; }
.hg-vs .hg-side .hg-best-b { display: inline-flex; flex: none; padding: 1px 10px 1px 4px; gap: 5px; font-size: 12.5px; line-height: 1.35; color: var(--text); white-space: nowrap; }
.hg-vs .hg-side .hg-best-b span, .hg-vs .hg-side .hg-best-b b { display: inline; color: inherit; font-size: inherit; overflow: visible; }
.hg-vs .hg-side .hg-best-b .hg-num { color: var(--vd-good); font-size: 1.15em; }
.hg-vs .hg-side .hg-best-b .hg-tile-ic { width: 18px; height: 18px; border-radius: 0; }
.hg-vs .hg-side .hg-best-b.op { background: color-mix(in srgb, var(--vd-bad) 10%, var(--raised)); border-color: color-mix(in srgb, var(--vd-bad) 40%, var(--line)); }
.hg-vs .hg-side .hg-best-b.op .hg-num { color: var(--vd-bad); }
/* the header keeps its height when a name block gets a trophy row: less padding around it */
.hg-vs:not(.team):has(.hg-dist:not([hidden])) { padding: 8px 0; }
/* short window (690): the trophy row must not push the first « Also fix » card under the fold (test c76) */
@media (max-height: 740px) {
  .hg-vs:not(.team):has(.hg-dist:not([hidden])) { padding: 3px 0; }
  .hg-vs .hg-side .hg-dist { margin-top: 2px; }
  .hg-vs .hg-side .hg-best-b { padding-top: 0; padding-bottom: 0; }
}
/* c105 (audit c104, Mobalytics prize cards): 4 tiles on one row, each as wide as its content needs (the gathered total is the
   widest), then sharing what is left; every tile carries on its top edge who holds it (flag + name, green you / orange him) */
.hg-tiles { display: flex; gap: 8px; padding-top: 6px; }
.hg-tiles > .hg-tile { flex: 1 1 auto; padding: 0 9px 7px; column-gap: 7px; }
.hg-tiles > .hg-tile .hg-tile-h { font-size: 12px; gap: 5px; }
/* the key tile's two pills already fix its width: the spare width goes to the tiles whose text is longer (RU « на 2 мин 49 раньше ») */
.hg-tiles > .hg-tile .hg-tile-h .hg-tile-ic { width: 20px; height: 20px; }
/* 4 tiles in ~888 px (c105 v4 measured ~927 px of content at 28 px): the big number stays the biggest thing in the tile, 25 px */
.hg-tiles > .hg-tile .hg-tile-n { font-size: 25px; }
.hg-tiles > .hg-tile .hg-tile-gap { font-size: 12px; white-space: normal; text-wrap: balance; line-height: 1.15; }
.hg-tiles > .hg-tile .hg-tile-op { font-size: 13px; } .hg-tiles > .hg-tile .hg-tile-opv { font-size: 15px; }
/* 4 tiles share ~888 px: the edge pills are a touch smaller than the key tag of the old 3-tile row (c105 v3 measured 916 px of
   content: labels went to 2 lines and the row grew 20 px, the 1st fix of the DE 690 loss slipped under « Weiter unten ») */
.hg-tiles > .hg-tile .hg-tile-tag { font-size: 10.5px; letter-spacing: .02em; padding: 0 7px; line-height: 17px; }
/* the top edge: who holds it on the left, the gap in words (or the key tag) on the right, both sitting on the border; part of
   the flow, so a tile is always as wide as its two pills need (c105 v2: « R.. S HAT ENTSCHIEDEN » overlapped) */
.hg-tile-edge { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 21px; margin: -11px 0 0; }
.hg-tile-edge .hg-tile-tag { position: static; }
.hg-tiles > .hg-tile .hg-tile-h { white-space: nowrap; min-width: 0; }
/* when the row runs out of width, a long label goes to a 2nd line rather than losing its end (« …archers de cav ») */
.hg-tiles > .hg-tile .hg-tile-l { white-space: normal; }
/* c152 (après-partie c112): with 4 tiles the 10:00 villagers / gathered labels go to 2 lines (ES, FR) and the row grew 9 px,
   pushing « También a corregir » under « Más abajo » at 690: a tight line height on the label; 1-line tiles keep the icon height */
.hg-tiles > .hg-tile .hg-tile-l { line-height: 1.1; }
.hg-tile-who { position: static; flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px 0 3px; border-radius: 999px; font-size: 13px; font-weight: 800; line-height: 19px; white-space: nowrap; color: var(--vd); background: var(--panel); border: 1px solid color-mix(in srgb, var(--vd) 70%, var(--line)); }
.hg-tile-who img { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; flex: none; }
.hg-tile-who.is-tie { padding-left: 9px; color: var(--muted); border-color: var(--line); font-weight: 700; }
/* the key tile's own tag sits right; when both pills share a narrow tile, the name pill gives way */
.hg-tile { --vd: var(--muted); display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; row-gap: 0; padding: 7px 14px 8px; border-radius: var(--radius-m); background: var(--raised); border: 1px solid var(--line); border-top: 3px solid color-mix(in srgb, var(--vd) 70%, var(--line)); }
.hg-tile.is-good { --vd: var(--vd-good); } .hg-tile.is-bad { --vd: var(--vd-bad); }
/* the measure the headline is about (audit c53): stands out from the two others, no gap words (the title says it) */
.hg-tile.is-key { border-color: color-mix(in srgb, var(--vd) 55%, var(--line)); background: color-mix(in srgb, var(--vd) 9%, var(--raised)); }
/* audit c62: the key tile is tagged « Ce qui a décidé »; next to it, the other tiles stay true but quiet (number in plain text,
   thin top border, gap word softened) so an orange tile under a win or a green one under a loss never reads as another cause */
.hg-tile { position: relative; }
.hg-tile-tag { position: absolute; top: -9px; right: 12px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 16px; color: var(--ink); background: var(--vd); white-space: nowrap; }
.hg-tiles:has(.is-key) .hg-tile:not(.is-key) { border-top-width: 1px; border-top-color: var(--line); }
.hg-tiles:has(.is-key) .hg-tile:not(.is-key) .hg-tile-n { color: var(--text); }
.hg-tiles:has(.is-key) .hg-tile:not(.is-key) .hg-tile-gap { color: color-mix(in srgb, var(--vd) 65%, var(--muted)); font-weight: 600; }
.hg-tiles:has(.is-key) { padding-top: 6px; }
.hg-tile-h { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.hg-tile-ic { width: 22px; height: 22px; object-fit: contain; flex: none; }
.hg-tile-n { font-size: 28px; line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--vd, var(--text)); }
.hg-tile:not(.is-good):not(.is-bad) .hg-tile-n { color: var(--text); }
/* fixed row (c51): a tie stays neutral, a missing measure is a grey dash */
.hg-tile.is-none .hg-tile-n { color: var(--muted); font-weight: 600; }
.hg-tile.is-none { border-top-color: var(--line); }
.hg-tile-side { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 1px; align-self: center; }
.hg-tile-gap { font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--vd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-tile-op { font-size: 14px; line-height: 1.25; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-tile-opv { font-size: 16px; font-weight: 700; color: var(--text); }
/* a long side name (« Équipe adverse ») goes to its own line instead of cutting the number (c51) */
.hg-tile-op { white-space: normal; } .hg-tile-opn { white-space: nowrap; } .hg-tile-opv { white-space: nowrap; }
.hg-vd-more { margin-top: 6px; } .hg-vd-more > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 0; }
.hg-vd-more > summary:hover, .hg-vd-more > summary:focus-visible { color: var(--text); }
.hg-vd-line .hg-num { white-space: nowrap; font-size: 1.2em; font-weight: 800; font-variant-numeric: tabular-nums; color: inherit; letter-spacing: -0.01em; }
.hg-vd-ctx { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: var(--text); opacity: .88; }
.hg-vd-fix { display: block; margin-top: 3px; font-size: 13px; font-weight: 500; color: var(--muted); }
.hg-vd-fix::before { content: '→ '; color: var(--vd-bad); }
/* audit c47 : dans chaque liste « À corriger », le constat en gris et la correction en clair et gras (comme sous la grande carte) */
.hg-vd-moments li.is-bad > .row > span:has(> .hg-vd-fix), .hg-vd-moments li.is-bad > button > span:has(> .hg-vd-fix) { color: var(--muted); font-size: 13.5px; }
.hg-vd-moments .hg-vd-fix { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; }
.hg-vd-moments .hg-vd-fix::before { color: var(--vd, var(--vd-bad)); font-weight: 800; }
/* audit c68: what the n°1 cost, quiet under its fix (the rank tag says it is first, this says why) */
.hg-vd-moments .hg-vd-cost { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--vd-bad); }
.hg-vd-moments em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.hg-vd-moments li > button:hover em, .hg-vd-moments li > button:focus-visible em { color: var(--gold); }
.hg-mapslot:empty { display: none; }
.hg-mapslot { margin: 0 0 14px; }
.hg-nomap { margin: 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius-m); color: var(--muted); font-size: 13.5px; }
.hg-keep { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--raised); }
.hg-keep ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.4; }
.hg-keep li { display: flex; gap: 10px; align-items: baseline; }
.hg-keep li::before { content: '→'; color: var(--gold); }
.hg-keep b { font-variant-numeric: tabular-nums; color: var(--gold); }
.hg-keep button { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.hg-keep button:hover b, .hg-keep button:focus-visible b { text-decoration: underline; }
.hg-detail { margin: 0; }
.hg-detail > summary { cursor: pointer; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--text); font-weight: 600; font-size: 14px; list-style: none; }
.hg-detail > summary::-webkit-details-marker { display: none; }
.hg-detail > summary::before { content: '▸'; display: inline-block; margin-right: 8px; color: var(--gold); transition: transform .15s; }
.hg-detail[open] > summary::before { transform: rotate(90deg); }
.hg-detail[open] > summary { margin-bottom: 14px; }
.hg-a2 { --me: var(--gold); --op: #e6857a; margin-bottom: 14px; }
.hs-ins { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.hs-ins li { position: relative; padding-left: 16px; font-size: 13px; }
.hs-ins li::before { content: ''; position: absolute; left: 2px; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.hs-fh { margin: 0 0 6px; font-size: 12px; color: var(--faint-text); text-transform: uppercase; letter-spacing: .04em; }
.hs-fights { margin-bottom: 12px; } .hs-fights b { margin-right: 8px; } .hs-fl { margin-right: 8px; color: var(--faint-text); font-variant-numeric: tabular-nums; }
.hs-ins li.good::before { background: #7fc48d; } .hs-ins li.bad::before { background: #e6857a; }
.hs-stats { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.hs-stats th, .hs-stats td { padding: 4px 8px; text-align: right; white-space: nowrap; }
.hs-stats thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.hs-stats tbody th { text-align: left; font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.hs-stats tbody th img { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; vertical-align: -3px; margin-right: 6px; }
.hs-stats tbody th span { border-bottom: 2px solid var(--me); }
.hs-stats tr.op th span { border-color: var(--op); }
.hs-stats tbody tr + tr { border-top: 1px solid var(--line); }
.hs-stats td { color: var(--muted); font-size: 15px; }
.hs-stats td.best { color: var(--text); font-weight: 700; }
.hs-tabs { margin: 0 0 6px; }
.hs-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-cond); }
.hs-svg .g { stroke: var(--line); stroke-width: 1; }
.hs-svg text { font-size: 12px; fill: var(--muted); } /* viewBox units: the chart is drawn a bit under 700 px wide, 12 stays >= 11 px on screen */
.hs-svg .yl { text-anchor: end; dominant-baseline: middle; }
.hs-svg .xl { text-anchor: middle; fill: var(--faint-text); }
.hs-svg polyline { fill: none; stroke-width: 2.25; stroke-linejoin: round; }
.hs-svg polyline.me { stroke: var(--me); } .hs-svg polyline.op { stroke: var(--op); }
.hs-svg line.age { stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; }
.hs-svg line.age.me, .hs-svg .ev.me line { stroke: var(--me); } .hs-svg line.age.op, .hs-svg .ev.op line { stroke: var(--op); }
.hs-svg .al { text-anchor: middle; font-size: 12px; font-weight: 700; }
.hs-svg .al.me { fill: var(--me); } .hs-svg .al.op { fill: var(--op); }
.hs-chart rect { fill: transparent; } .hs-chart rect:hover { fill: rgba(236, 229, 211, 0.07); }
.hs-chart { margin-bottom: 14px; }

/* plan: choose the civ you play */
.plan-pick { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.profile-auto { margin: -2px 0 10px; }

/* AoE II civ without a real player's build: a compact strip on top of the list (state + best-covered civs), so the openings stay above the fold */
#civ-maps { flex-basis: 100%; } #civ-maps:empty { display: none; }
.map-chips { margin: 0; } /* map filter (AoE II: in the place of the sort tabs) */ .map-chips + .civ-maps { margin-top: 8px; }
.civ-maps { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 8px 14px; border-radius: var(--radius-m); background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.civ-maps > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.civ-maps > div > b { color: var(--muted); font-weight: 600; }
.cm-skel { display: inline-block; width: 150px; height: 12px; vertical-align: middle; border-radius: var(--radius-s); background: linear-gradient(90deg, var(--panel), var(--raised), var(--panel)); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
.cm-map b { font-variant-numeric: tabular-nums; }
.cm-map em { font-style: normal; font-size: 12px; color: var(--muted); }
.cm-map em.up { color: #7fc48d; } .cm-map em.down { color: #e6857a; }
.no-pro { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 20px 0; padding: 10px 14px; border-radius: var(--radius-m); background: var(--panel); border: 1px solid var(--line); }
.no-pro > div:first-child { flex: 1 1 220px; min-width: 0; }
.no-pro h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); text-wrap: balance; }
.no-pro p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.no-pro .pro-civs { margin: 0; gap: 4px; }
.no-pro .pro-civ { gap: 6px; padding: 3px 8px 3px 3px; font-size: 13px; }
.no-pro .pro-civ img { width: 22px; height: 22px; }
.no-pro + .civ-bonus { margin-top: 8px; }
/* AoE II civ without pro: no row has a tier, so the tier column goes */
.builds.no-tier .cols-head, .builds.no-tier .row-main { grid-template-columns: minmax(200px, 1fr) 140px 180px 240px; }
.builds.no-tier .cols-head span:first-child, .builds.no-tier .tier-open, .builds.no-tier .tier-civ { display: none; }
@media (max-width: 1230px) {
  .builds.no-tier .cols-head, .builds.no-tier .row-main { grid-template-columns: minmax(180px, 1fr) 140px 240px; }
}
.pro-civ .n { min-width: 20px; padding: 1px 6px; border-radius: var(--radius-s); background: var(--text); color: var(--ink); font-family: var(--font-cond); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.pro-civ:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tier-open { visibility: hidden; }
/* Civ with no build at all: the strip becomes the page (title, Import, best-covered civs), never a lone gray line */
.no-pro.is-empty { flex-direction: column; align-items: flex-start; gap: 12px; margin: 20px; padding: 20px 22px; }
.no-pro.is-empty > div:first-child { flex: none; }
.no-pro.is-empty h2 { font-size: 18px; }
.no-pro.is-empty p { margin-top: 4px; font-size: 14px; }
.no-pro.is-empty .np-lead { margin: 6px 0 0; }
.no-pro.is-empty .pro-civs { gap: 6px; }
.no-pro.is-empty .pro-civ { gap: 8px; padding: 5px 12px 5px 5px; font-size: 14px; }
.no-pro.is-empty .pro-civ img { width: 26px; height: 26px; }

/* maps: strongest civs per ranked 1v1 map */
.maps-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.maps-head h2 { margin: 0; }
.maps-head p { margin: 0; color: var(--muted); font-size: 13px; }
.maps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; } /* 2 columns at the min size: full civ names */
.map-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 10px 8px; min-width: 0; }
.map-card.is-focus { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.map-card header { display: flex; align-items: center; gap: 8px; margin: 0 4px 6px; }
.map-card h3 { margin: 0; flex: 1; min-width: 0; font-family: var(--font-cond); font-size: 17px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.map-type { flex: none; padding: 1px 7px; border-radius: 999px; font-family: var(--font-cond); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid currentColor; }
.map-type.t-land { color: var(--builder); }
.map-type.t-hybrid { color: var(--age-2); }
.map-type.t-water { color: var(--age-3); }
.map-civs { display: grid; gap: 2px; max-height: 158px; /* exactly 5 rows of 30px: never a half row */ overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.map-civs button { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 34px; align-items: center; gap: 6px; padding: 4px; border: 0; border-radius: var(--radius-s); background: none; color: var(--text); font-size: 13px; text-align: left; }
.map-civs button:hover { background: var(--hover); }
.map-civs button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.map-civs img { width: 22px; height: 22px; border-radius: 3px; }
.map-civs span { line-height: 1.15; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } /* one line; full name in the row tooltip */
:lang(ja) .map-civs button { gap: 4px; } /* 7-kana civ names fit on one line at the min size */
:lang(ja) .map-civs span { font-size: 12px; }
.map-civs b { font-weight: 700; font-variant-numeric: tabular-nums; }
.map-civs em { font-style: normal; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }
.map-civs em.up { color: #7fc48d; } .map-civs em.down { color: #e6857a; }
.map-skel { display: block; height: 30px; border-radius: var(--radius-s); background: linear-gradient(90deg, var(--panel), var(--raised), var(--panel)); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
.map-empty { margin: 6px 4px; color: var(--muted); font-size: 13px; }
.tb-discord { color: #aab4ff; border: 1px solid rgba(88, 101, 242, 0.5); border-radius: 999px; padding-left: 12px; padding-right: 12px; }
.tb-discord:hover { background: rgba(88, 101, 242, 0.18); color: #fff; }
.kbd-btn { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
.kbd-btn:hover kbd { border-color: var(--gold); color: var(--gold); }
.kbd-btn.is-capturing kbd { border-color: var(--gold); color: var(--gold); animation: kbd-blink 1s ease-in-out infinite; }
@keyframes kbd-blink { 50% { opacity: 0.55; } }
.btn-small { padding: 4px 10px; font-size: 12px; }
.hg-h2h { margin: 10px 0 0; font-size: 14px; color: var(--muted, #9aa4b8); }
.hg-h2h:empty { display: none; }
.hg-h2h b { font-weight: 700; color: var(--text, #e8e2d0); }
.hg-h2h.hm-up b { color: #7fc48d; }
.hg-h2h.hm-down b { color: #e6857a; }
#home-hist { display: flex; flex-direction: column; }
#home-hist .me-retry { align-self: flex-start; }
#home-hist .home-hist-list { flex: 1 1 auto; max-height: 420px; overflow-y: auto; }
.home-hist-all { align-self: flex-end; margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; }
.home-hist-all .hchev { width: 12px; height: 12px; }
/* « Objectif de la semaine »: one compact line between the record and the games; a button when it opens a plan */
.hh-goal { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; width: 100%; margin-top: -4px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--gold-soft); color: var(--text); font: inherit; font-size: 13px; text-align: left; }
button.hh-goal { cursor: pointer; } button.hh-goal:hover { border-color: var(--gold); }
.hh-goal small { flex: 1 0 100%; color: var(--gold); font-size: 12px; font-weight: 600; } /* label on its own line: the goal keeps the width */
.hh-goal span { flex: 1 1 0; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.hh-goal img { width: 18px; height: 18px; border-radius: 3px; flex: none; }
.hg-n { flex: none; font-family: var(--font-cond); font-variant-numeric: tabular-nums; color: var(--muted); }
.hg-n.done { color: #7fc48d; }
.home-hist-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.hh-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px 8px 14px; border: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--line); border-radius: var(--radius-s); background: none; color: var(--text); text-align: left; cursor: pointer; }
.hh-row:hover { background: var(--hover); }
.hh-row.w { box-shadow: inset 4px 0 0 #7fc48d; }
.hh-row.l { box-shadow: inset 4px 0 0 #e6857a; }
.hh-civs { display: flex; flex: none; gap: 4px; }
.hh-civs img { width: 24px; height: 24px; border-radius: 4px; }
.hh-civs img + img { margin-left: 0; }
.hh-mid { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.hh-mid b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-row.w .hh-mid > b { color: #7fc48d; }
.hh-row.l .hh-mid > b { color: #e6857a; }
.hh-mid b span { color: var(--text); font-weight: 500; }
.hh-mid small { color: var(--muted); font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; } /* map + date wrap on a second line rather than being cut */
.hh-elo { flex: none; font-weight: 700; font-size: 13px; }
.hh-row .hchev { width: 12px; height: 12px; flex: none; color: var(--muted); }
.hh-elo .up { color: #7fc48d; } .hh-elo .down { color: #e6857a; }

/* history detail: loading spinner while the summary / tactical map arrive */
.hg-load { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 36px 0; color: var(--muted, #8a93a6); font-size: 13px; }
.hg-load .spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--gold, #e3a83b); animation: hg-spin .8s linear infinite; }
@keyframes hg-spin { to { transform: rotate(360deg); } }

/* history detail: positives | mistakes */
.hs-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 0 0 14px; }
.hs-col { border-radius: 10px; padding: 10px 12px; border: 1px solid; }
.hs-col.pos { background: rgba(127,196,141,.07); border-color: rgba(127,196,141,.28); }
.hs-col.neg { background: rgba(230,133,122,.07); border-color: rgba(230,133,122,.28); }
.hs-col h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.hs-col.pos h4 { color: #7fc48d; } .hs-col.neg h4 { color: #e6857a; }
.hs-col .hs-ins { margin: 0; gap: 7px; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.hs-ins li b { margin-right: 8px; font-variant-numeric: tabular-nums; }
.hs-ins li small.hs-fl { display: block; margin: 1px 0 0; font-size: 12px; }
.hs-ins li small.hs-why { display: block; margin-top: 2px; font-size: 12px; color: var(--text, #dfe5ef); opacity: .9; }
.hs-ins li small.hs-why::before { content: '→ '; color: #e6857a; }
.hs-onmap { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--gold); font: inherit; font-size: 12px; cursor: pointer; text-align: start; }
.hs-onmap::before { content: '▶ '; font-size: 10px; } .hs-onmap:hover { text-decoration: underline; }

/* history detail: synthesis on top (3 costly mistakes | what to do instead) */
.hs-syn { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; margin: 0 0 14px; padding: 12px 14px; background: var(--raised); border-radius: var(--radius-m); }
.hs-syn-b h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hs-syn-b.is-err h4 { color: #e6857a; } .hs-syn-b.is-fix h4 { color: var(--gold); }
.hs-syn-b ol, .hs-syn-b ul { margin: 0 0 4px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.35; }
.hs-syn-b ol { counter-reset: syn; }
.hs-syn-b ol li { counter-increment: syn; position: relative; padding-left: 26px; }
.hs-syn-b ol li::before { content: counter(syn); position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: rgba(230,133,122,.18); color: #e6857a; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.hs-syn-b ul li { position: relative; padding-left: 16px; }
.hs-syn-b ul li::before { content: '→'; position: absolute; left: 0; color: var(--gold); }
/* economy / army sections (js/report-eco.js, js/report-army.js), same look as the end-of-game report (css/summary.css) */
details.hs-sec { margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--raised); }
details.hs-sec > summary { cursor: pointer; list-style: none; padding: 9px 12px; font-family: var(--font-cond); font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; border-radius: var(--radius-m); }
details.hs-sec > summary::-webkit-details-marker { display: none; }
details.hs-sec > summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); transition: transform .15s ease-out; flex: none; }
details.hs-sec[open] > summary::before { transform: rotate(45deg); }
details.hs-sec > summary:hover { background: var(--hover); }
details.hs-sec > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
details.hs-sec > :not(summary) { margin-left: 12px; margin-right: 12px; }
details.hs-sec[open] > :last-child { margin-bottom: 10px; }
.hs-vs { margin-bottom: 8px; width: calc(100% - 24px); }
.hs-vs tbody tr:first-child { border-top: 0; }
.hs-vs tbody th { white-space: normal; max-width: none; overflow: visible; } /* long labels (ru, pl...) wrap instead of losing the resource order */
.hs-vs thead th { white-space: normal; vertical-align: bottom; line-height: 1.25; } /* « Unités produites au total », « Améliorations de forge à 20 min » */
/* harvest by age: one heading carries the unit and the resource order (in their colours), each row is just the age */
.hs-stats tr.hs-sub th { padding-top: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.hs-stats tr.hs-sub small { margin-left: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.hs-stats tr.hs-sub th span { border-bottom: 0; } /* resource names, not the you / him underline */
.hs-stats tr.hs-in th { padding-left: 18px; font-weight: 500; }
.hs-stats tr.hs-sub + tr.hs-in { border-top: 0; }

/* home: stream overlay link */
.card-slim { padding-top: 12px; padding-bottom: 12px; }
.stream-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stream-line h2 { margin: 0 auto 0 0; }
.btn.btn-sm { padding: 5px 12px; font-size: 13px; }
.hs-gather thead th img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }
.hs-cmp { max-width: 100%; margin-bottom: 8px; }
.hs-cmp-t thead th { white-space: normal; vertical-align: bottom; }
.hs-cmp-t tbody th { white-space: normal; overflow: visible; } /* « Ta moyenne (N parties) » is long in pl, vi */
.hs-end { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: rgba(224,173,69,.08); border: 1px solid rgba(224,173,69,.3); font-size: 13.5px; }
.hs-end b { color: var(--gold); margin-right: 6px; }

/* avatar AoE4 World (ou initiales) : carte de scouting + en-tête du profil */
.sc-ava { width: 28px; height: 28px; border-radius: 50%; flex: none; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); color: var(--text, #e8ecf4); font-size: 11px; font-weight: 700; }
.sc-ava img { width: 100%; height: 100%; object-fit: cover; }
.me-top .sc-ava { width: 52px; height: 52px; font-size: 17px; }
/* AoE II: coming soon (not clickable) */
#game-switch button.soon { opacity: .55; cursor: not-allowed; }
#game-switch button.soon small { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gold); margin-left: 3px; }
#game-switch button { white-space: nowrap; }

/* « plus bas » : dégradé + pastille tant que la zone principale cache du contenu (js/scroll-hint.js) */
.sh-fade { position: fixed; height: 28px; transform: translateY(28px); /* bottom 28px of the view only: the strip below already holds the pill */ pointer-events: none; background: linear-gradient(transparent, rgba(10, 14, 22, .85)); opacity: 0; transition: opacity .2s; z-index: 40; }
.sh-pill { position: fixed; transform: translate(-50%, 50px); display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--gold); border-radius: 999px; background: var(--panel); color: var(--text); font: 600 13px/1 var(--font-cond, inherit); box-shadow: 0 4px 16px rgba(0, 0, 0, .45); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 41; }
.sh-pill svg { width: 14px; height: 14px; color: var(--gold); animation: sh-bob 1.6s ease-in-out infinite; }
.sh-pill:hover { background: var(--hover); }
/* while the pill shows, the main view leaves a 40px strip under itself; the pill (placed 44px above the view bottom by js, shifted 50px down) sits in it and never covers a line */
body:has(.sh-pill.on) .builds > .home, body:has(.sh-pill.on) .builds > .build-list { margin-bottom: 40px; }
.sh-fade.on, .sh-pill.on { opacity: 1; } .sh-pill.on { pointer-events: auto; }
/* The history card already has a dedicated strip for the pill: don't dim the last advice above it. */
body:has(.hist-game) .sh-fade.on { opacity: 0; }
@keyframes sh-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* âges et build : barre d'âges + puces dans l'ordre du temps, qui passent à la ligne (jamais superposées) */
.hs-tl2 { display: grid; gap: 14px; margin: 6px 0 4px; }
.tl-p { display: grid; gap: 7px; }
.tl-h { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tl-h img { width: 26px; height: 18px; border-radius: 3px; object-fit: cover; }
.tl-p.me .tl-h b { color: var(--me); } .tl-p.op .tl-h b { color: var(--op); }
.tl-bar { position: relative; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.tl-bar i { position: absolute; top: 0; bottom: 0; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-c { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--raised, rgba(255,255,255,.05)); border: 1px solid var(--line); font-size: 13px; color: var(--text); white-space: nowrap; }
.tl-c b { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.tl-c.bld { color: var(--muted); }
.tl-c.age { font-weight: 700; } .tl-c.a2 { border-color: var(--age-2); color: var(--age-2); } .tl-c.a3 { border-color: var(--age-3); color: var(--age-3); } .tl-c.a4 { border-color: var(--age-4); color: var(--age-4); }
.tl-c.lm { font-weight: 600; border-color: var(--gold); }

/* No detail for a game: your record on this map + civ (from the loaded history) */
.hg-ctx { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 8px; }
.hg-ctx span { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-ctx b { font-size: 20px; font-variant-numeric: tabular-nums; }
.hg-ctx em { font-style: normal; font-size: 16px; color: var(--muted); }
.hg-ctx small { grid-column: 1 / -1; color: var(--muted); }
/* AoE II game with no replay: what the replay gives and what to do */
.hg-norec { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line, rgba(255,255,255,.18)); border-radius: 8px; }
.hg-norec b { display: block; font-size: 13px; margin-bottom: 4px; }
.hg-norec p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* AoE II: why the game is not recognized, one line under the detection checkbox */
.rec-line { margin: -4px 0 8px 28px; padding-left: 8px; border-left: 2px solid var(--gold); font-size: 13px; font-weight: 600; color: var(--gold); }
.rec-line[hidden] { display: none; }
.rec-line.is-tooshort { border-color: var(--line); color: var(--muted); }

.tf-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tf-stat { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; background: rgba(255,255,255,.04); font-size: 13px; }
.tf-stat img { width: 18px; height: 18px; border-radius: 3px; }
.tf-stat small { color: var(--muted, #9aa0aa); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.tf-stat.up b { color: #7fc48d; } .tf-stat.down b { color: #e6857a; }

.hist-filter { display: flex; gap: 6px; margin-bottom: 8px; }
.hist-filter button { padding: 3px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.hist-filter button:hover { border-color: var(--gold); }
.hist-filter button[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }

/* narrow window (800 px): the history row drops the duration column so the opponent, map and Elo stay readable */
@media (max-width: 900px) {
  .hist-row { grid-template-columns: 6px 74px minmax(110px, 1.6fr) minmax(70px, 1fr) 70px 16px; gap: 6px; }
  .hist-row > :nth-child(5) { display: none; }
  .hist-row .vs { gap: 6px; }
  .hist-row .hres { overflow-wrap: normal; font-size: 13px; }
  .hist-row .vs small { display: none; }
  .hist-sum { gap: 8px 18px; }
  .cols-head, .row-main, .builds.no-tier .cols-head, .builds.no-tier .row-main { grid-template-columns: minmax(0, 1fr) 100px minmax(0, auto); gap: 10px; padding-left: 14px; padding-right: 14px; } /* fenêtre mini : plus de débordement horizontal */
  .row-actions { flex-wrap: wrap; }
  .home-grid { grid-template-columns: minmax(0, 1fr); } /* profile and latest games stack: two columns would crush the rows */
}

/* Historique par équipes (4v4 : 8 pictos de civ) : les pictos rétrécissent au lieu de déborder sur la colonne carte */
.hist-row .vs { overflow: hidden; }
.hist-row .vs img { flex: 0 1 24px; min-width: 13px; width: auto; height: auto; max-height: 24px; aspect-ratio: 1; object-fit: contain; }
.hist-row .vs { gap: 6px; }

/* AF1 : série en cours à côté de la courbe Elo (historique) */
.prog-runs .cur b { font-weight: 700; }
.prog-runs .cur::before { content: "●"; margin-right: 5px; font-size: 9px; vertical-align: 1px; }

/* AD1 : fiche civ AoE II en une vue (bonus à gauche, unité unique et contres à droite), sans défilement */
.civ-bonus { padding: 10px 14px; }
.civ-bonus[open] > .cb-type { margin-bottom: 6px; }
.cb-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 18px; align-items: start; }
.civ-bonus:not(.has-uu) .cb-body { grid-template-columns: minmax(0, 1fr); }
.cb-main ul { font-size: 13px; line-height: 1.3; gap: 2px; }
.cb-main .cb-techs { margin-top: 6px; font-size: 12px; line-height: 1.3; }
.cb-side { display: grid; gap: 6px; padding-left: 16px; border-left: 1px solid var(--line); }
.cb-uu { display: grid; gap: 5px; }
.cb-uu + .cb-uu { padding-top: 8px; border-top: 1px solid var(--line); }
.cb-uu-head { display: flex; align-items: center; gap: 10px; }
.cb-uu-head img { width: 38px; height: 38px; flex: none; border-radius: var(--radius-s, 6px); object-fit: contain; background: rgba(255, 255, 255, 0.04); }
.cb-uu-head small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cb-uu-head strong { display: block; font-size: 15px; line-height: 1.15; color: var(--text); }
.cb-cost { display: block; font-size: 12px; color: var(--muted); }
.cb-cost b { color: var(--text); font-weight: 600; }
.cb-vs { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; font-size: 12px; line-height: 1.2; }
.cb-vs > b { flex: 0 0 auto; min-width: 5.2em; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.cb-weak > b { color: var(--food); }
.cb-strong > b { color: var(--builder); }
.cb-vs .ct-u { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 6px 2px 3px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.cb-vs .ct-u img { width: 18px; height: 18px; object-fit: contain; flex: none; }
.cb-vs .ct-u span { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1020px) {
  .cb-body { grid-template-columns: minmax(0, 1fr); }
  .cb-side { padding-left: 0; border-left: 0; padding-top: 8px; border-top: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .cb-uu + .cb-uu { padding-top: 0; border-top: 0; }
}
.cb-uu.is-second .cb-uu-head img { width: 28px; height: 28px; }
.cb-uu.is-second .cb-uu-head strong { font-size: 13px; }
.cb-uu.is-second .cb-uu-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.map-builds { display: grid; gap: 2px; margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.map-builds h4 { margin: 0 4px 2px; font-family: var(--font-cond); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.mb-chip { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 4px; border: 0; border-radius: var(--radius-s); background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; }
button.mb-chip { cursor: pointer; }
button.mb-chip:hover { background: var(--hover); }
button.mb-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.mb-chip img { width: 18px; height: 18px; border-radius: 3px; flex: none; }
.mb-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mb-more { padding: 0 4px; font-size: 12px; color: var(--muted); }

/* Home: « Your last game » card (AoE IV, linked profile), head of the grid */
.home-last[hidden] { display: none; }
.home-last { padding: 0; }
.hl-btn { display: flex; align-items: center; gap: 12px 16px; width: 100%; padding: 12px 16px 12px 18px; border: 0; box-shadow: inset 4px 0 0 var(--line); border-radius: inherit; background: none; color: var(--text); text-align: left; cursor: pointer; }
.hl-btn.w { box-shadow: inset 4px 0 0 #7fc48d; } .hl-btn.l { box-shadow: inset 4px 0 0 #e6857a; }
.hl-btn:hover { background: var(--hover); }
.hl-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hl-mid small, .hl-pick small { color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.hl-mid b { font: 600 18px var(--font-cond); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-mid b i { font-style: normal; margin-right: 6px; } .hl-mid b i.win { color: #7fc48d; } .hl-mid b i.loss { color: #e6857a; }
.hl-mid b span { color: var(--muted); font-weight: 500; }
.hl-mid em { font-style: normal; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-pick { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 6px 12px; border: 1px solid rgba(224, 173, 69, .35); border-radius: var(--radius-s); background: var(--gold-soft); }
.hl-pick b { font-size: 14px; font-variant-numeric: tabular-nums; } .hl-pick span { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .hl-btn { flex-wrap: wrap; } .hl-pick { order: 3; flex: 1 1 100%; } }
.hl-btn .hchev { flex: none; width: 16px; height: 16px; color: var(--faint); } .hl-btn:hover .hchev { color: var(--gold); }
.hl-pick { text-align: center; } .hl-pick small { white-space: nowrap; } .hl-pick b { font-size: 20px; line-height: 1.1; } .hl-mid { flex-basis: 150px; }

/* accueil sans profil relié (AoE IV et AoE II, 10/11) : promesse + champ pseudo à gauche, aperçu cadré à droite,
   puis les builds du patch sur une ligne de 3 et les contres ouverts ; aucun bloc vide, aucun texte coupé */
.np-hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 22px; align-items: start; padding: 18px 20px 20px;
  border-color: color-mix(in srgb, var(--gold) 38%, var(--line));
  background: radial-gradient(120% 140% at 0% 0%, var(--gold-soft), transparent 55%), var(--panel); }
.nph-main { min-width: 0; }
.np-card .np-title { margin: 4px 0 6px; font-family: var(--font-cond); font-size: 28px; line-height: 1.1; font-weight: 700; color: var(--text); text-wrap: balance; }
.np-card .np-sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.np-card .field-row { display: flex; gap: 8px; } .np-card .field-row input { flex: 1; min-width: 0; }
.np-field input { height: 44px; padding: 0 14px; font-size: 15px; border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.np-field input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.np-field .btn { height: 44px; padding: 0 18px; font-size: 15px; font-weight: 700; white-space: nowrap; flex: none; }
.np-hero .profile-results:empty { display: none; }
.np-hero .profile-results { max-height: 150px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--ink); padding: 4px; }
.np-hero .profile-results button { padding: 8px 10px; font-size: 14px; }
.np-perks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.np-perks li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.35; color: var(--text); }
.np-perks svg { flex: none; width: 28px; height: 28px; padding: 6px; border-radius: 7px; background: var(--gold-soft); color: var(--gold); }
/* aperçu : un vrai cadre, net, avec son étiquette ; rien n'y est cliquable */
.nph-pv { position: relative; min-width: 0; margin-top: 6px; padding: 22px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--ink); pointer-events: none; user-select: none; }
.nph-tag { position: absolute; top: -10px; left: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.nph-pv .hist-sum { gap: 6px 20px; margin-bottom: 10px; }
.nph-pv .hist-sum b { font-size: 22px; }
.nph-pv .hist-list { gap: 6px; }
.nph-pv .hist-row { grid-template-columns: 5px 98px minmax(0, 1fr) 76px; gap: 8px; padding: 7px 10px 7px 0; font-size: 13.5px; }
.nph-pv .hist-row > :nth-child(4), .nph-pv .hist-row > :nth-child(5), .nph-pv .hist-row .hchev { display: none; }
.nph-pv .hist-row .bar { margin: -7px 0; }
.nph-pv .hist-row .vs img { max-height: 22px; }
.nph-pv .hist-row .vs { gap: 4px; } /* le nom adverse tient en entier à 1280 px */
.nph-pv .hist-row .hres { font-size: 12.5px; overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* builds du patch : une carte à part, 3 côte à côte, titre en entier (jamais coupé) */
.np-recs h2 { margin-bottom: 10px; }
.np-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.np-build { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; align-content: start; gap: 4px 10px; width: 100%; padding: 10px 12px; text-align: left; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; transition: border-color .15s, background-color .15s; }
.np-build:hover, .np-build:focus-visible { border-color: var(--gold); background: var(--hover); }
.np-build img { width: 30px; height: 30px; border-radius: 4px; }
.np-bt { min-width: 0; display: grid; gap: 2px; }
.np-bt b { font-size: 14px; line-height: 1.25; overflow-wrap: break-word; text-wrap: pretty; }
.np-bt small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-ages { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
@media (max-width: 1180px) { .np-hero { grid-template-columns: minmax(0, 1fr); } .nph-pv { margin-top: 8px; } }
@media (max-width: 1020px) { .np-list { grid-template-columns: minmax(0, 1fr); } }
/* liste des civs : libellés des colonnes dits une fois (test 03/11, l'utile d'abord) */
#civ-list .rail-head { display: flex; justify-content: flex-end; gap: 0; padding: 2px 8px 4px; position: sticky; top: 0; z-index: 1; background: var(--panel, var(--bg)); }
#civ-list .rail-head span { width: 58px; text-align: center; font-size: 10.5px; font-weight: 600; line-height: 1.1; color: var(--faint-text, var(--muted)); text-wrap: balance; }
#civ-list .civ .rc-win small, #civ-list .civ .rc-tier:not(.is-odd) small { display: none; } /* tier label only where it differs from the header (QA 04/11 H) */
/* new AoE IV civ without public stats yet: one label over both columns (tier + wins) */
#civ-list .civ .rc-soon { width: 116px; }
#civ-list .civ .rc-soon small { max-width: 116px; font-style: italic; }
/* carte repliée de l'accueil (table des contres) : une ligne, ouverte en un clic */
.home-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.home-fold > summary::-webkit-details-marker { display: none; }
.home-fold > summary h2 { margin: 0; }
.home-fold > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-left: auto; transition: transform .15s; }
.home-fold[open] > summary::after { transform: rotate(-135deg); }
.home-fold[open] > summary { margin-bottom: 10px; }

/* ---------- builds des joueurs : « Mes builds », « Communauté », éditeur, partage (js/player-builds.js) ---------- */
/* jamais de badge PRO ici : ces lignes restent visiblement à part des builds pros */
.row.is-mine, .row.is-com { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--muted) 45%, transparent); }
.list-sec.is-com { align-items: center; flex-wrap: wrap; }
.pb-tabs { display: inline-flex; gap: 2px; margin-left: auto; text-transform: none; letter-spacing: 0; }
.list-sec .pb-tabs button { font: 600 12px var(--font); color: var(--muted); background: none; border: 1px solid transparent; border-radius: var(--radius-s); padding: 3px 9px; cursor: pointer; }
.list-sec .pb-tabs button[aria-selected="true"] { color: var(--text); border-color: var(--line); background: var(--panel); }
.pb-cta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.pb-cta p { flex: 1 1 100%; margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.pb-cta.is-small { padding: 8px 20px; }
.btn-gold-sm { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-gold-sm:hover { filter: brightness(1.08); border-color: var(--gold); }
.btn-quiet { background: none; color: var(--muted); }
.pb-empty { padding: 14px 20px; color: var(--muted); }
.pb-empty p { margin: 0; }
.pb-more { margin: 8px 20px; }
.pb-vote { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.pb-v { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; background: var(--panel); border: 0; color: var(--muted); font-size: 11px; cursor: pointer; }
.pb-v + .pb-v { border-left: 1px solid var(--line); }
.pb-v b { font: 700 13px var(--font-cond); font-variant-numeric: tabular-nums; color: var(--text); }
.pb-tested { display: inline-flex; align-items: center; gap: 6px; }
.pb-tested b { font: 700 13px var(--font-cond); font-variant-numeric: tabular-nums; color: var(--text); padding-left: 6px; border-left: 1px solid var(--line); }
.pb-tested.is-on { border-color: var(--ok, #5fb36b); color: var(--ok, #5fb36b); }
.pb-tested.is-own { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--muted); font-size: 11px; }
.pb-up.is-on { color: #8fcf8a; background: color-mix(in srgb, #8fcf8a 14%, var(--panel)); }
.pb-down.is-on { color: #e6857a; background: color-mix(in srgb, #e6857a 14%, var(--panel)); }
.tb-create { color: var(--gold); }

/* ---------- éditeur guidé des builds des joueurs (js/pb-editor.js) ---------- */
.dlg-editor { width: min(1220px, 97vw); max-height: 95vh; }
.dlg-editor .dlg-body { position: relative; }
.dlg-editor button[disabled] { opacity: .35; cursor: default; }
.ed-body { position: relative; display: flex; flex-direction: column; gap: 10px; max-height: calc(95vh - 2px); }
.ed-head { display: flex; align-items: center; gap: 10px; }
.ed-head h2 { margin: 0; }
.ed-badge { font: 700 11px var(--font-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); padding: 2px 7px; border-radius: 3px; }
.ed-help { margin-left: auto; margin-right: 2px; min-height: 32px; background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); padding: 3px 14px; font: 600 13px var(--font); }
.ed-help:hover, .ed-help:focus-visible { color: var(--text); border-color: var(--gold); }
.ed-hint { display: block; font-size: 12px; line-height: 1.35; color: var(--faint); }
.ed-f { display: flex; flex-direction: column; gap: 3px; }
.ed-f > label { font: 600 12px var(--font); color: var(--muted); }
.ed-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.ed-meta .ed-grow { flex: 1 1 280px; }
.ed-meta select, .ed-meta input, .sh-l input { background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 9px; font: 14px var(--font); }
.ed-meta select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.ed-cols { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: 16px; min-height: 0; flex: 1; }
.ed-steps, .ed-preview { overflow: auto; min-height: 0; max-height: 62vh; padding-right: 4px; }
.ed-steps { padding-bottom: 10px; }
.ed-preview { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; }
.ed-preview h3 { margin: 0; font: 700 13px var(--font-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.ed-preview .ed-hint { margin-bottom: 8px; }
.ed-age { border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: 10px; background: color-mix(in srgb, var(--ink) 70%, var(--panel)); }
.ed-age > header { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-m) var(--radius-m) 0 0; background: color-mix(in srgb, var(--age, var(--age-0)) 16%, var(--panel)); box-shadow: inset 3px 0 0 var(--age, var(--age-0)); }
.ed-age > header b { font-family: var(--font-cond); font-size: 16px; }
.ed-card { margin: 8px; padding: 8px 10px 8px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); display: flex; flex-direction: column; gap: 7px; }
.ed-card.is-bad { border-color: #e6857a; }
.ed-card-top { display: flex; align-items: flex-start; gap: 10px; }
.ed-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); font: 700 14px var(--font-cond); color: var(--text); margin-top: 2px; }
.ed-lbl { font: 700 11px var(--font-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ed-what { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.ed-what .ed-lbl { flex: 0 0 100%; }
.ed-act { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 3px 2px 4px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.ed-act img { width: 24px; height: 24px; }
.ed-act-x { border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; padding: 0; font-size: 11px; }
.ed-act-x:hover, .ed-act-x:focus-visible { background: var(--hover); color: var(--text); }
.ed-pick { min-height: 34px; border: 1px dashed var(--gold); background: var(--gold-soft); color: var(--gold); border-radius: 999px; padding: 4px 14px; font: 700 13px var(--font); }
.ed-pick.is-more { border-color: var(--line); background: none; color: var(--muted); }
.ed-pick:hover, .ed-pick:focus-visible { background: color-mix(in srgb, var(--gold) 24%, transparent); color: var(--text); }
.ed-time { flex: none; display: flex; flex-direction: column; gap: 2px; font: 700 11px var(--font-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: help; }
.ed-time input { width: 70px; height: 32px; background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 4px 6px; font: 600 14px var(--font); text-align: center; text-transform: none; letter-spacing: 0; }
.ed-time input::placeholder { color: var(--muted); opacity: 1; }
.ed-tools { flex: none; display: flex; gap: 4px; margin-top: 16px; }
.ed-tools button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--ink); color: var(--muted); font-size: 14px; }
.ed-tools button:not([disabled]):hover, .ed-tools button:focus-visible { color: var(--text); border-color: var(--gold); }
.ed-vils { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px; padding-left: 36px; }
.ed-vils > .ed-lbl { flex: 0 0 100%; }
.ed-res { display: flex; flex-direction: column; gap: 4px; padding: 5px 6px 6px; border-radius: var(--radius-s); background: var(--ink); box-shadow: inset 0 -2px 0 var(--rc, var(--line)); }
.ed-res.res-food { --rc: var(--food); } .ed-res.res-wood { --rc: var(--wood); } .ed-res.res-gold { --rc: var(--goldres); } .ed-res.res-stone { --rc: var(--stone); } .ed-res.res-builder { --rc: var(--builder); }
.ed-rname { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.ed-rname img { width: 22px; height: 22px; }
.ed-stepper { display: flex; align-items: center; }
.ed-stepper button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); background: var(--raised); color: var(--text); font: 700 16px/1 var(--font); }
.ed-stepper button:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.ed-stepper button:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.ed-stepper button:hover, .ed-stepper button:focus-visible { background: var(--hover); border-color: var(--gold); }
.ed-stepper input { width: 36px; height: 32px; border: 1px solid var(--line); border-width: 1px 0; background: var(--ink); color: var(--text); text-align: center; font: 700 14px var(--font-cond); padding: 0; }
.ed-total { font: 700 15px var(--font-cond); color: var(--gold); padding: 0 0 5px 4px; white-space: nowrap; }
.ed-msg { margin: 0; font-size: 13px; line-height: 1.35; padding-left: 36px; }
.ed-msg.is-warn { color: var(--gold); }
.ed-msg.is-err { color: #e6857a; }
.ed-f .ed-msg, .ed-addbar .ed-msg { padding-left: 0; }
.ed-addbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 6px; }
.ed-addbar .ed-hint { flex: 0 0 100%; }
.ed-add { border-color: var(--gold); color: var(--text); font-weight: 700; }
.ed-ageup { display: inline-flex; align-items: center; gap: 6px; border-color: var(--age); color: var(--text); }
.ed-ageup img { width: 22px; height: 22px; }
.ed-example { margin: 0 8px 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--radius-m); color: var(--muted); opacity: .85; display: flex; flex-direction: column; gap: 6px; }
.ed-ex-t { font: 700 11px var(--font-cond); letter-spacing: .06em; text-transform: uppercase; }
.ed-ex-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.ed-ex-row > img { width: 16px; height: 16px; }
.ed-foot { display: flex; align-items: center; gap: 12px; }
.ed-foot .dlg-actions { margin: 0 0 0 auto; }
.ed-check { margin: 0; font-size: 13px; }
.ed-check.is-ok { color: #8fcf8a; }
.ed-check.is-warn { color: var(--gold); }
.ed-check.is-err { color: #e6857a; }
.ed-ptitle { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ed-flag { width: 34px; height: 20px; object-fit: cover; border-radius: 2px; }
.ed-preview .age-block { margin-bottom: 8px; }
.ed-preview .age-block > ol > li { grid-template-columns: 46px 30px minmax(0, 1fr); font-size: 14px; }
/* palette « Quoi faire » */
.ed-pal { position: absolute; z-index: 6; max-height: 420px; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--raised); border: 1px solid var(--gold); border-radius: var(--radius-m); box-shadow: 0 10px 28px rgba(0,0,0,.5); }
.ed-pal-q { background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 9px; font: 14px var(--font); }
.ed-pal-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-pal-cats button { min-height: 32px; border: 1px solid var(--line); background: var(--ink); color: var(--muted); border-radius: 999px; padding: 2px 12px; font: 600 12px var(--font); }
.ed-pal-cats button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.ed-pal-grid { flex: 0 1 auto; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; align-content: start; }
.ed-pal-it { min-height: 40px; display: flex; align-items: center; gap: 6px; text-align: left; padding: 3px 6px; line-height: 1.15; background: var(--ink); border: 1px solid transparent; border-radius: var(--radius-s); color: var(--text); font-size: 13px; }
.ed-pal-it img { width: 26px; height: 26px; flex: none; }
.ed-pal-it span { overflow-wrap: anywhere; }
.ed-pal-it:hover, .ed-pal-it:focus-visible { border-color: var(--gold); }
.ed-pal-none { margin: 0; color: var(--muted); font-size: 13px; }
/* palette complète : recherche + civ du build / toutes, catégories, âges, titres de groupe, âge de chaque élément */
.ed-pal-top { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.ed-pal-top .ed-pal-q { flex: 1 1 200px; min-width: 0; }
.ed-pal-civ { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ed-pal-civ button { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; border: 0; background: var(--ink); color: var(--muted); padding: 2px 11px; font: 600 12px var(--font); }
.ed-pal-civ button img { width: 20px; height: 13px; object-fit: cover; border-radius: 2px; }
.ed-pal-civ button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.ed-pal-ages { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-pal-ages[hidden] { display: none; }
.ed-pal-ages button { min-height: 28px; min-width: 32px; border: 1px solid var(--line); background: var(--ink); color: var(--muted); border-radius: var(--radius-s); padding: 1px 8px; font: 600 12px var(--font); }
.ed-pal-ages button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.ed-pal-h { grid-column: 1 / -1; margin: 6px 2px 0; color: var(--gold); font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .06em; }
.ed-pal-h:first-child { margin-top: 0; }
.ed-pal-it { position: relative; }
.ed-pal-it.is-own { background: linear-gradient(90deg, rgba(214, 178, 94, .14), var(--ink) 70%); }
.ed-pal-age { margin-left: auto; flex: none; color: var(--muted); font: 600 10px var(--font); }
/* démarrage (10/11/2026) : civ à gauche (grille de drapeaux cherchable), façons de commencer à droite ; fenêtre ajustée */
.dlg-editor.is-start { width: min(940px, 97vw); }
.ed-start { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ed-start h3 { margin: 0 0 10px; font: 700 18px var(--font-cond); }
.ed-civpick { display: flex; flex-direction: column; min-width: 0; }
.ed-civ-q { width: 100%; box-sizing: border-box; min-height: 38px; margin-bottom: 8px; padding: 7px 10px 7px 32px; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a59d8b' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14'/%3E%3C/svg%3E") no-repeat 10px 50% / 15px; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 14px var(--font); }
.ed-civ-q:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.ed-civs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 4px; height: 384px; overflow: auto; overscroll-behavior: contain; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.ed-civ { position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px 4px 5px; border: 1px solid transparent; border-radius: var(--radius-s); color: var(--muted); font: 600 14px/1.15 var(--font-cond); cursor: pointer; transition: background-color .12s ease-out, border-color .12s ease-out; }
.ed-civ[hidden] { display: none; }
.ed-civ input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ed-civ img { flex: none; width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }
/* nom de civ jamais coupé (« Dynastie macéd… », 10/11) : retour à la ligne, 3 lignes au plus pour les langues longues */
.ed-civ span { min-width: 0; font-size: 13.5px; line-height: 1.12; overflow-wrap: break-word; hyphens: auto; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.ed-civ:hover { background: var(--panel); color: var(--text); }
.ed-civ:has(input:checked) { background: var(--gold-soft); border-color: var(--gold); color: var(--text); }
.ed-civ:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 1px; }
.ed-civ-none { margin: 6px 2px; }
.ed-ways { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ed-ways h3 { margin-bottom: 0; }
.ed-start-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--ink); color: var(--muted); font: 13px/1.4 var(--font); }
.ed-scratch { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .12s ease-out; }
.ed-sc-txt { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
button.ed-start-card:hover, button.ed-start-card:focus-visible { border-color: var(--gold); }
.ed-sc-txt b, #ed-frompro { font: 700 17px var(--font-cond); color: var(--text); }
.ed-sc-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-size: 20px; line-height: 1; }
.ed-pro-h { display: flex; align-items: center; gap: 10px; }
.ed-pro-h > span { display: flex; flex-direction: column; gap: 1px; }
.ed-pro-flag { flex: none; width: 34px; height: 34px; border-radius: 5px; object-fit: cover; }
.ed-pro-civ { color: var(--muted); }
.ed-pros { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; overscroll-behavior: contain; margin-top: 6px; padding-right: 2px; scrollbar-width: thin; }
.ed-pro { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t a" "m a" "i i"; gap: 4px 12px; align-items: center; min-height: 34px; text-align: left; padding: 9px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); font: 13px var(--font); cursor: pointer; transition: border-color .12s ease-out; }
.ed-pro:hover, .ed-pro:focus-visible { border-color: var(--gold); }
.ed-pro-t { grid-area: t; font: 700 15px/1.25 var(--font-cond); }
.ed-pro-m { grid-area: m; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: 12px; }
.ed-pro-m b { color: var(--gold); font-weight: 700; }
.ed-pro-tag { padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; }
.ed-pro-ages { grid-area: a; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font: 700 14px var(--font-cond); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.ed-pro-ages > span { display: inline-flex; align-items: center; gap: 5px; }
.ed-pro-ages img, .ed-pro-ages .ico-pill { width: 20px; height: 20px; }
.ed-pro-ico { grid-area: i; display: flex; flex-wrap: wrap; gap: 4px; }
.ed-pro-ico img, .ed-pro-ico .ico-pill { width: 26px; height: 26px; border-radius: 4px; background: var(--ink); }
.ed-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  .ed-start { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ed-civs { height: 208px; }
  .ed-pros { max-height: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .ed-civ, .ed-pro, .ed-scratch { transition: none; } }
/* visite de 3 bulles */
.ed-tour { position: absolute; z-index: 7; padding: 10px 12px; background: var(--raised); border: 1px solid var(--gold); border-radius: var(--radius-m); box-shadow: 0 8px 24px rgba(0,0,0,.5); font-size: 14px; font-weight: 600; line-height: 1.45; }
.ed-tour p { margin: 0 0 8px; }
.ed-tour-n { color: var(--gold); margin-right: 4px; }
.ed-tour-b { display: flex; justify-content: flex-end; gap: 6px; }
.ed-tour-on { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--radius-s); }
@media (prefers-reduced-motion: no-preference) { .ed-tour, .ed-pal { animation: toast-in .16s ease-out; } }

.dlg-share { width: min(560px, 92vw); }
.sh-row { display: flex; gap: 8px; align-items: flex-start; }
/* code long : cadre fixe de 3 lignes entières, le reste défile DANS le cadre (le padding est sur la boîte, pas sur le
 * textarea : aucune 4e ligne coupée à moitié en bas) ; Copier prend toujours le code complet */
.sh-box { flex: 1; min-width: 0; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 4px 6px 8px; }
.sh-box:focus-within { border-color: var(--gold); }
.sh-row textarea { display: block; width: 100%; box-sizing: border-box; height: 54px; resize: none; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--muted); font: 12px/18px ui-monospace, monospace; word-break: break-all; overflow-y: auto; scrollbar-width: thin; }
.sh-h { margin: 16px 0 8px; font: 700 13px var(--font-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sh-link { display: flex; gap: 8px; align-items: center; }
.sh-link input { flex: 1; background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 8px; font: 14px var(--font); }
.sh-code { font: 700 18px var(--font-cond); letter-spacing: .12em; color: var(--gold); }
.sh-l { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.sh-c { display: flex; gap: 6px; align-items: center; font-size: 14px; margin-bottom: 6px; }
.error.is-info { color: var(--gold); }
@media (max-width: 900px) { .ed-cols { grid-template-columns: 1fr; } .ed-preview { display: none; }  }
.row-title small .pb-vote { margin-left: 8px; vertical-align: middle; }
.row-title small .pb-v { padding: 1px 7px; }
.pb-vote.is-own .pb-v { cursor: default; }
.ed-preview .age-block > ol > li.is-cur { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }

.ed-card button:focus-visible, .ed-card input:focus-visible, .ed-pal button:focus-visible, .ed-pal input:focus-visible, .ed-addbar button:focus-visible, .ed-start button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ed-tools button[disabled], .ed-stepper button[disabled] { opacity: .3; }

/* « Quoi faire » : une phrase libre, texte et pastilles d'icônes mêlés dans l'ordre (05/11/2026) */
.ed-close { margin-left: auto; flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--ink); color: var(--text); padding: 0; cursor: pointer; }
.ed-help + .ed-close { margin-left: 4px; }
.ed-close:hover, .ed-close:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; box-shadow: 0 0 0 2px var(--gold-soft); }
.ed-start-foot { display: flex; justify-content: flex-end; }
.ed-sent { flex: 1 1 320px; min-width: 0; min-height: 38px; box-sizing: border-box; padding: 5px 9px; background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 14px/26px var(--font); white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; outline: none; }
.ed-sent:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.ed-sent:empty::before { content: attr(data-ph); color: var(--faint); pointer-events: none; }
.ed-sent.is-example { flex: 1; border-style: dashed; background: none; color: var(--muted); cursor: default; }
.ed-tok { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin: 1px 1px; padding: 0 2px 0 3px; height: 26px; line-height: 24px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; user-select: all; cursor: grab; }
.ed-tok img, .ed-tok .ico-pill { width: 20px; height: 20px; flex: none; }
.ed-tok .ed-tok-n { padding-right: 3px; }
.is-example .ed-tok { cursor: default; padding-right: 6px; margin-right: 0; }
.ed-tok-x { border: 0; background: none; color: var(--muted); width: 20px; height: 20px; border-radius: 50%; padding: 0; font-size: 10px; line-height: 20px; cursor: pointer; }
.ed-tok-x:hover { background: var(--hover); color: var(--text); }
.ed-sent-h { flex: 0 0 100%; display: none; }
.ed-card.is-last .ed-sent-h, .ed-card:focus-within .ed-sent-h { display: block; }
.ed-sug { position: absolute; z-index: 8; width: 300px; padding: 4px; background: var(--raised); border: 1px solid var(--gold); border-radius: var(--radius-m); box-shadow: 0 10px 28px rgba(0,0,0,.5); }
.ed-sug-list { max-height: 300px; overflow: auto; }
.ed-sug-it { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-s); font-size: 14px; cursor: pointer; }
.ed-sug-it img, .ed-sug-it .ico-pill { width: 24px; height: 24px; flex: none; }
.ed-sug-it span { flex: 1; }
.ed-sug-it[aria-selected="true"], .ed-sug-it:hover { background: var(--gold-soft); color: var(--text); }
.ed-sug-h { display: block; padding: 4px 8px 2px; font-size: 11px; color: var(--faint); }
.ed-sug .ed-hint { padding: 6px 8px; }
.ed-leave { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(0,0,0,.55); border-radius: var(--radius-m); }
.ed-leave-box { max-width: 420px; padding: 16px 18px; background: var(--raised); border: 1px solid var(--gold); border-radius: var(--radius-m); box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.ed-leave-box p { margin: 0 0 14px; font-size: 15px; font-weight: 600; line-height: 1.45; }
.ed-leave-box .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ed-leave button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .ed-sug, .ed-leave-box { animation: toast-in .14s ease-out; } }

/* ---------- réglages : menu de groupes à gauche, un groupe à la fois, tout visible sans défiler à 1280x740 ---------- */
.dlg-settings { width: min(900px, calc(100vw - 48px)); height: min(640px, calc(100vh - 40px)); max-height: none; overflow: hidden; }
.dlg-settings .set-body { display: flex; flex-direction: column; height: 100%; padding: 0; }
.set-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.set-head h2 { margin: 0; }
.set-saved { margin: 0 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #7fc48d; opacity: 0; transform: translateY(2px); transition: opacity .18s ease-out, transform .18s ease-out; }
.set-saved::before { content: ''; width: 4px; height: 8px; margin: -3px 2px 0 1px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.set-saved.is-on { opacity: 1; transform: none; }
.set-saved:empty { visibility: hidden; }
.set-x { width: 32px; height: 32px; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); font-size: 22px; line-height: 1; transition: background .15s ease-out, color .15s ease-out; }
.set-x:hover { background: var(--hover); color: var(--text); }
.set-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 216px 1fr; }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-right: 1px solid var(--line); background: var(--ink); }
.set-tab { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); font-weight: 600; text-align: left; transition: background .15s ease-out, color .15s ease-out; }
.set-tab:hover { background: var(--hover); color: var(--text); }
.set-tab.is-on { background: var(--gold-soft); color: var(--gold); box-shadow: inset 2px 0 0 var(--gold); }
.set-ico { display: inline-flex; flex: none; }
.set-nav .set-quit { margin-top: auto; padding: 10px 10px 2px; border-top: 1px solid var(--line); }
.set-panels { min-height: 0; overflow-y: auto; padding: 14px 22px 16px; }
.set-panel { animation: set-in .16s ease-out; }
@keyframes set-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.set-ptitle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.set-ptitle h3 { margin: 0; font-family: var(--font-cond); font-size: 18px; }
.set-reset { padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; transition: border-color .15s ease-out, color .15s ease-out; }
.set-reset:hover { border-color: var(--muted); color: var(--text); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0; border-top: 1px solid rgba(42, 54, 80, .55); }
.set-ptitle + .set-row, .set-preview + .set-row, .set-adv > summary + .set-row { border-top: 0; }
.set-lbl { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.set-lbl label { font-weight: 600; cursor: pointer; }
.set-lbl small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.set-lbl small:empty { display: none; }
.set-ctl { flex: none; display: flex; align-items: center; gap: 10px; }
.set-ctl input[type=range] { width: 170px; accent-color: var(--gold); }
.set-ctl select { min-width: 210px; }
.set-val { min-width: 44px; text-align: right; font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.set-row-btn { justify-content: flex-end; border-top: 0; }
.set-ctl :disabled, .set-row-btn :disabled { opacity: .4; cursor: default; }
/* interrupteur (oui / non) : la case à cocher garde son rôle, son id et le clavier */
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); cursor: pointer; transition: background .18s ease-out, border-color .18s ease-out; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .18s ease-out; }
.switch:checked { background: var(--gold); border-color: var(--gold); }
.switch:checked::after { transform: translateX(16px); background: var(--ink); }
.switch:hover { border-color: var(--muted); }
.switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* aperçu de l'overlay : suit la taille, le fond, le mode compact et l'étape suivante */
.set-preview { position: relative; display: flex; align-items: center; justify-content: center; height: 104px; margin: 4px 0 6px; border-radius: var(--radius-m); overflow: hidden;
  background: linear-gradient(135deg, #3d4a2b 0%, #5a5233 38%, #36502f 62%, #2c3d4f 100%); }
.set-preview::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 6px, transparent 6px 14px); }
.set-pv-tag { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(236, 229, 211, .75); }
.set-pv-ov { --pv-scale: 1; --pv-alpha: .86; position: relative; min-width: 220px; padding: calc(6px * var(--pv-scale)) calc(10px * var(--pv-scale)); border-radius: 6px; border: 1px solid rgba(224, 173, 69, .35);
  background: rgba(16, 22, 36, var(--pv-alpha)); font-size: calc(12px * var(--pv-scale)); line-height: 1.3; transition: font-size .15s ease-out, background .15s ease-out; }
.set-pv-title { display: flex; justify-content: space-between; gap: 14px; color: var(--gold); font-family: var(--font-cond); }
.set-pv-title span { font-variant-numeric: tabular-nums; color: var(--text); }
.set-pv-now { font-weight: 600; }
.set-pv-next { color: var(--muted); }
.set-pv-ov.is-compact .set-pv-title, .set-pv-ov.is-compact .set-pv-next, .set-pv-ov.no-next .set-pv-next { display: none; }
/* avancé : replié, une flèche qui tourne */
.set-adv { margin-top: 4px; border-top: 1px solid var(--line); }
.set-adv > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 0 4px; color: var(--muted); font-weight: 600; cursor: pointer; }
.set-adv > summary::-webkit-details-marker { display: none; }
.set-adv > summary::before { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(-45deg); transition: transform .15s ease-out; }
.set-adv[open] > summary::before { transform: rotate(45deg); }
.set-adv > summary:hover { color: var(--text); }
/* compte */
.set-block { padding: 2px 0 10px; }
.set-btitle { margin: 4px 0 2px; font-weight: 600; }
.profile-current.is-none { color: var(--muted); font-weight: 500; }
#set-pba { border-top: 1px solid rgba(42, 54, 80, .55); margin-top: 6px; padding-top: 10px; }
#set-pba legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-weight: 600; }
/* raccourcis : deux colonnes de libellés, la touche à droite */
#set-p-keys .keys { gap: 4px 14px; align-items: center; }
#set-p-keys .keys dt { padding: 5px 0; border-top: 1px solid rgba(42, 54, 80, .55); }
#set-p-keys .keys dd { padding: 5px 0; border-top: 1px solid rgba(42, 54, 80, .55); text-align: right; }
.kbd-btn { min-width: 92px; padding: 3px 6px; border: 1px solid transparent; border-radius: var(--radius-s); background: none; transition: border-color .15s ease-out, background .15s ease-out; }
.kbd-btn:hover { border-color: var(--line); background: var(--hover); }
.kbd-btn.is-capturing { border-color: var(--gold); background: var(--gold-soft); }
.set-about .hint { font-size: 12.5px; }
.set-version { color: var(--muted); font-family: var(--font-cond); font-weight: 600; font-variant-numeric: tabular-nums; }
.set-about-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
#set-p-keys .keys { column-gap: 0; }
#set-p-keys .keys dd { padding-left: 14px; }
@media (prefers-reduced-motion: reduce) { .set-panel { animation: none; } .switch, .switch::after, .set-saved { transition: none; } }

/* ---------- profil du jeu affiché : puce de la barre du haut + panneau « Pas toi ? » (js/me-switch.js) ---------- */
.me-g { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: var(--radius-s); background: var(--gold-soft); color: var(--gold); font-family: var(--font-cond); font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.me-chip { flex: 0 1 auto; min-width: 0; max-width: 300px; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 6px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line); color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; transition: border-color .15s ease-out, background-color .15s ease-out; }
.me-chip:hover, .me-chip[aria-expanded='true'] { border-color: var(--gold); background: var(--raised); }
.me-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.me-chip .me-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.me-chip .me-elo { flex: none; font-family: var(--font-cond); font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.me-chip .me-elo small { margin-left: 2px; font-weight: 500; color: var(--muted); font-size: 11px; }
.me-chip .me-q { flex: none; color: var(--muted); font-size: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.me-chip:hover .me-q { color: var(--text); }
.me-chip.is-none { border-style: dashed; border-color: var(--gold); }
.me-chip .me-link { color: var(--gold); }
@media (max-width: 1180px) { .me-chip .me-q { display: none; } }

.me-pop { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(-4px); transition: opacity .16s ease-out, transform .16s ease-out; }
.me-pop.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .me-pop, .me-chip { transition: none; } }
.me-ph { display: flex; align-items: center; gap: 8px; }
.me-ph h3 { flex: 1; margin: 0; font-family: var(--font-cond); font-size: 16px; }
.me-x { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); cursor: pointer; }
.me-x:hover, .me-x:focus-visible { background: var(--hover); color: var(--text); }
.me-cur { margin: 0; display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--raised); border-left: 3px solid var(--gold); }
.me-cur b { font-size: 15px; }
.me-cur span { color: var(--gold); font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums; }
.me-cur.is-none { color: var(--muted); border-left-color: var(--line); }
.me-steam { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.me-lbl { margin: 2px 0 -4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.me-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.me-list:empty { display: none; }
.me-row { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 0; border-radius: var(--radius-s); background: none; color: var(--text); text-align: left; cursor: pointer; transition: background-color .15s ease-out; }
.me-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.me-row small { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.me-row:hover, .me-row:focus-visible { background: var(--hover); outline: none; }
.me-list .hint, .me-list .error { padding: 4px 8px; font-size: 13px; color: var(--muted); }
.me-list .error { color: #e6857a; }
.me-field input { min-width: 0; }
.me-pf { margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.me-other { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 6px; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.me-other:hover, .me-other:focus-visible { color: var(--text); background: var(--hover); outline: none; }
.me-hint { margin: 16px 20px 0; border-style: solid; }
.me-hint .me-g { flex: none; }
.me-hint .me-htxt { flex: 1; font-weight: 600; }
.me-toast { display: flex; align-items: center; gap: 12px; }
.me-toast span { flex: 1; }
.builds.is-home .me-hint:not([hidden]), .builds.is-history .me-hint:not([hidden]), .builds.is-maps .me-hint:not([hidden]) { display: flex; }

.ed-msg.is-hint { color: var(--muted); }
#import-text { font-family: inherit; }
.profile-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.profile-line .profile-current { margin: 0; flex: 1 1 auto; min-width: 0; }
.profile-line .profile-auto, .profile-line .profile-unlink { margin: 0; }

/* ---- Réglages vivants (2026-11-10) : l'état sous chaque groupe, l'overlay posé sur une vraie partie, de vraies icônes ---- */
.set-tab { align-items: flex-start; }
.set-tab .set-ico { margin-top: 1px; }
.set-tname { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.set-sum { font-size: 12px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.set-sum:empty { display: none; }
.set-tab.is-on .set-sum { color: rgba(224, 173, 69, .75); }
.set-preview { height: 106px; margin: 2px 0 4px; background: #2d3a24 url(../icons/scenes/scene-aoe4.webp) center 30% / cover no-repeat; }
body[data-game='aoe2'] .set-preview { background-image: url(../icons/scenes/scene-aoe2.webp); background-position: center 45%; }
.set-preview::before { background: linear-gradient(180deg, rgba(16, 22, 36, .35), rgba(16, 22, 36, 0) 40%, rgba(16, 22, 36, .3)); }
.set-pv-tag { padding: 2px 6px; border-radius: var(--radius-s); background: rgba(16, 22, 36, .7); color: var(--text); }
.set-pv-ov { box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.set-pv-title b { display: inline-flex; align-items: center; gap: 6px; }
.set-pv-flag img { width: calc(16px * var(--pv-scale)); height: calc(16px * var(--pv-scale)); border-radius: 2px; display: block; }
.set-pv-step { display: flex; align-items: center; gap: calc(8px * var(--pv-scale)); }
.set-pv-icons { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--gold); font-family: var(--font-cond); }
.set-pv-icons img { width: calc(20px * var(--pv-scale)); height: calc(20px * var(--pv-scale)); object-fit: contain; }
.set-pv-icons i { font-style: normal; color: var(--muted); padding: 0 1px; }
.set-pv-ov.is-compact .set-pv-icons { display: none; }
/* voix : la phrase entendue, visible avant de la tester */
.set-voice-pv { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: linear-gradient(90deg, rgba(224, 173, 69, .10), rgba(224, 173, 69, 0) 60%), var(--raised); }
.svp-wave { display: inline-flex; align-items: center; gap: 3px; height: 28px; flex: none; }
.svp-wave i { width: 4px; border-radius: 2px; background: var(--gold); }
.svp-wave i:nth-child(1) { height: 10px; } .svp-wave i:nth-child(2) { height: 22px; } .svp-wave i:nth-child(3) { height: 28px; } .svp-wave i:nth-child(4) { height: 16px; } .svp-wave i:nth-child(5) { height: 8px; }
.svp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.svp-txt small { font-size: 12px; color: var(--muted); font-weight: 600; }
.svp-txt q { font-size: 15px; font-weight: 600; color: var(--text); quotes: '« ' ' »'; }
html:not([lang='fr']) .svp-txt q { quotes: '“' '”'; }
.set-voice-pv .btn { flex: none; }
.set-voice-pv.is-off .svp-wave i { background: var(--faint); }
.set-voice-pv.is-off q { color: var(--muted); }
/* affichage : la planche d'icônes réelle du mode choisi */
.set-icons-pv { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 10px; }
.set-icons-pv span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; background: var(--ink); border: 1px solid var(--line); }
.set-icons-pv img { width: 30px; height: 30px; object-fit: contain; }
.set-icons-pv img[src*="aoe2"] { mix-blend-mode: lighten; border-radius: 4px; }
.set-icons-pv .ico-pill { font-size: 12px; }
/* discord : ce que voient les amis */
.set-dc-pv { margin: 2px 0 6px; }
.set-dc-cap { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.set-dc-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-m); background: #1e1f22; border-left: 3px solid #5865f2; transition: opacity .18s ease-out; }
.set-dc-card img { border-radius: 8px; flex: none; }
.set-dc-card div { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: #dbdee1; line-height: 1.35; }
.set-dc-card b { color: #f2f3f5; font-size: 14px; }
.set-dc-pv.is-off .set-dc-card { opacity: .4; filter: grayscale(1); }
/* à propos */
.set-about-hero { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; padding: 14px 16px; border-radius: var(--radius-m); border: 1px solid rgba(224, 173, 69, .3);
  background: linear-gradient(90deg, rgba(16, 22, 36, .92) 30%, rgba(16, 22, 36, .55)), #2d3a24 url(../icons/scenes/scene-aoe4.webp) center / cover; }
body[data-game='aoe2'] .set-about-hero { background-image: linear-gradient(90deg, rgba(16, 22, 36, .92) 30%, rgba(16, 22, 36, .55)), url(../icons/scenes/scene-aoe2.webp); }
.set-about-hero img { border-radius: 12px; flex: none; }
.set-about-hero > div { display: flex; flex-direction: column; min-width: 0; }
.set-about-hero b { font-family: var(--font-cond); font-size: 22px; color: var(--gold); letter-spacing: .02em; }
.set-about-flags { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.set-about-flags img { width: 26px; height: 26px; border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }

/* ---- Import : trois façons d'importer, reconnues à la frappe ---- */
.dlg-import { width: min(720px, 94vw); max-height: calc(100vh - 32px); overflow-y: auto; }
.imp-body { padding: 0 0 18px; }
.imp-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 16px 16px 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(22, 30, 48, .97) 35%, rgba(22, 30, 48, .7)), #2d3a24 url(../icons/scenes/scene-aoe4.webp) center 40% / cover; }
body[data-game='aoe2'] .imp-head { background-image: linear-gradient(90deg, rgba(22, 30, 48, .97) 35%, rgba(22, 30, 48, .7)), url(../icons/scenes/scene-aoe2.webp); }
.imp-emblem { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(224, 173, 69, .4); }
.imp-htxt { flex: 1; min-width: 0; }
.imp-htxt h2 { margin: 2px 0 4px; }
.imp-htxt .hint { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.imp-kinds { list-style: none; margin: 16px 22px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.imp-kind { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--raised); cursor: text; transition: border-color .15s ease-out, background-color .15s ease-out; }
.imp-kind:hover { border-color: #3a4a6a; }
.imp-kind.is-match { border-color: var(--gold); background: linear-gradient(180deg, rgba(224, 173, 69, .14), rgba(224, 173, 69, .04)); }
.imp-kico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: var(--gold); }
.imp-kico img { border-radius: 6px; }
.imp-ktxt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-ktxt b { font-size: 14px; }
.imp-ktxt small { font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.imp-pick { align-self: flex-start; margin-top: 6px; display: inline-flex; white-space: nowrap; padding: 3px 9px; border-radius: var(--radius-s); border: 1px solid rgba(224, 173, 69, .45); color: var(--gold); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.imp-pick:hover { background: var(--gold-soft); }
.imp-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.imp-pick:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.imp-drop { margin: 12px 22px 0; border: 1px dashed #3a4a6a; border-radius: var(--radius-m); background: var(--ink); transition: border-color .15s ease-out, background-color .15s ease-out; }
.imp-drop:focus-within { border-color: var(--gold); border-style: solid; }
.imp-drop.is-drag { border-color: var(--gold); background: rgba(224, 173, 69, .08); }
.imp-drop #import-text { display: block; width: 100%; box-sizing: border-box; min-height: 92px; padding: 12px 14px; border: 0; background: none; color: var(--text); font-size: 14px; resize: vertical; outline: none; }
.imp-detect { margin: 0; padding: 0 14px; min-height: 0; font-size: 13px; color: var(--muted); }
.imp-detect:empty { display: none; }
.imp-detect.is-ok, .imp-detect.is-none { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 14px; border-top: 1px solid var(--line); }
.imp-detect.is-ok b { color: #7fc48d; display: inline-flex; align-items: center; gap: 6px; }
.imp-detect.is-ok b::before { content: ''; width: 4px; height: 8px; margin: -3px 2px 0 1px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.imp-build { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); font-weight: 600; }
.imp-build img { width: 20px; height: 20px; border-radius: 3px; }
.imp-build em { font-style: normal; color: var(--muted); font-weight: 500; }
.dlg-import .error { margin: 10px 22px 0; }
.imp-actions { align-items: center; margin: 16px 22px 0; }
.imp-alt { margin: 0 auto 0 0; font-size: 13px; color: var(--muted); }
.imp-create { padding: 0; border: 0; background: none; color: var(--gold); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.imp-create:hover { color: #f0c264; }

/* ---- Accueil hors ligne : ce qui se passe, ça revient seul, et tout ce qui marche sans connexion ---- */
.off-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 4px; padding: 16px 18px; border-radius: var(--radius-m); border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(16, 22, 36, .95) 40%, rgba(16, 22, 36, .6)), #2d3a24 url(../icons/scenes/scene-aoe4.webp) center 35% / cover; }
body[data-game='aoe2'] .off-hero { background-image: linear-gradient(90deg, rgba(16, 22, 36, .95) 40%, rgba(16, 22, 36, .6)), url(../icons/scenes/scene-aoe2.webp); }
.off-ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(224, 173, 69, .12); color: var(--gold); border: 1px solid rgba(224, 173, 69, .35); }
.off-txt { flex: 1 1 280px; min-width: 0; }
.off-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--font-cond); font-size: 20px; font-weight: 700; line-height: 1.25; }
.off-who { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--muted); }
.off-lead { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 62ch; }
.off-actions { flex: none; gap: 8px 10px; }
.off-h { margin: 14px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.off-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.off-tile { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--raised); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease-out, background-color .15s ease-out, transform .15s ease-out; }
.off-tile:hover, .off-tile:focus-visible { border-color: var(--gold); background: var(--hover); }
.off-tile:active { transform: translateY(1px); }
.off-vis { flex: none; display: grid; place-items: center; width: 76px; height: 56px; border-radius: 6px; background: var(--ink); overflow: hidden; }
.off-vis img { width: 30px; height: 30px; object-fit: contain; }
.off-vis img[src*="aoe2"] { mix-blend-mode: lighten; border-radius: 3px; }
.off-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.off-tt b { font-size: 14.5px; }
.off-tt small { font-size: 12.5px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.off-flags { display: flex; }
.off-flags img { width: 30px; height: 30px; border-radius: 3px; margin-left: -8px; border: 2px solid var(--ink); }
.off-flags img:first-child { margin-left: 0; }
.off-ov { display: flex; flex-direction: column; gap: 2px; padding: 3px 5px; border-radius: 4px; border: 1px solid rgba(224, 173, 69, .45); background: rgba(16, 22, 36, .9); }
.off-ov i { display: flex; align-items: center; gap: 1px; font-style: normal; }
.off-ov img { width: 20px; height: 20px; }
.off-ov b { font-size: 11px; color: var(--gold); font-family: var(--font-cond); }
.off-steps { display: flex; flex-direction: column; gap: 2px; }
.off-steps i { display: grid; place-items: center; width: 52px; height: 15px; border-radius: 3px; background: var(--raised); font-style: normal; }
.off-steps img { width: 14px; height: 14px; }
.off-steps .plus { color: var(--gold); font-weight: 700; font-size: 12px; border: 1px dashed rgba(224, 173, 69, .5); background: none; }
.off-ct { display: flex; align-items: center; gap: 2px; }
.off-ct i { font-style: normal; color: var(--gold); font-weight: 700; }
.hg-a2-fix { margin: 8px 0 0; font-size: 14.5px; font-weight: 600; color: var(--text); }
.hg-a2-fix::before { color: var(--vd, var(--vd-bad)); font-weight: 800; }
/* audit c116: one bold action line, then the how / what it is worth in small (read in 5 s) */
.hg-vd-why { margin: 2px 0 0; padding-left: 1.15em; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--muted); }
/* c121: the target time of a fix, coloured at the head of its small line (audit c119: it was lost in the grey) */
.hg-vd-why .hg-vd-goal { font-weight: 700; color: var(--vd-good, #5fd38d); white-space: nowrap; }
/* c128 (audit c126): the goal on a line of its own, as big as the action line above it, in every card that has an action */
.hg-vd-goal-l { margin: 3px 0 0; padding-left: 1.15em; font-size: 14.5px; font-weight: 700; line-height: 1.3; color: var(--vd-good, #5fd38d); }
.hg-vd-goal-l + .hg-vd-why { margin-top: 1px; }
/* c131 (audit c129): green goal on the green win card was barely seen; a dark band, label in the goal colour, target in white (no extra height) */
.hg-vd-goal-l { width: fit-content; max-width: calc(100% - 1.15em); margin-left: calc(1.15em - 8px); padding: 1px 8px; border-radius: 5px; background: rgba(6, 10, 16, .55); box-shadow: inset 3px 0 0 var(--vd-good, #5fd38d); }
.hg-vd-goal-l .hg-goal-k { font-weight: 800; }
.hg-vd-goal-l .hg-goal-v { color: var(--text); }
.hg-a2 > .hs-sec:not([open]) { margin-top: 4px; }

/* partie en équipe (2v2-4v4) : phrase-titre colorée, ✓ / à corriger, puis âges et score militaire de chaque joueur (toi et tes alliés en bleu, eux en rouge) */
.hg-team { --me: var(--age-3); --op: #e6857a; margin-bottom: 18px; }
.hg-tm-wrap { padding: 12px 16px; border-radius: var(--radius-m); background: var(--raised); border: 1px solid var(--line); }
.hg-tm-wrap h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hg-tm { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hg-tm th, .hg-tm td { padding: 6px 8px; text-align: right; font-size: 13.5px; }
.hg-tm tr > :first-child { text-align: left; }
.hg-tm tr:first-child th { font-size: 12px; font-weight: 600; color: var(--muted); }
.hg-tm th[scope="row"] { font-weight: 600; border-left: 3px solid var(--me); }
.hg-tm tr.is-opp th[scope="row"] { border-left-color: var(--op); }
.hg-tm tr.is-sep > * { border-top: 1px solid var(--line); }
.hg-tm tr.is-me th[scope="row"] .hg-tm-p > span { color: var(--me); }
/* c76 : la liste des joueurs redit le tableau miroir : masquée quand il est là ; la civ passe sous chaque nom, l'Elo moyen sous « Moyenne » */
.hist-game:has(.hg-tm-mirror) .hg-vs.team { display: none; }
.hg-tm .hg-tm-nm { display: block; font-weight: inherit; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-tm .hg-tm-p > span { min-width: 0; }
.hg-tm .hg-tm-civ { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 500; line-height: 1.25; color: var(--muted); letter-spacing: 0; text-transform: none; white-space: normal; }
.hg-tm tr.hg-tm-avg th .hg-tm-civ { font-size: 11px; }
.hg-tm-p { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.hg-tm-p img { width: 26px; height: 17px; object-fit: cover; border-radius: 2px; flex: none; }
.hg-tm-p > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.hg-tm td { color: var(--muted); }
.hg-tm td.hg-tm-best { font-weight: 700; color: var(--text); }
/* audit c59 (référence Mobalytics) : tableau miroir en haut de la fiche d'équipe, une ligne par joueur et les mêmes colonnes
   des deux côtés ; la colonne de l'âge du titre est la colonne clé, tes valeurs en vert (devant eux) ou orange (derrière) */
.hg-tm-mirror { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hg-tm-mirror .hg-tm { background: var(--raised); border: 1px solid var(--line); border-top: 3px solid var(--me); border-radius: var(--radius-m); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.hg-tm-mirror .hg-tm.is-foes { border-top-color: var(--op); }
.hg-tm-mirror .hg-tm th, .hg-tm-mirror .hg-tm td { padding: 5px 10px; }
.hg-tm-mirror .hg-tm tr.hg-tm-h th { font-size: 12px; line-height: 1.2; font-weight: 600; color: var(--muted); vertical-align: bottom; padding-top: 7px; }
.hg-tm-mirror .hg-tm tr.hg-tm-h th:first-child { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--me); }
.hg-tm-mirror .hg-tm.is-foes tr.hg-tm-h th:first-child { color: var(--op); }
.hg-tm-mirror .hg-tm tr.hg-tm-h th:not(:first-child) { padding-inline: 3px; } /* c94: « Edad de los Castillos » on 2 lines, not 3 */
.hg-tm-mirror .hg-tm tr.hg-tm-h th.is-key { color: var(--text); font-weight: 700; }
/* c165 (audit c164) : en-têtes sur 2 lignes au plus dans les 15 langues (ES « Edad de los Castillos », DE « Dorfbewohner um 10:00 »,
   VI « Thời kỳ Phong kiến » passaient sur 3) ; les lignes des deux tableaux sont alignées par alignMirror() */
.hg-tm-mirror .hg-tm tr.hg-tm-h th:not(:first-child) { font-size: 11px; letter-spacing: -.01em; }
.hg-tm-mirror { align-items: start; }
.hg-tm-mirror .hg-tm th[scope="row"] { border-left: 0; font-size: 14px; }
.hg-tm-mirror .hg-tm.is-foes th[scope="row"] .hg-tm-p > span { color: var(--text); }
.hg-tm-mirror .hg-tm { table-layout: fixed; width: 100%; min-width: 0; }
.hg-tm-mirror .hg-tm tr > :first-child { width: 43%; }
/* c143 (audit c141) : RU/UK « Феодальная эпоха » (key column, 12.5 px bold) wider than its cell at 1280 px : narrower player column */
:is(:lang(ru), :lang(uk)) .hg-tm-mirror.has-key .hg-tm tr > :first-child { width: 38%; }
:is(:lang(ru), :lang(uk)) .hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th.is-key { padding-inline: 2px; letter-spacing: -.02em; }
.hg-tm-mirror .hg-tm-p { display: flex; max-width: 100%; }
.hg-tm-mirror .hg-tm-p > span { max-width: none; min-width: 0; }
.hg-tm-mirror .hg-tm td { color: var(--text); font-size: 14px; }
.hg-tm-mirror .hg-tm td.is-key { font-size: 17px; font-weight: 800; background: color-mix(in srgb, var(--text) 5%, transparent); }
.hg-tm-mirror .hg-tm th.is-key { background: color-mix(in srgb, var(--text) 5%, transparent); }
.hg-tm-mirror .hg-tm td.is-good { color: var(--vd-good); font-weight: 700; }
.hg-tm-mirror .hg-tm td.is-bad { color: var(--vd-bad); font-weight: 700; }
.hg-tm-mirror .hg-tm td.is-key.is-good, .hg-tm-mirror .hg-tm td.is-key.is-bad { font-weight: 800; }
/* audit c62 : ligne « Moyenne » de chaque équipe (la cible du conseil s'y lit), colonne clé plus marquée, autres colonnes calmes */
.hg-tm-mirror .hg-tm tr.hg-tm-avg > * { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--text) 3%, transparent); }
.hg-tm-mirror .hg-tm tr.hg-tm-avg th[scope="row"] { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hg-tm-mirror .hg-tm tr.hg-tm-avg td { font-weight: 700; }
.hg-tm-mirror .hg-tm .hg-tm-gap { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 700; line-height: 1.35; white-space: normal; overflow-wrap: normal; }
/* c171: the average comparison needs the full metric column. Reclaim horizontal
   cell padding instead of squeezing the words or lowering the line height. */
.hg-tm-mirror .hg-tm tr.hg-tm-avg td { padding-inline: 2px; border-left: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.hg-tm-mirror .hg-tm tr.hg-tm-avg td .hg-tm-gap { hyphens: none; }
.hg-tm-mirror .hg-tm .hg-tm-gap .hg-tm-d { white-space: nowrap; } /* c96 : la durée sur une ligne, « plus tard » dessous si la case est étroite */
/* c211 (audits c197-c209, N°2) : écart de villageois de la ligne Moyenne sur une ligne quand il tient (classe posée par alignMirror) ;
   RU/UK/VI : l'écart passe à 10,5 px (« меньше на 3 » 84 px pour 76) ; élargir la colonne coupait « Bertrand_HRE » ou les en-têtes d'âge */
.hg-tm-mirror .hg-tm tr.hg-tm-avg td .hg-tm-gap.is-n.is-1l { white-space: nowrap; overflow: hidden; }
:is(:lang(ru), :lang(uk), :lang(vi)) .hg-tm-mirror .hg-tm tr.hg-tm-avg td .hg-tm-gap.is-n { font-size: 10.5px; letter-spacing: -.02em; }
/* c99 (audit c98) : rang de chaque joueur dans la colonne clé, à droite de l'heure, même règle pour les deux équipes */
/* c106 (audit c104) : petit, gris, coupé au trait de colonne → sous l'heure, « 3e sur 4 », le 1er en or */
.hg-tm-mirror .hg-tm tr:not(.hg-tm-avg) td.is-key:has(.hg-tm-rk) { line-height: 1.1; padding-top: 3px; padding-bottom: 3px; } /* la ligne ne grandit pas (690 px) */
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 600; line-height: 14px; color: color-mix(in srgb, var(--text) 82%, var(--muted)); white-space: nowrap; }
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk b { display: inline-block; padding: 0 5px; border-radius: 8px; font-size: 12px; font-weight: 800; line-height: 14px; color: #fff; background: rgba(255,255,255,.24); } /* c108 (audit c107) : 2e-4e lisibles (AA) */
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk.is-1st b { color: #1a1406; background: #e8b84a; }
/* c112 (audit c110, Mobalytics) : rang petit et gris, ta ligne pas mise en avant → rang un cran plus gros (même hauteur
   de ligne : 690 px), « sur 4 » en clair, et TA ligne teintée de ton bleu avec un trait à gauche (aucune hauteur en plus) */
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk { font-size: 12px; color: var(--text); }
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk b { padding: 0 6px; font-size: 13px; }
.hg-tm-mirror .hg-tm tr.is-me > * { background-color: color-mix(in srgb, var(--me) 13%, var(--raised)); }
.hg-tm-mirror.has-key .hg-tm tr.is-me td.is-key { background-color: color-mix(in srgb, var(--me) 18%, var(--raised)); }
.hg-tm-mirror .hg-tm tr.is-me th[scope="row"] { box-shadow: inset 3px 0 0 var(--me); }
/* c115 (audit c113, Mobalytics) : de la 2e à la 4e place la pastille avait le même gris : médailles lues sans légende
   (or, argent, bronze ; 4e et plus en gris clair), texte sombre AA ; TA pastille cerclée de ton bleu pour trouver ton rang d'un coup d'œil */
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk.is-2nd b { color: #14171c; background: #c9d0da; }
/* c158 (audit c157 #2) : le bronze orangé se lisait comme l'orange « à travailler » : bronze froid, gris-brun */
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk.is-3rd b { color: #17120d; background: #a8937e; }
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk:not(.is-1st):not(.is-2nd):not(.is-3rd) b { color: #fff; background: #5d6675; }
.hg-tm-mirror .hg-tm td.is-key .hg-tm-rk.is-you b { box-shadow: 0 0 0 2px var(--me); }
.hg-tm-mirror .hg-tm tr:not(.hg-tm-avg) td.is-key { white-space: nowrap; padding-left: 6px; padding-right: 6px; } /* l'heure et son rang sur une ligne : la colonne s'élargit, la ligne ne grandit pas */
.hg-tm-mirror.has-key .hg-tm th.is-key, .hg-tm-mirror.has-key .hg-tm td.is-key { background: color-mix(in srgb, var(--text) 8%, transparent); box-shadow: inset 2px 0 0 color-mix(in srgb, var(--text) 22%, transparent), inset -2px 0 0 color-mix(in srgb, var(--text) 22%, transparent); }
.hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th.is-key { color: var(--text); font-size: 12.5px; }
/* c180 (audit c179 #1) : l'en-tête de la colonne clé ne touche plus ses filets (liseré 2 px + 4 px d'air) ; en RU/UK
   « Феодальная » ne tenait pas dans le tiers restant : la colonne clé prend 23 % en 12 px, les deux autres se partagent le reste */
.hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th.is-key { padding-inline: 6px; }
:is(:lang(ru), :lang(uk)) .hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th.is-key { width: 23%; padding-inline: 6px; letter-spacing: 0; font-size: 12px; }
.hg-tm-mirror.has-key .hg-tm td:not(.is-key).is-good, .hg-tm-mirror.has-key .hg-tm td:not(.is-key).is-bad { font-weight: 500; }
.hg-tm-mirror.has-key .hg-tm td:not(.is-key).is-good { color: color-mix(in srgb, var(--vd-good) 55%, var(--text)); }
.hg-tm-mirror.has-key .hg-tm td:not(.is-key).is-bad { color: color-mix(in srgb, var(--vd-bad) 55%, var(--text)); }
/* audit c83 : le joueur de ton équipe le plus en retard sur l'âge du titre, marqué dans la colonne clé */
.hg-tm-mirror.has-key .hg-tm td.is-key.is-worst { background: color-mix(in srgb, var(--vd-bad) 20%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--vd-bad) 70%, transparent); }

/* audit c56 (règle anti-stagnation, référence Mobalytics : tout sur un écran) : en-tête sur une ligne, bilan Toi/Lui sous
   son nom, et les listes de corrections en 2 colonnes pour que toutes se lisent sans défiler à 1280x690 */
.hist-game .hg-head { align-items: center; justify-content: flex-start; gap: 10px 18px; padding-bottom: 10px; }
.hist-game .hg-head .hg-back { flex: none; align-self: center; }
.hist-game .hg-head .hg-res { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; min-width: 0; flex: 1; }
.hist-game .hg-head .hg-res b { font-size: 34px; }
.hist-game .hg-head .hg-res span { margin-top: 0; }
.hist-game .hg-head .hg-elo { margin-left: auto; }
.hist-game .hg-vs { padding: 8px 0; }
.hist-game .hg-side img { width: 42px; height: 42px; }
.hg-side .hg-h2h { display: block; margin: 1px 0 0; font-size: 13px; }
.hg-vd-other .hg-vd-moments:has(> li + li) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li { display: flex; min-width: 0; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li > button, .hg-vd-other .hg-vd-moments:has(> li + li) > li > .row { grid-template-columns: 40px minmax(0, 1fr); align-content: start; height: 100%; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li > button > em { grid-column: 2; justify-self: start; margin-top: 2px; }
.hg-vd-other .hg-vd-moments:has(> li + li):not(:has(li > button, li > .row > b:not(.nt))) li > .row { grid-template-columns: 16px minmax(0, 1fr); }
.hg-side .hg-h2h { white-space: nowrap; }
.hg-side .hg-h2h b { display: inline; font-size: inherit; }
.hg-vd-other .hg-vd-moments:has(> li:nth-child(3)):not(:has(> li:nth-child(4))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* c87 (audit c86): fixes are no longer numbered; a card with a before/after tag on its top edge keeps room for it */
.hg-vd-fixes > li { position: relative; }
.hg-vd-fixes:has(> li > .hg-rank-why) { margin-top: 12px !important; }
.hg-rank-n { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; vertical-align: -5px; font-size: 12px; font-weight: 800; line-height: 1; letter-spacing: 0; color: var(--ink); background: var(--vd-bad); font-variant-numeric: tabular-nums; }
.hg-vd-moments .hg-vd-cost.is-later { font-weight: 500; color: var(--muted); }
/* audit c74: why a card has its rank, on its top edge next to the number (before / after the turning point) */
.hg-rank-why { position: absolute; z-index: 1; top: -9px; left: 12px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; border-radius: 999px; font-size: 11px; letter-spacing: -.01em; font-weight: 700; line-height: 16px; white-space: nowrap; color: var(--vd-bad); background: var(--ink); border: 1px solid color-mix(in srgb, var(--vd-bad) 55%, var(--line)); }
.hg-rank-why.is-later { color: var(--muted); border-color: var(--line); font-weight: 600; }
.hg-vd-fixes > li:has(> .hg-rank-why) > button, .hg-vd-fixes > li:has(> .hg-rank-why) > .row { padding-top: 12px; }

/* c73 (audit c71 + c68): in the grid of fixes, the time and a compact « See it on the map » share the first line and the text takes
   the full width of the card, so fix n°1 fits whole at 1280x690 (EN) instead of being cut under « More below » */
.hg-vd-other .hg-vd-moments:has(> li + li) > li > button { grid-template-columns: auto minmax(0, 1fr); row-gap: 2px; column-gap: 8px; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li > button > b { grid-row: 1; grid-column: 1; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li > button > em { grid-row: 1; grid-column: 2; justify-self: start; align-self: baseline; margin-top: 0; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li > button > em::before { content: '· '; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li > button > span { grid-row: 2; grid-column: 1 / -1; }
.hg-vd-other .hg-vd-moments:has(> li + li) > li > .row:has(> b:not(.nt)) { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
/* short windows (Overwolf 1280x690): the same blocks, tighter, so fix n°1 is read whole without scrolling */
@media (max-height: 740px) {
  .hg-verdict { gap: 6px; }
  /* c76 (audit c74) : fenêtre basse, l'en-tête toi / adversaire sur 2 lignes au lieu de 3 (nom et civ côte à côte), et le
     tableau d'équipe plus serré, pour que le texte de chaque correction tienne au-dessus de « Plus bas » */
  .hg-vs:not(.team) { padding: 8px 0; }
  .hg-vs:not(.team) .hg-side img { width: 40px; height: 40px; }
  .hg-vs:not(.team) .hg-side > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
  .hg-vs:not(.team) .hg-side.opp > div { justify-content: flex-end; }
  .hg-vs:not(.team) .hg-side > div > .hg-h2h { flex-basis: 100%; }
  .hg-tm-mirror .hg-tm th, .hg-tm-mirror .hg-tm td { padding-top: 4px; padding-bottom: 4px; }
  .hg-tile { padding-top: 5px; padding-bottom: 6px; }
  .hg-tiles > .hg-tile { padding-bottom: 5px; }
  .hg-tiles, .hg-tiles:has(.is-key) { padding-top: 2px; }
  .hg-vd-main { padding: 10px 16px; }
  .hg-vd-other { padding: 8px 16px 10px; }
  .hg-verdict h3 { margin-bottom: 4px; }
  .hg-vd-fixes:has(> li > .hg-rank-why) { margin-top: 10px !important; }
  .hg-vd-other .hg-vd-moments:has(> li + li) > li > button, .hg-vd-other .hg-vd-moments:has(> li + li) > li > .row { padding-top: 6px; padding-bottom: 6px; }
  .hg-vd-other .hg-vd-moments .hg-vd-fix { margin-top: 2px; }
  .hg-vd-moments .hg-vd-cost { margin-top: 1px; }
  /* c99 : 2v2 à 690, en-têtes et lignes de texte un peu plus serrés pour que la correction d'« Aussi à corriger » tienne en DE */
  .hg-tm-mirror .hg-tm .hg-tm-h th { padding-top: 3px; padding-bottom: 3px; line-height: 1.15; }
  .hist-game .hg-head .hg-res { column-gap: 10px; }
  .hist-game .hg-head .hg-res span { font-size: 13px; } /* « NIEDERLAGE » + date sur une ligne : ~12 px gagnés en DE */
  .hg-team .hg-vd-main > p { line-height: 1.32; }
  .hg-team .hg-vd-main > .hg-vd-fix { margin-top: 6px; }
  /* c128 : la ligne « Objectif » à part ne doit pas pousser les corrections sous « Plus bas » */
  .hg-vd-goal-l, .hg-team .hg-vd-main > .hg-vd-goal-l { margin-top: 1px; line-height: 1.2; }
  .hg-vd-goal-l + .hg-vd-why { margin-top: 0; line-height: 1.28; }
}

/* c120 (audits c113-c119): when he holds a tile, your side line reads as YOURS: your flag, your blue, a bigger white value */
.hg-tile-op.is-mine { color: var(--age-3); }
.hg-tile-op.is-mine .hg-tile-opn { color: var(--age-3); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; vertical-align: -2px; }
.hg-tile-meflag { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; flex: none; box-shadow: 0 0 0 1.5px var(--age-3); vertical-align: -2px; margin-right: 4px; }
.hg-tile-op.is-mine .hg-tile-opn .hg-tile-meflag { margin-right: 0; }
.hg-tiles > .hg-tile .hg-tile-op.is-mine .hg-tile-opv, .hg-tile-op.is-mine .hg-tile-opv { font-size: 17px; font-weight: 800; color: #fff; }

/* c123 (audits c113-c122, 4 fois « à qui est le gros chiffre ? ») : vis-à-vis fixe à la Mobalytics dans la rangée 1v1.
   Toi toujours à gauche (drapeau cerclé de ton bleu, « Toi »), lui toujours à droite (nom, drapeau vers l'extérieur), deux
   valeurs de MÊME taille ; la meilleure soulignée ; TA valeur porte la couleur (vert mieux, orange pire), la sienne reste blanche.
   L'écart en mots va sur le bord haut, au-dessus du meilleur ; plus de pastille « qui tient ». */
.hg-tile.is-vs { grid-template-columns: 1fr; }
.hg-tile.is-vs .hg-tile-edge { justify-content: flex-start; }
.hg-tile.is-vs .hg-tile-edge.is-op { justify-content: flex-end; }
.hg-tile.is-vs.is-key .hg-tile-edge { justify-content: flex-end; }
.hg-tile.is-vs .hg-tile-edge .hg-tvs-gap { flex: none; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 19px; color: var(--vd); background: var(--panel); border: 1px solid color-mix(in srgb, var(--vd) 70%, var(--line)); white-space: nowrap; overflow: visible; }
/* c142 (audit c141, Mobalytics « une seule distinction ») : la tuile clé garde SEULE une pastille colorée (« Ce qui a décidé ») ;
   l'écart des deux autres devient une légende grise sur le bord, sans cadre ni couleur, comme le titre d'un encadré : il se lit
   après la tuile clé et ne rivalise plus avec elle ; même place, aucune hauteur en plus */
.hg-tiles > .hg-tile.is-vs .hg-tile-edge .hg-tvs-gap, .hg-tiles:has(.is-key) > .hg-tile.is-vs:not(.is-key) .hg-tile-edge .hg-tvs-gap { padding: 0 6px; border: 0; border-radius: 0; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel); }
.hg-tvs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; column-gap: 8px; margin-top: 2px; }
.hg-tvs::before { content: ''; grid-column: 2; grid-row: 1; align-self: stretch; width: 1px; margin: 3px 0; background: var(--line); }
.hg-tvs > .hg-tvs-s.me { grid-column: 1; grid-row: 1; }
.hg-tvs > .hg-tvs-s.op { grid-column: 3; grid-row: 1; align-items: flex-end; text-align: right; }
.hg-tvs-s { display: flex; flex-direction: column; min-width: 0; gap: 1px; overflow: visible; white-space: normal; }
.hg-tvs-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hg-tile .hg-tvs .hg-tvs-nm { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; line-height: 16px; font-weight: 700; color: var(--muted); white-space: nowrap; vertical-align: baseline; }
.hg-tile .hg-tvs .me .hg-tvs-nm { color: var(--age-3); font-weight: 800; }
.hg-tile .hg-tvs .hg-tvs-nm .hg-tile-meflag { margin: 0; vertical-align: 0; }
.hg-tvs-flag { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; flex: none; }
.hg-tiles > .hg-tile .hg-tvs .hg-tvs-v, .hg-tile .hg-tvs .hg-tvs-v { font-size: 24px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.hg-tiles .hg-tile.is-vs .hg-tvs .me .hg-tvs-v { color: var(--vd); }
.hg-tiles:has(.is-key) .hg-tile.is-vs:not(.is-key) .hg-tvs .me .hg-tvs-v { color: color-mix(in srgb, var(--vd) 80%, var(--text)); }
/* c127 (audit c126): the « better » underline is neutral white; the good/bad colour stays on YOUR value only (an orange line under his number read as « the problem ») */
/* c130 (audit c129): the white underline was not read as « better »; a gold crown before the better value says it (gold = 1st,
   same as the 2v2 medals, no side colour). Two numbers that count different things get no crown (.is-diff). */
.hg-tvs-vl { display: inline-flex; align-items: center; gap: 4px; }
.hg-tvs .hg-tvs-crown { display: inline-flex; flex: none; color: var(--gold); line-height: 0; }
.hg-tvs .hg-tvs-crown svg { display: block; }
/* historique c159: two different units face to face (AoE II « Chevaliers contre archers de cavalerie »): each number wears its
   unit's icon, no crown */
.hg-tvs .hg-tvs-uic { flex: none; width: 26px; height: 26px; border-radius: 4px; object-fit: cover; } /* c163 : 20 px illisible à côté d’un chiffre de 28 px (audit c161 #5) */
/* c178 (audit c164 #3) : icônes sombres fondues dans la tuile sombre. Plaque claire + liseré à la couleur du camp (toi bleu,
   lui rouge, comme partout) : chaque icône se détache et se rattache à son joueur, sans couronne (deux unités différentes) */
.hg-tvs .hg-tvs-uic { box-sizing: border-box; width: 28px; height: 28px; padding: 1px; background: #4a5670; box-shadow: 0 0 0 1.5px var(--age-3); }
.hg-tvs .hg-tvs-s.op .hg-tvs-uic { box-shadow: 0 0 0 1.5px #e6857a; }
/* c181 (audit c179 #3) : chevalier et archer à cheval se confondaient à 28 px : le nom de l'unité suit le nombre, en petit, sur
   deux lignes au plus, pas plus haut que l'icône (la rangée garde sa hauteur à 690).
   Le nom ne compte pas dans la largeur de la tuile (contain) : sinon la tuile clé s'élargit et « Villageois à 10:00 » passe sur
   deux lignes dans la tuile voisine (rangée 88 → 137 px mesurée). */
.hg-tvs .hg-tvs-vl:has(.hg-tvs-un) { align-self: stretch; align-items: center; gap: 6px; min-width: 0; }
.hg-tvs .hg-tvs-un { flex: 1 1 0; contain: inline-size; min-width: 0; font-size: 12px; line-height: 13px; font-weight: 600; color: var(--muted); text-align: left; white-space: normal; overflow-wrap: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.hg-tile.is-vs.is-key .hg-tile-edge { gap: 6px; }
.hg-tile.is-vs .hg-tile-op { overflow: visible; }
/* c123 : les deux valeurs du vis-à-vis à la même taille, quelles que soient les règles c120 (.hg-tile-opv 17 px blanc) */
.hg-tiles > .hg-tile.is-vs .hg-tvs .hg-tvs-s .hg-tvs-v { font-size: 24px; line-height: 1.1; font-weight: 800; color: var(--text); }
.hg-tiles > .hg-tile.is-vs .hg-tvs .hg-tvs-s.me .hg-tvs-v { color: var(--vd); }
.hg-tiles:has(.is-key) > .hg-tile.is-vs:not(.is-key) .hg-tvs .hg-tvs-s.me .hg-tvs-v { color: color-mix(in srgb, var(--vd) 80%, var(--text)); }
/* c123 : fenêtre basse (690), le vis-à-vis rend les ~7 px qu'il a pris, pour que « Aussi à corriger » reste au-dessus du pli */
@media (max-height: 740px) {
  .hg-tvs { margin-top: 0; }
  .hg-tile .hg-tvs .hg-tvs-nm { line-height: 14px; }
  .hg-tiles > .hg-tile.is-vs .hg-tvs .hg-tvs-s .hg-tvs-v { font-size: 22px; line-height: 1.05; }
}
/* c139 (audit c138 : la tuile « Ce qui a décidé » était la plus étroite et se lisait en dernier) : elle prend au moins 37 % de la
   rangée (les deux autres gardent leur texte sur une ligne, mesuré en FR/ES/DE/RU), un cadre plein à sa couleur et des chiffres
   un cran plus gros ; aucune pastille d'écart (le titre le dit, c133) ; en fenêtre basse, même hauteur de rangée qu'avant */
.hg-tiles > .hg-tile.is-key, .hg-tiles > .hg-tile.is-vs.is-key { flex: 1 1 auto; min-width: 37%; }
/* historique c190 (audit c188 #4): the key tile with two unit names keeps room for the longest official name (DE « Bogenschützen » was cut at 98 px), the row stays one label line high in all 15 languages */
.hg-tiles > .hg-tile.is-vs.is-key:has(.hg-tvs-un) { min-width: max(37%, 406px); }
/* c187 (audit c182 #5) : avec deux tuiles seulement (AoE II victoire), la tuile clé prenait 60 % de la rangée et laissait un grand
   vide entre les deux heures ; deux tuiles = deux moitiés égales (hauteur de rangée inchangée à 690 et 800, mesuré en 5 langues) */
.hg-tiles:has(> .hg-tile + .hg-tile):not(:has(> .hg-tile + .hg-tile + .hg-tile)) > .hg-tile { flex: 1 1 0; min-width: 0; }
.hg-tiles > .hg-tile.is-key { border: 2px solid color-mix(in srgb, var(--vd) 85%, var(--line)); border-top-width: 3px; background: color-mix(in srgb, var(--vd) 15%, var(--raised)); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--vd) 60%, transparent); padding-bottom: 5px; }
.hg-tiles > .hg-tile.is-vs.is-key .hg-tvs .hg-tvs-s .hg-tvs-v { font-size: 27px; line-height: 1.02; }
@media (max-height: 740px) {
  .hg-tiles > .hg-tile.is-key { padding-bottom: 3px; }
  .hg-tiles > .hg-tile.is-vs.is-key .hg-tvs .hg-tvs-s .hg-tvs-v { font-size: 24px; line-height: 1; }
  .hg-vd-line { line-height: 1.18; }
}
/* c140 (audit c138 : cartes « Aussi à corriger » rognées en ES/DE/PT/RU à 690) : en fenêtre basse, « DERROTA » et la ligne
   carte · date · durée tiennent sur UNE ligne dans toutes les langues (mot du résultat 30 px, Elo un cran plus petit) :
   ~17 px rendus aux corrections */
@media (max-height: 740px) {
  .hist-game .hg-head { column-gap: 14px; }
  .hist-game .hg-head .hg-res { column-gap: 8px; }
  .hist-game .hg-head .hg-res b { font-size: 30px; }
  .hist-game .hg-head .hg-elo { font-size: 15px; gap: 5px; }
  .hist-game .hg-head .hg-elo b { font-size: 24px; }
}
/* c145 (audit c144 #2) : à 800 aussi, résultat + carte · date · durée + Elo sur UNE ligne dans les 15 langues : même en-tête
   qu'en fenêtre basse (c140), même hauteur en victoire et en défaite (VICTOIRE/ПОБЕДА passaient sur 2 lignes, +12 px) */
.hist-game .hg-head { column-gap: 14px; }
.hist-game .hg-head .hg-res { column-gap: 8px; }
.hist-game .hg-head .hg-res b { font-size: 30px; }
.hist-game .hg-head .hg-res span { font-size: 13px; }
.hist-game .hg-head .hg-elo { font-size: 15px; gap: 5px; }
.hist-game .hg-head .hg-elo b { font-size: 24px; }

/* c160 (Matteo 15/11 : « les textes sont vachement collés entre eux, rends les choses plus claires ») : la fiche respire.
   Une échelle d'espacement unique (4/8/12/16/24), interligne 1.35+ pour le texte et 1.2+ pour les titres, 12 px entre les
   blocs d'une carte, 16 px entre les cartes, pastilles DANS leur tuile. Ce bloc vient en dernier et vaut pour toutes les
   hauteurs de fenêtre : il annule les resserrages « fenêtre basse » (c76, c123, c140, c152) ; à 690 on défile plutôt que tasser. */
.hist-game { --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; }
.hist-game .hg-head { padding-bottom: var(--sp-3); }
.hist-game .hg-vs, .hist-game .hg-vs:not(.team), .hist-game .hg-vs:not(.team):has(.hg-dist:not([hidden])) { padding: var(--sp-3) 0; }
.hist-game .hg-side span, .hist-game .hg-side .hg-h2h { line-height: 1.4; }
.hist-game .hg-vs .hg-side .hg-dist { margin-top: var(--sp-1); }
/* cartes : 16 px entre elles */
.hist-game .hg-verdict { gap: var(--sp-4); margin-top: var(--sp-1); margin-bottom: var(--sp-4); }
/* tuiles : la pastille (écart, « Ce qui a décidé ») passe à droite du libellé, dans la tuile, plus sur le bord */
.hist-game .hg-tiles, .hist-game .hg-tiles:has(.is-key) { gap: var(--sp-3); padding-top: 0; }
.hist-game .hg-tiles > .hg-tile, .hist-game .hg-tiles > .hg-tile.is-key { padding: var(--sp-3) 14px; row-gap: var(--sp-2); align-content: start; }
.hist-game .hg-tile.is-vs { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-2); }
.hist-game .hg-tile.is-vs .hg-tile-h { grid-column: 1; grid-row: 1; align-self: center; }
.hist-game .hg-tile.is-vs .hg-tile-edge, .hist-game .hg-tile.is-vs.is-key .hg-tile-edge { grid-column: 2; grid-row: 1; align-self: center; height: auto; margin: 0; }
.hist-game .hg-tile.is-vs .hg-tvs { grid-column: 1 / -1; grid-row: 2; }
.hist-game .hg-tile .hg-tile-tag { position: static; }
.hist-game .hg-tiles > .hg-tile .hg-tile-l { line-height: 1.3; }
.hist-game .hg-tiles > .hg-tile .hg-tile-h { font-size: 12.5px; }
.hist-game .hg-tvs { margin-top: 0; }
.hist-game .hg-tvs-s { gap: 2px; }
.hist-game .hg-tile .hg-tvs .hg-tvs-nm { line-height: 1.35; }
.hist-game .hg-tiles > .hg-tile.is-vs .hg-tvs .hg-tvs-s .hg-tvs-v { font-size: 24px; line-height: 1.15; }
.hist-game .hg-tiles > .hg-tile.is-vs.is-key .hg-tvs .hg-tvs-s .hg-tvs-v { font-size: 27px; line-height: 1.15; }
/* carte principale : titre / phrase / conseil, 12 px entre chaque */
.hist-game .hg-vd-main { padding: var(--sp-4) 18px; }
.hist-game .hg-vd-other { padding: 14px var(--sp-4) var(--sp-4); }
.hist-game .hg-verdict h3 { margin: 0 0 10px; line-height: 1.3; }
.hist-game .hg-vd-line { line-height: 1.25; }
.hist-game .hg-vd-ctx { margin-top: var(--sp-2); line-height: 1.45; }
.hist-game .hg-vd-main > .hg-vd-fix, .hist-game .hg-team .hg-vd-main > .hg-vd-fix, .hist-game .hg-a2-fix { margin-top: var(--sp-3); line-height: 1.4; }
.hist-game .hg-vd-goal-l, .hist-game .hg-team .hg-vd-main > .hg-vd-goal-l { margin-top: var(--sp-2); padding-top: 3px; padding-bottom: 3px; line-height: 1.35; }
.hist-game .hg-vd-goal-l + .hg-vd-why, .hist-game .hg-vd-why { margin-top: var(--sp-2); line-height: 1.45; }
.hist-game .hg-vd-then { margin-top: var(--sp-2); line-height: 1.4; }
.hist-game .hg-team .hg-vd-main > p { line-height: 1.4; }
/* ligne verte « ce qui a marché » */
.hist-game .hg-vd-well { padding: var(--sp-3) var(--sp-4); line-height: 1.4; }
.hist-game .hg-vd-none { padding: var(--sp-3) var(--sp-4); line-height: 1.4; }
/* corrections : heure, constat, conseil séparés */
.hist-game .hg-vd-moments { gap: var(--sp-3); }
.hist-game .hg-vd-other .hg-vd-moments, .hist-game .hg-vd-other .hg-vd-moments:has(> li + li) { gap: var(--sp-3); margin-top: 0; }
.hist-game .hg-vd-moments li > button, .hist-game .hg-vd-moments li > .row,
.hist-game .hg-vd-other .hg-vd-moments:has(> li + li) > li > button, .hist-game .hg-vd-other .hg-vd-moments:has(> li + li) > li > .row { padding: 10px 10px var(--sp-3); row-gap: 6px; line-height: 1.4; } /* 10 px sur les côtés : la largeur du texte ne bouge pas (coupures RU c136) */
.hist-game .hg-vd-moments .hg-vd-fix, .hist-game .hg-vd-other .hg-vd-moments .hg-vd-fix { margin-top: var(--sp-2); line-height: 1.4; }
.hist-game .hg-vd-moments .hg-vd-cost { margin-top: var(--sp-1); line-height: 1.35; }
.hist-game .hg-vd-fixes:has(> li > .hg-rank-why) { margin-top: var(--sp-3) !important; }
.hist-game .hg-vd-fixes > li:has(> .hg-rank-why) > button, .hist-game .hg-vd-fixes > li:has(> .hg-rank-why) > .row { padding-top: var(--sp-4); }
/* tableau d'équipe 2v2 */
.hist-game .hg-tm-mirror { gap: var(--sp-3); }
.hist-game .hg-tm-mirror .hg-tm th, .hist-game .hg-tm-mirror .hg-tm td { padding-top: 6px; padding-bottom: 6px; line-height: 1.3; }
.hist-game .hg-tm-mirror .hg-tm .hg-tm-h th { padding-top: var(--sp-2); padding-bottom: 6px; line-height: 1.25; }
/* tuiles secondaires (plus étroites) : le libellé garde toute la largeur, l'écart en mots se lit sous les deux nombres */
.hist-game .hg-tile.is-vs:not(.is-key) .hg-tile-h { grid-column: 1 / -1; }
.hist-game .hg-tile.is-vs:not(.is-key) .hg-tile-edge { grid-column: 1 / -1; grid-row: 3; }
.hist-game .hg-tiles > .hg-tile.is-vs:not(.is-key) .hg-tile-edge .hg-tvs-gap { padding: 0; background: none; line-height: 1.35; }
/* c165 (audit c164) : DE « Dorfbewohner um 10:00 », VI « Thời kỳ Phong kiến » et ES « Edad de los Castillos » (colonne clé) restaient sur 3 lignes */
:is(:lang(de), :lang(vi), :lang(es)) .hist-game .hg-tm-mirror .hg-tm tr.hg-tm-h th:not(:first-child) { padding-inline: 1px; letter-spacing: -.02em; }
:is(:lang(vi), :lang(es)) .hist-game .hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th.is-key { font-size: 11.5px; }
:lang(de) .hist-game .hg-tm-mirror .hg-tm tr.hg-tm-h th:last-child { font-weight: 500; } /* « Dorfbewohner » tient sur une ligne */
/* c180 : la colonne clé garde ses 6 px d'air (liseré + 4 px) en DE/VI/ES aussi */
:is(:lang(de), :lang(vi), :lang(es)) .hist-game .hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th.is-key { padding-inline: 6px; }
:lang(es) .hist-game .hg-tm-mirror.has-key .hg-tm tr > :first-child { width: 41%; }
:lang(es) .hist-game .hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th.is-key { width: 21%; } /* « Edad de los Castillos » reste sur 2 lignes */
/* l'en-tête juste à gauche de la colonne clé (aligné à droite) garde 4 px avant le liseré, dans toutes les langues */
.hist-game .hg-tm-mirror.has-key .hg-tm tr.hg-tm-h th:not(:first-child):has(+ th.is-key) { padding-right: 4px; }
/* c180 : ZH « 10:00 时的村民 » collé en un bloc (hgGlue) débordait de 2 px hors du tableau : en chinois/japonais/coréen l'en-tête se coupe entre les caractères */
:is(:lang(zh), :lang(ja), :lang(ko)) .hg-tm-mirror .hg-tm tr.hg-tm-h th hg-nw { white-space: normal; }
/* c184 (audit c182 #1) : la dernière colonne des tableaux 2v2 garde de l'air avant le bord droit (DE « Dorfbewohner um 10:00 »,
   ES, VI collés à 1 px ; 3 px ailleurs) : 6 px à droite pour l'en-tête et les valeurs */
.hist-game .hg-tm-mirror .hg-tm tr.hg-tm-h th:last-child:not(:first-child), .hist-game .hg-tm-mirror .hg-tm tr > td:last-child { padding-right: 6px; }

/* Éditeur de builds sur le site (metaaoe.app/build-editor/, js/pb-web.js). Ajouté à build-editor/app/editor.css après
 * les styles de l'éditeur de l'app (css/theme.css + css/desktop.css) par site/_tools/build-pages.js. */

/* le site donne 88 px de marge à toute <section> : pas dans l'éditeur ni ses aperçus */
.pbw section, .pbw-demo section, .dlg-editor section { padding: 0; }
.dlg-editor { color: var(--text, #e8e2d4); }

.pbw { margin: 8px 0 72px; display: grid; gap: 40px; }
.pbw h2 { margin: 0 0 8px; font: 700 26px/1.15 var(--font-cond, inherit); text-wrap: balance; }
.pbw h3 { margin: 18px 0 8px; font: 700 13px var(--font-cond, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }

/* en tête (10/11/2026) : texte + action à gauche, vrai build pro rendu comme l'overlay à droite */
.pbw-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 32px 56px; align-items: start; padding: 40px 0 44px; }
.pbw-intro h1 { margin: 0; text-wrap: balance; }
.pbw-intro .lp-answer { margin: 14px 0 0; max-width: 58ch; }
.pbw-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 26px; min-height: 52px; }
.pbw-cta-hint { flex-basis: 100%; margin: 0; color: var(--faint, var(--muted)); font-size: 14px; }
.pbw-how { list-style: none; counter-reset: how; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 34px 0 0; padding: 0; }
.pbw-how li { counter-increment: how; display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 2px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; }
.pbw-how li:first-child { border-top-color: var(--gold); }
.pbw-how-ico { display: flex; margin-bottom: 6px; }
.pbw-how-ico img { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; background: var(--ink); box-shadow: 0 0 0 2px var(--bg, #101624); }
.pbw-how-ico img + img { margin-left: -6px; }
.pbw-how b { color: var(--text); font: 700 17px/1.2 var(--font-cond, inherit); }
.pbw-how b::before { content: counter(how) ". "; color: var(--gold); }

.pbw-demo { margin: 0; min-width: 0; }
.pbw-demo[hidden] { display: none; }
.pbw-demo figcaption { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.pbw-demo-card { position: relative; min-height: 430px; border: 1px solid rgba(224, 173, 69, .45); border-radius: 12px; background: #101624; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); overflow: hidden; }
.pbw-demo-card[aria-busy="true"] { background: linear-gradient(#161e30, #101624); }
.pbw-demo-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #161e30; }
.pbw-demo-head img { flex: none; width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.pbw-demo-head span { display: flex; flex-direction: column; min-width: 0; }
.pbw-demo-head b { font: 700 18px/1.2 var(--font-cond, inherit); color: var(--text); }
.pbw-demo-head small { color: var(--muted); font-size: 13px; }
.pbw-demo .pbw-prev { max-width: none; max-height: 300px; overflow: hidden; padding: 10px 12px 0; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.pbw-demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 16px; }
.pbw-demo-foot span { color: var(--muted); font-size: 13px; }
.pbw-demo img.ico { display: inline-block; }

/* barre : jeu + gros bouton « Créer » */
.pbw-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.pbw-seg button { min-height: 44px; padding: 0 18px; border: 0; background: transparent; color: var(--muted); font: 700 15px var(--font, inherit); cursor: pointer; transition: color .12s ease-out; }
.pbw-seg button:hover { color: var(--text); }
.pbw-seg button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.pbw .btn, .pbw-cta .btn, .pbw-demo .btn { min-height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel, #1a2131); color: var(--text, #e8e2d4); font: 700 14px var(--font, inherit); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: border-color .12s ease-out, background-color .12s ease-out; }
.pbw .btn:hover, .pbw-cta .btn:hover, .pbw-demo .btn:hover { border-color: var(--gold); }
.pbw .btn-gold, .pbw-cta .btn-gold, .pbw-demo .btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.pbw .btn-gold:hover, .pbw-cta .btn-gold:hover, .pbw-demo .btn-gold:hover { background: #f0c46a; border-color: #f0c46a; }
.pbw .btn-quiet { background: transparent; color: var(--muted); }
.pbw .btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.pbw-cta .pbw-new { min-height: 52px; padding: 0 26px; font-size: 17px; }
.pbw-new span { font-size: 22px; line-height: 1; }
.pbw-seg button:focus-visible, .pbw-cta .btn:focus-visible, .pbw-demo .btn:focus-visible, .pbw button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* « Partir d'un build pro » : grille des civs + builds pros à copier */
.pbw-start-lead { margin: 0 0 16px; color: var(--muted); }
.pbw-civs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px; }
.pbw-civs button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel, #161e30); color: var(--text); font: 600 15px/1.15 var(--font-cond, inherit); text-align: left; cursor: pointer; transition: border-color .12s ease-out, background-color .12s ease-out; }
.pbw-civs button:hover { border-color: var(--gold); background: rgba(224, 173, 69, .08); }
.pbw-civs img { flex: none; width: 32px; height: 32px; border-radius: 5px; object-fit: cover; }
.pbw-civs span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbw .pbw-picks-h { margin: 28px 0 10px; font: 700 20px/1.2 var(--font-cond, inherit); letter-spacing: 0; text-transform: none; color: var(--text); }
.pbw-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.pbw-pick { position: relative; }
.pbw-pick > img { position: absolute; left: 13px; top: 13px; z-index: 1; width: 40px; height: 40px; border-radius: 6px; object-fit: cover; pointer-events: none; }
.pbw-pick .ed-pro { width: 100%; height: 100%; padding: 12px 14px 12px 66px; align-content: start; }
.pbw-pick .ed-pro-ico img { display: block; }
.pbw-pick .ed-pro-ages img { display: inline-block; }

/* « Ton build est prêt » et la liste */
.pbw .pbw-ready { padding: 22px 24px; border: 1px solid var(--gold); border-radius: 10px; background: var(--ink); scroll-margin-top: 80px; }
.pbw-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pbw-head img { border-radius: 3px; object-fit: cover; }
.pbw-head b { font-size: 17px; }
.pbw-head small { color: var(--muted); }
.pbw-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pbw-acts.is-big .pbw-open { min-height: 52px; padding: 0 28px; font-size: 17px; }
.pbw-acts.is-big .btn { min-height: 52px; }
.pbw-msg { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--gold); background: rgba(214, 178, 94, .08); border-radius: 4px; line-height: 1.5; }
.pbw-msg .btn { margin-left: 8px; vertical-align: middle; }
.pbw-hint { margin: 10px 0 0; color: var(--muted); }
.pbw-err { margin: 0; padding: 10px 14px; border-left: 3px solid #d9534f; background: rgba(217, 83, 79, .1); border-radius: 4px; }
.pbw-list { display: grid; gap: 10px; }
.pbw-list > li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); }
.pbw-list .pbw-head { margin-bottom: 10px; }
.pbw-prev { max-width: 640px; }
.pbw-prev .age-block { margin-bottom: 8px; }
.pbw-prev .age-block > ol > li { grid-template-columns: 52px 34px minmax(0, 1fr); }
@media (max-width: 980px) { .pbw-hero { grid-template-columns: minmax(0, 1fr); padding-top: 24px; } .pbw-demo { max-width: 560px; } }
@media (max-width: 640px) {
  .pbw-hero { gap: 28px; padding-bottom: 28px; }
  .pbw-cta .pbw-new { flex: 1 1 auto; justify-content: center; }
  .pbw-how { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 26px; }
  .pbw-how li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 10px; }
  .pbw-how-ico { grid-row: span 2; margin: 0; }
  .pbw-demo-card { min-height: 360px; }
  .pbw-demo .pbw-prev { max-height: 236px; }
  .pbw-civs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pbw-picks { grid-template-columns: minmax(0, 1fr); }
  .pbw-acts .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .pbw-seg button, .pbw .btn, .pbw-cta .btn, .pbw-demo .btn, .pbw-civs button { transition: none; } }
/* phrase d'une étape : icônes en ligne dans le texte (site.css met les images en bloc) */
#dlg-editor img.ico, #dlg-editor .ed-tok img, .pbw-ready img.ico { display: inline-block; }
