:root {
    --bg-color: #0c0c0c;
    --surface-color: #1a1a1a;
    --primary-color: #E50914;
    --primary-hover: #f40a16;
    --accent-color: #46d369;
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shakeGrid {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-5px); }
    40%  { transform: translateX(5px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.options-grid.limit-reached {
    animation: shakeGrid 0.45s ease;
}

.options-grid.limit-reached .option-card:not(.selected) {
    opacity: 0.35;
}

@keyframes heroSlideUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

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

    50% {
        transform: translateY(-5px);
    }

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

.animate-fade {
    animation: fadeIn 0.6s ease forwards;
}

.animate-scale {
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    opacity: 0;
    background-color: #080808;
    background-image:
        /* Lueur rouge intense en haut à gauche */
        radial-gradient(ellipse 65% 55% at 0% 0%, rgba(229, 9, 20, 0.22) 0%, transparent 65%),
        /* Lueur violette forte en haut à droite */
        radial-gradient(ellipse 70% 60% at 100% 5%, rgba(120, 40, 220, 0.28) 0%, transparent 65%),
        /* Halo rouge chaleureux au centre-bas */
        radial-gradient(ellipse 90% 45% at 50% 100%, rgba(229, 9, 20, 0.14) 0%, transparent 65%),
        /* Lueur dorée subtile au centre */
        radial-gradient(ellipse 50% 30% at 50% 55%, rgba(180, 80, 20, 0.06) 0%, transparent 70%);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    padding: 1.5rem 4%;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 500; /* au-dessus de tout overlay fixe (questionnaire z-index:50) */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* La transition est gérée en JS pour un fondu progressif au scroll */
    transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--primary-color);
    border: none;
    outline: none;
    text-decoration: none;
}

.logo::before, .logo::after {
    content: none;
    display: none;
}

.logo span {
    color: var(--text-color);
    font-weight: 300;
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── Switcher FR / EN — pill dropdown ── */
.lang-switcher {
    position: relative;
}

.lang-pill-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 20px;
    padding: 6px 12px 6px 14px;
    color: rgba(255,255,255,0.85);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.lang-pill-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

.lang-chevron {
    opacity: 0.55;
    transition: transform 0.2s ease;
}

.lang-switcher.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    min-width: 70px;
    z-index: 200;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.lang-option {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 9px 16px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
    background: rgba(255,255,255,0.07);
    color: white;
}

.lang-option.active {
    color: white;
}

/* Legacy — conserver si référencé ailleurs */
.lang-btn { display: none; }
.lang-sep  { display: none; }

.btn-config {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-config:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Layout */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4%;
    margin-top: 50px;
    /* Reduced to avoid pushing down too much */
    min-height: calc(100vh - 100px);
}

.view {
    display: none;
    width: 100%;
    max-width: 1300px;
    flex-direction: column;
}

.view.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Hero : titre centré en haut, trending en bas naturellement */
#hero.active {
    justify-content: flex-start;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding-top: clamp(100px, 16vh, 170px);
    padding-bottom: 3rem;
}

#loading.active {
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

/* Questionnaire : barre en haut fixe, bloc grandit vers le bas */
#questionnaire.active {
    justify-content: flex-start;
    align-items: center;
    min-height: calc(100vh - 100px);
    padding-top: 2.5rem;
    padding-bottom: 4rem;
    gap: 2rem;
}

#results.active {
    align-items: center;
    padding-top: 5rem;
    padding-bottom: 8rem;
}

#results h2 {
    margin-bottom: 3rem;
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #9ca3af);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes pulse-small {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes fadeInReason {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-dots {
    display: inline-block;
    animation: pulse-small 1.5s infinite;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--primary-color) !important;
    opacity: 0.7;
}

.ai-reason.ready {
    animation: fadeInReason 1s ease-out forwards;
}

/* Update h1 to include standard background-clip */
h1 {
    background-clip: text;
    -webkit-background-clip: text;
}



/* Hero Section */
.hero-content {
    text-align: center;
    max-width: 820px;
    width: 90%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ══ PAGE READY — apparition fluide et staggerée ══
   body.page-ready → transition opacity globale
   Chaque bloc hero/nav apparaît avec un délai progressif
*/
body.page-ready {
    opacity: 1;
    transition: opacity 0.6s ease;
}

/* Blocs hero : opacity 0 par défaut, animés quand page-ready */
body:not(.page-ready) .navbar,
body:not(.page-ready) #hero.active .hero-content h1,
body:not(.page-ready) #hero.active .hero-content .subtitle,
body:not(.page-ready) #hero.active .hero-content .hero-btns,
body:not(.page-ready) #hero.active .hero-content .hero-features {
    opacity: 0;
}

body.page-ready .navbar {
    animation: heroSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
body.page-ready #hero.active .hero-greeting {
    animation: heroSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}
body.page-ready #hero.active .hero-content h1 {
    animation: heroSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}
body.page-ready #hero.active .hero-content .subtitle {
    animation: heroSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}
body.page-ready #hero.active .hero-content .hero-btns {
    animation: heroSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.72s both;
}
body.page-ready #hero.active .hero-content .hero-features {
    animation: heroSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.88s both;
}

/* ── Hero Connecté ── */
@keyframes greeting-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.8rem;
    animation: greeting-in 0.6s ease both;
}

.greeting-wave {
    font-size: 2rem;
    animation: duo-icon-float 3s ease-in-out infinite;
    display: inline-block;
}

.greeting-text {
    font-size: 1.75rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    letter-spacing: -0.5px;
}

.greeting-text strong {
    color: white;
    font-weight: 800;
}

/* Chips stats cachés — on garde les classes mais on masque */
.hero-stats {
    display: none !important;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.stat-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.stat-chip.red {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
    color: #ff6b6b;
}

.stat-chip.red:hover {
    background: rgba(229, 9, 20, 0.18);
    border-color: rgba(229, 9, 20, 0.5);
}

.stat-chip.green {
    background: rgba(70, 211, 105, 0.1);
    border-color: rgba(70, 211, 105, 0.3);
    color: #46d369;
}

.stat-chip.green:hover {
    background: rgba(70, 211, 105, 0.18);
    border-color: rgba(70, 211, 105, 0.5);
}

/* ── Bouton Historique navbar ── */
.btn-history {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.btn-history:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ══════════════════════════════════════════════════
   NOTATION — Ligne étoiles + Déjà vu (redesign propre)
   ══════════════════════════════════════════════════ */

.rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Zone étoiles */
.rating-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.rating-stars {
    display: flex;
    gap: 1px;
    direction: ltr;
}

.star {
    font-size: 1.15rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.18);
    transition: color 0.12s ease, transform 0.1s ease;
    line-height: 1;
    user-select: none;
}

/* Hover : toutes les étoiles jusqu'à celle survolée deviennent jaunes */
.rating-stars:hover .star {
    color: rgba(255, 200, 0, 0.4);
}

.rating-stars .star:hover~.star {
    color: rgba(255, 255, 255, 0.18) !important;
}

.rating-stars:hover .star:hover {
    color: #f5c518;
    transform: scale(1.2);
}

/* État actif (noté) */
.star.active {
    color: #f5c518;
}

.star.active:hover {
    transform: scale(1.2);
}

/* ══════════════════════════════════════════════════
   HISTORIQUE — Page
   ══════════════════════════════════════════════════ */

#history-view.active,
#watchlist-view.active {
    align-items: flex-start;
    align-self: flex-start;   /* épingle en haut du conteneur main */
    padding-top: 5rem;
    padding-bottom: 6rem;
    margin-top: 5rem;
    /* Fond identique pour les deux pages */
    background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(229, 9, 20, 0.06) 0%, transparent 70%),
        var(--bg-color, #0c0c0c);
    border-radius: 24px;
}

/* ── Header ── */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 2.5rem;
    gap: 1rem;
    padding-bottom: 1.5rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
}


.history-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    letter-spacing: -2px;
    margin-bottom: 0.3rem;
    line-height: 1;
}

.history-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

/* ── Stats — bloc premium ── */
.dna-card {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 2.8rem;
    animation: fadeIn 0.5s ease both;
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 22px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 40px rgba(0,0,0,0.5);
}

.dna-card-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

@media (max-width: 700px) {
    .dna-card-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dna-stat {
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255,255,255,0.07);
    border-radius: 0;
    padding: 2rem 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: relative;
}

.dna-stat:last-child {
    border-right: none;
}

/* Filet rouge en haut uniquement sur le premier stat pour ancrer visuellement */
.dna-stat.stat-seen {
    border-top: 2px solid #E50914;
}
.dna-stat.stat-rated,
.dna-stat.stat-avg,
.dna-stat.stat-love {
    border-top: 2px solid transparent;
}

/* Icône masquée */
.dna-stat::before { display: none; }
.dna-stat-icon { display: none; }

.dna-stat-value {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    color: white;
    margin-bottom: 6px;
}

.dna-stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 5px;
}

/* Couleur coups de cœur seulement */
.dna-stat.stat-seen .dna-stat-value  { color: white; }
.dna-stat.stat-rated .dna-stat-value { color: white; }
.dna-stat.stat-avg .dna-stat-value   { color: white; }
.dna-stat.stat-love .dna-stat-value  { color: #E50914; }

.dna-divider { display: none; }

/* Sous-texte lisible */
.dna-stat-sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    line-height: 1.4;
    font-weight: 400;
}

/* Supprimer insights (retiré) */
.history-insights { display: none; }

.insight-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.38);
    line-height: 1.3;
}

.insight-item strong {
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}

.insight-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #E50914;
    flex-shrink: 0;
    opacity: 0.7;
}

.dna-genres {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.dna-genre-tag {
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.25);
    color: #ff8080;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Section label ── */
.history-section-label {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 1.2rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

/* ── Grille films ── */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* ══ TOAST REPRISE DE SESSION (style Netflix/Spotify) ══ */
.resume-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 9999;

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.2rem;

    background: rgba(24, 24, 24, 0.97);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1rem 1.4rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(229,9,20,0.15);

    max-width: 480px;
    width: calc(100vw - 2rem);

    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
}
.resume-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.resume-banner.hiding {
    transform: translateX(-50%) translateY(130%);
    opacity: 0;
}
.resume-banner-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.resume-banner-body {
    flex: 1;
    min-width: 0;
}
.resume-banner-text {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
    display: block;
    margin-bottom: 0.55rem;
}
.resume-banner-btns {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.resume-banner-btns .btn-primary {
    padding: 0.5rem 1.1rem;
    font-size: 0.82rem;
    border-radius: 50px;
    white-space: nowrap;
}
.resume-skip-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
    padding: 0;
    white-space: nowrap;
}
.resume-skip-btn:hover { color: rgba(255,255,255,0.65); }
.resume-banner-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0 0 0.4rem;
    transition: color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.resume-banner-close:hover { color: rgba(255,255,255,0.7); }
.resume-skip-btn:hover { color: rgba(255,255,255,0.6); }

/* ══════════════════════════════════════════════════
   ONBOARDING — Tooltip dynamique sous chaque cible
   ══════════════════════════════════════════════════ */

@keyframes onboarding-pulse {
    0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.55), 0 0 0 2px rgba(229,9,20,0.45); }
    50%       { box-shadow: 0 0 0 9999px rgba(0,0,0,0.55), 0 0 0 3px rgba(229,9,20,0.9), 0 0 14px rgba(229,9,20,0.25); }
}

@keyframes onboarding-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes arrow-bounce {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(6px); }
}

@keyframes icon-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    65%  { transform: scale(1.15); }
    100% { transform: scale(1);    opacity: 1; }
}

/* Flèche rebondissante */
.onboarding-bounce-arrow {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    animation: arrow-bounce 0.9s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.onboarding-bounce-arrow.visible {
    opacity: 1;
}

/* Carte tooltip — fond blanc cassé */
.onboarding-tooltip {
    position: fixed;
    z-index: 9999;
    width: 300px;
    background: #ede4d0;          /* ivoire chaud, vieux papier */
    border-radius: 16px;
    padding: 1.4rem 1.5rem 1.2rem;
    box-shadow:
        0 3px 0 0 #E50914,           /* liseré rouge en haut */
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateY(8px);
    pointer-events: none;
}
.onboarding-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header : pill étape + icône */
.onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.onboarding-step-pill {
    font-size: 0.65rem;
    font-weight: 700;
    color: #E50914;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.onboarding-icon {
    font-size: 1.25rem;
    animation: icon-pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    display: block;
}

/* Titre */
.onboarding-tooltip h4 {
    font-size: 0.93rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.35rem;
    line-height: 1.35;
    letter-spacing: -0.1px;
}

/* Description */
.onboarding-tooltip p {
    font-size: 0.79rem;
    color: rgba(26, 26, 26, 0.52);
    line-height: 1.6;
    margin: 0;
}

/* Footer : dots + boutons */
.onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.onboarding-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.onboarding-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.35s ease;
}

