/* ===== Valforge — Mondes PVE, Forge, Boss de serveur =====
   Feuille dédiée aux modules worlds.js / forge.js / event.js. S'appuie sur les
   variables et classes de style.css (.screen, .page-header, .btn, .stage-row,
   .roster, .hero-card, .overlay, .result-card, .stat-row). */

/* ---------- Paliers de matériaux (T1…T6) ---------- */
:root {
  --tier-1: #aeb5be; --tier-2: #58aee8; --tier-3: #a86be8; --tier-4: #ed6d71; --tier-5: #f2c65f; --tier-6: #7ff0e0;
}
.tier-1 { --tier: var(--tier-1); } .tier-2 { --tier: var(--tier-2); } .tier-3 { --tier: var(--tier-3); }
.tier-4 { --tier: var(--tier-4); } .tier-5 { --tier: var(--tier-5); } .tier-6 { --tier: var(--tier-6); }

/* ---------- Mondes ---------- */
.worlds-list { flex: 1; overflow-y: auto; padding: 4px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.world-card {
  border: 1px solid var(--card-edge); border-radius: 14px; background: var(--card); overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.world-card.expanded { border-color: var(--gold); box-shadow: 0 0 16px rgba(232, 195, 90, 0.18); }
.world-card.locked { opacity: 0.55; }
.world-card.done .world-progress i { background: linear-gradient(90deg, #7fd68a, #4ea85a); }
.world-head {
  display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; gap: 4px 12px; align-items: center;
  width: 100%; padding: 10px 12px; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.world-head:disabled { cursor: default; }
.world-boss { grid-row: 1 / 3; width: 56px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid #ffffff22; background: #000; }
.world-boss img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.world-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.world-copy small { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.06em; }
.world-copy b { font-size: 1rem; }
.world-state { grid-row: 1 / 3; font-size: 1.1rem; color: var(--gold); }
.world-progress { grid-column: 2 / 4; height: 5px; border-radius: 3px; background: #ffffff14; overflow: hidden; }
.world-progress i { display: block; height: 100%; background: linear-gradient(90deg, #f0d075, #c99a2e); transition: width 0.4s; }
.world-desc { padding: 0 12px 8px; color: var(--muted); font-size: 0.78rem; }
.world-desc b { color: var(--gold); }
.world-levels { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 12px; }
.world-level.boss { border-color: #7a4b6a; }
.world-level .stage-num { display: grid; place-items: center; width: 34px; }
.level-boss-thumb { width: 34px; height: 44px; object-fit: cover; object-position: center 20%; border-radius: 6px; border: 1px solid #ffffff2a; }
.world-level .stage-reward small { display: block; color: #9ecfe8; font-size: 0.68rem; text-align: right; }
.world-level .stage-name small span { margin-right: 2px; }

/* ---------- Sélection d'équipes (Mondes & boss) ---------- */
.worlds-select-body { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.team-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0; scrollbar-width: none; }
.team-tabs::-webkit-scrollbar { display: none; }
.team-tab {
  flex: 0 0 auto; min-width: 84px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--card);
  color: var(--text); font: inherit; font-weight: 600; font-size: 0.82rem; cursor: pointer; text-align: center;
}
.team-tab small { display: block; color: var(--muted); font-weight: 400; font-size: 0.68rem; }
.team-tab.active { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 195, 90, 0.3); }
.team-tab.empty:not(.active) { border-style: dashed; opacity: 0.75; }
.team-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0 10px; }
.team-slot {
  position: relative; aspect-ratio: 2 / 3; border-radius: 9px; border: 1px solid var(--card-edge); background: #00000040; overflow: hidden;
  display: grid; place-items: center; color: var(--muted); font-size: 1.3rem; padding: 0; cursor: pointer;
}
.team-slot.empty { border-style: dashed; cursor: default; }
.team-slot img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.team-slot small { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 3px; background: #000000b0; color: #f3ead3; font-size: 0.58rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.worlds-roster .hero-card { position: relative; cursor: pointer; }
.worlds-roster .hero-card.elsewhere { opacity: 0.55; }
.team-badge { position: absolute; top: 4px; right: 4px; padding: 1px 6px; border-radius: 6px; background: var(--gold); color: #221a05; font-size: 0.62rem; font-weight: 700; z-index: 2; }
#screen-worlds-select .select-footer, #screen-event .select-footer { display: flex; gap: 8px; }
#screen-worlds-select .select-footer .btn-primary, #screen-event .select-footer .btn-primary { flex: 1; }
.wave-banner { background: linear-gradient(90deg, transparent, #2b1a2ee6 25%, #2b1a2ee6 75%, transparent) !important; }

/* ---------- Résultat & butin ---------- */
.worlds-loot { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.loot-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 9px;
  background: #00000045; border: 1px solid color-mix(in srgb, var(--tier, var(--gold)) 55%, transparent); font-size: 0.85rem;
}
.loot-chip b { color: var(--tier, var(--gold)); }
.loot-chip small { color: var(--muted); font-size: 0.66rem; }
.loot-chip.stone { --tier: #f7e6b0; }
.loot-note { width: 100%; text-align: center; color: var(--gold); font-size: 0.85rem; margin-top: 4px; }
.worlds-stats { width: 100%; margin-top: 6px; }

/* ---------- Forge ---------- */
.forge-materials { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; min-height: 34px; }
.mat-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; font-size: 0.82rem;
  background: #00000045; border: 1px solid color-mix(in srgb, var(--tier) 60%, transparent);
}
.mat-chip b { color: var(--tier); }
.mat-chip small { color: var(--muted); font-size: 0.62rem; }
.forge-empty { color: var(--muted); font-size: 0.8rem; padding: 6px 2px; }
.forge-empty b { color: var(--gold); }
.forge-tabs { display: flex; gap: 6px; padding: 2px 0 8px; }
.forge-tabs button, .forge-pill {
  flex: 1; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; font-size: 0.85rem; cursor: pointer;
}
.forge-tabs button.active, .forge-pill.active { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 195, 90, 0.28); }
.forge-body { flex: 1; overflow-y: auto; padding-bottom: 18px; }
.forge-h { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 6px; font-size: 0.85rem; color: #dac89f; letter-spacing: 0.04em; text-transform: uppercase; }
.forge-h small { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.72rem; }
.forge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.forge-pill small { display: block; color: var(--muted); font-weight: 400; font-size: 0.66rem; margin-top: 2px; }
.forge-pill.mode-pve.active { border-color: #7fd68a; box-shadow: 0 0 10px #7fd68a44; }
.forge-pill.mode-pvp.active { border-color: #e8734a; box-shadow: 0 0 10px #e8734a44; }
.forge-sets { display: grid; grid-template-columns: repeat(3, 1fr); }
.forge-set {
  padding: 8px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--card); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; border-top: 3px solid var(--set-color);
}
.forge-set b { display: block; font-size: 0.78rem; margin-bottom: 3px; color: var(--set-color); }
.forge-set small { display: block; color: var(--muted); font-size: 0.64rem; line-height: 1.3; }
.forge-set.active { border-color: var(--set-color); box-shadow: 0 0 12px color-mix(in srgb, var(--set-color) 40%, transparent); background: color-mix(in srgb, var(--set-color) 8%, var(--card)); }
.forge-pieces { display: grid; grid-template-columns: repeat(3, 1fr); }
.forge-piece {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--card-edge);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; font-size: 0.82rem; cursor: pointer;
}
.forge-piece span { font-size: 1.25rem; }
.forge-piece.active { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 195, 90, 0.28); }
.forge-tiers { display: grid; grid-template-columns: repeat(6, 1fr); }
.forge-tier {
  padding: 6px 2px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--tier) 45%, var(--card-edge)); background: var(--card);
  color: var(--tier); font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.forge-tier small { display: block; color: var(--muted); font-weight: 400; font-size: 0.56rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forge-tier.none { opacity: 0.45; }
.forge-tier.active { box-shadow: 0 0 10px color-mix(in srgb, var(--tier) 50%, transparent); border-color: var(--tier); opacity: 1; }
.forge-preview {
  margin-top: 12px; padding: 12px; border-radius: 12px; background: #00000045; border: 1px solid color-mix(in srgb, var(--set-color) 50%, var(--card-edge));
}
.forge-preview-head { display: flex; gap: 10px; align-items: center; }
.forge-preview-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: #00000055; border: 1px solid var(--set-color); font-size: 1.7rem; flex: 0 0 auto; }
.forge-preview-head b { display: block; color: var(--set-color); font-size: 0.98rem; }
.forge-preview-head small { display: block; color: var(--muted); font-size: 0.7rem; margin-top: 2px; }
.forge-stats { margin: 10px 0 6px; color: #f3ead3; font-weight: 600; font-size: 0.9rem; }
.forge-stats small { color: var(--muted); font-weight: 400; font-size: 0.7rem; }
.forge-cost { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.forge-cost li { padding: 3px 8px; border-radius: 8px; background: #00000040; border: 1px solid #ffffff14; font-size: 0.82rem; }
.forge-cost li small { color: var(--muted); font-size: 0.66rem; }
.forge-cost li.ok { border-color: #7fd68a55; }
.forge-cost li.ko { border-color: #e0555588; color: #f0a0a0; }
.forge-craft-btn { width: 100%; }
.gear-mode-badge { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em; vertical-align: middle; }
.gear-mode-badge.mode-pve { background: #7fd68a26; color: #7fd68a; border: 1px solid #7fd68a55; }
.gear-mode-badge.mode-pvp { background: #e8734a26; color: #e8734a; border: 1px solid #e8734a55; }

/* Inventaire */
.forge-items { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.forge-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--card-edge); border-left: 3px solid var(--set-color);
}
.forge-item.equipped { background: color-mix(in srgb, var(--set-color) 7%, var(--card)); }
.forge-item-icon { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: #00000055; border: 1px solid var(--tier); font-size: 1.6rem; }
.forge-item-icon small { position: absolute; right: -4px; bottom: -4px; padding: 0 5px; border-radius: 6px; background: var(--tier); color: #10101a; font-size: 0.6rem; font-weight: 800; }
.forge-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.forge-item-body > b { color: var(--set-color); font-size: 0.9rem; }
.forge-item-body small { color: var(--muted); font-size: 0.68rem; }
.forge-item-stats { color: #f3ead3; font-size: 0.78rem; font-weight: 600; }
.forge-level { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; }
.forge-level i { width: 14px; height: 5px; border-radius: 2px; background: #ffffff1c; }
.forge-level i.on { background: var(--gold); }
.forge-level em { margin-left: 4px; color: var(--gold); font-size: 0.7rem; font-style: normal; font-weight: 700; }
.forge-item-owner b { color: var(--gold); }
.forge-item-actions { display: flex; flex-direction: column; gap: 6px; }
.forge-item-actions .btn { white-space: nowrap; }
.forge-item-actions .btn small { display: block; font-weight: 400; font-size: 0.62rem; color: inherit; opacity: 0.8; }

/* Choix du héros à équiper */
.forge-picker { max-height: 80dvh; display: flex; flex-direction: column; }
.forge-picker h2 { font-size: 1.05rem; }
.forge-picker-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 10px 0; text-align: left; }
.forge-pick {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: 10px;
  border: 1px solid var(--card-edge); background: var(--card); color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.forge-pick:hover { border-color: var(--gold); }
.forge-pick-face { width: 44px; height: 56px; border-radius: 8px; overflow: hidden; background: #000; display: grid; place-items: center; font-size: 1.4rem; }
.forge-pick-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.forge-pick-copy b { display: block; font-size: 0.9rem; }
.forge-pick-copy small { display: block; color: var(--muted); font-size: 0.68rem; }

/* Fiche héros : emplacements réels */
#hero-overlay .gear-slot > span.forge-icon { font-size: 1.9rem; }
#hero-overlay .gear-slot.empty { opacity: 0.55; }
#hero-overlay .gear-slot.filled { border-color: var(--gold); }
.gear-footnote { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.7rem; color: var(--muted); }
.gear-set-pill { padding: 1px 7px; border-radius: 6px; border: 1px solid var(--set-color); color: var(--set-color); font-size: 0.64rem; font-weight: 700; }

/* ---------- Boss de serveur ---------- */
.event-body { flex: 1; overflow-y: auto; padding-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.event-hero {
  position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--dragon-color) 18%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--dragon-color) 45%, var(--card-edge));
}
.event-art { width: 96px; height: 128px; object-fit: cover; object-position: center 20%; border-radius: 10px; border: 1px solid #ffffff2a; box-shadow: 0 6px 18px #000a; }
.event-copy small { display: block; color: var(--muted); font-size: 0.66rem; letter-spacing: 0.08em; }
.event-copy .live { color: #ff6b6b; animation: eventPulse 1.4s ease-in-out infinite; }
.event-copy h3 { font-size: 1.05rem; margin: 3px 0; color: var(--dragon-color); }
.event-copy p { color: var(--text); font-size: 0.78rem; opacity: 0.85; }
.event-copy .event-window { margin-top: 5px; letter-spacing: 0; color: #dac89f; }
@keyframes eventPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.event-panel { padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); }
.event-panel .forge-h { margin-top: 0; }
.event-hp-head { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 5px; }
.event-hp-head span { color: var(--hp-low); font-weight: 700; }
.event-hp { position: relative; height: 14px; border-radius: 7px; background: #00000070; border: 1px solid #ffffff18; overflow: hidden; }
.event-hp i { position: absolute; left: 0; top: 0; bottom: 0; }
.event-hp i.others { background: linear-gradient(90deg, #7a4b6a, #b0607a); }
.event-hp i.mine { background: linear-gradient(90deg, #f0d075, #c99a2e); box-shadow: 0 0 8px #f0d07588; }
.event-legend { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.66rem; margin-top: 4px; }
.event-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.event-legend .dot.others { background: #b0607a; } .event-legend .dot.mine { background: #f0d075; }
.event-me { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.event-me span { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 9px; background: #00000040; }
.event-me small { color: var(--muted); font-size: 0.6rem; letter-spacing: 0.06em; }
.event-me b { color: #f3ead3; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.event-tiers { display: flex; flex-direction: column; gap: 6px; }
.event-tier {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 10px;
  background: #00000040; border: 1px solid #ffffff14; opacity: 0.8;
}
.event-tier.reached { opacity: 1; border-color: var(--gold); }
.event-tier.claimed { border-color: #7fd68a66; }
.event-tier.kill { border-color: #b0607a66; }
.event-tier-head b { display: block; font-size: 0.85rem; }
.event-tier-head small { color: var(--muted); font-size: 0.66rem; }
.event-tier-loot { grid-column: 1 / 2; display: flex; flex-wrap: wrap; gap: 4px; }
.event-tier-loot .loot-chip { padding: 2px 6px; font-size: 0.72rem; }
.event-tier-loot .loot-chip small { display: none; }
.event-tier > em, .event-tier > .btn { grid-column: 2; grid-row: 1 / 3; font-size: 0.72rem; color: var(--muted); font-style: normal; white-space: nowrap; }
.event-tier.claimed > em { color: #7fd68a; }
.event-summon-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.event-summon-art { width: 160px; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; border: 2px solid var(--tier-color); box-shadow: 0 0 22px color-mix(in srgb, var(--tier-color) 50%, transparent); background: #000; display: grid; place-items: center; font-size: 3rem; }
.event-summon-art img { width: 100%; height: 100%; object-fit: cover; }

/* Bouton du village */
.bottom-menu-item { position: relative; }
.bottom-menu-item.live::after {
  content: ''; position: absolute; top: 4px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #ff5b5b;
  box-shadow: 0 0 8px #ff5b5b; animation: eventPulse 1.4s ease-in-out infinite;
}

@media (max-width: 420px) {
  .forge-sets { grid-template-columns: 1fr; }
  .forge-item { grid-template-columns: 44px 1fr; }
  .forge-item-actions { grid-column: 1 / -1; flex-direction: row; }
  .forge-item-actions .btn { flex: 1; }
  .event-hero { grid-template-columns: 76px 1fr; }
  .event-art { width: 76px; height: 102px; }
}

/* ---------- Brief de niveau : puissance, ennemis, butin, mutateurs ---------- */
.level-brief { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); margin-top: 6px; }
.brief-power-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.8rem; }
.brief-power-head span { color: var(--muted); font-size: 0.72rem; }
.brief-power-head em { font-style: normal; font-weight: 700; }
.brief-gauge { height: 8px; margin-top: 5px; border-radius: 4px; background: #00000070; border: 1px solid #ffffff14; overflow: hidden; }
.brief-gauge i { display: block; height: 100%; transition: width 0.3s; }
.brief-power.good .brief-gauge i, .ready.good, .brief-power.good em, b.good { background: none; color: #7fd68a; }
.brief-power.good .brief-gauge i { background: linear-gradient(90deg, #7fd68a, #4ea85a); }
.brief-power.fair .brief-gauge i { background: linear-gradient(90deg, #f0d075, #c99a2e); }
.brief-power.fair em, .ready.fair { color: var(--gold); }
.brief-power.warn .brief-gauge i { background: linear-gradient(90deg, #f0a35a, #d0692e); }
.brief-power.warn em, .ready.warn { color: #f0a35a; }
.brief-power.bad .brief-gauge i { background: linear-gradient(90deg, #e05555, #a03030); }
.brief-power.bad em, .ready.bad, b.bad { color: #f07070; }
.ready { font-style: normal; font-weight: 700; padding: 0 5px; border-radius: 5px; background: #00000040; }
.brief-enemies small, .brief-loot small, .brief-mutators small { display: block; color: var(--muted); font-size: 0.64rem; letter-spacing: 0.06em; }
.enemy-strip { display: flex; gap: 5px; margin: 5px 0; overflow-x: auto; scrollbar-width: none; }
.enemy-strip::-webkit-scrollbar { display: none; }
.enemy-face { position: relative; flex: 0 0 auto; width: 46px; height: 60px; border-radius: 7px; overflow: hidden; background: #000; border: 1px solid #ffffff22; display: grid; place-items: center; font-size: 1.3rem; }
.enemy-face.boss { border-color: #b0607a; box-shadow: 0 0 8px #b0607a66; }
.enemy-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.enemy-face small { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 2px; background: #000000b0; color: #f3ead3; font-size: 0.5rem; letter-spacing: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-elements { letter-spacing: 0 !important; font-size: 0.7rem !important; }
.el-badge { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border-radius: 6px; font-size: 0.66rem; font-weight: 700; color: var(--el-color); border: 1px solid color-mix(in srgb, var(--el-color) 60%, transparent); background: color-mix(in srgb, var(--el-color) 12%, transparent); vertical-align: middle; }
.loot-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.loot-line .loot-chip { padding: 3px 7px; font-size: 0.76rem; }
.mutator-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 6px; }
.mutator { display: grid; grid-template-columns: 26px 1fr; gap: 2px 8px; align-items: center; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--card-edge); background: #00000040; color: var(--text); text-align: left; font: inherit; cursor: pointer; opacity: 0.75; }
.mutator span { grid-row: 1 / 3; font-size: 1.2rem; }
.mutator b { font-size: 0.76rem; }
.mutator small { color: var(--muted); font-size: 0.6rem; letter-spacing: 0; }
.mutator.on { opacity: 1; border-color: #e05555; background: #e0555518; box-shadow: 0 0 8px #e0555544; }
.nightmare-tag { font-style: normal; font-size: 0.62rem; color: #f07070; font-weight: 700; margin-left: 4px; }
.team-tab small { white-space: nowrap; }
.slot-el { position: absolute; top: 2px; right: 3px; font-size: 0.7rem; font-style: normal; text-shadow: 0 0 4px #000; }
.hero-el { position: absolute; top: 4px; left: 4px; z-index: 2; font-size: 0.8rem; padding: 0 3px; border-radius: 5px; background: #000000a0; }
.hero-el.good { box-shadow: 0 0 6px #7fd68a; }
.hero-el.bad { box-shadow: 0 0 6px #f07070; }
.relic-note { color: #f7e6b0; text-shadow: 0 0 10px #f7e6b088; }

/* ---------- Forge : éléments, châssis, reliques, recyclage ---------- */
.forge-elements { display: grid; grid-template-columns: repeat(3, 1fr); }
.forge-element.active { border-color: var(--el-color); box-shadow: 0 0 10px color-mix(in srgb, var(--el-color) 45%, transparent); }
.forge-element.none { opacity: 0.5; }
.forge-item-icon em { position: absolute; left: -5px; top: -6px; font-size: 0.9rem; font-style: normal; filter: drop-shadow(0 0 4px var(--el-color)); }
.forge-item.relic { border-color: #f7e6b0; box-shadow: 0 0 14px #f7e6b033; background: linear-gradient(160deg, #2a2418, var(--card)); }
.forge-sockets { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.socket { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px dashed #ffffff40; font-size: 0.7rem; color: var(--muted); }
.socket.set { border-style: solid; border-color: var(--gold); font-size: 0.85rem; color: inherit; }
.socket small { position: absolute; right: -4px; bottom: -4px; font-size: 0.5rem; background: var(--gold); color: #221a05; border-radius: 4px; padding: 0 2px; font-weight: 800; }
.socket.big { width: 40px; height: 40px; font-size: 1.4rem; }
.socket.big small { font-size: 0.6rem; right: -3px; bottom: -3px; }
.rune-word { padding: 1px 6px; border-radius: 6px; background: #f7e6b022; color: #f7e6b0; font-size: 0.64rem; font-weight: 700; }
.relic-line { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; color: #f7e6b0; }
.relic-xp { flex: 1; height: 5px; border-radius: 3px; background: #00000060; overflow: hidden; min-width: 40px; }
.relic-xp b { display: block; height: 100%; background: linear-gradient(90deg, #f7e6b0, #c99a2e); }
.forge-item-actions .btn.danger { border-color: #e05555; color: #f07070; }
.socket-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; padding: 8px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--card); text-align: left; }
.socket-body b { display: block; font-size: 0.8rem; margin-bottom: 5px; }
.socket-options { display: flex; flex-wrap: wrap; gap: 5px; }
.socket-options .btn small { font-size: 0.6rem; opacity: 0.8; }
.gem-types { gap: 5px; }
.rune-list { display: flex; flex-direction: column; gap: 6px; }
.rune-card { padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--card-edge); border-left: 3px solid #f7e6b0; }
.rune-card b { display: block; color: #f7e6b0; font-size: 0.82rem; }
.rune-card span { display: block; font-size: 0.74rem; margin: 2px 0; }
.rune-card small { color: var(--muted); font-size: 0.66rem; }
.gem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gem-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); text-align: center; }
.gem-face { position: relative; font-size: 2rem; line-height: 1; }
.gem-face small { position: absolute; right: -8px; bottom: -2px; font-size: 0.6rem; background: var(--gold); color: #221a05; border-radius: 5px; padding: 0 4px; font-weight: 800; }
.gem-card b { font-size: 0.8rem; }
.gem-card small { color: var(--muted); font-size: 0.66rem; }
.gem-card .btn { width: 100%; margin-top: 4px; }
.gem-card .btn small { display: block; color: inherit; opacity: 0.8; font-size: 0.6rem; }

/* ---------- Mécaniques de boss, simulation, quêtes, caisse AFK ---------- */
.brief-mechanic { padding: 8px 10px; border-radius: 10px; background: #00000040; border: 1px solid #b0607a66; }
.brief-mechanic small { display: block; color: var(--muted); font-size: 0.64rem; letter-spacing: 0.06em; }
.brief-mechanic b { display: block; color: #e8a0b8; font-size: 0.85rem; margin-top: 2px; }
.brief-mechanic span { display: block; font-size: 0.74rem; opacity: 0.9; }
.brief-mechanic em { display: block; margin-top: 4px; font-style: normal; font-size: 0.72rem; font-weight: 700; }
.brief-mechanic.ok em { color: #7fd68a; } .brief-mechanic.ko em { color: #f07070; }
.mech-tag { font-style: normal; font-size: 0.62rem; color: #e8a0b8; font-weight: 700; margin-left: 4px; }
.sweep-btn { display: inline-block; margin-top: 3px; padding: 2px 7px; border-radius: 6px; background: linear-gradient(160deg, #f0d075, #c99a2e); color: #221a05; font-size: 0.66rem; font-weight: 800; }
.sweep-btn:hover { filter: brightness(1.1); }
.daily-reset { color: var(--muted) !important; font-weight: 400 !important; font-size: 0.7rem; }
.daily-list { display: flex; flex-direction: column; gap: 6px; }
.daily-quest { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #00000040; border: 1px solid #ffffff14; }
.daily-quest.done { border-color: #7fd68a66; }
.daily-icon { font-size: 1.3rem; text-align: center; }
.daily-copy b { display: block; font-size: 0.82rem; }
.daily-copy small { display: block; color: var(--muted); font-size: 0.66rem; }
.daily-bar { display: block; height: 5px; margin-top: 5px; border-radius: 3px; background: #00000070; overflow: hidden; }
.daily-bar b { display: block; height: 100%; background: linear-gradient(90deg, #f0d075, #c99a2e); }
.daily-quest.done .daily-bar b { background: linear-gradient(90deg, #7fd68a, #4ea85a); }
.daily-quest > em { font-style: normal; font-weight: 700; color: var(--gold); font-size: 0.85rem; }
.daily-quest.done > em { color: #7fd68a; }
.daily-chest.ready { border-color: var(--gold); box-shadow: 0 0 14px rgba(232, 195, 90, 0.25); }
.daily-chest.claimed { opacity: 0.75; }
.daily-claim { width: 100%; margin-top: 10px; }
.forge-qty { align-items: center; margin: 6px 0; }
.forge-qty small { color: var(--muted); font-size: 0.7rem; margin-right: 4px; }
.forge-qty .forge-pill { flex: 0 0 auto; padding: 5px 12px; }
.attempts { font-style: normal; font-weight: 700; color: #9ecfe8; }
.attempts.out { color: #f07070; }

/* ---------- Boss en combat : carte agrandie ---------- */
/* Boss seul (boss de serveur) : il occupe toute la grille ennemie. */
.grid-enemy.solo-boss { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 38dvh; }
.grid-enemy.solo-boss .unit.boss-unit {
  grid-column: 1 / -1 !important; grid-row: 1 / -1 !important;
  width: min(72vw, 320px); margin: 0 auto; padding: 6px;
  border-color: #b0607a; box-shadow: 0 0 22px #b0607a55, inset 0 0 0 1px #ffffff14;
  background: radial-gradient(ellipse at 50% 30%, #3a1f33, var(--card) 70%);
}
.grid-enemy.solo-boss .unit.boss-unit .unit-sprite,
.grid-enemy.solo-boss .unit.boss-unit .unit-sprite:has(.hero-art) { width: 100%; max-width: none; }
.grid-enemy.solo-boss .unit.boss-unit .hero-art { object-position: center 12%; border-radius: 10px; }
.grid-enemy.solo-boss .unit.boss-unit .uname { font-size: 0.95rem; margin: 4px 0 5px; }
.grid-enemy.solo-boss .unit.boss-unit .bars { width: 96%; }
.grid-enemy.solo-boss .unit.boss-unit .bar { height: 9px; }
.grid-enemy.solo-boss .unit.boss-unit .shield-badge { font-size: 0.85rem; }
/* Boss accompagné (boss de fin de Monde, mini-boss) : mis en avant dans sa case. */
.grid-enemy.has-boss .unit.boss-unit {
  border-color: #b0607a; box-shadow: 0 0 14px #b0607a55; z-index: 2;
  background: radial-gradient(ellipse at 50% 30%, #3a1f33, var(--card) 70%);
}
.grid-enemy.has-boss .unit.boss-unit .unit-sprite:has(.hero-art) { width: 100%; max-width: none; }
.grid-enemy.has-boss .unit.boss-unit .hero-art { object-position: center 10%; transform: scale(1.12); transform-origin: center bottom; }
.grid-enemy.has-boss .unit.boss-unit .uname { color: #e8a0b8 !important; font-weight: 800; }
/* Boss accompagné : la carte s'étire sur deux cases (front + milieu) de la colonne centrale. */
.grid-enemy.has-boss:not(.solo-boss) .unit.boss-unit { grid-row: 2 / 4 !important; grid-column: 2 !important; }
.grid-enemy.has-boss:not(.solo-boss) .unit.boss-unit .hero-art { transform: none; object-position: center 15%; }
.grid-enemy.has-boss:not(.solo-boss) .unit.boss-unit .uname { font-size: 0.78rem; }
.grid-enemy.has-boss:not(.solo-boss) .unit.boss-unit .bar { height: 7px; }
/* Image de boss entière (format 2:3), plus de recadrage : le cadre suit la hauteur disponible. */
.grid-enemy.solo-boss { height: 46dvh; }
.grid-enemy.solo-boss .unit.boss-unit { width: min(92vw, calc((46dvh - 74px) * 2 / 3 + 14px)); }
.grid-enemy.solo-boss .unit.boss-unit .hero-art,
.grid-enemy.has-boss:not(.solo-boss) .unit.boss-unit .hero-art { object-fit: contain; object-position: center; background: #0a0610; }

/* ---------- Grille de combat 2 lignes × 3 (2026-09-05) ---------- */
.grid { grid-template-rows: repeat(2, 1fr); height: 26dvh; }
.grid-enemy.has-boss:not(.solo-boss) .unit.boss-unit { grid-row: 1 / 3 !important; grid-column: 2 !important; }
.grid-enemy.solo-boss { height: 46dvh; }

/* ---------- Formation éditable (sélection d'équipe) ---------- */
.formation { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; padding: 8px; border-radius: 12px; background: #00000035; border: 1px solid var(--card-edge); }
.formation-row { display: grid; grid-template-columns: 62px repeat(3, 1fr); gap: 6px; align-items: stretch; }
.formation-row > small { display: flex; flex-direction: column; justify-content: center; color: var(--muted); font-size: 0.6rem; letter-spacing: 0.06em; line-height: 1.25; }
.formation-row > small em { font-style: normal; letter-spacing: 0; color: #6f6885; font-size: 0.56rem; }
.formation-row.front { padding-bottom: 6px; border-bottom: 1px dashed #ffffff18; }
.formation .team-slot { aspect-ratio: 3 / 4; }
.formation .team-slot.target { border-color: var(--gold); box-shadow: 0 0 12px rgba(232, 195, 90, 0.45); }
.formation .team-slot.empty { cursor: pointer; }
.slot-plus { font-size: 1.4rem; color: var(--muted); }
.slot-remove { position: absolute; top: 2px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #000000b0; color: #f0a0a0; font-size: 0.6rem; line-height: 16px; text-align: center; z-index: 2; }
.formation-hint { color: var(--muted); font-size: 0.68rem; text-align: center; }

/* ---------- Arène asynchrone ---------- */
.arena-head { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.arena-league { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: linear-gradient(160deg, color-mix(in srgb, var(--league-color) 18%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--league-color) 55%, var(--card-edge)); }
.arena-league-icon { font-size: 2rem; text-align: center; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--league-color) 60%, transparent)); }
.arena-league small { display: block; color: var(--muted); font-size: 0.62rem; letter-spacing: 0.06em; }
.arena-league b { display: block; font-size: 1.05rem; color: var(--league-color); }
.arena-mmr { text-align: right; }
.arena-mmr b { color: #f3ead3 !important; }
.arena-me { margin-top: 0 !important; }
.cap-bar { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: #00000070; overflow: hidden; vertical-align: middle; }
.cap-bar b { display: block; height: 100%; background: linear-gradient(90deg, #f0d075, #c99a2e); }
.arena-chest { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: #f7e6b014; border: 1px solid var(--gold); }
.arena-chest b { font-size: 0.85rem; } .arena-chest span { grid-column: 1; font-size: 0.72rem; color: var(--muted); } .arena-chest .btn { grid-row: 1 / 3; grid-column: 2; }
.arena-tabs button { padding: 7px 4px; font-size: 0.8rem; }
.league-badge { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border-radius: 6px; font-size: 0.66rem; font-weight: 700; color: var(--league-color); border: 1px solid color-mix(in srgb, var(--league-color) 60%, transparent); background: color-mix(in srgb, var(--league-color) 12%, transparent); vertical-align: middle; }
.opponents { display: flex; flex-direction: column; gap: 8px; }
.opponent { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); }
.opponent.beaten { opacity: 0.55; }
.opponent-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opponent-copy b { font-size: 0.9rem; } .opponent-copy small { color: var(--muted); font-size: 0.68rem; }
.opponent > .btn { grid-column: 1 / -1; }
.mini-formation { display: flex; flex-direction: column; gap: 3px; }
.mini-formation > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.mini-formation .mini-front { padding-top: 3px; border-top: 1px dashed #ffffff22; }
.mini-formation small { color: var(--muted); font-size: 0.6rem; text-align: center; }
.mini-slot { aspect-ratio: 3 / 4; border-radius: 5px; overflow: hidden; background: #00000060; border: 1px solid #ffffff18; display: grid; place-items: center; font-size: 0.9rem; }
.mini-slot.empty { border-style: dashed; }
.mini-slot img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.arena-roster { max-height: 40dvh; overflow-y: auto; }
.journal { display: flex; flex-direction: column; gap: 5px; }
.journal-row { display: grid; grid-template-columns: 78px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 9px; background: #00000040; border: 1px solid #ffffff12; font-size: 0.74rem; }
.journal-row small { color: var(--muted); font-size: 0.64rem; } .journal-row span { color: var(--muted); }
.journal-row.won { border-color: #7fd68a55; } .journal-row.won em { color: #7fd68a; }
.journal-row.lost { border-color: #e0555555; } .journal-row.lost em { color: #f07070; }
.journal-row em { font-style: normal; font-weight: 700; }
.shop { display: flex; flex-direction: column; gap: 6px; }
.shop-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--card-edge); }
.shop-item.out { opacity: 0.55; }
.shop-icon { font-size: 1.4rem; text-align: center; }
.shop-item b { display: block; font-size: 0.82rem; } .shop-item small { color: var(--muted); font-size: 0.66rem; }
.shop-item em { font-style: normal; color: var(--gold); }
.ranking { display: flex; flex-direction: column; gap: 4px; }
.ranking-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 9px; background: #00000040; border: 1px solid #ffffff12; font-size: 0.78rem; }
.ranking-row.me { border-color: var(--gold); background: #e8c35a14; }
.ranking-row em { font-style: normal; color: var(--muted); font-weight: 700; min-width: 28px; }
.ranking-row span { color: var(--muted); font-size: 0.72rem; }

/* ---------- Marché ---------- */
.market-wallet { gap: 4px; }
.market-wallet .currency-pill { padding: 3px 7px; font-size: 0.72rem; }
.market-tabs button { padding: 7px 2px; font-size: 0.74rem; }
.market-tabs button.live { border-color: #ff6b6b; box-shadow: 0 0 10px #ff6b6b55; }
.market-head { margin: 6px 0 4px; }
.market-refresh { width: 100%; margin-top: 10px; }
.wish { background: none; border: 0; color: var(--muted); font-size: 0.9rem; cursor: pointer; padding: 0 2px; vertical-align: middle; }
.wish.on { color: var(--gold); text-shadow: 0 0 6px #e8c35a88; }
.wish-line { margin-top: 10px; border-top: 1px dashed #ffffff18; padding-top: 8px; }
.shop-item.flash { border-color: #ff9f5a88; background: linear-gradient(160deg, #3a2418, var(--card)); }
.flash-tag { font-style: normal; font-size: 0.62rem; color: #ffb27a; margin-left: 4px; }
.hotspot.live .hotspot-label::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #ff5b5b; box-shadow: 0 0 8px #ff5b5b; animation: eventPulse 1.4s ease-in-out infinite; vertical-align: middle; }

/* ---------- Tirage de départ ---------- */
.starter-panel { max-width: 420px; }
.starter-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.starter-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--tier-color); box-shadow: 0 0 14px color-mix(in srgb, var(--tier-color) 35%, transparent); }
.starter-role { font-size: 0.6rem; letter-spacing: 0.1em; color: var(--muted); }
.starter-art { width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: #000; display: grid; place-items: center; font-size: 1.6rem; }
.starter-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.starter-card b { font-size: 0.82rem; text-align: center; }
.starter-card small { color: var(--muted); font-size: 0.6rem; text-align: center; }
.starter-card em { font-style: normal; color: var(--gold); font-size: 0.62rem; text-align: center; }
.starter-synergy { color: #dac89f; font-size: 0.78rem; min-height: 1.2em; }

/* ---------- Navigation : menu « Plus », pastilles ---------- */
.hub-menu-panel { width: min(92vw, 440px); padding: 14px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--card-edge); display: flex; flex-direction: column; gap: 10px; }
.hub-menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--card-edge); background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.menu-tile span { font-size: 1.6rem; }
.menu-tile b { font-size: 0.74rem; }
.menu-tile:hover { border-color: var(--gold); }
.menu-tile.live::after { content: ''; position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: #ff5b5b; box-shadow: 0 0 8px #ff5b5b; animation: eventPulse 1.4s ease-in-out infinite; }
.hub-harvest { width: 100%; }
.hub-bottom-bar .bottom-menu-item.live::after { right: 10px; }

/* ---------- Premium ---------- */
.vip-head { margin-bottom: 8px; }
.vip-chest { display: flex; flex-direction: column; align-items: center; width: 52px; padding: 6px 2px; border-radius: 9px; border: 1px solid var(--card-edge); background: #00000040; color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer; opacity: 0.55; }
.vip-chest small { font-size: 0.56rem; color: var(--muted); }
.vip-chest.ok { opacity: 1; border-color: var(--gold); box-shadow: 0 0 8px rgba(232, 195, 90, 0.35); }
.vip-chest.done { opacity: 0.8; border-color: #7fd68a66; }
.premium-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.premium-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); }
.premium-card.active { border-color: var(--gold); box-shadow: 0 0 12px rgba(232, 195, 90, 0.25); }
.premium-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.premium-card-head b { font-size: 0.9rem; } .premium-card-head span { color: var(--gold); font-weight: 700; font-size: 0.8rem; }
.premium-card small { color: var(--muted); font-size: 0.66rem; }
.premium-status { color: #7fd68a; font-size: 0.7rem; font-weight: 700; }
.dev-toggle { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); cursor: pointer; }
.dev-panel { border-style: dashed; }
.vip-badge.animated { animation: eventPulse 2s ease-in-out infinite; box-shadow: 0 0 10px #f7e6b0; }
@media (max-width: 420px) { .premium-cards { grid-template-columns: 1fr; } }

/* ---------- Alliance ---------- */
.alliance-tabs button { padding: 7px 2px; font-size: 0.72rem; }
.alliance-create { display: flex; gap: 6px; }
.alliance-create input { flex: 1; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--card-edge); background: #00000050; color: var(--text); font: inherit; }
.event-hp.gauges { position: relative; }
.gauge-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #ffffff70; }
.alliance-head { margin-bottom: 8px; }

/* ---------- Ressources par classe (2e barre) ---------- */
.unit[data-resource="rage"] .en-fill { background: linear-gradient(90deg, #e05555, #ff8a3a); }
.unit[data-resource="mana"] .en-fill { background: linear-gradient(90deg, #4f8fe8, #7fc4ff); }
.unit[data-resource="energie"] .en-fill { background: linear-gradient(90deg, #e8c35a, #fff0a0); }
.unit[data-resource="devotion"] .en-fill { background: linear-gradient(90deg, #f3ead3, #ffffff); box-shadow: 0 0 4px #fff8; }

/* ---------- Hub d'alliance (village de guilde) ---------- */
.alliance-banner .arena-league-icon { font-size: 2.2rem; }
.hub-guards { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); }
.hub-guards > small { color: var(--muted); font-size: 0.6rem; letter-spacing: 0.08em; }
.hub-guards > div { display: flex; gap: 8px; }
.guard { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 54px; }
.guard img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 15%; border: 2px solid var(--card-edge); }
.guard.me img { border-color: var(--gold); box-shadow: 0 0 8px rgba(232, 195, 90, 0.5); }
.guard small { font-size: 0.56rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 54px; }
.hub-motd { padding: 8px 10px; border-radius: 10px; background: #f7e6b012; border: 1px solid #f7e6b044; font-size: 0.78rem; color: #f3ead3; }
.hub-grid { display: flex; flex-direction: column; gap: 8px; }
.hub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-row.single { grid-template-columns: 1fr; }
.hub-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px 10px; border-radius: 14px; border: 1px solid var(--card-edge); background: radial-gradient(ellipse at 50% 20%, #2a2440, var(--card) 70%); color: var(--text); font: inherit; cursor: pointer; }
.hub-tile:hover { border-color: var(--gold); }
.hub-tile span { font-size: 2rem; filter: drop-shadow(0 4px 8px #000a); }
.hub-tile b { font-size: 0.82rem; }
.hub-tile small { color: var(--muted); font-size: 0.64rem; text-align: center; }
.hub-badge { position: absolute; top: 6px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e05555; font-style: normal; font-size: 0.8rem; box-shadow: 0 0 8px #e0555588; animation: eventPulse 1.6s ease-in-out infinite; }
.hub-back { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.hub-back b { font-size: 0.9rem; }
.hub-leave { align-self: center; opacity: 0.7; }
.role { margin-left: 6px; padding: 0 5px; border-radius: 5px; font-size: 0.58rem; font-weight: 700; text-transform: uppercase; vertical-align: middle; background: #ffffff14; color: var(--muted); }
.role.chef { background: #e8c35a22; color: var(--gold); } .role.officier { background: #9fd6b022; color: #9fd6b0; }
.seen { font-size: 0.64rem !important; }
#alliance-motd { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--card-edge); background: #00000050; color: var(--text); font: inherit; font-size: 0.82rem; margin-bottom: 8px; resize: vertical; }
.emblem-color { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; }
.emblem-color.on { border-color: #fff; box-shadow: 0 0 8px var(--c); }
.emblem-icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--card); font-size: 1.2rem; cursor: pointer; }
.emblem-icon.on { border-color: var(--gold); box-shadow: 0 0 8px rgba(232, 195, 90, 0.4); }

/* L'attribut hidden l'emporte toujours (les .forge-tabs sont en display:flex). */
[hidden] { display: none !important; }

/* ---------- PV en chiffres sous la barre ---------- */
.unit .hp-num { display: block; width: 100%; text-align: right; font-size: 0.56rem; line-height: 1; color: #d7f5da; font-variant-numeric: tabular-nums; margin-bottom: 1px; text-shadow: 0 1px 2px #000; }
.unit .hp-num.low { color: #ffb0b0; }
.grid-enemy.solo-boss .unit.boss-unit .hp-num { font-size: 0.85rem; text-align: center; margin-bottom: 3px; }
.grid-enemy.has-boss:not(.solo-boss) .unit.boss-unit .hp-num { font-size: 0.68rem; }

/* ---------- Invocation : bannières, ×1 / ×10, révélation ---------- */
.summon-tabs button { padding: 7px 2px; font-size: 0.74rem; }
.summon-showcase { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px; border-radius: 14px; background: radial-gradient(ellipse at 20% 30%, color-mix(in srgb, var(--tier-color) 22%, var(--card)), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--tier-color) 55%, var(--card-edge)); margin-top: 6px; }
.summon-showcase-art { aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--tier-color); box-shadow: 0 0 18px color-mix(in srgb, var(--tier-color) 45%, transparent); display: grid; place-items: center; font-size: 2rem; }
.summon-showcase-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.summon-showcase-copy small { display: block; color: var(--muted); font-size: 0.62rem; letter-spacing: 0.08em; }
.summon-showcase-copy b { display: block; font-size: 1.05rem; margin: 2px 0; color: var(--tier-color); }
.summon-showcase-copy p { font-size: 0.74rem; opacity: 0.9; }
.faction-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 8px 0; }
.faction-picker .forge-pill { padding: 5px 6px; font-size: 0.7rem; }
.faction-picker .forge-pill.active { border-color: var(--faction-color); box-shadow: 0 0 8px color-mix(in srgb, var(--faction-color) 50%, transparent); }
.rates { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rate { padding: 1px 6px; border-radius: 6px; font-size: 0.64rem; font-weight: 700; color: var(--tier-color); border: 1px solid color-mix(in srgb, var(--tier-color) 55%, transparent); background: color-mix(in srgb, var(--tier-color) 10%, transparent); }
.summon-panel .event-me { margin-top: 0; }
.pay-with { align-items: center; margin: 8px 0; }
.pay-with small { color: var(--muted); font-size: 0.7rem; }
.pay-with .forge-pill { flex: 0 0 auto; padding: 5px 10px; font-size: 0.78rem; }
.summon-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.summon-buttons .btn small { display: block; font-weight: 500; font-size: 0.66rem; opacity: 0.85; margin-top: 2px; }
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin-bottom: 6px; }
.wish-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.wish-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: center 12%; border-radius: 7px; }
.wish-card small { font-size: 0.62rem; } .wish-card em { font-style: normal; font-size: 0.56rem; color: var(--muted); }
.wish-card.on { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 195, 90, 0.4); }
.wish-card.on::after { content: '★'; position: absolute; top: 4px; right: 6px; color: var(--gold); text-shadow: 0 0 6px #000; }
.wish-card.owned { opacity: 0.55; }
.wish-card:disabled { opacity: 0.4; cursor: default; }
.summon-result-card { max-width: 440px; width: 94vw; }
.summon-result-grid { display: grid; gap: 6px; margin: 10px 0; }
.summon-result-grid.single { grid-template-columns: 1fr; justify-items: center; }
.summon-result-grid.ten { grid-template-columns: repeat(5, 1fr); }
.pull-card { perspective: 600px; }
.pull-card .pull-face { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 9px; overflow: hidden; border: 1px solid var(--tier-color); box-shadow: 0 0 10px color-mix(in srgb, var(--tier-color) 50%, transparent); background: #000; transition: transform 0.35s; transform-style: preserve-3d; }
.summon-result-grid.single .pull-face { width: min(60vw, 220px); }
.pull-face img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: center 12%; }
.pull-stars { position: absolute; top: 3px; left: 4px; color: var(--tier-color); font-size: 0.62rem; text-shadow: 0 0 4px #000; }
.summon-result-grid.single .pull-stars { font-size: 1rem; }
.pull-new, .pull-dupe, .pull-conv { position: absolute; top: 3px; right: 4px; font-style: normal; font-size: 0.5rem; font-weight: 800; padding: 0 4px; border-radius: 4px; }
.pull-new { background: var(--gold); color: #221a05; } .pull-dupe { background: #00000090; color: var(--muted); } .pull-conv { top: auto; bottom: 18px; background: #7fd68a; color: #052; }
.pull-face small { padding: 2px 3px 4px; font-size: 0.58rem; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.summon-result-grid.single .pull-face small { font-size: 0.95rem; }
.pull-card.hidden-card .pull-face { transform: rotateY(180deg); }
.pull-card.hidden-card .pull-face > * { visibility: hidden; }
.pull-card.hidden-card .pull-face::after { content: '✦'; position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, #2a2440, #0e0c16); color: var(--gold); font-size: 1.4rem; transform: rotateY(180deg); }

/* ---------- Quêtes : paliers, légende, « Y aller » ---------- */
.daily-tabs button { padding: 7px 4px; font-size: 0.78rem; }
.tier-track { display: flex; gap: 6px; justify-content: space-between; margin: 8px 0 4px; }
.tier-track .vip-chest { flex: 1; width: auto; }
.tier-legend { list-style: none; display: grid; grid-template-columns: 1fr; gap: 2px; margin: 4px 0 8px; color: var(--muted); font-size: 0.66rem; }
.tier-legend b { color: var(--gold); }
.daily-quest { grid-template-columns: 34px 1fr auto auto; }
.daily-go { padding: 4px 8px !important; font-size: 0.7rem !important; }

/* ---------- Conseil d'alliance (gestion) ---------- */
.council-list { display: flex; flex-direction: column; gap: 5px; margin: 6px 0; }
.council-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 7px 10px; border-radius: 9px; background: #00000040; border: 1px solid #ffffff12; font-size: 0.78rem; }
.council-row.me { border-color: var(--gold); }
.council-row.inactive { border-color: #e0555566; }
.council-row b { grid-column: 1; }
.council-row .role { grid-column: 2; grid-row: 1; justify-self: end; }
.council-row small { grid-column: 1; color: var(--muted); font-size: 0.66rem; }
.council-row small.seen { grid-column: 2; grid-row: 2; justify-self: end; }
.council-row small.warn, .council-row .warn { color: #f07070; font-weight: 700; }
.council-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.council-actions .btn { padding: 4px 8px; font-size: 0.68rem; }
.council-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; font-size: 0.74rem; color: var(--muted); }
.council-fields label { display: flex; flex-direction: column; gap: 3px; }
.council-fields input { padding: 7px 9px; border-radius: 9px; border: 1px solid var(--card-edge); background: #00000050; color: var(--text); font: inherit; font-size: 0.85rem; }
label.council-fields { grid-template-columns: 1fr; }
.role.veteran { background: #cdb9f222; color: #cdb9f2; }
.external-motd { color: #dac89f !important; font-style: italic; }
#save-import { width: 100%; margin: 8px 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--card-edge); background: #00000050; color: var(--text); font: inherit; font-size: 0.72rem; resize: vertical; }

/* ---------- Village : bâtiments cliquables et icônes d'angle ---------- */
#village-scene .hotspot { z-index: 2; }
.village-corner { position: absolute; top: 2.5%; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid #f7e6b088; background: radial-gradient(circle at 40% 35%, #3a2f18, #14100a 75%); color: #f7e6b0; font: inherit; cursor: pointer; box-shadow: 0 4px 14px #000a, inset 0 0 0 2px #00000060; }
.village-corner.corner-left { left: 1.5%; } .village-corner.corner-right { right: 1.5%; }
.village-corner span { font-size: 1.2rem; line-height: 1; }
.village-corner small { font-size: 0.5rem; letter-spacing: 0.04em; }
.village-corner:hover { border-color: var(--gold); box-shadow: 0 0 12px rgba(232, 195, 90, 0.5); }
.village-corner.live::after { content: ''; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #ff5b5b; box-shadow: 0 0 8px #ff5b5b; animation: eventPulse 1.4s ease-in-out infinite; }
#village-scene .hotspot.live .hotspot-label::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #ff5b5b; box-shadow: 0 0 8px #ff5b5b; animation: eventPulse 1.4s ease-in-out infinite; vertical-align: middle; }
/* Étiquettes des bâtiments : compactes en vue d'ensemble, plus grandes une fois la carte agrandie. */
#village-scene .hotspot { align-items: center; }
#village-scene .hotspot-label { font-size: 0.6rem; padding: 3px 7px; }
#village-scene [data-expanded="true"] .hotspot-label { font-size: 0.82rem; padding: 5px 10px; }
#village-scene .hotspot[data-goto="event"] { justify-content: flex-end; }
#village-scene .hotspot[data-goto="event"] .hotspot-label { position: absolute; right: 0; top: 40%; }
#village-scene .hotspot[data-goto="worlds"] .hotspot-label { position: absolute; left: 0; bottom: 8%; }

/* ---------- Familiers / Ménagerie ---------- */
.pet-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.pet-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--gold); text-align: center; }
.pet-slot.empty { border-color: var(--card-edge); border-style: dashed; }
.pet-slot > small:first-child { color: var(--muted); font-size: 0.58rem; letter-spacing: 0.08em; }
.pet-slot small { color: var(--muted); font-size: 0.64rem; }
.pet-slot b { font-size: 0.9rem; }
.pet-slot-face { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 2px solid var(--tier-color, var(--card-edge)); background: #000; display: grid; place-items: center; font-size: 1.8rem; box-shadow: 0 0 12px color-mix(in srgb, var(--tier-color, #000) 50%, transparent); }
.pet-slot-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.egg-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.egg { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; padding: 8px 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--tier-color, var(--card-edge)); }
.egg.empty { border-style: dashed; color: var(--muted); }
.egg.ready { box-shadow: 0 0 12px color-mix(in srgb, var(--tier-color) 60%, transparent); animation: eventPulse 1.6s ease-in-out infinite; }
.egg span { font-size: 1.6rem; } .egg b { color: var(--tier-color); font-size: 0.7rem; } .egg small { color: var(--muted); font-size: 0.62rem; }
.pet-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pet-card { display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto; gap: 2px 10px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); border-left: 3px solid var(--tier-color); }
.pet-card.locked { opacity: 0.6; }
.pet-card.locked .pet-face img { filter: grayscale(1) brightness(0.6); }
.pet-card.equipped { border-color: var(--gold); }
.pet-face { grid-row: 1 / 6; position: relative; width: 72px; height: 96px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--tier-color); }
.pet-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.pet-stars { position: absolute; top: 3px; left: 4px; color: var(--tier-color); font-size: 0.6rem; text-shadow: 0 0 4px #000; }
.pet-tag { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 0.55rem; font-weight: 800; background: #000000b0; color: var(--gold); }
.pet-card b { font-size: 0.9rem; color: var(--tier-color); }
.pet-card small { color: var(--muted); font-size: 0.66rem; }
.pet-card .pet-line { color: #d8d2e6; }
.pet-card .loot-line { margin-top: 4px; }

/* ===== Bannière céleste (Ombre & Divinité) ===== */
.summon-tabs .tab-celestial { color: #d8c5ff; }
.summon-tabs .tab-celestial.active { background: linear-gradient(135deg, rgba(120, 80, 220, 0.35), rgba(255, 210, 120, 0.25)); border-color: #b79cff; }
.wish-card.celestial { border-color: color-mix(in srgb, #b79cff 60%, transparent); box-shadow: inset 0 0 0 1px rgba(183, 156, 255, 0.25); }

/* ===== Épreuves (trials.js) : tours ===== */
.tower-list { display: grid; gap: 6px; }
.tower-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--faction-color) 45%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--faction-color) 12%, transparent), transparent 60%), var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tower-card:disabled, .tower-card.locked { opacity: 0.55; cursor: default; filter: grayscale(0.5); }
.tower-card.done { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 195, 90, 0.3); }
.tower-icon { font-size: 1.5rem; text-align: center; }
.tower-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tower-copy b { font-size: 0.9rem; }
.tower-copy small { color: var(--muted); font-size: 0.66rem; }
.tower-copy .brief-gauge { display: block; margin-top: 4px; }
.tower-bonus { font-weight: 800; color: var(--faction-color); font-size: 0.85rem; white-space: nowrap; }
.faction-bonus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.faction-bonus-grid span { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 9px; background: #00000040; border: 1px solid color-mix(in srgb, var(--faction-color) 35%, transparent); }
.faction-bonus-grid i { font-style: normal; font-size: 1.1rem; }
.faction-bonus-grid small { color: var(--muted); font-size: 0.56rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.faction-bonus-grid b { color: var(--faction-color); font-size: 0.8rem; }
.trial-floor-head { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.trial-floor-head > span { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 9px; background: #00000040; }
.trial-floor-head small { color: var(--muted); font-size: 0.58rem; letter-spacing: 0.06em; }
.trial-floor-head b { color: #f3ead3; font-size: 1.05rem; }
.trial-floor-head b em { font-style: normal; color: var(--muted); font-size: 0.7rem; }
.trial-floor-head .ready { letter-spacing: 0; font-weight: 700; }
.trial-floor-head .ready.good { color: #7fd68a; } .trial-floor-head .ready.fair { color: #e8c35a; } .trial-floor-head .ready.warn { color: #e8934a; } .trial-floor-head .ready.bad { color: #e86a6a; }
.trial-enemies .team-slot { border-color: color-mix(in srgb, var(--faction-color, #888) 60%, transparent); cursor: default; }

/* ===== Emblèmes de faction unifiés (mêmes PNG que l'écran Héros, via App.factionIconMarkup) ===== */
.tower-icon .faction-emblem { width: 34px; height: 34px; }
.faction-bonus-grid .faction-emblem { width: 26px; height: 26px; }
.faction-picker .faction-emblem { width: 20px; height: 20px; margin-right: 3px; }
.forge-h .faction-emblem, .forge-empty .faction-emblem, .result-reward .faction-emblem, .trial-floor .faction-emblem { width: 1.3em; height: 1.3em; }
.wish-card em .faction-emblem { width: 1.2em; height: 1.2em; margin-right: 2px; }

/* ===== Coffre (inventory.js) ===== */
.village-corner.corner-right-2 { top: calc(2.5% + 56px); }
.inv-section .forge-h { flex-wrap: wrap; }
.inv-section .forge-h .inv-go { margin-left: auto; }
.inv-sub { margin: 8px 0 4px; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.inv-grid.two { grid-template-columns: repeat(2, 1fr); }
.inv-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--card-edge); background: #00000040; color: var(--text); font: inherit; cursor: pointer; }
.inv-cell.static { cursor: default; }
.inv-cell i { font-style: normal; font-size: 1.25rem; line-height: 1; display: grid; place-items: center; height: 24px; }
.inv-cell i .vf-icon { width: 22px; height: 22px; }
.inv-cell b { font-size: 0.95rem; color: #f3ead3; }
.inv-cell small { color: var(--muted); font-size: 0.58rem; text-align: center; line-height: 1.15; }
.inv-cell:hover { border-color: var(--gold); }
.mat-chip.empty { opacity: 0.45; }
.mat-chip .faction-emblem { width: 1.2em; height: 1.2em; }
.inv-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 6px; }
.inv-item { display: flex; flex-direction: column; gap: 1px; padding: 5px 7px; border-radius: 8px; background: #00000040; border-left: 3px solid var(--tier, var(--card-edge)); }
.inv-item b { font-size: 0.72rem; color: var(--tier, #f3ead3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-item small { color: var(--muted); font-size: 0.6rem; }
.inv-item.relic { background: linear-gradient(90deg, rgba(232, 195, 90, 0.16), #00000040); }

/* ===== Aide (help.js) ===== */
.help-search input { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--card-edge); background: #00000050; color: var(--text); font: inherit; font-size: 0.85rem; }
.help-search input:focus { outline: none; border-color: var(--gold); }
.help-tabs { margin-top: 8px; }
.help-list { display: grid; gap: 8px; }
.help-card { padding: 9px 11px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge); }
.help-head { display: flex; align-items: center; gap: 8px; }
.help-head i { font-style: normal; font-size: 1.15rem; line-height: 1; display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; }
.help-head i .vf-icon { width: 22px; height: 22px; }
.help-head b { font-size: 0.86rem; color: #f3ead3; flex: 1; min-width: 0; }
.help-head b em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 0.72rem; }
.help-head .help-go { flex: 0 0 auto; }
.help-card p { margin: 6px 0 0; font-size: 0.76rem; line-height: 1.35; color: #d9d2c4; }
.help-card p small { display: block; color: var(--muted); font-size: 0.58rem; letter-spacing: 0.08em; margin-bottom: 1px; }
.help-card.faq .help-head b { font-size: 0.82rem; }

/* ===== Amis (friends.js) ===== */
.village-corner.corner-right-3 { top: calc(2.5% + 112px); }
.friend-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #ffffff10; }
.friend-row:last-child { border-bottom: 0; }
.friend-avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 1px solid var(--card-edge); background: #00000060; display: grid; place-items: center; }
.friend-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.friend-avatar i { font-style: normal; font-weight: 800; color: #f3ead3; }
.friend-avatar .dot { position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: #666; border: 2px solid #14100a; }
.friend-row.online .friend-avatar .dot { background: #7fd68a; box-shadow: 0 0 6px #7fd68a; }
.friend-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.friend-copy b { font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-copy small { color: var(--muted); font-size: 0.66rem; }
.friend-actions { display: flex; gap: 4px; }
.friend-actions .btn { position: relative; }
.friend-actions .badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: #e86a6a; color: #fff; font-size: 0.58rem; font-style: normal; font-weight: 800; display: grid; place-items: center; }
.online-tag { color: #7fd68a; font-size: 0.68rem; } .offline-tag { color: var(--muted); font-size: 0.68rem; }
.dm-thread { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; padding: 4px 0 8px; }
.dm-msg { display: flex; flex-direction: column; gap: 1px; max-width: 80%; padding: 6px 10px; border-radius: 12px; font-size: 0.8rem; }
.dm-msg.me { align-self: flex-end; background: linear-gradient(135deg, #5a4620, #3a2f18); border-bottom-right-radius: 4px; }
.dm-msg.them { align-self: flex-start; background: #ffffff12; border-bottom-left-radius: 4px; }
.dm-msg small { color: var(--muted); font-size: 0.56rem; align-self: flex-end; }
.dm-form { display: flex; gap: 6px; margin-top: 4px; }
.dm-form input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--card-edge); background: #00000050; color: var(--text); font: inherit; font-size: 0.82rem; }
.dm-form input:focus { outline: none; border-color: var(--gold); }

/* ===== Compte en ligne (account.js) ===== */
.acct-title-btn { margin-top: 10px; opacity: 0.85; }
.account-card { text-align: left; max-width: 420px; }
.acct-status { margin: 6px 0 8px; font-size: 0.78rem; color: #d9d2c4; line-height: 1.35; }
.acct-status b { color: #f3ead3; } .acct-err { color: #e86a6a; font-style: normal; }
.acct-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e8c35a; margin-right: 4px; vertical-align: middle; }
.acct-dot.on { background: #7fd68a; box-shadow: 0 0 6px #7fd68a; } .acct-dot.off { background: #777; }
.acct-form { display: grid; gap: 8px; }
.acct-form label { display: grid; gap: 3px; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.04em; }
.acct-form input { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--card-edge); background: #00000050; color: var(--text); font: inherit; font-size: 0.88rem; }
.acct-form input:focus { outline: none; border-color: var(--gold); }
.acct-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.acct-players { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Objets illustrés : laisser respirer la matière et garder les badges lisibles. */
.forge-item-icon { width: 60px; height: 60px; border-radius: 7px; background: radial-gradient(ellipse at 50% 30%, #34394366, #080c12 80%); }
.forge-item-icon > .vf-icon-art { width: 52px; height: 52px; }
.forge-item-icon > small, .forge-item-icon > em { z-index: 1; }
.forge-preview-icon { width: 104px; height: 104px; border-radius: 7px; }
.forge-preview-icon > .vf-icon-art { width: 96px; height: 96px; }
.forge-preview-head > div { min-width: 0; overflow-wrap: anywhere; }
.forge-piece > span > .vf-icon-art { width: 38px; height: 38px; }
.forge-pick-face > .vf-icon-art, .forge-icon > .vf-icon-art { width: 38px; height: 38px; }
.mat-chip > .vf-icon-art { width: 30px; height: 30px; }
.inv-cell i { height: 42px; }
.inv-cell i .vf-icon-art { width: 38px; height: 38px; }
.egg > span > .vf-icon-art { width: 58px; height: 58px; }
.inv-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.inv-item > .vf-icon-art { grid-row: 1 / 3; width: 38px; height: 38px; }
.inv-item > b, .inv-item > small { grid-column: 2; min-width: 0; }
.shop-icon > .vf-icon-art { width: 38px; height: 38px; }
.help-head i { width: 36px; height: 36px; }
.help-head i .vf-icon-art { width: 34px; height: 34px; }
.forge-item { grid-template-columns: 60px minmax(0, 1fr) auto; }
.shop-item { grid-template-columns: 40px minmax(0, 1fr) auto; }
@media (max-width: 540px) {
  .forge-pieces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .forge-item { grid-template-columns: 60px minmax(0, 1fr); }
  .forge-preview-icon { width: 88px; height: 88px; }
  .forge-preview-icon > .vf-icon-art { width: 80px; height: 80px; }
}
.forge-item-actions .btn small > .vf-icon-art, .forge-cost .vf-icon-art { width: 20px; height: 20px; vertical-align: -5px; }

/* ===== Fiche héros : emplacements cliquables + sélecteur d'équipement (forge.js) ===== */
.gear-slot.interactive { cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.gear-slot.interactive:hover, .gear-slot.interactive:focus-visible { border-color: var(--gold) !important; outline: none; }
.gear-slot.interactive:active { transform: scale(0.97); }
.gear-slot.interactive.empty small { color: var(--gold); }
button.gear-mode-badge { font: inherit; cursor: pointer; }
#gear-picker { z-index: 1200; }
.gear-picker-card { text-align: left; max-width: 440px; max-height: 88vh; overflow-y: auto; }
.gp-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; margin-top: 6px; border-radius: 10px; background: #00000040; border-left: 3px solid var(--tier, var(--card-edge)); }
.gp-item.current { background: linear-gradient(90deg, color-mix(in srgb, var(--tier, #e8c35a) 18%, transparent), #00000040); }
.gp-icon { display: grid; place-items: center; width: 44px; height: 44px; }
.gp-icon .vf-icon { width: 40px; height: 40px; }
.gp-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gp-copy b { font-size: 0.8rem; color: var(--tier, #f3ead3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-copy small { color: var(--muted); font-size: 0.62rem; }
.gp-copy .gp-stats { color: #d9d2c4; }
.gp-actions .btn { white-space: nowrap; }
.gp-upgrade { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: #00000040; border: 1px dashed var(--card-edge); }
.gp-upgrade-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.8rem; }
.gp-upgrade-head small { color: var(--muted); }
.gp-upgrade .forge-cost { margin: 6px 0; }

/* ===== Exploration : page Mondes / page du Monde (2026-09-05) ===== */
.worlds-list > * { flex: 0 0 auto; }                 /* les cartes ne se compriment plus : la liste défile */
.world-detail .world-head { cursor: default; }
.world-detail .world-head:disabled { opacity: 1; }
.worlds-back { padding: 2px 0 4px; }
.worlds-back b { flex: 1; }
.worlds-hint { text-align: center; padding: 4px 8px; }
.world-next { padding: 4px 10px 12px; }
.world-next .btn { width: 100%; }

/* ===== Épreuves : rotation hebdomadaire des Tours de faction ===== */
.tower-rotation { padding: 6px 10px; margin-bottom: 6px; border-radius: 10px; background: #00000040; border: 1px dashed var(--card-edge); font-size: 0.76rem; color: #d9d2c4; line-height: 1.4; }
.tower-rotation b { color: #f3ead3; }
.tower-rotation small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.62rem; }
.tower-rotation .faction-emblem { width: 1.2em; height: 1.2em; }
.tower-card.closed { opacity: 0.6; filter: saturate(0.5); }
.tower-closed { font-style: normal; font-size: 0.6rem; font-weight: 700; color: #e86a6a; margin-left: 4px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ===== Combat : les héros sont représentés par leur carte de collection (2026-09-06) ===== */
.battlefield:has(.card-unit) .grid { height: auto; grid-template-rows: repeat(2, auto); gap: 6px 5px; }
.battlefield:has(.card-unit) { justify-content: flex-start; gap: 2px; }
.unit.card-unit { padding: 0 0 2px; background: none; border: 0; border-radius: 6px; justify-content: flex-start; overflow: visible; }
.unit.card-unit .unit-sprite.unit-card { width: 100%; max-width: none; flex: 0 0 auto; display: block; }
.unit.card-unit .hero-card-compact { width: 100%; content-visibility: visible; contain-intrinsic-size: auto; cursor: default; transition: transform 0.15s, filter 0.3s; }
.unit.card-unit .hero-card-compact .nephilim-nameplate small, .unit.card-unit .hero-card-compact .nephilim-nameplate em { display: none; }
.unit.card-unit .hero-card-compact .nephilim-nameplate strong { font-size: clamp(0.5rem, 2.4vw, 0.72rem); }
.unit.card-unit .uname { display: none; }                     /* le nom est déjà sur la plaque de la carte */
.unit.card-unit .bars { width: 96%; margin-top: 2px; }
.unit.card-unit .hp-num { font-size: 0.58rem; }
.unit.card-unit .shield-badge { z-index: 8; top: 4px; right: 4px; background: #000a; padding: 1px 4px; border-radius: 6px; }
.unit.card-unit.hit .hero-card-compact { animation: spriteHurt 0.4s ease; }
.unit.card-unit.healed .hero-card-compact { filter: drop-shadow(0 0 8px #5fd668) brightness(1.15); }
.unit.card-unit.casting .hero-card-compact { filter: drop-shadow(0 0 12px var(--gold)) brightness(1.2); transform: translateY(-4px) scale(1.04); }
.unit.card-unit.dead .hero-card-compact { filter: grayscale(1) brightness(0.45); }
.unit.card-unit.dead { opacity: 0.35; }
.grid-enemy .unit.card-unit .hero-card-compact { border-color: color-mix(in srgb, #e86a6a 40%, var(--tier-color)) !important; }
@media (max-height: 760px) {
  .unit.card-unit .bars { margin-top: 1px; }
  .unit.card-unit .hp-num { font-size: 0.52rem; }
  .battlefield:has(.card-unit) .grid { gap: 3px 4px; }
}
/* Hauteur : 4 rangées de cartes + barres + journal doivent tenir sans défilement → largeur de carte déduite de la hauteur d'écran. */
.unit.card-unit .unit-sprite.unit-card { width: min(100%, calc((100dvh - 340px) / 4 * 0.667)); margin: 0 auto; }
.unit.card-unit { align-items: center; }
.battlefield:has(.card-unit) { padding-top: 6px; }
.starter-card.starter-star { border-color: var(--gold); box-shadow: 0 0 14px rgba(232, 195, 90, 0.35); }

/* ===== Barre du bas partagée (bottom-nav.js) : Alliance, Arène, Épreuves, Aide ===== */
.screen.has-bottom-bar { padding-bottom: 0; }
.screen.has-bottom-bar > .shared-bottom-bar { flex: 0 0 auto; margin-top: 4px; }

/* ===== Héros : « Mon armée » en liste verticale pleine largeur, filtrable par faction (2026-09-06) ===== */
.owned-ranking-list { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow-x: visible; scroll-snap-type: none; padding-bottom: 2px; }
.owned-rank-card { scroll-snap-align: none; min-width: 0; }
@media (min-width: 720px) { .owned-ranking-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.army-filter { margin: 2px 0 10px; }
.army-filter[hidden] { display: none; }
.army-filter .faction-filter-btn small { margin-left: 4px; opacity: 0.75; font-size: 0.66rem; }

/* ===== Tirage de départ : 5 choix 3★ + 2 compagnons 1★ (2026-09-06) ===== */
.starter-panel { max-width: 460px; max-height: 92vh; overflow-y: auto; }
#starter-cards.starter-cards { display: block; margin: 6px 0; }
.starter-step { margin: 8px 0 6px; font-size: 0.78rem; color: #dac89f; text-align: left; }
.starter-step b { color: var(--gold); }
.starter-choices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.starter-companions { display: grid; grid-template-columns: repeat(2, minmax(0, 120px)); gap: 8px; justify-content: center; }
.starter-choices .starter-card { padding: 5px 3px; gap: 2px; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.starter-choices .starter-card b { font-size: 0.62rem; }
.starter-choices .starter-card small, .starter-choices .starter-card em { font-size: 0.5rem; line-height: 1.15; }
.starter-choices .starter-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.starter-card.selected { border-color: var(--gold); box-shadow: 0 0 16px rgba(232, 195, 90, 0.5); transform: translateY(-3px) scale(1.04); }
.starter-card.selected .starter-role { color: var(--gold); font-weight: 800; }
.starter-companion { opacity: 0.92; }
@media (max-width: 400px) { .starter-choices { grid-template-columns: repeat(3, 1fr); } }

/* Étiquettes des bâtiments SOUS le bâtiment plutôt qu'en plein milieu (demande utilisateur 2026-09-06). */
#village-scene .hotspot { align-items: flex-end; justify-content: center; padding-bottom: 1.5%; box-sizing: border-box; }
#village-scene .hotspot[data-goto="event"] { justify-content: center; }
#village-scene .hotspot[data-goto="event"] .hotspot-label { position: static; }
#village-scene .hotspot[data-goto="worlds"] .hotspot-label { position: static; }
#village-scene .hotspot .hotspot-label { transform: translateY(42%); }                 /* l'étiquette pend sous le bâtiment */
#village-scene .hotspot[data-goto="event"] { justify-content: flex-start; }             /* Boss serveur : à gauche du dragon, hors des cadrans */
#village-scene .hotspot[data-goto="event"] .hotspot-label { transform: translate(-30%, 42%); }
#village-scene .hotspot[data-goto="heroes"] .hotspot-label { transform: translateY(10%); } /* château : reste sur le parvis, pas sur la fontaine */
/* Vue compacte (carte non agrandie) : éviter les cadrans d'angle. */
#village-scene [data-expanded="false"] .hotspot[data-goto="worlds"] .hotspot-label { transform: translate(38%, 42%); }
#village-scene [data-expanded="false"] .hotspot[data-goto="event"] .hotspot-label { transform: translate(-72%, 70%); }
#village-scene [data-expanded="false"] .hotspot[data-goto="pets"] .hotspot-label { transform: translate(-12%, 42%); }
