/* recyclage.css — Recycler ses doubles au choix (recyclage.js) : le mode sélection de la Collection et l'animation en éclats.
   Style « Brick ZR, les briques » (skill brikz-ui) : la barre du bas est une plaque, les raccourcis sont des tuiles, ce qui est
   choisi brille d'or (les tons nouveaux sont des jetons, ci-dessous). */
:root {
  --dore: #ffb81c;         /* une carte choisie pour le recyclage : son contour, sa pastille */
  --dore-clair: #ffe27a;
  --dore-ombre: #a86d00;
  --cristal: #6fe6ff;      /* le cyan des éclats (le solde de la Collection, l'icône) */
}

/* En mode sélection : seules les cartes qui ont des doubles ; ce qui ne sert pas au choix s'efface */
#collection-screen.rec-actif .coll-showcase-btn,
#collection-screen.rec-actif .coll-eclats .btn,
#collection-screen.rec-actif #coll-eclats-aide,
#collection-screen.rec-actif .filter-themes,
#collection-screen.rec-actif .coll-separe,
#collection-screen.rec-actif .theme-entete,
#collection-screen.rec-actif #collection-empty,
#collection-screen.rec-actif #collection-grid .coll-cell:not(.rec-ok) { display: none; }
#collection-screen.rec-actif .coll-eclats { margin-bottom: 8px; }

