/* --- CONFIGURATION GLOBALE & AMBIANCE NETFLIX --- */

:root {
    --bg-color: #0b0b0f;
    --netflix-red: var(--accent);
    --netflix-red-glow: rgba(var(--accent-rgb), 0.35);
    --glass-bg: rgba(20, 20, 25, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-light: rgba(255, 255, 255, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    padding-bottom: 110px; /* Espace pour ne pas cacher le contenu sous la nav-bar fixe */
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

/* --- GESTION DES SECTIONS (Pages) --- */

.page-section {
    display: none; /* Caché par défaut */
    animation: fadeIn 0.3s ease-in-out;
}

.page-section.active {
    display: block; /* Affiché si actif */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: #e0e0e0;
}

/* --- SECTION DÉCOUVRIR & RECHERCHE --- */

.discover-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.media-type-switch {
    display: flex;
    gap: 8px;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    width: fit-content;
}

.switch-btn {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.switch-btn.active {
    background: var(--netflix-red);
    color: #fff;
    box-shadow: 0 2px 10px var(--netflix-red-glow);
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 600px;
}

.search-box input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-light);
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--netflix-red);
    box-shadow: 0 0 15px var(--netflix-red-glow);
}

.search-box button {
    background: var(--netflix-red);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: auto;
    height: auto;
}

.search-box button:active {
    transform: scale(0.96);
}

/* --- GRILLE DES RÉSULTATS DE RECHERCHE --- */

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

/* --- STYLE DES LIGNES DE CATÉGORIES (Défilement horizontal) --- */

.category-row {
    margin-bottom: 25px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.see-all-btn {
    background: transparent;
    border: none;
    color: var(--netflix-red);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.see-all-btn:hover {
    opacity: 0.8;
}

/* Grille de défilement horizontal style Netflix */

.horizontal-scroll-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), 0.5) transparent;
}

.horizontal-scroll-grid::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll-grid::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.5);
    border-radius: 999rem;
}

/* --- CARTE INDIVIDUELLE (Film / Série) --- */

.media-card {
    flex: 0 0 140px;
    width: 140px;
    min-width: 140px;
    background: var(--glass-bg);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    position: relative;
    border: 2px solid transparent; 
    transition: border-color 0.2s ease;
}

@media (min-width: 768px) {
    .media-card {
        flex: 0 0 170px;
        width: 170px;
        min-width: 170px;
    }
}

.media-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border: 2px solid var(--netflix-red, var(--accent));
}

.media-card img {
    width: 100% !important;
    height: 210px !important;
    min-height: 210px !important;
    max-height: 210px !important;
    object-fit: cover !important;
    background: rgba(0, 0, 0, 0.2);
    display: block;
}

.media-card img[src$=".svg"] {
    object-fit: contain !important;
    padding: 35px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    box-sizing: border-box !important;
}

.media-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.media-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.btn-add {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 6px;
    padding: 6px 0;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, border-color 0.2s;
}

.btn-add:hover {
    background: var(--netflix-red);
    border-color: var(--netflix-red);
}

.empty-msg {
    color: #777;
    font-style: italic;
    font-size: 0.9rem;
}

/* --- BARRE DE NAVIGATION EN PILULE (Bas de page) --- */

.menu {
    position: fixed;
    left: 50%;
    bottom: 15px;
    bottom: calc(15px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: 92%;
    max-width: 440px;
    background: rgba(18, 18, 22, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(var(--accent-rgb), 0.15);
    padding: 6px;
    border-radius: 99rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 1000;
}

.menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    height: 48px;
    width: 100%;
    border-radius: 999rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    padding: 0 4px;
    gap: 3px;
}

.menu a img {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    object-fit: contain !important;
    display: block;
}

.menu a span {
    font-size: 0.52rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.menu a.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.85), rgba(var(--accent-dark-rgb, 120, 5, 10), 0.9));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.4);
}

.menu a.active img {
    filter: brightness(0) invert(1);
}

.menu a:not(.active):hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
}

.menu a:active {
    transform: scale(0.92);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    width: 100%;
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: #fff;
}

/* Dégradés fluides */

body::before, 
body::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 70px; 
    z-index: 999;
    pointer-events: none;
}

body::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.25), transparent);
}

body::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(var(--accent-rgb), 0.25), transparent);
}

/* --- MODALE --- */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-content {
    background-color: #141414;
    width: 100%;
    max-width: 900px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    color: #fff;
    margin: 40px auto;
    border: 1px solid #333;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--accent);
}

.modal-header-banner {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.modal-header-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #141414 10%, rgba(20,20,20,0.4) 60%, rgba(20,20,20,0.8) 100%);
}

.modal-header-info {
    position: relative;
    padding: 30px 40px;
    z-index: 2;
    width: 100%;
}

.modal-header-info h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.modal-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #b3b3b3;
    margin-bottom: 10px;
    align-items: center;
}

.rating-badge {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.modal-body {
    padding: 30px 40px;
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--accent);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.action-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.action-btn:hover {
    background: #444;
}

.action-btn.active {
    background: var(--accent);
}

.cast-horizontal-scroll, .trailer-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* --- 1. BOUTON 1 : VU / PAS VU (Switch Uiverse) --- */

.radio-input {
    position: relative;
    display: flex;
    background-color: #1a1a1a;
    border-radius: 9999px;
    padding: 4px;
    width: fit-content;
    margin: 10px 0;
    border: 2px solid #333;
}

.radio-input label {
    flex: 1;
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    padding: 8px 20px;
}

.radio-input label input {
    display: none;
}

.radio-title {
    font-size: 14px;
    font-weight: 600;
    color: #aaa;
    transition: color 0.3s ease;
}

.radio-input input:checked + .radio-title {
    color: #fff;
}

.radio-input .selector {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: 50%;
    background-color: var(--accent);
    border-radius: 9999px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
}

#switch-tv:checked ~ .selector {
    transform: translateX(100%);
}

/* --- 3. BOUTON 3 : FAVORIS (Icône Cœur Uiverse isolée) --- */

.btn-favorite {
    display: block;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.btn-favorite input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.btn-favorite svg {
    position: relative;
    top: 0;
    left: 0;
    height: 40px;
    width: 40px;
    transition: all 0.3s;
    fill: #666;
}

.btn-favorite svg:hover {
    transform: scale(1.1);
}

.btn-favorite input:checked ~ svg {
    fill: #E3474F;
}

/* --- 2. BOUTON 2 : AJOUTER À LA LISTE (Bouton Animé Vert Uiverse isolé) --- */

.btn-watchlist {
    width: 160px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    background: #00a600;
    border: none;
    border-radius: 5px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    transition: 200ms;
}

.btn-watchlist,
.btn-watchlist span {
    transition: 200ms;
}

.btn-watchlist .text {
    transform: translateX(25px);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.btn-watchlist .icon {
    position: absolute;
    border-left: 1px solid #007300;
    transform: translateX(115px);
    height: 45px;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-watchlist svg {
    width: 15px;
    fill: #eee;
}

.btn-watchlist:hover {
    background: #00a600;
}

.btn-watchlist:active {
    background: #00cc00;
}

.btn-watchlist:hover .text {
    color: transparent;
}

.btn-watchlist:hover .icon {
    width: 160px;
    border-left: none;
    transform: translateX(0);
}

.btn-watchlist:focus {
    outline: none;
}

.btn-watchlist:active .icon svg {
    transform: scale(0.8);
}

/* --- PAGE PROFIL --- */

.profile-header {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-banner {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.banner-gradient {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 40%, var(--bg-color));
}

.profile-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -45px;
    position: relative;
    z-index: 2;
}

.avatar-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 10px;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--netflix-red);
    object-fit: cover;
    background: #1a1a1a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-names h1 {
    font-size: 1.4rem;
    margin: 0 0 4px 0;
    color: #fff;
}

.username {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 0 5px;
}

/* Blocs de stats */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
}

.stat-icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 10px;
}

