/* Boitajeux — compte et collection (accueil, boosters, album, deck, connexion) */

.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cl-ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; }

/* Pastille du compte, en haut de l'accueil */
.hero-acct { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; }
.cl-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--glass); color: var(--fg); font: 700 14px var(--f-body); cursor: pointer; max-width: 220px; }
.cl-chip.guest { padding: 8px 16px; background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.cl-chip:hover { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.cl-chip.guest:hover { background: var(--accent); filter: brightness(1.08); }
.cl-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; object-fit: cover; background: radial-gradient(circle at 35% 30%, #63c7b0, #1f7a6a); color: #fff; font: 400 13px/1 "Bagel Fat One", system-ui, sans-serif; }
.cl-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--hot); color: #fff; font: 800 12px/20px var(--f-body); text-align: center; }

/* Encart de l'accueil */
.cl-home { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(110deg, rgba(242, 196, 109, .14), transparent 60%), color-mix(in srgb, var(--surface) 70%, transparent); }
.cl-home-txt { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; min-width: 0; }
.cl-bar { position: relative; height: 16px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); max-width: 420px; }
.cl-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #d29a2a, #f6d27a); border-radius: inherit; }
.cl-bar span { position: relative; display: block; text-align: center; font: 800 11px/16px var(--f-body); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.cl-bar.big { height: 24px; max-width: none; }
.cl-bar.big span { line-height: 24px; font-size: 13px; }

/* Écran collection */
.wrap.cl-wrap { max-width: 1140px; }
.cl-top .chip { display: inline-flex; align-items: center; gap: 6px; }
.cl-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); align-self: flex-start; }
.cl-tab { display: inline-flex; align-items: center; gap: 6px; font: 400 17px/1 var(--f-display); color: var(--muted); background: none; border: 0; padding: 9px 18px; border-radius: 999px; cursor: pointer; }
.cl-tab.on { background: var(--accent); color: var(--accent-ink); }
.cl-tab .cl-badge { font-family: var(--f-body); }
.cl-foot { text-align: center; }

