/* ═══════════════════════════════════════════════
   Tehono Market — Boosters mystérieux (public)
   Design intégré depuis booster-prototype/style.css.
   Préfixe : .th-bp-*
   ═══════════════════════════════════════════════ */

.th-bp-wrap {
    /* Palette */
    /* Palette alignée sur les NFTs Booster (vert + or). */
    --bp-bg-deep:        #08140a;
    --bp-bg-mid:         #0e2316;
    --bp-bg-soft:        #1a3a25;
    --bp-text:           #f0f5ee;
    --bp-text-soft:      #c4d8c2;
    --bp-text-muted:     #6e8772;
    --bp-accent-green-deep: #1f5a2e;
    --bp-accent-green:      #3a8a4c;
    --bp-accent-green-soft: #7fc28b;
    --bp-accent-gold:    #ffd24f;
    --bp-accent-cyan:    #6fe89a;
    --bp-rarity-common:    #8a8aa0;
    --bp-rarity-uncommon:  #4caf50;
    --bp-rarity-rare:      #4f7fff;
    --bp-rarity-epic:      #b94fff;
    --bp-rarity-legendary: #ffd24f;
    --bp-tear-duration: 0.9s;
    --bp-pack-w: 180px;
    --bp-pack-h: 290px;
    --bp-card-w: 160px;
    --bp-card-h: 250px;

    position: relative;
    background: transparent;
    color: var(--bp-text);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 30px 16px 60px;
    overflow: hidden;
    min-height: 600px;
    border-radius: 16px;
}
.th-bp-wrap *,
.th-bp-wrap *::before,
.th-bp-wrap *::after { box-sizing: border-box; }
@media (max-width: 720px) {
    .th-bp-wrap {
        --bp-pack-w: 110px;
        --bp-pack-h: 180px;
        --bp-card-w: 130px;
        --bp-card-h: 200px;
    }
}

/* ── Fond animé : étoiles + nébuleuse ──────────── */
.th-bp-stage-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}
.th-bp-nebula {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 60% 50% at 30% 30%, rgba(58, 138, 76, 0.20) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 70% 70%, rgba(31, 90, 46, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(255, 210, 79, 0.10) 0%, transparent 60%);
    animation: th-bp-nebula-drift 30s ease-in-out infinite;
    filter: blur(40px);
}
@keyframes th-bp-nebula-drift {
    0%, 100% { transform: translate(0, 0)        rotate(0deg); }
    50%      { transform: translate(20px, -30px) rotate(8deg); }
}
.th-bp-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 23% 17%, white 50%, transparent),
        radial-gradient(1px 1px at 67% 43%, white 50%, transparent),
        radial-gradient(2px 2px at 12% 78%, white 50%, transparent),
        radial-gradient(1px 1px at 88% 62%, white 50%, transparent),
        radial-gradient(1px 1px at 45% 92%, white 50%, transparent),
        radial-gradient(1px 1px at 91% 12%, white 50%, transparent),
        radial-gradient(2px 2px at 33% 55%, white 50%, transparent),
        radial-gradient(1px 1px at 75% 85%, white 50%, transparent);
    background-size: 600px 600px;
    background-repeat: repeat;
    opacity: 0.6;
    animation: th-bp-stars-twinkle 4s ease-in-out infinite;
}
@keyframes th-bp-stars-twinkle {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}

/* ── Header + Wallet ──────────────────────────── */
.th-bp-head { text-align: center; margin: 0 0 24px; position: relative; z-index: 2; }
.th-bp-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.4px;
    margin: 0 0 8px;
    background: linear-gradient(135deg, var(--bp-accent-gold), var(--bp-accent-green-soft), var(--bp-accent-green-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.th-bp-sub {
    color: var(--bp-text-soft);
    font-size: 13px;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.55;
}
.th-bp-sub strong { color: var(--bp-accent-gold); }

.th-bp-wallet {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 16px;
    margin: 0 auto 16px;
    max-width: 720px;
    flex-wrap: wrap;
}
.th-bp-wallet-label,
.th-bp-runes {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--bp-text-muted);
}
.th-bp-runes { color: var(--bp-accent-gold); }
.th-bp-wallet-state {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--bp-text-soft);
}
.th-bp-wallet-state.is-connected { color: var(--bp-text); }
.th-bp-wallet button { margin-left: auto; }