#rec-tete { margin: 0 0 12px; }
.rec-aide { margin: 0 0 10px; font-size: 13.5px; line-height: 1.4; color: var(--texte-2); }
.rec-puces { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-puce {
  min-height: 34px; padding: 0 11px; border: 0; border-radius: 6px; cursor: pointer; white-space: nowrap;
  background: var(--plaque); color: var(--texte); font: 700 13.5px/1 var(--font);
  box-shadow: 0 3px 0 var(--plaque-bord), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform var(--appui) var(--ease-out), box-shadow var(--appui) var(--ease-out);
}
.rec-puce:active { transform: translateY(3px); box-shadow: 0 0 0 var(--plaque-bord); }
.rec-vide { margin: 14px 0 0; padding: 14px; border-radius: var(--r-tuile); background: var(--plaque); color: var(--texte-2); font-size: 14px; line-height: 1.45; text-align: center; }

/* une carte : sa pastille « choisis / doubles » en bas, le « − » en haut à gauche ; choisie, elle brille d'or */
.coll-cell.rec-ok { -webkit-tap-highlight-color: transparent; }
.rec-badge {
  position: absolute; left: 50%; bottom: -8px; z-index: 3; transform: translateX(-50%);
  min-width: 46px; height: 24px; padding: 0 8px; border-radius: var(--r-brique);
  display: flex; align-items: center; justify-content: center; gap: 1px;
  background: var(--plaque-haut); color: var(--texte-2); font: 600 12.5px/1 var(--font); font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 0 var(--plaque-bord), 0 0 0 2px var(--plaque-nuit); pointer-events: none;
}
.rec-badge b { color: var(--texte); font-weight: 800; font-size: 14px; }
.rec-pris .rec-badge { background: linear-gradient(180deg, var(--dore-clair) 0 2px, var(--dore) 2px); color: #3a2600; box-shadow: 0 2px 0 var(--dore-ombre), 0 0 0 2px var(--plaque-nuit); }
.rec-pris .rec-badge b { color: #2a1c00; }
.coll-cell.rec-pris .bp-tc {
  box-shadow: 0 0 0 2.5px var(--dore), 0 0 14px 2px rgba(255,190,40,.55), 0 6px 16px rgba(0,0,0,.5);
  animation: rec-dore 1.6s ease-in-out infinite alternate;
}
@keyframes rec-dore {
  from { box-shadow: 0 0 0 2.5px var(--dore), 0 0 10px 1px rgba(255,190,40,.4), 0 6px 16px rgba(0,0,0,.5); }
  to { box-shadow: 0 0 0 2.5px var(--dore-clair), 0 0 18px 4px rgba(255,210,70,.65), 0 6px 16px rgba(0,0,0,.5); }
}
.rec-moins {
  position: absolute; top: -9px; left: -9px; z-index: 3; width: 30px; height: 30px; padding: 0; border: 2px solid #fff; border-radius: 50%;
  background: var(--plaque-haut); cursor: pointer; box-shadow: 0 2px 0 var(--plaque-bord);
  transition: transform var(--appui) var(--ease-out);
}
.rec-moins::before { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 3px; margin: -1.5px 0 0 -6px; border-radius: 2px; background: #fff; }
.rec-moins::after { content: ''; position: absolute; inset: -8px; } /* une cible plus grande pour le doigt */
.rec-moins:active { transform: scale(.9); }

/* la barre du bas : ce qu'on gagne, Annuler, Recycler */
#rec-barre {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 16px 12px; z-index: 5;
  background: var(--tenons-barre), var(--plaque-barre);
  box-shadow: 0 -1px 0 rgba(255,255,255,.06), 0 -4px 0 rgba(0,0,0,.18);
  animation: rec-monte .28s var(--ease-out) both;
}
@keyframes rec-monte { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.rec-total { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#rec-n { font-size: 13px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rec-gain { display: inline-flex; align-items: center; font-size: 19px; font-weight: 800; color: var(--cristal); font-variant-numeric: tabular-nums; }
#rec-barre .btn { flex: none; width: auto; min-height: 46px; padding-left: 14px; padding-right: 14px; }
@media (max-width: 350px) { #rec-barre .btn-secondary { padding-left: 10px; padding-right: 10px; } #rec-gain { font-size: 17px; } }

/* pendant l'animation, plus rien ne se touche */
#collection-screen.rec-en-cours #collection-grid, #collection-screen.rec-en-cours #rec-barre, #collection-screen.rec-en-cours #rec-tete { pointer-events: none; }
#collection-screen.rec-en-cours .screen-scroll { overflow: hidden; }

/* ── La scène du recyclage (Eclats3D) : un fond de nuit sur tout l'écran, comme l'ouverture d'un booster ── */
.rec-scene {
  position: fixed; inset: 0; z-index: 450; overflow: hidden; opacity: 0; transition: opacity .3s ease-out;
  background:
    radial-gradient(ellipse 70% 46% at 50% 58%, rgba(120,70,220,.34), rgba(255,110,40,.08) 55%, transparent 76%),
    radial-gradient(circle at 50% 10%, rgba(40,140,255,.2), transparent 38%),
    linear-gradient(180deg, #0c0930 0%, #120c48 52%, #070a1f 100%);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.rec-scene.rec-scene-on { opacity: 1; }
.rec-scene.rec-scene-off { opacity: 0; transition-duration: .3s; }
.rec-scene .rec-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* la réserve d'éclats, en haut : l'icône, le compteur qui monte */
.rec-reserve {
  position: absolute; z-index: 2; left: 50%; top: calc(var(--safe-top) + 28px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none;
}
.rec-reserve-ico {
  width: 64px; height: 64px; background: url(art/icones/eclats.svg) center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(111,230,255,.55));
}
.rec-reserve-n {
  font: 800 30px/1.05 var(--font); color: var(--cristal); font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #06223a, 0 0 14px rgba(111,230,255,.45);
}
.rec-reserve-txt { font: 600 13px/1 var(--font); color: var(--texte-2); letter-spacing: .04em; }
.rec-reserve.rec-charge .rec-reserve-ico { animation: rec-charge .22s ease-in-out infinite alternate; }
@keyframes rec-charge { from { transform: scale(1); } to { transform: scale(1.1); filter: drop-shadow(0 0 18px rgba(111,230,255,.95)); } }
.rec-reserve.rec-pleine .rec-reserve-ico { animation: rec-pleine .5s var(--ease-out); }
@keyframes rec-pleine { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
/* le bilan, en bas, quand tout est arrivé */
.rec-bilan {
  position: absolute; z-index: 2; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 48px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; pointer-events: none;
  opacity: 0; transform: translateY(14px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.rec-scene-fin .rec-bilan { opacity: 1; transform: none; }
.rec-bilan-gain { display: inline-flex; align-items: center; font: 800 40px/1 var(--font); color: var(--cristal); text-shadow: 0 3px 0 #06223a, 0 0 18px rgba(111,230,255,.5); }
.rec-bilan-gain .eclat-ico { width: 1em; height: 1em; margin-right: .2em; }
.rec-bilan-txt { font: 600 16px/1.3 var(--font); color: var(--texte); }
.rec-bilan-suite { margin-top: 10px; font: 600 14px/1 var(--font); color: var(--texte-2); animation: rec-suite 1.2s ease-in-out infinite alternate; }
@keyframes rec-suite { from { opacity: .45; } to { opacity: 1; } }
.rec-scene-fin { cursor: pointer; }

/* sans animation 3D (« réduire les animations ») : un simple éclair sur les cartes recyclées */
.coll-cell.rec-flash .bp-tc { animation: rec-flash .6s ease-out both; }
@keyframes rec-flash { 0% { filter: none; } 40% { filter: brightness(1.8) saturate(.4); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .coll-cell.rec-pris .bp-tc { animation: none; }
  #rec-barre { animation: none; }
}
