/* ============================================================
   BREEDER — feuille de style
   Thème sombre "cozy", menu à gauche, chambre au centre.
   ============================================================ */

:root {
  --bg:        #14151c;
  --bg-soft:   #1d1f2a;
  --panel:     #242736;
  --panel-2:   #2c3044;
  --line:      #3a3f57;
  --text:      #e8eaf2;
  --muted:     #9aa0b8;
  --accent:    #ffca57;
  --accent-2:  #6c8cff;
  --radius:    14px;
  --sidebar-w: 200px;
  --topbar-h:  60px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #23263a, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 16px 12px; gap: 8px;
  z-index: 20;
}
.logo {
  font-size: 1.35rem; font-weight: 800; letter-spacing: .5px;
  margin-bottom: 14px; padding: 4px 6px;
}
.logo span { color: var(--accent); }
#sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav-btn {
  text-align: left; font-size: 1rem; font-weight: 600;
  color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 10px;
  padding: 11px 12px; cursor: pointer; transition: .15s;
}
.nav-btn:hover { background: var(--panel); color: var(--text); }
.nav-btn.active {
  background: var(--panel-2); color: var(--text);
  border-color: var(--line);
  box-shadow: inset 3px 0 0 var(--accent);
}
#reset-btn {
  margin-top: auto; font-size: .85rem; color: var(--muted);
  background: transparent; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; cursor: pointer;
}
#reset-btn:hover { color: #ff6b6b; border-color: #ff6b6b; }

/* ---- TOPBAR ---- */
#topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 24px;
  background: rgba(20,21,28,.7); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 15;
}
.wallet {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 18px;
  font-size: 1.25rem; font-weight: 800;
}
.coin-icon { font-size: 1.1rem; }
.rate {
  font-size: .8rem; font-weight: 700; color: #5ed88a;
  background: rgba(94,216,138,.12); padding: 2px 8px; border-radius: 999px;
}

/* ---- ZONE PRINCIPALE ---- */
#view {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 24px) 28px 40px;
  max-width: 1600px;
}
.view-head { margin-bottom: 20px; }
.view-head h2 { font-size: 1.6rem; }
.hint { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.hint a { color: var(--accent); }

/* ---- ART (image perso + fallback emoji) ---- */
.art {
  width: 150px; height: 150px; border-radius: 12px;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
/* cadrage sur le HAUT : on veut voir le visage, pas le torse (artworks plein pied) */
.art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.art-emoji { font-size: 4.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; }
.art.sm { width: 76px; height: 76px; }
.art.sm .art-emoji { font-size: 2.4rem; }
.art.big { width: 320px; height: 320px; }
.art.big .art-emoji { font-size: 9rem; }

/* ---- BADGE RARETÉ ---- */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  color: #14151c; padding: 2px 8px; border-radius: 999px;
}

/* ============================================================
   VUE CHAMBRE
   ============================================================ */
.room-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 2px dashed var(--line);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; transition: .15s;
  background: var(--bg-soft);
}
.slot.empty:hover { border-color: var(--accent-2); background: var(--panel); }
.slot.empty .plus { font-size: 2rem; color: var(--muted); }
.slot.targetable {
  border-color: var(--accent); border-style: solid;
  box-shadow: 0 0 0 3px rgba(255,202,87,.2);
}
.slot.filled {
  border: 2px solid var(--r, var(--line));
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  box-shadow: 0 0 22px -8px var(--r);
}
.slot.filled .art { width: 60%; height: 60%; }
.slot-info { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.slot-name { font-weight: 700; font-size: .82rem; }
.slot-lvl { font-size: .72rem; color: var(--muted); }
.slot-remove {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff;
  cursor: pointer; font-size: .8rem; opacity: 0; transition: .15s;
}
.slot.filled:hover .slot-remove { opacity: 1; }

/* Pièce flottante "+X" */
.float-coin {
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  color: #5ed88a; font-weight: 800; font-size: .85rem;
  pointer-events: none; animation: floatUp 1.2s ease-out forwards;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 8px); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -28px); }
}

/* Panneau de placement */
.placement-panel {
  margin-top: 20px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.placement-panel.hidden { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head button { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 12px; }
.mini-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-soft); border: 2px solid var(--r,var(--line));
  border-radius: 12px; padding: 10px 6px; cursor: pointer;
  color: var(--text); font-size: .8rem; transition: .15s;
}
.mini-card:hover { transform: translateY(-2px); }
.mini-card.in-room { opacity: .5; }
.mini-card small { color: var(--muted); font-size: .7rem; }
.empty-note { color: var(--muted); text-align: center; padding: 12px; }

/* ============================================================
   VUE BOUTIQUE
   ============================================================ */
.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 16px;
}
.spawner {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-top: 3px solid var(--t);
  border-radius: var(--radius); padding: 20px 18px; text-align: center;
}
.spawner.locked { opacity: .6; }
.spawner-emoji { font-size: 3rem; }
.spawner h3 { margin: 8px 0 2px; font-size: 1.1rem; }
.spawner-collect { color: var(--muted); font-size: .82rem; margin-bottom: 14px; }
.buy-btn {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: var(--accent); color: #1a1a1a; font-weight: 800;
  font-size: .95rem; cursor: pointer; transition: .15s;
}
.buy-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.buy-btn:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
.lock-note { color: var(--muted); font-size: .85rem; padding: 10px 0; }

