/* =====================================================================
   SHUJAA ESPADA v2 — page Tier lists
   ===================================================================== */

.tl { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: calc(var(--nav-h) + 56px) var(--gutter) 90px; }
.nav-links a[aria-current="page"] { color: var(--gold-2); }
.tl-head .title { font-size: clamp(2.4rem, 6vw, 5.4rem); }
.tl-head .lede { margin-top: 14px; }

/* onglets joueurs */
.tl-tabs { display: flex; gap: 10px; margin: 40px 0 22px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tl-tab {
  flex: 0 0 auto; display: grid; gap: 2px; text-align: left; cursor: pointer;
  padding: 12px 18px 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(243, 235, 224, 0.03);
  box-shadow: inset 3px 0 0 var(--pc);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.tl-tab:hover { background: rgba(243, 235, 224, 0.07); }
.tl-tab[aria-selected="true"] { border-color: color-mix(in srgb, var(--pc) 60%, transparent); background: color-mix(in srgb, var(--pc) 13%, transparent); transform: translateY(-2px); }
.tl-tab-name { font-weight: 800; font-size: 16px; }
.tl-tab-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }

/* la feuille */
.tl-board { display: grid; gap: 22px; }
.tl-sheet {
  border-radius: 20px; overflow: hidden;
  background: linear-gradient(160deg, rgba(36, 14, 18, 0.92), rgba(14, 8, 9, 0.94));
  box-shadow: 0 0 0 1.5px rgba(196, 49, 75, 0.35), 0 40px 100px -40px rgba(0, 0, 0, 0.9);
}
.tl-sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.tl-sheet-head h2 { margin: 0; font-size: clamp(20px, 2.4vw, 28px); font-weight: 900; letter-spacing: -0.01em; }
.tl-sheet-head em { font-family: var(--serif); font-weight: 400; color: var(--gold-2); margin-left: 6px; }
.tl-count { font-family: var(--mono); font-size: 12px; color: var(--mute); white-space: nowrap; }

.tier { display: grid; grid-template-columns: 92px 1fr; border-bottom: 1px solid rgba(243, 235, 224, 0.06); }
.tier:last-child { border-bottom: 0; }
.tier-label {
  display: grid; place-items: center; cursor: pointer; border: 0; padding: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 92%, white), var(--tc) 55%, color-mix(in srgb, var(--tc) 70%, black));
  color: #1a0f08; font-weight: 900; font-size: 26px; letter-spacing: -0.02em; line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
}
.tier-label span { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.tier-label:hover::after, .tier-label:focus-visible::after { content: "✎"; position: absolute; right: 6px; top: 4px; font-size: 13px; opacity: 0.7; }

.tier-row { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 10px; min-height: 96px; transition: background 0.2s; }
.tier-row.over { background: rgba(196, 49, 75, 0.08); }

/* tuile héros */
.hero {
  --s: 76px;
  position: relative; width: var(--s); height: var(--s); padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, #2a1217, #13090b);
  box-shadow: inset 0 0 0 1px rgba(243, 235, 224, 0.1), inset 0 -3px 0 var(--role);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.hero:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(196, 49, 75, 0.6), inset 0 -3px 0 var(--role), 0 10px 24px -10px rgba(0, 0, 0, 0.9); }
.hero:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.hero-mono { position: absolute; inset: 0 0 18px; display: grid; place-items: center; font-weight: 900; font-size: 24px; color: color-mix(in srgb, var(--role) 85%, white); opacity: 0.85; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.hero-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 4px 4px;
  font-size: 10.5px; font-weight: 700; line-height: 1.1; text-align: center; color: var(--ink);
  background: linear-gradient(transparent, rgba(8, 5, 4, 0.92) 55%);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero.is-unknown { background: repeating-linear-gradient(135deg, #2a1217 0 8px, #1d140e 8px 16px); box-shadow: inset 0 0 0 1.5px rgba(196, 49, 75, 0.55), inset 0 -3px 0 var(--role); }
.hero.is-unknown .hero-mono { color: var(--gold-2); font-size: 30px; }
.hero.lifted { opacity: 0.25; }
.hero.ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; transition: none; box-shadow: 0 0 0 2px var(--gold-2), 0 20px 40px -10px rgba(0, 0, 0, 0.9); }
.drop-mark { width: 4px; height: 76px; border-radius: 4px; background: var(--gold-2); box-shadow: none; }
body.dragging { cursor: grabbing; }
body.dragging .hero { cursor: grabbing; }

/* à classer */
.tl-pool { border-radius: 18px; border: 1px dashed rgba(243, 235, 224, 0.18); background: rgba(11, 6, 7, 0.55); }
.tl-pool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.tl-pool-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.tl-pool-head h3 span { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-left: 6px; }
.tl-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); cursor: pointer; }
.tl-check input { accent-color: var(--gold); width: 16px; height: 16px; }
.tl-pool .tier-row { min-height: 80px; }
.tl-pool .hero { --s: 64px; }
.tl-empty { margin: auto; color: var(--dim); font-size: 14px; }

/* outils */
.tl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; }
.tl-tools label { cursor: pointer; }
.tl-sep { flex: 1; }
.tl-danger { color: #ff9a85; }
.tl-danger:hover { border-color: rgba(229, 88, 59, 0.6); }

.tl-help { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; color: var(--mute); }
.tl-help summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.tl-help-body { max-width: 52em; font-size: 15px; }
.tl-help code { font-family: var(--mono); font-size: 12.5px; color: var(--gold-2); background: rgba(243, 235, 224, 0.05); padding: 1px 6px; border-radius: 6px; }
.tl-files { display: flex; flex-wrap: wrap; gap: 6px; }

/* dépôt de fichiers sur la page */
body.file-over::after {
  content: "Lâche tes images ici"; position: fixed; inset: 14px; z-index: 90; display: grid; place-items: center;
  border: 2px dashed var(--gold-2); border-radius: 24px; background: rgba(11, 6, 7, 0.82);
  font-family: var(--serif); font-style: italic; font-size: clamp(28px, 4vw, 48px); color: var(--gold-2); pointer-events: none;
}

/* fenêtres */
.tl-dlg {
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink);
  background: linear-gradient(160deg, #241015, #0f0809);
  box-shadow: 0 0 0 1.5px rgba(196, 49, 75, 0.45), 0 40px 120px -20px rgba(0, 0, 0, 0.95);
}
.tl-dlg::backdrop { background: rgba(5, 3, 2, 0.7); backdrop-filter: blur(4px); }
.tl-dlg-in { display: grid; gap: 14px; padding: 22px; }
.tl-dlg .kicker { margin: 0 0 8px; }
.tl-dlg-top { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.tl-dlg-pic { position: relative; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #2a1217, #13090b); box-shadow: inset 0 0 0 1px rgba(243, 235, 224, 0.12); display: grid; place-items: center; font-weight: 900; font-size: 30px; color: var(--gold-2); }
.tl-dlg-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-field { display: grid; gap: 6px; font-size: 13px; color: var(--mute); }
.tl-field input {
  font: inherit; font-size: 16px; color: var(--ink); padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(243, 235, 224, 0.05);
}
.tl-field input:focus { outline: 2px solid rgba(196, 49, 75, 0.6); outline-offset: 1px; }
.tl-dlg-label { margin: 0; font-size: 13px; color: var(--mute); }
.tl-moves, .tl-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-move {
  min-width: 44px; height: 38px; padding: 0 12px; border-radius: 10px; cursor: pointer; font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--tc, #a8969a) 50%, transparent); background: color-mix(in srgb, var(--tc, #a8969a) 14%, transparent);
}
.tl-move.pool { font-weight: 700; font-size: 13px; }
.tl-move.on { background: var(--tc, #a8969a); color: #1a0f08; }
.tl-swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: var(--tc); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3); }
.tl-swatch.on { box-shadow: 0 0 0 2px #0f0809, 0 0 0 4px var(--gold-2); }
.tl-dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-dlg-actions label { cursor: pointer; }
.tl-dlg-actions [hidden] { display: none; }
.tl-dlg-actions button:disabled { opacity: 0.35; cursor: default; }
.tl-dlg-foot { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }

.tl-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 95; max-width: calc(100vw - 32px);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 12px; background: #1d130d; color: var(--ink); font-size: 14px;
  box-shadow: 0 0 0 1px rgba(196, 49, 75, 0.45), 0 20px 50px -10px rgba(0, 0, 0, 0.9);
  transition: transform 0.3s, opacity 0.3s;
}
.tl-toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 760px) {
  .tl { padding-top: calc(var(--nav-h) + 32px); }
  .tier { grid-template-columns: 58px 1fr; }
  .tier-label { font-size: 20px; }
  .tier-row { gap: 6px; padding: 8px; min-height: 72px; }
  .hero { --s: 58px; }
  .tl-pool .hero { --s: 54px; }
  .hero-mono { font-size: 18px; inset: 0 0 14px; }
  .hero-name { font-size: 9px; padding-top: 10px; }
  .drop-mark { height: 58px; }
  .tl-sep { display: none; }
}

/* =====================================================================
   Évolution : bilan, graphique, fil des mouvements, analyse
   ===================================================================== */
.evo { margin-top: clamp(70px, 10vh, 120px); --up: #3fe07a; --down: #ef3b3b; }
.evo-head .title { font-size: clamp(2rem, 4.6vw, 3.8rem); }
.evo-head .lede { margin-top: 12px; max-width: 760px; }
.evo-team { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 30px 0 18px; }
.evo-p { display: grid; gap: 8px; text-align: left; cursor: pointer; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(243, 235, 224, 0.03); box-shadow: inset 3px 0 0 var(--pc); color: var(--ink); transition: background 0.2s, border-color 0.2s; }
.evo-p:hover { background: rgba(243, 235, 224, 0.06); }
.evo-p.on { border-color: color-mix(in srgb, var(--pc) 60%, transparent); background: color-mix(in srgb, var(--pc) 12%, transparent); }
.evo-p b { font-size: 16px; font-weight: 800; }
.evo-ud { display: flex; gap: 12px; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.evo-ud i { font-style: normal; }
.evo-ud .u { color: var(--up); }
.evo-ud .d { color: var(--down); }
.evo-bar { display: flex; height: 6px; border-radius: 4px; overflow: hidden; background: rgba(243, 235, 224, 0.08); }
.evo-bar .u { background: var(--up); }
.evo-bar .d { background: var(--down); }
.evo-bar .z { flex: 1; }

.evo-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.evo-chart-box, .evo-detail, .evo-meta { border-radius: 20px; background: linear-gradient(160deg, rgba(36, 14, 18, 0.92), rgba(14, 8, 9, 0.94)); box-shadow: 0 0 0 1px var(--line); padding: 20px 22px; }
.evo-cap { margin: 0 0 10px; font-size: 14px; color: var(--mute); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.evo-cap b { color: var(--ink); }
.evo-key { font-family: var(--mono); font-size: 12px; display: inline-flex; gap: 10px; }
.evo-key i { font-style: normal; }
.evo-key .u { color: var(--up); }
.evo-key .d { color: var(--down); }
.evo-chart { width: 100%; height: auto; display: block; overflow: visible; }
.evo-ax { font: 800 15px var(--sans, sans-serif); fill: #160a0c; }
.evo-t { font: 600 14px var(--mono, monospace); fill: var(--mute); }
.evo-empty { font: 600 19px var(--sans, sans-serif); fill: var(--mute); }
.evo-path { fill: none; stroke: var(--lc); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; transition: opacity 0.2s; }
.evo-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
.evo-line.dim { opacity: 0.18; }
.evo-pt { cursor: pointer; }
.evo-pt circle { stroke: #0b0607; stroke-width: 2.5; }
.evo-pt circle.u { fill: var(--up); }
.evo-pt circle.d { fill: var(--down); }
.evo-pt text { font: 900 11px sans-serif; fill: #0b0607; pointer-events: none; }
.evo-pt.on circle { stroke: #fff; stroke-width: 3; }
.evo-end { fill: #0b0607; stroke: var(--lc); stroke-width: 2.5; }
.evo-hn { font: 800 15px var(--sans, sans-serif); fill: var(--ink); }

.evo-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.evo-feed-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.evo-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.evo-mv { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(243, 235, 224, 0.03); color: var(--ink); text-align: left; cursor: pointer; box-shadow: inset 3px 0 0 var(--pc); }
.evo-mv:hover { background: rgba(243, 235, 224, 0.06); }
.evo-mv.on { border-color: rgba(243, 235, 224, 0.4); }
.evo-mv img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: rgba(243, 235, 224, 0.05); }
.evo-mv-t { font-size: 14px; line-height: 1.3; }
.evo-mv-t small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.evo-mv-n { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.evo-mv.u .evo-mv-n { color: var(--up); }
.evo-mv.d .evo-mv-n { color: var(--down); }
.evo-none { color: var(--mute); font-size: 14px; padding: 10px 2px; }

.evo-detail { position: sticky; top: calc(var(--nav-h) + 16px); box-shadow: 0 0 0 1px var(--line), inset 0 3px 0 var(--pc, var(--gold)); }
.evo-detail h3 { margin: 4px 0 0; font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.evo-detail h3 span { display: inline-block; margin-left: 6px; font-family: var(--mono); font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 8px; vertical-align: 3px; }
.evo-detail h3 span.u { color: #0b0607; background: var(--up); }
.evo-detail h3 span.d { color: #fff; background: var(--down); }
.evo-detail h4 { margin: 18px 0 6px; font-size: 12px; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pc, var(--gold-2)); }
.evo-dh { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.evo-dh img { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; background: color-mix(in srgb, var(--pc, #c4314b) 18%, transparent); }
.evo-txt { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.evo-notes, .evo-tips { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.evo-notes li::marker { color: var(--mute); }
.evo-tips li::marker { color: var(--pc, var(--gold)); }
.evo-motiv { margin: 18px 0 14px; padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 15px; background: color-mix(in srgb, var(--pc, #c4314b) 14%, transparent); }
.evo-del { font-size: 12px; }

.evo-meta { margin-top: 18px; display: grid; gap: 10px; }
.evo-meta h3 { margin: 4px 0 10px; font-size: 18px; font-weight: 800; }
.evo-src { margin: 0; font-size: 12px; color: var(--mute); }
.evo-src a { color: var(--gold-2); }

@media (max-width: 900px) {
  .evo-grid { grid-template-columns: 1fr; }
  .evo-detail { position: static; }
}
.evo-meta-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.evo-live { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; color: var(--mute); box-shadow: inset 0 0 0 1px var(--line); }
.evo-live.on { color: var(--up); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 60%, transparent); }
.evo-live.on::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--up); vertical-align: 1px; }
.evo-meta-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.evo-meta h4 { margin: 0 0 8px; font-size: 12px; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-2); }
.evo-patchs { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.evo-patchs > li > a { color: var(--ink); text-decoration: none; font-size: 15px; }
.evo-patchs > li > a:hover { text-decoration: underline; }
.evo-patchs ul { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--mute); display: grid; gap: 3px; }
@media (max-width: 760px) { .evo-meta-cols { grid-template-columns: 1fr; } }

/* ---- ambiance de la page : de la couleur et de la vie (plus de grain « VHS ») ---- */
body.tl-page { background: #17121f; --tlc: #ff5fa2; }
.tl-page .glow, .tl-page .grain { display: none; }
.tl-sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, #2a1d3d 0%, #17121f 55%, #120e18 100%); }
/* grandes nappes de couleur, pré-floutées par leur dégradé (aucun filtre : léger à animer) */
.tl-sky i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: 0.62; will-change: transform;
  background: radial-gradient(closest-side, var(--c) 0%, color-mix(in srgb, var(--c) 40%, transparent) 45%, transparent 100%); }
.tl-sky i:nth-child(1) { --c: color-mix(in srgb, var(--tlc) 70%, transparent); left: -18vmax; top: -22vmax; animation: tl-drift1 26s ease-in-out infinite alternate; transition: --c 0.8s; }
.tl-sky i:nth-child(2) { --c: rgba(76, 201, 240, 0.55); right: -24vmax; top: 6vh; animation: tl-drift2 31s ease-in-out infinite alternate; }
.tl-sky i:nth-child(3) { --c: rgba(61, 220, 132, 0.4); left: 18vw; bottom: -38vmax; animation: tl-drift3 29s ease-in-out infinite alternate; }
.tl-sky i:nth-child(4) { --c: rgba(255, 196, 61, 0.38); left: -26vmax; bottom: -20vmax; width: 52vmax; height: 52vmax; animation: tl-drift2 35s ease-in-out infinite alternate-reverse; }
.tl-sky i:nth-child(5) { --c: rgba(157, 92, 255, 0.45); right: -10vmax; bottom: -30vmax; width: 60vmax; height: 60vmax; animation: tl-drift1 24s ease-in-out infinite alternate-reverse; }
@keyframes tl-drift1 { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes tl-drift2 { to { transform: translate(-12vw, 14vh) scale(0.9); } }
@keyframes tl-drift3 { to { transform: translate(10vw, -12vh) scale(1.1); } }
/* les lettres des rangs qui flottent en fond, chacune à sa couleur */
.tl-sky b { position: absolute; left: 0; top: 0; font: 900 var(--fs, 160px)/1 var(--sans); color: transparent; -webkit-text-stroke: 2.5px var(--c); opacity: 0; will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) { .tl-sky i, .tl-sky b { animation: none; } }

/* la feuille : plus claire, bordée de la couleur du joueur, chaque rangée teintée par son rang */
.tl-page .tl-sheet {
  background: linear-gradient(160deg, rgba(40, 30, 58, 0.86), rgba(24, 18, 34, 0.9));
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--pc) 55%, transparent), 0 30px 80px -30px color-mix(in srgb, var(--pc) 45%, rgba(0, 0, 0, 0.6));
}
.tl-page .tl-sheet-head em { color: var(--pc); }
.tl-page .tier-row { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 16%, transparent), color-mix(in srgb, var(--tc) 4%, transparent) 55%, transparent); }
.tl-page .tier-row.over { background: color-mix(in srgb, var(--tc) 24%, transparent); }
.tl-page .tl-pool { background: rgba(40, 30, 58, 0.55); }
