/* Page Collection : en-tête, barre de tri, filtres et recyclage. */
.collection-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.collection-head h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); text-transform: uppercase; }
.kicker { margin: 0 0 2px; color: var(--seal); font: 800 12px ui-monospace, Consolas, monospace; letter-spacing: .14em; }

.summary { display: flex; padding: 14px 4px; background: linear-gradient(165deg, #1d1650, #100c27); border: 2px solid var(--line); box-shadow: inset 0 0 0 1px #7c5cff40; }
.summary-block { display: flex; flex-direction: column; min-width: 110px; padding: 0 20px; }
.summary-block + .summary-block { border-left: 1px solid var(--line); }
.summary-block b { font: italic 900 26px var(--titre); line-height: 1.2; }
.summary-block b em { color: #ffffff59; }
.summary-block.accent b { color: #ff5a45; }
.summary-block small { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.summary-bar { height: 5px; margin-top: 5px; background: #ffffff1c; }
.summary-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff4d38, #ffc83d); }

.toolbar { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-bottom: 12px; }
.search-box, .rarity-pills, .tool, .segmented { background: #120e2b; border: 2px solid var(--line); border-radius: 6px; }
.search-box { position: relative; flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; min-height: 52px; }
.search-box input { flex: 1; width: 100%; border: 0; background: none; padding: 12px 4px; }
.search-box:focus-within { border-color: var(--accent); }
.search-info { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); font: italic 900 14px serif; }
.search-help { position: absolute; top: calc(100% + 6px); right: 0; z-index: 4; max-width: 300px; margin: 0; padding: 10px 14px; background: #1d1650; border: 2px solid var(--accent); font-size: 13px; }

.rarity-pills { display: flex; align-items: center; gap: 6px; padding: 6px 10px; }
.rarity-pills button { border: 2px solid transparent; color: #fff; font-weight: 900; }
.rarity-pills .dot { width: 34px; height: 34px; padding: 0; border-radius: 8px; background: color-mix(in srgb, var(--rc) 55%, #0b0820); }
.rarity-pills .every { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 6px; border-radius: 8px; background: none; }
.rarity-pills .every i { width: 24px; height: 24px; border-radius: 6px; background: conic-gradient(#35e0d0, #4a9dff, #a86bff, #ff5fb8, #ff5a5a, #ffc83d, #4be37a, #35e0d0); }
.rarity-pills .every.on { background: #ffffff1a; }
.rarity-pills .on { border-color: #fff; }
.rarity-pills .dot.on { background: var(--rc); color: #12091f; box-shadow: 0 0 12px var(--rc); }

.tool { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 52px; color: #fff; font-weight: 800; }
.tool:hover { border-color: var(--accent); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--seal); color: #fff; font-size: 12px; font-weight: 900; }
.recycle-open { justify-content: center; width: 56px; padding: 0; color: #3ecf8e; border-color: #1f6b4b; background: #0f241d; font-size: 24px; }
.recycle-open .badge { position: absolute; top: -9px; right: -9px; }
.badge.green { background: #3ecf8e; color: #072015; }

.segmented { display: flex; padding: 4px; gap: 4px; }
.segmented button { padding: 0 18px; min-height: 40px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-weight: 800; }
.segmented button.on { background: #fff; color: #1d1440; }

.filter-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; width: min(660px, 100%); padding: 18px; background: #130e30; border: 2px solid var(--accent); box-shadow: 0 20px 50px #000c, 0 0 0 4px #7c5cff33; }
.filter-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.filter-fields label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.filter-fields select { width: 100%; }
.filter-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn.apply { background: linear-gradient(#ff6a55, #e5321c); }

.result-count { margin: 6px 0 0; color: var(--muted); font: 700 13px ui-monospace, Consolas, monospace; }

/* Fenêtre de recyclage */
.recycle h2 { margin: 0 40px 6px 0; text-align: left; font: italic 900 22px var(--titre); text-transform: uppercase; }
.recycle > p { margin: 0 0 14px; text-align: left; font-size: 13px; }
.recycle-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.recycle-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 84px; padding: 10px 12px; text-align: left; color: #fff; background: color-mix(in srgb, var(--rc) 8%, #120e2b); border: 2px solid color-mix(in srgb, var(--rc) 35%, #120e2b); border-radius: 8px; }
.recycle-tile strong { color: var(--rc); font-size: 14px; }
.recycle-tile span { font-size: 13px; }
.recycle-tile small { color: var(--rc); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.recycle-tile[aria-pressed='true'] { background: color-mix(in srgb, var(--rc) 22%, #120e2b); border-color: var(--rc); box-shadow: 0 0 14px -4px var(--rc); }
.recycle-tile:disabled { opacity: .45; }
/* Le halo des cartes rares ne doit pas faire croire qu'une case ou une pastille est cochée. */
.recycle-tile[aria-pressed='false'], .rarity-pills .dot:not(.on) { box-shadow: none; }
.recycle-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.btn.recycle-go { background: linear-gradient(#ff6a55, #e5321c); }
/* La fenêtre grandit avec son contenu : c'est le fond qui défile si l'écran est petit. */
.modal:has(.recycle) { width: min(700px, 100%); max-height: none; overflow: visible; margin: auto; }
/* Les textes d'une carte restent dans la carte : ils ne passent plus devant les menus. */
.card { isolation: isolate; }

@media (max-width: 900px) {
  .summary { width: 100%; }
  .summary-block { flex: 1; min-width: 0; padding: 0 10px; }
  .summary-block b { font-size: 19px; }
  .rarity-pills { flex: 1 1 100%; justify-content: space-between; }
  .rarity-pills .dot { width: 32px; height: 32px; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; }
}
@media (max-width: 640px) {
  .filter-fields { grid-template-columns: 1fr; }
}

/* bouton du mode développement, sur toute la largeur de l'en-tête */
.collection-head .give-all { flex-basis: 100%; }