.onboarding-dot.active {
    width: 18px;
    border-radius: 3px;
    background: #E50914;
}

.onboarding-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.onboarding-skip {
    background: none;
    border: none;
    color: rgba(26, 26, 26, 0.3);
    font-size: 0.72rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    font-family: inherit;
}
.onboarding-skip:hover { color: rgba(26, 26, 26, 0.6); }

.onboarding-next-btn {
    background: #E50914;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.5rem 1.15rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.2px;
    font-family: inherit;
    white-space: nowrap;
}
.onboarding-next-btn:hover {
    background: #c40812;
    transform: translateY(-1px);
}

/* ══ DEEP LINKS STREAMING ══ */
.provider-link {
    display: inline-block;
    border-radius: 7px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}
.provider-link:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.jw-link {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 3px 10px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.jw-link:hover {
    color: white;
    border-color: rgba(255,255,255,0.3);
}

/* ══ MICRO-ANIMATIONS RATING ══ */
@keyframes star-burst {
    0%   { transform: translate(0,0) scale(1);     opacity: 1; }
    70%  { opacity: 0.8; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0.2); opacity: 0; }
}
.star-particle {
    display: block;
    line-height: 1;
    transform-origin: center;
    will-change: transform, opacity;
    user-select: none;
}

@media (max-width: 600px) {
    .history-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

.history-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 2/3;
    cursor: pointer;
    animation: fadeIn 0.4s ease both;
    background: #1c1c1c;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Bouton suppression sur les cartes historique */
.history-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s, color 0.2s;
    z-index: 10;
    line-height: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.history-item:hover .history-item-delete {
    opacity: 1;
    transform: scale(1);
}

.history-item-delete:hover {
    background: rgba(229, 9, 20, 0.85) !important;
    border-color: rgba(229, 9, 20, 0.6);
    color: white !important;
}

.history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.history-item:hover img {
    transform: scale(1.04);
}

/* Gradient permanent fort en bas */
.history-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.96) 0%,
            rgba(0, 0, 0, 0.7) 25%,
            rgba(0, 0, 0, 0.2) 50%,
            transparent 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.9rem 0.8rem;
    pointer-events: none;
}

.history-item-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.history-item-meta {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
}

/* Étoiles intégrées au bas */
.history-item-rating {
    display: flex;
    gap: 2px;
    margin-top: 6px;
}

.history-item-rating .hstar {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.15);
}

.history-item-rating .hstar.on {
    color: #f5c518;
    text-shadow: 0 0 6px rgba(245, 197, 24, 0.4);
}

/* Badge "Vu" sans note */
.history-item-seen {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(70, 211, 105, 0.92);
    border-radius: 100px;
    padding: 3px 10px;
    font-size: 0.62rem;
    font-weight: 800;
    color: #051a0a;
    display: flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(70, 211, 105, 0.3);
}

.history-empty {
    text-align: center;
    padding: 5rem 2rem;
    color: rgba(255, 255, 255, 0.4);
    width: 100%;
}

.history-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: grayscale(1);
    opacity: 0.3;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #a3a3a3 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Hero badge pill ── */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1.4rem;
    text-transform: uppercase;
}

/* Hero h1 : exactement 2 lignes */
#hero h1 {
    font-size: clamp(2.3rem, 4.2vw, 3.6rem);
    line-height: 1.15;
    margin-bottom: 0;
    white-space: nowrap;
    font-weight: 800;
    letter-spacing: -1px;
}

@media (max-width: 600px) {
    #hero h1 {
        font-size: clamp(1.75rem, 7.5vw, 2.2rem);
        white-space: normal;
        word-break: break-word;
        line-height: 1.15;
    }
}

/* "Assis-toi," — ligne intro légère, desktop only */
.hero-title-intro {
    display: inline;
    font-size: 0.72em;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.5px;
    font-style: italic;
}

.hero-title-line1 {
    color: #fff;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* "en 30 secondes" en rouge/coral — bold accent */
.hero-title-red {
    background: linear-gradient(90deg, #e50914 0%, #ff4d4d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    letter-spacing: -0.8px;
}

/* ── Feature badges sous les boutons ── */
.hero-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.82);
    font-weight: 500;
    letter-spacing: 0.2px;
}

.hero-feature-icon {
    font-size: 0.85rem;
    opacity: 1;
}

.hero-feature-sep {
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
}

.subtitle {
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2.2rem;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
    font-weight: 400;
    letter-spacing: 0.1px;
}


/* ══════════════════════════════════════════════════
   HERO — Carousel Tendances (premium)
   ══════════════════════════════════════════════════ */
.trending-section {
    width: 100%;
    margin: 4.5rem 0 0;
    position: relative;
    /* Halo ambiant sous le carousel pour effet "scène" */
    background: radial-gradient(ellipse 80% 120% at 50% 100%, rgba(229, 9, 20, 0.09) 0%, transparent 70%);
    padding-bottom: 3rem;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.trending-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.trending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 2%;
}

.trending-header-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.trending-voir-plus {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: rgba(229,9,20,0.85);
    cursor: pointer;
    transition: color 0.2s;
    text-transform: uppercase;
}
.trending-voir-plus:hover { color: #e50914; }

.trending-title-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trending-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin: 0;
    background: none;
    -webkit-text-fill-color: #fff;
}

.trending-title::before {
    content: '🔥';
    margin-right: 6px;
    font-size: 0.9em;
}

.trending-subtitle-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.38);
    font-weight: 400;
    letter-spacing: 0.15px;
    margin: 0;
    font-style: italic;
}

/* Garder l'ancien .trending-label au cas où */
.trending-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.trending-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #E50914;
    border-radius: 2px;
}

.trending-nav {
    display: flex;
    gap: 8px;
}

.trending-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.trending-nav-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
}

/* Wrapper scroll */
.trending-row-wrap {
    position: relative;
    padding: 0 2%;
    overflow: hidden;
}

.trending-row-wrap::before,
.trending-row-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.trending-row-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color), transparent);
}

.trending-row-wrap::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color), transparent);
}

.trending-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    padding-top: 0.5rem;
    scrollbar-width: none;
    /* scroll-behavior géré en JS uniquement pour que le jump infini soit instantané */
}

.trending-row::-webkit-scrollbar { display: none; }

/* Carte poster */
.trending-poster {
    flex: 0 0 auto;
    width: 155px;
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), z-index 0s;
}

.trending-poster:hover {
    transform: translateY(-10px) scale(1.06);
    z-index: 3;
}

.trending-poster img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    transition: box-shadow 0.3s ease;
}

.trending-poster:hover img {
    box-shadow: 0 20px 50px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.1);
}

/* Titre toujours visible en bas */
.trending-poster-title {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.trending-poster:hover .trending-poster-title {
    color: rgba(255,255,255,0.9);
}

/* Rating badge — toujours visible en bas à gauche */
.trending-poster-overlay {
    position: absolute;
    bottom: 38px;
    left: 7px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 0.66rem;
    font-weight: 700;
    color: #FFD700;
    opacity: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Platform badge — top-left */
.trending-poster-platform {
    position: absolute;
    top: 7px;
    left: 7px;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(6px);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 0.55rem;
    font-weight: 900;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
}

/* Numéro de rang — masqué */
.trending-poster-rank {
    display: none;
}

/* ── Trending mobile ── */
@media (max-width: 600px) {
    .trending-section {
        margin-top: 2.5rem;
        padding-bottom: 1.5rem;
    }

    .trending-header {
        padding: 0;
        margin-bottom: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .trending-header-right {
        display: none;
    }

    .trending-title {
        font-size: 1.15rem;
        font-weight: 900;
        letter-spacing: -0.5px;
        white-space: nowrap;
    }

    .trending-subtitle-label {
        font-size: 0.72rem;
        white-space: normal;
        line-height: 1.35;
        color: rgba(255,255,255,0.35);
    }

    /* Masquer les boutons flèche — l'utilisateur swipe */
    .trending-nav {
        display: none;
    }

    .trending-voir-plus {
        font-size: 0.65rem;
    }

    .trending-row-wrap {
        padding: 0;
    }

    /* Fade edges plus courts */
    .trending-row-wrap::before,
    .trending-row-wrap::after {
        width: 30px;
    }

    .trending-row {
        gap: 10px;
        padding-bottom: 1rem;
        /* Scroll snapping natif sur mobile */
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .trending-poster {
        width: 130px;
        scroll-snap-align: start;
    }
}

/* Questionnaire */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 3rem;
    border-radius: 10px;
    overflow: visible;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #E50914 0%, #ff6b6b 100%);
    width: 0%;
    min-width: 0%;
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.8);
    display: block;
}

.question-container {
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    position: relative;
    text-align: center;
    /* Transition de base pour le fade */
    will-change: opacity, transform;
}

/* ── Transitions question-container ── */
@keyframes q-appear {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* Version mobile : UNIQUEMENT opacity, jamais de transform pendant l'animation
   Sur iOS, les hit-boxes sont calculées avant l'animation → translateY cause des mis-taps */
@keyframes q-appear-mobile {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes q-disappear {
    from { opacity: 1; transform: translateY(0);     }
    to   { opacity: 0; transform: translateY(-6px);  }
}

@keyframes q-disappear-mobile {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Fade out : déclenché avant le changement de contenu */
.question-container.q-exit {
    animation: q-disappear 0.22s ease forwards;
    pointer-events: none;
}

/* Fade in : déclenché après le rechargement du contenu */
.question-container.q-enter {
    animation: q-appear 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sur mobile tactile : animations sans transform pour éviter les mis-taps iOS */
@media (pointer: coarse) {
    .question-container.q-exit {
        animation: q-disappear-mobile 0.18s ease forwards;
    }
    .question-container.q-enter {
        animation: q-appear-mobile 0.28s ease forwards;
    }
    /* Supprimer backdrop-filter du container — décale les coordonnées tactiles */
    .question-container {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: transparent !important;
    }
    /* Supprimer will-change sur mobile — inutile sans animation transform */
    .question-container {
        will-change: auto !important;
    }
}

.question-container h2 {
    font-size: 1.8rem;
    /* Reduced title size */
    margin-bottom: 0.2rem;
    font-weight: 800;
}

.question-container p.muted {
    margin-bottom: 1.5rem;
    /* Reduced margin */
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-back {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

@media (hover: hover) and (pointer: fine) {
    .btn-back:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: white;
        transform: translateX(-3px);
    }
}

.btn-back:active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    margin-top: 1.5rem;
}

@media (max-width: 700px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Supprimé — on garde 2 colonnes sur mobile pour un layout compact et fiable */

.option-card {
    /* Reset bouton natif (on utilise <button> pour la fiabilité tactile iOS) */
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.4rem 1rem;
    cursor: pointer;
    touch-action: manipulation; /* supprime le délai 300ms iOS sur tap */
    /* Transition légère — JAMAIS transform ici pour éviter les mis-taps mobile */
    transition: background 0.12s ease, border-color 0.12s ease,
                box-shadow 0.12s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.7rem;
    position: relative;
    overflow: visible;
    /* backdrop-filter retiré — trop lourd sur mobile, cause des jank et mis-taps */
    /* Pas d'animation individuelle — le container q-enter gère l'entrée globale */
    animation: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    /* Isolation GPU pour compositing propre */
    will-change: background, border-color;
    -webkit-user-select: none;
    /* Minimum touch target Apple HIG = 44pt */
    min-height: 48px;
}

/* Pas de stagger — le container anime globalement, les cartes sont stables */
.option-card:nth-child(1),
.option-card:nth-child(2),
.option-card:nth-child(3),
.option-card:nth-child(4) { animation: none; }

/* Feedback tactile — background flash seulement, JAMAIS de transform sur mobile
   Les transforms déplacent physiquement les hit-boxes et causent des mis-taps */
.option-card:active {
    background: rgba(255, 40, 70, 0.12);
    border-color: rgba(255, 40, 70, 0.4);
}

/* Desktop hover uniquement (garanti pas sur touch grâce à hover:hover + pointer:fine) */
@media (hover: hover) and (pointer: fine) {
    .option-card:hover {
        background: rgba(255, 40, 70, 0.08);
        border-color: rgba(255, 40, 70, 0.6);
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 40, 70, 0.2);
    }
}

.option-card:focus,
.option-card:focus-visible {
    outline: none;
    box-shadow: none;
}

.option-card.selected {
    background: rgba(255, 40, 70, 0.08);
    border-color: rgba(255, 40, 70, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 40, 70, 0.2);
    transform: none;
}

.option-card .icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
    z-index: 1;
    pointer-events: none; /* empêche l'icône de voler le tap */
}

/* Hover icône — desktop only */
@media (hover: hover) and (pointer: fine) {
    .option-card:hover .icon {
        transform: scale(1.15) translateY(-3px);
        transition: transform 0.3s ease;
    }
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 1;
}

.option-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
}

.option-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.3;
    font-weight: 400;
}

.text-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.text-input-group textarea {
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    resize: none;
    transition: var(--transition);
}

.text-input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.1);
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}


.search-group {
    position: relative;
    margin-bottom: 2rem;
}

input[type="text"] {
    width: 100%;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.3);
}

