:root {
    --bg-dark: #050508;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(168, 85, 247, 0.2);
    --color-c: #808080;
    --color-uc: #ffffff;
    --color-r: #22c55e;
    --color-sr: #3b82f6;
    --color-ur: #a855f7;
    --color-sec: #ef4444;
    --color-lr: #ff4500;
    --color-gld: #fbbf24;
    --color-rev: #22d3ee;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.03) 0%, transparent 40%), radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior: none;
}

/* 1. Titres : Playfair Display + 1re lettre en Cinzel Decorative */
h2, h3, .serif-text, .ext-1-title-text, .war-mode-title, .bh-title, .mkt-dtitle, .shop-daily-title {
    font-family: 'Playfair Display', serif !important;
}

h2, .war-mode-title, .bh-title, .mkt-dtitle, .shop-daily-title {
    text-transform: none !important;
}

    /* Permet à ::first-letter de fonctionner sur les h2 en flexbox contenant un span */
    h2 > span[data-i18n] {
        display: inline-block;
    }

        .ws-cap,
        h2::first-letter,
        h2 > span[data-i18n]::first-letter,
        h3::first-letter,
        .serif-text::first-letter,
        .ext-1-title-text::first-letter,
        .war-mode-title::first-letter,
        .bh-title::first-letter,
        .mkt-dtitle::first-letter,
        .shop-daily-title::first-letter {
            font-family: 'Cinzel Decorative', serif !important;
        }

/* 2. WIKISTORY (en-tête h1, boosters et tous les dos de cartes) : mot ENTIER en Cinzel Decorative */
h1, h1 *,
.boosterTitle, .boosterTitle *,
.card-back .serif-text,
.card-back-content > div:first-child,
.card-back-inner-wrapper .serif-text,
.deck-back > div:first-child {
    font-family: 'Cinzel Decorative', serif !important;
}

/* Réduction et harmonisation de la taille des onglets et titres spécifiques */
.tab-title-guerre,
h2.title-guerre,
.section-guerre-title {
    font-size: 1.25rem !important; /* Taille ajustée pour être similaire aux autres onglets */
    text-transform: none !important; /* Désactive la mise en capitales forcée */
}

.combat-option-title,
.ia-title,
.pve-title,
.pvp-title {
    font-size: 1.15rem !important; /* Ajustement pour "affrontez l'ia..." et "affrontez un autre..." */
    text-transform: none !important;
}

/* Ajustement du cadre de filtres de la Mémoire */
.memory-filters-container,
.filters-wrapper {
    padding: 6px 12px !important; /* Réduction drastique de l'espace haut/bas */
    min-height: auto !important; /* Annule une éventuelle hauteur minimale excessive */
    height: 46px !important; /* Hauteur compacte, juste assez pour les icônes de filtre */
    display: flex;
    align-items: center;
    gap: 8px;
}

    /* Optionnel : Ajuste la taille des boutons/icônes internes pour qu'ils soient bien centrés */
    .memory-filters-container .filter-btn,
    .filters-wrapper .filter-icon {
        height: 32px !important;
        width: 32px !important;
        padding: 4px !important;
    }

/* Forcer la casse "Première lettre de chaque mot uniquement" */
.tab-title-sequence,
.tab-title-draft,
.combat-option-title,
.ia-title,
.pve-title,
.pvp-title,
.menu-item-text {
    text-transform: capitalize !important; /* "Séquences", "Draft", "Affrontez L'ia..." */
}

/* ----- 3D CAROUSEL ----- */
.carousel-item {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.4s ease;
    pointer-events: none;
}

    .carousel-item.active {
        z-index: 50;
    }

        .carousel-item.active .booster-pack {
            pointer-events: auto; /* Active le clic uniquement sur le booster physique central */
            opacity: 1;
            filter: none;
        }

    .carousel-item.side {
        z-index: 40;
    }

    .carousel-item.back {
        z-index: 10;
    }

    .carousel-item.side .booster-pack {
        pointer-events: auto;
        opacity: 0.6;
    }

    .carousel-item.back .booster-pack {
        pointer-events: none;
        opacity: 0.3;
    }

.boosterTitle {
    font-family: 'Cinzel Decorative', 'Playfair Display', serif;
}

/* ----- THEMATIC BOOSTERS ----- */
.booster-theme-gold .booster-layer {
    background: #4a3300;
    border-color: rgba(255, 215, 0, 0.4);
    backface-visibility: hidden;
}