/* ── Feedback ──────────────────────────────────── */
.th-bp-feedback {
    display: none;
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto 16px;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-word;
}
.th-bp-feedback.is-visible { display: block; }
.th-bp-feedback code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.th-bp-feedback.is-info    { background: rgba(255,255,255,0.04);  border-color: rgba(255,255,255,0.1); color: var(--bp-text-soft); }
.th-bp-feedback.is-success { background: rgba(80, 200, 120, 0.08); border-color: rgba(80, 200, 120, 0.35); color: #9ee0b8; }
.th-bp-feedback.is-error   { background: rgba(255, 100, 100, 0.06); border-color: rgba(255, 100, 100, 0.35); color: #ff9b9b; }

.th-bp-disabled {
    text-align: center;
    padding: 50px 20px;
    color: var(--bp-text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 14px;
    font-style: italic;
    position: relative;
    z-index: 2;
}

/* ── Arène (5 packs en bas + reveal en haut) ────
   Hauteur compacte par défaut (juste les packs). S'agrandit pendant le reveal
   pour que les cartes qui jaillissent au-dessus aient de la place. */
.th-bp-arena {
    position: relative;
    width: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 12px;
    z-index: 1;
    transition: min-height 0.4s ease;
}
.th-bp-wrap.is-revealing .th-bp-arena { min-height: 560px; }
@media (max-width: 720px) {
    .th-bp-arena { min-height: 220px; }
    .th-bp-wrap.is-revealing .th-bp-arena { min-height: 460px; }
}

.th-bp-aura {
    position: absolute;
    width: 480px; height: 480px;
    left: 50%; bottom: 0;
    transform: translate(-50%, 30%);
    background: radial-gradient(circle,
        rgba(58, 138, 76, 0.24) 0%,
        rgba(255, 210, 79, 0.14) 35%,
        transparent 65%);
    filter: blur(40px);
    animation: th-bp-aura-pulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes th-bp-aura-pulse {
    0%, 100% { transform: translate(-50%, 30%) scale(1);    opacity: 0.7; }
    50%      { transform: translate(-50%, 30%) scale(1.15); opacity: 1;   }
}

/* ── Rangée des 5 packs ───────────────────────── */
.th-bp-packs-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    z-index: 6;
    position: relative;
}
@media (max-width: 720px) {
    .th-bp-packs-row { gap: 6px; }
}

/* ── Pack ─────────────────────────────────────── */
.th-bp-pack {
    position: relative;
    width: var(--bp-pack-w);
    height: var(--bp-pack-h);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    animation: th-bp-pack-float 4s ease-in-out infinite;
    filter: drop-shadow(0 18px 38px rgba(58, 138, 76, 0.45));
    transition: filter 0.3s ease, transform 0.5s ease, opacity 0.5s ease;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
}
.th-bp-pack:active { cursor: grabbing; }
.th-bp-pack.is-tearing,
.th-bp-pack.is-opening,
.th-bp-pack.is-dragging { animation: none; cursor: progress; }
.th-bp-pack:hover {
    filter: drop-shadow(0 24px 48px rgba(255, 210, 79, 0.55));
}
.th-bp-pack.is-faded {
    opacity: 0.15;
    transform: scale(0.85) translateY(20px);
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)) blur(2px);
}
.th-bp-pack.is-chosen { z-index: 10; animation: none; }
.th-bp-pack.is-fading { animation: th-bp-pack-fade 0.6s ease forwards; }
@keyframes th-bp-pack-fade {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.7) translateY(40px); }
}

@keyframes th-bp-pack-float {
    0%, 100% { transform: translateY(0)    rotate(-1deg); }
    50%      { transform: translateY(-8px) rotate(1deg); }
}
.th-bp-pack[data-pack-index="0"] { animation-delay: 0s;    }
.th-bp-pack[data-pack-index="1"] { animation-delay: -0.8s; }
.th-bp-pack[data-pack-index="2"] { animation-delay: -1.6s; }
.th-bp-pack[data-pack-index="3"] { animation-delay: -2.4s; }
.th-bp-pack[data-pack-index="4"] { animation-delay: -3.2s; }

/* Body du pack — full pack. Le pack est UNE pièce visuelle ; le lid est juste
   le top 18% qui va se décoller à la déchirure. Pas de gap, pas de tab séparé. */
.th-bp-pack-body {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        var(--bp-bg-mid) 0%,
        var(--bp-bg-deep) 100%);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: none;
    transition: clip-path 0.05s 0.45s linear;
    clip-path: inset(0 0 0 0);
    z-index: 5;
}

