/* =====================================================================
   WoW Forever Tracker — feuille de style commune
   ---------------------------------------------------------------------
   Les couleurs sont des "variables CSS" (--nom) définies une seule fois
   ici. Chaque œuvre a sa palette : la classe .theme-jjk, .theme-dbz...
   redéfinit --t1 / --t2 / --t-glow pour la carte concernée.
   ===================================================================== */

:root {
  --bg: #0f1117;
  --bg-2: #161a23;
  --panel: #1b202b;
  --panel-2: #222836;
  --line: #2d3445;
  --text: #e8e6e1;
  --muted: #9aa1b2;
  --gold: #f2c14e;
  --silver: #c0c6d0;
  --copper: #c87f4a;
  --ok: #4fbf7a;
  --farm: #b17cf0;
  --warn: #e8a33c;
  --danger: #e5534b;
  --radius: 14px;
  --font-title: "Cinzel", Georgia, serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Palette par défaut (écrasée par les thèmes d'œuvre) */
  --t1: #5468ff;
  --t2: #a3b1ff;
  --t-glow: rgba(84, 104, 255, .35);
}

/* --- Palettes des œuvres --------------------------------------------- */
.theme-jjk   { --t1: #4b2a8f; --t2: #e0315e; --t-glow: rgba(224, 49, 94, .35); }   /* énergie occulte */
.theme-dbz   { --t1: #f07a1a; --t2: #2a5bd7; --t-glow: rgba(240, 122, 26, .4); }    /* orange & bleu */
.theme-aot   { --t1: #2f5d3a; --t2: #d8c9a3; --t-glow: rgba(216, 201, 163, .3); }   /* cape verte & lin */
.theme-fma   { --t1: #a51f24; --t2: #d9a62b; --t-glow: rgba(217, 166, 43, .35); }   /* manteau rouge & or */
.theme-slime { --t1: #1f8fd6; --t2: #7fe3f5; --t-glow: rgba(127, 227, 245, .4); }   /* slime bleu */

/* --- Base ------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #1d2335 0%, var(--bg) 70%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-title); letter-spacing: .02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* --- En-tête et navigation ------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 17, 23, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 10px; padding-bottom: 10px;
}
.brand { font-family: var(--font-title); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.brand span { color: var(--gold); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--muted);
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel-2); }

/* --- Boutons et formulaires ------------------------------------------ */
button, .btn {
  font: inherit; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px;
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--gold); color: #1a1406; border-color: var(--gold); font-weight: 600; }
button.danger { color: var(--danger); }
button.icon { padding: 2px 8px; }
.edit-toggle.on { background: var(--warn); color: #1a1406; border-color: var(--warn); font-weight: 600; }

input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--t2); outline-offset: 1px; }
input[type="number"] { width: 6em; }
label { display: inline-flex; flex-direction: column; gap: 2px; font-size: .8rem; color: var(--muted); }

/* Les éléments ".edit-only" n'apparaissent qu'en mode édition */
.edit-only { display: none !important; }
body.edit-mode .edit-only { display: revert !important; }
body.edit-mode .view-only { display: none !important; }

dialog {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; width: min(420px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog label { font-size: .85rem; }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; z-index: 100; box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
.toast.error { border-color: var(--danger); color: #ffb4ae; }

/* --- Page Collection ------------------------------------------------- */
.page-head { padding: 28px 0 8px; }
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 24px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; min-width: 130px;
}
.stat b { display: block; font-size: 1.3rem; font-family: var(--font-title); }

.cards {
  display: grid; gap: 20px; padding-bottom: 40px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.group-title { grid-column: 1 / -1; margin: 12px 0 -4px; color: var(--muted); font-size: .95rem; text-transform: uppercase; letter-spacing: .12em; }

/* La carte à collectionner */
.card {
  position: relative; display: flex; flex-direction: column;
  text-decoration: none;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border-radius: var(--radius);
  border: 2px solid transparent;
  /* astuce : deux fonds superposés pour faire une bordure en dégradé */
  background-clip: padding-box;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0,0,0,.35);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px;
  background: linear-gradient(135deg, var(--t1), var(--t2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--line), 0 14px 40px var(--t-glow); }

.card-art {
  position: relative; height: 120px;
  background:
    radial-gradient(circle at 75% 40%, var(--t-glow), transparent 60%),
    linear-gradient(135deg, var(--t1) 0%, color-mix(in srgb, var(--t1) 40%, #000) 100%);
  display: flex; align-items: center; justify-content: flex-end; padding: 0 18px;
}
.card-art .emblem { width: 92px; height: 92px; opacity: .95; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.card-art .lvl {
  position: absolute; left: 16px; top: 16px;
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 2px solid var(--t2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-title); line-height: 1;
}
.card-art .lvl small { font-size: .6rem; color: var(--muted); font-family: var(--font); text-transform: uppercase; }
.card-art .lvl b { font-size: 1.4rem; }
.role-badge {
  position: absolute; left: 82px; top: 18px;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 999px;
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-family: var(--font-title); font-size: 1.15rem; font-weight: 700; margin: 0; }
.card-ref { font-size: .82rem; color: var(--muted); margin-top: -6px; }
.card-ref i { color: var(--t2); font-style: normal; }
.card-class { font-size: .9rem; }
.card .xpbar { margin-top: 2px; }
.card-profs { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mini-prof { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: .8rem; }
.mini-prof .bar { grid-column: 1 / -1; height: 5px; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* --- Barres de progression ----------------------------------------- */
.bar {
  position: relative; height: 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); overflow: hidden;
}
.bar > span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--t1), var(--t2));
}
.xpbar > span { background: linear-gradient(90deg, #6d3fc0, #b37cff); }
.xpline { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }

/* Barre de métier 0–300 avec paliers 75 / 150 / 225 */
.prof-bar { height: 16px; overflow: visible; }
.prof-bar > span { border-radius: 999px 0 0 999px; }
.prof-bar .cap {               /* zone au-delà du plafond actuel, hachurée */
  position: absolute; top: 0; bottom: 0; right: 0;
  background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(255,255,255,.05) 5px 10px);
}
.prof-bar .tick {
  position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--line);
}
.prof-bar .tick.reached { background: var(--gold); }
.tick-labels { position: relative; height: 14px; font-size: .68rem; color: var(--muted); }
.tick-labels span { position: absolute; transform: translateX(-50%); }

/* --- Fiche personnage ------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  margin: 24px 0; border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 30%, var(--t-glow), transparent 55%),
    linear-gradient(120deg, var(--t1) 0%, color-mix(in srgb, var(--t1) 30%, #000) 100%);
  padding: 24px;
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.hero .emblem { width: 110px; height: 110px; margin-left: auto; }
.hero .lvl-big {
  width: 86px; height: 86px; border-radius: 50%; flex: none;
  background: rgba(0,0,0,.5); border: 3px solid var(--t2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-title); line-height: 1;
}
.hero .lvl-big b { font-size: 2rem; }
.hero .lvl-big small { font-size: .65rem; text-transform: uppercase; color: #ddd; font-family: var(--font); }
.hero h1 { margin: 0; }
.hero .sub { color: rgba(255,255,255,.8); }

.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); padding-bottom: 40px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.panel.wide { grid-column: 1 / -1; }
.panel h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.money .po { color: var(--gold); } .money .pa { color: var(--silver); } .money .pc { color: var(--copper); }

.prof-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.prof-row:last-child { border-bottom: 0; }
.prof-row .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 8px; }
.prof-row .kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-left: 6px; }
.prof-row .edit-only { margin-top: 8px; gap: 8px; align-items: end; flex-wrap: wrap; }
body.edit-mode .prof-row .edit-only { display: flex !important; }

.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; }

.goal { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.goal:last-child { border-bottom: 0; }
.goal.done .goal-title { text-decoration: line-through; color: var(--muted); }
.goal .goal-title { flex: 1; }
.tag { font-size: .7rem; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }

/* --- Statuts de donjon ---------------------------------------------- */
.status { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .78rem; white-space: nowrap; }
.status.a_faire { background: var(--panel-2); color: var(--muted); }
.status.fait { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.status.farm { background: color-mix(in srgb, var(--farm) 22%, transparent); color: var(--farm); }

.dungeon-list { width: 100%; border-collapse: collapse; }
.dungeon-list td, .dungeon-list th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.dungeon-list th { color: var(--muted); font-weight: 500; font-size: .8rem; }
.dungeon-list tr.out-of-range td:first-child { color: var(--muted); }

/* --- Page Donjons : tableau donjons × persos ------------------------ */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 8px 0 16px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); align-items: center; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 40px; }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; }
.matrix th, .matrix td { padding: 6px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix thead th { position: sticky; top: 0; background: var(--panel-2); font-weight: 500; font-size: .78rem; vertical-align: bottom; }
.matrix thead th .cn { display: block; font-family: var(--font-title); font-size: .85rem; }
.matrix th.dname, .matrix td.dname {
  text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 220px;
}
.matrix thead th.dname { z-index: 2; background: var(--panel-2); }
.matrix td.dname small { display: block; color: var(--muted); }
.matrix tr.section td { background: var(--bg-2); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; text-align: left; }
.cell {
  width: 100%; min-width: 64px; border: 0; border-radius: 8px; padding: 6px 4px;
  background: transparent; font-size: .78rem; line-height: 1.2; cursor: default;
}
body.edit-mode .cell { cursor: pointer; }
body.edit-mode .cell:hover { outline: 1px solid var(--muted); }
.cell.fait { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.cell.farm { background: color-mix(in srgb, var(--farm) 22%, transparent); color: var(--farm); }
.cell.a_faire.in-range { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.cell.a_faire.too-high { color: #4a5163; }
.cell.a_faire.too-low { color: var(--muted); }
.cell .runs { display: block; font-size: .68rem; opacity: .8; }
.cell .note-dot { color: var(--gold); }

/* --- Pied de page ---------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 30px; color: var(--muted); font-size: .8rem; }

@media (max-width: 600px) {
  .hero { padding: 18px; }
  .hero .emblem { width: 72px; height: 72px; }
  .grid-2 { grid-template-columns: 1fr; }
}

.prof-bar.mini { height: 6px; }
.prof-bar.mini .tick { top: -2px; bottom: -2px; width: 1px; }

/* --- Ce soir ---------------------------------------------------------- */
.pick {
  display: block; text-decoration: none; border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--t1) 55%, var(--panel)) 0%, var(--panel) 70%);
  border: 1px solid var(--line); padding: 16px; transition: transform .15s;
}
.pick:hover { transform: translateY(-2px); border-color: var(--t2); }
.pick.big { padding: 24px; box-shadow: 0 10px 40px var(--t-glow); }
.pick-head { display: flex; gap: 16px; align-items: center; }
.pick-head h2 { margin: 0; }
.pick-head .emblem { width: 90px; height: 90px; margin-left: auto; }
.pick .lvl-big {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: rgba(0,0,0,.45); border: 2px solid var(--t2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-title); line-height: 1;
}
.pick .lvl-big b { font-size: 1.3rem; }
.pick .lvl-big small { font-size: .55rem; text-transform: uppercase; color: #ddd; font-family: var(--font); }
.pick.big .lvl-big { width: 80px; height: 80px; }
.pick.big .lvl-big b { font-size: 1.9rem; }
.pick .score { margin-left: auto; font-family: var(--font-title); color: var(--muted); }
.pick .sub { color: rgba(255,255,255,.75); font-size: .9rem; }
.reasons { margin: 12px 0 0; padding-left: 20px; font-size: .9rem; }
.pick:not(.big) .reasons { font-size: .82rem; color: var(--muted); }
.picks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.journal { list-style: none; padding: 0; margin: 0; }
.journal li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.journal li:last-child { border-bottom: 0; }

/* --- Progression ----------------------------------------------------- */
.charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); padding-bottom: 40px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .line { fill: none; stroke: var(--t2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--t2); stroke: var(--panel); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-empty { height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 12px; }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 8px; font-size: .78rem; white-space: nowrap;
}

/* --- Synchro --------------------------------------------------------- */
.drop {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 140px; border: 2px dashed var(--line); border-radius: var(--radius);
  cursor: pointer; font-size: 1rem; color: var(--text);
}
.drop:hover, .drop.over { border-color: var(--gold); background: rgba(242,193,78,.06); }
code { background: var(--bg-2); padding: 1px 6px; border-radius: 4px; font-size: .85em; word-break: break-all; }

/* --- Navigation : défile horizontalement sur petit écran ------------- */
@media (max-width: 900px) {
  .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; order: 3; flex-basis: 100%; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

/* --- Logistique ------------------------------------------------------ */
.flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
        padding: 10px 0; border-bottom: 1px solid var(--line); }
.flow:last-child { border-bottom: 0; }
.flow-from, .flow-to { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-from { justify-content: flex-end; }
.flow-res { text-align: center; white-space: nowrap; }
.flow-res .arrow { display: block; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.chip { text-decoration: none; font-size: .8rem; padding: 2px 10px; border-radius: 999px;
        background: color-mix(in srgb, var(--t1) 45%, var(--panel-2)); border: 1px solid var(--t2); }
@media (max-width: 600px) {
  .flow { grid-template-columns: 1fr; text-align: center; }
  .flow-from, .flow-to { justify-content: center; }
}

/* --- Familiers ------------------------------------------------------- */
.pet-card { position: relative; text-align: center; }
.pet-num { position: absolute; top: 10px; left: 14px; color: var(--muted); font-family: var(--font-title); }
.pet-icon { font-size: 3rem; line-height: 1.2; }

/* --- Journal --------------------------------------------------------- */
.timeline { list-style: none; padding: 0 0 40px; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 0; bottom: 40px; width: 2px; background: var(--line); }
.tl-day { margin: 20px 0 8px 44px; color: var(--muted); text-transform: capitalize; font-size: .85rem; letter-spacing: .05em; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 6px 0; }
.tl-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line);
           display: flex; align-items: center; justify-content: center; z-index: 1; }
.tl-item.big .tl-icon { border-color: var(--gold); box-shadow: 0 0 12px rgba(242,193,78,.4); }
.tl-shot { display: block; margin-top: 8px; max-width: min(480px, 100%); border-radius: 10px; border: 1px solid var(--line); }

/* --- Stats ----------------------------------------------------------- */
.hbar { display: grid; grid-template-columns: minmax(90px, 35%) 1fr 3em; gap: 8px; align-items: center; padding: 4px 0; font-size: .88rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--bg); border-radius: 0 4px 4px 0; }
.hbar-track > span { display: block; height: 100%; background: var(--t2); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Succès ---------------------------------------------------------- */
.ach-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); padding-bottom: 40px; }
.ach { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--panel);
       border: 1px solid var(--line); opacity: .75; }
.ach.on { opacity: 1; border-color: var(--gold); background: linear-gradient(120deg, rgba(242,193,78,.12), var(--panel) 60%); }
.ach-icon { font-size: 2rem; filter: grayscale(1); }
.ach.on .ach-icon { filter: none; }
.ach-body { flex: 1; min-width: 0; }

/* --- Détecteur de puissance (accueil) -------------------------------- */
.scouter {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(34,197,94,.10), var(--panel) 60%);
  border: 1px solid rgba(34,197,94,.45); border-radius: var(--radius); padding: 16px 20px; margin: 4px 0 24px;
}
.scouter[hidden] { display: none; }
.scouter-lens {
  width: 74px; height: 56px; flex: none; border-radius: 10px 30px 10px 30px;
  background: radial-gradient(circle at 30% 35%, rgba(255,255,255,.6), rgba(34,197,94,.75) 30%, rgba(12,80,40,.9));
  box-shadow: 0 0 18px rgba(34,197,94,.6); position: relative; overflow: hidden;
}
.scouter-lens::after { content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.18) 3px 4px); animation: scan 2s linear infinite; }
@keyframes scan { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
.scouter-value { font-family: "Courier New", monospace; font-size: 2.2rem; color: #6ef59a; text-shadow: 0 0 10px rgba(34,197,94,.7); line-height: 1; }
.scouter-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.scouter-alert { font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; color: #ffd84a;
                 text-shadow: 0 0 12px rgba(255,120,0,.8); animation: shake .4s ease-in-out 3; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px) rotate(-1deg); } 75% { transform: translateX(4px) rotate(1deg); } }

/* --- Habillage anime : motifs de fond et emblèmes animés ------------- */
.theme-jjk .card-art, .theme-jjk.hero, .theme-jjk .hero {   /* extension de territoire : anneaux */
  background-image: repeating-radial-gradient(circle at 78% 50%, transparent 0 14px, rgba(224,49,94,.10) 14px 16px),
                    linear-gradient(135deg, var(--t1) 0%, #120a24 100%); }
.theme-dbz .card-art, .theme-dbz.hero, .theme-dbz .hero {   /* rayons d'énergie */
  background-image: repeating-conic-gradient(from 0deg at 78% 50%, rgba(255,214,80,.14) 0 6deg, transparent 6deg 18deg),
                    linear-gradient(135deg, var(--t1) 0%, #7a2e06 100%); }
.theme-aot .card-art, .theme-aot.hero, .theme-aot .hero {   /* toile des capes */
  background-image: repeating-linear-gradient(45deg, rgba(216,201,163,.07) 0 2px, transparent 2px 9px),
                    linear-gradient(135deg, var(--t1) 0%, #13261a 100%); }
.theme-fma .card-art, .theme-fma.hero, .theme-fma .hero {   /* cercles à la craie */
  background-image: radial-gradient(circle at 78% 50%, transparent 38px, rgba(217,166,43,.18) 39px 40px, transparent 41px),
                    radial-gradient(circle at 78% 50%, transparent 52px, rgba(217,166,43,.12) 53px 54px, transparent 55px),
                    linear-gradient(135deg, var(--t1) 0%, #3d0b0d 100%); }
.theme-slime .card-art, .theme-slime.hero, .theme-slime .hero { /* bulles de slime */
  background-image: radial-gradient(circle at 20% 70%, rgba(127,227,245,.18) 0 10px, transparent 11px),
                    radial-gradient(circle at 45% 25%, rgba(127,227,245,.14) 0 6px, transparent 7px),
                    radial-gradient(circle at 60% 80%, rgba(127,227,245,.12) 0 4px, transparent 5px),
                    linear-gradient(135deg, var(--t1) 0%, #0b3c63 100%); }

.theme-slime .emblem { animation: wobble 3s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wobble { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.06, .93); } }
.theme-jjk .emblem { animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { filter: drop-shadow(0 0 4px rgba(224,49,94,.4)); } 50% { filter: drop-shadow(0 0 14px rgba(224,49,94,.9)); } }
.theme-dbz .emblem { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 0%,100% { filter: drop-shadow(0 0 4px rgba(255,170,40,.5)); } 50% { filter: drop-shadow(0 0 16px rgba(255,200,60,1)); } }
.theme-aot .emblem { animation: soar 4s ease-in-out infinite; }
@keyframes soar { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) {
  .emblem, .scouter-lens::after, .scouter-alert, .emblem animateTransform { animation: none !important; }
}