.booster-theme-gold .booster-front {
    background: linear-gradient(145deg, #ffcf33, #b8860b, #4a2c00);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.4);
    backface-visibility: hidden;
}

.booster-theme-gold .boosterThemeLabel {
    color: #4a2c00;
    text-shadow: 0 0 5px rgba(255,255,255,0.8);
    font-weight: 900;
}

.booster-theme-carbon .booster-layer {
    background: #0f172a;
    border-color: #64748b;
    backface-visibility: hidden;
}

.booster-theme-carbon .booster-front {
    background: repeating-linear-gradient(45deg, #1e293b 0, #1e293b 4px, #0f172a 4px, #0f172a 8px);
    border-color: #94a3b8;
    box-shadow: inset 0 0 20px rgba(15,23,42,0.8);
    backface-visibility: hidden;
}

.booster-theme-carbon .boosterThemeLabel {
    color: #cbd5e1;
}

.booster-theme-cyber .booster-layer {
    background: #000;
    border-color: #0f0;
    backface-visibility: hidden;
}

.booster-theme-cyber .booster-front {
    background-color: #000;
    background-image: linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 0, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    border-color: #0f0;
    box-shadow: inset 0 0 20px rgba(0,255,0,0.4);
    backface-visibility: hidden;
}

.booster-theme-cyber .boosterThemeLabel {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.booster-theme-vintage .booster-layer {
    background: #5d4037;
    border-color: #8d6e63;
    backface-visibility: hidden;
}

.booster-theme-vintage .booster-front {
    background: linear-gradient(180deg, #e6dfd1, #d7ccc8);
    border-color: #8d6e63;
    backface-visibility: hidden;
}

.booster-theme-vintage .boosterThemeLabel {
    color: #2a1610;
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 0 10px #fff;
    font-weight: 900;
}

.booster-theme-prismatic .booster-layer {
    background: #022c22;
    border-color: #10b981;
    backface-visibility: hidden;
}

.booster-theme-prismatic .booster-front {
    background: linear-gradient(115deg, #10b981, #3b82f6, #8b5cf6);
    border-color: #10b981;
    box-shadow: inset 0 0 20px rgba(16,185,129,0.5);
    backface-visibility: hidden;
}

.booster-theme-prismatic .boosterThemeLabel {
    color: #10b981;
}

.booster-theme-reverse .booster-layer {
    background: #000;
    border-color: #22d3ee;
    backface-visibility: hidden;
}

.booster-theme-reverse .booster-front {
    background: linear-gradient(145deg, #000, #083344);
    border-color: #22d3ee;
    box-shadow: inset 0 0 20px rgba(34,211,238,0.5);
    backface-visibility: hidden;
}

.booster-theme-reverse .boosterThemeLabel {
    color: #22d3ee;
}

.booster-theme-parallel .booster-layer {
    background: #14062b;
    border-color: #e879f9;
    backface-visibility: hidden;
}

/* Booster PARALLEL : onde de rayons irisés et reflets holographiques */
.booster-theme-parallel .booster-front {
    background:
        radial-gradient(circle at 50% 46%, rgba(255,255,255,0.35) 0%, transparent 32%),
        repeating-conic-gradient(from 0deg at 50% 46%, rgba(232,121,249,0.32) 0deg 6deg, rgba(34,211,238,0.18) 6deg 12deg),
        linear-gradient(160deg, #2b0a4a 0%, #120a35 55%, #071a2e 100%);
    border-color: #e879f9;
    box-shadow: inset 0 0 24px rgba(232,121,249,0.55), 0 0 18px rgba(232,121,249,0.35);
    backface-visibility: hidden;
}

.booster-theme-parallel .booster-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(115deg, rgba(255,0,128,0.35) 0%, rgba(255,204,0,0.3) 6%, rgba(0,255,157,0.3) 12%, rgba(0,200,255,0.35) 18%, rgba(168,85,247,0.35) 24%, rgba(255,0,128,0.35) 30%);
    background-size: 300% 300%;
    mix-blend-mode: color-dodge;
    opacity: 0.55;
    animation: boosterParallelHolo 6s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 4;
}

@keyframes boosterParallelHolo { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }

.booster-theme-parallel .boosterThemeLabel {
    background: linear-gradient(90deg, #f0abfc, #67e8f9, #fde68a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900;
    filter: drop-shadow(0 0 4px rgba(232,121,249,0.8));
}

.booster-theme-holo .booster-layer {
    background: #fff;
    border-color: #fff;
    backface-visibility: hidden;
}

.booster-theme-holo .booster-front {
    background: linear-gradient(145deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff);
    border-color: #fff;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.8);
}

.booster-theme-holo .boosterThemeLabel {
    color: #fff;
    text-shadow: 0 0 5px #ff00ff;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes starShake {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }

    25%, 75% {
        transform: scale(1.05) rotate(3deg);
    }

    50% {
        transform: scale(0.95) rotate(-3deg);
    }
}

.booster-shaking .booster-center-star {
    animation: starShake 0.4s infinite;
}

.btn-purple-style {
    background-color: rgba(88, 28, 135, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #d8b4fe;
    text-shadow: 0 0 5px rgba(168,85,247,0.5);
    box-shadow: 0 0 10px rgba(168,85,247,0.2);
    transition: all 0.2s;
    cursor: pointer;
}

    .btn-purple-style:hover {
        background-color: rgba(147, 51, 234, 0.8);
        color: white;
        border-color: rgba(192, 132, 252, 1);
        box-shadow: 0 0 15px rgba(168,85,247,0.6);
    }

    .btn-purple-style:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        filter: grayscale(1);
    }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

    .modal-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.3s ease, visibility 0s linear 0s;
    }

.close-btn-hitbox {
    position: absolute;
    top: 0;
    right: 0;
    padding: 30px;
    z-index: 9999;
    cursor: pointer;
}

@keyframes drawCardAnim {
    0% {
        transform: translateY(50px) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.draw-anim {
    animation: drawCardAnim 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes starPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
        filter: brightness(2);
    }

    50% {
        transform: scale(1.5) rotate(15deg);
        filter: brightness(1.5);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
}

.star-pop {
    animation: starPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.booster-pack {
    transform: translateZ(-30px); /* au repos : légèrement en retrait, pour être net une fois avancé */
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    aspect-ratio: 2/3.4;
    max-width: 220px;
    width: 100%;
    margin: 0 auto;
}

    .booster-pack:hover {
        /* On remplace scale() par translateZ() pour avancer l'objet dans l'espace 3D. Fini le flou ! */
        transform: translateY(-10px) translateZ(0);
    }

    .booster-pack:active {
        transform: translateY(2px) translateZ(-20px);
    }

    .booster-pack.disabled {
        opacity: 0.5;
        pointer-events: none;
        filter: grayscale(50%);
    }

#viewDecks, #viewBattle, #deckEditorView {
    user-select: none;
    -webkit-user-select: none;
}

#editorDeckGrid .inv-item:hover {
    transform: translateY(-2px);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.booster-layer {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: #1f1f2e;
    border: 2px solid rgba(255,255,255,0.1);
    pointer-events: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.booster-front {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #1f1f2e, #0a0a10);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    z-index: 10;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

    .booster-front::before {
        content: '';
        position: absolute;
        inset: -50%;
        background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
        transform: rotate(45deg) translate3d(0,0,0);
        animation: boosterShine 4s infinite;
        z-index: 5;
        pointer-events: none;
    }

.booster-premium .booster-layer {
    background: #4a3300;
    border-color: rgba(255, 215, 0, 0.4);
}

.booster-premium .booster-front {
    background: linear-gradient(145deg, #ffcf33, #b8860b, #4a2c00);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.4);
}

.booster-premium .boosterTitle {
    color: #fff;
    text-shadow: 0 2px 10px rgba(255,255,255,0.8), 0 0 20px #ff0;
}

.booster-ultra .booster-layer {
    background: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.9);
}

.booster-ultra .booster-front {
    background: linear-gradient(145deg, #ffffff, #e2e8f0, #94a3b8);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: inset 0 0 30px rgba(255,255,255,0.8);
}

.booster-ultra .boosterTitle {
    color: #0f172a;
    text-shadow: 0 2px 10px rgba(255,255,255,1), 0 0 20px #94a3b8;
}

.booster-free .booster-layer {
    background: #4c1d95;
    border-color: rgba(167, 139, 250, 0.9);
}

.booster-free .booster-front {
    background: linear-gradient(145deg, #ddd6fe, #a78bfa, #4c1d95);
    border-color: #fff;
    box-shadow: inset 0 0 30px rgba(167, 139, 250, 0.8), 0 0 20px rgba(167, 139, 250, 0.5);
    animation: pulse-purple 2s infinite;
}

@keyframes pulse-purple {
    0% {
        box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
    }

    50% {
        box-shadow: 0 0 30px rgba(167, 139, 250, 0.9);
    }

    100% {
        box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
    }
}

/* GOD PACK */
.booster-god .booster-layer {
    background: linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    border-color: rgba(255, 255, 255, 0.9);
    background-size: 400% 400%;
    animation: rainbowBg 3s linear infinite;
}

.booster-god .booster-front {
    background: linear-gradient(145deg, rgba(255,255,255,0.5), rgba(0,0,0,0.2)), linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    background-size: 100% 100%, 400% 400%;
    background-blend-mode: overlay;
    border-color: #fff;
    box-shadow: inset 0 0 40px rgba(255,255,255,0.9), 0 0 30px rgba(255,255,255,0.6);
    animation: rainbowBg 3s linear infinite;
}

.booster-god .boosterTitle {
    color: #fff;
    text-shadow: 0 0 10px #fff, 0 0 20px #ff00ff;
}

@keyframes rainbowBg {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

@keyframes godShake {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translate(-10px, -10px) rotate(-2deg);
    }

    20%, 40%, 60%, 80% {
        transform: translate(10px, 10px) rotate(2deg);
    }
}

.god-shake-active {
    animation: godShake 0.4s infinite;
}

@keyframes boosterShine {
    0% {
        transform: translateX(-150%) translateY(-150%) rotate(45deg);
    }

    100% {
        transform: translateX(150%) translateY(150%) rotate(45deg);
    }
}

.booster-shaking {
    animation: shakeAction 0.5s infinite;
    pointer-events: none;
}

.booster-opening {
    animation: epicOpen 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    pointer-events: none;
}

@keyframes epicOpen {
    0% {
        transform: scale(1) rotateY(0deg) rotateX(0deg);
    }

    20% {
        transform: scale(0.9) rotateZ(-3deg) rotateY(15deg) rotateX(5deg);
    }

    40% {
        transform: scale(1.1) rotateZ(3deg) rotateY(-15deg) rotateX(-5deg);
    }

    60% {
        transform: scale(1.3) rotateZ(0deg) rotateY(0deg) rotateX(0deg);
        /* On remplace le filtre blur/brightness par une lueur qui ne pixelise pas l'image */
        box-shadow: 0 0 60px 20px rgba(255, 255, 255, 0.9);
        opacity: 1;
    }

    100% {
        transform: scale(3.5) translateY(-30px);
        opacity: 0;
    }
}

@keyframes shakeAction {
    0%, 100% {
        transform: scale(1) translate3d(0,0,0) rotateY(0deg) rotateX(0deg);
        filter: brightness(1);
    }

    25%, 75% {
        transform: scale(1.02) translate3d(-2px, 2px, 0) rotateY(-10deg) rotateX(5deg);
        filter: brightness(1.1);
    }

    50% {
        transform: scale(0.98) translate3d(2px, -2px, 0) rotateY(10deg) rotateX(-5deg);
        filter: brightness(1.2);
    }
}

.card-perspective {
    perspective: 1200px;
    width: 320px;
    height: 480px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    --spot-x: 50%;
    --spot-y: 50%;
}

@media (min-width: 768px) {
    .card-perspective {
        width: 360px;
        height: 540px;
    }
}

/* Boîte gradée : la carte garde les proportions d'une carte normale (2:3), c'est le cadre qui s'adapte */
.is-graded {
    width: 330px !important;
    height: 540px !important;
}

@media (min-width: 768px) {
    .is-graded {
        width: 360px !important;
        height: 560px !important;
    }
}

/* Bandeau de gradation : même hauteur au recto et au verso */
.grade-banner { height: 54px; }
@media (min-width: 768px) { .grade-banner { height: 80px; } }

/* Versus : le titre du bandeau rapetisse pour que les deux noms tiennent */
.grade-title-box { container-type: inline-size; }
.grade-title-fit { font-size: min(10px, calc(100cqw / (var(--gtn) * 0.74))) !important; white-space: nowrap; }
@media (min-width: 768px) { .grade-title-fit { font-size: min(14px, calc(100cqw / (var(--gtn) * 0.74))) !important; } }

.is-graded .card-face {
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.2), 0 20px 50px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    overflow: visible;
    transform-style: preserve-3d;
}

    .is-graded .card-face::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: inherit;
        z-index: -1;
        transform: translateZ(-1px);
    }

.is-graded .card-thickness {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    cursor: grab;
}

    .card-inner:active {
        cursor: grabbing;
    }

@keyframes craftPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    40% {
        transform: scale(1.08);
        filter: brightness(1.5) drop-shadow(0 0 40px #10b981);
    }

    80% {
        transform: scale(1.08);
        filter: brightness(2) drop-shadow(0 0 80px #10b981);
        opacity: 1;
    }

    100% {
        transform: scale(0.5);
        filter: brightness(3);
        opacity: 0;
    }
}

.crafting-glow {
    animation: craftPulse 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
    pointer-events: none;
}

@keyframes disintegrate {
    0% {
        transform: scale(1) rotate(0deg);
        filter: blur(0) brightness(1) sepia(0);
    }

    20% {
        transform: scale(1.05) rotate(-3deg);
        filter: blur(2px) brightness(1.5) sepia(1) hue-rotate(300deg);
    }

    70% {
        transform: scale(0.8) translateY(20px) rotate(8deg);
        filter: blur(8px) brightness(2) opacity(0.5);
    }

    100% {
        transform: scale(0) translateY(100px);
        filter: blur(20px) opacity(0);
    }
}

.destroying-glitch {
    animation: disintegrate 1.2s cubic-bezier(0.5, 0, 0.5, 1) forwards !important;
    pointer-events: none;
}

.card-face {
    position: absolute;
    inset: 0;
    background-color: #050508;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    transform: translate3d(0,0,2px);
    -webkit-transform: translate3d(0,0,2px);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.card-thickness {
    position: absolute;
    inset: 0;
    background-color: #111;
    border: 2px solid #222;
    border-radius: 16px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* L'ombre comble visuellement le gap de 2px sans créer de géométrie 3D supplémentaire */
    box-shadow: 0 0 1.5px 1px #111;
}

.card-back {
    transform: rotateY(180deg) translate3d(0,0,2px);
    background: radial-gradient(circle at 50% 50%, #222 0%, #050508 100%);
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border-radius: 16px;
    transform-style: preserve-3d;
}

.cond-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    z-index: 45;
    mix-blend-mode: normal;
}

.cond-MINT {
    opacity: 0;
}

.cond-NM {
    background: radial-gradient(circle at 0% 0%, rgba(200,200,200,0.4) 0%, transparent 6%), radial-gradient(circle at 100% 0%, rgba(200,200,200,0.4) 0%, transparent 6%), radial-gradient(circle at 0% 100%, rgba(200,200,200,0.4) 0%, transparent 6%), radial-gradient(circle at 100% 100%, rgba(200,200,200,0.4) 0%, transparent 6%);
}

.cond-GOOD {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='600'%3E%3Cpath d='M80 150 Q 130 190 140 260 M280 90 Q 260 140 230 190' stroke='rgba(255,255,255,0.25)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 100% 100%;
}

.cond-PLAYED {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='600'%3E%3Cpath d='M50 100 Q 110 180 120 300 M320 120 Q 270 200 240 280 M100 450 Q 180 400 250 380 M280 50 Q 300 90 290 150' stroke='rgba(255,255,255,0.3)' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 100% 100%;
}

.cond-DAMAGED {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='600'%3E%3Cpath d='M40 80 Q 120 160 130 320 M340 100 Q 270 190 240 310 M80 480 Q 180 410 280 380 M90 280 Q 160 330 220 420 M300 40 Q 320 100 300 180 M150 50 Q 130 100 140 160' stroke='rgba(255,255,255,0.35)' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"), radial-gradient(circle at 0% 0%, rgba(220,220,220,0.6) 0%, transparent 15%), radial-gradient(circle at 100% 0%, rgba(220,220,220,0.6) 0%, transparent 15%), radial-gradient(circle at 0% 100%, rgba(220,220,220,0.6) 0%, transparent 15%), radial-gradient(circle at 100% 100%, rgba(220,220,220,0.6) 0%, transparent 15%), radial-gradient(circle at 60% 30%, rgba(200,200,200,0.4) 0%, transparent 20%), radial-gradient(circle at 30% 70%, rgba(200,200,200,0.3) 0%, transparent 30%);
    box-shadow: inset 0 0 40px 10px rgba(200,200,200,0.3);
    background-size: 100% 100%;
}

.holo-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    transform: translate3d(0,0,0);
    -webkit-transform: translate3d(0,0,0);
    background-repeat: no-repeat;
}

.holo-sr, .holo-ur, .holo-sec, .holo-lr {
    background-size: 300% 300%;
    background-position: var(--spot-x, 50%) var(--spot-y, 50%);
    mix-blend-mode: color-dodge;
}

.holo-lr {
    background-image: linear-gradient(115deg, transparent 0%, transparent 20%, rgba(255, 215, 0, 0.3) 40%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 150, 0, 0.3) 60%, transparent 80%, transparent 100%);
    opacity: 0.4;
}

.holo-sr {
    background-image: linear-gradient(115deg, transparent 0%, transparent 20%, rgba(0, 200, 255, 0.3) 45%, rgba(255, 50, 100, 0.2) 55%, transparent 80%, transparent 100%);
}

.holo-ur {
    background-image: linear-gradient(115deg, transparent 0%, transparent 20%, rgba(200, 50, 255, 0.3) 45%, rgba(100, 200, 255, 0.2) 55%, transparent 80%, transparent 100%);
}

.holo-sec {
    background-image: linear-gradient(115deg, transparent 0%, transparent 20%, rgba(255, 50, 50, 0.3) 45%, rgba(255, 200, 0, 0.2) 55%, transparent 80%, transparent 100%);
}

.holo-gld {
    background-size: 300% 300%;
    background-position: var(--spot-x, 50%) var(--spot-y, 50%);
    mix-blend-mode: overlay;
    background-image: linear-gradient(115deg, transparent 0%, transparent 20%, rgba(255, 215, 0, 0.3) 45%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 215, 0, 0.3) 55%, transparent 80%, transparent 100%);
}

.holo-confetti, .holo-ice, .holo-stripes, .holo-bubbles, .holo-sparkles {
    background-image: radial-gradient( farthest-corner at var(--spot-x, 50%) var(--spot-y, 50%), #ff0000 0%, #ff9900 15%, #ffff00 30%, #33ff00 45%, #00ffff 60%, #0066ff 75%, #cc00ff 90%, #ff0000 100% );
    background-size: 100% 100%;
    opacity: 0.4; /* couche holographique des HOLO plus transparente (0.8 avant) */
    mix-blend-mode: color-dodge;
}

.holo-confetti {
    -webkit-mask-image: radial-gradient(ellipse at 25% 25%, black 2%, transparent 5%), radial-gradient(ellipse at 75% 75%, black 1.5%, transparent 4%), radial-gradient(ellipse at 10% 80%, black 2.5%, transparent 6%), radial-gradient(ellipse at 80% 10%, black 1%, transparent 3%), radial-gradient(ellipse at 50% 50%, black 3%, transparent 7%);
    -webkit-mask-size: 60px 60px, 80px 80px, 45px 45px, 70px 70px, 50px 50px;
}

.holo-ice {
    -webkit-mask-image: linear-gradient(105deg, transparent 20%, black 21%, black 23%, transparent 24%), linear-gradient(-35deg, transparent 40%, black 41%, black 43%, transparent 44%), linear-gradient(15deg, transparent 60%, black 61%, black 63%, transparent 64%);
    -webkit-mask-size: 560px 960px, 720px 800px, 480px 1120px;
}

.holo-stripes {
    -webkit-mask-image: repeating-linear-gradient(-45deg, black 0%, black 5%, transparent 5%, transparent 10%);
    -webkit-mask-size: 200% 200%;
}

.holo-bubbles {
    -webkit-mask-image: radial-gradient(circle, black 8px, transparent 9px), radial-gradient(circle, black 8px, transparent 9px);
    -webkit-mask-size: 100px 100px;
    -webkit-mask-position: 0 0, 50px 50px;
}

.holo-sparkles {
    -webkit-mask-image: linear-gradient(0deg, transparent 48%, black 48%, black 52%, transparent 52%), linear-gradient(90deg, transparent 48%, black 48%, black 52%, transparent 52%);
    -webkit-mask-size: 40px 40px;
}

.gold-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    /* ⚠️ ATTENTION : Plus de mix-blend-mode pour ne pas casser la 3D */
    background-image: radial-gradient(circle at 10% 10%, #fff 2px, transparent 4px), radial-gradient(circle at 20% 50%, #fff 3px, transparent 5px), radial-gradient(circle at 80% 20%, #fff 2px, transparent 4px), radial-gradient(circle at 90% 70%, #fff 3px, transparent 5px), radial-gradient(circle at 30% 80%, #fff 2px, transparent 4px), radial-gradient(circle at 60% 40%, #fff 3px, transparent 5px), radial-gradient(circle at 50% 90%, #fff 2px, transparent 4px), radial-gradient(circle at 70% 10%, #fff 3px, transparent 5px), radial-gradient(circle at 40% 30%, #fff 2px, transparent 4px);
    background-size: 100% 100%;
    /* On utilise drop-shadow pour simuler la lumière de l'or */
    filter: drop-shadow(0 0 4px #fbbf24) drop-shadow(0 0 8px #fff);
    opacity: 0.9;
}

/* On projette les étoiles à 60px (devant le texte qui est à 30px) */
.gold-stars-3d {
    transform: translateZ(60px) !important;
    -webkit-transform: translateZ(60px) !important;
    z-index: 100;
}

.cyber-glitch-pixels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    /* Utilisation de linear-gradient pour générer des carrés nets */
    background-image: linear-gradient(#0f0, #0f0), linear-gradient(#0f0, #0f0), linear-gradient(#0f0, #0f0), linear-gradient(#0f0, #0f0), linear-gradient(#0f0, #0f0), linear-gradient(#0f0, #0f0), linear-gradient(#0f0, #0f0);
    background-repeat: no-repeat;
    /* Tailles des carrés (largeur x hauteur) */
    background-size: 4px 4px, 6px 6px, 3px 3px, 8px 8px, 4px 4px, 5px 5px, 3px 3px;
    /* Positions respectives des carrés */
    background-position: 15% 25%, 35% 45%, 55% 15%, 75% 65%, 85% 85%, 25% 75%, 95% 35%;
    filter: drop-shadow(0 0 5px #0f0) drop-shadow(0 0 10px #0f0);
    animation: cyberColorPulse 4s infinite alternate ease-in-out;
}

/* On projette les pixels à 60px (devant le texte et l'infobulle) */
.cyber-pixels-3d {
    transform: translateZ(60px) !important;
    -webkit-transform: translateZ(60px) !important;
    z-index: 100;
}

.bg-cyber {
    background-color: #000 !important;
    background-image: linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 0, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.filter-cyber {
    filter: grayscale(100%) brightness(1.2) contrast(135%) sepia(100%) hue-rotate(180deg) saturate(350%);
    mix-blend-mode: screen;
}

.text-cyber {
    color: #fff !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: bold !important;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 8px #0f0, 0 0 15px #0f0, 0 0 20px #0f0 !important;
}

.holo-cyber {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 255, 0.4) 50%, transparent 100%);
    background-size: 100% 200%;
    animation: cyberScan 3s linear infinite;
    mix-blend-mode: color-dodge;
    pointer-events: none;
}

@keyframes cyberScan {
    0% {
        background-position: 0 -100%;
    }

    100% {
        background-position: 0 200%;
    }
}

/* --- OPTIONS GRAPHIQUES (js/gfx.js) --- */
/* Fond étoilé et particules */
body.gfx-no-bg .particle,
body.gfx-no-bg .star-layer,
body.gfx-no-bg .nebula {
    display: none !important;
    animation: none !important;
}
/* Effets animés des fragments (toutes tailles) */
body.gfx-no-cardfx .gold-stars,
body.gfx-no-cardfx .cyber-glitch-pixels { display: none !important; }
body.gfx-no-cardfx .ws-card, body.gfx-no-cardfx .ws-card *, body.gfx-no-cardfx .ws-card::before, body.gfx-no-cardfx .ws-card::after,
body.gfx-no-cardfx .ws-card *::before, body.gfx-no-cardfx .ws-card *::after,
body.gfx-no-cardfx .neb-behind, body.gfx-no-cardfx .neb-behind *, body.gfx-no-cardfx .neb-front, body.gfx-no-cardfx .neb-front * { animation: none !important; }
/* Les mêmes effets, seulement sur les fragments miniatures */
body.gfx-no-mini .ws-mini .gold-stars,
body.gfx-no-mini .ws-mini .cyber-glitch-pixels { display: none !important; }
body.gfx-no-mini .ws-mini, body.gfx-no-mini .ws-mini *, body.gfx-no-mini .ws-mini::before, body.gfx-no-mini .ws-mini::after,
body.gfx-no-mini .ws-mini *::before, body.gfx-no-mini .ws-mini *::after,
body.gfx-no-mini .neb-m, body.gfx-no-mini .neb-m * { animation: none !important; }
/* Rendu 3D, ombres et reflets */
body.gfx-flat .light-projection { display: none !important; }
/* « Rendu 3D » coupé : plus aucune profondeur. Les cartes sont dessinées à plat (une seule couche par carte au lieu d'une
   par élément), ce qui soulage beaucoup Firefox et les appareils modestes. Le retournement reste possible :
   la face cachée est masquée par js/card-modal.js (classes ff-front-side / ff-back-side). */
body.gfx-flat .card-perspective, body.gfx-flat .card-perspective-mini { perspective: none !important; }
body.gfx-flat .card-inner, body.gfx-flat .card-face, body.gfx-flat .card-face *,
body.gfx-flat .ws-card, body.gfx-flat .ws-card *, body.gfx-flat .card-back-inner-wrapper, body.gfx-flat .graded-card-slot {
    transform-style: flat !important;
    -webkit-transform-style: flat !important;
}
body.gfx-flat .card-inner.ff-back-side > .card-face:not(.card-back),
body.gfx-flat .card-inner:not(.ff-back-side) > .card-back { visibility: hidden; }
body.gfx-flat .card-back { background-color: #050508; }
body.gfx-flat .card-thickness { display: none !important; } /* tranche de la carte : sans profondeur, elle recouvrirait le dos */
body.gfx-flat .ws-card, body.gfx-flat .ws-card * { will-change: auto !important; }

body.gfx-flat .card-perspective,
body.gfx-flat .card-inner,
body.gfx-flat .card-face,
body.gfx-flat .glass-panel,
body.gfx-flat .modal-overlay * {
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* --- PRISMATIC (Spectre Boréal) --- */
.bg-prismatic {
    background-color: #022c22 !important;
}

.holo-prismatic {
    background: linear-gradient(115deg, rgba(16, 185, 129, 0.5), rgba(59, 130, 246, 0.5), rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.5), rgba(16, 185, 129, 0.5));
    background-size: 300% 300%;
    background-position: var(--spot-x, 50%) var(--spot-y, 50%);
    /* Remplacement par un motif de hachures régulier, net et uniforme (lignes de 2px espacées de 4px) */
    -webkit-mask-image: repeating-linear-gradient(45deg, #000 0px, #000 2px, transparent 2px, transparent 6px);
    mask-image: repeating-linear-gradient(45deg, #000 0px, #000 2px, transparent 2px, transparent 6px);
    animation: auroraAnim 5s linear infinite;
    mix-blend-mode: color-dodge;
    pointer-events: none;
}

@keyframes auroraAnim {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}
/* Flammes / Bordures 3D */
.f-prismatic {
    --f-c1: #10b981;
    --f-c2: #c084fc;
}

.f-size-full.f-prismatic {
    --f-b1: 15px;
    --f-s1: 5px;
    --f-b2: 30px;
    --f-s2: 10px;
    --f-b3: 10px;
    --f-s3: 2px;
}

.f-size-mini.f-prismatic {
    --f-b1: 3px;
    --f-s1: 1px;
    --f-b2: 6px;
    --f-s2: 2px;
    --f-b3: 2px;
    --f-s3: 1px;
}

.border-prismatic {
    border-color: #10b981 !important;
    box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.8), inset 0 0 40px rgba(45, 212, 191, 0.4);
}

.text-prismatic {
    color: #fff !important;
    font-family: 'Cinzel Decorative', serif !important;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #10b981, 0 0 10px #c084fc, 0 0 15px #2dd4bf !important;
}

.filter-prismatic {
    filter: saturate(150%) contrast(120%);
}

.text-gold-card {
    font-family: 'Playfair Display', serif !important;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, #fbbf24 50%, #b8860b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.5));
}

.bg-vintage {
    background-color: #f4ecd8 !important;
}

.filter-vintage {
    filter: sepia(0.8) contrast(1.2) brightness(0.85);
    mix-blend-mode: multiply;
}

.text-vintage {
    color: #3e2723 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: bold !important;
    text-shadow: none !important;
    letter-spacing: 0px !important;
    text-transform: uppercase;
}

.text-vintage-sm {
    color: #5d4037 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: bold !important;
}

.holo-vintage {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.3' mix-blend-mode='multiply'/%3E%3C/svg%3E"), radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6) 100%);
    opacity: 1;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.border-vintage {
    border-color: #5d4037 !important;
}

.bg-cert-vintage {
    background: linear-gradient(180deg, #e6dfd1, #d7ccc8);
    border-color: #8d6e63 !important;
    color: #3e2723 !important;
}

.filter-missprint {
    filter: hue-rotate(240deg) saturate(3) contrast(1.5);
}

.text-missprint {
    text-shadow: -2px 0 #00ffff, 2px 0 #ff00ff !important;
    color: #fff !important;
}

/* Reflet de la lumière : il fait ressortir la brillance (contraste et éclat) au lieu de délaver l'image.
   Couche principale en lumière douce (soft-light), légère ombre du côté opposé, petit point d'éclat net. */


.light-projection {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: soft-light;
    background:
    /* Premier radial-gradient : on élargit la lumière (ex: 0%, 40%, 80% au lieu de 0%, 20%, 50%) */
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 40%, transparent 80%),
    /* Second radial-gradient : on élargit l'ombrage opposé (ex: 85% au lieu de 60%) */
    radial-gradient(circle at calc(100% - var(--spot-x, 50%)) calc(100% - var(--spot-y, 50%)), rgba(0,0,0,0.30) 0%, transparent 85%);
}
    .light-projection::after {
        content: '';
        position: absolute;
        inset: 0;
        mix-blend-mode: color-dodge;
        /* On élargit pour correspondre à la nouvelle taille du spot */
        background: radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(255,250,235,0.20) 0%, rgba(255,250,235,0.05) 40%, transparent 75%);
    }

.rainbow-border {
    background: linear-gradient(#000, #000) padding-box, linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff) border-box !important;
    border-color: transparent !important;
}

.rainbow-border-mini {
    background: linear-gradient(#111, #111) padding-box, linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff) border-box !important;
    border-color: transparent !important;
}

.rainbow-border-back {
    background: linear-gradient(#222, #050508) padding-box, linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff) border-box !important;
    border-color: transparent !important;
}

/* Halo de base, fixe */
.fire-border {
    border-color: var(--f-c1) !important;
    z-index: 10;
    transform: translateZ(1px); /* force le rendu au premier plan sur iOS */
    box-shadow: 0 0 var(--f-b1) var(--f-s1) var(--f-c1), 0 0 var(--f-b2) var(--f-s2) var(--f-c2);
}
/* Halo intense, qui pulse en fondu */
.fire-border::after {
    content: '';
    position: absolute;
    inset: -6px; /* recouvre aussi la bordure de la carte */
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 calc(var(--f-b1) * 1.5) calc(var(--f-s1) * 1.5) var(--f-c2), 0 0 calc(var(--f-b2) * 1.5) calc(var(--f-s2) * 1.5) var(--f-c1);
    opacity: 0;
    animation: fire-fade 1s infinite alternate ease-in-out;
}
@keyframes fire-fade { from { opacity: 0; } to { opacity: 1; } }

.f-lr {
    --f-c1: #ff4500;
    --f-c2: #ff0000;
}

.f-sec {
    --f-c1: #ef4444;
    --f-c2: #f87171;
}

.f-ur {
    --f-c1: #7e22ce;
    --f-c2: #a855f7;
}

.f-sr {
    --f-c1: #3b82f6;
    --f-c2: #60a5fa;
}

.f-gold {
    --f-c1: #fbbf24;
    --f-c2: #f59e0b;
}

.f-rev {
    --f-c1: #22d3ee;
    --f-c2: #06b6d4;
}

.f-missprint {
    --f-c1: #d946ef;
    --f-c2: #06b6d4;
}

.f-cyber {
    --f-c1: #00ffff;
    --f-c2: #ff00ff;
}

.f-vintage {
    --f-c1: #8d6e63;
    --f-c2: #4e342e;
}

.f-carbon {
    --f-c1: #94a3b8;
    --f-c2: #38bdf8;
}

.f-size-full.f-lr, .f-size-full.f-gold, .f-size-full.f-rev, .f-size-full.f-missprint, .f-size-full.f-cyber, .f-size-full.f-vintage, .f-size-full.f-carbon {
    --f-b1: 15px;
    --f-s1: 5px;
    --f-b2: 30px;
    --f-s2: 10px;
    --f-b3: 10px;
    --f-s3: 2px;
}

.f-size-mini.f-lr, .f-size-mini.f-gold, .f-size-mini.f-rev, .f-size-mini.f-missprint, .f-size-mini.f-cyber, .f-size-mini.f-vintage, .f-size-mini.f-carbon {
    --f-b1: 3px;
    --f-s1: 1px;
    --f-b2: 6px;
    --f-s2: 2px;
    --f-b3: 2px;
    --f-s3: 1px;
}

.f-size-full.f-sec {
    --f-b1: 10px;
    --f-s1: 3px;
    --f-b2: 20px;
    --f-s2: 6px;
    --f-b3: 8px;
    --f-s3: 1px;
}

.f-size-mini.f-sec {
    --f-b1: 2px;
    --f-s1: 0px;
    --f-b2: 4px;
    --f-s2: 1px;
    --f-b3: 1px;
    --f-s3: 0px;
}

.f-size-full.f-ur {
    --f-b1: 8px;
    --f-s1: 2px;
    --f-b2: 15px;
    --f-s2: 4px;
    --f-b3: 5px;
    --f-s3: 1px;
}

.f-size-mini.f-ur {
    --f-b1: 1.5px;
    --f-s1: 0px;
    --f-b2: 3px;
    --f-s2: 1px;
    --f-b3: 1px;
    --f-s3: 0px;
}

.f-size-full.f-sr {
    --f-b1: 5px;
    --f-s1: 1px;
    --f-b2: 10px;
    --f-s2: 2px;
    --f-b3: 3px;
    --f-s3: 0px;
}

.f-size-mini.f-sr {
    --f-b1: 1px;
    --f-s1: 0px;
    --f-b2: 2px;
    --f-s2: 0px;
    --f-b3: 1px;
    --f-s3: 0px;
}

.stat-badge {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

    .stat-badge:hover {
        transform: scale(1.05);
    }

    .stat-badge.active-filter {
        box-shadow: 0 0 10px rgba(168,85,247,0.5);
        border-color: #a855f7;
        color: white !important;
    }

.inv-item {
    transition: transform 0.2s ease;
    contain-intrinsic-size: 120px 204px; /* Taille approximative de vos cartes pour éviter les sauts de scroll */
}

    .inv-item:hover {
        will-change: transform;
        transform: translateY(-8px) scale(1.05);
        z-index: 10;
        box-shadow: 0 15px 30px rgba(0,0,0,0.8), 0 0 20px rgba(6, 182, 212, 0.6);
    }

    .inv-item img {
        pointer-events: none;
        user-select: none;
    }

.dup-badge {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 2px solid rgba(168, 85, 247, 0.6);
    animation: pulse-purple 2s infinite;
}

.reveal-halo {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    transform: translateZ(1px); /* Safari iOS masque les z-index négatifs en 3D */
    z-index: 10;
}

    .reveal-halo.play {
        animation: explodeHalo 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    }

    .reveal-halo.halo-rainbow.play {
        animation: explodeRainbowHalo 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
        border-radius: 50%;
    }

@keyframes explodeHalo {
    0% {
        box-shadow: 0 0 20px 20px var(--halo-color);
        opacity: 0.8;
    }

    100% {
        box-shadow: 0 0 200px 100px var(--halo-color);
        opacity: 0;
    }
}

@keyframes explodeRainbowHalo {
    0% {
        opacity: 1;
        transform: scale(1);
        background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
        filter: blur(20px);
    }

    100% {
        opacity: 0;
        transform: scale(3.5);
        background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
        filter: blur(60px);
    }
}

.particle {
    position: absolute;
    border-radius: 50%;
    background-color: var(--p-color);
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px var(--p-color), 0 0 20px var(--p-color), inset 0 0 6px #ffffff;
    animation: particleOut forwards;
    box-shadow: 0 0 10px var(--p-color);
}

@keyframes particleOut {
    0% {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--tx)), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes particleTextOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}

.rarity-burst {
    animation: burstAnim 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes burstAnim {
    0% {
        transform: scale(0.5);
        opacity: 0;
        filter: blur(20px);
        letter-spacing: -10px;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: blur(0px);
        letter-spacing: 15px;
    }

    100% {
        transform: scale(1);
        opacity: 1;
        letter-spacing: 10px;
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #6b21a8;
    border-radius: 3px;
}

.text-outline {
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0px 0px 4px #000;
}

.text-outline-sm {
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.glitch-anim .glitch-text {
    animation: glitch 1s linear infinite;
    position: relative;
}

    .glitch-anim .glitch-text::before, .glitch-anim .glitch-text::after {
        content: attr(data-text);
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent;
    }

    .glitch-anim .glitch-text::before {
        left: 2px;
        text-shadow: -2px 0 red;
        clip: rect(24px, 550px, 90px, 0);
        animation: glitch-anim-2 3s infinite linear alternate-reverse;
    }

    .glitch-anim .glitch-text::after {
        left: -2px;
        text-shadow: -2px 0 cyan;
        clip: rect(85px, 550px, 140px, 0);
        animation: glitch-anim 2.5s infinite linear alternate-reverse;
    }

@keyframes glitch {
    2%, 64% {
        transform: translate(2px,0) skew(0deg);
    }

    4%, 60% {
        transform: translate(-2px,0) skew(0deg);
    }

    62% {
        transform: translate(0,0) skew(5deg);
    }
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 31px, 0);
    }

    20% {
        clip: rect(65px, 9999px, 11px, 0);
    }

    40% {
        clip: rect(43px, 9999px, 86px, 0);
    }

    60% {
        clip: rect(12px, 9999px, 43px, 0);
    }

    80% {
        clip: rect(76px, 9999px, 2px, 0);
    }

    100% {
        clip: rect(23px, 9999px, 98px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(3px, 9999px, 75px, 0);
    }

    40% {
        clip: rect(85px, 9999px, 12px, 0);
    }

    60% {
        clip: rect(23px, 9999px, 64px, 0);
    }

    80% {
        clip: rect(45px, 9999px, 32px, 0);
    }

    100% {
        clip: rect(9px, 9999px, 86px, 0);
    }
}

.battle-slot {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 8px;
    position: relative;
    aspect-ratio: 2/3.4;
    width: 100%;
    max-width: 120px;
    transition: all 0.3s;
}

    .battle-slot.highlight {
        border-color: #a855f7;
        box-shadow: 0 0 15px rgba(168,85,247,0.5);
        cursor: pointer;
        background: rgba(168,85,247,0.1);
    }

    .battle-slot.has-card {
        border-color: transparent !important;
        background: transparent !important;
    }

.deck-back {
    background: radial-gradient(circle at 50% 50%, #222 0%, #050508 100%);
}

.fusion-highlight-ready {
    border-color: #a855f7 !important;
    box-shadow: 0 0 20px rgba(168,85,247,0.6) !important;
    background: rgba(168,85,247,0.2) !important;
}

.empty-slot-highlight {
    border-color: #22d3ee !important;
    box-shadow: 0 0 20px rgba(34,211,238,0.6) !important;
    background: rgba(34,211,238,0.2) !important;
}

.fusion-highlight {
    border-color: #d946ef !important;
    box-shadow: 0 0 25px #d946ef !important;
    background: rgba(217,70,239,0.3) !important;
}

.card-sleeping {
    filter: grayscale(50%) brightness(0.7);
}

.sleeping-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 50;
    pointer-events: none;
    animation: floatZzz 2s infinite;
    text-shadow: 0 0 5px black;
}

@keyframes floatZzz {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -100%) scale(1);
    }
}

.attack-anim {
    animation: attackMove 0.5s ease-in-out forwards;
    z-index: 100;
}

.attack-anim-enemy {
    animation: attackMoveEnemy 0.5s ease-in-out forwards;
    z-index: 100;
}

@keyframes attackMove {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-100px) scale(1.1);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes attackMoveEnemy {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(100px) scale(1.1);
    }

    100% {
        transform: translateY(0);
    }
}

.damage-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #ff4444;
    font-weight: 900;
    font-size: 24px;
    text-shadow: 0 0 5px black, 0 0 10px black;
    z-index: 200;
    pointer-events: none;
    animation: floatDmg 2s forwards;
}

@keyframes floatDmg {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -120px) scale(1.5);
    }
}

@keyframes floatDmg {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -120px) scale(1.5);
    }
}

@keyframes floatDmg {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -120px) scale(1.5);
    }
}

@keyframes impactAnim {
    0% {
        transform: scale(1) translate(0, 0);
        filter: brightness(1);
    }

    20% {
        transform: scale(1.1) translate(-2px, 2px);
        filter: brightness(1.8) contrast(1.5) sepia(1) hue-rotate(-50deg);
        box-shadow: 0 0 20px red;
    }

    40% {
        transform: scale(0.9) translate(2px, -2px);
        filter: brightness(1.5);
    }

    60% {
        transform: scale(1.05) translate(-2px, -2px);
        filter: brightness(1.2);
    }

    80% {
        transform: scale(0.95) translate(2px, 2px);
        filter: brightness(1.1);
    }

    100% {
        transform: scale(1) translate(0, 0);
        filter: brightness(1);
    }
}

.impact-anim {
    animation: impactAnim 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    z-index: 100;
}

@keyframes fusionSpawn {
    0% {
        transform: scale(2) rotateZ(360deg) translateY(-100px);
        opacity: 0;
        filter: brightness(3) blur(10px);
        box-shadow: 0 0 100px #d946ef;
    }

    50% {
        transform: scale(1.2) rotateZ(0deg) translateY(-10px);
        opacity: 1;
        filter: brightness(2) blur(0px);
        box-shadow: 0 0 50px #d946ef;
    }

    100% {
        transform: scale(1) rotateZ(0deg) translateY(0);
        filter: brightness(1);
        box-shadow: none;
    }
}


.bg-carbon {
    background: repeating-linear-gradient(45deg, #1e293b 0, #1e293b 4px, #0f172a 4px, #0f172a 8px) !important;
}

.filter-carbon {
    filter: sepia(0.3) hue-rotate(180deg) brightness(1.2) contrast(1.3);
    mix-blend-mode: luminosity;
    opacity: 0.9;
}

.text-carbon {
    color: #f8fafc !important;
    text-shadow: 0 0 5px #94a3b8, 0 0 10px #94a3b8 !important;
    font-family: 'Courier New', Courier, monospace !important;
}

.border-carbon {
    border-color: #94a3b8 !important;
    box-shadow: inset 0 0 20px rgba(15,23,42,0.8);
}

.holo-carbon {
    background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.2) 40%, rgba(200,220,255,0.6) 50%, rgba(255,255,255,0.2) 60%, transparent 100%);
    background-size: 300% 300%;
    background-position: var(--spot-x, 50%) var(--spot-y, 50%);
    mix-blend-mode: color-dodge;
    opacity: 0.7;
    pointer-events: none;
}

@keyframes cyberColorPulse {
    0% {
        filter: hue-rotate(0deg) brightness(1);
    }

    33% {
        filter: hue-rotate(90deg) brightness(1.3);
    }

    66% {
        filter: hue-rotate(180deg) brightness(1.5);
    }

    100% {
        filter: hue-rotate(270deg) brightness(1.2);
    }
}

/* ----- CARTES HORIZONTALES ----- */
.card-perspective.is-horizontal {
    width: 336px;
    height: 224px;
}

@media (min-width: 768px) {
    .card-perspective.is-horizontal {
        width: 540px;
        height: 360px;
    }
}
/* Ajustement des proportions pour la boîte gradée horizontale */
.is-graded.is-horizontal {
    width: 346px !important;
    height: 310px !important;
}

@media (min-width: 768px) {
    .is-graded.is-horizontal {
        width: 580px !important;
        height: 450px !important;
    }
}

.mini-horizontal-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 170%;
    height: 58.82%;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
}

/* --- EXTENSION 1 : PIERRE HISTORIQUE (REMASTERED) --- */
:root {
    /* Forme abîmée plus fréquente mais moins profonde (max 3%).
               Le coin en haut à droite (100% 0%) est strictement préservé. */
    --ext-1-clip: polygon( 2% 2%, 12% 0%, 25% 3%, 38% 0%, 50% 2%, 62% 0%, 75% 3%, 88% 0%, 100% 0%, 100% 12%, 97% 25%, 100% 38%, 98% 50%, 100% 62%, 97% 75%, 100% 88%, 98% 100%, 88% 97%, 75% 100%, 62% 98%, 50% 100%, 38% 97%, 25% 100%, 12% 98%, 0% 100%, 3% 88%, 0% 75%, 2% 62%, 0% 50%, 3% 38%, 0% 25%, 2% 12%, 0% 2% );
}

.ext-1 {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

/* La bordure de pierre (qui prend la couleur de la carte) */
.ext-1-stone-edge {
    position: absolute;
    inset: -5px; /* Épaisseur divisée par 2 */
    background-color: var(--ext-color, #d7ccc8);
    /* Ajout d'un léger dégradé clair/sombre pour nuancer la teinte de la rareté */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.05' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15' mix-blend-mode='multiply'/%3E%3C/svg%3E"), linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.3) 100%);
    clip-path: var(--ext-1-clip);
    z-index: -1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Le fond intérieur en Marbre (Totalement opaque pour cacher le dos) */
.ext-1-marble-bg {
    background-color: #e5e0d8;
    /* Génération de veines de marbre en pur SVG/CSS */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015' numOctaves='3' result='t'/%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 4 -1.5' in='t' result='m'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)' opacity='0.15'/%3E%3C/svg%3E"), linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(0,0,0,0.05) 100%);
    clip-path: var(--ext-1-clip);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* L'image se dissipe dans le marbre vers le bas */
.ext-1-img {
    filter: sepia(0.2) contrast(1.1) brightness(0.9);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
}

.ext-1-title-text {
    color: #272018 !important;
    /* Contour blanc rigide + Lueur diffuse pour une lisibilité parfaite */
    text-shadow: -1px -1px 0 rgba(255,255,255,0.9), 1px -1px 0 rgba(255,255,255,0.9), -1px 1px 0 rgba(255,255,255,0.9), 1px 1px 0 rgba(255,255,255,0.9), 0 0 12px rgba(255,255,255,1) !important;
    font-family: 'Cinzel Decorative', serif !important;
    font-weight: 900 !important;
}

/* Nouvelle police élégante et lisible pour la description */
.ext-1-desc-text {
    color: #3e2723 !important;
    font-family: 'Playfair Display', serif !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 1.25;
    text-shadow: 0 1px 1px rgba(255,255,255,0.3) !important;
}

/* Booster de l'Extension 1 */
.booster-ext-1 .booster-layer {
    background: #5d4037;
    border-color: #8d6e63;
}

.booster-ext-1 .booster-front {
    background: linear-gradient(135deg, #e8e4d9 0%, #a1887f 100%);
    border: 2px solid #5d4037;
}

.booster-ext-1 .boosterTitle {
    color: #3e2723;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
    font-family: 'Cinzel Decorative', serif;
}

.booster-ext-1 .booster-center-star img {
    /* Donne une teinte sépia / cuivrée à l'image de l'étoile pour l'intégrer au thème pierre */
    filter: sepia(0.8) hue-rotate(-20deg) brightness(0.8) contrast(1.2) !important;
}

#achievement-banner {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid #fbbf24;
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99999;
    box-shadow: 0 4px 25px rgba(251, 191, 36, 0.3);
    pointer-events: none;
}

    #achievement-banner.show {
        top: 30px;
    }

.achievement-icon {
    font-size: 24px;
    animation: starPop 0.6s ease-out forwards;
}

#quest-banner {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid #3b82f6; /* Bordure Bleue pour les quêtes */
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99998;
    box-shadow: 0 4px 25px rgba(59, 130, 246, 0.3);
    pointer-events: none;
}
    /* On la fait descendre un peu plus bas que les succès (90px au lieu de 30px) pour éviter qu'elles se superposent si elles se déclenchent en même temps */
    #quest-banner.show {
        top: 90px;
    }

.quest-icon {
    font-size: 24px;
    animation: starPop 0.6s ease-out forwards;
}

/* ----- TUTORIAL MODAL ----- */
.tutorial-slide {
    display: none;
    animation: fadeIn 0.5s ease-out forwards;
}

    .tutorial-slide.active {
        display: flex;
    }

.fan-cards {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
    perspective: 1000px;
}

.fan-card-wrapper {
    position: absolute;
    width: 130px;
    aspect-ratio: 2/3.4;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), z-index 0s;
    cursor: pointer;
    transform-style: preserve-3d;
    /* Optimisation matérielle */
    will-change: transform;
}

    .fan-card-wrapper:nth-child(1) {
        transform: translateX(-75px) rotate(-15deg) translateY(20px);
        z-index: 1;
    }

    .fan-card-wrapper:nth-child(2) {
        transform: translateX(0) rotate(0deg) translateY(0);
        z-index: 3;
    }

    .fan-card-wrapper:nth-child(3) {
        transform: translateX(75px) rotate(15deg) translateY(20px);
        z-index: 2;
    }

    .fan-card-wrapper:hover {
        transform: translateX(0) translateY(-30px) scale(1.6) rotate(0deg) !important;
        z-index: 50 !important;
    }

.tut-graded-card {
    width: 140px;
    aspect-ratio: 2/3.4;
    transition: transform 0.5s ease;
    cursor: pointer;
    transform-style: preserve-3d;
    position: relative;
    will-change: transform;
}
    /* Zoom au survol de la carte gradée */
    .tut-graded-card:hover {
        transform: translateY(-10px) scale(1.6);
        z-index: 50;
    }

/* ----- FOND COSMIQUE 3D OPTIMISÉ ----- */
#cosmic-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #050508;
    overflow: hidden;
    pointer-events: none;
}

body.space-warp-active .modal-overlay,
body.space-warp-active #summonResultsOverlay {
    background: rgba(5, 5, 8, 0.8) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.nebula {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15) 0%, transparent 50%), radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.1) 0%, transparent 50%), radial-gradient(circle at 50% 80%, rgba(147, 51, 234, 0.1) 0%, transparent 50%);
    filter: blur(60px);
    transform: translateZ(0);
}