.stat-details h3 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: #bbb;
}

.stat-main, .stat-time {
    margin: 2px 0;
    font-size: 0.9rem;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-filter-switch {
    display: flex;
    gap: 5px;
    background: var(--glass-bg);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.filter-btn {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.filter-btn.active {
    background: var(--netflix-red);
    color: #fff;
}

/* Classement des genres */

.genre-ranking {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.genre-bar-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.genre-name {
    width: 140px;
    font-size: 0.85rem;
    color: #ddd;
}

.genre-bar-bg {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.genre-bar-fill {
    height: 100%;
    background: var(--netflix-red);
    border-radius: 4px;
}

.genre-percent {
    font-size: 0.85rem;
    color: #aaa;
    width: 35px;
    text-align: right;
}

/* Carrousel des Listes Personnalisées */

.custom-lists-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

.custom-list-card {
    flex: 0 0 200px;
    height: 110px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.custom-list-card:hover {
    transform: scale(1.03);
    border-color: var(--netflix-red);
}

.list-card-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6);
}

.list-card-overlay {
    position: relative;
    z-index: 2;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.list-card-overlay h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
}

.list-card-overlay span {
    font-size: 0.75rem;
    color: #aaa;
}

/* --- BOUTON PARAMÈTRES SUR LA BANNIÈRE --- */

.settings-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background 0.2s, border-color 0.2s;
    z-index: 3;
}

.settings-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--netflix-red);
}

/* --- BIO DU PROFIL --- */

.user-bio {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 8px 0 0 0;
    max-width: 400px;
    line-height: 1.4;
}

/* --- PAGE PARAMÈTRES / FORMULAIRE --- */

.settings-page-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 0;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.settings-header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: #fff;
}

.settings-form-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: #ccc;
    font-weight: 500;
}

.form-group input, 
.form-group textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: var(--netflix-red);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.save-btn {
    background: var(--netflix-red);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
    margin-top: 10px;
}

.save-btn:hover {
    opacity: 0.9;
}

/* --- GRILLE DES NOTES PAR ÉPISODE --- */

.episodes-rating-section {
    margin-top: 25px;
    background: rgba(20, 20, 25, 0.75);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.rating-sources-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.source-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #aaa;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.source-tab-btn.active {
    background: var(--netflix-red);
    color: #fff;
    border-color: var(--netflix-red);
}

.rating-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.episodes-grid-wrapper {
    overflow-x: auto;
    max-height: 350px;
    overflow-y: auto;
}

.episodes-matrix {
    display: grid;
    gap: 6px;
}

.episode-cell {
    background: #1a1a22;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 6px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.2s;
    min-width: 50px;
}

.episode-cell:hover {
    border-color: var(--netflix-red);
    transform: scale(1.05);
}

.episode-cell .ep-score {
    font-weight: bold;
    font-size: 0.85rem;
}

.episode-cell .ep-votes {
    font-size: 0.65rem;
    color: #888;
}

/* Sous-modale Épisode & Commentaires */

.episode-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10005;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.episode-modal-overlay.active {
    display: flex;
}

.episode-modal-content {
    background: #141418;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.episode-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.comments-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 8px;
}

.comment-author {
    font-weight: bold;
    font-size: 0.85rem;
    color: var(--netflix-red);
    margin-bottom: 4px;
}

.comment-text {
    font-size: 0.85rem;
    color: #ddd;
}

/* Uiverse Toggle Switch (Checkbox Wrapper 8) */

.checkbox-wrapper-8 .tgl {
  display: none;
}

.checkbox-wrapper-8 .tgl,
.checkbox-wrapper-8 .tgl:after,
.checkbox-wrapper-8 .tgl:before,
.checkbox-wrapper-8 .tgl *,
.checkbox-wrapper-8 .tgl *:after,
.checkbox-wrapper-8 .tgl *:before,
.checkbox-wrapper-8 .tgl + .tgl-btn {
  box-sizing: border-box;
}

.checkbox-wrapper-8 .tgl::-moz-selection,
.checkbox-wrapper-8 .tgl:after::-moz-selection,
.checkbox-wrapper-8 .tgl:before::-moz-selection,
.checkbox-wrapper-8 .tgl *::-moz-selection,
.checkbox-wrapper-8 .tgl *:after::-moz-selection,
.checkbox-wrapper-8 .tgl *:before::-moz-selection,
.checkbox-wrapper-8 .tgl + .tgl-btn::-moz-selection,
.checkbox-wrapper-8 .tgl::selection,
.checkbox-wrapper-8 .tgl:after::selection,
.checkbox-wrapper-8 .tgl:before::selection,
.checkbox-wrapper-8 .tgl *::selection,
.checkbox-wrapper-8 .tgl *:after::selection,
.checkbox-wrapper-8 .tgl *:before::selection,
.checkbox-wrapper-8 .tgl + .tgl-btn::selection {
  background: none;
}

.checkbox-wrapper-8 .tgl + .tgl-btn {
  outline: 0;
  display: block;
  width: 4em;
  height: 2em;
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.checkbox-wrapper-8 .tgl + .tgl-btn:after,
.checkbox-wrapper-8 .tgl + .tgl-btn:before {
  position: relative;
  display: block;
  content: "";
  width: 50%;
  height: 100%;
}

.checkbox-wrapper-8 .tgl + .tgl-btn:after {
  left: 0;
}

.checkbox-wrapper-8 .tgl + .tgl-btn:before {
  display: none;
}

.checkbox-wrapper-8 .tgl:checked + .tgl-btn:after {
  left: 50%;
}

.checkbox-wrapper-8 .tgl-skewed + .tgl-btn {
  overflow: hidden;
  transform: skew(-10deg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: all 0.2s ease;
  font-family: sans-serif;
  background: #888;
}

.checkbox-wrapper-8 .tgl-skewed + .tgl-btn:after,
.checkbox-wrapper-8 .tgl-skewed + .tgl-btn:before {
  transform: skew(10deg);
  display: inline-block;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
  position: absolute;
  line-height: 2em;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.checkbox-wrapper-8 .tgl-skewed + .tgl-btn:after {
  left: 100%;
  content: attr(data-tg-on);
}

.checkbox-wrapper-8 .tgl-skewed + .tgl-btn:before {
  left: 0;
  content: attr(data-tg-off);
}

.checkbox-wrapper-8 .tgl-skewed + .tgl-btn:active {
  background: #888;
}

.checkbox-wrapper-8 .tgl-skewed + .tgl-btn:active:before {
  left: -10%;
}

.checkbox-wrapper-8 .tgl-skewed:checked + .tgl-btn {
  background: #86d993;
}

.checkbox-wrapper-8 .tgl-skewed:checked + .tgl-btn:before {
  left: -100%;
}

.checkbox-wrapper-8 .tgl-skewed:checked + .tgl-btn:after {
  left: 0;
}

.checkbox-wrapper-8 .tgl-skewed:checked + .tgl-btn:active:after {
  left: 10%;
}

/* --- RESPONSIVE GRILLES --- */

@media (max-width: 768px) {
    .horizontal-scroll-grid .media-card:nth-child(n+6) {
        display: none;
    }

    .horizontal-scroll-grid.expanded {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        overflow-x: visible;
    }
    
    .horizontal-scroll-grid.expanded .media-card:nth-child(n+6) {
        display: block;
    }
}

@media (min-width: 769px) {
    .horizontal-scroll-grid {
        display: flex;
        overflow-x: auto;
    }
}

/* =========================================================
   AJOUTS : fonctionnalités reliées au JS
   ========================================================= */

/* --- Affiche manquante / texte additionnel sur les cartes --- */

.poster-fallback {
    width: 100%;
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: rgba(0, 0, 0, 0.4);
}

.media-extra {
    font-size: 0.7rem;
    color: #f0c14b;
    margin-bottom: 6px;
    line-height: 1.3;
}

.btn-add.added {
    background: rgba(40, 167, 69, 0.25);
    border-color: rgba(40, 167, 69, 0.6);
}

/* --- Page "Tout voir" --- */

.full-list-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.full-list-header h1 {
    font-size: 1.4rem;
    margin: 0;
    flex: 1;
}

.back-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-light);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.back-btn:hover {
    border-color: var(--netflix-red);
}

.back-btn.danger:hover {
    background: var(--netflix-red);
}

/* --- Boutons de la fiche détail --- */

.modal-actions {
    gap: 10px;
}

.m-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.m-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.m-btn.is-green {
    background: #28a745;
    border-color: #28a745;
}

.m-btn.is-red {
    background: var(--netflix-red);
    border-color: var(--netflix-red);
}

.m-btn-icon {
    padding: 8px 12px;
    font-size: 1rem;
}

/* --- Note TMDB dans l'en-tête de la fiche --- */

.rating-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.rating-source-tag {
    background: #01b4e4;
    color: #fff;
    font-weight: bold;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
}

.rating-source small {
    color: #ddd;
    font-size: 0.75rem;
}

/* --- Mon avis & note --- */

.rating-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #ccc;
}

.rating-input-group input,
.personal-notes textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border-light);
    border-radius: 8px;
    color: #fff;
    padding: 8px 10px;
    font-size: 0.9rem;
    outline: none;
}