.search-results {
    margin-top: 1rem;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.search-item {
    flex: 0 0 120px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    .search-item:hover {
        transform: scale(1.05);
    }
}

.search-item img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-item:hover img {
    border-color: var(--primary-color);
}

.search-item-info strong {
    font-size: 0.85rem;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.search-item-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background-color: var(--primary-hover);
        transform: scale(1.05);
    }
}

.btn-primary:active {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 2rem;
}

/* ── Reroll hint badge ── */
.reroll-hint-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, rgba(229,9,20,0.08), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    padding: 7px 16px;
    max-width: 320px;
}

.reroll-hint-icon {
    color: #E50914;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.reroll-hint-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.2px;
    line-height: 1.4;
}

/* ── Compteur rerolls restants ── */
.reroll-counter {
    display: inline-block;
    background: rgba(229,9,20,0.18);
    color: #ff6b6b;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 9px;
    margin-left: 6px;
    letter-spacing: 0.2px;
}

/* ── Bouton reroll verrouillé ── */
.btn-reroll-locked {
    opacity: 0.75;
    border-color: rgba(229,9,20,0.4) !important;
    color: rgba(255,255,255,0.7) !important;
}

/* ══════════════════════════════════════════════════
   PAYWALL — Modale rerolls
   ══════════════════════════════════════════════════ */

.paywall-modal {
    background: #fafaf8;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    padding: 0 0 1.75rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0,0,0,0.28);
    animation: scaleIn 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
}

/* Barre d'accroche fine en haut */
.paywall-modal::before {
    content: '';
    display: block;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #E50914 0%, #ff6b35 100%);
    flex-shrink: 0;
}

/* Zone icône + titre */
.paywall-header {
    width: 100%;
    background: transparent;
    padding: 1.6rem 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.paywall-header .auth-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: #aaa;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.paywall-header .auth-close:hover {
    background: rgba(0,0,0,0.1);
    color: #333;
}

.paywall-icon {
    font-size: 2.6rem;
    line-height: 1;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 16px;
    padding: 0.55rem 0.65rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.paywall-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #111;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* Corps */
.paywall-body {
    width: 100%;
    padding: 1.2rem 1.6rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.paywall-sub {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.paywall-perks {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.paywall-perks li {
    font-size: 0.84rem;
    font-weight: 500;
    color: #222;
    padding: 9px 12px 9px 10px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8e6;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.paywall-perks li::before {
    content: '✓';
    color: #16a34a;
    font-weight: 900;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: #dcfce7;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paywall-cta {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 0.97rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.015em;
    box-shadow: 0 4px 14px rgba(229, 9, 20, 0.35);
}
.paywall-cta:hover {
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.45);
    transform: translateY(-1px);
}

.paywall-cta-secondary {
    background: none;
    border: none;
    color: #999;
    padding: 0.3rem 1rem;
    font-size: 0.82rem;
    cursor: pointer;
    width: 100%;
    transition: color 0.15s;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.paywall-cta-secondary:hover { color: #333; }

.paywall-footnote {
    font-size: 0.7rem;
    color: #c0c0bc;
    margin: 0;
}

/* Card actions (trailer button area) */
.card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

.btn-trailer {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #E50914;
    border: none;
    color: #fff;
    padding: 0.45rem 1rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.55);
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: auto;
}

.poster-container:hover .btn-trailer {
    opacity: 1;
    transform: translateY(0);
}

.btn-trailer:hover {
    background: #ff1a24;
    box-shadow: 0 6px 24px rgba(229, 9, 20, 0.75);
    transform: translateY(-2px) scale(1.04);
}

.btn-trailer--disabled {
    background: rgba(229, 9, 20, 0.65);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.btn-trailer--disabled:hover {
    background: rgba(229, 9, 20, 0.85);
}

/* Bouton fallback YouTube (pas de trailer TMDb) */
.btn-trailer-yt {
    background: rgba(0, 0, 0, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: none !important;
    text-decoration: none;
    font-size: 0.72rem !important;
}

.btn-trailer-yt:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
    transform: translateY(-1px) !important;
}


/* Loading */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.trivia-box {
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.trivia-box p#trivia-content {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #fff;
    font-weight: 300;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results */

/* ── Carte mobile : dépliage fluide ── */
.card-details { display: block; }   /* desktop : toujours visible */
.card-expand-btn { display: none; } /* desktop : bouton masqué */

@keyframes cardExpand {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Results Grid */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px) translateZ(0); }
    to   { opacity: 1; transform: translateY(0)    translateZ(0); }
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Stagger d'apparition des cartes films */
.movie-card:nth-child(1) { animation-delay: 0ms;   }
.movie-card:nth-child(2) { animation-delay: 80ms;  }
.movie-card:nth-child(3) { animation-delay: 160ms; }
.movie-card:nth-child(4) { animation-delay: 240ms; }
.movie-card:nth-child(5) { animation-delay: 320ms; }
.movie-card:nth-child(6) { animation-delay: 400ms; }

@media (max-width: 1100px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .movies-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Carte film ── */
.movie-card {
    background: linear-gradient(145deg, #1a1a1a 0%, #111 100%);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    position: relative;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.movie-card:hover {
    transform: translateY(-8px) translateZ(0);
    border-color: rgba(229, 9, 20, 0.3);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(229, 9, 20, 0.1);
}

.poster-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #080808;
    flex-shrink: 0;
    transform: translateZ(0);
}

/* ─────────────────────────────────────────────────────────────
   EFFET CINÉMA — ZONE POSTER UNIQUEMENT
   Structure z-index dans .poster-container :
     0 = .poster-bg       → affiche floutée (fond des bandes noires)
     1 = .poster-glow     → halo de couleur discret au centre
     2 = img              → affiche nette
     3 = ::before         → vignette latérale
     4 = .poster-overlay  → fondu bas vers la carte
───────────────────────────────────────────────────────────── */

/* Affiche floutée en fond — remplit les bandes latérales */
.poster-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    filter: blur(22px) brightness(0.3) saturate(1.3);
    transform: scale(1.05);   /* évite les bords blancs du blur */
    z-index: 0;
    transition: filter 0.4s ease;
}

/* Légère intensification au hover */
@media (hover: hover) {
    .movie-card:hover .poster-bg {
        filter: blur(18px) brightness(0.38) saturate(1.5);
    }
}

/* Halo de chaleur très discret au centre — profondeur cinéma */
.poster-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(
        ellipse 60% 70% at 50% 45%,
        rgba(140, 10, 20, 0.12) 0%,
        transparent              60%
    );
    pointer-events: none;
}

/* Affiche nette au premier plan */
.poster-container img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.movie-card:hover .poster-container img {
    transform: scale(1.03) translateZ(0);
}

.watchlist-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.watchlist-btn:hover {
    transform: scale(1.12);
    background: rgba(229, 9, 20, 0.4);
    border-color: rgba(229, 9, 20, 0.5);
}

.watchlist-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Logos plateformes - supprimés de ce bloc car ils sont dans footer-actions */

.poster-overlay {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, #080808 0%, rgba(8,8,8,0.6) 50%, transparent 100%);
    z-index: 4;
    pointer-events: none;
}

/* Vignette latérale cinématographique — profondeur premium */
.poster-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right,
            rgba(4, 2, 6, 0.92)  0%,
            rgba(4, 2, 6, 0.55)  14%,
            rgba(4, 2, 6, 0.10)  30%,
            transparent          45%,
            transparent          55%,
            rgba(4, 2, 6, 0.10)  70%,
            rgba(4, 2, 6, 0.55)  86%,
            rgba(4, 2, 6, 0.92)  100%
        );
    z-index: 3;
    pointer-events: none;
}

.poster-container img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    z-index: 2;
}

.movie-info {
    padding: 1.2rem 1.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: transparent;
    position: relative;
}

.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.75rem;
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.match-score {
    color: rgba(255, 245, 235, 0.95);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ── Badge Match premium ── */
.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.08);
    border: 1px solid rgba(229, 9, 20, 0.3);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.2px;
    width: fit-content;
    margin-bottom: 10px;
}

/* ── Ligne titre + providers ── */
.title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.title-row h3 {
    margin-bottom: 0;
    flex: 1;
}

.card-providers {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    align-items: center;
    padding-top: 2px;
}

.card-providers img {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
}

/* ── Séparateur meta ── */
.meta-sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
    margin: 0 1px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    opacity: 0.75;
}

.header-top .stream-providers {
    display: flex;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.header-top .stream-providers img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.header-top .stream-providers img:hover {
    transform: scale(1.08);
}

.vod-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 200, 0, 0.12);
    border: 1px solid rgba(255, 200, 0, 0.35);
    color: #ffcc00;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: default;
}

.rating {
    color: #ffcc00;
    font-weight: 700;
    font-size: 0.8rem;
}

.year-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.3px;
}