/* Boosters */
.cl-packs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px 48px; padding: 18px 0 8px; }
.cl-pack-stack { position: relative; width: 190px; aspect-ratio: 5 / 7.2; flex: none; }
.cl-pack { position: absolute; inset: 0; transform: translate(calc(var(--i, 0) * 7px), calc(var(--i, 0) * -6px)) rotate(calc(var(--i, 0) * 3deg)); z-index: calc(10 - var(--i, 0)); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); transition: transform .25s; }
.cl-pack-stack:hover .cl-pack[style*="--i:0"] { transform: translateY(-6px) rotate(-2deg); }
.cl-pack-foil {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden;
  background: radial-gradient(circle at 50% 46%, #3a1f12 0 26%, transparent 27%), conic-gradient(from 210deg at 50% 46%, #f6d27a, #e8634a, #b464ff, #4aa3ff, #6fd39a, #f6d27a);
  -webkit-mask: linear-gradient(#000, #000) center / 100% calc(100% - 16px) no-repeat, conic-gradient(from -45deg at 50% 0, #000 90deg, transparent 0) 0 0 / 14px 9px repeat-x, conic-gradient(from 135deg at 50% 100%, #000 90deg, transparent 0) 0 100% / 14px 9px repeat-x;
  mask: linear-gradient(#000, #000) center / 100% calc(100% - 16px) no-repeat, conic-gradient(from -45deg at 50% 0, #000 90deg, transparent 0) 0 0 / 14px 9px repeat-x, conic-gradient(from 135deg at 50% 100%, #000 90deg, transparent 0) 0 100% / 14px 9px repeat-x;
}
.cl-pack-foil::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0) 0 18px, rgba(255, 255, 255, .22) 24px, rgba(255, 255, 255, 0) 30px); mix-blend-mode: overlay; }
.cl-pack-foil::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%) 0 0 / 260% 100% no-repeat; animation: tc-shine 4s ease-in-out infinite; }
.cl-pack-logo { position: relative; z-index: 1; font: 400 27px/1 "Bagel Fat One", system-ui, sans-serif; color: #fff8ec; text-shadow: 0 3px 0 #3a1f12, 0 0 18px rgba(0, 0, 0, .4); }
.cl-pack-logo i { font-style: normal; color: #f2c46d; }
.cl-pack-sub { position: relative; z-index: 1; font: 800 12px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: #3a1f12; background: #f6d27a; padding: 4px 9px; border-radius: 999px; }
.cl-pack.ghost { display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 14px; filter: none; color: var(--muted); font-weight: 700; }
.cl-pack-side { display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.cl-earn ul.cl-rules { margin: 0; padding-left: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 18px; }
.cl-rules b { color: var(--accent); }

.cl-opening { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 10px 0 6px; min-height: 340px; justify-content: center; }
.cl-opening.tear .cl-pack-stack { animation: cl-shake .6s ease-in-out both; }
.cl-opening.tear .cl-pack { animation: cl-burst .65s ease-in both; }
@keyframes cl-shake { 0%, 100% { transform: none; } 15% { transform: rotate(-4deg) scale(1.03); } 30% { transform: rotate(4deg) scale(1.05); } 45% { transform: rotate(-5deg) scale(1.07); } 60% { transform: rotate(5deg) scale(1.08); } 75% { transform: rotate(-2deg) scale(1.1); } }
@keyframes cl-burst { 0%, 70% { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)) brightness(1); opacity: 1; } 100% { filter: brightness(3); opacity: 0; transform: scale(1.3); } }
.actions.center { justify-content: center; }
.bo-row { --cw: clamp(120px, 15vw, 176px); display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; perspective: 1400px; }
.bo-slot { position: relative; width: var(--cw); aspect-ratio: 5 / 7; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .2s; }
.bo-slot:not(.flipped):hover { transform: translateY(-8px) rotate(-1deg); }
.bo-slot.deal { animation: bo-deal .55s cubic-bezier(.2, .8, .3, 1.15) calc(var(--d) * 110ms) both; }
@keyframes bo-deal { from { opacity: 0; transform: translateY(60px) scale(.4) rotate(calc((var(--d) - 2) * 12deg)); } }
.bo-flip { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.3, .7, .3, 1.15); }
.bo-slot.flipped .bo-flip { transform: rotateY(180deg); }
.bo-face { position: absolute; inset: 0; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bo-front { transform: rotateY(180deg); }
.bo-face .tc, .bo-face .tc-back { --cw: inherit; }
/* la lueur sous une carte encore cachée annonce sa rareté */
.bo-slot.r-rare:not(.flipped) .bo-back { filter: drop-shadow(0 0 10px rgba(74, 163, 255, .85)); }
.bo-slot.r-epique:not(.flipped) .bo-back { filter: drop-shadow(0 0 14px rgba(180, 100, 255, .95)); }
.bo-slot.r-legendaire:not(.flipped) .bo-back { filter: drop-shadow(0 0 18px rgba(255, 166, 48, 1)); animation: bo-glow 1.2s ease-in-out infinite; }
@keyframes bo-glow { 50% { filter: drop-shadow(0 0 28px rgba(255, 200, 80, 1)); } }
.bo-slot.r-legendaire.flipped .bo-front { animation: bo-legend 1s ease-out .3s; }
@keyframes bo-legend { 0% { filter: brightness(2.2) drop-shadow(0 0 30px #ffd86b); } 100% { filter: none; } }

/* Album */
.cl-album-head { display: flex; flex-direction: column; gap: 10px; }
.cl-sets { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cl-set { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 700 14px var(--f-body); color: var(--fg); background: var(--glass); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.cl-set .ts-ico { width: 16px; height: 16px; color: var(--accent); }
.cl-set small { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.cl-set.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.cl-set.on .ts-ico, .cl-set.on small { color: var(--accent-ink); }
.cl-album-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.cl-grid { --cw: 156px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cw), 1fr)); gap: 18px 14px; justify-items: center; }
.cl-grid.small { --cw: 124px; gap: 14px 10px; }
.cl-grid .tc { --cw: inherit; }
.cl-sethead { grid-column: 1 / -1; justify-self: stretch; display: flex; align-items: center; gap: 8px; font: 400 22px/1 var(--f-display); color: var(--paper); padding: 12px 0 2px; border-bottom: 1px solid var(--line); }
.cl-sethead .ts-ico { width: 22px; height: 22px; color: var(--accent); }
.cl-sethead small { font: 700 14px var(--f-body); color: var(--muted); margin-left: auto; }
.cl-cell { position: relative; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .15s; border-radius: 12px; }
.cl-cell:hover { transform: translateY(-4px); }
.cl-cell.used { opacity: .45; }
.cl-craft, .cl-in { position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%); z-index: 4; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font: 800 13px/1 var(--f-body); color: #e9fbff; background: rgba(12, 30, 40, .9); border: 1px solid rgba(159, 231, 255, .5); padding: 5px 9px; border-radius: 999px; }
.cl-craft .cl-ico { width: 14px; height: 14px; }
.cl-in { color: var(--fg); background: rgba(20, 13, 8, .9); border-color: var(--line); }

/* Fiche d'une carte */
.cl-sheet { max-width: 720px; }
.cl-detail { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cl-big .tc { --cw: min(250px, 70vw); }
.cl-big { flex: none; margin: 0 auto; }
.cl-info { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.cl-rar { font-weight: 800; }
.cl-rar.r-commune { color: #cfc7b8; } .cl-rar.r-rare { color: #6fb6ff; } .cl-rar.r-epique { color: #c693ff; } .cl-rar.r-legendaire { color: #ffb44d; }
.cl-kw { font-size: 14px; }
.cl-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-acts .btn small { font-weight: 600; opacity: .8; margin-left: 4px; }

/* Deck */
.dk { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.dk-list { position: sticky; top: 12px; }
.dk-curve { display: flex; align-items: flex-end; gap: 6px; height: 72px; padding: 0 2px; }
.dk-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.dk-bar i { width: 100%; min-height: 2px; background: linear-gradient(180deg, #4a8fe8, #2563bd); border-radius: 4px 4px 0 0; }
.dk-bar small { font: 800 11px/1 var(--f-body); color: var(--muted); }
.dk-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 46vh; overflow-y: auto; }
.dk-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 10px; border: 0; cursor: pointer; text-align: left; color: var(--fg); font: 700 14px var(--f-body);
  background: linear-gradient(90deg, var(--rc, #a39a8a) 0 4px, rgba(255, 255, 255, .05) 4px); }
.dk-row:hover { background: linear-gradient(90deg, var(--rc, #a39a8a) 0 4px, rgba(232, 99, 74, .25) 4px); }
.dk-row.r-rare { --rc: #4aa3ff; } .dk-row.r-epique { --rc: #b464ff; } .dk-row.r-legendaire { --rc: #ffa630; }
.dk-c { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; margin-left: 4px; font: 400 15px/1 "Bagel Fat One", system-ui, sans-serif; color: #fff; background: radial-gradient(circle, #3a7fe0 0 52%, #1c4f9c 53%); box-shadow: 0 0 0 1.5px #0f2650; }
.dk-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-st { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dk-x { color: var(--accent); }
.dk-msg { font-weight: 700; font-size: 14px; color: var(--ok); }
.dk-msg.bad { color: #ff9c8a; }
.dk-msg.todo { color: var(--accent); }
.dk-pool { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* Connexion */
.cl-login { max-width: 440px; }
.cl-form { display: flex; flex-direction: column; gap: 8px; }
.cl-form input { flex: none; }
.cl-seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); margin-bottom: 6px; }
.cl-seg button { flex: 1; font: 700 14px var(--f-body); color: var(--muted); background: none; border: 0; padding: 8px 10px; border-radius: 999px; cursor: pointer; }
.cl-seg button.on { background: var(--fg); color: var(--bg); }
.cl-form .btn.primary { margin-top: 6px; }
.cl-err { color: #ff9c8a; font-weight: 700; font-size: 14px; }
.cl-ok { color: var(--ok); font-weight: 700; font-size: 14px; }
.cl-form > p { margin: 0 0 4px; }
.cl-form .note { margin: 2px 0 6px; }
.cl-form .note code { font-size: 12px; background: rgba(0, 0, 0, .25); padding: 1px 5px; border-radius: 5px; }
.cl-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 6px; font-size: 14px; }
.cl-links .linkish:disabled { color: var(--muted); text-decoration: none; cursor: default; }
input.cl-code { font: 400 28px/1 "Bagel Fat One", system-ui, sans-serif; letter-spacing: .3em; text-align: center; padding: 12px 10px 10px; }
input.cl-code::placeholder { color: rgba(243, 235, 226, .2); }
.cl-twitch { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #9146ff; color: #fff; border-color: transparent; text-decoration: none; padding: 12px 18px; }
.cl-twitch:hover:not(:disabled) { background: #a970ff; }
.cl-twitch svg { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .dk { grid-template-columns: minmax(0, 1fr); }
  .dk-list { position: static; }
  .dk-rows { max-height: none; }
}
@media (max-width: 560px) {
  .hero-acct { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .cl-grid { --cw: calc((100vw - 48px) / 2 - 6px); gap: 14px 10px; }
  .cl-grid.small { --cw: calc((100vw - 52px) / 3 - 6px); gap: 10px 6px; }
  .cl-grid.small .cl-in { font-size: 10px; padding: 4px 6px; }
  .bo-row { --cw: calc((100vw - 64px) / 3); gap: 10px; }
  .cl-pack-stack { width: 150px; }
  .cl-pack-logo { font-size: 22px; }
  .cl-tab { padding: 8px 13px; font-size: 16px; }
}
