/* Interactions : mise en page. Les composants (cartes de sublimation, grille de sorts, onglets,
   panneaux) viennent de builder-extrait.css, copie des règles du Builder. */
:root {
  --bg: #101319; --bg2: #151922; --bg3: #1a1f29; --bg-card: #161a22; --bg-header: #12161d;
  --border: rgba(255,255,255,0.09); --border2: rgba(255,255,255,0.14);
  --accent: #f0c040; --accent2: #f5d573; --accent-rgb: 240, 192, 64;
  --text: #deded8; --text2: rgba(226,226,218,0.76); --text3: rgba(218,218,210,0.52); --text-white: #f4f4ef;
  --r-rare: #7ec84a; --r-mythique: #e2be92; --r-legendaire: #b0c345; --r-epique: #c37ca7; --r-relique: #b194d2;
  --oui: #84cc16; --non: #ef4444; --cond: #f0c040;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.45; }
/* halos du Builder, à la couleur de l'accent */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 45% at 18% 12%, rgba(var(--accent-rgb), 0.10) 0%, transparent 65%),
    radial-gradient(50% 40% at 85% 80%, rgba(var(--accent-rgb), 0.08) 0%, transparent 65%);
}
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ix-stage { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; min-height: 620px; }
.tabs-bar { flex-shrink: 0; }
.home-nav-btn { text-decoration: none; }
h1.ix-titre { margin: 0; cursor: default; font-family: 'Rajdhani', 'Inter', sans-serif; }
/* dans la grille de la classe, les sorts qui déclenchent la sublimation choisie ressortent */
.sp-pool-ico-btn.ix-touche { outline: 2px solid var(--oui); outline-offset: 2px; }
.sp-pool-ico-btn.ix-touche.ix-selon { outline-color: var(--cond); }
.sp-pool.ix-filtre .sp-pool-ico-btn:not(.ix-touche):not(.is-equipped) { filter: grayscale(.85) brightness(.5); }

/* trois colonnes, comme un onglet du Builder */
.ix-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(380px, 1.5fr) minmax(300px, 1.05fr); gap: 14px; padding: 14px 24px 18px; }
.ix-col { min-width: 0; min-height: 0; }
.ench-fusion-card.ix-col, .ench-fusion-card.ix-panneau { flex: initial; flex-direction: column; gap: 12px; }
.ix-centre { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb), .45) transparent; }
.ix-panneau { flex-shrink: 0 !important; }

/* ── sublimations ── */
.ix-grid-subs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 4px 0 0; }
.ench-subli-card { font: inherit; color: inherit; text-align: left; }
.ench-subli-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ix-genre { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--subli-c); font-weight: 700; }
.ix-sous-carte { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-pill[data-rarity="souvenir"] { border-color: rgba(176,195,69,.5); background: rgba(176,195,69,.08); }
.sr-pill.active[data-rarity="souvenir"] { box-shadow: 0 0 10px rgba(176,195,69,.4); }
.ix-rien { grid-column: 1 / -1; color: var(--text3); padding: 8px 2px; }

/* ── classes et sorts ── */
.ix-classes { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.ix-classe { padding: 0; aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--border2); background: rgba(255,255,255,.03); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .1s; overflow: hidden; }
.ix-classe img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ix-classe:hover { border-color: rgba(var(--accent-rgb), .6); transform: translateY(-1px); }
.ix-classe.active { border-color: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .10); }
.ix-kit { flex: initial; width: 100%; font-size: 14px; }
.ix-kit[aria-pressed="true"] { background: rgba(240,192,64,0.14); border-color: rgba(240,192,64,0.5); color: #f0c040; }
.sp-pool { padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb), .45) transparent; }
.sp-pool-ico-btn { cursor: pointer; width: 56px; height: 56px; padding: 0; font: inherit; }
.sp-pool-ico-btn:active { cursor: pointer; }
.sp-pool-ico-btn.is-equipped::after { font-size: 22px; }
.sp-pool-ico-btn.ix-petit { width: 44px; height: 44px; flex-shrink: 0; cursor: default; }

/* ── sélection ── */
.ix-entete { display: flex; align-items: center; justify-content: space-between; }
.ix-entete .sp-grid-title { margin: 0; }
.ix-vider { height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border2); background: rgba(255,255,255,.04); color: var(--text2); font-size: 12px; cursor: pointer; }
.ix-vider:hover { color: var(--text-white); border-color: rgba(var(--accent-rgb), .5); }
.ix-choix { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 56px; }
.ix-choix .ench-subli-card { width: 210px; }
.ix-choix-vide { color: var(--text3); }
.ix-choix .ix-classe { width: 56px; height: 56px; aspect-ratio: auto; flex-shrink: 0; }
.ix-exemples { display: flex; flex-wrap: wrap; gap: 6px; }
.ix-exemples .sp-tab { flex: initial; padding: 5px 10px; font-size: 13px; }