.rating-input-group input {
    width: 80px;
}

.personal-notes textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.rating-input-group input:focus,
.personal-notes textarea:focus {
    border-color: var(--netflix-red);
}

.personal-notes .save-btn {
    width: 100%;
}

/* --- Où regarder / casting --- */

.provider-item {
    display: inline-block;
    margin-right: 10px;
    text-align: center;
}

.provider-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.provider-item p {
    font-size: 10px;
    margin: 2px 0 0;
}

.cast-item {
    min-width: 100px;
    text-align: center;
}

.cast-item img,
.cast-fallback {
    width: 85px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.cast-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.8rem;
    margin: 0 auto;
}

.cast-name {
    font-size: 12px;
    margin: 5px 0 0;
    font-weight: bold;
}

.cast-role {
    font-size: 10px;
    color: #aaa;
    margin: 2px 0 0;
}

.genre-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 99rem;
    font-size: 0.75rem;
    margin: 0 6px 6px 0;
}

.empty-text {
    color: #888;
    font-size: 0.9rem;
}

/* --- Popup des épisodes --- */

.ep-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(5px);
}

.ep-popup-box {
    background: #141414;
    width: 92%;
    max-width: 650px;
    max-height: 85vh;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.ep-popup-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ep-popup-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.picker-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

.picker-close:hover {
    background: var(--netflix-red);
}

.ep-tabs {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.ep-tab-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.ep-tab-btn.active {
    background: var(--netflix-red);
}

.ep-hint {
    padding: 10px 20px 0;
    font-size: 0.7rem;
    color: #aaa;
}

.ep-popup-content {
    padding: 20px;
    overflow: auto;
    flex: 1;
}

.ep-loading {
    color: #aaa;
    text-align: center;
}

.ep-loading.error {
    color: #ff4d4d;
}

.ep-seasons {
    display: flex;
    gap: 14px;
    padding-bottom: 10px;
    width: max-content;
}

.ep-season-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 48px;
    align-items: center;
}

.ep-season-label {
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.ep-cell {
    width: 48px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
}

.ep-cell.watched {
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.ep-cell.unaired {
    opacity: 0.35;
    cursor: not-allowed;
}

.ep-cell.empty {
    border: none;
    cursor: default;
}

/* --- Fenêtre "Ajouter à une liste" --- */

.picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    backdrop-filter: blur(5px);
}

.picker-box {
    background: #141414;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 20px;
}

.picker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.picker-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.picker-row span {
    flex: 1;
}

.picker-row small {
    color: #888;
}

.picker-row input {
    accent-color: var(--netflix-red);
    width: 18px;
    height: 18px;
}

.picker-new {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.picker-new input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border-light);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    outline: none;
}

.picker-new input:focus {
    border-color: var(--netflix-red);
}

.picker-new .save-btn {
    margin-top: 0;
    padding: 10px 16px;
    font-size: 0.9rem;
}

/* --- Carte "Nouvelle liste" --- */

.new-list-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.25);
    color: #ccc;
    font-size: 0.85rem;
}

.new-list-plus {
    font-size: 1.6rem;
    line-height: 1;
}

/* --- Calendrier --- */

.calendar-container {
    margin-top: 15px;
    max-width: 700px;
}

.calendar-day h2 {
    font-size: 1rem;
    margin: 22px 0 10px;
    color: #fff;
    border-left: 3px solid var(--netflix-red);
    padding-left: 10px;
}

.calendar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.calendar-item:hover {
    border-color: var(--netflix-red);
}

.calendar-item img,
.calendar-poster-fallback {
    width: 56px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.calendar-poster-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    font-size: 1.5rem;
}

.calendar-item-info h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.calendar-item-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #aaa;
}

/* --- Notification (toast) --- */

#toast {
    position: fixed;
    left: 50%;
    bottom: calc(95px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 36, 0.95);
    border: 1px solid var(--glass-border-light);
    color: #fff;
    padding: 10px 18px;
    border-radius: 99rem;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 200000;
    max-width: 90%;
    text-align: center;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* =========================================================
   V3 : coches "vu", fiche série à onglets, statuts, saisons
   ========================================================= */

/* --- Coche "vu" sur les cartes --- */

.poster-wrap {
    position: relative;
}

.card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.55);
    color: transparent;
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    backdrop-filter: blur(4px);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.card-check:hover {
    border-color: #2ecc71;
}

.card-check:active {
    transform: scale(0.88);
}

.card-check.on {
    background: #2ecc71;
    border-color: #2ecc71;
    color: #fff;
}

.check-badge {
    position: absolute;
    top: 44px;
    right: 8px;
    min-width: 30px;
    text-align: center;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 99rem;
    padding: 2px 6px;
}

.media-card .poster-wrap img {
    width: 100% !important;
    height: 210px !important;
}

.card-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
}

.card-progress-fill {
    height: 100%;
    border-radius: 0 2px 2px 0;
}

.media-card.stopped .poster-wrap img {
    filter: grayscale(0.7) brightness(0.8);
}

/* --- Compteur de visionnages --- */

.view-counter {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
    font-weight: bold;
    font-size: 0.85rem;
}

.view-counter button {
    background: transparent;
    border: none;
    color: #fff;
    width: 32px;
    height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
}

.view-counter button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.view-counter span {
    padding: 0 6px;
    min-width: 34px;
    text-align: center;
}

/* --- Onglets de la fiche --- */

.modal-tabs {
    display: flex;
    gap: 4px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.modal-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 10px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.modal-tab.active {
    background: var(--netflix-red);
    color: #fff;
}

/* --- Carte de statut (À propos) --- */

.status-card {
    background: #1c1c1e;
    border-radius: 18px;
    padding: 16px 18px;
    margin-bottom: 25px;
}

.status-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-label {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
}

.status-count {
    color: #8e8e93;
    font-size: 1.05rem;
}

.status-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99rem;
    overflow: hidden;
    margin: 12px 0;
}

.status-bar-fill {
    height: 100%;
    border-radius: 99rem;
    transition: width 0.3s ease;
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.72rem;
    color: #aaa;
    margin-bottom: 12px;
}

.status-hint {
    color: #8e8e93;
    font-size: 0.85rem;
    margin: 10px 0 0;
}

/* --- Onglet Épisodes --- */

.ep-matrix-wrap {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 2px 12px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), 0.5) transparent;
}

.ep-cell.next {
    outline: 2px solid #f5b50a;
    outline-offset: 1px;
}

/* --- Liste des saisons (façon capture) --- */

.season-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.season-card {
    background: #1c1c1e;
    border-radius: 16px;
    padding: 14px 16px 16px;
}

