/* Atelier de forgemagie — un établi de pierre sombre éclairé par la braise de la forge.
   Choix délibéré d'un seul thème sombre : les runes et les jets « brillent » sur la pierre. */
:root {
  --stone: #12141b;
  --slab: #1a1d27;
  --slab-2: #222634;
  --seam: #2f3445;
  --seam-soft: #262a38;
  --text: #ece6d8;
  --muted: #9d9886;
  --dim: #6f6c62;
  --ember: #f2a24c;
  --ember-deep: #c46a24;
  --rune: #6fd6c8;
  --sc: #74d390;
  --sn: #e9c35a;
  --ec: #ee6b5f;
  --el-terre: #c48b55;
  --el-feu: #ec6c43;
  --el-eau: #55aee6;
  --el-air: #80c96f;
  --el-neutre: #b0aa9c;
  --el-vita: #e7708f;
  --el-sagesse: #b48cec;
  --el-majeur: #f2a24c;
  --el-autre: #6fd6c8;

  --display: "Alegreya SC", "Palatino Linotype", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(242, 162, 76, .16), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, rgba(111, 214, 200, .05), transparent 70%),
    var(--stone);
  color: var(--text);
  font: 16px/1.45 var(--body);
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: .02em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
img { max-width: 100%; }

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px;
  max-width: 1840px; margin: 0 auto; padding-block: 12px 10px;
}
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--slab); border: 1px solid var(--seam); border-radius: 999px; margin-right: auto; }
.tabs a { padding: 6px 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; }
.tabs a:hover { color: var(--ember); }
.tabs a[aria-current="page"] { background: var(--slab-2); color: var(--ember); box-shadow: inset 0 0 0 1px rgba(242, 162, 76, .35); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 42px; height: 42px; flex: none; transform: rotate(45deg); border-radius: 9px;
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  box-shadow: 0 0 24px rgba(242, 162, 76, .45), inset 0 0 0 2px rgba(255, 255, 255, .18);
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; inset: 11px; border-radius: 3px; border: 2px solid rgba(18, 20, 27, .65); }
.brand h1 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 800; line-height: 1.05; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }

.search {
  flex: 1 1 320px; max-width: 520px; display: flex; align-items: center; gap: 10px;
  background: var(--slab); border: 1px solid var(--seam); border-radius: 999px; padding: 0 16px;
}
.search:focus-within { border-color: var(--ember); box-shadow: 0 0 0 4px rgba(242, 162, 76, .12); }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 0; outline: none; }
.search input::placeholder { color: var(--dim); }