/* ── résultats ── */
.ix-resultats { display: flex; flex-direction: column; gap: 14px; }
.ix-bloc { background: var(--bg-card); border: 1px solid var(--border2); border-radius: 12px; padding: 16px; }
.ix-bloc h2 { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text2); margin: 0 0 12px; }
.ix-bloc h3 { margin: 0; font-size: 15px; color: var(--text-white); }
.ix-vide { color: var(--text3); margin: 0; padding: 0 2px; }

.ix-verdict { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.ix-verdict:first-of-type { border-top: 0; padding-top: 0; }
.ix-verdict:last-child { padding-bottom: 0; }
.ix-etat { align-self: start; text-align: center; padding: 6px 4px; border-radius: 8px; font-weight: 700; font-size: 13px; font-family: 'Rajdhani', 'Inter', sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.ix-etat.oui { color: var(--oui); background: rgba(132,204,22,.12); border: 1px solid rgba(132,204,22,.45); }
.ix-etat.non { color: var(--non); background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.45); }
.ix-etat.cond { color: var(--cond); background: rgba(240,192,64,.10); border: 1px solid rgba(240,192,64,.45); }
.ix-etat.info { color: var(--text2); background: rgba(255,255,255,.04); border: 1px solid var(--border2); }
.ix-quoi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-weight: 700; color: var(--text-white); }
.ix-quoi .plus { color: var(--text3); font-weight: 400; }
.ix-pourquoi { margin: 5px 0 0; color: var(--text2); }
.ix-ref { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.ix-ref img { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; }

.ix-ordre { margin: 0; padding: 0; list-style: none; counter-reset: o; display: grid; gap: 6px; }
.ix-ordre li { counter-increment: o; display: flex; align-items: center; gap: 10px; }
.ix-ordre li::before { content: counter(o); width: 24px; height: 24px; border-radius: 6px; background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .35); color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ix-ordre .ench-subli-card { width: 240px; cursor: default; }
/* ── fiches de fonctionnement d'un sort ou passif ── */
.ix-resume { margin: 0 0 4px; color: var(--text); font-size: 14.5px; line-height: 1.55; }
.ix-resume b, .ix-lien-txt b { color: var(--text-white); }
.ix-nom-etat { color: var(--accent) !important; }
.ix-lien { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.ix-lien-avec { display: flex; align-items: center; gap: 6px; }
.ix-lien-avec .plus { color: var(--text3); }
.ix-lien-avec .sp-pool-ico-btn { cursor: pointer; }
.ix-lien-txt p { margin: 0; color: var(--text2); line-height: 1.5; }
/* dans la grille, pastille or sur ce qui a une fiche */
.sp-pool-ico-btn.ix-a-fiche::before { content: ''; position: absolute; top: -4px; left: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-card); z-index: 4; box-shadow: 0 0 6px rgba(var(--accent-rgb), .8); }
.ix-chaine { margin: 0 0 14px; padding: 9px 12px; border-radius: 9px; background: rgba(var(--accent-rgb), .08); border: 1px solid rgba(var(--accent-rgb), .30); color: var(--text-white); font-weight: 700; font-size: 15px; }
.ix-chaine .fleche { color: var(--accent); font-weight: 400; }
.ix-moment { margin: 14px 0 8px; font-weight: 700; color: var(--text-white); }
.ix-moment:first-of-type { margin-top: 0; }

.ix-fiche-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ix-fiche-tete .ench-subli-card { width: 240px; cursor: default; }
.ix-jeu { margin: 0 0 12px; color: var(--text2); }
.ix-ligne { padding: 10px 0; border-top: 1px solid var(--border); }
.ix-ligne .qui { color: var(--text-white); font-weight: 700; }
.ix-ligne .si { color: var(--text2); margin-top: 6px; }
.ix-effets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.ix-effet { padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.04); border: 1px solid var(--border2); font-size: 12.5px; color: var(--text); }
.ix-effet.hit { border-color: rgba(132,204,22,.55); background: rgba(132,204,22,.10); color: #d6f0a8; }

.ix-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ix-sort { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; background: var(--bg3); border: 1px solid var(--border2); min-width: 0; }
.ix-sort .n { font-weight: 700; color: var(--text-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-sort .d { font-size: 12px; color: var(--text2); }
.ix-sort.cond { border-color: rgba(240,192,64,.45); }
.ix-note { margin: 12px 0 0; color: var(--text3); font-size: 12.5px; }
.ix-compte { font-family: 'JetBrains Mono', monospace; color: var(--accent); margin-left: 4px; }

/* ── écran étroit : une colonne, sélection et résultats d'abord ── */
@media (max-width: 1100px) {
  html, body { height: auto; }
  .ix-stage { height: auto; min-height: 0; }
  .ix-cols { display: flex; flex-direction: column; padding: 12px 12px 40px; }
  .ix-centre { order: -1; overflow: visible; }
  .ix-grid-subs { max-height: 330px; }
  .sp-pool { max-height: 360px; flex: initial; }
  .tabs-bar { height: 52px !important; }
  .nav-history { left: 12px; }
  .home-nav-btn span { display: none; }
}
@media (max-width: 560px) {
  .ix-verdict { grid-template-columns: 1fr; gap: 8px; }
  .ix-etat { justify-self: start; padding: 4px 14px; }
  .ix-grid-subs { grid-template-columns: 1fr; }
  .ix-choix .ench-subli-card, .ix-ordre .ench-subli-card, .ix-fiche-tete .ench-subli-card { width: 100%; }
  .ix-classes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.ix-tete-classe { width: 44px; height: 44px; object-fit: contain; }

/* ── bouton DATA : en haut à gauche, à côté d'Accueil, plein or et pulsant ── */
.ix-data { position: relative; }
.ix-data-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid #ffe08a; background: linear-gradient(180deg, #ffd766, #f0c040 55%, #d9a520); color: #1a1405; font-family: 'Rajdhani', 'Inter', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: 2px; cursor: pointer; animation: ix-pouls 1.8s ease-in-out infinite; }
.ix-data-btn:hover, .ix-data-btn[aria-expanded="true"] { animation: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .30), 0 0 22px rgba(var(--accent-rgb), .75); }
@keyframes ix-pouls { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .65), 0 0 10px rgba(var(--accent-rgb), .45); } 50% { box-shadow: 0 0 0 9px rgba(var(--accent-rgb), 0), 0 0 22px rgba(var(--accent-rgb), .85); } }
@media (prefers-reduced-motion: reduce) { .ix-data-btn { animation: none; box-shadow: 0 0 14px rgba(var(--accent-rgb), .7); } }
.ix-data-panneau { position: absolute; left: 0; top: calc(100% + 10px); z-index: 40; width: min(380px, calc(100vw - 24px)); padding: 13px 15px; border-radius: 10px; background: var(--bg3); border: 1px solid rgba(var(--accent-rgb), .55); box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 18px rgba(var(--accent-rgb), .22); font-family: 'Inter', sans-serif; }
.ix-data-panneau p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.55; }
.ix-data-panneau a { color: var(--accent); font-weight: 700; }
.nav-history { align-items: center; gap: 10px; }
@media (max-width: 560px) { .ix-data-panneau { left: -52px; } }
/* ── noms sous les icônes des interactions ── */
.ix-lien { align-items: start; }
.ix-lien-avec { align-items: flex-start; }
.ix-lien-avec .plus { margin-top: 12px; }
.ix-lien-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; }
.ix-lien-nom { font-size: 11.5px; font-weight: 700; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
/* ── recherche d'un sort ou passif, toutes classes : dernier quart de la colonne ── */
.ix-cherche { flex: 0 0 25%; min-height: 150px; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border2); }
.ix-cherche .sp-grid-title { margin: 0; }
.ix-trouves { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 5px; align-content: start; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb), .45) transparent; }
.ix-trouve { display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,.03); cursor: pointer; min-width: 0; }
.ix-trouve:hover { border-color: rgba(var(--accent-rgb), .55); }
.ix-trouve.pris { border-color: var(--accent); background: rgba(var(--accent-rgb), .10); }
.ix-trouve .sp-pool-ico-btn.ix-petit { width: 36px; height: 36px; pointer-events: none; }
.ix-trouve .n { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-trouve .d { font-size: 11.5px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-cherche-vide { margin: 2px 0 0; color: var(--text3); font-size: 13px; }
@media (max-width: 1100px) { .ix-cherche { flex: initial; } .ix-trouves { max-height: 260px; } }

.ix-lien-sub { grid-template-columns: 210px 1fr; align-items: center; }
.ix-lien-sub .ench-subli-card { width: 100%; }
@media (max-width: 560px) { .ix-lien-sub { grid-template-columns: 1fr; } }