.movie-header h3 {
    font-size: 1.2rem;
    color: white;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.genres-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 0;
    margin-bottom: 8px;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.actors-row {
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0.7;
    margin-top: 0;
    margin-bottom: 6px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.ai-box::after {
    content: '✦ IA';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 0.6rem;
    font-weight: 900;
    color: var(--primary-color);
    opacity: 0.5;
    letter-spacing: 1px;
}

.ai-reason {
    font-size: 0.95rem;
    color: #fff;
    font-style: italic;
    margin: 0;
    line-height: 1.5;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.certification-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.overview-container {
    flex-grow: 1;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.overview {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #aaa;
    margin: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.overview.expanded {
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
}

.read-more {
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 5px;
    opacity: 0.6;
}

.read-more:hover {
    opacity: 1;
    color: var(--primary-color);
}

.card-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.card-footer .btn-primary {
    width: 100%;
    padding: 0.9rem;
    font-size: 0.9rem;
}

.year {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}


.trailer-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 900;
    z-index: 20;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Modal Corrected */
.trailer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.trailer-modal-content {
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.trailer-modal-content iframe {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.close-trailer {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    opacity: 0.7;
    transition: 0.2s;
}

.close-trailer:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1f1f1f;
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.input-group {
    margin-top: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

.selected-container {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.movie-badge {
    background: var(--primary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.movie-badge span {
    cursor: pointer;
    font-weight: 800;
    opacity: 0.7;
}

.movie-badge span:hover {
    opacity: 1;
}

.muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.glass {
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

.action-area {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 3rem 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 10px 20px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.btn-action {
    background: transparent;
    border: none;
    color: #ccc;
    padding: 0.8rem 1.8rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.15s ease, background 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

@media (hover: hover) and (pointer: fine) {
    .btn-action:hover {
        color: white;
        background: rgba(255, 255, 255, 0.05);
    }
}

.btn-action:active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.btn-action.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

.btn-action.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    color: white;
}

/* Utils */
.btn-primary.full {
    width: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 900px) {
    .movie-card {
        grid-template-columns: 1fr;
    }

    .poster-container {
        height: 350px;
    }

    .movie-info {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
    }

    main {
        padding: 60px 5% 40px;
    }

    .question-container {
        padding: 2rem 1.5rem;
    }

    .question-container h2 {
        font-size: 1.6rem;
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .movies-grid {
        gap: 2rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .action-area {
        width: 100%;
        max-width: 100%;
        flex-direction: row;
        border-radius: 16px;
    }

    .btn-action {
        flex: 1;
        font-size: 0.8rem;
    }

    .btn-action span {
        display: none;
        /* Hide icons on mobile to save space */
    }

    .trailer-modal-content {
        width: 95%;
    }

    .close-trailer {
        top: -45px;
        right: 10px;
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .movie-card {
        border-radius: 8px;
    }

    .btn-primary.full {
        font-size: 0.9rem;
    }
}

/* Lints and Fixes */
h1 {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-item-info strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.glass {
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

/* Status Bar (Origine, Époque, etc.) */
.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 2rem;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-bar span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-bar strong {
    color: white;
    font-weight: 600;
}

/* AI DNA Card - Premium Design */
.ai-profile-bar {
    max-width: 1000px;
    margin: 4rem auto 2rem;
    perspective: 1000px;
}

.ai-profile-card {
    background: rgba(22, 22, 22, 0.7);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 3rem;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: fadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ai-profile-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(229, 9, 20, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.dna-helix {
    font-size: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 4s infinite ease-in-out;
    filter: drop-shadow(0 0 15px rgba(229, 9, 20, 0.4));
}

.profile-header {
    margin-bottom: 1.5rem;
}

.badge-premium {
    background: linear-gradient(90deg, #E50914, #ff4d4d);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.profile-header h2 {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    background: linear-gradient(to right, #fff, #9ca3af) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-align: left !important;
}

.dna-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dna-section label {
    display: block;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.dna-section p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
}

.dna-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.mood-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
}

.mood-tag:hover {
    background: rgba(229, 9, 20, 0.15);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 800px) {
    .ai-profile-card {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 1.5rem;
        text-align: center;
    }

    .dna-helix {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .profile-header h2 {
        font-size: 1.8rem !important;
        text-align: center !important;
    }

    .dna-section p {
        font-size: 1rem;
    }

    .dna-tags {
        justify-content: center;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInDown 0.6s ease-out;
}

/* --- NEW STYLES FOR THE 3+12 FLOW --- */

.section-header {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    margin-top: 4rem !important;
    margin-bottom: 2rem !important;
    text-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
    animation: fadeIn 0.8s ease-out;
}

.movie-card.premium {
    border: 1px solid rgba(229, 9, 20, 0.2);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(229, 9, 20, 0.05);
}

/* ══════════════════════════════════════════════════
   HERO — Boutons côte à côte
   ══════════════════════════════════════════════════ */
.hero-btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Wrapper du bouton principal */
.hero-cta-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    z-index: 2;
}

/* ── Variables communes : même gabarit pour les deux boutons hero ── */
.btn-hero-cta,
.btn-duo-subtle {
    padding: 1rem 2.4rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.28s ease;
    position: relative;
    z-index: 2;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* COMMENCER — rempli rouge */
.btn-hero-cta {
    background: var(--primary-color) !important;
    color: #fff !important;
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
}

.btn-hero-cta:hover {
    transform: translateY(-2px);
    background: #f40a16 !important;
    box-shadow: 0 8px 32px rgba(229, 9, 20, 0.65) !important;
}

/* Mode Duo — ghost blanc, même taille */
.btn-duo-subtle {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0;
}

.btn-duo-subtle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ══════════════════════════════════════════════════
   MODE DUO — Animations & ambiance
   ══════════════════════════════════════════════════ */

@keyframes duo-blob-a {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -50px) scale(1.12);
    }

    66% {
        transform: translate(-25px, 30px) scale(0.93);
    }

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

@keyframes duo-blob-b {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-45px, 25px) scale(0.9);
    }

    66% {
        transform: translate(35px, -35px) scale(1.18);
    }

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

@keyframes duo-ring-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(160, 25, 55, 0), 0 8px 30px rgba(140, 20, 45, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(160, 25, 55, 0.2), 0 8px 30px rgba(160, 25, 55, 0.4);
    }
}

@keyframes duo-icon-float {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

@keyframes duo-name-pop {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.85);
    }

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

@keyframes duo-stagger {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Fond premium quand le mode duo est actif ── */
body.duo-active {
    background-color: #060104;
    background-image:
        /* Halo bordeaux profond en haut à droite */
        radial-gradient(ellipse 65% 55% at 100% 0%, rgba(150, 20, 40, 0.42) 0%, transparent 65%),
        /* Halo lie-de-vin en haut à gauche */
        radial-gradient(ellipse 60% 50% at 0% 0%, rgba(120, 15, 35, 0.28) 0%, transparent 65%),
        /* Lueur rose foncé subtile au centre */
        radial-gradient(ellipse 55% 35% at 50% 50%, rgba(180, 30, 60, 0.06) 0%, transparent 70%),
        /* Halo bordeaux bas */
        radial-gradient(ellipse 80% 40% at 50% 100%, rgba(140, 20, 45, 0.18) 0%, transparent 65%);
    transition: background-color 0.8s ease, background-image 0.8s ease;
}

/* Background blobs */
.duo-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.duo-blob-a,
.duo-blob-b,
.duo-blob-c {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0;
    animation: fadeIn 1.2s ease forwards;
}

/* Blob bordeaux velours — haut gauche */
.duo-blob-a {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(160, 20, 50, 0.55) 0%, rgba(120, 15, 35, 0.22) 50%, transparent 70%);
    top: -190px;
    left: -140px;
    animation: fadeIn 1.2s ease forwards, duo-blob-a 11s ease-in-out 1s infinite;
}

/* Blob lie-de-vin — bas droite */
.duo-blob-b {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(130, 15, 40, 0.45) 0%, rgba(100, 10, 30, 0.18) 50%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation: fadeIn 1.2s ease forwards, duo-blob-b 13s ease-in-out 0.5s infinite;
}

/* Blob rose sombre — centre bas */
.duo-blob-c {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(200, 40, 70, 0.2) 0%, rgba(160, 25, 55, 0.08) 50%, transparent 70%);
    bottom: 20%;
    left: -60px;
    animation: fadeIn 1.4s ease 0.3s forwards, duo-blob-b 16s ease-in-out 2s infinite reverse;
}

/* ══════════════════════════════════════════════════
   MODE DUO — Cartes (share + welcome)
   ══════════════════════════════════════════════════ */

#duo-start.active,
#duo-share.active,
#duo-welcome.active {
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

.duo-card {
    background: rgba(16, 15, 18, 0.97);
    backdrop-filter: blur(48px);
    -webkit-backdrop-filter: blur(48px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 32px;
    padding: 3rem 2.5rem;
    max-width: 560px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 1;
}

/* Animations étagées pour les enfants de la carte */
.duo-card>* {
    animation: duo-stagger 0.5s ease both;
}

.duo-card>*:nth-child(1) {
    animation-delay: 0.06s;
}

.duo-card>*:nth-child(2) {
    animation-delay: 0.14s;
}

.duo-card>*:nth-child(3) {
    animation-delay: 0.22s;
}

.duo-card>*:nth-child(4) {
    animation-delay: 0.30s;
}

.duo-card>*:nth-child(5) {
    animation-delay: 0.38s;
}

.duo-card>*:nth-child(6) {
    animation-delay: 0.46s;
}

.duo-card>*:nth-child(7) {
    animation-delay: 0.54s;
}

.duo-badge-pill {
    background: linear-gradient(135deg, rgba(160, 25, 55, 0.4), rgba(200, 40, 70, 0.15));
    border: 1px solid rgba(220, 80, 100, 0.45);
    color: #f9a8b8;
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 14px rgba(220, 80, 100, 0.5);
}

.duo-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #e0c0c8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.duo-subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Layout QR + actions côte à côte */
.duo-share-layout {
    display: flex;
    gap: 1.4rem;
    width: 100%;
    align-items: flex-start;
}

.duo-share-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.duo-share-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    margin-bottom: 2px;
}

/* Boutons unifiés */
.duo-action-btn {
    width: 100%;
    padding: 11px 16px;
    border-radius: 11px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
}

.duo-action-red {
    background: #E50914;
    color: white;
}
.duo-action-red:hover { background: #c8000f; }

.duo-action-dark {
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
}
.duo-action-dark:hover { background: rgba(255,255,255,0.15); color: white; }

.duo-action-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.13);
    color: rgba(255,255,255,0.5);
}
.duo-action-ghost:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }

.duo-qr-container {
    background: #ffffff;
    border: none;
    border-radius: 18px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 164px;
    height: 164px;
    flex-shrink: 0;
    overflow: hidden;           /* ← empêche tout débordement */
    margin-bottom: 1.4rem;
    animation: duo-ring-pulse 2.5s ease-in-out infinite !important;
    box-shadow: 0 8px 32px rgba(150, 20, 45, 0.28);
    box-sizing: border-box;
}

.duo-qr-container img,
.duo-qr-container canvas {
    border-radius: 4px;
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 140px !important;
    height: 140px !important;
    object-fit: contain;
}

.duo-link-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 0.8rem;
    align-items: stretch;
}

.duo-copy-inline {
    flex-shrink: 0;
    padding: 0 16px;
    background: #E50914;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.2s;
}
.duo-copy-inline:hover { background: #c8000f; }

.duo-link-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.78rem !important;
    padding: 0.75rem 1rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    min-width: 0;
}

.duo-link-row .btn-primary {
    flex-shrink: 0;
    padding: 0.75rem 1.4rem;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.duo-share-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 2rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
    justify-content: center;
    letter-spacing: 0.3px;
}

.btn-share:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.duo-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
    max-width: 380px;
}

/* Séparateur "ou" */
.duo-together-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 1.2rem 0 0.8rem;
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    letter-spacing: 1px;
}
.duo-together-sep::before,
.duo-together-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.18);
}

/* Bouton "remplir ensemble" */
.duo-together-btn {
    width: 100%;
    padding: 13px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.duo-together-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    color: white;
}

/* ── Animation d'attente du partenaire ── */
@keyframes duo-dot-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
    40% { transform: translateY(-6px); opacity: 1; }
}
@keyframes duo-avatar-b-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(160,25,55,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(160,25,55,0); }
}
@keyframes duo-avatar-b-responding {
    0%, 100% { background: rgba(160,25,55,0.2); border-color: rgba(200,50,80,0.5); }
    50% { background: rgba(180,30,60,0.32); border-color: rgba(220,80,100,0.7); }
}

.duo-waiting-anim {
    margin-top: 1.4rem;
    width: 100%;
    text-align: center;
}

.duo-wait-avatars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.duo-wait-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.duo-wait-avatar-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid;
    transition: all 0.4s ease;
}

.duo-wait-avatar-a .duo-wait-avatar-icon {
    background: rgba(70, 211, 105, 0.15);
    border-color: rgba(70, 211, 105, 0.5);
    color: #46d369;
}

.duo-wait-avatar-b .duo-wait-avatar-icon {
    background: rgba(160, 25, 55, 0.12);
    border-color: rgba(200, 50, 80, 0.32);
    animation: duo-avatar-b-pulse 2s ease-in-out infinite;
}

/* Quand B répond activement */
.duo-waiting-anim.b-responding .duo-wait-avatar-b .duo-wait-avatar-icon {
    animation: duo-avatar-b-responding 1.2s ease-in-out infinite;
    font-size: 1rem;
}

/* Quand B a terminé */
.duo-waiting-anim.b-done .duo-wait-avatar-b .duo-wait-avatar-icon {
    background: rgba(70, 211, 105, 0.15);
    border-color: rgba(70, 211, 105, 0.5);
    color: #46d369;
    animation: none;
}

.duo-wait-name {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.duo-wait-connector {
    display: flex;
    gap: 5px;
    align-items: center;
    padding-bottom: 1.2rem; /* align with avatar center visually */
}

.duo-wait-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(200, 50, 80, 0.6);
    animation: duo-dot-bounce 1.4s ease-in-out infinite;
}
.duo-wait-dot:nth-child(2) { animation-delay: 0.2s; }
.duo-wait-dot:nth-child(3) { animation-delay: 0.4s; }

/* Quand B a terminé, les dots deviennent une ligne verte */
.duo-waiting-anim.b-done .duo-wait-dot {
    animation: none;
    background: rgba(70, 211, 105, 0.6);
    opacity: 1;
}

.duo-waiting-text {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    font-style: italic;
    transition: color 0.4s ease;
}

.duo-waiting-anim.b-responding .duo-waiting-text {
    color: rgba(249, 168, 184, 0.9);
    font-style: normal;
    font-weight: 500;
}

.duo-waiting-anim.b-done .duo-waiting-text {
    color: rgba(70, 211, 105, 0.9);
    font-style: normal;
    font-weight: 600;
}

/* Notification partenaire prêt */
.duo-partner-ready {
    margin-top: 1rem;
    padding: 14px 18px;
    background: rgba(70,211,105,0.08);
    border: 1px solid rgba(70,211,105,0.3);
    border-radius: 12px;
    color: #46d369;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: space-between;
}
.duo-partner-ready button {
    background: #46d369;
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

/* Champ prénom */
.duo-name-field {
    width: 100%;
    margin-bottom: 1.5rem;
}

.duo-name-field input[type="text"] {
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 12px !important;
    color: white !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    padding: 0.9rem 1.2rem !important;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.duo-name-field input[type="text"]:focus {
    border-color: rgba(220, 80, 100, 0.7) !important;
    background: rgba(200, 40, 60, 0.1) !important;
    box-shadow: 0 0 20px rgba(180, 30, 55, 0.2) !important;
    outline: none;
}

.duo-name-field input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

/* Welcome screen */
.duo-welcome-card {
    gap: 0;
}

.duo-welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 24px rgba(229, 9, 20, 0.5));
    animation: duo-icon-float 3s ease-in-out infinite !important;
    display: block;
}

/* Grand prénom du partenaire A (écran welcome) */
.duo-partner-name {
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #fff 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: duo-name-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    animation-delay: 0.18s;
}

.duo-partner-waiting {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
}

/* Séparateur stylé */
.duo-divider {
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 10px;
    margin: 0.8rem auto 1.6rem;
}

/* ══ Carte résumé profils duo (page résultats) ══ */
.duo-summary-card {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.07) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(70, 211, 105, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 3rem;
    animation: fadeIn 0.8s ease both;
}

.duo-summary-person {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.duo-summary-person.left {
    text-align: left;
}

.duo-summary-person.right {
    text-align: right;
}

.duo-summary-label {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
    opacity: 1;
}

.duo-summary-label.red {
    color: var(--primary-color);
}

.duo-summary-label.green {
    color: #46d369;
}

.duo-summary-mood {
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.duo-summary-films {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.38);
    font-style: italic;
    margin-top: 0.15rem;
}

.duo-summary-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.duo-summary-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.duo-summary-tonight {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .duo-summary-card {
        /* Reste en 3 colonnes mais tout petit */
        grid-template-columns: 1fr 52px 1fr;
        gap: 0.6rem;
        padding: 1rem 0.9rem;
        border-radius: 16px;
        margin-bottom: 1.8rem;
    }

    .duo-summary-label {
        font-size: 0.82rem;
        letter-spacing: 1px;
        margin-bottom: 0.1rem;
    }

    .duo-summary-mood {
        font-size: 0.88rem;
        font-weight: 700;
    }

    .duo-summary-films {
        font-size: 0.68rem;
    }

    .duo-summary-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .duo-summary-tonight {
        font-size: 0.44rem;
        letter-spacing: 1px;
    }

    .duo-summary-person.right {
        text-align: right;
    }
}

.movie-card.compact {
    transform: scale(0.98);
}

.movie-card.compact .ai-box {
    padding: 0.75rem;
}

.movie-card.compact .ai-reason {
    font-size: 0.85rem;
}

.micro-choice-container {
    margin: 2rem auto;
    width: 100%;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ══════════════════════════════════════════════════
   AUTH — Navbar bouton + menu utilisateur
   ══════════════════════════════════════════════════ */

.btn-auth {
    background: #ffffff !important;
    border-color: transparent !important;
    color: #111 !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
}

.btn-auth:hover {
    background: #f0f0f0 !important;
    border-color: transparent !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3) !important;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 6px 14px 6px 6px;
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E50914, #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown déconnexion au hover */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 10px; /* espace visuel sans casser le hover */
    background: transparent;
    min-width: 170px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
}

.user-dropdown::before {
    content: '';
    display: block;
    position: absolute;
    top: 10px;
    left: 0; right: 0; bottom: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.btn-signout-drop {
    width: 100%;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.55rem 0.9rem;
    margin-top: 4px;
    text-align: left;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.btn-signout-drop:hover {
    background: rgba(229, 9, 20, 0.12);
    color: #ff6b6b;
}

/* ══════════════════════════════════════════════════
   AUTH — Modale
   ══════════════════════════════════════════════════ */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-overlay.visible {
    opacity: 1;
}

.auth-modal {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.auth-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.auth-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #E50914;
    letter-spacing: -0.5px;
    text-align: center;
}

.auth-logo span {
    color: white;
    font-weight: 300;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    border: none;
    border-radius: 12px;
    padding: 0.85rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-google:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.auth-modal form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-modal input[type="email"],
.auth-modal input[type="password"],
.auth-modal input[type="text"],
.auth-modal input[type="date"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
    width: 100%;
    transition: all 0.2s;
    font-family: inherit;
}

/* Champ date de naissance */
.dob-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dob-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.3px;
}

.dob-hint {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.28);
    margin: 0;
    line-height: 1.4;
}

/* Uniformiser le calendrier natif sur tous les navigateurs */
.auth-modal input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.4;
    cursor: pointer;
}

.platform-logo-wrap {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.platform-chip:hover .platform-logo-wrap {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.platform-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.auth-modal input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(229, 9, 20, 0.06);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.auth-modal input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Champ mot de passe avec bouton œil */
.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    width: 100%;
    padding-right: 3rem !important;
}

.toggle-password {
    position: absolute;
    right: 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    user-select: none;
}

.toggle-password:hover {
    opacity: 1;
}

.auth-error {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: rgba(229, 9, 20, 0.08);
}

.hidden {
    display: none !important;
}

/* ── Bouton "J'ai vu ce film" ── */
.seen-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.seen-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
}

.seen-btn.seen {
    color: #46d369;
    border-color: rgba(70, 211, 105, 0.5);
    background: rgba(70, 211, 105, 0.1);
    box-shadow: 0 0 12px rgba(70, 211, 105, 0.15);
}

.seen-btn.seen:hover {
    background: rgba(70, 211, 105, 0.18);
}

.btn-choice {
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-choice:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

#results .status-bar {
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.85rem;
}

#results .status-bar span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#results .status-bar strong {
    color: var(--primary-color);
    margin-left: 4px;
}

.trailer-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(229, 9, 20, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 900;
    z-index: 5;
    letter-spacing: 0.5px;
}

/* Synopsis collapsible */
.synopsis-box {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.synopsis-text {
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 0.4rem 0;
}

/* Synopsis manquant — style discret */
.synopsis-placeholder {
    font-style: italic;
    color: rgba(255,255,255,0.28) !important;
    font-size: 0.78rem !important;
}

.synopsis-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    letter-spacing: 0.3px;
    transition: opacity 0.2s;
}

.synopsis-toggle:hover {
    opacity: 0.8;
}

/* Platform Logos Selection (Premium Dark App Grid) */
.providers-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.2rem;
    justify-items: center;
    max-width: 420px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .providers-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.6rem;
    }
}

.option-card.logo-only {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    height: 75px;
    width: 75px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    /* Pas de transition transform — empêche les chevauchements et mis-taps */
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    touch-action: manipulation;
}

/* Desktop only hover */
@media (hover: hover) and (pointer: fine) {
    .option-card.logo-only:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    }
}

.option-card.logo-only.selected {
    box-shadow: 0 0 0 3px var(--primary-color), 0 10px 30px rgba(229, 9, 20, 0.4);
    border-color: var(--primary-color);
    /* Pas de transform scale — évite le chevauchement entre cartes sur mobile */
}

.option-card.logo-only.selected::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.platform-full-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .option-card.logo-only:hover .platform-full-logo {
        transform: scale(1.02);
    }
}

/* Specific Style for "Peu importe" (Professional Glassmorphism) */
.provider-any-card {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 380px;
    margin: 1.5rem auto 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 60px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.provider-any-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.provider-any-card.selected {
    background: rgba(229, 9, 20, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.2);
}

.provider-any-card .option-info {
    text-align: left;
}

.provider-any-card .option-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.provider-any-card .option-desc {
    font-size: 0.75rem;
    margin: 0;
}

/* ─── MODAL PRÉFÉRENCES STREAMING ─── */
.prefs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.prefs-modal {
    background: #131313;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 22px;
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    /* Flex colonne : header fixe / body scroll / footer fixe */
    display: flex;
    flex-direction: column;
    overflow: hidden;       /* le scroll se fait dans .prefs-body */
    position: relative;
    box-shadow: 0 32px 100px rgba(0,0,0,0.9);
}

/* ── Zone 1 : En-tête (fixe) */
.prefs-header {
    flex-shrink: 0;
    padding: 1.8rem 1.8rem 0;
}

/* ── Zone 2 : Corps (scrollable) */
.prefs-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 1.8rem 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* ── Zone 3 : Pied (fixe) */
.prefs-footer {
    flex-shrink: 0;
    padding: 1rem 1.8rem 1.6rem;
    background: #131313;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-radius: 0 0 22px 22px;
}

/* ══ RACCOURCIS NAVIGATION dans le panel ══ */
.prefs-nav-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1.2rem;
}

.prefs-shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    color: white;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    text-align: left;
    width: 100%;
}

.prefs-shortcut:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.20);
}

.prefs-shortcut:active {
    transform: scale(0.97);
}

.prefs-shortcut-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.prefs-shortcut-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex: 1;
    color: rgba(255,255,255,0.85);
}

