/* ================================================================
   PASS VIP — styles (boutique, espace membre, cosmétiques publics,
   mur des soutiens, TéraCards). 100 % visuel, aucun effet en jeu.
   Couleurs : bronze #CD7F32 · argent #C0C0C0 · or #D4AF37
================================================================ */
:root {
    --vip-bronze: #CD7F32;
    --vip-silver: #C0C0C0;
    --vip-gold:   #D4AF37;
}
.vip-c-eclaireur  { --vip-c: var(--vip-bronze); }
.vip-c-convoi     { --vip-c: var(--vip-silver); }
.vip-c-commandant { --vip-c: var(--vip-gold); }
.vip-c-saison     { --vip-c: var(--vip-gold); }

/* ── Pseudo coloré + titre ── */
.vip-name { font-weight: 700; }
.vip-name--commandant, .vip-name--saison { text-shadow: 0 0 10px rgba(212, 175, 55, .35); }
.vip-title-badge, .vip-season-chip {
    display: inline-block; margin-left: .4rem; padding: .05rem .45rem;
    border: 1px solid currentColor; border-radius: 999px;
    font-family: var(--font-accent, inherit); font-size: .68rem; line-height: 1.5;
    letter-spacing: .04em; vertical-align: middle; white-space: nowrap;
    background: rgba(0, 0, 0, .35);
}
.vip-season-chip { color: var(--vip-gold); border-color: var(--vip-gold); }

/* ── Cadre animé autour de l'avatar ──
   Anneau CSS (toujours présent = repli si le SVG manque) + SVG par-dessus. */
.vip-frame { position: relative; isolation: isolate; overflow: visible !important; }
.vip-frame::before {
    content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: -1;
    background: conic-gradient(from 0deg, var(--vip-ring-a), var(--vip-ring-b), var(--vip-ring-a), var(--vip-ring-b), var(--vip-ring-a));
    animation: vipSpin 6s linear infinite;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}