/* ---------- Disposition ---------- */
.workspace {
  max-width: 1840px; margin: 0 auto;
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 290px; gap: 20px; align-items: start;
}
@media (max-width: 1240px) {
  .workspace { grid-template-columns: 270px minmax(0, 1fr); }
  .journal { grid-column: 2; }
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .journal { grid-column: auto; }
  .results { max-height: 300px; }
}
.catalog, .journal { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: 16px; }
@media (max-width: 860px) { .catalog, .journal { position: static; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head h2 { font-size: 1.05rem; color: var(--muted); letter-spacing: .08em; }
.status { font-size: .82rem; color: var(--dim); text-align: right; }
.status.err { color: var(--ec); }

/* ---------- Liste d'objets ---------- */
.results { list-style: none; margin: 0; padding: 4px; display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 230px); overflow-y: auto; background: var(--slab); border: 1px solid var(--seam); border-radius: var(--radius); }
.results button {
  width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center;
  border: 0; background: none; text-align: left; border-radius: 9px; padding: 6px 8px;
}
.results button:hover { background: var(--slab-2); }
.results button[aria-current="true"] { background: var(--slab-2); box-shadow: inset 2px 0 var(--ember); }
.results .pic { width: 44px; height: 44px; border-radius: 9px; background: var(--stone); display: grid; place-items: center; }
.results .pic img { width: 38px; height: 38px; object-fit: contain; }
.results .name { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .meta { display: block; font-size: .8rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .empty { padding: 14px; color: var(--dim); font-size: .92rem; }
.results .skeleton { height: 52px; border-radius: 9px; background: linear-gradient(90deg, var(--slab) 0%, var(--slab-2) 50%, var(--slab) 100%); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .results .skeleton { animation: shimmer 1.2s infinite linear; } }
@keyframes shimmer { to { background-position: -200% 0; } }

.paste { font-size: .9rem; color: var(--muted); }
.paste summary { cursor: pointer; }
.paste p { margin: 8px 0; }
.paste code { font-family: var(--mono); font-size: .76rem; word-break: break-all; color: var(--text); }
.paste textarea { width: 100%; min-height: 90px; background: var(--slab); border: 1px solid var(--seam); border-radius: 9px; padding: 8px; font: .76rem var(--mono); color: var(--text); }

/* ---------- Boutons ---------- */
.btn { border: 1px solid var(--seam); background: var(--slab-2); border-radius: 9px; padding: 7px 13px; font-weight: 500; }
.btn:hover { border-color: var(--ember); color: var(--ember); }
.btn.ghost { background: none; }
.btn.accent { border-color: rgba(242, 162, 76, .45); color: var(--ember); }
.btn.accent:hover { background: rgba(242, 162, 76, .12); }
a.btn { color: inherit; text-decoration: none; }
.link { border: 0; background: none; color: var(--dim); font-size: .85rem; padding: 0; }
.link:hover { color: var(--ember); }

/* ---------- Vitrine de l'objet ---------- */
.forge { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* Vitrine en bandeau : l'écran reste aux lignes de l'objet. */
.showcase {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  background: linear-gradient(160deg, var(--slab-2), var(--slab) 60%);
  border: 1px solid var(--seam); border-radius: 14px; padding: 10px 18px;
}
.showcase::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(220px 160px at 46px 50%, rgba(242, 162, 76, .14), transparent 70%);
}
@media (max-width: 900px) { .showcase { grid-template-columns: 72px minmax(0, 1fr); } .showcase .gauges { grid-column: 1 / -1; } }
.medallion {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 45%, #2c2a2c 0%, #191a21 62%, #12131a 100%);
  box-shadow: inset 0 0 0 2px rgba(242, 162, 76, .35), inset 0 0 30px rgba(0, 0, 0, .6), 0 8px 26px rgba(0, 0, 0, .35);
}
@media (max-width: 900px) { .medallion { width: 72px; height: 72px; } }
.medallion::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px dashed rgba(242, 162, 76, .25); }
.medallion img { width: 66%; height: 66%; object-fit: contain; filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .55)); }
.medallion .placeholder { font: 800 1.8rem var(--display); color: var(--ember); opacity: .7; }
.ident { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.eyebrow { font: 500 .74rem var(--body); text-transform: uppercase; letter-spacing: .14em; color: var(--ember); }
.eyebrow a { color: inherit; }
.ident h2 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); font-weight: 800; line-height: 1.05; }
.ident .sub { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--stone); border: 1px solid var(--seam); color: var(--muted); }
.chip.warn { color: var(--ember); border-color: rgba(242, 162, 76, .4); }
.gauges { display: flex; flex-wrap: wrap; gap: 10px 24px; position: relative; }
.gauge { display: flex; align-items: center; gap: 10px; }
.gauge .ring {
  --q: 0; width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--ember) calc(var(--q) * 1%), var(--seam) 0);
  display: grid; place-items: center;
}
.gauge .ring::after { content: ""; width: 34px; height: 34px; border-radius: 50%; background: var(--slab); }
.gauge .ring.over { background: conic-gradient(var(--ec) calc((var(--q) - 100) * 1%), var(--ember) 0); }
.gauge b { display: block; font: 600 1.15rem var(--mono); font-variant-numeric: tabular-nums; }
.gauge span { display: block; font-size: .78rem; color: var(--dim); text-transform: uppercase; letter-spacing: .09em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.toolbar .btn { padding: 5px 11px; font-size: .92rem; }

/* ---------- Lignes et runes ----------
   Une ligne par rangée (caractéristique · jet · runes) pour voir tout l'objet sans défiler en 1080p. */
.lines { display: flex; flex-direction: column; gap: 4px; container-type: inline-size; }
.lines-head, .line { display: grid; grid-template-columns: 200px 196px minmax(0, 1fr); column-gap: 16px; align-items: center; }
.lines-head { padding: 0 12px 2px 16px; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .hint { color: var(--dim); }
.line {
  background: var(--slab); border: 1px solid var(--seam-soft); border-radius: 10px; padding: 4px 8px 4px 16px;
  position: relative; min-height: 44px;
}
.line::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--el, var(--el-autre)); opacity: .9; }
.line.is-over { border-color: rgba(238, 107, 95, .35); }
.stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stat-pick {
  appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; border: 0; background: none; padding: 0; cursor: pointer;
  font-weight: 700; font-size: .98rem; line-height: 1.2; color: var(--el, var(--text)); text-overflow: ellipsis;
}
.stat-pick:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.stat-pick option { background: var(--slab); color: var(--text); font-weight: 400; }
.line.unknown .stat-pick { color: var(--ember); }
.stat-range { font: .7rem/1.25 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-range .chip { font-size: .66rem; padding: 0 7px; }

.jet { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--seam); border-radius: 8px; overflow: hidden; width: max-content; flex: none; background: var(--stone); }
.stepper button { border: 0; background: none; width: 26px; color: var(--muted); font-size: 1rem; }
.stepper button:hover { color: var(--ember); background: var(--slab-2); }
.stepper input { width: 52px; border: 0; background: none; text-align: center; font: 600 .95rem var(--mono); padding: 3px 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--stone); box-shadow: inset 0 0 0 1px var(--seam); min-width: 40px; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, rgba(242, 162, 76, .25), var(--el, var(--ember))); }
.track .fill.over { background: linear-gradient(90deg, var(--el, var(--ember)), var(--ec)); }