/* Calques d'étoiles avec point de fuite au centre exact */
.star-layer {
    position: absolute;
    inset: -100%;
    background-repeat: repeat;
    transform-origin: center center;
    /* L'animation est définie en dur ici, mais mise en PAUSE */
    animation: warpDrive 12s linear infinite;
    animation-play-state: paused;
}

/* Quand on découvre une carte, l'animation reprend là où elle s'était arrêtée.
   Les 4 calques font 9 fois l'écran : ils ne sont préparés pour le GPU (will-change) que pendant le voyage. */
body.space-warp-active .star-layer {
    animation-play-state: running;
    will-change: transform, opacity;
}

/* Les délais négatifs permettent de répartir les 4 calques dans le cycle de 12 secondes */
.layer-1 {
    background-image: radial-gradient(1px 1px at 10% 20%, #ffffff, rgba(0,0,0,0)), radial-gradient(2px 2px at 80% 80%, #94a3b8, rgba(0,0,0,0));
    background-size: 250px 250px;
    animation-delay: 0s;
}

.layer-2 {
    background-image: radial-gradient(1.5px 1.5px at 20% 80%, #ffffff, rgba(0,0,0,0)), radial-gradient(2px 2px at 60% 30%, #93c5fd, rgba(0,0,0,0));
    background-size: 350px 350px;
    animation-delay: -3s;
}

.layer-3 {
    background-image: radial-gradient(2px 2px at 40% 40%, #ffffff, rgba(0,0,0,0)), radial-gradient(1.5px 1.5px at 70% 90%, #d8b4fe, rgba(0,0,0,0));
    background-size: 450px 450px;
    animation-delay: -6s;
}

.layer-4 {
    background-image: radial-gradient(1.5px 1.5px at 15% 15%, #ffffff, rgba(0,0,0,0)), radial-gradient(2.5px 2.5px at 85% 45%, #fde047, rgba(0,0,0,0));
    background-size: 550px 550px;
    animation-delay: -9s;
}

@keyframes warpDrive {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* ========================================================= */
/* --- PATCH ANTI-CLIGNOTEMENT (MOBILE & CHROME ANDROID) --- */
/* ========================================================= */

/* 1. Lissage des polices et stabilisation du défilement */
body {
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none; /* Empêche l'effet "élastique" sur mobile qui fait lagger */
}

/* 2. Résolution du Z-Fighting (Cartes 3D) */
/* On écarte les différentes couches de 2px à 4px au lieu de 1px pour aider le GPU mobile */
.card-inner {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.card-face {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* L'outline transparent force le GPU mobile à lisser parfaitement les bords de la carte */
    outline: 1px solid transparent;
}

/* 3. Résolution des flashs d'écran globaux (Bug Backdrop-filter + 3D) */
/* On force la création d'un calque matériel distinct pour isoler le flou du reste du jeu */
.modal-overlay {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 4. Optimisation des hologrammes et projections de lumière */
.holo-layer, .holo-vintage, .light-projection {
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    isolation: isolate;
}

/* ISOLATION STRICTE POUR MOBILE (Évite les bugs GPU Android) */
@media (max-width: 768px) {
    /* Désactive le blur qui fait clignoter les éléments 3D */
    #viewDiscovery .glass-panel,
    .modal-overlay,
    .backdrop-blur,
    .backdrop-blur-md,
    .backdrop-blur-xl {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(15, 15, 20, 0.95) !important;
    }

    /* SUPPRIME "will-change" : c'est lui qui fait disparaître les boosters sur Android */
    .booster-front, .booster-layer {
        will-change: auto !important;
        -webkit-transform: translateZ(0);
    }

    /* Retire le blur de l'overlay de résultat des boosters sur mobile */
    #summonResultsOverlay {
        backdrop-filter: none !important;
        background-color: rgba(5, 5, 8, 0.98) !important;
    }
}

/* ========================================= */
/* --- PANNEAU D'ANALYSE LATÉRAL --- */
/* ========================================= */

#modalCardContainer {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* BOUTON CYAN */
.btn-cyan-style {
    background-color: rgba(8, 145, 178, 0.2);
    border: 1px solid rgba(6, 182, 212, 0.5);
    color: #a5f3fc;
    text-shadow: 0 0 5px rgba(6,182,212,0.5);
    box-shadow: 0 0 10px rgba(6,182,212,0.2);
    transition: all 0.2s;
    cursor: pointer;
}

    .btn-cyan-style:hover {
        background-color: rgba(8, 145, 178, 0.8);
        color: white;
        border-color: rgba(34, 211, 238, 1);
        box-shadow: 0 0 15px rgba(6,182,212,0.6);
    }

/* INFOBULLE D'ANALYSE ET DÉCALAGE DE LA CARTE */
@media (min-width: 700px) {
    #cardModal.analysis-open #modalCardContainer {
        transform: translateX(-220px);
    }

    #analysisTooltip {
        margin-left: 160px !important;
        width: 420px !important; /* Beaucoup plus large sur PC */
    }
}

@media (max-width: 767px) {
    #cardModal.analysis-open #modalCardContainer {
        transform: translateY(-160px) scale(0.75); /* On monte la carte et on la réduit */
    }

    #cardModal.analysis-open #analysisTooltip {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0) !important; /* Retire la rotation 3D sur mobile */
    }

    #analysisTooltip {
        top: auto !important; /* Annule le centrage vertical */
        bottom: 20px !important; /* Fixe en bas de l'écran */
        left: 50% !important;
        margin-left: 0 !important;
        width: 90% !important;
        max-width: 400px;
        transform: translate(-50%, 50px); /* Position de départ cachée */
    }

        /* Sur mobile, on limite la hauteur des listes d'analyse pour être sûr que ça rentre */
        #analysisTooltip .custom-scrollbar {
            max-height: 40vh !important;
        }
}

