/* Coffres V2 (2026-11-16, js/chest-v2.js). */
#cv2-extras { grid-column: 1 / -1; display: grid; gap: 12px; margin-top: 12px; width: 100%; justify-self: stretch; text-align: left; }
.cv2-keys { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; font-size: 0.9rem; }
.cv2-keys span { padding: 3px 10px; border-radius: 99px; background: var(--bg-panel-2); border: 1px solid var(--border-soft); }
.cv2-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.cv2-gold-toggle { font-size: 0.8rem; color: var(--text-dim); display: inline-flex; gap: 6px; align-items: center; }
.cv2-tier { position: relative; border-color: color-mix(in srgb, var(--c) 55%, transparent) !important; }
.cv2-fam { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 40%, #fff); }
.cv2-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cv2-btns .cv2-open { font-size: 0.8rem; padding: 5px 10px; min-height: 0; }
.cv2-need { font-size: 0.72rem; color: #fde68a; }
.cv2-panel { padding: 10px 14px; border-radius: 14px; background: var(--bg-panel-2); border: 1px solid var(--border-soft); }
.cv2-panel > summary { cursor: pointer; font-weight: 800; }
.cv2-panel > summary small { font-weight: 400; color: var(--text-dim); margin-left: 6px; }
.cv2-help { font-size: 0.82rem; color: var(--text-dim); margin: 8px 0; }
.cv2-fam-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.cv2-fam-list li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); }
.cv2-fam-list li > span { font-size: 1.4rem; }
.cv2-fam-list b { display: block; font-size: 0.86rem; }
.cv2-fam-list small { color: var(--text-dim); font-size: 0.74rem; }
.cv2-coins h3 { margin: 0 0 6px; font-size: 0.95rem; }
.cv2-coins h3 small { font-weight: 400; color: var(--text-dim); font-size: 0.75rem; }
.cv2-coin-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cv2-coin { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 16%, var(--bg-panel-2)); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.cv2-coin:hover { box-shadow: 0 0 14px -4px var(--c); }
.cv2-coin small { color: var(--text-dim); }
.cv2-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.cv2-recipe { padding: 10px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--bg-panel, rgba(0,0,0,.2)); display: grid; gap: 6px; }
.cv2-recipe.can { border-color: #facc15; }
.cv2-recipe header { display: flex; gap: 8px; align-items: center; font-size: 0.95rem; }
.cv2-recipe header span { font-size: 1.3rem; }
.cv2-recipe ul { margin: 0; padding-left: 18px; font-size: 0.8rem; }
.cv2-recipe li.ok { color: #86efac; }
.cv2-recipe li.no { color: #fca5a5; }
.cv2-recipe li small { color: var(--text-dim); }
.cv2-recipe-btns { display: flex; gap: 6px; }
.cv2-grid { display: grid; grid-template-columns: minmax(90px, auto) repeat(var(--cols), minmax(26px, 1fr)); gap: 4px; align-items: center; overflow-x: auto; }
.cv2-gh img { width: 26px; height: 26px; object-fit: contain; display: block; margin: 0 auto; }
.cv2-gl { font-size: 0.75rem; white-space: nowrap; color: color-mix(in srgb, var(--c) 40%, #fff); }
.cv2-cell { height: 26px; border-radius: 6px; border: 1px dashed var(--border-soft); display: grid; place-items: center; font-size: 0.65rem; color: var(--text-dim); }
.cv2-cell.on { border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 30%, transparent); color: #fff; font-weight: 700; }

/* Scene d'ouverture. */
.cv2-overlay { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; overflow-y: auto; padding: 24px 16px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c) 26%, #05060f), #03040a 70%); }
.cv2-overlay[hidden] { display: none; }
.cv2-close { position: fixed; top: 14px; right: 14px; }
.cv2-stage { width: min(960px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cv2-title { font: 400 clamp(1.1rem, 3.6vw, 1.7rem)/1.2 var(--font-brand, "Bungee", sans-serif); text-align: center; color: color-mix(in srgb, var(--c) 35%, #fff); text-shadow: 0 0 20px color-mix(in srgb, var(--c) 60%, transparent); }
.cv2-chest { appearance: none; box-shadow: none !important; border-radius: 0; outline-offset: 6px; position: relative; width: min(240px, 60vw); aspect-ratio: 1; border: 0; background: none; cursor: pointer; padding: 0; transition: transform 0.4s ease, opacity 0.4s ease; }
.cv2-chest img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(0,0,0,.6)); }
.cv2-glow { position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tc) 70%, transparent), transparent 70%); filter: blur(10px); animation: cv2Pulse 1.8s ease-in-out infinite; }
.cv2-key { position: absolute; left: 50%; top: 58%; font-size: 2.2rem; translate: -50% -50%; transform: translateY(70px); opacity: 0; transition: transform 0.45s cubic-bezier(.2,.9,.3,1.3), opacity 0.3s; }
.cv2-chest.turning .cv2-key { opacity: 1; transform: translateY(0) rotate(90deg); }
.cv2-chest.shake-1, .cv2-chest.shake-2 { animation: cv2Shake 2.4s ease-in-out infinite; --a: 1deg; }
.cv2-chest.shake-3, .cv2-chest.shake-4 { animation: cv2Shake 1.8s ease-in-out infinite; --a: 2deg; }
.cv2-chest.shake-5, .cv2-chest.shake-6 { animation: cv2Shake 1.2s ease-in-out infinite; --a: 3.5deg; }
.cv2-chest.shake-7, .cv2-chest.shake-8 { animation: cv2Shake 0.8s ease-in-out infinite; --a: 5deg; }
.cv2-chest.resist { animation: cv2Shake 0.25s linear infinite; --a: 6deg; }
.cv2-chest.open { animation: cv2Pop 0.5s ease-out both; }
.cv2-chest.open .cv2-glow { inset: -30%; animation: none; opacity: 1; }
.cv2-chest.gone { height: 0; opacity: 0; transform: scale(0.6); margin: -7px 0; overflow: hidden; }
.cv2-hint { margin: 0; color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.cv2-cascade { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cv2-mini { display: grid; justify-items: center; font-size: 0.72rem; animation: cv2Pop 0.4s calc(var(--i) * 0.16s) ease-out both; }
.cv2-mini img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 0 8px var(--c)); }
.cv2-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; width: 100%; transition: filter 0.3s; }
.cv2-items.suspense { filter: brightness(0.5); }
.cv2-item { position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); animation: cv2Fly 0.45s cubic-bezier(.2,.9,.3,1.2) both; min-width: 0; }
.cv2-item b { font-size: 0.82rem; overflow-wrap: anywhere; }
.cv2-item small { font-size: 0.7rem; color: var(--text-dim); }
.cv2-item.card { border-color: color-mix(in srgb, var(--rc) 70%, transparent); box-shadow: 0 0 16px -8px var(--rc); }
.cv2-item.card img { width: 100%; max-width: 120px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; color: transparent; }
.cv2-item.card.spot { grid-column: 1 / -1; justify-self: center; width: min(240px, 80%); border-width: 2px; box-shadow: 0 0 40px -6px var(--rc); animation: cv2Spot 0.7s cubic-bezier(.2,.9,.3,1.3) both; }
.cv2-item.card.spot img { max-width: 200px; }
.cv2-ph { font-size: 2.4rem; }
.cv2-res-ico { font-size: 1.8rem; line-height: 1; }
.cv2-res-img { width: 36px; height: 36px; object-fit: contain; }
.cv2-new, .cv2-first { position: absolute; top: 6px; left: 6px; font: 800 0.58rem/1 var(--font-body, sans-serif); letter-spacing: 0.05em; padding: 3px 6px; border-radius: 5px; background: #22c55e; color: #04220f; font-style: normal; }
.cv2-first { left: auto; right: 6px; background: #fbbf24; color: #3b2200; }
.cv2-bilan { width: 100%; text-align: center; padding: 14px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); animation: cv2Pop 0.4s ease-out both; }
.cv2-bilan[hidden] { display: none; }
.cv2-bilan h3 { margin: 0 0 6px; font: 400 1.2rem/1.2 var(--font-brand, "Bungee", sans-serif); }
.cv2-used, .cv2-firsts { margin: 4px 0; font-size: 0.86rem; color: var(--text-dim); }
.cv2-firsts { color: #fde68a; }
.cv2-bilan-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.cv2-bilan-btns > * { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; text-decoration: none; font: 700 0.9rem/1 var(--font-body, "Inter", sans-serif); }
@keyframes cv2Shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(calc(var(--a) * -1)); } 75% { transform: rotate(var(--a)); } }
@keyframes cv2Pulse { 50% { opacity: 0.55; transform: scale(1.08); } }
@keyframes cv2Pop { 0% { transform: scale(0.7); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes cv2Fly { 0% { transform: translateY(-60px) scale(0.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes cv2Spot { 0% { transform: scale(0.3) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cv2-chest, .cv2-item, .cv2-mini, .cv2-glow, .cv2-bilan { animation: none !important; } }
@media (max-width: 640px) { .cv2-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Ouvrir + xN sur une ligne (avis #95, 2026-11-19). */
.cv2-keyrow { display: flex; gap: 4px; flex: 1 1 100%; }
/* width:auto : .gatcha-tier button (games.css) met tous les boutons a 100 %,
   ce qui ecrasait « Ouvrir » au profit de « xN ». */
.cv2-keyrow .cv2-open { width: auto; }
.cv2-keyrow .cv2-open:first-child { flex: 1 1 auto; min-width: max-content; }
.cv2-keyrow .cv2-open + .cv2-open { flex: 0 0 auto; min-width: 3.2em; }