.runes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.rune {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto;
  grid-template-areas: "icon name split odds";
  gap: 0 8px; align-items: center; min-width: 0; min-height: 36px;
  text-align: left; padding: 3px 9px 5px 7px; border-radius: 8px; border: 1px solid var(--seam); background: var(--slab-2);
  position: relative; overflow: hidden;
}
.rune:hover { border-color: var(--rune); box-shadow: 0 0 0 3px rgba(111, 214, 200, .12), 0 0 18px rgba(111, 214, 200, .15); }
.rune:active { transform: translateY(1px); }
.rune .icon { grid-area: icon; width: 24px; height: 24px; display: grid; place-items: center; }
.rune .icon img { width: 24px; height: 24px; object-fit: contain; }
.rune .glyph {
  width: 20px; height: 20px; transform: rotate(45deg); border-radius: 5px; display: grid; place-items: center;
  background: var(--stone); box-shadow: inset 0 0 0 1px var(--el, var(--rune));
}
.rune .glyph b { transform: rotate(-45deg); font: 700 .54rem var(--mono); color: var(--el, var(--rune)); }
.rune .rname { grid-area: name; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.rune .odds { grid-area: odds; min-width: 4.2ch; text-align: right; font: 600 1rem var(--mono); color: var(--sc); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rune .split { grid-area: split; display: flex; gap: 6px; font: .7rem var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.split .s1 { color: var(--sc); } .split .s2 { color: var(--sn); } .split .s3 { color: var(--ec); }
.rune .bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; height: 3px; background: var(--stone); }
.bar .sc { background: var(--sc); } .bar .sn { background: var(--sn); } .bar .ec { background: var(--ec); }
.rune .flag { font: 700 .54rem var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; background: var(--ec); color: var(--stone); }
.rune .flag.exo { background: var(--rune); }
@container (max-width: 760px) {
  .lines-head { display: none; }
  .line { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; padding-block: 8px; }
  .runes { grid-column: 1 / -1; }
}
@container (max-width: 420px) {
  .line { grid-template-columns: minmax(0, 1fr); }
  .runes { grid-template-columns: minmax(0, 1fr); }
}
.no-runes { color: var(--dim); font-size: .9rem; align-self: center; }

.flash-SC { animation: flashSC .9s ease-out; }
.flash-SN { animation: flashSN .9s ease-out; }
.flash-EC { animation: flashEC .9s ease-out; }
@keyframes flashSC { from { box-shadow: 0 0 0 2px var(--sc), 0 0 40px rgba(116, 211, 144, .45); } }
@keyframes flashSN { from { box-shadow: 0 0 0 2px var(--sn), 0 0 40px rgba(233, 195, 90, .4); } }
@keyframes flashEC { from { box-shadow: 0 0 0 2px var(--ec), 0 0 40px rgba(238, 107, 95, .45); } }
@media (prefers-reduced-motion: reduce) { .flash-SC, .flash-SN, .flash-EC { animation: none; } }

.extras { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--slab); border: 1px dashed var(--seam); border-radius: 14px; padding: 12px 16px; }
.extras label { color: var(--muted); }
.extras select { background: var(--stone); border: 1px solid var(--seam); border-radius: 8px; padding: 6px 8px; }
.ignored { font-size: .86rem; color: var(--dim); margin: 0; }

.notes { color: var(--muted); font-size: .9rem; }
.notes summary { cursor: pointer; }
.option { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.option select { background: var(--slab); border: 1px solid var(--seam); border-radius: 8px; padding: 5px 8px; color: var(--text); }
.formula { margin: 10px 0; padding: 12px 14px; background: var(--slab); border: 1px solid var(--seam); border-radius: 10px; font: .8rem/1.7 var(--mono); color: var(--text); white-space: pre; overflow-x: auto; }

/* ---------- Journal ---------- */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 140px); overflow-y: auto; }
.history li { background: var(--slab); border: 1px solid var(--seam-soft); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.history .head { display: flex; align-items: center; gap: 8px; }
.badge { font: 700 .7rem var(--mono); padding: 2px 7px; border-radius: 6px; color: var(--stone); }
.badge.SC { background: var(--sc); } .badge.SN { background: var(--sn); } .badge.EC { background: var(--ec); }
.history .what { font-weight: 700; }
.history .detail { font: .78rem var(--mono); color: var(--muted); }
.history .loss { color: var(--ec); }
.history .gain { color: var(--sc); }
.history .odds { font: .7rem var(--mono); color: var(--dim); }
.history .empty { color: var(--dim); background: none; border: 1px dashed var(--seam); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--slab-2); border: 1px solid var(--seam); border-radius: 12px; padding: 10px 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); z-index: 20;
}
.toast a { color: var(--ember); }

/* ---------- Créateur de stuff ----------
   Trois colonnes en 1080p : personnage · équipement et stats · choix d'objet. */