/* Foil + holo désactivés : créaient des bandes colorées et des secteurs
   conic-gradient visibles comme "rectangles qui tournent" sur fond sombre.
   Garde l'animation th-bp-holo-rotate qui sert aussi au halo legendary. */
.th-bp-pack-foil,
.th-bp-pack-holo,
.th-bp-pack-foil--lid,
.th-bp-pack-holo--lid { display: none; }

@keyframes th-bp-holo-rotate {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.th-bp-pack-glow {
    position: absolute;
    top: 50%; left: 50%;
    width: 80%; height: 80%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse,
        rgba(255, 210, 79, 0.28) 0%,
        rgba(58, 138, 76, 0.18) 35%,
        transparent 70%);
    filter: blur(20px);
    animation: th-bp-glow-pulse 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes th-bp-glow-pulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1);    }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.1);  }
}

.th-bp-pack-emblem {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--bp-text);
    z-index: 5;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}
.th-bp-pack-sigil {
    width: 70px; height: 70px;
    color: var(--bp-accent-gold);
    filter: drop-shadow(0 0 10px rgba(255, 210, 79, 0.6));
    animation: th-bp-sigil-glow 3s ease-in-out infinite;
}
.th-bp-pack-image {
    width: 80px; height: 80px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 10px rgba(255, 210, 79, 0.6));
    animation: th-bp-sigil-glow 3s ease-in-out infinite;
}
@keyframes th-bp-sigil-glow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 210, 79, 0.4)); }
    50%      { filter: drop-shadow(0 0 14px rgba(255, 210, 79, 0.9)); }
}
.th-bp-pack-name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
}
.th-bp-pack-name small {
    display: block;
    font-size: 8px;
    letter-spacing: 5px;
    color: var(--bp-text-soft);
    margin-top: 3px;
    font-weight: 600;
}

/* Lid : le top 18% du pack, calque qui imite EXACTEMENT le body au même endroit
   (gradient stretché 555% pour matcher la fraction 0%-18% du body). Le pack
   apparaît comme une seule pièce continue ; à l'ouverture, ce calque se décolle. */
.th-bp-pack-lid {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 18%;
    background: linear-gradient(180deg,
        var(--bp-bg-mid) 0%,
        var(--bp-bg-deep) 100%);
    background-size: 100% 555%;
    background-position: 0 0;
    border-radius: 14px 14px 0 0;
    box-shadow: none;
    overflow: hidden;
    z-index: 6;
    transform-origin: bottom center;
}
.th-bp-pack-foil--lid,
.th-bp-pack-holo--lid { inset: 0; }

/* Tear-line — pile à la jonction lid/body (= 18% du pack). Ligne pointillée or
   qui matérialise la perforation où le pack va se déchirer. */
.th-bp-pack-tear-line {
    position: absolute;
    top: 18%;
    left: 6%; right: 6%;
    height: 1px;
    background-image: linear-gradient(to right, rgba(255, 210, 79, 0.55) 50%, transparent 50%);
    background-size: 8px 1px;
    background-repeat: repeat-x;
    pointer-events: none;
    z-index: 7;
    transition: opacity 0.2s ease, filter 0.3s ease;
}
.th-bp-pack.is-dragging .th-bp-pack-tear-line {
    filter: drop-shadow(0 0 4px var(--bp-accent-gold)) brightness(1.5);
}
.th-bp-pack.is-opening .th-bp-pack-tear-line { opacity: 0; }