#analysisTooltip {
    opacity: 0;
    visibility: hidden;
    /* Changer -50% en -35% */
    transform: translate3d(0, -35%, -100px) rotateY(-15deg);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

#cardModal.analysis-open #analysisTooltip {
    opacity: 1;
    visibility: visible;
    /* Changer -50% en -35% */
    transform: translate3d(0, -35%, 50px) rotateY(-5deg);
}

/* Barre de défilement discrète */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(6,182,212,0.5);
    border-radius: 4px;
}

/* Collections */
#collectionsListGrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.wsc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.wsc-input, .wsc-select {
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(168,85,247,0.5);
    color: #fff;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13px;
    outline: none;
}

.wsc-input {
    flex: 1 1 200px;
    min-width: 0;
}

    .wsc-input:focus, .wsc-select:focus {
        border-color: #c084fc;
        box-shadow: 0 0 10px rgba(168,85,247,0.5);
    }

.wsc-select option {
    background: #0a0a12;
    color: #fff;
}

.wsc-empty {
    grid-column: 1 / -1;
    padding: 48px 0;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.wsc-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    padding: 10% 6% 7%;
    border-radius: 12px;
    border: 1px solid rgba(168,85,247,0.35);
    background: linear-gradient(160deg, #1a1030 0%, #0a0a12 60%, #050508 100%);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

    .wsc-tile:hover {
        transform: translateY(-3px);
        border-color: #c084fc;
        box-shadow: 0 0 20px rgba(168,85,247,0.5);
    }

.wsc-medal {
    width: 68%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #c084fc;
    background: #000;
    box-shadow: 0 0 14px rgba(168,85,247,0.7);
}

    .wsc-medal img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .wsc-medal.wsc-icon {
        background: radial-gradient(circle, #ffffff 0%, #e9e3f7 100%);
    }

        .wsc-medal.wsc-icon img {
            object-fit: contain;
            padding: 16%;
        }

.wsc-name {
    width: 100%;
    margin-top: 10%;
    min-height: 2.4em;
    color: #fff;
    font-weight: 700;
    font-size: clamp(10px, 1.55vw, 18px);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.wsc-count {
    margin-top: 6%;
    color: #e9d5ff;
    font-weight: 700;
    font-size: clamp(9px, 1.3vw, 15px);
}

.wsc-bar {
    width: 100%;
    height: 5px;
    margin-top: 5%;
    border-radius: 99px;
    overflow: hidden;
    background: rgba(255,255,255,0.12);
}

    .wsc-bar > div {
        height: 100%;
        background: linear-gradient(90deg, #a855f7, #4ade80);
    }

.wsc-pct {
    margin-top: 4%;
    color: #4ade80;
    font-weight: 700;
    font-size: clamp(9px, 1.3vw, 15px);
}

.wsc-binder {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(145deg, #2a1746, #120a22);
    border: 1px solid rgba(168,85,247,0.5);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), inset 0 0 30px rgba(0,0,0,0.6);
}

    .wsc-binder.wsc-next {
        animation: wscNext 0.3s ease-out;
    }

    .wsc-binder.wsc-prev {
        animation: wscPrev 0.3s ease-out;
    }

@keyframes wscNext {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes wscPrev {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.wsc-page {
    flex: 1 1 0;
    min-width: 0;
    max-width: 410px;
    display: flex;
    flex-direction: column;
    padding: 12px 12px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, #16161f, #0d0d14);
}

    .wsc-page.wsc-left {
        border-radius: 10px 2px 2px 10px;
        box-shadow: inset -14px 0 18px -12px rgba(0,0,0,0.9);
    }

    .wsc-page.wsc-right {
        border-radius: 2px 10px 10px 2px;
        box-shadow: inset 14px 0 18px -12px rgba(0,0,0,0.9);
    }

.wsc-spine {
    position: relative;
    z-index: 2;
    width: 26px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(90deg, #07040d, #231338, #07040d);
}

    .wsc-spine span {
        width: 36px;
        height: 12px;
        flex-shrink: 0;
        border-radius: 99px;
        border: 2px solid #9ca3af;
        background: linear-gradient(180deg, #f3f4f6, #6b7280);
        box-shadow: 0 2px 4px rgba(0,0,0,0.8);
    }

.wsc-pockets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    justify-items: center;
}

.wsc-pocket {
    position: relative;
    width: 100%;
    max-width: 120px;
    aspect-ratio: 2 / 3.4;
    border-radius: 8px;
    border: 1px dashed rgba(168,85,247,0.3);
    background: rgba(255,255,255,0.03);
    box-shadow: inset 0 6px 10px rgba(0,0,0,0.5);
}

    .wsc-pocket.wsc-full {
        border-color: transparent;
        background: none;
        box-shadow: none;
    }

.wsc-pagenum {
    margin-top: 8px;
    text-align: center;
    color: #6b7280;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.wsc-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
}

    .wsc-nav span {
        min-width: 130px;
        text-align: center;
        color: #e9d5ff;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

.wsc-custombar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.wsc-customcount {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wsc-tile.wsc-custom {
    border-color: rgba(250,204,21,0.6);
    background: linear-gradient(160deg, #2b2208 0%, #0a0a12 60%, #050508 100%);
}

    .wsc-tile.wsc-custom .wsc-medal {
        border-color: #facc15;
        box-shadow: 0 0 14px rgba(250,204,21,0.6);
    }

    .wsc-tile.wsc-custom:hover {
        border-color: #fde047;
        box-shadow: 0 0 20px rgba(250,204,21,0.45);
    }

.wsc-badge {
    position: absolute;
    top: 4%;
    left: 5%;
    padding: 1px 6px;
    border-radius: 99px;
    background: #facc15;
    color: #000;
    font-size: clamp(7px, 0.8vw, 10px);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wsc-lang {
    position: absolute;
    top: 4%;
    right: 5%;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.6);
    color: #d1d5db;
    font-size: clamp(7px, 0.8vw, 10px);
    font-weight: 700;
}

.wsc-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.wsc-tool {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s;
}

    .wsc-tool:hover {
        border-color: #fff;
    }

    .wsc-tool.wsc-danger {
        border-color: rgba(239,68,68,0.6);
        color: #fca5a5;
    }

        .wsc-tool.wsc-danger:hover {
            border-color: #ef4444;
        }

.wsc-pickhint {
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wsc-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
    justify-items: center;
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
}

.wsc-pick-item {
    position: relative;
    width: 100%;
    max-width: 120px;
    border-radius: 10px;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color 0.15s, transform 0.15s;
}

    .wsc-pick-item:hover {
        transform: translateY(-2px);
    }

    .wsc-pick-item > .inv-item {
        pointer-events: none;
    }

    .wsc-pick-item.wsc-on {
        outline-color: #4ade80;
    }

.wsc-check {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 90;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.8);
    color: #4ade80;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.wsc-pick-item.wsc-on .wsc-check {
    border-color: #4ade80;
}

.wsc-more {
    display: block;
    margin: 14px auto 0;
}

@media (max-width: 640px) {
    #collectionsListGrid {
        gap: 6px;
    }

    .wsc-tile {
        border-radius: 8px;
    }

    .wsc-binder {
        padding: 8px;
    }

    .wsc-page {
        padding: 8px 8px 6px;
    }

    .wsc-pockets {
        gap: 5px;
    }
}

/* Interrupteurs des options */
.ws-switch {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    margin: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background-color: #1f1f2e;
    background-image: radial-gradient(circle, #9ca3af 0, #9ca3af 8px, transparent 8.5px);
    background-repeat: no-repeat;
    background-size: 22px 22px;
    background-position: left center;
    cursor: pointer;
    transition: background-position 0.2s, background-color 0.2s, border-color 0.2s;
}

    .ws-switch:checked {
        border-color: #c084fc;
        background-color: #7e22ce;
        background-image: radial-gradient(circle, #ffffff 0, #ffffff 8px, transparent 8.5px);
        background-repeat: no-repeat;
        background-size: 22px 22px;
        background-position: right center;
    }

    .ws-switch.ws-pink:checked {
        border-color: #f9a8d4;
        background-color: #be185d;
    }

    .ws-switch:focus-visible {
        outline: 2px solid #c084fc;
        outline-offset: 2px;
    }

/* Pas de flou d'arrière-plan à l'intérieur d'une carte en 3D */
.card-perspective [class*="backdrop-blur"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.is-graded .card-face::before {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.08);
}

/* Pas de flou d'arrière-plan à l'intérieur d'une carte en 3D */
.card-perspective [class*="backdrop-blur"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.is-graded .card-face::before {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.08);
}

/* ----- Performances : vignettes ----- */
/* Les vignettes sont affichées à plat : la 3D et les flous sont réservés à la carte en grand */
.inv-item *,
.inv-item *::before,
.inv-item *::after {
    transform-style: flat !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.inv-item [style*="translateZ"]:not([style*="translateX"]) {
    transform: none !important;
}
/* Bordure lumineuse fixe ; elle ne s'anime qu'au survol */
.inv-item .fire-border { transform: none; z-index: 0; }
.inv-item .fire-border::after { inset: -2px; animation: none; }
.inv-item:hover .fire-border::after { animation: fire-fade 1s infinite alternate ease-in-out; }

.inv-item .holo-prismatic,
.inv-item .holo-cyber,
.inv-item .cyber-glitch-pixels {
    animation: none !important;
}

/* Badges posés sur une carte (quantité, certification, favori, patch, date...) : toujours au-dessus */
.ws-badge { z-index: 70; }
.inv-item .fire-border { z-index: 0; }

/* ----- Performances : grands panneaux ----- */
#viewMemory, #viewCollections, #viewCollectionDetails, #viewCodex, #viewDecks, #viewBattle, #viewTrade, #viewVoyage {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(12, 12, 18, 0.88);
}

/* Mode Performance : pendant la révélation, la fenêtre couvre tout l'écran, donc la page et le fond ne sont plus dessinés */
/* Pendant une découverte, la fenêtre (opaque à 98 %) couvre tout l'écran : la page et le fond étoilé derrière ne sont
   plus dessinés ni animés, quelles que soient les options (aucune différence visible, la mise en scène devient plus fluide) */
body.reveal-active main,
body.reveal-active #cosmic-background {
    visibility: hidden;
}

body.reveal-active .booster-front::before {
    animation-play-state: paused !important;
}

/* Mode Performance : pas de reflet animé sur les boosters à l'arrière du carrousel */
body.gfx-no-ui .carousel-item.back .booster-front::before {
    animation: none;
    display: none;
}

/* Analyse détaillée : le panneau ne dépasse plus de l'écran, son contenu défile */
#analysisContent {
    max-height: 72vh;
    overflow-y: auto;
    pointer-events: auto;
    padding-right: 4px;
}

@media (max-width: 767px) {
    #analysisContent {
        max-height: 58vh;
    }
}
/* ----- Boosters du carrousel opaques (mobile et ordinateur) -----
   La transparence (opacity) d'un booster en 3D oblige le navigateur à le recomposer à part à chaque image du carrousel.
   Les boosters de côté et de l'arrière restent opaques et sont seulement assombris par un voile posé sur leur face.
   Option « Boosters transparents du carrousel » (js/gfx.js, classe gfx-booster-glass) : ancienne transparence. */
@supports (display: block) {
    body:not(.gfx-booster-glass) .carousel-item.side .booster-pack,
    body:not(.gfx-booster-glass) .carousel-item.back .booster-pack {
        opacity: 1;
    }
    body:not(.gfx-booster-glass) .carousel-item.side .booster-front::after,
    body:not(.gfx-booster-glass) .carousel-item.back .booster-front::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: #05050a;
        pointer-events: none;
        z-index: 40;
    }
    body:not(.gfx-booster-glass) .carousel-item.side .booster-front::after { opacity: 0.4; }
    body:not(.gfx-booster-glass) .carousel-item.back .booster-front::after { opacity: 0.7; }
    /* Les couches d'épaisseur des boosters de l'arrière ne se voient plus : inutile de les dessiner */
    body:not(.gfx-booster-glass) .carousel-item.back .booster-layer { display: none; }
}

/* ----- Mode combat : écrans toujours accessibles -----
   Les écrans du mode combat étaient centrés dans une zone de hauteur fixe : quand leur contenu dépassait (petit écran,
   zoom, polices plus grandes sous Firefox), le haut sortait de la zone sans pouvoir être atteint par le défilement.
   « safe center » centre tant que tout tient, et aligne en haut sinon. */
#battleModeSelect, #battleDifficultySelect, #battleP2PConnect, #battleDeckSelect {
    height: auto;
    min-height: 100%;
    flex-shrink: 0;
    justify-content: center;
    justify-content: safe center;
}
#viewBattle { overflow-y: auto; }

/* ----- Vue 3D des cartes allégée sur mobile (classe lite-3d posée par js/card-modal.js) ----- */
/* Reflet principal : une couche deux fois plus grande que la carte, déplacée par transform (aucun redessin) */
.lite-3d #modalCardContainer .light-projection,
.lite-3d #revealCardContainer .light-projection {
    inset: -50%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.4) 10%, transparent 26%);
    will-change: transform;
}
.lite-3d #modalCardContainer .light-projection::after,
.lite-3d #revealCardContainer .light-projection::after {
    background: radial-gradient(circle at 50% 50%, rgba(255,250,235,0.32) 0%, rgba(255,250,235,0.1) 4.5%, transparent 10%);
}
/* Pas de flou d'arrière-plan dans une carte qui tourne : les étiquettes ont déjà un fond sombre */
.lite-3d #modalCardContainer .backdrop-blur,
.lite-3d #revealCardContainer .backdrop-blur,
.lite-3d #modalCardContainer [class*="backdrop-blur"],
.lite-3d #revealCardContainer [class*="backdrop-blur"] {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
/* Braises EMBER : sans halo flouté (recalculé à chaque image) */
.lite-3d .ember-burn-glow { filter: none; }

/* ----- Firefox : fragments en grand ----- */
/* Firefox calcule mal la zone cliquable des éléments d'une carte posée en 3D (infobulles d'effets, bouton du fragment,
   fragments paysage). Sur Firefox, la carte au repos (face visible, sans rotation) est dessinée à plat : tout se clique normalement.
   Dès qu'on la fait tourner, la 3D revient (classe ff-flat retirée par js/card-modal.js). */
.ff-flat .card-inner,
.ff-flat .card-face,
.ff-flat .card-face * {
    transform-style: flat !important;
}
/* Firefox : la face qui ne regarde pas le joueur est cachée en entier (classes posées par js/card-modal.js).
   Sans cela, l'image et les textes de la face avant (posés en 3D) se voyaient à travers le dos de la carte. */
.ff-browser .card-inner.ff-back-side > .card-face:not(.card-back),
.ff-browser .card-inner.ff-front-side > .card-back {
    visibility: hidden;
}
/* Firefox : le dos doit rester opaque, même pour les fragments à image transparente (fond clair de secours) */
.ff-browser .card-back { background-color: #050508; isolation: auto; }
/* Firefox : le flou d'arrière-plan (backdrop-filter) y est très coûteux et provoque des ralentissements : il est désactivé */
@supports (-moz-appearance: none) {
    *, *::before, *::after {
        backdrop-filter: none !important;
    }
}
/* Le dos et l'épaisseur de la carte ne reçoivent jamais de clic (Firefox les touche même quand ils sont cachés) */
.card-perspective .card-back,
.card-perspective .card-thickness {
    pointer-events: none;
}
/* Panneau d'analyse vide (fermé) : il ne doit pas capter les clics posés sur la carte */
#analysisTooltip > div:not(:has(> :not(.hidden))) {
    pointer-events: none !important;
}
#cardModal:not(.analysis-open) #analysisTooltip,
#cardModal:not(.analysis-open) #analysisTooltip * {
    pointer-events: none !important;
}

/* ----- Mode daltonien (Options) ----- */
/* Raretés : couleurs distinguables quelle que soit la forme de daltonisme (palette Okabe-Ito) */
body.colorblind-mode {
    --color-r: #009E73;
    --color-sr: #56B4E9;
    --color-ur: #CC79A7;
    --color-sec: #F0E442;
    --color-lr: #E69F00;
}
/* Combat : dégâts en orange, soins en bleu (au lieu de rouge / vert) */
body.colorblind-mode .bfx-f-dmg { --c: #E69F00 !important; }
body.colorblind-mode .bfx-f-heal { --c: #56B4E9 !important; }
/* Halo des cadres selon la rareté */
body.colorblind-mode .f-sr { --f-c1: #56B4E9; --f-c2: #8fd0f5; }
body.colorblind-mode .f-ur { --f-c1: #CC79A7; --f-c2: #e3a6c8; }
body.colorblind-mode .f-sec { --f-c1: #F0E442; --f-c2: #f7ef8a; }
body.colorblind-mode .f-lr { --f-c1: #E69F00; --f-c2: #f5c04d; }
/* Filtres de rareté (Mémoire, Séquences) */
body.colorblind-mode #badge-R, body.colorblind-mode #deck-badge-R { color: #009E73 !important; border-color: #009E73 !important; }
body.colorblind-mode #badge-SR, body.colorblind-mode #deck-badge-SR { color: #56B4E9 !important; border-color: #56B4E9 !important; }
body.colorblind-mode #badge-UR, body.colorblind-mode #deck-badge-UR { color: #CC79A7 !important; border-color: #CC79A7 !important; }
body.colorblind-mode #badge-SEC, body.colorblind-mode #deck-badge-SEC { color: #F0E442 !important; border-color: #F0E442 !important; }
body.colorblind-mode #badge-LR, body.colorblind-mode #deck-badge-LR { color: #E69F00 !important; border-color: #E69F00 !important; }

/* Image transparente au dessin sombre (schéma, logo, carte...) : fond clair, sinon elle disparaît dans le noir (js/cards.js) */
img.ws-art-light {
    background: radial-gradient(ellipse at center, #fbf8f1 0%, #e7e0d1 100%) !important;
}

/* Onglet Vaisseau : le vaisseau flotte doucement */
.ship-hero { animation: shipFloat 6s ease-in-out infinite; }
@keyframes shipFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .ship-hero { animation: none; } }

/* Onglet Vaisseau : survol de l'image d'un équipement.
   Débloqué : zoom, image nette. Non débloqué : zoom, aperçu holographique (reflets irisés, lignes de balayage, scintillement). */
.eq-dim { filter: grayscale(0.7); opacity: 0.75; }
.eq-zoom { transition: transform .25s cubic-bezier(.2,1.3,.4,1), box-shadow .25s, filter .25s, opacity .25s; }
.eq-zoom:hover { transform: scale(1.9); z-index: 40; }
.eq-owned:hover { filter: contrast(1.08) saturate(1.1); opacity: 1; box-shadow: 0 0 0 2px var(--c), 0 0 30px var(--c), 0 10px 30px rgba(0,0,0,.8); }
.eq-holo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity .25s;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.16) 0 1px, transparent 1px 3px),
        linear-gradient(125deg, rgba(255,0,170,0.35), rgba(0,255,255,0.35) 30%, rgba(120,255,120,0.3) 55%, rgba(255,230,0,0.3) 75%, rgba(170,90,255,0.35));
    background-size: 100% 100%, 300% 300%; mix-blend-mode: screen; }
.eq-holo:hover { filter: grayscale(0.2) brightness(1.25) saturate(1.4); opacity: 0.85;
    box-shadow: 0 0 0 1px rgba(125,249,255,0.8), 0 0 26px rgba(34,211,238,0.7), 0 10px 30px rgba(0,0,0,.8);
    animation: eqHoloFlicker 2.4s steps(1) infinite; }
.eq-holo:hover::after { opacity: 1; animation: eqHoloShift 3s linear infinite; }
.eq-holo:hover img, .eq-holo:hover span { filter: drop-shadow(2px 0 rgba(255,0,170,0.6)) drop-shadow(-2px 0 rgba(0,255,255,0.6)); }
@keyframes eqHoloShift { from { background-position: 0 0, 0% 50%; } to { background-position: 0 12px, 100% 50%; } }
@keyframes eqHoloFlicker { 0%, 100% { opacity: .85; } 47% { opacity: .62; } 49% { opacity: .9; } 83% { opacity: .7; } }
@media (hover: none) { .eq-zoom:active { transform: scale(1.9); z-index: 40; } .eq-holo:active::after { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .eq-holo:hover, .eq-holo:hover::after { animation: none; } }

/* Forge Quantique : bouton « + » de l'en-tête, bouton de Découverte et bouton du Vaisseau, réactifs au survol */
.shop-plus-btn { margin-left: 2px; width: 18px; height: 18px; padding: 0; border-radius: 50%; background: #2563eb; border: 1px solid #93c5fd; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; line-height: 0;
    box-shadow: 0 0 8px rgba(59,130,246,0.8); transition: transform .2s cubic-bezier(.2,1.4,.4,1), box-shadow .2s, background .2s; }
.shop-plus-btn svg { display: block; transition: transform .3s; }
.shop-plus-btn:hover, .shop-plus-btn:focus-visible { transform: scale(1.25); background: #3b82f6; box-shadow: 0 0 14px rgba(96,165,250,1), 0 0 4px #fff; }
.shop-plus-btn:hover svg { transform: rotate(90deg); }
.shop-plus-btn:active { transform: scale(0.95); }
.shop-cta { transition: transform .25s cubic-bezier(.2,1.3,.4,1), box-shadow .25s, border-color .25s, filter .25s; }
.shop-cta:hover, .shop-cta:focus-visible { transform: translateY(-2px) scale(1.02); border-color: #93c5fd !important; box-shadow: 0 0 22px rgba(59,130,246,0.55), inset 0 0 18px rgba(96,165,250,0.15); filter: brightness(1.12); }
.shop-cta:active { transform: scale(0.98); }
.shop-cta-img { transition: transform .4s cubic-bezier(.2,1.4,.4,1), filter .3s; }
.shop-cta:hover .shop-cta-img { transform: scale(1.2) rotate(-12deg); filter: drop-shadow(0 0 10px #60a5fa); }
.shop-pill { transition: transform .2s cubic-bezier(.2,1.4,.4,1), box-shadow .2s, background .2s; }
.shop-pill:hover, .shop-pill:focus-visible { transform: scale(1.06); background: rgba(37,99,235,0.6) !important; box-shadow: 0 0 16px rgba(96,165,250,0.7); }
/* Forge Quantique : l'icône attire le regard (pulsation, petit tour sur elle-même, éclat), un reflet balaie le bouton */
.shop-cta { position: relative; overflow: hidden; }
.shop-cta::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
    background: linear-gradient(105deg, transparent, rgba(191,219,254,.28) 45%, rgba(255,255,255,.45) 50%, rgba(191,219,254,.28) 55%, transparent);
    transform: skewX(-18deg); animation: shopSweep 5s ease-in-out infinite; }
@keyframes shopSweep { 0%, 62% { left: -60%; } 82%, 100% { left: 130%; } }
.shop-cta-img { animation: shopForgeIcon 5s ease-in-out infinite; }
@keyframes shopForgeIcon {
    0%, 55%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 4px rgba(96,165,250,.6)); }
    62% { transform: scale(1.22) rotate(-16deg); filter: drop-shadow(0 0 12px #60a5fa) brightness(1.25); }
    70% { transform: scale(1.12) rotate(200deg); filter: drop-shadow(0 0 16px #93c5fd) brightness(1.35); }
    80% { transform: scale(1) rotate(360deg); filter: drop-shadow(0 0 6px rgba(96,165,250,.8)); } }
.shop-cta:hover .shop-cta-img { animation: none; }
.shop-plus-btn { animation: shopPlusPulse 2.6s ease-in-out infinite; }
@keyframes shopPlusPulse { 0%, 100% { box-shadow: 0 0 8px rgba(59,130,246,.8); } 50% { box-shadow: 0 0 14px rgba(96,165,250,1), 0 0 0 3px rgba(96,165,250,.25); } }
.shop-plus-btn:hover { animation: none; }
/* Découverte : le cadre de gauche a la même hauteur que celui du carrousel (ordinateur) */
@media (min-width: 1024px) { #viewDiscovery { align-items: stretch; } }
body.gfx-no-ui .shop-cta::after, body.gfx-no-ui .shop-cta-img, body.gfx-no-ui .shop-plus-btn { animation: none; }
@media (prefers-reduced-motion: reduce) { .shop-plus-btn, .shop-cta, .shop-cta-img, .shop-pill { transition: none; animation: none; } .shop-cta::after { animation: none; display: none; } }

/* Duel : boutons de mise rapide */
.stake-chip { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(6,182,212,0.45); background: rgba(8,51,68,0.4); color: #a5f3fc;
    font-size: 10px; font-weight: 800; font-family: monospace; cursor: pointer; transition: background .2s, transform .2s; }
.stake-chip:hover:not(:disabled) { background: rgba(14,116,144,0.6); transform: scale(1.05); }
.stake-chip:disabled { opacity: .4; cursor: not-allowed; }


/* ========================================================= */
/* --- OPTIMISATIONS (sans changement visuel) --- */
/* ========================================================= */
/* Lissage des polices sur Mac uniquement (Firefox Windows ne connaît pas cette propriété : plus d'avertissement) */
@supports (-moz-osx-font-smoothing: grayscale) {
    body { -moz-osx-font-smoothing: grayscale; }
}
/* Cartes des grilles hors de l'écran (classe posée par js/cards.js) : rien à dessiner, animations en pause */
.inv-item.fx-off { visibility: hidden; }
.inv-item.fx-off, .inv-item.fx-off * { animation-play-state: paused !important; }

/* Firefox : un calque GPU par reflet de chaque petite carte saturait la mémoire vidéo (des centaines dans la Mémoire).
   Les reflets restent identiques, ils sont simplement dessinés avec la carte. */
.ff-browser .inv-item .holo-layer,
.ff-browser .inv-item .holo-vintage {
    transform: none;
    -webkit-transform: none;
}
/* Firefox : la nébuleuse du fond n'est plus floutée en direct (flou de 60 px sur 1,4 fois l'écran) :
   les mêmes dégradés, élargis, donnent le même halo sans calcul */
.ff-browser .nebula {
    filter: none;
    background:
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.13) 0%, rgba(76, 29, 149, 0.05) 35%, transparent 65%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.09) 0%, rgba(6, 182, 212, 0.03) 35%, transparent 65%),
        radial-gradient(circle at 50% 80%, rgba(147, 51, 234, 0.09) 0%, rgba(147, 51, 234, 0.03) 35%, transparent 65%);
}


/* ----- Vaisseau : inclinaison vers le curseur, moteurs au survol, évolution ----- */
.ship-stage { position: relative; width: min(100%, 560px); margin: 6px auto 4px; perspective: 900px; }
.ship-stage::after { content: ''; position: absolute; left: 50%; bottom: 8%; width: 60%; height: 18%; transform: translateX(-50%); border-radius: 50%; pointer-events: none;
    background: radial-gradient(ellipse, rgba(96,165,250,0.35), transparent 70%); filter: blur(6px); opacity: 0.4; transition: opacity .4s; }
.ship-stage:hover::after { opacity: 1; animation: shipThrust 0.9s ease-in-out infinite alternate; }
@keyframes shipThrust { from { transform: translateX(-50%) scaleX(0.9); } to { transform: translateX(-50%) scaleX(1.12); } }
.ship-hero-img { width: 100%; height: auto; display: block; user-select: none;
    transform: translate(var(--ship-tx, 0), var(--ship-ty, 0)) rotateX(var(--ship-rx, 0deg)) rotateY(var(--ship-ry, 0deg));
    transition: transform .25s ease-out, filter .4s;
    filter: drop-shadow(0 0 24px rgba(96,165,250,0.45)); }
.ship-stage:hover .ship-hero-img { transform: translate(var(--ship-tx, 0), var(--ship-ty, 0)) rotateX(var(--ship-rx, 0deg)) rotateY(var(--ship-ry, 0deg)) scale(1.04);
    filter: drop-shadow(0 0 34px rgba(96,165,250,0.7)) brightness(1.06); }
.ship-evolve .ship-hero-img { animation: shipEvolve 1.4s ease-out; }
@keyframes shipEvolve { 0% { filter: drop-shadow(0 0 0 #fff) brightness(3); opacity: 0.2; transform: scale(0.9); }
    40% { filter: drop-shadow(0 0 60px #93c5fd) brightness(1.8); opacity: 1; transform: scale(1.06); }
    100% { filter: drop-shadow(0 0 24px rgba(96,165,250,0.45)); transform: none; } }
body.gfx-no-ui .ship-stage::after { animation: none; }

/* ===== Fusion : repères bien visibles (les variantes ont déjà leur propre halo) ===== */
@property --fuse-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes fuseSpin { to { --fuse-a: 360deg; } }
@keyframes fusePulse { from { opacity: .7; } to { opacity: 1; } }
/* Main : carte qui peut fusionner avec une carte posée (anneau tournant et étiquette FUSION) */
.fuse-ready { position: relative; }
.fuse-ready::before { content: ''; position: absolute; inset: -5px; border-radius: 12px; z-index: 60; pointer-events: none; padding: 4px;
    background: conic-gradient(from var(--fuse-a), #fff, #f0abfc, #a855f7, #22d3ee, #f0abfc, #fff);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    box-shadow: 0 0 16px #d946ef; animation: fuseSpin 1.8s linear infinite; }
.fuse-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); z-index: 65; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
    background: linear-gradient(135deg, #f0abfc, #a21caf); color: #fff; font: 900 9px/1.2 'Inter', sans-serif; letter-spacing: .12em; border: 1.5px solid #fff;
    box-shadow: 0 0 10px #d946ef, 0 0 18px rgba(217,70,239,.6); pointer-events: none; animation: fusePulse .8s ease-in-out infinite alternate; }
.fuse-badge::before { content: 'FUSION'; }
.fuse-badge-sm { top: -11px; font-size: 8px; padding: 1px 6px; }
/* Plateau : carte sur laquelle une carte de la main peut fusionner */
.fuse-target { outline: 2px solid #e879f9; outline-offset: 2px; border-radius: 8px; box-shadow: 0 0 16px rgba(217,70,239,.8); }
/* Pendant le glisser : cases où la fusion est possible (cadre épais et étiquette au-dessus de la carte posée) */
.battle-slot.fusion-highlight-ready::after, .battle-slot.fusion-highlight::after {
    content: ''; position: absolute; inset: -6px; border-radius: 12px; z-index: 70; pointer-events: none;
    border: 4px solid #e879f9; background: rgba(217,70,239,.22); box-shadow: 0 0 22px #d946ef, inset 0 0 22px rgba(217,70,239,.7);
    animation: fusePulse .6s ease-in-out infinite alternate; }
.battle-slot.fusion-highlight::after { border-color: #fff; background: rgba(240,171,252,.38); box-shadow: 0 0 32px #f0abfc, inset 0 0 28px rgba(240,171,252,.9); }
.battle-slot.fusion-highlight-ready::before, .battle-slot.fusion-highlight::before {
    content: 'FUSION'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); z-index: 71; pointer-events: none; padding: 2px 9px; border-radius: 999px;
    background: linear-gradient(135deg, #f0abfc, #a21caf); color: #fff; font: 900 10px/1.2 'Inter', sans-serif; letter-spacing: .14em; border: 1.5px solid #fff; box-shadow: 0 0 12px #d946ef; }
body.gfx-no-battle .fuse-ready::before, body.gfx-no-battle .fuse-badge, body.gfx-no-battle .battle-slot.fusion-highlight-ready::after { animation: none; }

/* Tutoriel du Vaisseau : le vaisseau flotte doucement, sans cadre rond */
.ship-tut-img { width: min(78vw, 360px); height: auto; object-fit: contain; filter: drop-shadow(0 0 22px rgba(168,85,247,.55)); animation: shipTutFloat 4.5s ease-in-out infinite alternate; user-select: none; }
@keyframes shipTutFloat { from { transform: translateY(4px) rotate(-1deg); } to { transform: translateY(-6px) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { .ship-tut-img { animation: none; } }
body.gfx-no-ui .ship-tut-img { animation: none; }

/* Onglets de combat (Contre l'IA, Duel, Draft) : même en-tête — titre, sous-titre, logo et histoire facultatifs */
.war-mode-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 22px; text-align: center; }
.war-mode-head.has-logo { text-align: left; }
.war-mode-logo { width: 72px; height: 72px; flex-shrink: 0; }
.war-mode-logo svg { width: 100%; height: 100%; overflow: visible; }
.war-mode-title { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(18px, 2.2vw, 24px); line-height: 1.15; color: #fff; text-transform: none !important; letter-spacing: .06em;
    text-shadow: 0 0 15px rgba(255,255,255,.4); }
.war-mode-title.orange { color: #fb923c; text-shadow: 0 0 18px rgba(249,115,22,.55); letter-spacing: .1em; }
.war-mode-sub { margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: #c4b5fd; }
.war-mode-sub-cyan { color: #67e8f9; }
.war-mode-sub-gold { color: #fde68a; font-family: 'Playfair Display', Georgia, serif; font-size: 16px; letter-spacing: .12em; text-transform: none; font-weight: 700; }
.war-mode-lorebtn { margin-top: 6px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fb923c; }
.war-mode-lore { max-width: 44rem; margin: -10px auto 18px; font-size: 12px; line-height: 1.6; color: #d1d5db; text-align: left; padding: 12px 16px; border-radius: 14px;
    background: rgba(0,0,0,.45); border: 1px solid rgba(251,146,60,.35); }
.war-mode-lore q { display: block; font-style: italic; color: #fdba74; margin-bottom: 6px; quotes: '« ' ' »'; }

/* Option « Masquer l'histoire » : toutes les fenêtres de lore disparaissent */
body.hide-lore #discoveryLore, body.hide-lore #voyageLore, body.hide-lore #commerceLore, body.hide-lore .war-lore,
body.hide-lore .war-mode-lorebtn, body.hide-lore #draftLore, body.hide-lore .eph-lore, body.hide-lore .dr-lore { display: none !important; }
/* Fenêtre Options : onglets Général / Graphique */
.opt-tabs { display: flex; gap: 8px; margin: -8px 0 18px; }
.opt-tab { flex: 1; padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9ca3af; border: 1px solid rgba(255,255,255,.12); transition: all .2s; }
.opt-tab:hover { color: #d8b4fe; border-color: #c084fc; }
.opt-tab.on { background: #9333ea; color: #fff; border-color: #c084fc; }
.opt-gfx-intro { font-size: 11px; color: #9ca3af; margin-bottom: 12px; }
.opt-gfx-notice { font-size: 12px; color: #fde68a; background: rgba(120,53,15,.45); border: 1px solid rgba(251,191,36,.5); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.45; }
.opt-gfx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(0,0,0,.4); border: 1px solid rgba(168,85,247,.3); cursor: pointer; }
.opt-gfx-row span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.opt-gfx-row b { font-size: 12px; color: #e9d5ff; }
.opt-gfx-row small { font-size: 10px; color: #9ca3af; line-height: 1.35; }
.opt-gfx-presets { display: flex; gap: 8px; margin-top: 14px; }
.opt-gfx-presets button { flex: 1; padding: 9px; border-radius: 10px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #d8b4fe; border: 1px solid rgba(168,85,247,.45); background: rgba(88,28,135,.25); }
.opt-gfx-presets button:hover { background: rgba(126,34,206,.45); color: #fff; }


/* Bouton de l'onglet Découverte */
.eph-cta { position: relative; overflow: hidden; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; margin: -12px 0 24px; border-radius: 12px; text-align: left; color: #fff;
    border: 1px solid rgba(251,191,36,.55); background: linear-gradient(90deg, rgba(120,53,15,.5), rgba(30,27,75,.55)); box-shadow: 0 0 15px rgba(251,191,36,.15); transition: border-color .2s, box-shadow .2s; }
.eph-cta:hover { border-color: #fcd34d; box-shadow: 0 0 22px rgba(251,191,36,.35); }
.eph-cta-title { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; font-size: 13px; color: #fde68a; }
.eph-cta-sub { display: block; font-size: 10px; color: #d1d5db; margin-top: 4px; }
.eph-cta svg { width: 38px; height: 38px; flex-shrink: 0; }
.eph-cta .eph-cta-new { display: none; padding: 3px 7px; letter-spacing: .1em !important; border-radius: 4px; font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; vertical-align: 2px;
    color: #fef3c7; background: rgba(180,83,9,.6); border: 1px solid #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.6); }
.eph-cta.eph-cta-ready .eph-cta-new { display: inline-block; animation: ephBlink 1.6s ease-in-out infinite; }
.eph-cta svg .eph-rot1 { transform-origin: 50px 50px; animation: ephSpin 40s linear infinite; }
@keyframes ephBlink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes ephSpin { to { transform: rotate(360deg); } }

/* Sélecteur de fragments rapide (js/filter-menus.js : vitrine, bannière, propositions) */
.wsp-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.wsp-bar .wsp-q { flex: 1 1 180px; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(168,85,247,.5); background: #050508; color: #fff; font-size: 14px; }
.wsp-bar select { flex: 0 1 auto; padding: 8px 8px; border-radius: 10px; border: 1px solid rgba(168,85,247,.4); background: #0b0716; color: #e9d5ff; font-size: 12px; max-width: 46%; }
.wsp-count { font-size: 11px; color: #9ca3af; margin-left: auto; white-space: nowrap; }
.wsp-more { grid-column: 1 / -1; height: 1px; }
/* Dans un sélecteur, les effets animés des cartes ne tournent qu'au survol : la grille reste fluide */
.wsp-grid > *:not(:hover) *, .wsp-grid > *:not(:hover) *::before, .wsp-grid > *:not(:hover) *::after { animation-play-state: paused !important; }

/* ===== Découvertes rares : mise en scène (js/discovery.js, rfxPlayRarity / rfxPlayAnomaly) ===== */
#rarityOverlay.rfx-on, #anomalyOverlay.afx-on { overflow: hidden; }
#rarityOverlay.rfx-on > :not(.rfx-layer):not(.particle), #anomalyOverlay.afx-on > :not(.afx-layer):not(.particle) { position: relative; z-index: 2; }
/* Particules du texte de rareté : hors du flux (sinon elles poussaient le texte vers le haut pendant une seconde) */
#rarityOverlay > .particle, #anomalyOverlay > .particle { position: absolute; z-index: 3; }
.rfx-layer, .afx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
#rarityOverlay:not(.rfx-on) .rfx-layer, #anomalyOverlay:not(.afx-on) .afx-layer { display: none; }

/* Rareté : halo de couleur, rayons tournants, ondes de choc, éclair, balayage lumineux, braises (LR) */
.rfx-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 45% at 50% 50%, color-mix(in srgb, var(--rfx-c) 32%, transparent), transparent 70%); opacity: 0; }
.rfx-rays { position: absolute; left: 50%; top: 50%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; opacity: 0;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rfx-c) 55%, transparent) 0deg 4deg, transparent 4deg 18deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,.55) 12%, transparent 30%); mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,.55) 12%, transparent 30%); }
.rfx-rays2 { background: repeating-conic-gradient(from 9deg, rgba(255,255,255,.35) 0deg 1.5deg, transparent 1.5deg 24deg); }
.rfx-ring { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; opacity: 0;
    border: 3px solid var(--rfx-c); box-shadow: 0 0 24px var(--rfx-c), inset 0 0 18px var(--rfx-c); }
.rfx-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, #fff, color-mix(in srgb, var(--rfx-c) 70%, transparent) 40%, transparent 75%); opacity: 0; mix-blend-mode: screen; }
.rfx-sweep { position: absolute; left: -40%; top: 38%; width: 30%; height: 24%; opacity: 0; mix-blend-mode: screen; transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); filter: blur(6px); }
.rfx-embers { position: absolute; inset: 0; display: none; }
.rfx-embers i { position: absolute; bottom: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #fde68a; box-shadow: 0 0 8px var(--rfx-c), 0 0 3px #fff; opacity: 0; }
.rfx-ch { display: inline-block; opacity: 0; transform: translateY(6px); }

.rfx-play .rfx-vignette { animation: rfxFade 1.5s ease-out forwards; }
.rfx-play .rfx-rays { animation: rfxRays 1.5s ease-out forwards, rfxSpin 14s linear infinite; }
.rfx-play .rfx-rays2 { animation: rfxRays2 1.5s ease-out forwards, rfxSpin 10s linear infinite reverse; }
.rfx-play .rfx-ring.r1 { animation: rfxRing 1s cubic-bezier(.15,.7,.3,1) .12s forwards; }
.rfx-play .rfx-flash { animation: rfxFlash .55s ease-out .1s forwards; }
.rfx-play .rfx-sweep { animation: rfxSweep .7s ease-in-out .55s forwards; }
.rfx-play .rfx-ch { animation: rfxCh .25s ease-out forwards; }
/* Plus la rareté est haute, plus la scène s'intensifie */
.rfx-play[data-tier="1"] .rfx-rays2 { display: none; }
.rfx-play[data-tier="2"] .rfx-ring.r2, .rfx-play[data-tier="3"] .rfx-ring.r2, .rfx-play[data-tier="4"] .rfx-ring.r2 { animation: rfxRing 1.1s cubic-bezier(.15,.7,.3,1) .3s forwards; }
.rfx-play[data-tier="3"] .rfx-ring.r3, .rfx-play[data-tier="4"] .rfx-ring.r3 { animation: rfxRing 1.2s cubic-bezier(.15,.7,.3,1) .48s forwards; }
.rfx-play[data-tier="3"] #rarityText, .rfx-play[data-tier="4"] #rarityText { animation: burstAnim .8s cubic-bezier(.175,.885,.32,1.275) forwards, rfxShake .45s linear .1s 1; }
.rfx-play[data-tier="4"] .rfx-embers { display: block; }
.rfx-play[data-tier="4"] .rfx-embers i { animation-name: rfxEmber; animation-timing-function: ease-out; animation-fill-mode: forwards; }
.rfx-play[data-tier="4"] .rfx-flash { animation: rfxFlash .55s ease-out .1s forwards, rfxFlash2 .5s ease-out .7s forwards; }

@keyframes rfxFade { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: .75; } }
@keyframes rfxRays { 0% { opacity: 0; transform: scale(.5); } 25% { opacity: .85; } 100% { opacity: .5; transform: scale(1); } }
@keyframes rfxRays2 { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: .7; } 100% { opacity: .3; transform: scale(1.05); } }
@keyframes rfxSpin { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes rfxRing { 0% { opacity: .95; transform: scale(.4); border-width: 6px; } 100% { opacity: 0; transform: scale(28); border-width: .5px; } }
@keyframes rfxFlash { 0% { opacity: 0; } 18% { opacity: .95; } 100% { opacity: 0; } }
@keyframes rfxFlash2 { 0% { opacity: 0; } 20% { opacity: .6; } 100% { opacity: 0; } }
@keyframes rfxSweep { 0% { left: -40%; opacity: 0; } 15% { opacity: 1; } 100% { left: 115%; opacity: 0; } }
@keyframes rfxCh { to { opacity: 1; transform: none; } }
@keyframes rfxShake { 0%, 100% { translate: 0 0; } 20% { translate: -6px 2px; } 40% { translate: 5px -3px; } 60% { translate: -4px -1px; } 80% { translate: 3px 2px; } }
@keyframes rfxEmber { 0% { opacity: 0; transform: translateY(0) scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-75vh) translateX(20px) scale(.4); } }

/* Anomalie : écran déchiré, lignes de balayage, bruit, onde instable, puis stabilisation dans la couleur de la variante */
.afx-scan { position: absolute; inset: 0; opacity: .5; background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px); }
.afx-scan::after { content: ''; position: absolute; left: 0; right: 0; height: 18%; top: -20%; background: linear-gradient(180deg, transparent, rgba(255,60,60,.12), transparent); }
.afx-noise { position: absolute; inset: -50%; opacity: .12; background-image: radial-gradient(rgba(255,255,255,.6) 1px, transparent 1px); background-size: 3px 3px; }
.afx-tears i { position: absolute; left: 0; right: 0; opacity: 0; mix-blend-mode: screen;
    background: linear-gradient(90deg, transparent, rgba(255,0,60,.35) 20%, rgba(0,255,255,.35) 60%, transparent); }
.afx-wave { position: absolute; left: 0; width: 100%; top: 64%; height: 70px; overflow: visible; }
.afx-wave path { fill: none; stroke: #f87171; stroke-width: 2; filter: drop-shadow(0 0 4px #ef4444); transition: stroke .3s; }
.afx-resolve { position: absolute; left: 50%; top: 45%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; opacity: 0;
    background: radial-gradient(circle, #fff, var(--afx-c) 40%, transparent 70%); }
.afx-serial { margin-top: 18px; font-family: ui-monospace, monospace; font-size: 22px; letter-spacing: .15em; color: #fde68a; text-shadow: 0 0 12px rgba(251,191,36,.8);
    padding: 6px 16px; border: 1px solid rgba(251,191,36,.5); border-radius: 8px; background: rgba(0,0,0,.55); }
.afx-serial b { font-size: 30px; }
.afx-serial small { opacity: .75; font-size: 16px; }
.afx-serial.afx-lock { animation: afxLock .5s cubic-bezier(.2,1.6,.4,1); border-color: #fde68a; box-shadow: 0 0 22px rgba(251,191,36,.6); }
.afx-serial.afx-one { color: #ede9fe; border-color: #a78bfa; text-shadow: 0 0 14px #a78bfa, 0 0 30px #7c3aed; animation: afxLock .6s cubic-bezier(.2,1.6,.4,1) 1.7s backwards; }

.afx-play .afx-scan::after { animation: afxRoll 1.1s linear 2; }
.afx-play .afx-noise { animation: afxNoise .2s steps(3) infinite; }
.afx-play .afx-tears i { animation: afxTear .5s steps(4) 3; }
.afx-play .afx-resolve { animation: afxResolve .6s ease-out 1.7s forwards; }
.afx-play .afx-wave path { animation: afxWaveCol .3s linear 1.7s forwards; }
.afx-play .glitch-text { animation: glitch 1s linear infinite, afxSettle .4s ease-out 1.7s forwards; }

@keyframes afxRoll { from { top: -20%; } to { top: 110%; } }
@keyframes afxNoise { 0% { transform: translate(0, 0); } 33% { transform: translate(-7px, 4px); } 66% { transform: translate(5px, -6px); } 100% { transform: translate(-3px, 7px); } }
@keyframes afxTear { 0% { opacity: 0; transform: translateX(0); } 25% { opacity: 1; transform: translateX(var(--dx)); } 50% { opacity: .4; transform: translateX(calc(var(--dx) * -.6)); } 75% { opacity: 1; transform: translateX(calc(var(--dx) * .3)); } 100% { opacity: 0; transform: translateX(0); } }
@keyframes afxResolve { 0% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(40); } }
@keyframes afxWaveCol { to { stroke: var(--afx-c); filter: drop-shadow(0 0 6px var(--afx-c)); } }
@keyframes afxSettle { to { color: #fff; text-shadow: 0 0 18px var(--afx-c), 0 0 40px var(--afx-c); } }
@keyframes afxLock { 0% { transform: scale(1.6); filter: brightness(2); } 100% { transform: scale(1); filter: none; } }
@media (prefers-reduced-motion: reduce) { .rfx-layer, .afx-layer { display: none; } }

/* Suspense avant l'annonce d'une carte rare : la carte, encore de dos, se charge et tremble de plus en plus */
#revealCardWrapper.reveal-charge #revealCardContainer { animation: revealCharge 1.4s ease-in forwards; }
#revealCardWrapper.reveal-charge #revealHalo { --halo-color: var(--charge-c); opacity: 1; animation: revealChargeHalo 1.4s ease-in forwards; }
@keyframes revealCharge {
    0% { translate: 0 0; filter: drop-shadow(0 0 0 var(--charge-c)); }
    20% { translate: -1px 1px; } 30% { translate: 1px -1px; } 40% { translate: -2px 0; } 50% { translate: 2px 1px; }
    60% { translate: -3px -1px; } 70% { translate: 3px 2px; } 80% { translate: -4px 1px; } 90% { translate: 4px -2px; }
    100% { translate: 0 0; filter: drop-shadow(0 0 26px var(--charge-c)) brightness(1.25); }
}
@keyframes revealChargeHalo { from { box-shadow: 0 0 0 0 transparent; } to { box-shadow: 0 0 80px 20px var(--charge-c); } }
body.gfx-no-ui #revealCardWrapper.reveal-charge #revealCardContainer { animation: none; }

/* ===== Découvertes rares : mise en scène épique (suite) ===== */
/* Avant l'annonce : traits de lumière aspirés vers la carte */
.rfx-implode { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.rfx-implode i { position: absolute; left: 50%; top: 50%; width: 22vmax; height: 2px; margin-top: -1px; transform-origin: 0 50%; opacity: 0;
    background: linear-gradient(90deg, #fff, var(--rfx-c), transparent); border-radius: 2px;
    animation: rfxSuck 0.9s cubic-bezier(.55,0,1,.45) var(--d) infinite; }
@keyframes rfxSuck { 0% { transform: rotate(var(--a)) translateX(var(--l)) scaleX(1); opacity: 0; } 20% { opacity: 1; } 100% { transform: rotate(var(--a)) translateX(0) scaleX(.2); opacity: 0; } }
/* Libération de l'énergie : éclair plein écran */
.rfx-impact { position: absolute; inset: 0; z-index: 300; pointer-events: none; background: radial-gradient(circle, #fff 0%, color-mix(in srgb, var(--rfx-c) 80%, #fff) 30%, transparent 75%);
    animation: rfxImpact .65s ease-out forwards; mix-blend-mode: screen; }
@keyframes rfxImpact { 0% { opacity: 1; } 100% { opacity: 0; } }
/* Fond en « saut dans l'hyperespace » : traits qui filent depuis le centre */
.rfx-warp { position: absolute; inset: 0; opacity: 0; }
.rfx-warp i { position: absolute; left: 50%; top: 50%; height: var(--w); width: 18vmax; margin-top: calc(var(--w) / -2); transform-origin: 0 50%;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rfx-c) 60%, #fff)); border-radius: 2px; opacity: 0; }
.rfx-play .rfx-warp { animation: rfxFade 1.6s ease-out forwards; }
.rfx-play .rfx-warp i { animation: rfxWarp .8s ease-in var(--d) infinite; }
@keyframes rfxWarp { 0% { transform: rotate(var(--a)) translateX(2vmax) scaleX(.1); opacity: 0; } 30% { opacity: .9; } 100% { transform: rotate(var(--a)) translateX(70vmax) scaleX(1.4); opacity: 0; } }
/* Nom de la rareté : chaque lettre s'écrase l'une après l'autre */
.rfx-letter { display: inline-block; opacity: 0; animation: rfxSlam .45s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes rfxSlam { 0% { opacity: 0; transform: scale(3.2) translateY(-20px); filter: blur(10px); } 60% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: none; filter: none; } }
/* Secousse de l'écran (Ultra Rare et plus) */
#rarityOverlay.rfx-quake { animation: rfxQuake .5s linear .12s 1; }
@keyframes rfxQuake { 0%, 100% { translate: 0 0; } 15% { translate: -9px 4px; } 30% { translate: 8px -6px; } 45% { translate: -6px -3px; } 60% { translate: 5px 5px; } 75% { translate: -3px 2px; } 90% { translate: 2px -1px; } }
/* Après le retournement : rayons divins derrière la carte, colonne de lumière pour SEC, LR et anomalies */
.rfx-godrays { position: absolute; left: 50%; top: 50%; width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; pointer-events: none; z-index: 0; }
.rfx-godrays .gr1, .rfx-godrays .gr2 { position: absolute; inset: 0; border-radius: 50%; opacity: 0;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rfx-c) 45%, transparent) 0deg 5deg, transparent 5deg 20deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,.5) 14%, transparent 34%); mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,.5) 14%, transparent 34%);
    animation: rfxRaysIn .8s ease-out forwards, rfxSpin 24s linear infinite; }
.rfx-godrays .gr2 { background: repeating-conic-gradient(from 10deg, rgba(255,255,255,.22) 0deg 2deg, transparent 2deg 26deg); animation: rfxRaysIn 1s ease-out forwards, rfxSpin 18s linear infinite reverse; }
.rfx-godrays .gp { position: absolute; left: 50%; top: 0; bottom: 0; width: 22vmin; margin-left: -11vmin; opacity: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rfx-c) 40%, transparent) 30%, rgba(255,255,255,.55) 50%, color-mix(in srgb, var(--rfx-c) 40%, transparent) 70%, transparent);
    filter: blur(6px); animation: rfxPillar 1.2s ease-out forwards; }
@keyframes rfxRaysIn { from { opacity: 0; transform: scale(.4); } to { opacity: .9; transform: scale(1); } }
@keyframes rfxPillar { 0% { opacity: 0; transform: scaleX(.1); } 30% { opacity: 1; transform: scaleX(1.3); } 100% { opacity: .7; transform: scaleX(1); } }
body.gfx-no-ui .rfx-implode, body.gfx-no-ui .rfx-impact, body.gfx-no-ui .rfx-godrays { display: none; }
@media (prefers-reduced-motion: reduce) { .rfx-implode, .rfx-impact, .rfx-godrays, .rfx-warp { display: none; } #rarityOverlay.rfx-quake { animation: none !important; } }

/* ----- Fond figé derrière les fenêtres -----
   Quand une fenêtre (carte en grand, profil, boutique...) est ouverte par-dessus le jeu, la page et le fond étoilé derrière
   elle mettent leurs animations en pause (classe posée par js/gfx.js). Le flou de la fenêtre n'a plus à être recalculé
   à chaque image : c'était le plus gros coût de la vue 3D d'une carte. Le fond, flouté, reste visible. */
body.overlay-open main *, body.overlay-open main *::before, body.overlay-open main *::after,
body.overlay-open #cosmic-background, body.overlay-open #cosmic-background *,
body.overlay-open #cosmic-background *::before, body.overlay-open #cosmic-background *::after {
    animation-play-state: paused !important;
}

/* ===== Albums thématiques (js/albums.js) ===== */
.alb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .alb-grid { gap: 6px; } }
.alb-tile { border-color: color-mix(in srgb, var(--alb-c) 55%, transparent); }
.alb-tile .wsc-medal { border-color: var(--alb-c); box-shadow: 0 0 14px color-mix(in srgb, var(--alb-c) 70%, transparent); }
.alb-icon { position: absolute; top: 4%; left: 6%; font-size: clamp(14px, 1.7vw, 22px); filter: drop-shadow(0 1px 3px #000); }
/* Album complet : doré */
.wsc-tile.alb-gold { border-color: #fbbf24; background: radial-gradient(circle at 50% 22%, rgba(251,191,36,.28), transparent 60%), linear-gradient(160deg, #3b2a06 0%, #1a1204 55%, #0a0703 100%); box-shadow: 0 0 18px rgba(251,191,36,.35); overflow: hidden; }
.wsc-tile.alb-gold::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,240,200,.35) 50%, transparent 65%); background-size: 250% 100%; animation: albSheen 4s ease-in-out infinite; }
.wsc-tile.alb-gold .wsc-medal { border-color: #fde68a; box-shadow: 0 0 0 3px #b45309, 0 0 22px rgba(251,191,36,.8); }
.wsc-tile.alb-gold .wsc-name { color: #fde68a; }
.wsc-tile.alb-gold .wsc-bar > div { background: linear-gradient(90deg, #f59e0b, #fde68a, #f59e0b); }
.wsc-tile.alb-gold .wsc-pct, .wsc-tile.alb-gold .wsc-count { color: #fde68a; }
@keyframes albSheen { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }
.alb-gold-view { border-color: rgba(251,191,36,.6) !important; box-shadow: 0 0 30px rgba(251,191,36,.25); }
.alb-gold-view #albumDetailTitle { color: #fde68a; }
.alb-gold-view #albumDetailMedal { border-color: #fde68a; box-shadow: 0 0 0 3px #b45309, 0 0 22px rgba(251,191,36,.8); }
.wsc-binder.alb-gold-book { background: linear-gradient(145deg, #5b3d07, #2a1b03); border-color: #fbbf24; box-shadow: 0 20px 50px rgba(0,0,0,.7), 0 0 30px rgba(251,191,36,.35), inset 0 0 30px rgba(0,0,0,.5); }
.wsc-binder.alb-gold-book .wsc-page { border-color: rgba(251,191,36,.35); background: linear-gradient(180deg, #1d170b, #100c05); }
.wsc-binder.alb-gold-book .wsc-spine { background: linear-gradient(90deg, #2a1b03, #8a6212, #2a1b03); }
.wsc-binder.alb-gold-book .alb-num { background: linear-gradient(180deg, #fde68a, #d97706); color: #1c1206; border-color: #fff7d6; }
/* Emplacements numérotés */
.alb-pocket { overflow: visible; }
.alb-num { position: absolute; top: -6px; left: -6px; z-index: 80; min-width: 22px; padding: 1px 5px; border-radius: 999px; font: 800 10px/16px ui-monospace, monospace; text-align: center;
    color: #e9d5ff; background: #1b1230; border: 1px solid rgba(192,132,252,.6); box-shadow: 0 2px 6px rgba(0,0,0,.7); pointer-events: none; }
.alb-has .alb-num { color: #fff; background: #6d28d9; border-color: #c4b5fd; }
.alb-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center;
    color: rgba(229,231,235,.45); font-size: clamp(8px, 1vw, 11px); line-height: 1.2; overflow: hidden; }
.alb-ph b { font-weight: 700; overflow-wrap: anywhere; }
.alb-ph small { font-size: .85em; color: rgba(252,165,165,.6); }
/* Animation « Album complet » */
.alb-done { position: fixed; inset: 0; z-index: 9800; display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: radial-gradient(circle at 50% 45%, rgba(120,80,10,.55), rgba(5,4,2,.96) 60%); animation: albIn .4s ease-out; cursor: pointer; }
.alb-done.alb-done-out { animation: albOut .4s ease-in forwards; }
@keyframes albIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes albOut { to { opacity: 0; } }
.alb-done-rays { z-index: 0; }
.alb-done-box { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; text-align: center; max-width: 92vw; }
.alb-done-medal { position: relative; width: min(46vw, 200px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 4px solid #fde68a;
    box-shadow: 0 0 0 6px #b45309, 0 0 60px rgba(251,191,36,.9); animation: albMedal 1.1s cubic-bezier(.2,1.4,.4,1) .2s both; }
.alb-done-medal img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) saturate(1.3); }
.alb-done-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,250,220,.75) 50%, transparent 65%); background-size: 250% 100%; animation: albSheen 2.2s ease-in-out 1.2s infinite; }
@keyframes albMedal { 0% { transform: scale(0) rotate(-200deg); opacity: 0; } 70% { transform: scale(1.12) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.alb-done-kicker { font: 900 clamp(26px, 6vw, 52px)/1 'Playfair Display', Georgia, serif; letter-spacing: .14em;
    background: linear-gradient(180deg, #fff7d6, #fbbf24 55%, #b45309); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(251,191,36,.7)); }
.alb-done-kicker .rfx-letter { -webkit-background-clip: text; background-clip: text; background-image: inherit; }
.alb-done-name { color: #fde68a; font-size: clamp(15px, 2.6vw, 22px); font-weight: 700; opacity: 0; animation: albFade .5s ease-out 1.3s forwards; }
.alb-done-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 420px; }
.alb-done-slots i { width: 14px; height: 20px; border-radius: 3px; border: 1px solid rgba(251,191,36,.4); background: rgba(255,255,255,.05); animation: albSlot .35s ease-out forwards; }
@keyframes albSlot { 0% { transform: scale(1); } 50% { transform: scale(1.5); background: #fff7d6; box-shadow: 0 0 14px #fbbf24; } 100% { transform: scale(1); background: linear-gradient(180deg, #fde68a, #d97706); border-color: #fde68a; box-shadow: 0 0 8px rgba(251,191,36,.7); } }
.alb-done-count { color: #fde68a; font: 800 14px ui-monospace, monospace; letter-spacing: .2em; opacity: 0; animation: albFade .5s ease-out 2.6s forwards; }
.alb-done-btn { margin-top: 6px; padding: 10px 26px; border-radius: 999px; border: 1px solid #fde68a; background: linear-gradient(180deg, #f59e0b, #b45309); color: #1c1206; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; cursor: pointer;
    opacity: 0; animation: albFade .5s ease-out 2.9s forwards; box-shadow: 0 0 18px rgba(251,191,36,.6); }
@keyframes albFade { to { opacity: 1; } }
body.gfx-no-ui .wsc-tile.alb-gold::after, body.gfx-no-ui .alb-done-shine { animation: none; }
.alb-problems { grid-column: 1 / -1; white-space: pre-wrap; margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(248,113,113,.5); background: rgba(127,29,29,.25); color: #fecaca; font: 12px/1.6 ui-monospace, monospace; text-align: left; }
.alb-done-reward { display: flex; align-items: center; gap: 6px; font: 800 20px/1 ui-sans-serif, system-ui, sans-serif; color: #e9d5ff; text-shadow: 0 0 14px rgba(168,85,247,.8); opacity: 0; animation: albFade .6s ease-out 3.4s forwards; }
.alb-done-reward img { width: 24px; height: 24px; filter: drop-shadow(0 0 6px rgba(168,85,247,.8)); }
.wsc-tile.alb-wait .wsc-bar, .wsc-tile.alb-wait .wsc-count { animation: albWait 1.2s ease-in-out infinite alternate; }
@keyframes albWait { from { opacity: .35; } to { opacity: .8; } }

/* ===== Boutique : onglets, fragment du jour, badge « Nouveau » (js/shop.js) ===== */
.shop-tabs { display: flex; justify-content: center; gap: 8px; margin: 0 auto 16px; padding: 4px; width: fit-content; border-radius: 999px; background: rgba(0,0,0,.4); border: 1px solid rgba(96,165,250,.35); }
.shop-tab { padding: 8px 20px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #93c5fd; background: transparent; border: 0; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.shop-tab:hover { color: #fff; background: rgba(59,130,246,.18); }
.shop-tab.on { color: #fff; background: linear-gradient(90deg, #1d4ed8, #7c3aed); box-shadow: 0 0 14px rgba(96,165,250,.45); }
.shop-daily { position: relative; display: flex; align-items: center; gap: 22px; margin-bottom: 16px; padding: 18px; border-radius: 18px; cursor: pointer; overflow: hidden;
    border: 1px solid rgba(251,191,36,.6); background: radial-gradient(circle at 20% 50%, rgba(251,191,36,.18), transparent 60%), linear-gradient(135deg, rgba(60,30,5,.6), rgba(15,10,30,.85));
    box-shadow: 0 0 30px rgba(251,191,36,.18); transition: box-shadow .25s, border-color .25s; }
.shop-daily:hover { border-color: #fde68a; box-shadow: 0 0 40px rgba(251,191,36,.35); }
.shop-daily-stage { flex-shrink: 0; width: 192px; height: 288px; display: flex; align-items: center; justify-content: center; }
.shop-daily-card { flex-shrink: 0; width: 320px; height: 480px; transform: scale(.6); transform-origin: center; pointer-events: none; }
.shop-daily-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; border-radius: 14px; border: 1px dashed rgba(251,191,36,.4); color: #fde68a; font-size: 30px; text-align: center; padding: 10px; }
.shop-daily-wait small { font-size: 11px; color: #d1d5db; }
.shop-daily-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(251,191,36,.25); border-top-color: #fbbf24; animation: shopSpin 1s linear infinite; }
@keyframes shopSpin { to { transform: rotate(360deg); } }
.shop-daily-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.shop-daily-title { font-family: 'Playfair Display', Georgia, serif; font-size: 26px; line-height: 1.15; color: #fff; text-shadow: 0 0 16px rgba(251,191,36,.45); }
.shop-daily-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-daily-tags span { padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #fde68a; border: 1px solid rgba(251,191,36,.5); background: rgba(0,0,0,.35); }
.shop-daily-tags .t-lr { color: #1a1205; background: linear-gradient(90deg, #fbbf24, #fde68a); border-color: #fde68a; }
.shop-daily { --c: #fbbf24; }
.shop-daily .shop-buy { width: auto; align-self: flex-start; min-width: 150px; margin-top: 4px; padding: 10px 22px; background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); color: #000; }
.shop-daily:hover .shop-buy:not([disabled]) { filter: brightness(1.2); transform: scale(1.03); }
.shop-daily-retry { align-self: center; margin-top: 4px; padding: 6px 14px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fde68a; border: 1px solid rgba(251,191,36,.5); background: transparent; cursor: pointer; }
@media (max-width: 640px) {
    .shop-daily { flex-direction: column; text-align: center; gap: 10px; }
    .shop-daily-info { align-items: center; }
    .shop-daily-tags { justify-content: center; }
    .shop-daily .shop-buy { align-self: center; width: 100%; }
}
.shop-plus-btn { position: relative; }
.shop-new { position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid #fff; background: #f59e0b; box-shadow: 0 0 8px rgba(251,191,36,.9); animation: ephBlink 1.6s ease-in-out infinite; pointer-events: none; }
/* Étiquette « Nouveau » du bouton de la Forge : même style que celle de l'Éphéméride */
.shop-new-tag { padding: 3px 7px; border-radius: 4px; font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; vertical-align: 2px; margin-left: 4px;
    color: #fef3c7; background: rgba(180,83,9,.6); border: 1px solid #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.6); animation: ephBlink 1.6s ease-in-out infinite; }
.war-free-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 1.5px solid #fff; box-shadow: 0 0 8px #22c55e; animation: warFreePulse 1.6s ease-in-out infinite; pointer-events: none; }
@keyframes warFreePulse { 50% { transform: scale(1.3); } }

/* ===== Signature des variantes à la révélation (js/discovery.js, vfxPlay) ===== */
.vfx { position: fixed; z-index: 260; pointer-events: none; overflow: visible; }
.vfx > * { position: absolute; pointer-events: none; }
.afx-variant { margin-top: 14px; font: 900 clamp(18px, 3vw, 28px)/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .3em; text-transform: uppercase; color: var(--afx-c, #fff);
    text-shadow: 0 0 14px var(--afx-c, #fff), 0 0 34px var(--afx-c, #fff); opacity: 0; }
.afx-play .afx-variant { animation: afxVariantIn .7s cubic-bezier(.2,1.5,.4,1) 1.65s forwards; }
@keyframes afxVariantIn { 0% { opacity: 0; transform: scale(2.2); filter: blur(6px); } 100% { opacity: 1; transform: scale(1); filter: none; } }
/* reflet qui balaie la carte (GOLD, CARBON) */
.vfx-sheen { inset: 0; border-radius: 16px; overflow: hidden; background: linear-gradient(115deg, transparent 30%, rgba(255,240,180,.75) 48%, rgba(255,255,255,.95) 50%, rgba(255,240,180,.75) 52%, transparent 70%); background-size: 260% 100%; mix-blend-mode: screen; animation: vfxSheen 1.1s ease-out .1s both; }
.vfx-sheen.vfx-steel { background-image: linear-gradient(115deg, transparent 30%, rgba(203,213,225,.6) 48%, #fff 50%, rgba(203,213,225,.6) 52%, transparent 70%); }
@keyframes vfxSheen { from { background-position: 120% 0; opacity: 1; } to { background-position: -40% 0; opacity: 0; } }
/* GOLD */
.vfx-gold i { top: -12%; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff7c2, #fbbf24 55%, #b45309); box-shadow: 0 0 8px rgba(251,191,36,.9);
    animation: vfxFall 1.7s cubic-bezier(.35,.1,.6,1) var(--d) both; }
@keyframes vfxFall { 0% { transform: translateY(0) rotateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(125vh) rotateY(var(--r)); opacity: .9; } }
/* EMBER */
.vfx-heat { left: -20%; right: -20%; bottom: -10%; height: 45%; background: radial-gradient(ellipse at 50% 100%, rgba(255,90,31,.75), rgba(255,140,0,.25) 45%, transparent 70%); filter: blur(6px); animation: vfxHeat 1.8s ease-out both; }
@keyframes vfxHeat { 0% { opacity: 0; transform: scaleY(.4); } 25% { opacity: 1; transform: scaleY(1.1); } 100% { opacity: 0; transform: scaleY(1.3); } }
.vfx-ember i { bottom: 0; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: #ffd27a; box-shadow: 0 0 8px #ff5a1f, 0 0 16px #ff8c00; animation: vfxRise 1.8s ease-out var(--d) both; }
@keyframes vfxRise { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--sw), calc(var(--vh, 300px) * -1.15)) scale(.3); opacity: 0; } }
/* CYBER */
.vfx-cyber b { top: -10%; left: var(--x); width: 7%; font: 700 13px/1.05 ui-monospace, monospace; color: #00ffff; text-shadow: 0 0 6px #00ffff; word-break: break-all; text-align: center; animation: vfxCode 1.6s linear var(--d) both; }
@keyframes vfxCode { 0% { transform: translateY(-40%); opacity: 0; } 15% { opacity: 1; } 80% { opacity: .9; } 100% { transform: translateY(100%); opacity: 0; } }
.vfx-scan { left: -6%; right: -6%; height: 3px; top: 0; background: #00ffff; box-shadow: 0 0 14px #00ffff, 0 0 30px #00ffff; animation: vfxScan 1.2s ease-in-out .1s both; }
@keyframes vfxScan { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
/* VINTAGE */
.vfx-sepia { inset: -40vmax; background: rgba(112,66,20,.45); mix-blend-mode: color; animation: vfxSepia 1.6s ease-out both; }
@keyframes vfxSepia { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.vfx-vintage i { top: -5%; bottom: -5%; left: var(--x); width: 1px; background: rgba(255,248,230,.75); animation: vfxScratch 1.2s steps(6) var(--d) both; }
@keyframes vfxScratch { 0%, 100% { opacity: 0; } 20%, 60% { opacity: 1; } 40%, 80% { opacity: .2; transform: translateX(3px); } }
/* CARBON */
.vfx-hex { inset: -12%; opacity: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48' viewBox='0 0 28 48'%3E%3Cpath d='M14 0l14 8v16l-14 8L0 24V8zM14 32l14 8v16l-14 8L0 56V40z' fill='none' stroke='%23cbd5e1' stroke-width='1.2'/%3E%3C/svg%3E");
    -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%); animation: vfxHex 1.5s ease-out both; }
@keyframes vfxHex { 0% { opacity: 0; transform: scale(.85); } 30% { opacity: .9; } 100% { opacity: 0; transform: scale(1.15); } }
/* PRISMATIC */
.vfx-prism { inset: -30%; border-radius: 50%; background: conic-gradient(from 0deg, #ff004c, #ff9a00, #ffe600, #3dff6e, #00c2ff, #7a5cff, #ff00d4, #ff004c); filter: blur(28px); opacity: 0; animation: vfxPrism 1.8s ease-out both; }
@keyframes vfxPrism { 0% { opacity: 0; transform: scale(.4) rotate(0); } 30% { opacity: .55; } 100% { opacity: 0; transform: scale(1.3) rotate(180deg); } }
.vfx-prismatic i { left: 50%; top: 50%; width: 6px; height: 70vmax; margin-left: -3px; transform-origin: 50% 0; transform: rotate(var(--a));
    background: linear-gradient(to bottom, rgba(255,255,255,.9), hsla(calc(var(--a) * 1), 100%, 65%, .55) 30%, transparent 80%); filter: blur(1px); animation: vfxBeam 1.4s ease-out var(--d) both; }
@keyframes vfxBeam { 0% { opacity: 0; clip-path: inset(0 0 100% 0); } 30% { opacity: 1; } 100% { opacity: 0; clip-path: inset(0 0 0 0); } }
/* REVERSE */
.vfx-invert { inset: -100vmax; backdrop-filter: invert(1) hue-rotate(180deg); -webkit-backdrop-filter: invert(1) hue-rotate(180deg); animation: vfxInvert .9s steps(1) both; }
@keyframes vfxInvert { 0% { opacity: 1; } 18% { opacity: 0; } 30% { opacity: 1; } 48%, 100% { opacity: 0; } }
.vfx-ring { left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid #67e8f9; box-shadow: 0 0 20px #67e8f9; animation: vfxRing 1.2s ease-out .2s both; }
@keyframes vfxRing { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(18); opacity: 0; } }
/* MISSPRINT */
.vfx-ghost { inset: 0; border-radius: 16px; border: 3px solid; mix-blend-mode: screen; animation: vfxGhost 1.1s steps(8) both; }
.vfx-ghost.g1 { border-color: #ff2bd6; box-shadow: 0 0 18px #ff2bd6; --gx: -10px; }
.vfx-ghost.g2 { border-color: #00f0ff; box-shadow: 0 0 18px #00f0ff; --gx: 10px; }
@keyframes vfxGhost { 0% { transform: translate(var(--gx), 0); opacity: 1; } 25% { transform: translate(calc(var(--gx) * -0.6), 4px); } 50% { transform: translate(var(--gx), -3px); } 75% { transform: translate(calc(var(--gx) * .3), 2px); opacity: .8; } 100% { transform: none; opacity: 0; } }
.vfx-missprint i { left: -8%; right: -8%; top: var(--y); height: var(--h); background: linear-gradient(90deg, #ff2bd6, #00f0ff); mix-blend-mode: screen; opacity: 0; animation: vfxTear .5s steps(3) var(--d) both; }
@keyframes vfxTear { 0%, 100% { opacity: 0; } 30%, 70% { opacity: .8; transform: translateX(12px); } }
/* HOLO */
.vfx-hring { inset: 0; margin: auto; width: 120px; height: 120px; border-radius: 50%; border: 4px solid #ff7ac8;
    box-shadow: 0 0 14px #ff7ac8, inset 0 0 14px #7ad7ff, 0 0 26px #7affc1; animation: vfxHolo 1.4s ease-out var(--d) both; }
@keyframes vfxHolo { 0% { opacity: 0; transform: scale(.3); filter: hue-rotate(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(4); filter: hue-rotate(300deg); } }
/* ALT */
.vfx-alt i { left: var(--x); top: var(--y); width: var(--s); height: calc(var(--s) * 1.25); margin: calc(var(--s) / -2);
    background: radial-gradient(circle at 35% 30%, hsla(var(--h), 100%, 82%, 1), hsla(var(--h), 92%, 58%, .95) 55%, hsla(var(--h), 85%, 40%, .9));
    box-shadow: 0 0 4px hsla(var(--h), 95%, 60%, .7); animation: vfxSplash 1.1s cubic-bezier(.15,.7,.3,1) var(--d) both; }
@keyframes vfxSplash { 0% { transform: translate(0, 0) rotate(0) scale(.2); opacity: 0; } 12% { opacity: 1; transform: translate(calc(var(--dx) * .25), calc(var(--dy) * .25)) rotate(calc(var(--rot) * .3)) scale(1.2, .8); }
    70% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 22px)) rotate(var(--rot)) scale(.85, 1.15); opacity: 0; } }
/* PARALLEL */
.vfx-parallel i { left: 50%; top: 50%; width: 2px; height: var(--l); margin-left: -1px; transform-origin: 50% 0; transform: rotate(var(--a)) translateY(32%);
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,.95), transparent); animation: vfxSpeed .7s ease-out var(--d) both; }
@keyframes vfxSpeed { 0% { opacity: 0; transform: rotate(var(--a)) translateY(10%) scaleY(.2); } 40% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(60%) scaleY(1); } }
/* NEBULA */
.vfx-swirl { inset: -45%; border-radius: 50%; background: conic-gradient(from 0deg, transparent, rgba(167,139,250,.55), transparent 30%, rgba(56,189,248,.45), transparent 60%, rgba(236,72,153,.45), transparent); filter: blur(22px); animation: vfxSwirl 2.4s ease-out both; }
.vfx-swirl.s2 { inset: -30%; animation-direction: reverse; animation-duration: 2.2s; }
@keyframes vfxSwirl { 0% { opacity: 0; transform: rotate(0) scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(270deg) scale(1.2); } }
.vfx-nebula i { left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #c4b5fd, 0 0 12px #a78bfa; animation: vfxTwinkle 1.6s ease-in-out var(--d) both; }
@keyframes vfxTwinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.6); } }
/* Numéro de série : tampon */
.vfx-stamp { right: -6%; bottom: 8%; padding: 6px 14px; border-radius: 10px; border: 3px solid #fbbf24; background: rgba(20,12,2,.82); color: #fde68a;
    font: 900 22px/1 ui-monospace, monospace; letter-spacing: .08em; text-shadow: 0 0 10px rgba(251,191,36,.9); box-shadow: 0 0 22px rgba(251,191,36,.6), inset 0 0 12px rgba(251,191,36,.3);
    transform: rotate(-8deg); animation: vfxStamp .55s cubic-bezier(.2,1.8,.4,1) .35s both, vfxStampOut .5s ease-in 2s forwards; }
.vfx-stamp small { font-size: 13px; opacity: .8; }
.vfx-stamp.one { right: 50%; bottom: 50%; transform: translate(50%, 50%) rotate(-6deg); border-color: #c4b5fd; color: #ede9fe; background: rgba(20,8,40,.85); font-size: 26px;
    text-shadow: 0 0 12px #a78bfa, 0 0 26px #7c3aed; box-shadow: 0 0 34px rgba(167,139,250,.8); animation: vfxStampOne .7s cubic-bezier(.2,1.8,.4,1) .5s both, vfxStampOut .5s ease-in 2s forwards; }
@keyframes vfxStamp { 0% { transform: rotate(-8deg) scale(3); opacity: 0; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }
@keyframes vfxStampOne { 0% { transform: translate(50%, 50%) rotate(-6deg) scale(3); opacity: 0; } 100% { transform: translate(50%, 50%) rotate(-6deg) scale(1); opacity: 1; } }
@keyframes vfxStampOut { to { opacity: 0; } }
.vfx-crown { left: 50%; top: -14%; transform: translateX(-50%); font-size: 54px; color: #fde68a; text-shadow: 0 0 18px #fbbf24, 0 0 40px #a78bfa; animation: vfxCrown 1.2s cubic-bezier(.2,1.5,.4,1) .2s both, vfxStampOut .5s ease-in 2s forwards; }
@keyframes vfxCrown { 0% { transform: translate(-50%, -60px) scale(.3); opacity: 0; } 100% { transform: translate(-50%, 0) scale(1); opacity: 1; } }
.vfx-star-burst { left: 50%; top: 50%; width: 0; height: 0; }
.vfx-star-burst i { position: absolute; left: -2px; top: 0; width: 4px; height: 55vmax; transform-origin: 50% 0; transform: rotate(var(--a)); background: linear-gradient(to bottom, #fff, rgba(196,181,253,.6) 20%, transparent 60%); animation: vfxBeam 1.6s ease-out .3s both; }
@media (prefers-reduced-motion: reduce) { .vfx { display: none; } }

/* Options : volume des sons (js/sound.js) */
.snd-vol-row { display: flex; align-items: center; gap: 10px; }
.snd-vol { flex: 1; accent-color: #a855f7; height: 4px; cursor: pointer; }
.snd-vol:disabled { opacity: .35; cursor: default; }

/* Fragment du jour : bouton de prix toujours visible comme un bouton, même indisponible (chargement, hors connexion) */
.shop-daily .shop-buy[disabled] { background: rgba(0,0,0,.35); color: #fde68a; border: 1px solid rgba(251,191,36,.55); opacity: .6; }
.shop-daily-err { display: block; max-width: 100%; font-size: 9px; line-height: 1.3; color: #fca5a5; word-break: break-word; white-space: normal; }
.shop-daily-stage.zoomable { cursor: zoom-in; transition: transform .2s; }
.shop-daily-stage.zoomable:hover { transform: scale(1.04); }

/* Boosters habillés d'un dos de carte (Archiviste, Series, Odyssée...) : pas d'étoile centrale, le décor du dos la remplace */
.booster-front.bk-front .booster-center-star { visibility: hidden; }

/* Barre d'actions de la fenêtre d'un fragment : les boutons rétrécissent au lieu de sortir de l'écran (mobile, compte développeur) */
#cardModalBar { min-width: 0; max-width: 100%; }
#cardModalBar > button { min-width: 0; flex: 1 1 0; overflow: hidden; }
#cardModalBar > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
    #cardModalBar { gap: 3px; padding: 5px; }
    #cardModalBar > button { padding: 0 1px; letter-spacing: 0; font-size: 8.5px; height: 44px; }
    #cardModalBar > button > span + span { font-size: 7px; }
}

/* Notes de mise à jour et tutoriel : sur un écran trop bas, la fenêtre défile au lieu de cacher sa croix et son bouton hors écran */
#updateModal, #tutorialModal, #memoryTutorialModal { justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
#updateModal > .glass-panel, #tutorialModal > .glass-panel, #memoryTutorialModal > .glass-panel { margin: auto 0; flex-shrink: 0; }
@media (max-width: 640px) { #updateModal > .glass-panel { padding: 22px 18px; } #updateModal h2 { font-size: 22px; padding-right: 34px; } }

/* Découverte sur mobile : les boosters du carrousel qui dépassent sur les côtés ne doivent pas élargir la page
   (sinon le navigateur décale tout l'affichage vers la gauche au démarrage) */
/* (pas de règle sur html : elle empêchait le défilement vertical de la page ; body garde son overflow-x: hidden) */
main.container { overflow-x: clip; }

/* Grandes cartes petites (mobile, paysage) : statistiques et badges un peu plus compacts (js/cards.js : cardFitText) */
.cfit-small .cfit-t { margin-bottom: 2px !important; }
.cfit-small.cfit-land .cfit-x { margin-top: 2px !important; margin-bottom: 4px !important; }

/* Carte en grand : le contenu de l'onglet derrière n'est plus dessiné (js/card-modal.js) */
body.card-modal-open > main { visibility: hidden; transition: visibility 0s linear .3s; } /* après le fondu d'ouverture */
/* Mobile : la croix de la carte en grand passe sous la barre d'actions (elle recouvrait le dernier bouton) */
@media (max-width: 640px) { #cardModal > button[onclick="closeModal()"] { top: 74px; right: 8px; } }

/* Collections : réorganisation des cartes du classeur (js/collections.js) */
.wsc-pocket.wsc-picked { outline: 3px solid #facc15; outline-offset: 2px; box-shadow: 0 0 18px rgba(250,204,21,.55); }
.wsc-pocket.wsc-drop { outline: 2px dashed #a78bfa; outline-offset: 2px; }
#collectionDetailGrid .wsc-pocket[draggable], #collectionDetailGrid [draggable="true"] { cursor: grab; }
.wsc-tool.wsc-tool-on { border-color: #facc15 !important; color: #fde68a !important; }

/* Guide : les onglets passent à la ligne sur mobile au lieu d'élargir la fenêtre */
#helpTabs { flex-wrap: wrap; }
#helpModal > .glass-panel { overflow-x: hidden; max-width: min(42rem, calc(100vw - 16px)); }
@media (max-width: 640px) {
    #helpModal > .glass-panel { padding: 18px 14px; }
    #helpTabs { gap: 6px; }
    #helpTabs > button { padding: 5px 10px; font-size: 11px; }
    #helpModal h2 { padding-right: 34px; }
}
.wsp-bar .wsp-d { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #e9d5ff; cursor: pointer; padding: 6px 8px; border-radius: 10px; border: 1px solid rgba(168,85,247,.4); background: #0b0716; }
.wsp-bar .wsp-d input { accent-color: #a855f7; }

/* Bouton News : pastille à chaque nouvelle version, historique des versions dans la fenêtre */
.news-dot { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #ef4444; border: 1.5px solid #fff; box-shadow: 0 0 8px #ef4444; animation: warFreePulse 1.6s ease-in-out infinite; pointer-events: none; }
#updateModal .news-entry + .news-entry { margin-top: 18px; padding-top: 4px; opacity: .85; }
#updateModal .news-ver { font-weight: 700; color: #fff; font-size: 1rem; border-bottom: 1px solid rgba(6,182,212,.3); padding-bottom: 6px; margin-bottom: 10px; }

/* CARBON : trame en nid d'abeille (comme à l'ouverture), parcourue par un reflet métallique */
.carbon-hex { position: absolute; inset: 0; pointer-events: none; z-index: 1;
    /* Tuile exacte d'un pavage hexagonal (rayon 16 : largeur √3×16 = 27,7128, hauteur 48) : un hexagone + l'arête verticale
       qui le relie à la rangée suivante. Les arêtes des bords sont tracées des deux côtés et se raccordent sans chevauchement. */
    --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27.7128' height='48' viewBox='0 0 27.7128 48' preserveAspectRatio='none'%3E%3Cpath d='M13.8564 0L27.7128 8V24L13.8564 32L0 24V8ZM13.8564 32V48' fill='none' stroke='%23cbd5e1' stroke-width='1.1' stroke-linejoin='miter'/%3E%3C/svg%3E");
    background-image: var(--hex); background-size: 20.7846px 36px; opacity: .2; mix-blend-mode: screen; }
.carbon-hex::after { content: ''; position: absolute; inset: 0; background-image: var(--hex); background-size: inherit; opacity: .9;
    -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 50%, transparent 65%); mask-image: linear-gradient(115deg, transparent 35%, #000 50%, transparent 65%);
    -webkit-mask-size: 300% 100%; mask-size: 300% 100%; animation: carbonHexSweep 5s ease-in-out infinite; }
.carbon-hex-mini { background-size: 10.3923px 18px; }
@keyframes carbonHexSweep { 0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; } 60%, 100% { -webkit-mask-position: 0 0; mask-position: 0 0; } }
.fx-off .carbon-hex::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .carbon-hex::after { animation: none; opacity: 0; } }

/* Texte destiné aux moteurs de recherche et aux lecteurs d'écran (complète le titre <h1>), invisible à l'écran */
.seo-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Zoom à deux doigts autorisé (accessibilité), mais pas le zoom au double appui qui gênerait le jeu */
html { touch-action: manipulation; }

/* Découverte sur téléphone et tablette : le carrousel passe en premier, déplier l'histoire ne le fait plus descendre */
@media (max-width: 1023px) {
    #viewDiscovery > .glass-panel:nth-child(2) { order: -1; margin-bottom: 2rem; }
}
/* Ordinateur : le panneau du carrousel garde sa hauteur quand l'histoire de la Découverte se déplie */
@media (min-width: 1024px) {
    #viewDiscovery { align-items: flex-start !important; }
    #viewDiscovery > .glass-panel:nth-child(2) { align-self: flex-start; }
}

/* ===== ÉCONOMIE DE BATTERIE SUR MOBILE & GRILLES ===== */
/* 1. Ne faire briller que le booster central actif du carrousel (pas les 7 autres en 3D) */
.carousel-item:not(.active) .booster-front::before {
    animation: none !important;
    display: none !important;
}

/* 2. Mettre en pause les animations internes des miniatures tant qu'on ne les survole pas (Mémoire, Séquences, Découverte) */
#inventoryGrid > .inv-item:not(:hover) *,
#inventoryGrid > .inv-item:not(:hover) *::before,
#inventoryGrid > .inv-item:not(:hover) *::after,
#editorDeckGrid > .inv-item:not(:hover) *,
#editorInventoryGrid > .inv-item:not(:hover) *,
#summonSummaryGrid > .inv-item:not(:hover) * {
    animation-play-state: paused !important;
}

/* 3. Pas de double drop-shadow coûteux sur les étoiles/pixels des miniatures */
.inv-item .gold-stars,
.inv-item .cyber-glitch-pixels {
    filter: none !important;
}

/* 4. Sur téléphone (écran tactile), alléger les animations permanentes de l'interface */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .shop-cta::after,
    .shop-cta-img,
    .shop-plus-btn,
    .eph-cta svg .eph-rot1 {
        animation: none !important;
    }

    .inv-item .fire-border::after {
        animation: none !important;
        display: none !important;
    }
}