.season-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.season-text h4 {
    margin: 0 0 3px;
    font-size: 1.05rem;
}

.season-text small {
    color: #8e8e93;
    font-size: 0.8rem;
}

.season-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99rem;
    overflow: hidden;
    margin-top: 12px;
}

.season-bar-fill {
    height: 100%;
    border-radius: 99rem;
    transition: width 0.3s ease;
}

.round-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #8e8e93;
    background: transparent;
    color: transparent;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.round-check.big {
    width: 32px;
    height: 32px;
}

.round-check.on {
    background: rgba(46, 204, 113, 0.18);
    border-color: #2ecc71;
    color: #2ecc71;
}

.round-check:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.season-eps {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.season-ep {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.season-ep.unaired {
    opacity: 0.45;
}

.season-ep-info {
    flex: 1;
    min-width: 0;
}

.season-ep-info strong {
    display: block;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.season-ep-info small {
    color: #8e8e93;
    font-size: 0.72rem;
}

.rate-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 99rem;
    font-size: 0.75rem;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.rate-chip:hover {
    border-color: var(--netflix-red);
}

/* --- Fenêtre "Ma liste" : texte et boutons --- */

.picker-sub {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.4;
    margin: 0 0 10px;
}

.picker-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.picker-actions .save-btn {
    flex: 1;
    margin-top: 0;
}

.picker-danger {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(229, 56, 74, 0.6);
    color: #ff6b7a;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 14px;
}

.picker-danger:hover {
    background: rgba(229, 56, 74, 0.2);
}

/* =========================================================
   V4 : avis (carte dans la fiche + pop-up TV Track / TMDB)
   ========================================================= */

body.no-scroll {
    overflow: hidden;
}

/* --- Carte « Avis » dans la fiche --- */

.reviews-entry {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #fff;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s;
}

.reviews-entry:hover {
    border-color: var(--netflix-red);
}

.reviews-entry-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.reviews-entry-main strong {
    font-size: 1rem;
}

.reviews-entry-main span {
    color: #9a9aa2;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reviews-entry-side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.reviews-entry-side b {
    font-size: 0.95rem;
}

.reviews-chevron {
    font-size: 1.6rem;
    color: #8e8e93;
    line-height: 1;
}

/* --- Pop-up (feuille en hauteur) --- */

.reviews-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    z-index: 100001;
    display: none;
    justify-content: center;
    align-items: stretch;
}

.reviews-overlay.open {
    display: flex;
}

.reviews-sheet {
    background: #141414;
    width: 100%;
    max-width: 720px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sheetUp 0.25s ease-out;
}

@media (min-width: 760px) {
    .reviews-overlay {
        padding: 4vh 0;
    }
    .reviews-sheet {
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@keyframes sheetUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.reviews-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 12px;
}

.reviews-head h3 {
    margin: 0;
    font-size: 1.3rem;
}

.reviews-head small {
    color: #8e8e93;
    font-size: 0.8rem;
}

.reviews-tabs {
    display: flex;
    gap: 4px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 4px;
    margin: 0 20px 6px;
}

.reviews-tabs button {
    flex: 1;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 9px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.reviews-tabs button.active {
    background: var(--netflix-red);
    color: #fff;
}

.reviews-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px calc(30px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}

.rv-section {
    margin: 18px 0 10px;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8e8e93;
}

.rv-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 10px 0 4px;
}

.rv-summary b {
    font-size: 1.4rem;
}

.rv-summary small {
    color: #8e8e93;
}

/* --- Cartes d'avis --- */

.rv-card {
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 12px 0;
}

.rv-card.mine {
    border-color: rgba(var(--accent-rgb), 0.5);
}

.rv-card header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rv-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #2a2a2e;
    flex-shrink: 0;
}

.rv-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #ddd;
}

.rv-who {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rv-who strong {
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rv-who small {
    color: #8e8e93;
    font-size: 0.74rem;
}

.rv-badge {
    background: rgba(245, 181, 10, 0.16);
    color: #f5b50a;
    border-radius: 99rem;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.rv-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #e4e4e7;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.rv-text.muted {
    color: #8e8e93;
    font-style: italic;
}

.rv-text.clamp {
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rv-card footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.rv-card.mine footer {
    justify-content: flex-start;
}

.rv-link {
    background: transparent;
    border: none;
    color: #ff6b73;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: none;
}

.rv-link:hover {
    text-decoration: underline;
}

.rv-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.rv-btn:hover {
    border-color: var(--netflix-red);
}

.rv-btn.danger {
    color: #ff6b7a;
    border-color: rgba(229, 56, 74, 0.55);
}

.rv-btn.wide {
    width: 100%;
    margin: 8px 0;
    padding: 12px;
}

/* --- Formulaire de mon avis --- */

.rv-form {
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
}

.rv-label {
    display: block;
    font-size: 0.85rem;
    color: #c4c4cc;
    margin: 0 0 8px;
}

.rv-chips {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    margin-bottom: 10px;
}

.rv-chip {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 9px 0;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.rv-chip.active {
    background: var(--netflix-red);
    border-color: var(--netflix-red);
}

.rv-rating-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.rv-rating-row input,
.rv-form textarea {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border-light);
    border-radius: 8px;
    color: #fff;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}

.rv-rating-row input {
    width: 110px;
}

.rv-form textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    line-height: 1.5;
}

.rv-rating-row input:focus,
.rv-form textarea:focus {
    border-color: var(--netflix-red);
}

.rv-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.rv-form-actions .save-btn {
    flex: 1;
    margin-top: 0;
}

.rv-empty {
    background: #1c1c1e;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: #9a9aa2;
}

.rv-empty strong {
    display: block;
    color: #fff;
    margin-bottom: 6px;
}

.rv-empty p {
    margin: 0 0 10px;
    font-size: 0.84rem;
    line-height: 1.5;
}

/* =========================================================
   V5 : onglet Épisodes réorganisé + avis par épisode
   ========================================================= */

/* Titres de section (dans la fiche) */
#modal-tab-episodes .rv-section {
    margin: 26px 0 10px;
}

#modal-tab-episodes .rv-section.first {
    margin-top: 4px;
}

#modal-tab-episodes .ep-tabs {
    padding: 0 0 10px;
    border: none;
}

#modal-tab-episodes .ep-hint {
    padding: 0 0 12px;
    line-height: 1.45;
}

/* --- Carte « Où j'en suis » --- */

.next-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #1c1c1e;
    border: 1px solid rgba(245, 181, 10, 0.4);
    border-radius: 14px;
    padding: 14px 16px;
}

.next-card.done {
    border-color: rgba(46, 204, 113, 0.45);
}

.next-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
    cursor: pointer;
}

.next-card.done .next-info {
    cursor: default;
}

.next-info small {
    color: #8e8e93;
    font-size: 0.76rem;
}

.next-info strong {
    font-size: 0.98rem;
}

/* --- Repère « commentaire » sur la grille --- */

.ep-cell.has-comment {
    position: relative;
}

.ep-cell.has-comment::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.6);
}

/* --- Lignes d'épisodes dans les saisons --- */

.season-ep[data-ep-open] {
    cursor: pointer;
}

.season-ep[data-ep-open]:hover .season-ep-info strong {
    color: #ff6b73;
}

.ep-review-add {
    color: #8e8e93;
    font-size: 0.78rem;
    white-space: nowrap;
}

.ep-review-badge {
    background: rgba(245, 181, 10, 0.16);
    color: #f5b50a;
    border-radius: 99rem;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

/* --- Carte « Avis » : ligne sur les épisodes --- */

.reviews-entry-extra {
    font-style: normal;
    color: #f5b50a;
    font-size: 0.76rem;
    margin-top: 2px;
}

/* --- Pop-up d'un épisode --- */

.rv-ep-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 12px 0 4px;
}

.rv-ep-top small {
    color: #8e8e93;
    font-size: 0.8rem;
}