/* Pull-zone (texte indicateur) */
.th-bp-pack-pull-zone {
    position: absolute;
    top: 6px; left: 50%;
    transform: translateX(-50%);
    z-index: 7;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.th-bp-pull-text {
    display: block;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 210, 79, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 6px rgba(255, 210, 79, 0.4);
    animation: th-bp-pull-pulse 1.6s ease-in-out infinite;
}
@keyframes th-bp-pull-pulse {
    0%, 100% { opacity: 0.45; transform: translateY(-1px); }
    50%      { opacity: 1;    transform: translateY( 1px); }
}
.th-bp-pack.is-dragging .th-bp-pack-pull-zone,
.th-bp-pack.is-opening .th-bp-pack-pull-zone { opacity: 0; }

/* Animation déchirure */
.th-bp-pack.is-opening .th-bp-pack-lid {
    animation: th-bp-lid-tear var(--bp-tear-duration) cubic-bezier(.55, 0, .25, 1) forwards;
}
@keyframes th-bp-lid-tear {
    0%   { transform: translate(0, 0)         rotate(0deg)    scale(1); }
    8%   { transform: translate(0, -2px)      rotate(0deg)    scale(1.01); }
    25%  { transform: translate(3px, -25px)   rotate(-2deg)   scale(1.03); }
    50%  { transform: translate(8px, -100px)  rotate(-7deg)   scale(1.02); opacity: 1; }
    80%  { transform: translate(-2px, -200px) rotate(-15deg)  scale(0.9);  opacity: 0.8; }
    100% { transform: translate(15px, -320px) rotate(-22deg)  scale(0.72); opacity: 0; }
}

/* Body : zigzag autour de 18% (= la tear-line). Quand le lid se décolle,
   le top du body devient cette arête en dents-de-scie (papier déchiré). */
.th-bp-pack.is-opening .th-bp-pack-body {
    clip-path: polygon(
        0% 19%, 4% 18.2%, 8% 19.5%, 12% 17.8%, 16% 19%, 20% 18%, 24% 19.4%, 28% 17.9%,
        32% 19.1%, 36% 18.3%, 40% 19.6%, 44% 17.7%, 48% 19%, 52% 18.2%, 56% 19.5%,
        60% 17.8%, 64% 19%, 68% 18%, 72% 19.4%, 76% 17.9%, 80% 19.1%, 84% 18.3%,
        88% 19.6%, 92% 17.7%, 96% 19%, 100% 18.5%,
        100% 100%, 0% 100%
    );
    box-shadow: inset 0 8px 16px -8px rgba(255, 210, 79, 0.45);
}

/* Flash horizontal au moment de la déchirure */
.th-bp-pack.is-opening::before {
    content: '';
    position: absolute;
    top: 18%; left: -10%; right: -10%;
    height: 4px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(255, 255, 255, 0.9) 30%,
        rgba(255, 210, 79, 1) 50%,
        rgba(255, 255, 255, 0.9) 70%,
        transparent 100%);
    filter: blur(2px);
    z-index: 9;
    animation: th-bp-tear-flash 0.4s ease-out forwards;
    pointer-events: none;
}
@keyframes th-bp-tear-flash {
    0%   { opacity: 0; transform: scaleX(0.3); }
    30%  { opacity: 1; transform: scaleX(1.2); }
    100% { opacity: 0; transform: scaleX(1.5); }
}

/* ── Particules ───────────────────────────────── */
.th-bp-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 8;
}
.th-bp-particle {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}
.th-bp-particle.is-active {
    animation: th-bp-particle-fly 1.2s ease-out forwards;
}
@keyframes th-bp-particle-fly {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -200px)) scale(0.3); }
}

/* ── Hint ─────────────────────────────────────── */
.th-bp-hint {
    position: absolute;
    bottom: -30px; left: 50%;
    transform: translateX(-50%);
    color: var(--bp-text-muted);
    font-size: 12px;
    letter-spacing: 0.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    white-space: nowrap;
}
.th-bp-hint.is-visible { opacity: 0.7; animation: th-bp-hint-pulse 1.6s ease-in-out infinite; }
@keyframes th-bp-hint-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1;   }
}

/* ── Reveal (zone overlay sur l'arène) ────────── */
.th-bp-reveal {
    position: absolute;
    inset: 0;
    perspective: 1500px;
    z-index: 5;
    pointer-events: none;
}
.th-bp-reveal[hidden] { display: none; }

.th-bp-card-slot {
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: calc(var(--bp-card-w) / -2);
    margin-top: calc(var(--bp-card-h) / -2);
    width: var(--bp-card-w);
    height: var(--bp-card-h);
    transform-style: preserve-3d;
    pointer-events: none;
    will-change: transform, opacity;
}
.th-bp-card-slot.is-revealed { pointer-events: auto; }