.stuff-layout {
  max-width: 1840px; margin: 0 auto;
  display: grid; grid-template-columns: 330px minmax(0, 1fr) 380px; gap: 20px; align-items: start;
}
@media (max-width: 1400px) {
  .stuff-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .picker { grid-column: 1 / -1; }
}
@media (max-width: 860px) { .stuff-layout { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--slab); border: 1px solid var(--seam); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.perso { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hint-text { margin: 0; font-size: .8rem; color: var(--dim); }
.neg { color: var(--ec); }

.level-field { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.level-field input, .caracs input, .picker-search input, .eq-line input {
  background: var(--stone); border: 1px solid var(--seam); border-radius: 7px; padding: 4px 6px;
  font: 600 .92rem var(--mono); font-variant-numeric: tabular-nums; color: var(--text); min-width: 0;
}
.level-field input { width: 74px; }
.points { margin: 0; color: var(--muted); font-size: .9rem; }
.points b { color: var(--text); }
.points b.neg { color: var(--ec); }
.caracs { width: 100%; border-collapse: collapse; font-size: .9rem; }
.caracs th, .caracs td { padding: 3px 4px; text-align: left; }
.caracs thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 500; }
.caracs tbody th { color: var(--el, var(--text)); font-weight: 700; white-space: nowrap; }
.caracs input { width: 100%; }
.caracs td:nth-child(3) input { width: 54px; }
.carac-in { display: flex; align-items: center; gap: 6px; }
.carac-in input { width: 64px; }
.carac-total { text-align: right !important; font-weight: 600; }

.sets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sets li { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--seam-soft); }
.sets li:last-child { border-bottom: 0; padding-bottom: 0; }
.sets .empty { color: var(--dim); font-size: .9rem; }
.set-head { display: flex; justify-content: space-between; gap: 10px; }
.set-head span { color: var(--ember); font-size: .85rem; }
.set-bonus { display: flex; flex-wrap: wrap; gap: 2px 10px; font: .76rem var(--mono); }
.set-bonus span { color: var(--el, var(--text)); }
.set-bonus.none { color: var(--dim); }

.stuff-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.slots { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 8px 6px 7px; border-radius: 12px; border: 1px solid var(--seam); background: var(--slab);
}
.slot:hover { border-color: var(--ember); }
.slot[aria-pressed="true"] { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(242, 162, 76, .14); background: var(--slab-2); }
.slot-pic { width: 52px; height: 52px; border-radius: 10px; background: var(--stone); display: grid; place-items: center; }
.slot-pic img { width: 46px; height: 46px; object-fit: contain; }
.slot-glyph { width: 18px; height: 18px; transform: rotate(45deg); border-radius: 4px; border: 1px dashed var(--seam); }
.slot-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.slot-name { width: 100%; font-size: .8rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.slot.filled .slot-name { color: var(--text); font-weight: 500; }

.stat-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .stat-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scol { background: var(--slab); border: 1px solid var(--seam-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.scol h3 { font-size: .9rem; color: var(--muted); letter-spacing: .08em; margin-bottom: 6px; }
.srow, .rrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 2px 0; border-bottom: 1px dashed var(--seam-soft); }
.srow span { color: var(--el, var(--text)); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow b, .rrow b { font: 600 .95rem var(--mono); font-variant-numeric: tabular-nums; }
.srow.zero span, .srow.zero b, .rrow b.zero { color: var(--dim); font-weight: 400; }
.srow.neg b { color: var(--ec); }
.rrow { display: grid; grid-template-columns: minmax(0, 1fr) 56px 64px; }
.rrow span { color: var(--el, var(--text)); font-size: .9rem; }
.rrow b { text-align: right; }
.rrow b.capped { color: var(--ember); }
.rhead span { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); text-align: right; }
.scol .hint-text { margin-top: 8px; }

.picker { position: sticky; top: 16px; max-height: calc(100vh - 32px); }
@media (max-width: 1400px) { .picker { position: static; max-height: none; } }
.picker .results { flex: 1; min-height: 160px; max-height: none; }
.picker-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.picker-search .stat-filter { flex: 1 1 100%; }
.picker-search select { flex: 1 1 100%; background: var(--stone); border: 1px solid var(--seam); border-radius: 7px; padding: 5px 8px; }
.picker-search select[hidden] { display: none; }
.picker-search input[type="search"] { flex: 1; font-family: var(--body); font-weight: 400; padding: 6px 10px; }
.picker-search label { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: .8rem; white-space: nowrap; }
.picker-search label input { width: 58px; }
.picker .status { text-align: left; }
.equipped { display: flex; flex-direction: column; gap: 8px; }
.equipped-head { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; }
.equipped-head .pic { width: 48px; height: 48px; border-radius: 10px; background: var(--stone); display: grid; place-items: center; }
.equipped-head img { width: 42px; height: 42px; object-fit: contain; }
.equipped-head b { display: block; }
.equipped-head .meta { display: block; font-size: .8rem; color: var(--dim); }
.eq-lines { display: flex; flex-direction: column; gap: 2px; max-height: 330px; overflow-y: auto; }
.eq-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 8px; align-items: center; font-size: .86rem; }
.eq-name { color: var(--el, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-range { font-size: .72rem; color: var(--dim); }
.eq-line input { width: 64px; padding: 2px 6px; }
.toast[hidden] { display: none; }
.rune.blocked { cursor: not-allowed; opacity: .45; background: var(--slab); border-style: dashed; }
.rune.blocked:hover { border-color: var(--seam); box-shadow: none; }
.rune.blocked:active { transform: none; }
.rune.blocked .split { color: var(--dim); }
.rune.blocked .odds { color: var(--dim); }
.stat-filter { width: 100%; background: var(--stone); border: 1px solid var(--seam); border-radius: 7px; padding: 6px 10px; font: 400 .9rem var(--body); color: var(--text); min-width: 0; }
.stat-filter::placeholder { color: var(--dim); }
.results .meta b { color: var(--ember); font-weight: 500; }
.results .more { display: block; text-align: center; color: var(--ember); padding: 8px; }

/* ---------- Optimiseur ---------- */
.opt-layout {
  max-width: 1840px; margin: 0 auto;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start;
}
@media (max-width: 900px) { .opt-layout { grid-template-columns: minmax(0, 1fr); } }
.opt-form { position: sticky; top: 16px; }
@media (max-width: 900px) { .opt-form { position: static; } }
.opt-form form { display: flex; flex-direction: column; gap: 10px; }
.opt-form fieldset { border: 1px solid var(--seam-soft); border-radius: 10px; margin: 0; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.opt-form legend { padding: 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .92rem; }
.field input, .field select { background: var(--stone); border: 1px solid var(--seam); border-radius: 7px; padding: 4px 6px; color: var(--text); min-width: 0; }
.field input { width: 70px; font: 600 .92rem var(--mono); }
.field select { max-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.opt-form button[type="submit"] { padding: 9px 13px; font-weight: 700; }
.opt-form button:disabled { opacity: .5; cursor: wait; }
.opt-progress { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; color: var(--muted); }
.opt-progress[hidden] { display: none; }
.opt-progress .track { flex: none; display: block; }
.status[hidden] { display: none; }
.opt-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.opt-empty h2 { font-size: 1.4rem; }
.opt-empty p { margin: 0; color: var(--muted); }
.opt-rules { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.opt-rules b { color: var(--text); }
.table-wrap { overflow-x: auto; }
.opt-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.opt-table th, .opt-table td { padding: 4px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--seam-soft); }
.opt-table th:first-child, .opt-table td:first-child { text-align: left; white-space: normal; }
.opt-table thead th { font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.opt-table tr.on { background: var(--slab-2); }
.opt-table tr.on .link { color: var(--ember); font-weight: 700; }
.opt-table .link { font-size: .9rem; color: var(--text); }
.opt-table tr.turret td:first-child { color: var(--rune); }
.opt-table tr.unused td { color: var(--dim); }
.opt-table tr.unused b { font-weight: 400; }
.opt-table small { color: var(--dim); }
.opt-turns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1500px) { .opt-turns { grid-template-columns: minmax(0, 1fr); } }
.opt-turn { min-width: 0; }
.opt-turn h3 { font-size: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.opt-turn h3 .num { color: var(--ember); font-size: 1.15rem; }
.opt-turn h3 small { font: .74rem var(--mono); color: var(--dim); letter-spacing: 0; }
.opt-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.opt-item { background: var(--slab-2); border: 1px solid var(--seam-soft); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt-item header { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; }
.opt-item .pic { width: 40px; height: 40px; border-radius: 8px; background: var(--stone); display: grid; place-items: center; }
.opt-item .pic img { width: 34px; height: 34px; object-fit: contain; }
.opt-item header b { display: block; line-height: 1.15; }
.opt-item .meta { font-size: .76rem; color: var(--dim); }
.opt-passive { margin: 0; font-size: .78rem; color: var(--rune); }
.opt-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: .84rem; }
.opt-lines li { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.opt-lines li > span:first-child { color: var(--el, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-lines .flag { font: 700 .58rem var(--mono); padding: 1px 4px; border-radius: 4px; background: var(--ec); color: var(--stone); }
.opt-lines .flag.exo { background: var(--rune); text-transform: uppercase; }
.opt-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 18px; }
.opt-stat { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px dashed var(--seam-soft); font-size: .88rem; }
.opt-stat i { font-style: normal; color: var(--el, var(--text)); }
.opt-stat.zero i, .opt-stat.zero b { color: var(--dim); font-weight: 400; }
.opt-fm { margin: 0; font-size: .78rem; color: var(--ember); }
.cast-note { display: block; font: .7rem var(--body); color: var(--dim); white-space: normal; }

/* ---------- Sorts ---------- */
.spell-layout { max-width: 1840px; margin: 0 auto; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .spell-layout { grid-template-columns: minmax(0, 1fr); } }
.spell-form { position: sticky; top: 16px; }
@media (max-width: 900px) { .spell-form { position: static; } }
.spell-form form { display: flex; flex-direction: column; gap: 8px; }
.spell-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.spell-best { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.spell-card { background: var(--slab); border: 1px solid var(--seam-soft); border-top: 3px solid var(--el); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.spell-card h3 { font-size: .9rem; color: var(--el); letter-spacing: .04em; }
.spell-card b { font: 600 1.4rem var(--mono); }
.spell-card b small { font: .72rem var(--mono); color: var(--dim); }
.spell-card span { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spell-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(620px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 760px) { .spell-groups { grid-template-columns: minmax(0, 1fr); } }
.spell-group h2 { color: var(--el); }
.spell-name { display: flex; align-items: center; gap: 8px; }
.spell-name img { width: 26px; height: 26px; border-radius: 6px; flex: none; }
.opt-table tr.locked td { color: var(--dim); }
.opt-table tr.locked b { font-weight: 400; }
.opt-table td.ratio b { color: var(--ember); }
.spell-form fieldset { border: 1px solid var(--seam-soft); border-radius: 10px; margin: 0; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.spell-form legend { padding: 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }
.spell-form .field[hidden] { display: none; }
.spell-form #setupField { flex-direction: column; align-items: stretch; gap: 4px; }
.spell-form #setupField select { max-width: none; }
.conditions { display: flex; flex-direction: column; gap: 4px; }
.condition { display: grid; grid-template-columns: minmax(0, 1fr) 62px auto; gap: 6px; align-items: center; }
.condition select, .condition input { background: var(--stone); border: 1px solid var(--seam); border-radius: 7px; padding: 4px 6px; color: var(--text); min-width: 0; width: 100%; }
.condition input { font: 600 .88rem var(--mono); }
.condition .link { font-size: 1.1rem; }
.condition-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.condition-buttons .btn { padding: 3px 9px; font-size: .84rem; }
.opt-conditions { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9rem; }
.opt-conditions .met { color: var(--sc); }
.opt-conditions .unmet { color: var(--ember); }
.opt-conditions b { font-weight: 500; }
.spell-card .btn { margin-top: 6px; padding: 3px 9px; font-size: .84rem; text-align: center; }
.spell-launch { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.spell-launch .btn { padding: 3px 10px; font-size: .84rem; }
.opt-table td.met { color: var(--sc); }
.opt-table td.unmet { color: var(--ember); }
.element-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.opt-main .stat-board { margin-bottom: 4px; }
.opt-main .scol { background: var(--slab-2); }
@media (min-width: 901px) { .opt-form { max-height: calc(100vh - 32px); overflow-y: auto; } }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--stone); border: 1px solid var(--seam); border-radius: 10px; }
.mode-tabs button { border: 0; background: none; border-radius: 7px; padding: 5px; font-weight: 700; color: var(--muted); }
.mode-tabs button[aria-pressed="true"] { background: var(--slab-2); color: var(--ember); box-shadow: inset 0 0 0 1px rgba(242, 162, 76, .35); }
.opt-form fieldset[hidden] { display: none; }
.free-note { font: .78rem var(--body); color: var(--ember); letter-spacing: 0; text-transform: none; }
.save-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.save-form input { background: var(--stone); border: 1px solid var(--seam); border-radius: 7px; padding: 5px 8px; color: var(--text); min-width: 0; }
.save-form input::placeholder { color: var(--dim); }
.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: .9rem; }
.saved-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.saved-list .empty { color: var(--dim); }
.saved-name { color: var(--text); font-size: .92rem; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.saved-actions { display: flex; gap: 8px; flex: none; }
.shared-banner { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 6px 8px; border: 1px solid rgba(242, 162, 76, .4); border-radius: 8px; font-size: .84rem; color: var(--ember); }
.shared-banner[hidden] { display: none; }
.stuff-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* FM de mon stuff et objets imposés */
.opt-lines small.was { color: var(--muted); font-weight: 400; margin-right: 4px; }
.opt-lines li.gone > span:first-child { color: var(--muted); text-decoration: line-through; }
.opt-table tr.weapon td:first-child { font-weight: 700; }
.field input[type="search"] { flex: 1; width: auto; min-width: 0; font: inherit; }
.lock-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.lock-list:empty { display: none; }
.lock-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lock-list.locked li { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }
.lock-list small { color: var(--muted); }
.lock-list .empty { color: var(--muted); }

/* Comparaison de la FM */
.fm-gain { margin: 0 0 12px; color: var(--muted); }
.fm-gain b { color: var(--text); }
.fm-gain b.up { color: var(--sc); }
.fm-gain b.down { color: var(--ember); }

/* Mes stuffs : un blason par stuff */
.plaques-page { max-width: 1840px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.plaques-note { max-width: 70ch; }
.plaque-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.plaques { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.plaque {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px 16px; padding: 16px;
  border: 1px solid var(--seam); border-radius: var(--radius);
  background: radial-gradient(260px 200px at 46px 50px, color-mix(in srgb, var(--el) 22%, transparent), transparent 75%), var(--slab);
}
.plaque-crest { grid-row: 1 / span 1; }
.shield { display: block; width: 92px; height: auto; }
.shield-ground { fill: var(--stone); }
.shield-rim { fill: none; stroke: var(--ember); stroke-width: 2; }
.shield.bare .shield-rim { stroke: var(--seam); }
.shield.bare g[stroke] { stroke: var(--muted); }
.plaque-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plaque h2 { font-size: 1.32rem; overflow-wrap: anywhere; }
.glyph { width: 18px; height: 18px; flex: none; }
.plaque-contexts { display: flex; flex-wrap: wrap; gap: 4px; }
.context {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 8px;
  border: 1px solid var(--seam-soft); border-radius: 8px; background: none; color: var(--dim); font-size: .86rem;
}
.context span { display: none; }
.context small { color: inherit; }
.context:hover { color: var(--text); border-color: var(--seam); }
.context.on { color: var(--ember); border-color: rgba(242, 162, 76, .45); background: rgba(242, 162, 76, .1); }
.context.on span { display: inline; }
.plaque-filters .context { color: var(--muted); }
.plaque-filters .context span { display: inline; }
.plaque-filters .context.on { color: var(--ember); }
.plaque-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; color: var(--muted); font-size: .92rem; }
.plaque-stats b { color: var(--text); font-weight: 500; }
.plaque-element { display: inline-flex; align-items: center; gap: 4px; color: var(--el); }
.plaque-element b { color: var(--el); }
.plaque-traits { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; color: var(--rune); font-size: .86rem; }
.plaque-traits li { display: inline-flex; align-items: center; gap: 4px; }
.plaque-traits .glyph { width: 15px; height: 15px; }
.plaque-items { grid-column: 1 / -1; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.plaque-items li { width: 38px; height: 38px; border-radius: 8px; background: var(--stone); display: grid; place-items: center; }
.plaque-items img { width: 32px; height: 32px; object-fit: contain; }
.plaque-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.plaque-actions .btn { padding: 5px 11px; font-size: .92rem; }

/* Panoplies */
.set-link { padding: 0; background: none; border: 0; color: inherit; text-align: left; text-decoration: underline; text-decoration-color: var(--seam); text-underline-offset: 3px; }
.set-link:hover { color: var(--ember); text-decoration-color: var(--ember); }
a.set-link b { color: inherit; }
.set-search { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.set-search input { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--seam); border-radius: 9px; background: var(--stone); color: var(--text); }
.set-results { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: .92rem; }
.set-results:empty { display: none; }
.set-results small, .set-results .empty { color: var(--dim); }
.results li.has-set { position: relative; }
.results li.has-set > button:first-child { padding-right: 72px; }
.results button.result-set {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: auto; padding: 2px 7px;
  border: 1px solid var(--seam); border-radius: 6px; background: var(--slab); color: var(--muted); font-size: .76rem;
}
.results button.result-set:hover { border-color: var(--ember); color: var(--ember); background: var(--slab); }
.set-dialog {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 18px;
  border: 1px solid var(--seam); border-radius: var(--radius); background: var(--slab); color: var(--text);
}
.set-dialog::backdrop { background: rgba(8, 9, 13, .72); }
.set-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.set-dialog-head h2 { font-size: 1.5rem; }
.set-dialog-head p { margin: 2px 0 0; color: var(--muted); }
.set-dialog-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.set-piece { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--seam-soft); border-radius: 10px; background: var(--slab-2); }
.set-piece.worn { border-color: rgba(242, 162, 76, .45); }
.set-piece header { display: flex; gap: 10px; align-items: center; }
.set-piece header div { display: flex; flex-direction: column; min-width: 0; }
.set-piece .pic { width: 42px; height: 42px; flex: none; border-radius: 8px; background: var(--stone); display: grid; place-items: center; }
.set-piece .pic img { width: 36px; height: 36px; object-fit: contain; }
.set-piece .meta { color: var(--muted); font-size: .84rem; }
.set-piece .btn { align-self: flex-start; padding: 4px 10px; font-size: .9rem; margin-top: auto; }
.set-replaces { color: var(--dim); font-size: .8rem; }
.set-ladder { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.set-ladder li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 4px 8px; border-radius: 8px; }
.set-ladder li > b { color: var(--muted); font-weight: 500; font-size: .84rem; }
.set-ladder li.on { background: rgba(242, 162, 76, .1); }
.set-ladder li.on > b { color: var(--ember); }
.set-dialog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.set-dialog-foot .btn[disabled] { opacity: .55; cursor: default; }
@media (max-width: 520px) {
  .plaque { grid-template-columns: 64px minmax(0, 1fr); }
  .shield { width: 64px; }
}

/* Une pièce forgée par le joueur */
.opt-fm.mine { color: var(--rune); }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.card-actions .btn { padding: 4px 10px; font-size: .88rem; }
.forge-dialog { width: min(1080px, calc(100vw - 32px)); }
.forge-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.forge-live { position: sticky; top: 0; min-width: 0; padding-left: 18px; border-left: 1px solid var(--seam-soft); }
.forge-live-table { max-height: 58vh; overflow: auto; }
.forge-live .fm-gain b.up { font-size: 1.15em; }
@media (max-width: 820px) {
  .forge-grid { grid-template-columns: minmax(0, 1fr); }
  .forge-live { position: static; padding-left: 0; border-left: 0; }
}
.forge-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.forge-lines li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 84px 18px; align-items: center; gap: 8px; }
.forge-lines label { color: var(--el, var(--text)); }
.forge-lines .flag.exo { font: 700 .58rem var(--mono); padding: 1px 4px; border-radius: 4px; background: var(--rune); color: var(--stone); text-transform: uppercase; }
.forge-range { color: var(--muted); font-size: .84rem; text-align: right; }
.forge-lines input, .forge-add input { width: 100%; padding: 3px 6px; border: 1px solid var(--seam); border-radius: 7px; background: var(--stone); color: var(--text); }
.forge-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.forge-add .field { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.forge-add input { width: 70px; }
.lock-list.locked li { flex-wrap: wrap; }
.lock-fm { flex-basis: 100%; font-size: .84rem; }
.fm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }

/* Logo et élément de frappe des sorts */
.spell-name > span { color: var(--el, var(--text)); }
.spell-name small { color: var(--dim); }
.opt-table tr.unused .spell-name > span { opacity: .72; }
.opt-table .spell-name { min-height: 26px; }
.strike-dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.strike-dots i { width: 8px; height: 8px; border-radius: 50%; }
.opt-table td.opt-added { white-space: normal; text-align: left; min-width: 180px; color: var(--muted); }
.check[hidden] { display: none; }

/* ---------- Page Stats FM ---------- */
.fmstats { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; padding-top: 14px; }
.fmstats h2 { color: var(--text); font-size: 1.25rem; }
.fm-hero h2 { font-size: clamp(1.8rem, 4.2vw, 3rem); font-weight: 800; line-height: 1.1; color: var(--ember); }
.fm-hero p { margin: 8px 0 14px; color: var(--muted); font-size: 1.1rem; }
.fm-note { margin: 8px 0 0; color: var(--muted); font-size: .92rem; max-width: 72ch; }

.fm-bar { display: flex; gap: 2px; height: 14px; }
.fm-seg { min-width: 3px; }
.fm-seg:first-child { border-radius: 4px 0 0 4px; }
.fm-seg:last-child { border-radius: 0 4px 4px 0; }
.fm-seg:only-child { border-radius: 4px; }
.fm-seg.sc, .fm-legend i.sc { background: var(--sc); }
.fm-seg.sn, .fm-legend i.sn { background: var(--sn); }
.fm-seg.ec, .fm-legend i.ec { background: var(--ec); }
.fm-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 7px 0 0; padding: 0; color: var(--muted); font-size: .88rem; }
.fm-legend li { display: flex; align-items: center; gap: 6px; }
.fm-legend i { width: 9px; height: 9px; border-radius: 2px; }
.fm-legend b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

.fm-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 26px 40px; align-items: start; }
.fm-side { display: flex; flex-direction: column; gap: 26px; }
.fm-ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; }

.fm-records { margin: 10px 0 0; }
.fm-record { padding: 10px 0; border-top: 1px solid var(--seam-soft); }
.fm-record dt { color: var(--muted); font-size: .9rem; }
.fm-record dd { margin: 1px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.fm-record b { font-family: var(--display); font-size: 1.45rem; font-weight: 700; }
.fm-record span { color: var(--muted); font-size: .92rem; }

.fm-table { overflow-x: auto; margin-top: 10px; }
.fm-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fm-table th, .fm-table td { padding: 6px 12px 6px 0; text-align: left; border-top: 1px solid var(--seam-soft); }
.fm-table thead th { border-top: 0; color: var(--muted); font-weight: 500; }
.fm-table tbody th { font-weight: 500; white-space: nowrap; }

.fm-rank { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fm-rank li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "pic name count" "pic bar bar"; align-items: center; column-gap: 8px; }
.fm-rank-pic { grid-area: pic; width: 30px; height: 30px; }
.fm-rank-pic img { width: 100%; height: 100%; object-fit: contain; }
.fm-rank-name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-rank-count { grid-area: count; color: var(--muted); font-size: .88rem; }
.fm-rank-bar { grid-area: bar; height: 4px; }
.fm-rank-bar i { display: block; height: 100%; min-width: 3px; border-radius: 2px; background: var(--ember); }

.fm-guide { display: flex; flex-direction: column; gap: 18px; padding-top: 22px; border-top: 1px solid var(--seam); }
.fm-guide .fm-note { margin-top: -10px; }
.fm-rule h3 { font-size: 1.1rem; color: var(--ember); }
.fm-rule p { margin: 4px 0 0; max-width: 72ch; }
.fm-bands { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.fm-band { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 2px 14px; align-items: center; }
.fm-band-name { grid-row: span 2; font-size: .95rem; }
.fm-band-name small { display: block; color: var(--muted); font-size: .8rem; }
.fm-band .fm-legend { margin-top: 3px; }
.fm-weights { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 3px 28px; }
.fm-weights li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--seam-soft); padding: 3px 0; }
.fm-weights b { font-weight: 500; }

@media (max-width: 820px) {
  .fm-grid { grid-template-columns: minmax(0, 1fr); }
  .tabs { flex-wrap: wrap; border-radius: 16px; }
  .tabs a { padding: 5px 12px; }
}

/* ---------- Profils ---------- */
a.context { color: inherit; text-decoration: none; }
.fm-title { color: var(--ember); font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
.fmstats a { color: var(--ember); }
.fmstats a.context { color: inherit; }
.fm-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin-top: 14px; max-width: 640px; }
.fm-form label { flex-basis: 100%; color: var(--muted); font-size: .92rem; }
.fm-form input { flex: 1 1 220px; min-width: 0; padding: 7px 10px; background: var(--slab); border: 1px solid var(--seam); border-radius: 9px; }
.fm-message { margin: 12px 0 0; color: var(--sc); }
.fm-message.err { color: var(--ec); }
.fm-key { margin: 22px 0 16px; max-width: 72ch; }
.fm-key h3 { font-size: 1.05rem; color: var(--text); }
.fm-key p { margin: 4px 0 8px; color: var(--muted); font-size: .92rem; }
.fm-key input { width: 100%; padding: 7px 10px; background: var(--slab); border: 1px solid var(--seam); border-radius: 9px; font-family: var(--mono); font-size: .85rem; }
.fm-command { display: block; padding: 8px 10px; background: var(--slab); border: 1px solid var(--seam); border-radius: 9px; font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; }
.fm-links { white-space: nowrap; text-align: right !important; }
.fm-links a { margin-left: 10px; }
.fm-table small { margin-left: 4px; color: var(--muted); font-weight: 400; }
.plaque-owner { margin: 0; color: var(--muted); font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Page Brisage : les mêmes colonnes dans chaque tableau, pour lire un montant d'un tableau à l'autre. */
.break-views { display: flex; gap: 8px; }
.break-views button[aria-pressed="true"] { border-color: var(--ember); color: var(--ember); }
#rankings { display: flex; flex-direction: column; gap: 26px; }
.break-section h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.break-section h2 .arrow { width: 16px; height: 16px; }
.break-section h2.gain .arrow { color: var(--sc); }
.break-section h2.loss .arrow { color: var(--ec); }
.break-card { background: var(--slab); border: 1px solid var(--seam-soft); border-radius: var(--radius); }
.break-table { width: 100%; min-width: 820px; table-layout: fixed; border-collapse: collapse; font-feature-settings: "lnum", "tnum"; word-spacing: .12em; }
.break-players { min-width: 480px; }
.break-items .c-item { width: 31%; }
.break-items .c-player { width: 13%; }
.break-items .c-date { width: 9%; }
.break-items .c-coef { width: 9%; }
.break-items .c-price { width: 14%; }
.break-items .c-runes { width: 11%; }
.break-items .c-result { width: 13%; }
.break-players .c-name { width: 40%; }
.break-players .c-count { width: 14%; }
.break-players .c-sum { width: 23%; }
.break-table th, .break-table td { padding: 8px 14px; text-align: right; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.break-table th:first-child, .break-table td:first-child { text-align: left; }
.break-table th:nth-child(2), .break-table td:nth-child(2) { text-align: left; }
.break-players th:nth-child(2), .break-players td:nth-child(2) { text-align: right; }
.break-table thead th { padding-block: 10px 8px; font-size: .72rem; font-weight: 500; letter-spacing: .06em; color: var(--dim); white-space: nowrap; }
.break-table tbody tr { border-top: 1px solid var(--seam-soft); transition: background .12s; }
.break-table tbody tr:hover { background: var(--slab-2); }
.break-table td { color: var(--muted); }
.break-table td b { display: block; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.break-table td small { display: block; font-size: .76rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.break-player { color: var(--text) !important; white-space: nowrap; }
.break-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.break-rank { flex: none; width: 18px; text-align: center; font-family: var(--display); font-weight: 700; color: var(--dim); }
.break-table tbody tr:first-child .break-rank { color: var(--ember); }
.break-pic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--stone); border: 1px solid var(--seam-soft); }
.break-pic img { width: 34px; height: 34px; object-fit: contain; }
.break-name { min-width: 0; }
.break-amount { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-weight: 700; white-space: nowrap; color: var(--text); }
.break-amount.gain { color: var(--sc); background: rgba(116, 211, 144, .12); }
.break-amount.loss { color: var(--ec); background: rgba(238, 107, 95, .12); }
.arrow { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.break-unknown { font-size: .85rem; color: var(--dim); white-space: nowrap; }