.prefs-shortcut-arrow {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    font-weight: 300;
    line-height: 1;
}

/* ── Séparateur de section ── */
.prefs-section-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.prefs-section-divider::before,
.prefs-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.prefs-section-divider span {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    white-space: nowrap;
}

.prefs-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    background: rgba(255,255,255,0.07);
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 9px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

.prefs-close:hover {
    background: rgba(255,255,255,0.14);
    color: white;
}

.prefs-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin: 0 0 1rem;
    letter-spacing: -0.5px;
}

.prefs-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    margin: 0 0 1.2rem;
    line-height: 1.5;
}

/* ── Callout explicatif ── */
.prefs-callout {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 1.2rem;
}

.prefs-callout-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prefs-callout-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.prefs-callout-text {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.6;
}

.prefs-callout strong {
    color: rgba(255,255,255,0.85);
    font-weight: 600;
}

/* ── ONGLETS ── */
.prefs-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1.4rem;
}

.prefs-tab {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: rgba(255,255,255,0.35);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
    letter-spacing: 0.2px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.prefs-tab:hover {
    color: rgba(255,255,255,0.7);
}

.prefs-tab.active {
    color: white;
    border-bottom-color: #E50914;
}

/* ── Panels ── */
.prefs-tab-panel {
    display: none;
}

.prefs-tab-panel.active {
    display: block;
}

/* ── Hint par onglet ── */
.prefs-tab-hint {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.78);
    margin: 0 0 1.5rem;
    line-height: 1.65;
}

.prefs-tab-hint strong {
    color: white;
    font-weight: 700;
}

/* ══ PANNEAU MON PROFIL ══ */
.profil-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 1.2rem 1.3rem;
}

.profil-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 1rem;
}

.profil-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profil-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.profil-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profil-info-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
}

.profil-info-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    text-align: right;
    word-break: break-all;
}

.profil-age-badge {
    background: rgba(229,9,20,0.12);
    border: 1px solid rgba(229,9,20,0.3);
    border-radius: 100px;
    padding: 3px 10px;
    font-size: 0.75rem !important;
    color: rgba(255,255,255,0.8) !important;
}

.profil-pwd-form input[type="password"],
.profil-pwd-form input[type="text"] {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    padding: 0.8rem 3rem 0.8rem 1rem;
    width: 100%;
    font-family: inherit;
    transition: border-color 0.2s;
}

.profil-pwd-form input:focus {
    outline: none;
    border-color: rgba(229,9,20,0.5);
}

/* ── Section labels ── */
.prefs-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    margin-top: 1.6rem;
    margin-bottom: 0.8rem;
}

/* Époque → dégradé rouge → rose */
.prefs-section-label--epoque {
    background: linear-gradient(90deg, #E50914, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pays d'origine → même dégradé que Époque */
.prefs-section-label--origine {
    background: linear-gradient(90deg, #E50914, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}

.platform-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.platform-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.platform-chip input[type=checkbox] {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.platform-chip input[type=checkbox]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4L3.5 6.5L9 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px 8px;
    background-repeat: no-repeat;
    background-position: center;
}

.platform-chip:has(input:checked) {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.4);
}

/* Logo plateforme */
.platform-logo-wrap {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* Fallback coloré si l'image ne charge pas — caché par défaut, activé via onerror */
.platform-logo-fb {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.platform-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    flex: 1;
}

.platform-chip:has(input:checked) .platform-name {
    color: white;
}

/* ══ CHIPS PRÉFÉRENCES PAR DÉFAUT ══ */
.pref-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.6rem;
    margin-bottom: 0.4rem;
}

.pref-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.pref-chip input[type=checkbox] {
    display: none;
}

.pref-chip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 20px;        /* pill shape — plus premium */
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.7);
    font-size: 0.83rem;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1;
}

.pref-chip:hover span {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: white;
}

.pref-chip:has(input:checked) span {
    background: rgba(229, 9, 20, 0.15);
    border-color: rgba(229, 9, 20, 0.6);
    color: #ff6b6b;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.2);
}

/* Variante pour les exclusions sélectionnées */
.pref-chip--exclude:has(input:checked) span {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.5);
    color: #fca5a5;
    font-weight: 600;
}

/* Bouton PERSONNALISATION — même style que les autres boutons nav */

/* ══════════════════════════════════════════════════
   MOBILE RESPONSIVE — v43
   Check complet de toutes les pages
   Ne touche PAS à la version desktop (> 600px)
   ══════════════════════════════════════════════════ */