.vip-frame::after {
    content: ""; position: absolute; inset: -10px; border-radius: 50%; z-index: -2;
    box-shadow: 0 0 18px 2px var(--vip-ring-glow);
    animation: vipPulse 2.8s ease-in-out infinite;
    pointer-events: none;
}
.vip-frame--eclaireur  { --vip-ring-a: #f3c08a; --vip-ring-b: #8a4f1c; --vip-ring-glow: rgba(205, 127, 50, .5); }
.vip-frame--convoi     { --vip-ring-a: #f4f4f4; --vip-ring-b: #8a8a8a; --vip-ring-glow: rgba(200, 200, 200, .45); }
.vip-frame--commandant { --vip-ring-a: #fff1b8; --vip-ring-b: #b8860b; --vip-ring-glow: rgba(212, 175, 55, .55); }
.vip-frame--saison     { --vip-ring-a: #ffe08a; --vip-ring-b: #e67e22; --vip-ring-glow: rgba(230, 126, 34, .6); }
.vip-frame-img {
    position: absolute; inset: var(--vip-frame-inset, -17%); width: var(--vip-frame-size, 134%); height: var(--vip-frame-size, 134%);
    max-width: none; pointer-events: none; z-index: 2;
    animation: vipFrameFloat 4s ease-in-out infinite;
}
.vip-frame:not(.vip-frame--noimg)::before { opacity: 0; }   /* le SVG a déjà son anneau animé */
@keyframes vipSpin { to { transform: rotate(360deg); } }
@keyframes vipPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes vipFrameFloat { 0%, 100% { filter: drop-shadow(0 0 2px var(--vip-ring-glow)); } 50% { filter: drop-shadow(0 0 8px var(--vip-ring-glow)); } }

/* ── Bannière de profil ── */
.vip-banner {
    display: block; width: 100%; aspect-ratio: 4 / 1; min-height: 70px;
    border-radius: 10px; margin-bottom: 1rem; border: 1px solid rgba(212, 175, 55, .45);
    background: linear-gradient(120deg, #2b1d07 0%, #6b4f12 45%, #d4af37 50%, #6b4f12 55%, #1a1206 100%);
    background-size: cover; background-position: center;
    position: relative; overflow: hidden;
}
.vip-banner--saison:not(.has-img) { background: linear-gradient(120deg, #2a1204 0%, #8a4a12 40%, #ffd27a 50%, #8a4a12 60%, #2a1204 100%); }
.vip-banner:not(.has-img)::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%);
    background-size: 250% 100%; animation: vipShine 5s linear infinite;
}
@keyframes vipShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }

/* ================================================================
   BOUTIQUE — catégorie Pass VIP
================================================================ */
.vip-shop-section { padding: 4rem 0 3rem; background: radial-gradient(ellipse at top, rgba(212, 175, 55, .08), transparent 60%); }
.vip-no-gameplay {
    max-width: 760px; margin: .8rem auto 2rem; text-align: center;
    padding: .7rem 1rem; border: 1px dashed rgba(212, 175, 55, .55); border-radius: 8px;
    color: var(--bone, #e8dcc4); background: rgba(0, 0, 0, .25); font-size: .95rem;
}
.vip-pass-card { border-top: 3px solid var(--vip-c, var(--vip-gold)) !important; display: flex; flex-direction: column; }
.vip-pass-card .product-media { cursor: zoom-in; }
.vip-pass-card .vip-pass-fallback {
    width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--vip-c) 45%, transparent), #0d0a07 70%);
    color: var(--vip-c); font-family: var(--font-display, serif); font-size: 1.6rem; letter-spacing: .08em; text-transform: uppercase;
}
.vip-pass-card .vip-pass-fallback span { font-size: 3.2rem; }
.vip-pass-card h3 { color: var(--vip-c, var(--bone)); }
.vip-pass-meta { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 .8rem; }
.vip-pass-meta .vip-pass-price { margin: 0; }
.vip-pass-duration { color: var(--bone-dim); font-family: var(--font-accent); font-size: .85rem; }
.vip-pass-desc { color: var(--bone-dim); font-size: .9rem; margin: 0 0 .7rem; }
.vip-perks { list-style: none; padding: 0; margin: 0 0 1rem; font-size: .88rem; color: var(--bone); flex: 1; }
.vip-perks li { padding: .22rem 0 .22rem 1.6rem; position: relative; line-height: 1.35; }
.vip-perks li::before { content: "✅"; position: absolute; left: 0; top: .2rem; font-size: .8rem; }
.vip-pass-note { color: var(--ash); font-size: .78rem; margin: .3rem 0 .8rem; }
.vip-current-chip {
    display: inline-block; margin-bottom: .5rem; padding: .15rem .6rem; border-radius: 999px;
    background: var(--vip-c); color: #120d05; font-weight: 700; font-size: .75rem;
}
.vip-pass-card .btn { width: 100%; justify-content: center; }

.vip-compare-wrap { margin: 2.5rem auto 0; max-width: 1180px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vip-compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .9rem; background: rgba(0, 0, 0, .25); }
.vip-compare caption { text-align: left; font-family: var(--font-display); color: var(--bone); font-size: 1.2rem; padding: 0 0 .7rem; }
.vip-compare th, .vip-compare td { padding: .55rem .7rem; border-bottom: 1px solid var(--border, #333); text-align: center; }
.vip-compare th:first-child, .vip-compare td:first-child { text-align: left; color: var(--bone-dim); }
.vip-compare thead th { font-family: var(--font-display); font-size: 1rem; border-bottom: 2px solid var(--vip-c, var(--border)); color: var(--vip-c, var(--bone)); }
.vip-compare .yes { color: #43b581; font-weight: 700; }
.vip-compare .no { color: var(--ash); }
.vip-compare tr.is-nogameplay td { color: var(--bone); font-weight: 600; }

/* ── Modale d'achat ── */
.vip-modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, .78); }
.vip-modal.open { display: flex; }
.vip-modal-box {
    width: min(520px, 100%); max-height: 92vh; overflow-y: auto;
    background: var(--bg-card, #15110c); border: 1px solid var(--vip-c, var(--vip-gold)); border-radius: 12px;
    padding: 1.6rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); position: relative;
}
.vip-modal-box h3 { font-family: var(--font-display); color: var(--vip-c, var(--bone)); margin: 0 0 1rem; }
.vip-modal-close { position: absolute; top: .6rem; right: .8rem; background: none; border: 0; color: var(--bone-dim); font-size: 1.4rem; cursor: pointer; }
.vip-modal-rows { display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; margin: 0 0 1rem; font-size: .95rem; }
.vip-modal-rows dt { color: var(--bone-dim); }
.vip-modal-rows dd { margin: 0; text-align: right; color: var(--bone); font-weight: 600; }
.vip-modal-rows .is-short { color: #e74c3c; }
.vip-warn {
    border-left: 3px solid #e67e22; background: rgba(230, 126, 34, .1);
    padding: .7rem .9rem; margin: 0 0 1rem; font-size: .9rem; color: var(--bone);
}
.vip-check { display: flex; gap: .6rem; align-items: flex-start; margin: .4rem 0 .9rem; cursor: pointer; font-size: .9rem; color: var(--bone); }
.vip-check input { margin-top: .2rem; flex-shrink: 0; width: 1.05rem; height: 1.05rem; accent-color: var(--vip-c, var(--orange)); }
.vip-modal-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.vip-modal-actions .btn { flex: 1; justify-content: center; }
.vip-modal-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
.vip-modal-err { color: #e74c3c; font-size: .9rem; margin: .5rem 0 0; min-height: 1.2em; }
.vip-success { text-align: center; }
.vip-success .big { font-size: 2.6rem; }
.vip-success ul { text-align: left; }

/* ── Prix barré décos (VIP connecté) ── */
.product-price-old { color: var(--ash); font-size: .9rem; margin-bottom: -.5rem; }
.product-price-old s { opacity: .8; }
.product-price-old .vip-off { color: var(--vip-gold); margin-left: .4rem; font-weight: 700; text-decoration: none; }

/* ================================================================
   ESPACE MEMBRE — « Mon pass »
================================================================ */
.vip-mypass { border-top: 3px solid var(--vip-c, var(--border)); }
.vip-mypass-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.vip-mypass-tier { font-family: var(--font-display); font-size: 1.5rem; color: var(--vip-c, var(--bone)); }
.vip-mypass-dates { color: var(--bone-dim); font-size: .9rem; }
.vip-days { display: inline-block; padding: .2rem .7rem; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--vip-c, var(--border)); color: var(--vip-c, var(--bone)); font-weight: 700; }
.vip-cos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; margin: 1rem 0; }
.vip-cos-grid label { display: block; font-family: var(--font-accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bone-dim); margin-bottom: .3rem; }
.vip-cos-grid select { width: 100%; }
.vip-cos-preview { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: .6rem 0 1rem; }
.vip-cos-preview .vip-back-thumb { width: 60px; aspect-ratio: 5 / 7; border-radius: 6px; border: 1px solid var(--border); background: linear-gradient(160deg, #4a2c12, #1a0f08); background-size: cover; background-position: center; }
.vip-badges-life { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }

/* ================================================================
   MUR DES SOUTIENS
================================================================ */
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; max-width: 1100px; margin: 0 auto; }
.wall-entry {
    padding: .9rem 1rem; border-radius: 8px; background: var(--bg-card, #15110c);
    border: 1px solid var(--border, #333); border-left: 4px solid var(--vip-c, var(--vip-gold));
}
.wall-entry .wall-name { font-family: var(--font-display); font-size: 1.1rem; color: var(--vip-c, var(--bone)); overflow-wrap: anywhere; }
.wall-entry .wall-tier { color: var(--bone-dim); font-size: .82rem; font-family: var(--font-accent); }

/* ================================================================
   TÉRACARDS — dos de carte VIP + animations d'ouverture
   Purement visuel, aucun effet sur le tirage.
================================================================ */
.pack-out-card.has-vip-back {
    background: var(--vip-back) center / cover no-repeat, linear-gradient(160deg, #4a2c12, #1a0f08) !important;
    font-size: 0 !important;
}
/* Animations d'ouverture par variante : css/vip-opening.css (+ js/vip-opening.js) */
@media (prefers-reduced-motion: reduce) {
    .vip-frame::before, .vip-frame::after, .vip-frame-img, .vip-banner::after { animation: none !important; }
}

/* ── Badge annonces avant-première ── */
.vip-preview-chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; background: var(--vip-gold); color: #120d05; font-weight: 700; margin-right: .4rem; }

/* Image de pass (portrait 600×800) — hors pipeline .product-image de la boutique */
.vip-pass-card .product-media { aspect-ratio: 3 / 4 !important; }
.vip-pass-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* L'avatar garde sa forme ronde quand le cadre rend l'overflow visible */
.vip-frame > img:not(.vip-frame-img) { border-radius: 50%; }
/* Prix du pass (hors .product-price : la boutique recalcule ces prix-là selon les options) */
.vip-pass-price { font-family: var(--font-display); color: var(--orange, #e67e22); font-size: clamp(1.35rem, 2vw, 1.8rem); }
/* Le SVG du cadre déborde de l'avatar (prioritaire sur « .avatar img { width:100% } ») */
.vip-frame > img.vip-frame-img { position: absolute !important; inset: var(--vip-frame-inset, -17%) !important; width: var(--vip-frame-size, 134%) !important; height: var(--vip-frame-size, 134%) !important; max-width: none !important; object-fit: contain !important; border-radius: 0 !important; }

/* ================================================================
   ESPACE MEMBRE — en-tête de profil (bannière + avatar + cadre)
   Cadre SVG 256×256 : anneau doré intérieur r 97,5/128 (bord ≈ 0,75)
   → 134 % de l'avatar = anneau collé au bord de la photo, même centre.
================================================================ */
.dashboard-side { --pf-avatar: 112px; }
.dashboard-side .avatar {
    width: var(--pf-avatar); height: var(--pf-avatar);
    position: relative; z-index: 2;
    box-shadow: 0 0 0 4px var(--bg-card, #15110c), 0 6px 18px rgba(0, 0, 0, .55);
}
.dashboard-side .avatar.vip-frame { margin-top: 1.4rem; margin-bottom: 1.8rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .55); }
/* Bannière pleine largeur, collée aux bords de la carte (annule le padding 2rem) */
.dashboard-side > #user-banner.vip-banner {
    width: auto; margin: -2rem -2rem 0;
    aspect-ratio: 4 / 1; min-height: 0;   /* = viewBox 1200×300 → rien n'est rogné */
    border: 0; border-bottom: 1px solid rgba(212, 175, 55, .55); border-radius: 0;
    /* texte à gauche dans le SVG : ancrage à gauche si un ratio différent s'applique */
    background-size: cover; background-position: left center; background-repeat: no-repeat;
}
.dashboard-side > #user-banner.vip-banner::before {      /* fondu bas → l'avatar se détache */
    content: ""; position: absolute; inset: auto 0 0 0; height: 18%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .3));
    pointer-events: none;
}
/* Avatar centré qui chevauche le bas-centre (calme) de la bannière.
   Chevauchement max 30 % de l'avatar, réduit selon la largeur (les % de
   margin = largeur du conteneur) pour ne jamais masquer « SAISON N » ni
   « Soutien officiel du serveur » : quasi nul en colonne étroite (~380 px),
   30 % en pleine largeur (mobile / une colonne). */
.dashboard-side > #user-banner.vip-banner + .avatar,
.dashboard-side > #user-banner.vip-banner + .avatar.vip-frame {
    margin-top: max(calc(var(--pf-avatar) * -0.3), calc(34px - 12%));
    margin-bottom: 1.8rem;   /* le ruban du cadre déborde sous l'avatar */
}
/* Pseudo puis titre en dessous, centrés */
.dashboard-side h3 { line-height: 1.2; }
.dashboard-side h3 .vip-title-badge,
.dashboard-side h3 .vip-season-chip { display: table; margin: .45rem auto 0; font-size: .72rem; }
