/* ===== Découvrir : vitrine 3D ===== */
.d-body { --stage: #2a62d6; --stage-dark: #1d4db8; background: #fff; }

/* Bouton scanner de l'en-tête */
.k-scan { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.k-scan:hover { background: var(--pink-soft); color: var(--pink-ink); }
.k-nav a[aria-current="page"] { color: var(--pink-ink); font-weight: 700; }

/* ----- Scène ----- */
.d-hero {
    position: relative; overflow: hidden; margin: 0 16px; border-radius: 36px;
    background: radial-gradient(120% 90% at 50% 0%, #3a74ec 0%, var(--stage) 45%, var(--stage-dark) 100%);
    color: #fff;
}
.d-hero__head { position: relative; z-index: 5; max-width: 1100px; margin: 0 auto; padding: 48px 24px 8px; text-align: center; }
.d-eyebrow { color: #ffd166; }
.d-title { margin: 0 0 24px; font-size: clamp(40px, 6vw, 76px); line-height: 1; font-weight: 800; letter-spacing: -.045em; }
.d-title em { font-style: normal; color: #ffd166; }

.d-search {
    display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto 20px; padding: 6px 6px 6px 18px;
    background: #fff; color: var(--ink); border-radius: 999px; box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.d-search svg { flex-shrink: 0; color: var(--muted); }
.d-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; background: transparent; color: inherit; padding: 10px 0; }
.d-search select { border: 0; background: #f3f4f8; border-radius: 999px; padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 600; color: inherit; cursor: pointer; }
.d-search:focus-within { box-shadow: 0 0 0 3px #ffd166, 0 16px 40px rgba(0,0,0,.18); }

.d-tags { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 12px; scrollbar-width: none; }
/* Centré quand tout tient, aligné à gauche (défilable) quand ça déborde */
.d-tags > :first-child { margin-left: auto; }
.d-tags > :last-child { margin-right: auto; }
.d-tags::-webkit-scrollbar { display: none; }
.d-tag {
    flex-shrink: 0; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
    background: rgba(255,255,255,.14); color: #fff !important; border: 1px solid rgba(255,255,255,.22); transition: background .15s;
}
.d-tag:hover { background: rgba(255,255,255,.26); }
.d-tag.is-active { background: #ffd166; color: #1b1b1b !important; border-color: #ffd166; }
.d-tag:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Décor : pastilles floues */
.d-blob { position: absolute; border-radius: 50%; filter: blur(2px); z-index: 1; pointer-events: none; }
.d-blob--1 { width: 180px; height: 180px; left: 6%; bottom: 60px; background: radial-gradient(circle at 35% 30%, #ffb347, #ff7a00 70%); box-shadow: inset -12px -16px 30px rgba(0,0,0,.2); animation: d-float 7s ease-in-out infinite; }
.d-blob--2 { width: 110px; height: 110px; right: 8%; top: 42%; background: radial-gradient(circle at 35% 30%, #ff6b9a, var(--pink) 70%); box-shadow: inset -8px -10px 20px rgba(0,0,0,.2); animation: d-float 9s ease-in-out -3s infinite; }
@keyframes d-float { 50% { transform: translateY(-18px) rotate(8deg); } }

/* ----- Carrousel 3D ----- */
.d-stage { position: relative; z-index: 3; height: 620px; perspective: 1600px; outline: none; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.d-stage.is-dragging { cursor: grabbing; }
.d-stage:focus-visible { box-shadow: inset 0 0 0 3px #ffd166; border-radius: 24px; }
html:not(.js) .d-stage { display: none; } /* sans JS : la grille suffit */
.d-track { position: absolute; inset: 0; transform-style: preserve-3d; }
.d-slide {
    position: absolute; left: 50%; top: 46%; width: 300px; margin-left: -150px; margin-top: -250px;
    text-decoration: none; color: inherit; transform-style: preserve-3d; will-change: transform, opacity;
    -webkit-user-drag: none;
}
.d-slide .dc { box-shadow: 0 40px 80px rgba(8, 20, 70, .45); }
.d-slide.is-center .dc { box-shadow: 0 50px 100px rgba(8, 20, 70, .55), 0 0 0 3px rgba(255,255,255,.5); }
.d-slide img { -webkit-user-drag: none; pointer-events: none; }

.d-nav {
    position: absolute; top: 46%; z-index: 20; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; border: 0; cursor: pointer;
    background: #fff; color: var(--ink); font-size: 30px; line-height: 1; box-shadow: 0 10px 30px rgba(0,0,0,.2);
    display: grid; place-items: center; padding-bottom: 4px;
}
.d-nav:hover { background: #ffd166; }
.d-nav:focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; }
.d-nav--prev { left: max(16px, calc(50% - 480px)); }
.d-nav--next { right: max(16px, calc(50% - 480px)); }
.d-counter { position: absolute; bottom: 14px; left: 0; right: 0; margin: 0; text-align: center; font-weight: 700; font-size: 14px; opacity: .8; font-variant-numeric: tabular-nums; }

/* ----- Carte (utilise les variables du thème de chaque utilisateur, cf. page.css) ----- */
.dc {
    position: relative; overflow: hidden; border-radius: 30px; min-height: 500px;
    background: var(--bg); color: var(--text); font-family: var(--font, Inter), system-ui, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
    display: flex; flex-direction: column;
}
.dc__cover {
    position: relative; height: 230px; flex-shrink: 0;
    background: rgba(255,255,255,.12) center / cover no-repeat;
    -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent);
}
.dc__cover:not([style]) { background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 60%); }
.dc__avatar {
    position: absolute; left: 50%; bottom: 18px; width: 88px; height: 88px; margin-left: -44px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(255,255,255,.85); box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.dc__avatar--initial { display: grid; place-items: center; background: var(--btn); color: var(--btn-text); font-size: 36px; font-weight: 800; }
.dc__cover[style] .dc__avatar { display: none; } /* avec couverture, la photo parle d'elle-même */
.dc__body { position: relative; padding: 0 20px 22px; margin-top: -8px; text-align: center; flex: 1; display: flex; flex-direction: column; }
.dc__cover[style] + .dc__body { margin-top: -60px; }
.dc__name { margin: 0; font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; overflow-wrap: anywhere; }
.dc__premium { font-size: .55em; vertical-align: middle; color: #ffb703; }
.dc__handle { margin: 6px 0 12px; font-size: 13px; opacity: .75; }
.dc__tags { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.dc__tags li { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--text) 14%, transparent); }
.dc__links { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 8px; }
.dc__links li {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; font-size: 14px; font-weight: 600;
    background: var(--btn); color: var(--btn-text); border: var(--border, 0); border-radius: var(--radius);
    box-shadow: var(--shadow, none); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ----- Vide ----- */
.d-empty { position: relative; z-index: 5; max-width: 520px; margin: 0 auto; padding: 60px 24px 80px; text-align: center; font-size: 17px; line-height: 1.5; }
.d-empty__title { font-size: 26px; font-weight: 800; margin: 0 0 10px; }
.d-empty .k-btn { margin-top: 12px; }

/* ----- Grille ----- */
.d-grid-section { max-width: 1280px; margin: 0 auto; padding: 56px 24px 32px; }
.d-h2 { margin: 0 0 24px; font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.d-h2 span { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.d-grid__item { text-decoration: none; color: inherit; border-radius: 30px; transition: transform .2s; }
.d-grid__item:hover { transform: translateY(-6px) rotate(-1deg); }
.d-grid__item:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }
.d-grid__item .dc { min-height: 440px; box-shadow: 0 16px 40px rgba(20,20,40,.12); }
.d-grid__item .dc__cover { height: 190px; }
.d-grid__item .dc__name { font-size: 28px; }
.d-pager { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }

/* Bouton flottant « Scanner » (mobile) */
.d-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 60px; height: 60px; border-radius: 50%;
    display: none; place-items: center; background: var(--pink); color: #fff; box-shadow: 0 12px 30px var(--pink-glow);
}
.d-fab svg { width: 26px; height: 26px; }

@media (max-width: 760px) {
    .d-hero { margin: 0 8px; border-radius: 28px; }
    .d-hero__head { padding: 32px 16px 4px; }
    .d-search { flex-wrap: wrap; border-radius: 22px; padding: 8px 8px 8px 16px; }
    .d-search input { flex-basis: calc(100% - 40px); }
    .d-search select, .d-search .k-btn { flex: 1; }
    .d-stage { height: 540px; }
    .d-slide { width: 250px; margin-left: -125px; margin-top: -225px; }
    .dc { min-height: 450px; }
    .dc__cover { height: 200px; }
    .dc__name { font-size: 28px; }
    .d-nav { width: 44px; height: 44px; margin-top: -22px; font-size: 26px; }
    .d-blob--1 { width: 110px; height: 110px; left: -30px; }
    .d-blob--2 { width: 70px; height: 70px; right: -10px; }
    .k-scan span { display: none; }
    .d-fab { display: grid; }
    .d-grid-section { padding: 40px 16px 24px; }
    .d-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .d-grid__item .dc { min-height: 330px; border-radius: 22px; }
    .d-grid__item .dc__cover { height: 130px; }
    .d-grid__item .dc__name { font-size: 20px; }
    .d-grid__item .dc__body { padding: 0 12px 14px; }
    .d-grid__item .dc__links li { padding: 9px 10px; font-size: 12px; }
    .d-grid__item .dc__avatar { width: 64px; height: 64px; margin-left: -32px; }
}
@media (prefers-reduced-motion: reduce) {
    .d-blob { animation: none; }
    .d-grid__item { transition: none; }
}