/* ── Navbar mobile ── */
@media (max-width: 600px) {
    .navbar {
        padding: 14px 4% 10px; /* top 14px = respiration visible */
        overflow: hidden;
    }

    .logo {
        font-size: 1.35rem;
        flex-shrink: 0;
    }

    .nav-actions {
        gap: 4px;
        flex-wrap: nowrap;
        overflow: hidden;
        flex-shrink: 1;
        min-width: 0;
    }

    /* Cache les labels texte, garde seulement l'emoji */
    .btn-config .btn-label {
        display: none;
    }

    .btn-config {
        padding: 7px 12px;
        font-size: 0.88rem;
        letter-spacing: 0;
        min-width: 36px;
        flex-shrink: 0;
        justify-content: center;
        /* Taille minimale tactile */
        min-height: 36px;
    }

    /* User menu : cache le prénom, compact */
    .user-name {
        display: none;
    }

    .user-menu {
        padding: 4px 8px 4px 4px;
        gap: 5px;
        flex-shrink: 0;
    }

    .user-avatar {
        width: 27px;
        height: 27px;
        font-size: 0.65rem;
    }

    /* Switcher langue plus compact */
    .lang-pill-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
    }
}

/* ── Layout principal ── */
@media (max-width: 600px) {
    main {
        padding: 0;
        margin-top: 0;
        min-height: 100vh;
    }

    /* ── Marges latérales : padding sur la section résultat ── */
    #results.active {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }

    /* Grille : prend toute la largeur dispo (le padding est sur #results) */
    .movies-grid {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Historique et watchlist aussi */
    #history-view.active,
    #watchlist-view.active {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }

    #hero.active {
        min-height: 100vh;
        padding-top: 75px;
        padding-bottom: 2rem;
        padding-left: 20px;
        padding-right: 20px;
        justify-content: flex-start;
        align-items: center;
        box-sizing: border-box;
    }

    .hero-content {
        padding: 0;
    }

    #questionnaire.active,
    #loading.active {
        min-height: 100vh;
        padding-top: 80px;
        padding-bottom: 20px;
        justify-content: flex-start;
        align-items: stretch;
    }

    /* Pages scrollables : padding classique */
    #results.active {
        padding-top: 4.5rem;
        padding-bottom: 5rem;
    }

    #history-view.active,
    #watchlist-view.active {
        padding-top: 4rem;
        padding-bottom: 3.5rem;
        margin-top: 3.5rem;
        align-self: flex-start;
    }

    /* Duo plein écran */
    #duo-start.active,
    #duo-share.active,
    #duo-welcome.active {
        min-height: 100vh;
        padding-top: 70px;
        padding-bottom: 20px;
    }
}

/* ── Hero mobile ── */
@media (max-width: 600px) {
    .hero-content {
        padding: 0 16px;
        box-sizing: border-box;
    }

    .greeting-text {
        font-size: 1.25rem;
    }

    .greeting-wave {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.6rem;
        color: rgba(255,255,255,0.42);
    }

    .hero-btns {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 280px;
        margin: 0 auto 0;
        gap: 0.7rem;
    }

    .btn-hero-cta,
    .btn-duo-subtle {
        width: auto;
        min-width: 200px;
        text-align: center;
        justify-content: center;
        padding: 0.8rem 1.8rem;
        font-size: 0.92rem;
    }

    .hero-features {
        gap: 0.4rem;
        margin-top: 0.6rem;
    }

    .hero-feature {
        font-size: 0.72rem;
    }
}

/* ── Résultats mobile ── */
@media (max-width: 600px) {
    #results h2 {
        font-size: 1.7rem;
        letter-spacing: -0.5px;
        margin-bottom: 1.2rem;
        padding: 0 0.5rem;
    }

    .action-area {
        padding: 6px 10px;
        gap: 4px;
    }

    .btn-action {
        padding: 0.65rem 0.9rem;
        font-size: 0.76rem;
        gap: 5px;
    }

    /* Masque le texte des boutons action, garde icônes */
    .btn-action span {
        display: none;
    }

    #results .status-bar {
        gap: 0.5rem;
        padding: 0.8rem 1rem;
        margin-bottom: 1.5rem;
    }

    #results .status-bar span {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }

    /* Cards films en 1 colonne */
    .movies-grid {
        gap: 1.5rem;
    }

    .movie-card {
        border-radius: 16px;
    }

    .poster-container {
        height: 240px;
    }

    .movie-info {
        padding: 1rem 1.1rem 1.2rem;
    }

    .movie-header {
        margin-bottom: 0;
    }

    /* Streaming providers plus petits */
    .header-top .stream-providers img {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    /* Boutons action en pleine largeur */
    .action-area {
        flex-wrap: wrap;
        gap: 6px;
    }

    .btn-action {
        flex: 1;
        min-width: 44px;
        justify-content: center;
    }
}

/* ── Questionnaire mobile ── */
@media (max-width: 600px) {
    .question-container {
        padding: 1.6rem 1.1rem 1.4rem;
        border-radius: 18px;
    }

    .question-container h2 {
        font-size: 1.3rem;
        line-height: 1.25;
        margin-bottom: 0.2rem;
    }

    .question-container p.muted {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .progress-bar {
        margin-bottom: 1.5rem;
    }

    .option-card {
        padding: 0.9rem 0.7rem;
        gap: 0.4rem;
        border-radius: 12px;
    }

    .option-card .icon {
        font-size: 1.4rem;
    }

    .option-label {
        font-size: 0.85rem;
    }

    .option-desc {
        font-size: 0.7rem;
    }

    /* Search multi film */
    .search-item {
        flex: 0 0 90px;
    }

    .search-item img {
        width: 90px;
        height: 135px;
    }

    .text-input-group textarea {
        height: 100px;
        font-size: 1rem;
    }

    .btn-back {
        font-size: 0.75rem;
        padding: 7px 14px;
    }
}

/* ── Mes Films (Historique) mobile ── */
@media (max-width: 600px) {
    #history-view.active,
    #watchlist-view.active {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
        margin-top: 1.5rem;
        align-self: flex-start;
    }

    /* Header en colonne */
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        margin-bottom: 1.2rem;
        padding-bottom: 1rem;
    }

    .history-title {
        font-size: 1.9rem;
        letter-spacing: -1px;
    }

    .history-subtitle {
        font-size: 0.78rem;
    }

    /* Stats block — 2 colonnes compactes */
    .dna-card {
        margin-bottom: 1.8rem;
    }

    .dna-stat {
        padding: 1.2rem 1rem 1rem;
    }

    .dna-stat-value {
        font-size: 1.8rem;
        letter-spacing: -1px;
    }

    .dna-stat-label {
        font-size: 0.52rem;
        letter-spacing: 1.2px;
    }

    .dna-stat-sub {
        font-size: 0.62rem;
    }

    /* Grille films : 3 cols serrées */
    .history-grid {
        gap: 5px;
    }

    .history-item {
        border-radius: 10px;
    }

    .history-item-title {
        font-size: 0.68rem;
    }

    .history-item-meta {
        font-size: 0.58rem;
    }
}