.th-bp-card {
    position: relative;
    width: 100%; height: 100%;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.5s ease;
    will-change: transform;
}
.th-bp-card-image {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.th-bp-card-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: white;
    pointer-events: none;
}
.th-bp-card-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin: 0;
}
.th-bp-card-flavor {
    font-size: 9px;
    color: var(--bp-text-soft);
    letter-spacing: 0.5px;
    margin: 2px 0 0;
    text-transform: uppercase;
}
.th-bp-card-frame {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    border: 2px solid var(--rarity-color, var(--bp-rarity-common));
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 20px 0 var(--rarity-color, var(--bp-rarity-common));
    opacity: 0.85;
}
.th-bp-card-slot[data-rarity="common"]    { --rarity-color: var(--bp-rarity-common); }
.th-bp-card-slot[data-rarity="uncommon"]  { --rarity-color: var(--bp-rarity-uncommon); }
.th-bp-card-slot[data-rarity="rare"]      { --rarity-color: var(--bp-rarity-rare); }
.th-bp-card-slot[data-rarity="epic"]      { --rarity-color: var(--bp-rarity-epic); }
.th-bp-card-slot[data-rarity="legendary"] { --rarity-color: var(--bp-rarity-legendary); }

.th-bp-card-rarity {
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    padding: 3px 10px;
    background: var(--rarity-color);
    color: rgba(0, 0, 0, 0.85);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 3;
}

/* Sheen sur cartes rares */
.th-bp-card-slot[data-rarity="rare"] .th-bp-card::after,
.th-bp-card-slot[data-rarity="epic"] .th-bp-card::after,
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 48%,
        rgba(255, 255, 255, 0.4)  50%,
        rgba(255, 255, 255, 0.25) 52%,
        transparent 100%);
    background-size: 200% 200%;
    animation: th-bp-sheen 3s ease-in-out infinite;
    mix-blend-mode: overlay;
    pointer-events: none;
}
@keyframes th-bp-sheen {
    0%, 100% { background-position: -50% 0%; }
    50%      { background-position: 150% 0%; }
}

/* ═══════════════════════════════════════════════
   LEGENDARY — design premium "wow"
   1. Halo doré radial pulsant derrière la carte
   2. Triple cadre or (fin / gap sombre / épais lumineux)
   3. Ornements aux 4 coins
   4. Sheen accéléré + balayage horizontal lumineux
   5. Nom en gradient or avec text-shadow doré
   6. Pill LEGENDARY 3D embossée
   ═══════════════════════════════════════════════ */
.th-bp-card-slot[data-rarity="legendary"] { z-index: 6 !important; }

/* Le wrapper card lui-même : multi-couches d'ombres dorées + cadre or peint via box-shadow */
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card {
    box-shadow:
        /* Triple bordure or peinte par superposition d'ombres outset */
        0 0 0 1px  rgba(255, 240, 180, 0.95),     /* hairline crème */
        0 0 0 4px  rgba(20, 12, 4, 0.85),          /* gap sombre */
        0 0 0 5px  rgba(255, 220, 90, 0.95),       /* line or moyenne */
        0 0 0 7px  rgba(180, 130, 40, 0.6),        /* line or sombre */
        /* Glow extérieur dégradé */
        0 0 35px  0  rgba(255, 230, 130, 0.85),
        0 0 80px  10px rgba(255, 200, 60, 0.55),
        0 0 140px 20px rgba(255, 175, 30, 0.30),
        /* Profondeur drop-shadow */
        0 28px 50px -10px rgba(0, 0, 0, 0.75);
}

/* Halo radial pulsant derrière la carte */
.th-bp-card-slot[data-rarity="legendary"]::before {
    content: '';
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle,
        rgba(255, 248, 215, 0.9) 0%,
        rgba(255, 220, 100, 0.7) 25%,
        rgba(255, 175, 40, 0.45) 55%,
        transparent              82%);
    animation: th-bp-legendary-pulse 2.4s ease-in-out infinite;
    border-radius: 50%;
    filter: blur(20px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.th-bp-card-slot[data-rarity="legendary"].is-revealed::before { opacity: 1; }
@keyframes th-bp-legendary-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.85; }
    50%      { transform: scale(1.18); opacity: 1;    }
}

/* Ornements dorés aux 4 coins (via le frame de base et un pseudo-élément additionnel)
   On utilise le ::after du card-frame pour dessiner 4 angles via radial-gradient masqués. */
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card-frame {
    border: 0;
    box-shadow: none;
    background:
        /* Coin haut-gauche */
        radial-gradient(circle at top left,    rgba(255, 230, 130, 0.6) 0%, transparent 12%),
        radial-gradient(circle at top right,   rgba(255, 230, 130, 0.6) 0%, transparent 12%),
        radial-gradient(circle at bottom left, rgba(255, 230, 130, 0.6) 0%, transparent 12%),
        radial-gradient(circle at bottom right,rgba(255, 230, 130, 0.6) 0%, transparent 12%);
    pointer-events: none;
    animation: th-bp-frame-glow 1.6s ease-in-out infinite alternate;
}
@keyframes th-bp-frame-glow {
    0%   { filter: drop-shadow(0 0 4px rgba(255, 220, 90, 0.4)); }
    100% { filter: drop-shadow(0 0 14px rgba(255, 230, 130, 0.95)); }
}