/* Résultat de tirage */
.roll-result { margin-top: 22px; }
.roll-result.hidden { display: none; }
.roll-result.show { display: block; animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.roll-card {
  display: flex; gap: 18px; align-items: center;
  background: var(--panel); border: 2px solid var(--r);
  border-radius: var(--radius); padding: 18px;
  box-shadow: 0 0 30px -10px var(--r);
}
.new-tag { color: var(--accent); font-weight: 800; font-size: .8rem; letter-spacing: 1px; }
.dup-tag { color: var(--muted); font-weight: 700; font-size: .8rem; }
.roll-info h3 { margin: 4px 0 6px; font-size: 1.3rem; }
.flavor { color: var(--muted); font-size: .85rem; margin-top: 8px; font-style: italic; }

/* ============================================================
   VUE ALMANACH / DEX
   ============================================================ */
.dex-type { margin: 22px 0 12px; font-size: 1.15rem;
  padding-left: 10px; border-left: 3px solid var(--t); }
.dex-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 20px;
}
.dex-card {
  background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--r, var(--line));
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
/* L'image remplit toute la largeur de la carte -> beaucoup plus grande */
.dex-card .art { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.dex-card .art-emoji { font-size: 6rem; }
.dex-card.locked { opacity: .45; filter: grayscale(1); }
.dex-name { font-weight: 700; font-size: 1.08rem; }
.dex-meta { display: flex; gap: 12px; font-size: .78rem; color: var(--muted); }
.xp-bar { width: 100%; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.xp-bar div { height: 100%; background: var(--accent-2); }

/* ============================================================
   VUE MISSIONS
   ============================================================ */
.mission-list { display: flex; flex-direction: column; gap: 12px; }

/* --- Missions périodiques (quotidiennes / hebdo) --- */
.pmission-block { margin-bottom: 20px; }
.pmission-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pmission-head h3 { margin: 0; font-size: 1.05rem; }
.pmission-timer { font-size: .82rem; opacity: .75; white-space: nowrap; }
.pm-badge { display: inline-block; margin-left: 6px; font-size: .72rem; font-weight: 700; vertical-align: middle;
  background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; }
.pmission-sep { margin: 8px 0 12px; font-size: 1.05rem; opacity: .9; }
.pm-flash { animation: pmFlash 1.4s ease-out 1; }
@keyframes pmFlash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  30% { box-shadow: 0 0 22px -4px var(--accent); border-color: var(--accent); }
}

/* --- Améliorations de la chambre --- */
.room-upg-btn {
  margin-top: 10px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; border: none; font-weight: 700; font-size: .9rem;
}
.room-upg-btn:hover { filter: brightness(1.08); }
.ru-intro { margin: 4px 2px 12px; font-size: .9rem; opacity: .9; }
.ru-list { display: flex; flex-direction: column; gap: 12px; }
.ru-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.ru-item.maxed { opacity: .7; }
.ru-ico { font-size: 1.9rem; flex: 0 0 auto; width: 40px; text-align: center; }
.ru-body { flex: 1; min-width: 0; }
.ru-title { font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ru-lvl { font-size: .78rem; opacity: .7; font-weight: 600; }
.ru-desc { margin: 3px 0 4px; font-size: .84rem; opacity: .85; }
.ru-eff { display: block; margin-bottom: 6px; font-size: .8rem; opacity: .9; }
.ru-buy { flex: 0 0 auto; }
.ru-buy button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.1;
  padding: 8px 12px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; font-size: .85rem;
  background: var(--accent); color: #fff; min-width: 92px;
}
.ru-buy button span { font-size: .78rem; font-weight: 600; opacity: .95; }
.ru-buy button:disabled { background: var(--line); color: var(--text, #e8e9f0); opacity: .55; cursor: not-allowed; }
.mission {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.mission.ready { border-color: var(--accent); box-shadow: 0 0 20px -10px var(--accent); }
.mission.done { opacity: .6; }
.mission-main { flex: 1; }
.mission-title { font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.unlock-chip { font-size: .68rem; font-weight: 700; color: #14151c; padding: 2px 8px; border-radius: 999px; }
.mission-desc { color: var(--muted); font-size: .85rem; margin: 4px 0 8px; }
.prog-bar { height: 7px; background: var(--bg); border-radius: 999px; overflow: hidden; max-width: 320px; }
.prog-bar div { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.mission-main small { color: var(--muted); font-size: .75rem; }
.mission-reward { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.mission-reward span { font-weight: 800; }
.mission-reward button {
  padding: 8px 16px; border: none; border-radius: 8px;
  background: var(--accent); color: #1a1a1a; font-weight: 700; cursor: pointer;
}
.mission-reward button:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 20px; font-weight: 600; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 760px) {
  :root { --sidebar-w: 64px; }
  .logo span, .nav-btn { font-size: 0; }
  .nav-btn { text-align: center; }
  .room-grid { grid-template-columns: repeat(2, 1fr); }
  .dex-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .slot.filled { min-height: 220px; }
}

/* ============================================================
   AJOUTS v2 : humeur, jauges, nourrir, expéditions, inventaire, modales
   ============================================================ */

/* --- Chambre : la carte pleine s'adapte à son contenu --- */
.slot.filled {
  aspect-ratio: auto; min-height: 320px;
  padding: 12px 10px 10px; gap: 6px; justify-content: flex-start;
}
/* image du perso placé : remplit la largeur de l'emplacement */
.slot.filled .art { width: 100%; height: auto; aspect-ratio: 1 / 1; margin-top: 2px; }
.mood { position: absolute; top: 8px; left: 10px; font-size: 1.5rem; line-height: 1; z-index: 2; }
.slot-bars { width: 100%; display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.stat-bar { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.stat-bar > div { height: 100%; transition: width .3s; }
.stat-bar.aff > div { background: #ff7597; }
.stat-bar.hun > div { background: #ffb74d; }
.stat-bar.xp  > div { background: var(--accent-2); }
.stat-bar.prog > div { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.feed-btn {
  width: 100%; margin-top: 4px; padding: 6px; border: none; border-radius: 8px;
  background: var(--panel-2); color: var(--text); font-weight: 700; font-size: .78rem;
  cursor: pointer; transition: .15s;
}
.feed-btn:hover { background: var(--line); }
.mini-card.busy, .mini-card:disabled { opacity: .4; cursor: not-allowed; }
.mini-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,202,87,.25); }

/* --- Modale générique --- */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; width: min(560px, 100%); max-height: 85vh; overflow: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 1.1rem; }
.modal-head button { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }

/* --- Nourrir --- */
.feed-fav { color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
.food-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 10px; }
.food-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 8px; cursor: pointer; color: var(--text); transition: .15s;
}
.food-card:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.food-card.fav { border-color: #ff7597; box-shadow: 0 0 14px -6px #ff7597; }
.food-emoji { font-size: 1.8rem; }
.food-card small { color: var(--muted); font-size: .72rem; }
.food-card em { color: #ff7597; font-size: .7rem; font-style: normal; }

/* --- Expéditions --- */
.exp-list { display: flex; flex-direction: column; gap: 14px; }
.exp-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.exp-card.locked { opacity: .55; }
.exp-emoji { font-size: 2.6rem; }
.exp-body { flex: 1; }
.exp-body h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exp-meta { color: var(--muted); font-size: .82rem; margin: 6px 0 10px; }
.exp-active { display: flex; align-items: center; gap: 14px; }
.exp-team { font-size: 1.4rem; }
.exp-countdown {
  font-weight: 800; color: var(--accent); background: rgba(255,202,87,.12);
  padding: 6px 14px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.buy-btn.ghost { background: var(--panel-2); color: var(--text); }
.buy-btn.ghost:hover { background: var(--line); }

/* --- Récompenses --- */
.reward-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.reward {
  display: flex; align-items: center; gap: 8px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-weight: 700;
}
.reward-emoji { font-size: 1.4rem; }

/* --- Inventaire --- */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 12px; margin-bottom: 10px; }
.inv-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; text-align: center;
}
.inv-emoji { font-size: 2rem; }
.inv-name { font-weight: 700; font-size: .85rem; }
.inv-qty { color: var(--accent); font-weight: 800; }
.inv-card small { color: var(--muted); font-size: .72rem; }

/* --- Évolution (dex) --- */
.evolve-btn {
  margin-top: 6px; width: 100%; padding: 8px; border: none; border-radius: 8px;
  background: linear-gradient(90deg, #9c27b0, #e040fb); color: #fff; font-weight: 800;
  font-size: .8rem; cursor: pointer; transition: .15s;
}
.evolve-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.evo-note { margin-top: 6px; font-size: .74rem; color: var(--muted); }

/* ============================================================
   AJOUTS v3 : fiche personnage, inventaire cliquable, équipe
   ============================================================ */
.clickable { cursor: pointer; }
.dex-card.clickable:hover { border-color: var(--accent); transform: translateY(-2px); transition: .15s; }
.inv-card.clickable:hover { border-color: var(--accent-2); transform: translateY(-2px); transition: .15s; }
.use-hint { color: var(--muted); font-size: .68rem; font-style: normal; margin-top: 2px; }

/* Puissance d'équipe (modale expédition) */
.team-power { color: var(--accent); font-weight: 700; margin: 4px 0 12px; }

/* Fiche personnage */
.char-modal { display: flex; flex-direction: column; gap: 16px; }
.char-head { display: flex; gap: 16px; align-items: flex-start; }
.char-id { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.char-mood { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.char-mood span { font-size: .95rem; color: var(--muted); }
.lic-chip { display: inline-block; font-size: .72rem; font-weight: 700; color: #14151c; padding: 2px 8px; border-radius: 999px; }
.char-status { color: var(--muted); font-size: .85rem; }
.char-stats { display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cs-row { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.cs-row:first-child { margin-top: 0; }
.cs-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cs-list > div { flex: 1; min-width: 120px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.cs-list b { font-size: .72rem; color: var(--muted); font-weight: 600; }
.cs-list span { font-weight: 800; }
.char-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.char-actions .buy-btn { width: auto; flex: 1; min-width: 140px; }
.char-actions .evolve-btn { width: 100%; }

/* ============================================================
   AJOUTS v4 : event, tri Almanach, Atelier, Options, tutoriel, disclaimer
   ============================================================ */

/* Bandeau d'event (topbar) */
#topbar { justify-content: space-between; gap: 12px; }
.event-banner {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: color-mix(in srgb, var(--e, #ffca57) 18%, var(--panel));
  border: 1px solid var(--e, #ffca57); border-radius: 999px;
  padding: 6px 14px; font-weight: 700; font-size: .85rem; max-width: 60%;
}
.event-banner.hidden { display: none; }
.event-banner .ev-emoji { font-size: 1.1rem; }
.event-banner .ev-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-banner .ev-timer {
  background: var(--e, #ffca57); color: #14151c; font-weight: 800;
  padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
@media (max-width: 620px) { .event-banner .ev-name { display: none; } }

/* Contrôles de tri de l'Almanach */
.dex-controls { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.dex-controls label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
.dex-controls select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: .9rem; cursor: pointer;
}
.dex-type small { color: var(--muted); font-weight: 500; }

/* Boutons variantes */
.buy-btn.sm { width: auto; padding: 7px 12px; font-size: .82rem; margin-top: 4px; }
.buy-btn.danger { background: #ef5350; color: #fff; }
.buy-btn.danger:hover { filter: brightness(1.1); }
.inv-card.dim { opacity: .55; }

/* Options : statistiques */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; margin-bottom: 8px; }
.stat-tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 2px;
}
.stat-tile b { font-size: 1.3rem; }
.stat-tile span { color: var(--muted); font-size: .8rem; }

/* Options : rapports + sauvegarde */
.report-form { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.report-form select, .report-form textarea, .save-box {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; font-family: inherit; font-size: .9rem; resize: vertical;
}
.report-form .buy-btn { width: auto; align-self: flex-start; }
.save-box { width: 100%; max-width: 640px; word-break: break-all; }
.opt-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.opt-row .buy-btn { width: auto; }

/* Tutoriel */
.tuto-step { text-align: center; display: flex; flex-direction: column; gap: 12px; }
.tuto-icon { font-size: 3.2rem; }
.tuto-step h3 { font-size: 1.3rem; }
.tuto-step p { color: var(--muted); line-height: 1.5; }
.tuto-step p b { color: var(--text); }
.tuto-dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }
.tuto-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tuto-dots span.on { background: var(--accent); }
.tuto-nav { display: flex; justify-content: space-between; gap: 10px; }
.tuto-nav .buy-btn { width: auto; flex: 1; }

/* Disclaimer */
.disclaimer { display: flex; flex-direction: column; gap: 10px; }
.disclaimer p { line-height: 1.5; color: var(--muted); }
.disclaimer p b { color: var(--text); }

/* Bouton d'aide (sidebar) */
#help-btn {
  margin-top: auto; font-size: .85rem; color: var(--muted);
  background: transparent; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; cursor: pointer;
}
#help-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Contrôles de tri compacts (panneau de placement) */
.dex-controls.sm { gap: 10px; margin-bottom: 12px; }
.dex-controls.sm label { font-size: .72rem; }
.dex-controls.sm select { padding: 6px 8px; font-size: .82rem; }

/* ============================================================
   AJOUTS v5 : boutique multi-tirage (x1 / x5 / x10)
   ============================================================ */
.qty-select { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--muted); font-size: .9rem; }
.qty-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 16px; font-weight: 800; cursor: pointer; transition: .15s;
}
.qty-btn:hover { border-color: var(--accent-2); }
.qty-btn.active { background: var(--accent); color: #14151c; border-color: var(--accent); }

/* Résumé d'un tirage multiple */
.pull-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  align-items: baseline; margin-bottom: 12px;
}
.pull-head b { font-size: 1.05rem; }
.pull-head span { color: var(--muted); font-size: .85rem; }
.pull-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }
.pull-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--bg-soft); border: 2px solid var(--r, var(--line)); border-radius: 12px;
  padding: 12px 8px; text-align: center; box-shadow: 0 0 16px -10px var(--r);
}
.pull-card.is-new { animation: pop .35s ease; }
.pull-name { font-weight: 700; font-size: .82rem; }
.pull-new {
  position: absolute; top: -8px; right: -6px;
  background: var(--accent); color: #14151c; font-size: .6rem; font-weight: 800; font-style: normal;
  padding: 2px 6px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* ============================================================
   AJOUTS v6 : Atelier (recettes/coûts), sous-titres de forge
   ============================================================ */
.forge-lic { margin: 16px 0 8px; font-size: 1rem; padding-left: 8px; border-left: 3px solid var(--t); }
.craft-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px;
}
.craft-card.dim { opacity: .6; }
.craft-card .inv-emoji { font-size: 2rem; }
.craft-card .inv-name { font-weight: 700; font-size: .85rem; }
.craft-card small { color: var(--muted); font-size: .72rem; }
.recipe { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0; }
.cost {
  font-size: .72rem; font-weight: 700; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; white-space: nowrap;
}
.cost.miss { color: #ff6b6b; border-color: #ff6b6b; }

/* ============================================================
   AJOUTS v7 : quotidienne, résumé hors-ligne, progression déblocage
   ============================================================ */
.exp-card.daily {
  border: 1px solid var(--t, var(--accent));
  background: linear-gradient(180deg, color-mix(in srgb, var(--t,#ffca57) 12%, var(--panel)), var(--panel));
  box-shadow: 0 0 24px -12px var(--t, var(--accent));
}
.exp-card.daily h3 { color: var(--text); }

.offline { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.offline-icon { font-size: 3rem; }
.offline p { color: var(--muted); line-height: 1.5; }
.offline p b { color: var(--text); }
.offline-gain {
  font-size: 1.8rem; font-weight: 900; color: var(--accent);
  background: rgba(255,202,87,.12); padding: 10px 24px; border-radius: 12px;
}
.offline .buy-btn { width: auto; }

/* Progression de déblocage sous un spawner verrouillé */
.spawner .lock-note + .stat-bar { margin-top: 8px; }

/* ============================================================
   Retour au site ldmstreaming (discret, bas de la sidebar)
   ============================================================ */
#help-btn { margin-top: auto; }   /* garde l'aide en bas, le retour juste dessous */
#site-back {
  display: block; text-align: center; text-decoration: none;
  margin-top: 8px; padding: 6px; font-size: .72rem; letter-spacing: .04em;
  color: var(--muted); border-radius: 8px; transition: .15s; opacity: .7;
}
#site-back:hover { opacity: 1; color: var(--text); background: var(--panel); }

/* Statut de sauvegarde (cloud Twitch / local) — Options */
.cloud-status {
  font-size: .85rem; line-height: 1.5; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px; max-width: 640px;
}
.cloud-status.on { border-color: #7ec8ff; color: var(--text); background: rgba(126,200,255,.08); }
.cloud-status a { color: var(--accent); }

/* ============================================================
   Changelog / version
   ============================================================ */
#version-tag {
  background: transparent; border: none; color: var(--muted);
  font-size: .7rem; letter-spacing: .05em; cursor: pointer; padding: 4px 6px;
  margin-top: 6px; text-align: center; opacity: .6; transition: .15s;
}
#version-tag:hover { opacity: 1; color: var(--accent); }

.changelog { display: flex; flex-direction: column; gap: 14px; }
.cl-intro { color: var(--muted); font-size: .9rem; }
.cl-entry { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.cl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cl-ver { font-weight: 800; color: var(--accent); background: rgba(255,202,87,.12); padding: 2px 10px; border-radius: 999px; font-size: .85rem; }
.cl-title { font-weight: 700; }
.cl-date { margin-left: auto; color: var(--muted); font-size: .75rem; }
.cl-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.cl-list li { color: var(--text); font-size: .88rem; line-height: 1.45; }
.changelog .buy-btn { width: auto; align-self: center; margin-top: 4px; }

/* Écran de bannissement */
.ban-screen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  padding: 24px; background: var(--bg);
}
.ban-screen .ban-emoji { font-size: 4rem; }
.ban-screen h1 { font-size: 2rem; color: #ff6b6b; }
.ban-screen p { color: var(--muted); max-width: 460px; }
.ban-screen .buy-btn { width: auto; margin-top: 10px; text-decoration: none; }
.ban-screen .ban-reason {
  background: rgba(255,107,107,.1); border: 1px solid #ff6b6b55; border-radius: 10px;
  padding: 10px 16px; max-width: 460px;
}
.ban-screen .ban-reason span {
  display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: #ff6b6b; margin-bottom: 4px;
}
.ban-screen .ban-reason p { color: var(--text); margin: 0; }

/* Avertissements (Options) */
.warn-list { display: flex; flex-direction: column; gap: 8px; }
.warn-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255,183,77,.08); border: 1px solid #ffb74d44;
  border-radius: 10px; padding: 10px 12px;
}
.warn-item .warn-ico { font-size: 1.3rem; }
.warn-item p { margin: 0 0 2px; }

/* Classement des amis */
.lb-list { display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 10px; background: var(--bg-soft, rgba(255,255,255,.04));
  border: 1px solid var(--line, rgba(255,255,255,.08));
}
.lb-row.me { border-color: var(--accent, #ffca57); background: rgba(255,202,87,.08); }
.lb-rank { font-size: 1.1rem; min-width: 34px; text-align: center; }
.lb-name { flex: 1; font-weight: 600; }
.lb-stat { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Bouton "cacher" d'une mission */
.mission-hide {
  background: transparent; border: 1px solid var(--line, rgba(255,255,255,.15));
  border-radius: 6px; cursor: pointer; font-size: .8rem; padding: 2px 6px;
  margin-top: 4px; opacity: .55; transition: opacity .15s;
}
.mission-hide:hover { opacity: 1; }

/* ============================================================
   FUSION (Danse Metamoran)
   ============================================================ */
.fusion-stage {
  display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; margin-bottom: 20px;
}
@media (min-width: 680px) { .fusion-stage { grid-template-columns: 1fr 1.1fr 1fr; } }
.fusion-slot {
  display: grid; align-content: center; justify-items: center; gap: 4px;
  min-height: 130px; padding: 16px; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 16px; background: var(--bg-soft, rgba(255,255,255,.03));
  color: var(--text); transition: border-color .15s, transform .1s;
}
.fusion-slot:hover { border-color: var(--accent, #ffca57); }
.fusion-slot.filled { border-style: solid; }
.fusion-slot .fus-em { font-size: 2.4rem; line-height: 1; }
.fusion-slot .fus-nm { font-weight: 700; }
.fusion-slot small { color: var(--muted); }
.fusion-mid { display: grid; align-content: center; gap: 8px; padding: 6px; }
.gauge-wrap { display: grid; gap: 4px; justify-items: center; }
.fusion-gauge { width: 100%; height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fusion-gauge > i { display: block; height: 100%; background: linear-gradient(90deg, #4f89ff, #2fd39a); transition: width .3s; }
.fusion-cost { text-align: center; font-size: .9rem; }
.fusion-cost small { color: var(--muted); }
.fusion-manual { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: .82rem; color: var(--muted); cursor: pointer; }
.fuse-go {
  border: none; border-radius: 12px; padding: 12px 18px; font-weight: 800; letter-spacing: .04em; cursor: pointer;
  color: #fff; background: conic-gradient(from 210deg, #4f89ff, #ffb020, #4f89ff);
  box-shadow: 0 8px 22px rgba(255,176,32,.35);
}
.fuse-go:disabled { filter: grayscale(.7) brightness(.8); cursor: not-allowed; box-shadow: none; }
.mini.warn { color: #ffab6b; text-align: center; }
.fusion-preview { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.fusion-preview .fp { font-size: .74rem; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.fusion-preview .fp.win { color: #2fd39a; border-color: #2fd39a55; }
.fusion-preview .fp.fat { color: #e878b3; border-color: #e878b355; }
.fusion-preview .fp.thin { color: #93a3c1; border-color: #93a3c155; }

/* Codex */
.codex-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.codex-card {
  text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--bg-soft, rgba(255,255,255,.03)); border: 1px solid var(--line); color: var(--text);
  display: grid; gap: 3px;
}
.codex-card:hover { border-color: var(--accent, #ffca57); }
.codex-card.done { border-color: #2fd39a66; background: rgba(47,211,154,.08); }
.codex-pair { font-size: 1.2rem; }
.codex-win { font-size: .82rem; font-weight: 600; }
.codex-win:not(.ok) { color: var(--muted); }
.codex-fails { display: flex; gap: 6px; font-size: .9rem; }
.codex-fails span { opacity: .3; filter: grayscale(1); }
.codex-fails span.ok { opacity: 1; filter: none; }

/* Sélecteur de fusionnant */
.pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pick-char {
  display: grid; justify-items: center; gap: 2px; padding: 12px 8px; cursor: pointer;
  background: var(--bg-soft, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
}
.pick-char:hover { border-color: var(--accent, #ffca57); }
.pick-char.dim { opacity: .5; }
.pick-char .pick-em { font-size: 1.8rem; }
.pick-char .pick-nm { font-weight: 600; font-size: .85rem; text-align: center; }
.pick-char small { color: var(--muted); font-size: .7rem; text-align: center; }
.pick-sep { grid-column: 1/-1; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; }

/* Révélation animée */
.fusion-reveal { text-align: center; min-height: 240px; display: grid; place-items: center; }
.fr-dance { position: relative; height: 110px; display: flex; align-items: center; justify-content: center; gap: 44px; font-size: 3rem; }
.fusion-reveal.revealed .fr-dance { display: none; }
.fusion-reveal.dancing .fr-a { animation: frDanceA .8s ease-in-out infinite alternate; }
.fusion-reveal.dancing .fr-b { animation: frDanceB .8s ease-in-out infinite alternate; }
@keyframes frDanceA { from { transform: translateX(0) rotate(-10deg); } to { transform: translateX(26px) rotate(10deg); } }
@keyframes frDanceB { from { transform: translateX(0) rotate(10deg); } to { transform: translateX(-26px) rotate(-10deg); } }
.fr-flash { position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(255,220,120,.7), transparent 70%); opacity: 0; }
.fusion-reveal.dancing .fr-flash { animation: frFlash 1.5s ease-in forwards; }
@keyframes frFlash { 0%,58% { opacity: 0; transform: scale(0); } 84% { opacity: 1; transform: scale(26); } 100% { opacity: 0; transform: scale(32); } }
.fr-result { opacity: 0; transform: scale(.82); transition: opacity .4s ease, transform .4s ease; pointer-events: none; display: grid; gap: 14px; justify-items: center; }
.fusion-reveal.revealed .fr-result { opacity: 1; transform: scale(1); pointer-events: auto; }
.fr-card { border: 2px solid var(--r, #888); border-radius: 16px; padding: 16px; display: flex; gap: 14px; align-items: center; text-align: left; max-width: 420px; }
.fusion-reveal.win.revealed .fr-card { box-shadow: 0 0 34px color-mix(in srgb, var(--r) 55%, transparent); animation: frWin 1.4s ease infinite; }
@keyframes frWin { 0%,100% { box-shadow: 0 0 24px color-mix(in srgb, var(--r) 40%, transparent); } 50% { box-shadow: 0 0 52px color-mix(in srgb, var(--r) 80%, transparent); } }
.fusion-reveal.fat.revealed .fr-card, .fusion-reveal.thin.revealed .fr-card { opacity: .96; }
.fr-tag { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--accent, #ffca57); display: block; margin-bottom: 2px; }
.fusion-reveal.fat .fr-tag { color: #e878b3; } .fusion-reveal.thin .fr-tag { color: #93a3c1; }
.fr-info h3 { margin: 2px 0 4px; }
@media (prefers-reduced-motion: reduce) {
  .fusion-reveal.dancing .fr-a, .fusion-reveal.dancing .fr-b, .fusion-reveal.dancing .fr-flash,
  .fusion-reveal.win.revealed .fr-card { animation: none; }
}

/* ============================================================
   Notifications (event lancé, nouvelle version) + bandeau spécial
   ============================================================ */
.notif-event { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.notif-event .notif-emoji { font-size: 3.4rem; }
.notif-event h3 { font-size: 1.35rem; color: var(--e, var(--accent)); }
.notif-event p { color: var(--muted); max-width: 460px; }
.notif-event .notif-eff { color: var(--e, var(--accent)); font-weight: 700; }
.notif-event .buy-btn { width: auto; }

.event-banner.special { animation: pulseGlow 1.6s ease-in-out infinite; }
.event-banner .ev-tag {
  background: var(--e, #ffca57); color: #14151c; font-size: .6rem; font-weight: 800;
  padding: 2px 6px; border-radius: 999px; letter-spacing: .04em;
}
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 14px -2px var(--e, #ffca57); }
}

/* ============================================================
   Amis
   ============================================================ */
.friend-add { display: flex; gap: 10px; margin-bottom: 18px; max-width: 480px; }
.friend-add input {
  flex: 1; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: .95rem;
}
.friend-add .buy-btn { width: auto; }
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 12px; margin-bottom: 10px; }
.friend-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px;
}
.friend-av img, .friend-noav {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
  background: var(--panel-2); border: 2px solid var(--accent-2);
}
.friend-name { font-weight: 700; font-size: .9rem; }
.friend-stat { color: var(--muted); font-size: .72rem; }
.friend-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.friend-card .buy-btn.sm { width: auto; padding: 5px 10px; font-size: .75rem; }

/* ============================================================
   Aide contextuelle (petits "?")
   ============================================================ */
.help-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; vertical-align: middle;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  font-size: .72rem; font-weight: 800; cursor: help; padding: 0; line-height: 1;
  margin-left: 4px; transition: .15s;
}
.help-dot:hover { background: var(--accent); color: #14151c; border-color: var(--accent); }
h2 .help-dot { width: 20px; height: 20px; font-size: .8rem; }

/* ============================================================
   Amis interactifs : chat, cadeaux, visite
   ============================================================ */
.gift-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(255,202,87,.12); border: 1px solid var(--accent);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600;
}
.gift-banner .buy-btn { width: auto; }
.friend-del { margin-top: 4px; font-size: .68rem; padding: 3px 8px; }
.chat-badge {
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px;
  background: #ff6b6b; color: #fff; border-radius: 999px; font-size: .62rem;
  font-weight: 800; margin-left: 2px; padding: 0 4px;
}
/* Chat */
.chat-log {
  display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto;
  padding: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
}
.chat-msg {
  align-self: flex-start; max-width: 80%; padding: 7px 11px; border-radius: 12px;
  background: var(--panel-2); font-size: .9rem; line-height: 1.35; word-break: break-word;
}
.chat-msg.mine { align-self: flex-end; background: var(--accent); color: #14151c; }
.chat-input { display: flex; gap: 8px; }
.chat-input input {
  flex: 1; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font-size: .9rem;
}
.chat-input .buy-btn { width: auto; }
/* Visite de chambre */
.visit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 10px; }
.visit-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--panel); border: 2px solid var(--r, var(--line)); border-radius: 12px; padding: 10px 6px;
}
.visit-card small { color: var(--muted); font-size: .72rem; }

/* ============================================================
   Collections (Sets)
   ============================================================ */
.set-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; margin-bottom: 10px; }
.set-card {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--t, var(--accent));
  border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.set-card.ready { border-color: var(--accent); box-shadow: 0 0 20px -10px var(--accent); }
.set-card.done { opacity: .7; }
.set-head { display: flex; align-items: center; gap: 12px; }
.set-emoji { font-size: 2rem; }
.set-title { flex: 1; display: flex; flex-direction: column; }
.set-title small { color: var(--muted); font-size: .74rem; }
.set-count { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.set-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.set-chip {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; font-size: 1rem;
}
.set-chip.miss { opacity: .3; filter: grayscale(1); }
.set-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.set-reward { font-weight: 700; font-size: .85rem; }
.set-foot .buy-btn { width: auto; }

/* ============================================================
   Pastille de notification sur l'onglet Amis
   ============================================================ */
.nav-btn { position: relative; }
.nav-badge {
  position: absolute; top: 6px; right: 8px;
  min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  background: #ff4f5e; color: #fff; border-radius: 999px;
  font-size: .68rem; font-weight: 800; text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
@media (max-width: 760px) { .nav-badge { top: 2px; right: 2px; } }

/* ============================================================
   TEMPS RÉEL — petites animations "vivantes"
   ============================================================ */
@keyframes cardPop   { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }
@keyframes badgePulse{ 0% { transform: scale(1); } 30% { transform: scale(1.55); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }

/* La pastille du menu Amis "sursaute" quand une notif arrive en direct */
.nav-badge.pulse { animation: badgePulse .5s ease; }

/* Une nouvelle demande d'ami surgit en douceur (au lieu d'apparaître d'un coup) */
.friend-grid.incoming .friend-card { animation: cardPop .34s ease both; }

/* La bannière "cadeaux en attente" pop à l'arrivée */
.gift-banner { animation: cardPop .4s ease both; }

/* ============================================================
   SÉLECTION D'ÉQUIPE D'EXPÉDITION
   Grille scrollable au centre ; recherche + bouton Lancer fixes.
   ============================================================ */
.team-select { display: flex; flex-direction: column; max-height: calc(85vh - 96px); }
.team-controls { flex: 0 0 auto; }
.team-controls .hint { margin: 0 0 8px; }
.team-search {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text, #e8e9f0); font-size: .9rem; margin-bottom: 8px;
}
.team-search:focus { outline: none; border-color: var(--accent); }
.team-quick { display: flex; gap: 8px; margin: 8px 0; }
.team-quick .buy-btn { flex: 1; margin: 0; }
.team-grid { flex: 1 1 auto; overflow-y: auto; margin: 4px 0; padding: 2px; min-height: 80px; }
.team-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line);
}
.team-foot .team-power { white-space: nowrap; font-size: .95rem; color: var(--muted); }
.team-foot .buy-btn { flex: 1; margin: 0; }

/* Zones d'entraînement : léger accent visuel pour les distinguer des expéditions */
.exp-card.training { border-left: 3px solid var(--accent-2); }

/* Barre de recherche partagée (Almanach, Inventaire, placement, collections…) */
.ctrl-search {
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text, #e8e9f0);
  font-size: .9rem; min-width: 180px; flex: 1 1 220px;
}
.ctrl-search::placeholder { color: var(--muted); }
.ctrl-search:focus { outline: none; border-color: var(--accent); }

/* Petit bouton "réinitialiser les filtres" partagé */
.ctrl-reset {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text, #e8e9f0); cursor: pointer;
  font-size: .95rem; line-height: 1;
}
.ctrl-reset:hover { border-color: var(--accent); }

/* Bouton "détails du butin" sur les cartes d'expédition */
.exp-details {
  align-self: flex-start; margin-top: 6px; padding: 3px 10px; border-radius: 8px; cursor: pointer;
  font-size: .76rem; color: var(--muted); background: transparent; border: 1px solid var(--line);
}
.exp-details:hover { color: var(--text, #e8e9f0); border-color: var(--accent); }

/* Liste détaillée du butin (popup) */
.loot-list { display: flex; flex-direction: column; gap: 6px; }
.loot-row {
  display: grid; grid-template-columns: 26px 1fr 70px 44px; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px; background: var(--bg-soft, rgba(255,255,255,.03));
  border: 1px solid var(--line);
}
.loot-row .loot-ic { font-size: 1.15rem; text-align: center; }
.loot-row .loot-nm { font-size: .9rem; }
.loot-row .loot-nm small { color: var(--muted); font-size: .68rem; margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }
.loot-row .loot-meta { font-family: var(--font-mono, monospace); font-size: .8rem; color: var(--muted); text-align: right; }
.loot-row .loot-meta.span2 { grid-column: 3 / 5; }
.loot-row .loot-bar { grid-column: 3; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.loot-row .loot-bar > i { display: block; height: 100%; border-radius: 99px; }
.loot-row .loot-bar > i.high { background: #2fd39a; }
.loot-row .loot-bar > i.mid { background: #ffb020; }
.loot-row .loot-bar > i.low { background: #e8709a; }
.loot-row .loot-ch { font-size: .82rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.loot-row .loot-ch.always { color: #2fd39a; font-size: .72rem; font-weight: 600; }

/* ============================================================
   TABLEAU DE BORD (accueil)
   ============================================================ */
.dash { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.dash-tag { font-family: var(--font-mono, monospace); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.dash-tag.sm { font-size: .62rem; }

/* Action principale */
.dash-primary {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent, #ffca57) 16%, var(--bg-soft, #1a2130)), var(--bg-soft, #1a2130));
  border: 1px solid color-mix(in srgb, var(--accent, #ffca57) 40%, var(--line));
  box-shadow: 0 6px 22px rgba(0,0,0,.18);
}
.dash-primary .dash-p-body { flex: 1; min-width: 0; }
.dash-primary h3 { margin: 3px 0 4px; font-size: 1.15rem; }
.dash-primary p { margin: 0; color: var(--text, #e8e9f0); opacity: .9; font-size: .92rem; }
.dash-go {
  flex-shrink: 0; border: none; border-radius: 12px; padding: 12px 18px; cursor: pointer;
  font-weight: 800; letter-spacing: .02em; color: #1a1200;
  background: linear-gradient(135deg, var(--accent, #ffca57), #ffb020);
  box-shadow: 0 6px 16px rgba(255,176,32,.32);
}
.dash-go:hover { filter: brightness(1.06); }
.dash-prog { margin-top: 8px; }
.dash-prog small { color: var(--muted); font-size: .74rem; }

/* Recommandations secondaires */
.dash-secondary { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .dash-secondary { grid-template-columns: 1fr 1fr; } }
.dash-sec {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--bg-soft, rgba(255,255,255,.04)); border: 1px solid var(--line);
}
.dash-sec-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-sec-body b { font-size: .9rem; }
.dash-sec-body small { color: var(--muted); font-size: .78rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-sec-btns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.dash-sec-go {
  border: 1px solid var(--accent, #ffca57); background: transparent; color: var(--accent, #ffca57);
  border-radius: 9px; padding: 7px 11px; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.dash-sec-go:hover { background: color-mix(in srgb, var(--accent, #ffca57) 15%, transparent); }
.dash-sec-x { border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: .85rem; padding: 4px 6px; border-radius: 6px; }
.dash-sec-x:hover { color: var(--text); }

/* Ligne favori + activités */
.dash-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .dash-row { grid-template-columns: 1.1fr 1fr; } }
.dash-fav {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; cursor: pointer;
  background: var(--bg-soft, rgba(255,255,255,.04));
  border: 1px solid color-mix(in srgb, var(--r, #888) 45%, var(--line));
}
.dash-fav.empty { cursor: default; border-style: dashed; }
.dash-fav-art { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.dash-fav-art .art { width: 56px; height: 56px; }
.dash-fav-art .art img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.dash-fav-mood { position: absolute; bottom: -4px; right: -4px; font-size: 1rem; }
.dash-fav-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-fav-info b { font-size: .98rem; }
.dash-fav-info .dash-lvl { color: var(--muted); font-weight: 600; font-size: .78rem; }
.dash-fav-lic { font-size: .74rem; font-weight: 600; }
.dash-fav-info small { color: var(--muted); font-size: .8rem; }

.dash-acts { display: flex; flex-direction: column; gap: 6px; justify-content: center;
  padding: 10px 12px; border-radius: 14px; background: var(--bg-soft, rgba(255,255,255,.04)); border: 1px solid var(--line); }
.dash-acts-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-act {
  border: 1px solid var(--line); background: transparent; color: var(--text, #e8e9f0);
  border-radius: 999px; padding: 6px 11px; font-size: .8rem; cursor: pointer;
}
.dash-act:hover { border-color: var(--accent, #ffca57); }

/* Résumé hors-ligne */
.off-sec { text-align: left; background: var(--bg-soft, rgba(255,255,255,.04)); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.off-sec b { display: block; margin-bottom: 2px; }
.off-sec ul { margin: 0; padding-left: 18px; }
.off-sec li { font-size: .88rem; }

/* ============================================================
   REFONTE NAVIGATION (v0.9.0) — 6 grands espaces + sous-nav + mobile
   ============================================================ */
:root { --subnav-h: 50px; }

/* --- Barre latérale --- */
#sidebar { padding: 14px 10px; gap: 6px; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.side-top .logo { margin: 0; font-size: 1.22rem; }
#sidebar-toggle {
  flex: 0 0 auto; width: 30px; height: 30px; cursor: pointer; transition: .15s;
  background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; font-size: .9rem;
}
#sidebar-toggle:hover { color: var(--text); border-color: var(--accent); }
#nav-main, #nav-bottom { display: flex; flex-direction: column; gap: 5px; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 5px; padding-top: 8px; }
.side-foot #help-btn { margin-top: 0; }

/* Boutons d'espace : icône + libellé + pastille */
.nav-btn { display: flex; align-items: center; gap: 11px; position: relative; }
.nav-ic { flex: 0 0 auto; width: 22px; text-align: center; font-size: 1.15rem; line-height: 1; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sidebar .nav-badge {
  position: static; margin-left: auto; top: auto; right: auto;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #191919; font-size: .68rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-badge[hidden] { display: none !important; }

/* --- Sous-navigation (barre fixe sous la topbar) --- */
#subnav {
  position: fixed; top: var(--topbar-h); left: var(--sidebar-w); right: 0; z-index: 14;
  background: rgba(20,21,28,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); overflow-x: auto; display: none;
}
body.has-subnav #subnav { display: block; }
.subnav-inner { display: flex; align-items: center; gap: 6px; padding: 7px 24px; min-height: var(--subnav-h); white-space: nowrap; }
.subnav-title { font-weight: 800; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; margin-right: 8px; }
.subnav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  border-radius: 999px; padding: 7px 15px; font-weight: 700; font-size: .9rem; cursor: pointer; transition: .15s;
}
.subnav-btn:hover { color: var(--text); background: var(--panel); }
.subnav-btn.active { color: #191919; background: var(--accent); border-color: var(--accent); }
.subnav-badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--accent-2); color: #fff; font-size: .64rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.subnav-badge[hidden] { display: none; }
body.has-subnav #view { padding-top: calc(var(--topbar-h) + var(--subnav-h) + 20px); }

/* --- Barre latérale réduite (desktop) --- */
body.sidebar-collapsed { --sidebar-w: 68px; }
body.sidebar-collapsed .side-top { flex-direction: column; gap: 8px; }
body.sidebar-collapsed .logo .nav-label,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed #version-tag,
body.sidebar-collapsed #site-back { display: none; }
body.sidebar-collapsed .nav-btn { justify-content: center; gap: 0; padding: 11px 6px; }
body.sidebar-collapsed .subnav-title { display: none; }
body.sidebar-collapsed #sidebar .nav-badge {
  position: absolute; top: 3px; right: 5px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px;
}
body.sidebar-collapsed #sidebar-toggle { transform: rotate(180deg); }

/* --- Navigation mobile (barre inférieure) --- */
.mobile-nav { display: none; }
#more-menu { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; display: flex; align-items: flex-end; }
.more-sheet {
  background: var(--panel); width: 100%; border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  animation: sheetUp .18s ease-out;
}
@keyframes sheetUp { from { transform: translateY(20px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
.more-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.more-head button { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.more-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); font-size: 1.05rem; font-weight: 600; padding: 13px 8px; border-radius: 10px; cursor: pointer;
}
.more-item:hover, .more-item:active { background: var(--panel-2); }

@media (max-width: 820px) {
  #sidebar { display: none; }
  #topbar { left: 0; }
  #subnav { left: 0; }
  #subnav .subnav-inner { padding-left: 16px; padding-right: 16px; }
  #view { margin-left: 0; padding-left: 16px; padding-right: 16px; padding-bottom: 88px; }
  body.has-subnav #view { padding-top: calc(var(--topbar-h) + var(--subnav-h) + 16px); }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--bg-soft); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .mobile-nav .nav-btn { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; border: none; background: transparent; box-shadow: none; }
  .mobile-nav .nav-btn.active { color: var(--accent); background: transparent; box-shadow: none; border: none; }
  .mobile-nav .nav-ic { width: auto; font-size: 1.3rem; }
  .mobile-nav .nav-label { flex: none; font-size: .6rem; font-weight: 700; }
  .mobile-nav .nav-badge {
    position: absolute; top: 2px; left: 50%; margin-left: 4px; right: auto;
    min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px;
    background: var(--accent); color: #191919; font-size: .6rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
  }
}