/* ── Mode Duo mobile ── */
@media (max-width: 600px) {
    .duo-card {
        padding: 1.8rem 1.3rem 2rem;
        border-radius: 20px;
        max-width: 100%;
    }

    .duo-badge-pill {
        font-size: 0.68rem;
        padding: 5px 14px;
        margin-bottom: 1.1rem;
    }

    .duo-title {
        font-size: 1.5rem;
        margin-bottom: 0.7rem;
    }

    .duo-subtitle {
        font-size: 0.88rem;
        margin-bottom: 1.2rem;
    }

    .duo-partner-name {
        font-size: 2rem;
        letter-spacing: -1.5px;
    }

    .duo-qr-container {
        width: 130px;
        height: 130px;
        border-radius: 14px;
        padding: 10px;
        margin-bottom: 0.9rem;
    }

    .duo-link-row {
        gap: 0.4rem;
    }

    .duo-link-input {
        font-size: 0.7rem !important;
        padding: 0.65rem 0.8rem !important;
    }

    .duo-copy-inline {
        font-size: 0.75rem;
        padding: 0 11px;
        border-radius: 8px;
    }

    .duo-action-btn {
        font-size: 0.82rem;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .duo-together-sep {
        margin: 0.9rem 0 0.6rem;
    }

    .duo-partner-ready {
        font-size: 0.82rem;
        padding: 11px 14px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .duo-partner-ready button {
        width: 100%;
        padding: 9px 14px;
    }

    /* Résumé duo résultats */
    .duo-summary-card {
        padding: 0.8rem 0.7rem;
        gap: 0.4rem;
    }

    .duo-summary-mood {
        font-size: 0.8rem;
    }

    .duo-summary-label {
        font-size: 0.75rem;
    }
}

/* ── Modal Personnalisation — centré ── */
@media (max-width: 600px) {
    .prefs-overlay {
        padding: 16px;
        align-items: center;
        justify-content: center;
    }

    .prefs-modal {
        border-radius: 20px;
        max-height: 90dvh;
        height: auto;
        padding: 0;          /* géré par prefs-header / prefs-body / prefs-footer */
        width: min(92vw, 420px);
        max-width: 420px;
        overflow: hidden;
    }

    /* Poignée visuelle en haut */
    .prefs-modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.18);
        border-radius: 2px;
        margin: 0 auto 1.2rem;
    }

    .prefs-title {
        font-size: 1.25rem;
    }

    .prefs-subtitle {
        font-size: 0.8rem;
    }

    .prefs-callout {
        padding: 10px 12px;
        margin-bottom: 1rem;
    }

    .prefs-callout-title {
        font-size: 0.8rem;
    }

    .prefs-callout-text {
        font-size: 0.73rem;
    }

    /* Onglets — scrollable sur mobile */
    .prefs-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding-bottom: 1px;
    }

    .prefs-tabs::-webkit-scrollbar { display: none; }

    .prefs-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 0.76rem;
        padding: 10px 12px;
        min-height: 40px;
    }

    /* Grille plateformes : reste 2 colonnes mais chips plus compacts */
    .platforms-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .platform-chip {
        padding: 8px 10px;
        gap: 7px;
        border-radius: 8px;
    }

    .platform-logo-wrap {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .platform-logo {
        width: 34px;
        height: 34px;
    }

    .platform-name {
        font-size: 0.78rem;
    }

    /* Chips préférences */
    .pref-chip span {
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .prefs-section-label {
        font-size: 0.65rem;
        margin-bottom: 0.6rem;
    }

    .prefs-tab-hint {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
}

/* ── Modal Auth — centré sur mobile ── */
@media (max-width: 600px) {
    .auth-overlay {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .auth-modal {
        border-radius: 20px;
        padding: 24px 20px 28px;
        max-width: 400px;
        width: 90%;
        max-height: 90dvh;
        overflow-y: auto;
    }

    .auth-modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.15);
        border-radius: 2px;
        margin: 0 auto 1.2rem;
    }
}

/* ── Très petits écrans ≤ 380px ── */
@media (max-width: 380px) {
    .logo {
        font-size: 1.25rem;
    }

    .btn-config {
        padding: 7px 9px;
    }

    h1 {
        font-size: 2rem !important;
    }

    .question-container {
        padding: 1.3rem 0.9rem 1.2rem;
    }

    .question-container h2 {
        font-size: 1.15rem;
    }

    .history-title {
        font-size: 1.65rem;
    }

    .dna-stat-value {
        font-size: 1.55rem;
    }

    .dna-stat {
        padding: 1rem 0.8rem 0.9rem;
    }

    .duo-card {
        padding: 1.5rem 1rem 1.6rem;
    }

    .duo-title {
        font-size: 1.3rem;
    }

    /* 2 colonnes au lieu de 3 pour la grille films (très petits écrans) */
    .history-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .movies-grid {
        gap: 1rem;
    }
}
/* ═══════════════════════════════════════════════════════════════
   ██████  MOBILE PROFESSIONAL FULL REWRITE — v44
   Priority: 320px–430px (iPhone SE → iPhone 16 Pro)
   Spacing: 8px grid | Touch targets: 48px min | Side padding: 20px
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 440px) {

    /* ─────────────────────────────────────────────
       1. GLOBAL — box model, overflow
    ───────────────────────────────────────────── */
    *, *::before, *::after {
        -webkit-tap-highlight-color: transparent;
    }

    body {
        overflow-x: clip;       /* clip ≠ hidden : ne crée pas de contexte de scroll, laisse les éléments positionnés visibles */
        /* Prévenir le bounce iOS sur les éléments fixes */
        overscroll-behavior: none;
    }

    /* ─────────────────────────────────────────────
       2. NAVBAR — safe-area + respiration verticale
    ───────────────────────────────────────────── */
    .navbar {
        padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 12px !important;
        height: auto !important;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        overflow: visible !important;   /* permet au dropdown de sortir de la navbar */
    }

    .lang-switcher {
        position: relative;
        z-index: 500;           /* au-dessus de tout */
        overflow: visible;
    }

    .lang-dropdown {
        z-index: 501;
        position: absolute;     /* relatif à .lang-switcher */
        top: calc(100% + 6px);
        right: 0;
    }

    .logo {
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    /* Plus d'espace entre les icônes de la navbar */
    .nav-actions {
        gap: 8px;
        overflow: visible;      /* visible pour que le dropdown langue ne soit pas coupé */
        flex-shrink: 1;
    }

    .btn-config {
        padding: 8px 10px;      /* légèrement plus respirant */
        min-height: 36px;
        min-width: 36px;
        border-radius: 10px;
        font-size: 0.85rem;
    }

    .btn-config .btn-label {
        display: none;
    }

    .lang-pill-btn {
        padding: 6px 12px;      /* plus d'espace horizontal */
        font-size: 0.75rem;
        min-height: 36px;
    }

    .user-name { display: none; }
    .user-menu {
        padding: 4px 10px 4px 4px;  /* plus d'air à droite */
        gap: 6px;               /* 4px → 6px */
    }
    .user-avatar {
        width: 28px;            /* légèrement plus grand */
        height: 28px;
        font-size: 0.62rem;
    }

    /* ─────────────────────────────────────────────
       3. MAIN CONTAINER
    ───────────────────────────────────────────── */
    main {
        padding: 0;
        margin-top: 0;
        min-height: 100dvh;
        overflow-x: hidden;
    }

    /* ── Marges latérales : padding sur les sections ── */
    #results.active {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }

    .movies-grid {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #history-view.active,
    #watchlist-view.active {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }

    /* ─────────────────────────────────────────────
       4. HERO
    ───────────────────────────────────────────── */
    #hero.active {
        padding-top: calc(148px + env(safe-area-inset-top, 0px));
        padding-bottom: 56px;
        padding-left: 20px;
        padding-right: 20px;
        align-items: center;
        justify-content: flex-start;
        min-height: 100dvh;
        box-sizing: border-box;
    }

    .hero-content {
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* ── Greeting (logged-in) */
    .hero-greeting {
        margin-bottom: 32px;
        gap: 8px;
    }

    .greeting-wave { font-size: 1.5rem; }

    .greeting-text {
        font-size: 1.05rem;
        font-weight: 400;
        color: rgba(255,255,255,0.72);
    }

    /* ── Badge pill */
    .hero-badge {
        font-size: 0.58rem;
        letter-spacing: 1px;
        padding: 6px 16px;
        margin-bottom: 32px;    /* espace généreux sous le badge */
    }

    /* ── Titre principal */
    #hero h1 {
        font-size: clamp(1.8rem, 8.5vw, 2.3rem) !important;
        white-space: normal !important;
        word-break: break-word;
        line-height: 1.12;
        letter-spacing: -0.8px;
        margin-top: 0;
        margin-bottom: 0;
        padding: 0;
        max-width: 320px;
    }

    /* ── Sous-titre — sobre et élégant */
    .subtitle {
        font-size: 0.88rem;
        line-height: 1.55;
        margin-top: 14px;
        margin-bottom: 24px;
        padding: 0;
        color: rgba(255,255,255,0.45);
        max-width: 280px;
        font-weight: 400;
    }

    /* ── CTA bloc — colonne centrée, boutons compacts ── */
    .hero-btns {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
        max-width: 280px;
        margin: 0 auto 0;
        padding: 0;
    }

    /* Bouton principal — compact, proportions UX */
    .btn-hero-cta {
        width: auto;
        min-width: 200px;
        justify-content: center;
        padding: 12px 32px;
        font-size: 0.95rem;
        font-weight: 800;
        min-height: 46px;
        border-radius: 12px;
        letter-spacing: 0.3px;
    }

    /* Bouton secondaire Duo — plus discret */
    .btn-duo-subtle {
        width: auto;
        min-width: 160px;
        justify-content: center;
        padding: 10px 24px;
        font-size: 0.85rem;
        min-height: 42px;
        border-radius: 12px;
    }

    /* ── Feature badges — une ligne, collée aux boutons */
    .hero-features {
        gap: 5px;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        margin-top: 6px;
        opacity: 0.45;
        white-space: nowrap;
        overflow: hidden;
    }

    .hero-feature {
        font-size: 0.63rem;         /* légèrement réduit pour tenir */
        white-space: nowrap;
        flex-shrink: 0;
    }

    .hero-feature-sep {
        color: rgba(255,255,255,0.15);
        flex-shrink: 0;
    }

    /* ─────────────────────────────────────────────
       5. TRENDING SECTION — forte séparation
    ───────────────────────────────────────────── */
    .trending-section {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-top: 32px;
        padding: 0 0 16px;
        background: none;
        box-sizing: border-box;
    }

    .trending-header {
        padding: 0;
        margin-bottom: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .trending-header-right {
        display: none;
    }

    .trending-title-block {
        gap: 4px;
    }

    .trending-title {
        font-size: 1.15rem;
        font-weight: 900;
        letter-spacing: -0.5px;
        line-height: 1.15;
        white-space: nowrap;
    }

    .trending-subtitle-label {
        font-size: 0.72rem;
        line-height: 1.35;
        white-space: normal;
        color: rgba(255,255,255,0.35);
        font-weight: 400;
        letter-spacing: 0.1px;
    }

    /* Masque les flèches — swipe natif */
    .trending-nav { display: none; }

    .trending-row-wrap {
        padding: 0;
        overflow: hidden;
    }

    .trending-row-wrap::before,
    .trending-row-wrap::after {
        width: 20px;
    }

    .trending-row {
        gap: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
        padding-top: 4px;
    }

    .trending-poster {
        width: 120px;
        scroll-snap-align: start;
        border-radius: 8px;
    }

    /* ─────────────────────────────────────────────
       6. QUESTIONNAIRE — position:fixed pour bloc STABLE (ne bouge plus entre questions)
    ───────────────────────────────────────────── */
    #questionnaire.active {
        position: fixed;
        inset: 0;
        z-index: 50;                          /* sous la navbar (z-index:100) */
        padding-top: calc(120px + env(safe-area-inset-top, 0px));
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 24px);
        padding-left: 16px;
        padding-right: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        align-items: stretch;
        min-height: unset;
        box-sizing: border-box;
        background: transparent;
    }

    .progress-bar {
        margin-bottom: 16px;
        height: 3px;
    }

    .question-container {
        padding: 20px 16px;
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,0.07);
    }

    .question-container h2 {
        font-size: 1.25rem;
        line-height: 1.3;
        font-weight: 800;
        margin-bottom: 4px;
    }

    .question-container p.muted {
        font-size: 0.78rem;
        margin-bottom: 16px;
        line-height: 1.5;
    }

    /* Options : 2 colonnes — gap 14px pour zone morte entre cartes (évite mis-taps) */
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .option-card {
        padding: 18px 12px;
        gap: 6px;
        border-radius: 12px;
        min-height: 90px;
        /* Empêche TOUT transform sur mobile — cause #1 des mis-taps */
        transform: none !important;
    }

    .option-card:active {
        background: rgba(255, 40, 70, 0.15);
        border-color: rgba(255, 40, 70, 0.5);
        transform: none !important;
    }

    .option-card .icon {
        font-size: 1.5rem;
    }

    .option-label {
        font-size: 0.82rem;
        line-height: 1.2;
    }

    .option-desc {
        font-size: 0.64rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Platform logo cards — plus gros touch target sur mobile */
    .option-card.logo-only {
        height: 70px;
        width: 70px;
        transform: none !important;
    }

    .option-card.logo-only.selected {
        transform: none !important;
    }

    .btn-back {
        font-size: 0.72rem;
        padding: 8px 14px;
        min-height: 36px;
        border-radius: 20px;
    }

    /* Watchlist btn — minimum 44px pour iOS touch target */
    .watchlist-btn {
        width: 44px;
        height: 44px;
        top: 10px;
        right: 10px;
    }

    /* ─────────────────────────────────────────────
       7. LOADING SCREEN
    ───────────────────────────────────────────── */
    #loading.active {
        justify-content: center;
        align-items: center;
        padding-top: 0;
        min-height: 100dvh;
    }

    .loader-content {
        text-align: center;
        padding: 24px;
    }

    #loading-text {
        font-size: 0.9rem;
        margin-top: 16px;
        line-height: 1.5;
        color: rgba(255,255,255,0.55);
    }

    /* ─────────────────────────────────────────────
       8. RÉSULTATS
    ───────────────────────────────────────────── */
    #results.active {
        padding-top: calc(120px + env(safe-area-inset-top, 0px));
        padding-bottom: 40px;
        align-items: stretch;
    }

    #results > h2 {
        font-size: 1.4rem !important;
        font-weight: 800;
        letter-spacing: -0.3px;
        margin-bottom: 16px;
        line-height: 1.25;
    }

    /* Action area (reroll, etc.) */
    .action-area {
        padding: 8px 12px;
        gap: 4px;
        flex-wrap: wrap;
        width: 100%;
        box-sizing: border-box;
        border-radius: 14px;
        margin: 16px 0 24px;
    }

    .btn-action {
        padding: 10px 14px;
        font-size: 0.78rem;
        min-height: 44px;
        flex: 1;
        justify-content: center;
    }

    /* Masque le texte des boutons action, garde icônes */
    .btn-action span { display: none; }

    /* Grille films */
    .movies-grid {
        gap: 16px;
        grid-template-columns: 1fr;
    }

    .movie-card {
        border-radius: 16px;
    }

    .poster-container {
        height: 220px;
    }

    .movie-info {
        padding: 16px;
    }

    /* Bouton bande-annonce — compact mais lisible sur mobile */
    .btn-trailer {
        opacity: 1 !important;
        transform: translateY(0) !important;
        min-height: unset !important;   /* annule le 44px de pointer:coarse */
        height: auto !important;
        padding: 0.3rem 0.75rem !important;
        font-size: 0.65rem !important;
        gap: 4px !important;
        bottom: 8px !important;
        left: 8px !important;
        letter-spacing: 0.3px !important;
        font-weight: 700 !important;
        border-radius: 100px !important;
        box-shadow: 0 2px 8px rgba(229,9,20,0.4) !important;
        line-height: 1.3 !important;
    }

    .btn-trailer svg, .btn-trailer .trailer-icon {
        width: 10px !important;
        height: 10px !important;
    }

    .btn-trailer-yt {
        font-size: 0.52rem !important;
        padding: 0.16rem 0.46rem !important;
    }

    /* ── Carte mobile compacte ── */
    .card-details {
        display: none;
        overflow: hidden;
    }

    .movie-card.expanded .card-details {
        display: block;
        animation: cardExpand 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .card-expand-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 100%;
        margin: 10px 0 2px;
        height: 36px;
        background: #000;
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 10px;
        color: #fff;
        font-size: 0.72rem;
        font-weight: 500;
        letter-spacing: 0.3px;
        cursor: pointer;
        touch-action: manipulation;
        transition: border-color 0.15s ease, background 0.15s ease;
    }

    .card-expand-btn:active {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.4);
    }

    .movie-card.expanded .card-expand-btn {
        border-color: rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.6);
    }

    /* ── Hiérarchie carte mobile ── */
    .movie-header {
        gap: 0;
        margin-bottom: 0;
    }

    /* 1. Titre */
    .movie-header h3 {
        font-size: 16px;
        font-weight: 800;
        line-height: 1.2;
        margin-bottom: 0;
        -webkit-line-clamp: 2;
    }

    .title-row {
        margin-bottom: 6px;
    }

    /* 2. Tags */
    .genres-row {
        gap: 4px;
        margin-bottom: 8px;
    }

    .genre-tag {
        font-size: 0.6rem;
        padding: 2px 7px;
    }

    /* 3. Badge match */
    .match-badge {
        font-size: 11px;
        padding: 3px 9px;
        margin-bottom: 10px;
    }

    /* 4. Meta (note • année • durée) */
    .meta-row {
        gap: 4px;
        font-size: 13px;
        margin-bottom: 6px;
    }

    .rating {
        font-size: 13px;
    }

    .year-badge {
        font-size: 13px;
    }

    /* 5. Casting */
    .actors-row {
        font-size: 0.68rem;
        opacity: 0.7;
        margin-bottom: 6px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Box IA */
    .ai-box {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .ai-reason {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    /* Synopsis */
    .overview {
        font-size: 0.82rem;
        line-height: 1.55;
    }

    /* Status bar */
    #results .status-bar {
        padding: 10px 14px;
        gap: 6px;
        flex-wrap: wrap;
        margin-bottom: 16px;
    }

    #results .status-bar span {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    /* Hint "Pas convaincu" */
    .reroll-hint,
    [class*="reroll"] {
        font-size: 0.78rem;
        padding: 0 4px;
        text-align: center;
    }

    /* ─────────────────────────────────────────────
       9. DUO SECTIONS
    ───────────────────────────────────────────── */
    #duo-start.active,
    #duo-share.active,
    #duo-welcome.active {
        padding-top: calc(120px + env(safe-area-inset-top, 0px));
        padding-bottom: 320px;       /* marge basse > marge haute → centre optique haut */
        padding-left: 16px;
        padding-right: 16px;
        min-height: 100dvh;
        box-sizing: border-box;
        justify-content: center;
        align-items: center;
        background: none;
    }

    .duo-card {
        padding: 24px 20px 24px;    /* padding uniforme, bouton reste dedans */
        border-radius: 24px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;           /* empêche tout débordement */
        box-shadow:
            0 20px 40px rgba(0,0,0,0.7),
            0 0 0 1px rgba(255,255,255,0.07),
            inset 0 1px 0 rgba(255,255,255,0.09);
    }

    /* Bouton dans la carte — pleine largeur, pas de débordement */
    .duo-card .duo-action-red,
    .duo-card .btn-primary {
        width: 100%;
        box-sizing: border-box;
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 14px 16px;
        min-height: 48px;
    }

    .duo-badge-pill {
        font-size: 0.62rem;
        padding: 4px 12px;
        margin-bottom: 14px;
    }

    .duo-welcome-icon {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }

    .duo-title {
        font-size: 1.4rem !important;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    .duo-subtitle {
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 18px;
        color: rgba(255,255,255,0.55);
    }

    .duo-name-field input[type="text"] {
        font-size: 0.95rem !important;
        padding: 13px 14px !important;
    }

    /* ── Blobs plus petits sur mobile — lumières réduites */
    .duo-blob-a {
        width: 280px;
        height: 280px;
        top: -80px;
        left: -80px;
    }

    .duo-blob-b {
        width: 240px;
        height: 240px;
        bottom: -60px;
        right: -60px;
    }

    .duo-blob-c {
        width: 200px;
        height: 200px;
    }

    /* Ligne lien + copier — empêche l'overflow */
    .duo-link-row {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
    }

    .duo-link-input {
        min-width: 0;
        flex: 1;
        font-size: 0.72rem;
        padding: 10px 10px;
    }

    .duo-copy-inline {
        flex-shrink: 0;
        padding: 10px 12px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .duo-action-btn {
        padding: 13px 16px;
        font-size: 0.88rem;
        min-height: 48px;
        border-radius: 12px;
    }

    /* QR code réduit légèrement */
    .duo-qr-container {
        width: 144px !important;
        height: 144px !important;
    }

    /* ─────────────────────────────────────────────
       10. HISTORIQUE & WATCHLIST
    ───────────────────────────────────────────── */
    #history-view.active,
    #watchlist-view.active {
        padding-top: 60px;
        padding-bottom: 48px;
        padding-left: 20px;
        padding-right: 20px;
        align-items: stretch;
        align-self: flex-start;
        border-radius: 16px;
        /* Annule le padding 16px de main + 12px de marge propre */
        margin: 72px -4px 20px;
        width: calc(100% + 8px);
        box-sizing: border-box;
        min-height: auto;
    }

    .history-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .history-title {
        font-size: 1.75rem;
        letter-spacing: -0.5px;
    }

    .history-subtitle {
        font-size: 0.75rem;
        margin-top: 2px;
    }

    .history-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .history-item {
        border-radius: 10px;
    }

    .history-item-title {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    /* ─────────────────────────────────────────────
       11. RESUME BANNER
    ───────────────────────────────────────────── */
    .resume-banner {
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateX(0) translateY(110%);
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 20px 20px 28px; /* 28px = safe area bas iOS */
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .resume-banner.visible {
        transform: translateX(0) translateY(0);
    }

    .resume-banner.hiding {
        transform: translateX(0) translateY(110%);
    }

    .resume-banner-close {
        position: absolute;
        top: 14px;
        right: 16px;
    }

    .resume-banner-text {
        font-size: 0.88rem;
        margin-bottom: 10px;
    }

    .resume-banner-btns {
        width: 100%;
        gap: 8px;
    }

    .resume-banner-btns .btn-primary {
        flex: 1;
        justify-content: center;
        min-height: 44px;
        font-size: 0.85rem;
    }

    .resume-skip-btn {
        flex-shrink: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* ─────────────────────────────────────────────
       11b. BOUTONS QUESTIONNAIRE — compact, nowrap
    ───────────────────────────────────────────── */
    .btn-primary {
        padding: 12px 20px;
        font-size: 0.92rem;
        min-height: 46px;
        white-space: nowrap;        /* jamais de retour à la ligne */
        letter-spacing: 0.5px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Bouton CONTINUER du questionnaire — compact et centré */
    #questionnaire .btn-primary {
        padding: 10px 28px !important;
        font-size: 0.82rem !important;
        min-height: 40px !important;
        min-width: 140px !important;
        max-width: 240px !important;
        width: auto !important;
        margin: 0 auto !important;
        border-radius: 10px !important;
        letter-spacing: 0.4px !important;
    }

    .btn-secondary {
        padding: 11px 16px;
        font-size: 0.88rem;
        min-height: 44px;
        white-space: nowrap;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Bouton pleine largeur dans le questionnaire */
    .btn-primary.full,
    #search-next-btn,
    #search-skip-btn {
        width: 100%;
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 12px 16px;
        min-height: 46px;
    }

    /* ─────────────────────────────────────────────
       12. AUTH MODAL — centré verticalement
    ───────────────────────────────────────────── */
    .auth-overlay {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .auth-modal {
        border-radius: 20px;
        padding: 24px 20px 28px;
        width: 90%;
        max-width: 400px;
        max-height: 90dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .auth-modal::before {
        display: none;
    }

    /* ─────────────────────────────────────────────
       13. PRÉFÉRENCES MODAL
    ───────────────────────────────────────────── */
    .prefs-overlay {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .prefs-modal {
        border-radius: 20px;
        padding: 0;          /* géré par prefs-header / prefs-body / prefs-footer */
        max-height: 90dvh;
        overflow: hidden;    /* le scroll est dans .prefs-body */
        width: min(92vw, 420px);
        max-width: 420px;
    }

    .prefs-title {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }

    .prefs-subtitle {
        font-size: 0.82rem;
        margin-bottom: 14px;
    }

    /* ── Tabs : scrollable horizontal, pas de coupure ── */
    .prefs-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;          /* Firefox */
        gap: 4px;
        margin-bottom: 16px;
        padding-bottom: 1px;            /* laisse le border-bottom visible */
        flex-wrap: nowrap;
    }

    .prefs-tabs::-webkit-scrollbar {
        display: none;                  /* Chrome / Safari */
    }

    .prefs-tab {
        flex: 0 0 auto;                 /* ne compresse plus — taille naturelle */
        white-space: nowrap;
        font-size: 0.78rem;
        padding: 10px 14px;
        min-height: 40px;
        border-radius: 8px 8px 0 0;    /* léger arrondi haut pour le premium */
    }

    /* Chips préférences — pill compact sur mobile */
    .pref-chip span {
        padding: 9px 14px;
        font-size: 0.8rem;
        min-height: 38px;
        border-radius: 20px;
    }

    .pref-chips-grid {
        gap: 8px;
    }

    /* Platformes — 2 colonnes sur mobile (lisible) */
    .platforms-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .platform-chip {
        padding: 12px 12px;
        gap: 10px;
        border-radius: 14px;
    }

    .platform-name {
        font-size: 0.82rem;
    }

    /* Sections labels plus espacées sur mobile */
    .prefs-section-label {
        margin-top: 1.8rem;
        margin-bottom: 0.7rem;
        font-size: 0.62rem;
    }

    /* Raccourcis nav — pleine largeur sur très petit écran */
    .prefs-nav-shortcuts {
        gap: 8px;
    }

    .prefs-shortcut {
        padding: 13px 12px;
        border-radius: 12px;
    }

    .prefs-shortcut-label {
        font-size: 0.78rem;
    }

    /* ─────────────────────────────────────────────
       14. ONBOARDING TOOLTIP
    ───────────────────────────────────────────── */
    .onboarding-tooltip {
        max-width: calc(100vw - 32px);
        padding: 16px;
        border-radius: 16px;
        font-size: 0.85rem;
    }

    .onboarding-next-btn {
        padding: 10px 16px;
        font-size: 0.82rem;
        min-height: 40px;
    }

    /* ─────────────────────────────────────────────
       15. TRAILER MODAL
    ───────────────────────────────────────────── */
    .trailer-modal-content {
        width: 100%;
        border-radius: 0;
        max-height: 100dvh;
    }

    .trailer-modal-content iframe {
        height: 56vw; /* ratio 16:9 */
    }

    .close-trailer {
        top: 12px;
        right: 12px;
        font-size: 1.6rem;
    }

}

/* ─────────────────────────────────────────────
   VERY SMALL — iPhone SE (375px) & below
───────────────────────────────────────────── */
@media (max-width: 375px) {

    .logo { font-size: 1.2rem; }

    #hero h1 {
        font-size: 1.75rem !important;
        letter-spacing: -0.3px;
    }

    .duo-title { font-size: 1.35rem !important; }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .option-card {
        padding: 14px 8px;
        min-height: 82px;
        transform: none !important;
    }

    .option-label { font-size: 0.75rem; }

    .history-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .platforms-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .trending-poster { width: 110px; }
}


/* ═══════════════════════════════════════════════════════════════
   BOTTOM SHEET — Auth & Prefs modals
   Approche: overlay fade (opacity) + modal slide-up subtil
   ═══════════════════════════════════════════════════════════════ */

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {

    /* ── Overlay commun — parfaitement centré ── */
    .auth-overlay,
    .prefs-overlay {
        align-items: center !important;
        justify-content: center !important;
        padding: 16px !important;
    }

    /* ─────────── AUTH MODAL ─────────── */
    .auth-modal {
        width: 90% !important;
        max-width: 400px !important;
        border-radius: 20px !important;
        padding: 28px 22px 32px !important;
        max-height: 90dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        animation: none !important;
        box-shadow: 0 16px 48px rgba(0,0,0,0.7) !important;
        margin: auto !important;
    }

    /* Fade-in à l'ouverture */
    .auth-overlay.visible .auth-modal {
        animation: slideUpModal 0.28s cubic-bezier(0.32, 0.72, 0, 1) both !important;
    }

    /* Supprime le drag handle */
    .auth-modal::before {
        display: none !important;
    }

    /* Close btn */
    .auth-close {
        position: absolute !important;
        top: 14px !important;
        right: 16px !important;
    }

    .auth-logo {
        padding-top: 0 !important;
        font-size: 1.3rem !important;
        margin-bottom: 4px !important;
    }

    /* ─────────── PREFS MODAL ─────────── */
    .prefs-modal {
        width: min(92vw, 420px) !important;
        max-width: 420px !important;
        border-radius: 20px !important;
        padding: 0 !important;          /* zones gèrent leur propre padding */
        max-height: 90dvh !important;
        overflow: hidden !important;    /* scroll dans .prefs-body uniquement */
        animation: none !important;
        box-shadow: 0 16px 48px rgba(0,0,0,0.7) !important;
        margin: auto !important;
    }

    /* Fade-in à l'ouverture */
    .prefs-overlay.visible .prefs-modal {
        animation: slideUpModal 0.28s cubic-bezier(0.32, 0.72, 0, 1) both !important;
    }

    /* Supprime le drag handle */
    .prefs-modal::before {
        display: none !important;
    }

    .prefs-close {
        position: absolute !important;
        top: 14px !important;
        right: 16px !important;
    }

    .prefs-title {
        font-size: 1.25rem !important;
        padding-top: 0 !important;
        margin-bottom: 16px !important;
    }

    /* ── Zones flex sur mobile ── */
    .prefs-header {
        padding: 20px 20px 0 !important;
    }

    .prefs-body {
        padding: 0 20px !important;
    }

    .prefs-footer {
        padding: 12px 20px calc(16px + env(safe-area-inset-bottom)) !important;
        border-radius: 0 0 20px 20px !important;
    }

    /* Bouton Enregistrer — prend toute la largeur du footer */
    #prefs-save-btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 15px !important;
        position: static !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   GLOBAL MOBILE TOUCH SAFETY NET
   Appliqué en dernier pour garantir la fiabilité tactile
   ═══════════════════════════════════════════════════════════════ */
@media (pointer: coarse) {
    /* Tous les éléments interactifs : minimum 44px, pas de transform hover */
    button, [role="button"], .option-card, .btn-action, .btn-primary,
    .btn-back, .platform-chip, .prefs-tab, .provider-any-card,
    .watchlist-btn, .auth-close, .prefs-close {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Aucun transform ne doit bouger les hit-boxes sur tactile */
    .option-card,
    .option-card:active,
    .option-card.selected,
    .option-card.logo-only,
    .option-card.logo-only.selected,
    .option-card.logo-only:active {
        transform: none !important;
    }

    /* Désactiver backdrop-filter sur mobile — killer de performance */
    .option-card,
    .question-container {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