/* Sheen renforcé + double sweep (lumière qui balaye) */
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card::after {
    background: linear-gradient(115deg,
        transparent 25%,
        rgba(255, 240, 180, 0.55) 47%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(255, 240, 180, 0.55) 53%,
        transparent 75%) !important;
    background-size: 250% 250% !important;
    animation: th-bp-sheen 2.2s ease-in-out infinite !important;
    mix-blend-mode: overlay !important;
}

/* Image legendary : saturation + brillance boostées */
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card-image {
    filter: brightness(1.08) contrast(1.06) saturate(1.12);
}

/* Bandeau info (nom + flavor) repensé en mode premium */
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card-info {
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(28, 18, 6, 0.92) 35%,
        rgba(14, 9, 3, 1) 100%);
    padding: 14px 14px 12px;
    border-top: 1px solid rgba(255, 220, 90, 0.45);
}

/* Nom : gradient or brillant + glow doré */
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.4px;
    background: linear-gradient(135deg,
        #fff8d6 0%,
        #ffd24f 30%,
        #ffb347 55%,
        #ffd24f 80%,
        #fff8d6 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 200, 60, 0.55));
    animation: th-bp-gold-shimmer 4s ease-in-out infinite;
}
@keyframes th-bp-gold-shimmer {
    0%, 100% { background-position:   0% 50%; }
    50%      { background-position: 100% 50%; }
}

.th-bp-card-slot[data-rarity="legendary"] .th-bp-card-flavor {
    font-size: 9px;
    color: #ffd88a;
    letter-spacing: 2.2px;
    margin: 4px 0 0;
    opacity: 0.9;
}

/* Pill LEGENDARY repensée : embossée 3D, gradient or */
.th-bp-card-slot[data-rarity="legendary"] .th-bp-card-rarity {
    top: 12px;
    padding: 4px 14px;
    background: linear-gradient(135deg,
        #fff8d6 0%,
        #ffd24f 45%,
        #ffa726 100%);
    color: #1a0e08;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;
    border: 1px solid rgba(255, 240, 200, 0.85);
    box-shadow:
        0 3px 10px rgba(255, 200, 60, 0.6),
        0 0 24px  rgba(255, 220, 90, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(120, 70, 10, 0.35);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ── Actions (rejouer) ────────────────────────── */
.th-bp-actions {
    position: relative;
    z-index: 7;
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}
.th-bp-actions[hidden] { display: none; }

/* ── Boutons ──────────────────────────────────── */
.th-bp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #ffffff;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
    letter-spacing: 0.2px;
    transition: background 0.15s, color 0.15s;
}
.th-bp-btn:hover { background: transparent; color: #ffffff; }
.th-bp-btn:disabled,
.th-bp-btn[disabled] { opacity: 0.45; cursor: not-allowed; background: #ffffff; color: #1a1a1a; }
.th-bp-btn-ghost {
    background: transparent;
    color: var(--bp-text);
    border-color: rgba(255, 255, 255, 0.25);
}
.th-bp-btn-ghost:hover { background: var(--bp-text); color: #1a1a1a; border-color: var(--bp-text); }

/* ── Inventaire ───────────────────────────────── */
.th-bp-inventory {
    position: relative;
    z-index: 2;
    margin: 32px auto 0;
    max-width: 720px;
    padding: 22px 24px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255, 210, 79, 0.3);
    border-radius: 14px;
}
.th-bp-inv-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--bp-accent-gold); }
.th-bp-inv-sub { margin: 0 0 14px; font-size: 12px; color: var(--bp-text-muted); }
.th-bp-inv-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.th-bp-inv-item {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}
.th-bp-inv-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
}
/* Bulle de quantité quand le même NFT a été tiré plusieurs fois (>1). */
.th-bp-inv-qty {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 24px;
    padding: 3px 8px;
    background: var(--bp-accent-gold);
    color: #1a0e08;
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.3px;
    border-radius: 999px;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    z-index: 2;
    pointer-events: none;
}
.th-bp-inv-item-name {
    font-size: 10px;
    color: var(--bp-text-soft);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