.rv-seen {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    border-radius: 99rem;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.rv-seen.on {
    background: rgba(46, 204, 113, 0.18);
    border-color: #2ecc71;
    color: #2ecc71;
}

.ep-overview {
    margin: 10px 0 0;
}

.rv-note {
    color: #8e8e93;
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 12px 0 0;
}

/* =========================================================
   V6 : icônes, fluidité, filtres, Safari, profil
   ========================================================= */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }
button, a, .media-card, .chip { touch-action: manipulation; }

/* --- Icônes (remplacent les emojis) --- */
svg.ic {
    width: 1.1em; height: 1.1em;
    flex-shrink: 0;
    vertical-align: -0.18em;
    fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
svg.ic.fill { fill: currentColor; }
.page-title { display: flex; align-items: center; gap: 10px; }
.page-title svg.ic { width: 1.15em; height: 1.15em; color: var(--netflix-red); }
.see-all-btn, .btn-add, .settings-btn, .back-btn, #search-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.poster-fallback svg.ic, .calendar-poster-fallback svg.ic { width: 2.2rem; height: 2.2rem; opacity: .35; }
.poster-fallback, .calendar-poster-fallback { display: flex; align-items: center; justify-content: center; }
.clear-btn svg.ic { width: 1rem; height: 1rem; }

/* --- Plus doux : espaces, arrondis, ombres --- */
body { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
.media-card { border-radius: 14px; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease; }
.media-card:active { transform: scale(.97) !important; }
.media-card img { transition: opacity .35s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.media-card { animation: cardIn .5s cubic-bezier(.2,.8,.2,1) both; }
.media-card:nth-child(2) { animation-delay: .04s; } .media-card:nth-child(3) { animation-delay: .08s; }
.media-card:nth-child(4) { animation-delay: .12s; } .media-card:nth-child(5) { animation-delay: .16s; }
.media-card:nth-child(n+6) { animation-delay: .2s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
button { transition: transform .15s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease, opacity .2s ease; }
button:active:not(:disabled) { transform: scale(.96); }
.modal-overlay.active { animation: overlayIn .25s ease both; }
.modal-overlay.active > .modal-content, .modal-overlay.active > [class*="-content"], .modal-overlay.active > [class*="-card"] { animation: sheetIn .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-overlay { height: 100vh; height: 100dvh; }
.page-section { animation-duration: .4s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
.menu a { transition: all .3s cubic-bezier(.2,.8,.2,1); }

/* --- Pastilles de catégories --- */
.chip-row {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 2px 2px 8px; margin: 0 -2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row:empty { display: none; }
.chip {
    flex: 0 0 auto; scroll-snap-align: start;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.75);
    border: 1px solid var(--glass-border);
    padding: 8px 14px; border-radius: 999px;
    font-size: .8rem; font-weight: 600; cursor: pointer;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.chip:hover { background: rgba(255,255,255,.1); color: #fff; }
.chip.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb),.9), rgba(var(--accent-dark-rgb, 120, 5, 10),.95));
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 14px var(--netflix-red-glow);
}
.chip-row-sm .chip { padding: 6px 12px; font-size: .74rem; }
.genre-results-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.genre-results-title { margin: 0; font-size: 1.15rem; }
.load-more-wrap { display: flex; justify-content: center; margin: 22px 0 6px; }

/* --- Boutons --- */
.primary-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    color: #fff; border: 0; border-radius: 12px;
    padding: 12px 20px; font-weight: 700; font-size: .9rem; cursor: pointer;
    box-shadow: 0 6px 18px var(--netflix-red-glow);
}
.primary-btn:disabled { opacity: .4; box-shadow: none; cursor: not-allowed; }
.primary-btn.wide { width: 100%; }
.ghost-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255,255,255,.06); color: #fff;
    border: 1px solid var(--glass-border-light); border-radius: 12px;
    padding: 11px 18px; font-weight: 600; font-size: .85rem; cursor: pointer;
}
.ghost-btn:hover { background: rgba(255,255,255,.11); }
.link-btn { background: none; border: 0; color: rgba(255,255,255,.55); font-size: .85rem; padding: 10px; cursor: pointer; }
.link-btn:hover { color: #fff; }

/* --- Carte d'appel à l'action (profil) --- */
.cta-card {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 16px 0 4px; padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb),.18), rgba(20,20,25,.7));
    border: 1px solid rgba(var(--accent-rgb),.3);
    animation: cardIn .5s cubic-bezier(.2,.8,.2,1) both;
}
.cta-icon { width: 44px; height: 44px; border-radius: 14px; background: rgba(var(--accent-rgb),.25); display: grid; place-items: center; color: #fff; }
.cta-icon svg.ic { width: 22px; height: 22px; }
.cta-text { flex: 1 1 200px; display: flex; flex-direction: column; gap: 3px; }
.cta-text span { font-size: .8rem; color: rgba(255,255,255,.65); line-height: 1.4; }

/* --- Mes données --- */
.data-card { margin-top: 18px; }
.data-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.05rem; }
.data-hint { margin: 0 0 14px; font-size: .82rem; color: rgba(255,255,255,.6); line-height: 1.45; }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Bienvenue / création de profil --- */
.welcome-overlay {
    position: fixed; inset: 0; z-index: 20000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(5,5,8,.88);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    animation: overlayIn .3s ease both;
}
.welcome-overlay.closing { opacity: 0; transition: opacity .2s ease; }
.welcome-card {
    width: 100%; max-width: 380px; text-align: center;
    background: linear-gradient(180deg, #1a1a20, #121216);
    border: 1px solid var(--glass-border-light); border-radius: 24px;
    padding: 28px 22px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.7);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    animation: sheetIn .45s cubic-bezier(.2,.8,.2,1) both;
}
.welcome-logo { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg,var(--accent-light),var(--accent-dark)); display: grid; place-items: center; box-shadow: 0 8px 24px var(--netflix-red-glow); }
.welcome-logo svg.ic { width: 26px; height: 26px; }
.welcome-card h2 { margin: 6px 0 0; font-size: 1.3rem; }
.welcome-sub { margin: 0 0 6px; font-size: .86rem; color: rgba(255,255,255,.6); line-height: 1.45; }
.welcome-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.12); }
.swatches { display: flex; gap: 10px; justify-content: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.swatch.active { border-color: #fff; transform: scale(1.15); }
.welcome-label { align-self: flex-start; font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.6); margin-top: 6px; }
.welcome-card input {
    width: 100%; background: rgba(255,255,255,.06); border: 1px solid var(--glass-border-light);
    border-radius: 12px; padding: 13px 14px; color: #fff; font-size: 1rem; outline: none;
}
.welcome-card input:focus { border-color: var(--netflix-red); box-shadow: 0 0 14px var(--netflix-red-glow); }
.welcome-note { margin: 2px 0 0; font-size: .72rem; color: rgba(255,255,255,.45); display: flex; gap: 6px; align-items: center; }

/* --- Chargement (squelettes) --- */
.skeleton-card { flex: 0 0 auto; width: 140px; }
.grid-container .skeleton-card { width: auto; }
.sk-poster, .sk-line {
    border-radius: 12px;
    background: linear-gradient(100deg, rgba(255,255,255,.05) 30%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}
.sk-poster { aspect-ratio: 2 / 3; }
.sk-line { height: 10px; width: 70%; margin-top: 10px; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Safari : barre du bas plus basse, plus de flou parasite --- */
body::after { display: none; }
body::before { position: fixed; top: 0; }
.nav-fade {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; pointer-events: none;
    height: calc(84px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(11,11,15,.96) 0%, rgba(11,11,15,.8) 45%, rgba(11,11,15,0) 100%);
}
.menu {
    bottom: 10px;
    bottom: max(10px, calc(env(safe-area-inset-bottom) - 8px));
    background: rgba(18,18,22,.88);
}
@supports not (backdrop-filter: blur(1px)) and (not (-webkit-backdrop-filter: blur(1px))) { .menu { background: rgba(18,18,22,.97); } }
.search-box { max-width: 640px; }
#search-btn span { display: inline; }
@media (max-width: 380px) { #search-btn span { display: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   V7 : grilles resserrées + vignettes d'épisodes
   ========================================================= */
.grid-container {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 12px;
}
@media (min-width: 768px) {
    .grid-container { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
}
.grid-container .media-card { width: 100%; min-width: 0; flex: none; }
.grid-container .media-card .poster-wrap img,
.grid-container .media-card > img { height: auto !important; aspect-ratio: 2 / 3; object-fit: cover; }
.grid-container .btn-add { padding-left: 4px; padding-right: 4px; font-size: .72rem; }

.ep-thumb {
    flex: 0 0 auto; width: 86px; aspect-ratio: 16 / 9;
    border-radius: 8px; object-fit: cover; background: #232328; display: block;
}
.ep-thumb-empty { display: grid; place-items: center; color: rgba(255,255,255,.3); }
.ep-thumb-empty svg.ic { width: 1.2rem; height: 1.2rem; }
.ep-thumb-lg { width: 116px; border-radius: 10px; }
.season-ep { gap: 10px; }
.next-card .ep-thumb-lg { margin-right: -2px; }
.rv-still { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 12px; display: block; background: #232328; }
@media (max-width: 380px) { .ep-thumb { width: 72px; } .ep-thumb-lg { width: 92px; } }
.season-ep-info strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next-card { flex-wrap: wrap; }
.next-card .ep-thumb-lg { width: 108px; }
.next-card .next-info { flex: 1 1 140px; }
.next-card .m-btn { width: 100%; justify-content: center; }

/* =========================================================
   V8 : même taille d'affiche et même écart dans tous les onglets
   ========================================================= */
:root { --gap: 12px; --card-w: calc((100vw - 40px - 2 * var(--gap)) / 3); }
@media (min-width: 600px) { :root { --card-w: 150px; } }
@media (min-width: 1000px) { :root { --card-w: 170px; } }

.grid-container {
    grid-template-columns: repeat(auto-fill, var(--card-w));
    gap: var(--gap);
    justify-content: start;
}
@media (max-width: 599px) { .grid-container { grid-template-columns: repeat(3, var(--card-w)); } }
.horizontal-scroll-grid { gap: var(--gap); }
.horizontal-scroll-grid .media-card,
.grid-container .media-card { flex: 0 0 var(--card-w); width: var(--card-w); min-width: var(--card-w); }
.horizontal-scroll-grid .media-card .poster-wrap img,
.horizontal-scroll-grid .media-card > img { height: auto !important; aspect-ratio: 2 / 3; object-fit: cover; }
.skeleton-card { flex: 0 0 var(--card-w); width: var(--card-w); }
.grid-container .skeleton-card { width: var(--card-w); }
@media (max-width: 768px) { .horizontal-scroll-grid.expanded { grid-template-columns: repeat(3, var(--card-w)); gap: var(--gap); } }

/* =========================================================
   V9 : barre de navigation stable (ne bouge plus)
   ========================================================= */
html { scrollbar-gutter: stable; overflow-x: hidden; }
.menu {
    left: 0; right: 0;
    margin: 0 auto;
    transform: none;
    width: min(92%, 440px);
    contain: layout;
}
.menu a { will-change: auto; }
.nav-fade { left: 0; right: 0; }

/* --- Bouton J'aime : rouge quand c'est un favori --- */
.m-btn-icon.is-fav {
    color: #ff2d3d;
    background: rgba(var(--accent-rgb), 0.16);
    border-color: rgba(var(--accent-rgb), 0.6);
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
}
.m-btn-icon.is-fav svg.ic { fill: #ff2d3d; stroke: #ff2d3d; animation: heartPop .35s cubic-bezier(.2,.9,.3,1.4); }
@keyframes heartPop { 0% { transform: scale(.6); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }


/* =========================================================
   V10 : paramètres, couleur principale, taille des affiches
   ========================================================= */
:root { --accent: #E50914; --accent-rgb: 229, 9, 20; --accent-light: #f01420; --accent-dark: #b5050d; --cols: 3; }
html[data-density="compact"] { --cols: 4; }
html[data-density="large"] { --cols: 2; }
:root, html[data-density] { --card-w: calc((100vw - 40px - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
@media (min-width: 600px) {
    :root, html[data-density] { --card-w: 150px; }
    html[data-density="compact"] { --card-w: 125px; }
    html[data-density="large"] { --card-w: 190px; }
}
@media (max-width: 599px) { .grid-container { grid-template-columns: repeat(var(--cols), var(--card-w)); } }
html[data-density="compact"] .media-card .btn-add { font-size: .62rem; }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
}

/* --- Paramètres --- */
.settings-pane { display: none; }
.settings-pane.active { display: block; animation: fadeIn .3s ease both; }
.settings-header { gap: 14px; }
.back-btn { background: rgba(255,255,255,.07); border: 1px solid var(--glass-border); color: #fff; border-radius: 99rem; padding: 8px 14px; font-size: .82rem; cursor: pointer; }
.set-list { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 18px; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--glass-border); color: #fff; padding: 14px 16px; text-align: left; cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row:active { background: rgba(255,255,255,.06); transform: none; }
.set-row > svg.ic { color: rgba(255,255,255,.35); }
.set-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .2); color: #fff; flex: 0 0 auto; }
.set-ico svg.ic { width: 19px; height: 19px; }
.set-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.set-txt strong { font-size: .95rem; }
.set-txt small { color: rgba(255,255,255,.55); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.st-preview { position: relative; margin-bottom: 52px; }
.st-banner { height: 140px; border-radius: 16px; background-size: cover; background-position: center; background-color: #1a1a20; border: 1px solid var(--glass-border); }
.st-avatar { position: absolute; left: 18px; bottom: -42px; width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); background: #1a1a1a; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.st-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.st-actions-sm { margin-bottom: 18px; }
.st-actions-sm .link-btn { padding: 6px 4px; font-size: .78rem; }
.banner-presets { display: flex; gap: 10px; flex-wrap: wrap; }
.banner-preset { width: 62px; height: 32px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.banner-preset:hover { border-color: rgba(255,255,255,.6); }
.swatches.left { justify-content: flex-start; }
.muted-count { color: rgba(255,255,255,.4); font-weight: 400; font-size: .75rem; margin-left: 6px; }

.set-field { display: flex; flex-direction: column; gap: 10px; }
.set-field + .set-field { border-top: 1px solid var(--glass-border); padding-top: 18px; }
.set-field-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.set-field-head { display: flex; flex-direction: column; gap: 3px; }
.set-field-head strong { font-size: .92rem; }
.set-field-head small { color: rgba(255,255,255,.55); font-size: .76rem; line-height: 1.4; }
.seg { display: flex; background: rgba(255,255,255,.06); border: 1px solid var(--glass-border); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; background: transparent; border: 0; color: rgba(255,255,255,.65); padding: 9px 6px; border-radius: 9px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.seg button.active { background: linear-gradient(135deg, var(--accent-light), var(--accent-dark)); color: #fff; box-shadow: 0 3px 10px rgba(var(--accent-rgb), .35); }
.set-select { background: rgba(255,255,255,.06); border: 1px solid var(--glass-border-light); color: #fff; border-radius: 12px; padding: 11px 12px; font-size: .9rem; outline: none; width: 100%; }
.set-select option { background: #1a1a20; color: #fff; }

.switch { position: relative; flex: 0 0 auto; width: 50px; height: 30px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 99rem; background: rgba(255,255,255,.14); transition: background .25s ease; pointer-events: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }

.settings-form-card + .settings-form-card { margin-top: 16px; }
.danger-card { border-color: rgba(229,56,74,.35); }
.danger-btn { background: rgba(229,56,74,.12); color: #ff6b7a; border: 1px solid rgba(229,56,74,.5); border-radius: 12px; padding: 12px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.danger-btn:hover { background: rgba(229,56,74,.22); }
.about-card { align-items: center; text-align: center; gap: 10px; }
.about-card h2 { margin: 4px 0 0; }


/* =========================================================
   V11 : dégradés haut/bas, grande bannière, compte, notifications, avis
   ========================================================= */
body { padding-top: calc(30px + env(safe-area-inset-top)); }

/* Dégradés doux (fixes, sans bord visible) en haut et en bas de l'écran */
body::before {
    display: block; content: ""; position: fixed; top: 0; left: 0; right: 0; width: auto;
    height: calc(110px + env(safe-area-inset-top)); z-index: 998; pointer-events: none;
    background: linear-gradient(to bottom,
        rgba(var(--accent-rgb), .30) 0%, rgba(var(--accent-rgb), .20) 18%, rgba(var(--accent-rgb), .11) 38%,
        rgba(var(--accent-rgb), .045) 62%, rgba(var(--accent-rgb), .012) 82%, rgba(var(--accent-rgb), 0) 100%);
}
body::after { display: none; }
.nav-fade {
    height: calc(130px + env(safe-area-inset-bottom));
    background:
        linear-gradient(to top, rgba(var(--accent-rgb), .22) 0%, rgba(var(--accent-rgb), .12) 25%, rgba(var(--accent-rgb), .05) 55%, rgba(var(--accent-rgb), 0) 100%),
        linear-gradient(to top, rgba(11,11,15,.97) 0%, rgba(11,11,15,.88) 30%, rgba(11,11,15,.55) 60%, rgba(11,11,15,.2) 82%, rgba(11,11,15,0) 100%);
}

/* Bannière de profil plus grande et plus visible */
.profile-banner { height: 240px; }
.banner-gradient { background: linear-gradient(to bottom, rgba(0,0,0,0) 62%, rgba(11,11,15,.55) 85%, var(--bg-color) 100%); }
.profile-user-info { margin-top: -50px; }
.st-banner { height: 190px; }
.st-avatar { bottom: -42px; }

/* Compte */
.account-card { flex-direction: row; align-items: center; gap: 14px; }
.acc-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); flex: 0 0 auto; }
.acc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acc-text small { color: rgba(255,255,255,.55); }
.acc-note { margin: 10px 4px 16px; }

/* Notifications */
#notif-list.disabled { opacity: .45; }
#notif-list .set-field + .set-field { padding-top: 16px; }

/* Avis */
.fb-stars { display: flex; gap: 6px; }
.fb-star { background: none; border: 0; padding: 4px; color: rgba(255,255,255,.3); cursor: pointer; }
.fb-star svg.ic { width: 28px; height: 28px; }
.fb-star.on { color: #f5b50a; }
#fb-text { min-height: 120px; }
#fb-text, .form-group textarea { font-family: inherit; }
.fb-history { display: flex; flex-direction: column; gap: 10px; }
.fb-item { background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px; }
.fb-item p { margin: 8px 0 0; font-size: .85rem; line-height: 1.45; color: rgba(255,255,255,.85); white-space: pre-wrap; word-break: break-word; }
.fb-item-top { display: flex; align-items: center; gap: 8px; }
.fb-item-top small { color: rgba(255,255,255,.45); margin-left: auto; }
.fb-tag { background: rgba(var(--accent-rgb), .22); border-radius: 99rem; padding: 3px 10px; font-size: .72rem; font-weight: 700; }
.fb-rate { color: #f5b50a; font-size: .78rem; display: inline-flex; gap: 4px; align-items: center; }
.fb-del { background: none; border: 0; color: rgba(255,255,255,.4); padding: 4px; cursor: pointer; }
.ghost-btn:disabled { opacity: .4; cursor: not-allowed; }

/* =========================================================
   V12 : dégradés qui font partie de la page (pas fixes)
   - en haut : visible au début, disparaît quand on défile
   - en bas : n'apparaît qu'en arrivant tout en bas de la page
   ========================================================= */
body::before {
    position: absolute; top: 0; left: 0; right: 0; width: auto;
    height: calc(130px + env(safe-area-inset-top));
    z-index: 0; pointer-events: none;
}
body::after {
    display: block; content: ""; position: absolute; left: 0; right: 0; bottom: 0; width: auto;
    height: 220px; z-index: 0; pointer-events: none;
    background: linear-gradient(to top,
        rgba(var(--accent-rgb), .28) 0%, rgba(var(--accent-rgb), .18) 22%, rgba(var(--accent-rgb), .09) 45%,
        rgba(var(--accent-rgb), .03) 72%, rgba(var(--accent-rgb), 0) 100%);
}
.nav-fade { display: none; }
.page-section, #full-list-section { position: relative; z-index: 1; }


/* =========================================================
   V13 : spoilers, plateformes, objectif, thème clair, données
   ========================================================= */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.time-input { background: rgba(255,255,255,.06); border: 1px solid var(--glass-border-light); color: #fff; border-radius: 12px; padding: 9px 10px; font-size: .95rem; color-scheme: dark; }
.time-input:disabled { opacity: .4; }

/* Spoilers */
.spoiler { position: relative; border-radius: 12px; cursor: pointer; }
.spoiler > *:not(.spoiler-cover) { filter: blur(9px); opacity: .7; transition: filter .3s ease, opacity .3s ease; pointer-events: none; user-select: none; }
.spoiler-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; font-size: .82rem; font-weight: 600; background: rgba(11,11,15,.25); border-radius: 12px; transition: opacity .3s ease; }
.spoiler-cover svg.ic { width: 22px; height: 22px; opacity: .8; }
.spoiler-cover small { color: rgba(255,255,255,.65); font-weight: 400; }
.spoiler.revealed { cursor: default; }
.spoiler.revealed > *:not(.spoiler-cover) { filter: none; opacity: 1; pointer-events: auto; user-select: auto; }
.spoiler.revealed .spoiler-cover { opacity: 0; pointer-events: none; }

/* Plateformes */
.prov-banner { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .8rem; color: rgba(255,255,255,.6); }
.prov-banner.mine { color: #2ecc71; font-weight: 600; }
.provider-item.mine img { box-shadow: 0 0 0 2px #2ecc71; }
.provider-item.mine p { color: #2ecc71; font-weight: 600; }

/* Objectif hebdomadaire */
.goal-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 18px; padding: 16px; margin-bottom: 18px; }
.goal-card.reached { border-color: rgba(46,204,113,.5); box-shadow: 0 0 22px rgba(46,204,113,.12); }
.goal-top { display: flex; align-items: center; gap: 12px; }
.goal-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .2); flex: 0 0 auto; }
.goal-card.reached .goal-ico { background: rgba(46,204,113,.2); color: #2ecc71; }
.goal-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.goal-text small { color: rgba(255,255,255,.55); font-size: .76rem; }
.goal-count { font-size: 1.5rem; }
.goal-count span { font-size: .9rem; color: rgba(255,255,255,.5); font-weight: 600; }
.goal-bar { height: 8px; border-radius: 99rem; background: rgba(255,255,255,.1); margin-top: 14px; overflow: hidden; }
.goal-fill { height: 100%; border-radius: 99rem; background: linear-gradient(90deg, var(--accent-dark), var(--accent-light)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.goal-card.reached .goal-fill { background: linear-gradient(90deg, #1f9d55, #2ecc71); }

/* Économie de données */
.trailer-load { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 18px; border-radius: 12px; border: 1px dashed var(--glass-border-light); background: rgba(255,255,255,.04); color: #fff; font-size: .9rem; cursor: pointer; }
html.data-saver .media-card { animation: none; }

/* Notes des autres masquées */
html.hide-others-ratings #modal-rating,
html.hide-others-ratings .rv-summary,
html.hide-others-ratings .rv-card .rv-badge,
html.hide-others-ratings .reviews-entry .rating-source-tag,
html.hide-others-ratings .reviews-entry .rating-source-tag + b { display: none !important; }

/* À propos */
.about-links { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }
.about-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--glass-border); color: #fff; text-decoration: none; font-size: .88rem; cursor: pointer; text-align: left; font-family: inherit; }
.about-link:hover { background: rgba(255,255,255,.09); }

/* Thème clair : inversion des couleurs, images et photos conservées */
html[data-theme="light"] { filter: invert(1) hue-rotate(180deg); background: #0b0b0f; }
html[data-theme="light"] img,
html[data-theme="light"] video,
html[data-theme="light"] iframe,
html[data-theme="light"] .profile-banner,
html[data-theme="light"] .st-banner,
html[data-theme="light"] .modal-header-banner,
html[data-theme="light"] .banner-preset,
html[data-theme="light"] .swatch,
html[data-theme="light"] .welcome-avatar { filter: invert(1) hue-rotate(180deg); }


/* =========================================================
   V14 : Premium
   ========================================================= */
.lock-mini { display: none; width: .85em; height: .85em; vertical-align: -.1em; opacity: .85; }
html:not(.is-premium) .lock-mini { display: inline-block; }
html:not(.is-premium) .premium-sw { position: relative; }
.swatch.premium-sw, .banner-preset.premium-sw { display: inline-grid; place-items: center; color: #fff; }
.swatch.premium-sw .lock-mini, .banner-preset.premium-sw .lock-mini { filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
html.is-premium .premium-sw .lock-mini { display: none; }

.set-row-premium .set-ico { background: linear-gradient(135deg, #f5b50a, #b45309); color: #fff; }
.set-row-premium { background: linear-gradient(90deg, rgba(245,181,10,.10), transparent); }

.premium-hero { text-align: center; padding: 26px 20px 22px; margin-bottom: 16px; border-radius: 22px; border: 1px solid rgba(245,181,10,.4); background: radial-gradient(120% 120% at 50% 0%, rgba(245,181,10,.22), rgba(20,20,25,.7) 70%); }
.premium-hero.on { border-color: rgba(46,204,113,.5); background: radial-gradient(120% 120% at 50% 0%, rgba(46,204,113,.2), rgba(20,20,25,.7) 70%); }
.premium-hero h2 { margin: 10px 0 4px; font-size: 1.35rem; }
.premium-hero p { margin: 0 0 16px; color: rgba(255,255,255,.7); font-size: .88rem; line-height: 1.45; }
.premium-hero.on p { margin-bottom: 0; }
.premium-soon { display: block; margin-top: 10px; color: rgba(255,255,255,.5); font-size: .75rem; }
.premium-crown { width: 56px; height: 56px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #fbbf24, #b45309); box-shadow: 0 8px 24px rgba(245,181,10,.35); }
.premium-crown svg.ic { width: 28px; height: 28px; }
.feat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.feat { display: flex; gap: 12px; align-items: flex-start; }
.feat > svg.ic { width: 22px; height: 22px; margin-top: 2px; color: #f5b50a; }
.feat strong { display: block; font-size: .92rem; }
.feat small { display: block; color: rgba(255,255,255,.55); font-size: .78rem; line-height: 1.4; margin-top: 2px; }
.feat-list.soon .feat > svg.ic { color: rgba(255,255,255,.4); }
.feat-list.soon { opacity: .75; }
.soon-title { margin-top: 22px; font-size: .95rem; color: rgba(255,255,255,.7); }

.adv-btn { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 14px; padding: 13px 14px; border-radius: 16px; background: linear-gradient(90deg, rgba(245,181,10,.14), rgba(255,255,255,.04)); border: 1px solid rgba(245,181,10,.35); color: #fff; cursor: pointer; text-align: left; font-family: inherit; }
.adv-btn > svg.ic { width: 24px; height: 24px; color: #f5b50a; flex: 0 0 auto; }
.adv-btn span { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adv-btn small { color: rgba(255,255,255,.55); font-size: .75rem; }
.adv-btn-sm { max-width: 520px; }
.pro-tag { display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: .68rem; font-weight: 700; color: #f5b50a; background: rgba(245,181,10,.14); border-radius: 99rem; padding: 4px 9px; white-space: nowrap; }
.pro-tag svg.ic { width: 12px; height: 12px; }
html.is-premium .pro-tag { display: none; }

.paywall-overlay { position: fixed; inset: 0; z-index: 30000; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(5,5,8,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.paywall-overlay.open { display: flex; animation: overlayIn .25s ease both; }
.paywall-card { width: 100%; max-width: 360px; text-align: center; background: linear-gradient(180deg, #1c1c22, #121216); border: 1px solid rgba(245,181,10,.35); border-radius: 24px; padding: 26px 22px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.7); animation: sheetIn .35s cubic-bezier(.2,.8,.2,1) both; }
.paywall-card h2 { margin: 6px 0 0; font-size: 1.25rem; }
.paywall-card p { margin: 0 0 6px; color: rgba(255,255,255,.7); font-size: .88rem; line-height: 1.5; }

.adv-overlay { position: fixed; inset: 0; z-index: 15000; display: none; background: rgba(5,5,8,.97); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.adv-overlay.open { display: block; animation: overlayIn .25s ease both; }
.adv-sheet { max-width: 560px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom)); }
.adv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.adv-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 1.3rem; }
.adv-head h2 svg.ic { color: #f5b50a; }
.adv-close { background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); color: #fff; border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.adv-year { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.adv-year label { color: rgba(255,255,255,.6); font-size: .85rem; }
.adv-year select { width: auto; min-width: 110px; }
.adv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adv-tile { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.adv-tile b { font-size: 1.9rem; line-height: 1; }
.adv-tile b small { font-size: 1rem; color: rgba(255,255,255,.6); }
.adv-tile span { color: rgba(255,255,255,.6); font-size: .8rem; }
.delta { align-self: flex-start; margin-top: 4px; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 99rem; background: rgba(255,255,255,.08); color: rgba(255,255,255,.6); }
.delta.up { background: rgba(46,204,113,.16); color: #2ecc71; }
.delta.down { background: rgba(229,56,74,.16); color: #ff6b7a; }
.delta.new { background: rgba(245,181,10,.16); color: #f5b50a; }
.adv-note { margin: 12px 2px 16px; color: rgba(255,255,255,.6); font-size: .82rem; }
.adv-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 18px; padding: 14px 14px 12px; margin-bottom: 14px; }
.adv-card h3 { margin: 0 0 10px; font-size: .95rem; }
.chart { width: 100%; height: auto; display: block; }
.bar-ep { fill: var(--accent); }
.bar-mv { fill: #f5b50a; }
.bar-empty { fill: rgba(255,255,255,.14); }
.chart-lbl { fill: rgba(255,255,255,.5); font-size: 11px; font-family: inherit; }
.chart-legend { display: flex; gap: 16px; margin-top: 6px; font-size: .75rem; color: rgba(255,255,255,.6); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.lg-ep { background: var(--accent); } .lg-mv { background: #f5b50a; }
.best-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.best-row:last-child { border-bottom: 0; }
.best-rank { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: rgba(var(--accent-rgb), .25); }
.best-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.best-rate { color: #f5b50a; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; gap: 4px; }
#adv-share { margin-top: 6px; }

/* Thème Noir pur (Premium) */
html[data-theme="amoled"] { --bg-color: #000; background: #000; }
html[data-theme="amoled"] body { background: #000; }
html[data-theme="amoled"] .settings-form-card, html[data-theme="amoled"] .set-list, html[data-theme="amoled"] .goal-card, html[data-theme="amoled"] .adv-card, html[data-theme="amoled"] .adv-tile { background: #0a0a0c; }
html[data-theme="amoled"] .media-card { background: #08080a; }
html[data-theme="light"] .adv-overlay, html[data-theme="light"] .paywall-overlay { background: rgba(5,5,8,.97); }
.adv-overlay, html[data-theme="light"] .adv-overlay { background: #07070a; }