/* static/css/style.css — Oto-Tomo : identité « Sakura Moderne » (clair) / « Rose et Nuit » (sombre)
   Polices : Fredoka (titres) + Nunito (texte), hébergées localement (static/fonts). */

@font-face { font-family: 'Fredoka'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/fredoka-500.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/fredoka-600.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/fredoka-700.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/nunito-400.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/nunito-600.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/nunito-700.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/nunito-800.woff2') format('woff2'); }

/* --- THÈME CLAIR : Sakura Moderne --- */
:root {
    --bg-color: #fff4f8;            /* Pétale */
    --main-bg-color: #ffffff;
    --text-color: #3b2430;          /* Prune */
    --text-color-muted: #8d6b7b;
    --border-color: #f4d3e0;
    --card-bg-color: #fff9fb;
    --header-border-color: #f8e1ea;
    --link-color: #d6406f;
    --link-hover-color: #b72751;
    --button-border-color: #efc2d3;
    --input-bg-color: #ffffff;
    --input-text-color: #3b2430;
    --choice-btn-bg: #ffffff;
    --choice-btn-hover-bg: #ffe9f1;
    --choice-btn-border: #efc2d3;

    --primary: #f8a5c2;             /* Rose Poudré */
    --primary-strong: #e0527f;      /* Rose Sakura */
    --accent-gold: #c8963e;         /* Or Doux (texte lisible) */
    --success: #4fa87c;
    --danger: #dc4a4a;
    --info: #5b9cc4;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --font-heading: 'Fredoka', 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --shadow-color: rgba(224, 82, 127, 0.16);
    --shadow-soft: 0 1px 2px rgba(59, 36, 48, 0.06), 0 8px 24px rgba(224, 82, 127, 0.10);
    --flash-success-color: #ddf1e7;

    /* Couleurs du logo (fleur) */
    --logo-a: #b72751;
    --logo-b: #f8a5c2;
    --logo-c: #3b2430;
}

/* --- THÈME SOMBRE : Rose et Nuit --- */
html.dark-mode {
    --bg-color: #1e1420;            /* Nuit Prune */
    --main-bg-color: #281a2b;
    --text-color: #f6e9ef;          /* Brume */
    --text-color-muted: #c4a3b4;
    --border-color: #46304a;
    --card-bg-color: #311f35;
    --header-border-color: #3d2941;
    --link-color: #ff7aa8;          /* Rose Néon Doux */
    --link-hover-color: #ffa3c3;
    --button-border-color: #5a3d5f;
    --input-bg-color: #221626;
    --input-text-color: #f6e9ef;
    --choice-btn-bg: #281a2b;
    --choice-btn-hover-bg: #3a2540;
    --choice-btn-border: #5a3d5f;

    --primary: #ff7aa8;
    --primary-strong: #e6568a;
    --accent-gold: #f2c46b;         /* Or Pâle */
    --success: #6fcf9f;
    --danger: #ff7b7b;
    --info: #7ec3ea;

    --shadow-color: rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
    --flash-success-color: #2b4234;

    --logo-a: #ff7aa8;
    --logo-b: #f8a5c2;
    --logo-c: #f6e9ef;
}

/* Logo (SVG inline, voir templates/_logo.html) */
.brand-logo .logo-a { fill: var(--logo-a); }
.brand-logo .logo-b { fill: var(--logo-b); }
.brand-logo .logo-c { fill: var(--logo-c); }

/* --- STYLES GÉNÉRAUX --- */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}


@media (max-width: 600px) {
    body { padding: 10px; margin: 0; }
    .main-container { padding: 15px; }
    #choices { grid-template-columns: 1fr; }
    .details-container { flex-direction: column; }
    .details-container .poster { width: 100%; max-width: 220px; margin: 0 auto; }
    .lobby-columns { gap: 20px; }
    .lobby-column { width: 100%; }
    .reco-item { flex-direction: column; }
}

.main-container {
    background: var(--main-bg-color);
    padding: 28px 32px 32px;
    border: 1px solid var(--header-border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* --- EN-TÊTE DE MARQUE (logo + nom, présent sur toutes les pages) --- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 4px 6px;
    flex-wrap: wrap;
}
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--link-color);
    transition: transform 0.15s;
}
.site-brand:hover { transform: scale(1.02); }
.site-brand:hover .brand-logo { transform: rotate(-8deg); }
.site-brand .brand-logo { transition: transform 0.25s; }
.site-brand .brand-logo {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 6px var(--shadow-color));
}
.site-brand .brand-name {
    font-family: var(--font-heading);
    font-size: 1.7em;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.01em;
}
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-color-muted);
}
.theme-toggle select {
    width: auto;
    padding: 6px 10px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--header-border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
    gap: 15px;
}
nav a {
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.2s;
}
nav a:hover { color: var(--link-hover-color); }

/* Bouton stylé comme un lien (pour les actions POST à la place des <a href> GET) */
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    text-decoration: none;
    color: var(--link-color);
    cursor: pointer;
    transition: color 0.2s;
}
.link-button:hover { color: var(--link-hover-color); background: none; }

.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

/* --- MONITORING ADMIN (SENTRY) --- */
.monitoring-empty-state {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    max-width: 640px;
}
.monitoring-empty-state ol { margin: 10px 0; padding-left: 22px; }
.monitoring-empty-state code {
    background: var(--main-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    font-size: 0.9em;
}

.monitoring-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 28px;
}
.stat-tile {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 22px;
    min-width: 160px;
}
.stat-label {
    display: block;
    font-size: 0.82em;
    color: var(--text-color-muted);
    margin-bottom: 6px;
}
.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.2em;
    font-weight: 600;
    line-height: 1;
    color: var(--text-color);
}

.sentry-issue-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sentry-issue {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}
.sentry-level-error, .sentry-level-fatal { border-left-color: var(--danger); }
.sentry-level-warning { border-left-color: var(--accent-gold); }
.sentry-level-info, .sentry-level-debug { border-left-color: var(--text-color-muted); }

.sentry-issue-main { display: flex; align-items: center; gap: 8px; }
.sentry-issue-title { color: var(--text-color); }
.sentry-issue-culprit {
    font-size: 0.85em;
    color: var(--text-color-muted);
    font-family: monospace;
    margin-top: 2px;
}
.sentry-issue-meta {
    font-size: 0.82em;
    color: var(--text-color-muted);
    margin-top: 6px;
}

.sentry-level-badge {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: #fff;
    flex-shrink: 0;
}
.sentry-level-badge-error, .sentry-level-badge-fatal { background: var(--danger); }
.sentry-level-badge-warning { background: var(--accent-gold); }
.sentry-level-badge-info, .sentry-level-badge-debug { background: var(--text-color-muted); }

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    border-bottom: 2px solid var(--header-border-color);
    padding-bottom: 8px;
    margin-top: 36px;
    color: var(--text-color);
}
h1 { font-size: 1.9em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }
h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }

button, input[type="submit"] {
    font-family: var(--font-body);
    background: var(--main-bg-color);
    color: var(--text-color);
    font-weight: 700;
    padding: 10px 18px;
    border: 1.5px solid var(--button-border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s, border-color 0.2s, transform 0.12s, box-shadow 0.2s;
}
button:hover, input[type="submit"]:hover { background: var(--card-bg-color); border-color: var(--link-color); }
button:focus-visible, input[type="submit"]:focus-visible, a:focus-visible, .btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--link-color) 45%, transparent);
    outline-offset: 2px;
}
button:disabled { background: var(--card-bg-color); cursor: not-allowed; opacity: 0.6; }

/* Base class for <a> tags styled as buttons */
.btn {
    display: inline-block;
    padding: 7px 16px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    border: none;
    color: white;
    transition: opacity 0.2s, transform 0.1s;
}
.btn:hover { opacity: 0.88; color: white; }
.btn:active { transform: scale(0.97); }

.btn-red, .btn-delete { background-color: var(--danger); color: white; border: none; }
.btn-reco { background-color: var(--info); color: white; border: none; }
.btn-add { background-color: var(--success); color: white; border: none; }
.rating-form button { background-color: var(--link-color); color: white; border: none; border-radius: var(--radius-pill); }

input[type="text"], input[type="number"], input[type="password"], textarea, select {
    font-family: var(--font-body);
    width: 100%;
    padding: 9px 12px;
    box-sizing: border-box;
    border: 1.5px solid var(--button-border-color);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg-color);
    color: var(--input-text-color);
    transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--link-color) 16%, transparent);
}

.alert { /* Les alertes gardent leur sens sémantique, coloré via la palette du thème actif */
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-color);
}
.alert-success { background-color: color-mix(in srgb, var(--success) 20%, var(--main-bg-color)); border-color: var(--success); }
.alert-danger  { background-color: color-mix(in srgb, var(--danger) 16%, var(--main-bg-color)); border-color: var(--danger); }
.alert-warning { background-color: color-mix(in srgb, var(--accent-gold) 22%, var(--main-bg-color)); border-color: var(--accent-gold); }
.alert-info    { background-color: color-mix(in srgb, var(--info) 18%, var(--main-bg-color)); border-color: var(--info); }


/* --- STYLES DASHBOARD & PROFILS --- */
.anime-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 20px; padding: 0;}
.anime-card {
    border: 1px solid var(--header-border-color);
    box-shadow: 0 1px 2px rgba(59, 36, 48, 0.05);
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--card-bg-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.anime-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); border-color: var(--border-color); }
.anime-card > a { text-decoration: none; color: inherit; display: block; }
.anime-card img { width: 100%; height: auto; border-radius: var(--radius-md); object-fit: cover; aspect-ratio: 2/3; }
.anime-card p.title { margin: 10px 0; font-family: var(--font-heading); font-weight: 500; flex-grow: 1; font-size: 0.98em; line-height: 1.3; }
.actions { margin-top: 10px; }
.actions form { display: inline-block; margin: 2px; }
.actions .btn, .actions a { font-size: 0.8em; padding: 5px 10px; border-radius: var(--radius-pill); text-decoration: none; border: none; cursor: pointer; display: inline-block; color: white; }
.rating-form { margin-top: 5px; display:flex; gap: 5px; }
.rating-form input { width: 60px; text-align: center; padding: 5px; }
.current-rating { font-size: 0.9em; color: var(--text-color-muted); margin: 5px 0; }
.separator { margin: 30px 0; border: 0; border-top: 1px solid var(--header-border-color); }
.nav-link-special { font-weight: bold; color: var(--accent-gold); }
.admin-link-special { font-weight: bold; color: var(--accent-gold); }

/* --- EN-TÊTE DU DASHBOARD : salutation + icônes de notification --- */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 6px;
}
.dash-header h2 { margin: 0; border: none; padding: 0; }
.dash-notifs { display: flex; gap: 10px; }
.icon-notif {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--card-bg-color);
    border: 1.5px solid var(--border-color);
    font-size: 1.2em;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.icon-notif:hover { border-color: var(--link-color); transform: translateY(-2px); }
.notification-bubble {
    position: absolute;
    top: -4px;
    right: -4px;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-size: 0.72em;
    font-weight: 700;
    border: 2px solid var(--main-bg-color);
    box-sizing: border-box;
}
.notification-bubble.red { background: var(--danger); }
.notification-bubble.blue { background: var(--info); }

/* --- NAV DU DASHBOARD EN CHIPS --- */
.dash-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: none;
    padding-bottom: 0;
    margin: 14px 0 20px;
}
.dash-nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    background: var(--card-bg-color);
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 700;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.dash-nav-chip:hover { transform: translateY(-1px); }
.dash-nav-chip:hover { background: var(--link-color); border-color: var(--link-color); color: #fff; }
.dash-nav-chip-gold { border-color: var(--accent-gold); color: var(--accent-gold); }
.dash-nav-chip-gold:hover { background: var(--accent-gold); border-color: var(--accent-gold); color: #fff; }

/* --- Menus déroulants de la nav (regroupent les chips par thème) --- */
.dash-nav-dropdown {
    position: relative;
    display: inline-block;
}
.dash-nav-dropdown-btn {
    cursor: pointer;
    font: inherit;
}
.dash-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 190px;
    background: var(--main-bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 6px;
    z-index: 50;
    flex-direction: column;
    gap: 2px;
}
.dash-nav-dropdown.open .dash-nav-dropdown-menu { display: flex; }
.dash-nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 600;
    white-space: nowrap;
}
.dash-nav-dropdown-menu a:hover { background: var(--card-bg-color); }

/* --- BANNIÈRE CTA BLIND TEST --- */
.blindtest-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent-gold));
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin: 20px 0;
    box-shadow: 0 8px 20px var(--shadow-color);
    transition: transform 0.15s, box-shadow 0.15s;
}
.blindtest-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--shadow-color); color: #fff; }
.blindtest-banner-icon { font-size: 2.2em; line-height: 1; flex-shrink: 0; }
.blindtest-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.blindtest-banner-text strong { font-family: var(--font-heading); font-size: 1.15em; }
.blindtest-banner-text span:last-child { font-size: 0.85em; opacity: 0.92; }
.blindtest-banner-arrow { font-size: 1.6em; flex-shrink: 0; }

/* --- DISPOSITION EN 3 ZONES : amis / contenu principal / fil d'activité --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 270px;
    gap: 24px;
    align-items: start;
}
.dashboard-sidebar {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(59, 36, 48, 0.05);
    padding: 18px;
    position: sticky;
    top: 20px;
}
/* Colonnes latérales (amis ; temps de visionnage, à venir, activité) : plus
   hautes que l'écran, elles restaient collées en haut (sticky) et le bas était
   coupé. Elles défilent donc avec la page pour s'afficher en entier. */
.dashboard-sidebar { position: static; }
.dashboard-sidebar h3 { margin-top: 0; font-size: 1.05em; }
.dashboard-sidebar #friend-list { padding: 0; }
.dashboard-sidebar .list-item { flex-direction: column; align-items: flex-start; gap: 8px; }
.feed-list-compact .feed-item { padding: 10px 12px; }
.feed-list-compact .feed-content { font-size: 0.88em; }
.sidebar-more-link { text-align: center; margin: 10px 0 0; }
.dashboard-main { min-width: 0; }

@media (max-width: 1000px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { position: static; }
}

/* --- BARRE DE RECHERCHE "HERO" --- */
.search-row-hero { margin: 4px 0 20px; }
.search-row-hero .autocomplete-wrapper { position: relative; }
.search-row-hero input[type="text"] {
    padding: 13px 18px 13px 42px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-color);
    font-size: 1em;
}
.search-row-hero input[type="text"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--link-color) 18%, transparent); }
.search-row-hero .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    pointer-events: none;
}
.search-row-hero button[type="submit"] {
    border-radius: var(--radius-pill);
    background: var(--primary-strong);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 13px 24px;
}
.search-row-hero button[type="submit"]:hover { background: var(--link-hover-color); }

/* --- STYLES LOBBY BLIND TEST --- */
.lobby-columns {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 30px;
    text-align: left;
    flex-wrap: wrap;
}
.lobby-column { min-width: 200px; }
.lobby-list { list-style: none; padding: 0; }
.lobby-list li { background: var(--card-bg-color); color: var(--text-color); padding: 10px 14px; margin-bottom: 5px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }

/* --- STYLES BLIND TEST --- */
.center-text { text-align: center; }
#game-view, #waiting-view { text-align: center; }
#lobby-players-list li { background: var(--card-bg-color); color: var(--text-color); padding: 10px 14px; margin-bottom: 5px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
#timer { font-family: var(--font-heading); font-size: 2.5em; color: var(--link-color); margin: 20px 0; font-weight: bold; }
#choices { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; max-width: 700px; margin-left: auto; margin-right: auto; }
.choice-btn {
    width: 100%; padding: 20px; font-size: 1.1em; cursor: pointer;
    border: 2px solid var(--choice-btn-border);
    background: var(--choice-btn-bg);
    color: var(--text-color);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}
.choice-btn:hover:not(:disabled) { background: var(--choice-btn-hover-bg); border-color: var(--link-color); }
.choice-btn:disabled { cursor: not-allowed; opacity: 0.75; }
.choice-btn.selected-answer { border-color: var(--link-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 35%, transparent); background: color-mix(in srgb, var(--link-color) 12%, var(--choice-btn-bg)); }
.choice-btn.correct { background: var(--success); color: white; border-color: var(--success); transform: scale(1.05); box-shadow: none; }
.choice-btn.incorrect { background: var(--danger); color: white; border-color: var(--danger); opacity: 0.6; box-shadow: none; }
#score-list li { padding: 5px; border-bottom: 1px solid var(--header-border-color); }

/* --- PAGE DE DÉTAILS ANIME --- */
.details-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
    flex-wrap: wrap;
}
.details-container .poster { flex-shrink: 0; width: 200px; }
.details-container .poster img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 20px var(--shadow-color);
}
.details-container .info { flex: 1; min-width: 260px; }
.details-container .info h1 { margin-top: 0; }
.synopsis { line-height: 1.7; color: var(--text-color-muted); }

.streaming-platforms { margin-top: 20px; }
.streaming-platforms a {
    display: inline-block;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    text-decoration: none;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    margin: 4px 4px 4px 0;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s, border-color 0.2s;
}
.streaming-platforms a:hover { background-color: var(--choice-btn-hover-bg); border-color: var(--link-color); }

/* --- PAGES DE LISTES --- */
ul:has(> li.list-item) { list-style: none; padding: 0; }
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg-color);
    border: 1px solid var(--header-border-color);
    padding: 15px 18px; margin-bottom: 10px; border-radius: var(--radius-md);
}
.reco-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}
.reco-item img { width: 80px; border-radius: var(--radius-sm); flex-shrink: 0; object-fit: cover; }
.reco-details { flex: 1; }
.reco-details .message { font-style: italic; background: var(--bg-color); padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 10px; }

/* --- FORMULAIRES --- */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 32px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px var(--shadow-color);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.95em; }
ul.error, .error { color: var(--danger); font-size: 0.88em; margin-top: 4px; padding-left: 16px; }

.form-container input[type="submit"] {
    background: var(--primary-strong);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    padding: 12px 20px;
    width: 100%;
    font-size: 1em;
}
.form-container input[type="submit"]:hover { background: var(--link-hover-color); }

.password-wrapper { position: relative; }
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] { padding-right: 42px; }
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: auto;
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 1.05em;
    line-height: 1;
    cursor: pointer;
    color: var(--input-text-color);
}
.password-toggle-btn:hover { background: none; border: none; }

/* --- CARTES DE FORMULAIRE "AUTH" (login, inscription, mdp, reco...) --- */
.auth-card { position: relative; text-align: center; padding-top: 20px; }
.auth-card h2 { text-align: center; }
.auth-card form { text-align: left; }
.auth-flourish { font-size: 2.4em; margin: 0 0 4px; line-height: 1; }
.auth-footer-link { text-align: center; margin-top: 18px; color: var(--text-color-muted); }
.back-link { text-align: center; font-size: 0.9em; margin-top: -6px; }

/* --- BLIND TEST SETUP --- */
.player-selection { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.player-selection label { display: flex; align-items: center; gap: 6px; background: var(--card-bg-color); border: 1px solid var(--border-color); padding: 8px 16px; border-radius: var(--radius-pill); cursor: pointer; }
.player-selection label:has(input:checked) { border-color: var(--link-color); }

/* --- CLASSEMENT --- */
.scoreboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.scoreboard-table th {
    background: var(--card-bg-color);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.scoreboard-table td { padding: 12px 16px; }
.scoreboard-table th, .scoreboard-table td { border-bottom: 1px solid var(--border-color); }
.scoreboard-table tr:nth-child(1) td { color: #d4a656; font-weight: bold; }
.scoreboard-table tr:nth-child(2) td { color: #a8a0ab; font-weight: bold; }
.scoreboard-table tr:nth-child(3) td { color: #c78a5c; font-weight: bold; }

/* --- NOUVEAU STYLE BARRE DE SON --- */
.volume-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-pill);
    outline: none;
    cursor: pointer;
    background-image: linear-gradient(var(--link-color), var(--link-color));
    background-size: var(--volume-level, 50%) 100%;
    background-repeat: no-repeat;
}
.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--main-bg-color);
    border: 2px solid var(--link-color);
    border-radius: 50%;
    margin-top: -6px;
}
.volume-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--main-bg-color);
    border: 2px solid var(--link-color);
    border-radius: 50%;
}

/* --- LECTEUR AUDIO/VIDÉO --- */
#media-player {
    width: 100%;
    max-width: 560px;
    height: auto;
    border-radius: var(--radius-lg);
    background-color: black;
    /* Par défaut caché — seul le son joue pendant la question */
    visibility: hidden;
    max-height: 0;
    transition: all 0.3s ease-in-out;
}

#media-player.reveal {
    /* Révélation après la réponse */
    visibility: visible;
    max-height: 315px;
    margin: 15px auto;
}

/* Conteneur de révélation vidéo pour films, séries et jeux */
#reveal-media-container {
    width: 100%;
    max-width: 560px;
    margin: 15px auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#reveal-media-container iframe,
#reveal-media-container video,
#reveal-media-container img {
    width: 100%;
    height: 315px;
    display: block;
    border: none;
    object-fit: contain;
    background-color: black;
}

/* --- NOTIFICATIONS "TOAST" --- */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    z-index: 9999;
    max-width: 360px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    animation: toastSlideIn 0.3s ease-out;
    cursor: default;
}
.toast-notification p { margin: 0; font-size: 0.95em; line-height: 1.4; }
.toast-notification.fade-out { animation: toastFadeOut 0.5s ease-in forwards; }
.toast-notification.info    { background-color: var(--info);    color: white; }
.toast-notification.success { background-color: var(--success); color: white; }
.toast-notification.error   { background-color: var(--danger);  color: white; }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateY(10px); }
}

/* --- CLASSES UTILITAIRES --- */
.hidden { display: none !important; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Animation de confirmation de changement de statut (respecte le thème sombre) */
@keyframes flashSuccess {
    0%   { background-color: var(--flash-success-color); }
    100% { background-color: var(--card-bg-color); }
}
.flash-success { animation: flashSuccess 0.6s ease-out forwards; }

/* Hover sur les boutons de suppression */
.btn-delete:hover, .btn-red:hover { opacity: 0.85; }

/* --- RECHERCHE AVEC AUTOCOMPLETE --- */
.search-row { display: flex; gap: 10px; align-items: flex-start; }
.search-row .autocomplete-wrapper { flex: 1; }
.search-row input[type="text"] { width: 100%; }
.autocomplete-wrapper { position: relative; }
.autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--main-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    list-style: none;
    padding: 4px; margin: 0;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 20px var(--shadow-color);
}
.autocomplete-suggestions.open { display: block; }
.autocomplete-suggestions li { padding: 8px 12px; cursor: pointer; font-size: 0.95em; border-radius: var(--radius-sm); }
.autocomplete-suggestions li:hover,
.autocomplete-suggestions li.focused { background: var(--choice-btn-hover-bg); color: var(--link-color); }

/* --- FORMULAIRE DE RECHERCHE AVEC FILTRES --- */
.search-filter-form { margin-bottom: 24px; }
.filter-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.filter-field { flex: 1; min-width: 140px; max-width: 220px; }
.results-count { color: var(--text-color-muted); font-size: 0.9em; margin-bottom: 12px; }

/* --- PAGE PARCOURIR --- */
.browse-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.genre-tag {
    display: inline-block;
    padding: 5px 16px;
    border-radius: var(--radius-pill);
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.88em;
    transition: background 0.2s, border-color 0.2s;
}
.genre-tag:hover, .genre-tag.active { background: var(--link-color); border-color: var(--link-color); color: white; }
.browse-score { font-size: 0.85em; color: var(--text-color-muted); margin: 4px 0; }

/* --- FIL D'ACTIVITÉ --- */
.feed-list { list-style: none; padding: 0; }
.feed-item {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 10px;
}
.feed-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.feed-username { font-weight: 600; text-decoration: none; color: var(--link-color); }
.feed-username:hover { color: var(--link-hover-color); }
.feed-time { font-size: 0.8em; color: var(--text-color-muted); }
.feed-content { font-size: 0.95em; }
.feed-content a { color: var(--link-color); }
.feed-empty { text-align: center; padding: 40px 20px; }
.feed-empty p { color: var(--text-color-muted); margin-bottom: 16px; }

/* --- STATISTIQUES PROFIL --- */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0;
}
.stat-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    min-width: 110px;
    text-align: center;
}
.stat-card.stat-genres { text-align: left; flex: 1; min-width: 220px; }
.stat-card .stat-value { font-family: var(--font-heading); font-size: 2em; font-weight: 700; color: var(--link-color); }
.stat-card .stat-label { font-size: 0.8em; color: var(--text-color-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.genre-bars { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.genre-bar-row { display: flex; align-items: center; gap: 8px; font-size: 0.85em; }
.genre-bar-name { min-width: 90px; }
.genre-bar-track { flex: 1; height: 8px; background: var(--border-color); border-radius: var(--radius-pill); overflow: hidden; }
.genre-bar-fill { height: 100%; background: var(--link-color); border-radius: var(--radius-pill); transition: width 0.4s; }
.genre-bar-count { min-width: 24px; text-align: right; color: var(--text-color-muted); }

/* --- DROPDOWN CATÉGORIES BLIND TEST --- */
.genre-dropdown-wrapper { position: relative; display: inline-block; margin: 8px 0; }
.genre-dropdown-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 9px 18px; border-radius: var(--radius-md); cursor: pointer;
    background: var(--card-bg-color); border: 1px solid var(--border-color);
    color: var(--text-color); font-size: 0.95em; min-width: 200px;
    justify-content: space-between;
    transition: border-color 0.2s;
}
.genre-dropdown-btn:hover { border-color: var(--link-color); }
.dropdown-arrow { font-size: 0.8em; color: var(--text-color-muted); transition: transform 0.2s; }
.genre-dropdown-panel {
    position: absolute; top: calc(100% + 4px); left: 0;
    background: var(--main-bg-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 6px; box-shadow: 0 8px 24px var(--shadow-color);
    z-index: 50; min-width: 230px; max-height: 300px; overflow-y: auto;
    display: none;
}
.genre-dropdown-panel.open { display: block; }
.genre-dropdown-wrapper:has(.genre-dropdown-panel.open) .dropdown-arrow { transform: rotate(180deg); }
.genre-option {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    cursor: pointer; border-radius: var(--radius-sm); font-size: 0.9em;
    transition: background 0.15s;
}
.genre-option:hover { background: var(--choice-btn-hover-bg); }
.genre-option input[type="checkbox"] { width: auto; accent-color: var(--link-color); }
.genre-options-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* --- BOUTON AUDIO FLOTTANT (dernier recours si autoplay bloqué) --- */
#audio-unlock-btn {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 300;
    background: var(--link-color);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    display: none;          /* affiché par JS si nécessaire */
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    animation: toastSlideIn 0.3s ease-out;
}
#audio-unlock-btn:hover { opacity: 0.9; }

/* --- INDICATEUR DE SYNCHRO --- */
.sync-indicator {
    text-align: center;
    color: var(--text-color-muted);
    font-size: 0.9em;
    padding: 6px;
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* --- SKIP ACTIF / COMPTEUR --- */
#skip-round-btn.skip-active { background: var(--link-color); color: white; }

/* --- BADGE SANS FAUTE --- */
.perfect-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-gold), #c78a3a);
    color: #3d2a00;
    font-size: 0.8em;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* --- PAGES D'ERREUR --- */
.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-family: var(--font-heading); font-size: 6em; font-weight: 900; color: var(--border-color); line-height: 1; margin-bottom: 10px; }
.error-page h1 { border: none; margin-top: 0; }
.error-page p { color: var(--text-color-muted); margin-bottom: 24px; }

/* Liste de scores (page résultats blind test) */
.score-list { list-style: none; padding: 0; }
.score-list-page { max-width: 500px; margin: 0 auto; text-align: left; }
.score-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}
.score-list li:first-child { border-color: #d4a656; }
.score-list li:nth-child(2) { border-color: #a8a0ab; }
.score-list li:nth-child(3) { border-color: #c78a5c; }

/* --- GALERIE D'AVATARS --- */
.avatars-subtitle { color: var(--text-color-muted); margin-bottom: 24px; }
.avatars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.avatar-card {
    background: var(--card-bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.avatar-card:not(.avatar-locked):hover { border-color: var(--link-color); transform: translateY(-2px); }
.avatar-selected { border-color: var(--link-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 30%, transparent); }
.avatar-locked { opacity: 0.55; filter: grayscale(0.4); }

/* Médaillon circulaire graphique pour l'avatar (au lieu d'un simple emoji flottant) */
.avatar-emoji {
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    line-height: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, var(--main-bg-color), var(--card-bg-color) 75%);
    border: 3px solid var(--border-color);
    box-shadow: 0 6px 14px var(--shadow-color), inset 0 0 0 2px var(--main-bg-color);
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.25s;
}
.avatar-card:not(.avatar-locked) .avatar-emoji {
    border-color: var(--primary);
    background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--primary) 22%, var(--main-bg-color)), var(--card-bg-color) 75%);
}
.avatar-card:not(.avatar-locked):hover .avatar-emoji { transform: scale(1.08) rotate(-4deg); }
.avatar-selected .avatar-emoji {
    border-color: var(--accent-gold);
    box-shadow: 0 6px 18px var(--shadow-color), 0 0 0 5px color-mix(in srgb, var(--accent-gold) 30%, transparent);
}
.avatar-selected .avatar-emoji::after {
    content: '✨';
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.32em;
}
.avatar-name { font-family: var(--font-heading); font-weight: 700; font-size: 1em; }
.avatar-desc { font-size: 0.78em; color: var(--text-color-muted); line-height: 1.4; }
.avatar-condition { font-size: 0.82em; }
.badge-free { color: var(--success); font-weight: 600; }
.badge-unlocked { color: var(--success); font-weight: 600; }
.badge-locked { color: var(--text-color-muted); }
.avatar-current-badge { font-size: 0.8em; font-weight: 700; color: var(--link-color); }
.btn-select-avatar {
    margin-top: 4px;
    padding: 6px 16px;
    font-size: 0.85em;
    border-radius: var(--radius-pill);
    border: 1px solid var(--link-color);
    background: var(--link-color);
    color: white;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-select-avatar:hover:not(:disabled) { opacity: 0.85; }
.btn-select-avatar:disabled { background: var(--border-color); border-color: var(--border-color); cursor: not-allowed; color: var(--text-color-muted); }
.avatars-progress {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-top: 8px;
}
.avatars-progress h3 { margin: 0 0 4px; }
.avatars-progress p { margin: 4px 0 0; color: var(--text-color-muted); font-size: 0.9em; }

/* --- BADGES DE TYPE MÉDIA --- */
.media-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72em;
    font-weight: 600;
    color: #fff;
    margin: 4px 0;
    letter-spacing: 0.02em;
}

/* --- ONGLETS DE TYPE MÉDIA (page de recherche) --- */
.media-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.media-tab {
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.media-tab:hover { border-color: var(--link-color); color: var(--link-color); text-decoration: none; }
.media-tab.active { background: var(--link-color); border-color: var(--link-color); color: #fff; }

/* --- DIVERS (résultats de recherche) --- */
.no-poster { display: flex; align-items: center; justify-content: center; height: 140px; font-size: 3em; background: var(--card-bg-color); border-radius: var(--radius-lg); }

.add-button {
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 7px 16px;
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 8px;
}
.add-button:hover { background: var(--success); opacity: 0.85; }
.add-button:disabled { background: var(--border-color); color: var(--text-color-muted); opacity: 1; }

.add-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.add-actions .add-button { margin-top: 0; padding: 7px 12px; }
.add-button-seen { background: var(--primary); }
.add-done { font-size: 0.85em; font-weight: 600; color: var(--text-color-muted); padding: 7px 0; }

/* --- CONTRÔLES DASHBOARD --- */
.dashboard-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; }
.media-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    padding: 5px 16px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-btn:hover { border-color: var(--link-color); color: var(--link-color); }
.filter-btn.active { background: var(--link-color); border-color: var(--link-color); color: #fff; }

/* --- EN-TÊTE DE SECTION PAR TYPE --- */
.section-block { margin-bottom: 36px; }
.section-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.65em;
    font-weight: 700;
    background: var(--border-color);
    color: var(--text-color-muted);
    vertical-align: middle;
    margin-left: 6px;
}

/* Séparateur horizontal (bannière au-dessus du groupe) */
.media-section-header {
    /* Span toutes les colonnes de la grille parente */
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 10px;
    padding: 13px 20px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--section-color) 22%, var(--card-bg-color)),
        color-mix(in srgb, var(--section-color) 6%,  var(--card-bg-color)));
    border-top: 4px solid var(--section-color);
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--section-color) 12%, transparent);
}
.media-section-icon {
    font-size: 1.6em;
    line-height: 1;
    filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--section-color) 40%, transparent));
}
.media-section-label {
    font-family: var(--font-heading);
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.02em;
}
.media-section-count {
    margin-left: auto;
    font-size: 0.82em;
    color: color-mix(in srgb, var(--section-color) 80%, var(--text-color));
    background: color-mix(in srgb, var(--section-color) 12%, var(--main-bg-color));
    border: 1.5px solid color-mix(in srgb, var(--section-color) 35%, var(--border-color));
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-weight: 700;
}
.empty-list-msg { color: var(--text-color-muted); font-style: italic; padding: 8px 0; }

/* --- CHECKBOX DE SÉLECTION --- */
.anime-card { position: relative; }
.card-checkbox-wrapper {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 5;
    line-height: 0;
    cursor: pointer;
}
.card-checkbox {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--link-color);
    opacity: 0.25;
    transition: opacity 0.15s;
    border-radius: var(--radius-sm);
}
.anime-card:hover .card-checkbox,
.card-checkbox:checked { opacity: 1; }
.bulk-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--main-bg-color);
    border: 2px solid var(--link-color);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 28px var(--shadow-color);
    z-index: 100;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.9em;
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--link-color);
    color: var(--link-color);
    padding: 5px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
}
.btn-outline:hover { background: color-mix(in srgb, var(--link-color) 10%, transparent); }

/* --- BLIND TEST : SÉLECTION TYPE DE MÉDIAS --- */
.media-types-selection { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.media-type-option { cursor: pointer; }
.media-type-option input { display: none; }
.media-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    border: 2px solid;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.media-type-count { font-weight: 400; font-size: 0.85em; opacity: 0.85; }
.media-type-empty .media-type-pill { opacity: 0.4; cursor: not-allowed; }

/* ─── PANNEAU ADMIN ───────────────────────────────────────────── */
.admin-header { margin-bottom: 24px; }
.admin-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-top: 16px;
}
.admin-user-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.admin-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-user-avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7em;
    line-height: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, var(--main-bg-color), var(--card-bg-color) 75%);
    border: 2px solid var(--primary);
    box-shadow: 0 3px 8px var(--shadow-color);
}
.admin-username { font-family: var(--font-heading); font-size: 1.1em; font-weight: 700; }
.admin-user-meta { font-size: 0.82em; color: var(--text-color-muted); margin-top: 2px; }
.admin-self-badge {
    font-size: 0.75em;
    font-weight: 700;
    background: var(--link-color);
    color: #fff;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
}
.btn-sm { padding: 4px 14px; font-size: 0.82em; }
.btn-lg { padding: 15px 28px; font-size: 1.2em; }
.lobby-start-area { margin-top: 40px; }

/* Avatar section */
.admin-avatar-section { display: flex; flex-direction: column; gap: 8px; }
.admin-avatar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-avatar-title { font-size: 0.85em; font-weight: 600; color: var(--text-color-muted); margin-right: 4px; }
.btn-avatar-ctrl {
    padding: 3px 14px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}
.btn-unlock-all:hover { border-color: var(--success); color: var(--success); }
.btn-lock-all:hover   { border-color: var(--danger); color: var(--danger); }

.admin-avatar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.admin-avatar-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    user-select: none;
}
.admin-avatar-pill .av-emoji { font-size: 1.1em; }
.admin-avatar-pill .av-name  { font-weight: 600; }
.admin-avatar-pill .av-status { font-size: 0.85em; opacity: 0.7; }
.admin-avatar-pill.av-unlocked {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 15%, var(--card-bg-color));
    color: var(--text-color);
}
.admin-avatar-pill.av-locked {
    opacity: 0.45;
}

/* --- Mini-assistant FAQ (bulle de chat flottante) --- */
.faq-bot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-strong);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    user-select: none;
    transition: transform 0.15s;
}
.faq-bot-bubble:hover { transform: scale(1.08); }

.faq-bot-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: min(340px, calc(100vw - 32px));
    max-height: min(480px, calc(100vh - 140px));
    background: var(--main-bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius, 14px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}
/* L'attribut HTML `hidden` a la même spécificité qu'une classe : sans cette
   règle, le `display: flex` ci-dessus l'emportait toujours (chargé après le
   style par défaut du navigateur) et le panneau restait visible en
   permanence, quoi que fasse le JS (`panel.hidden = true/false` n'avait
   alors aucun effet visuel — c'était le bug remonté : la bulle "ne se
   referme jamais"). */
.faq-bot-panel[hidden] {
    display: none;
}
.faq-bot-header {
    background: var(--primary-strong);
    color: white;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}
.faq-bot-header button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
    padding: 2px 6px;
}
.faq-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.faq-bot-msg {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.88em;
    line-height: 1.4;
    max-width: 88%;
}
.faq-bot-msg-bot {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    align-self: flex-start;
}
.faq-bot-msg-user {
    background: var(--primary);
    color: var(--text-color);
    align-self: flex-end;
}
.faq-bot-form {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}
.faq-bot-form input {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-color);
    background: var(--input-bg-color);
    color: var(--input-text-color);
    font-size: 0.9em;
}
.faq-bot-form button {
    border-radius: var(--radius-pill);
    border: none;
    background: var(--primary-strong);
    color: white;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9em;
}
.admin-avatar-pill:hover { opacity: 1; border-color: var(--link-color); }

/* Suivi d'épisodes et visionnages (façon TV Time) sur les cartes */
.episode-tracker,
.rewatch-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    row-gap: 0.3rem;
}
.episode-tracker .ep-label,
.rewatch-tracker .rw-label {
    font-size: 0.8rem;
    color: var(--text-color-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}
.rewatch-tracker .rw-count,
.episode-tracker .ep-total { font-weight: 700; color: var(--text-color); }
.episode-tracker .ep-select,
.episode-tracker .ep-input {
    font-size: 0.8rem;
    padding: 0.15rem 0.2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg-color);
    color: var(--text-color);
    text-align: center;
    min-width: 2.6rem;
}
.episode-tracker .ep-select { text-align-last: center; }
.episode-tracker .ep-input { width: 2.8rem; }
.ep-btn, .rw-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    color: var(--primary-strong);
    /* Le + / − est dessiné en CSS (et non en texte) : les glyphes de police
       n'ont pas le même centrage verticalement selon la police. */
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.ep-minus, .rw-minus {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0.7rem 2px;
}
.ep-plus, .rw-plus {
    background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
    background-size: 0.7rem 2px, 2px 0.7rem;
}
.ep-btn:hover, .rw-btn:hover { background-color: var(--primary); color: #fff; }
.ep-btn:active, .rw-btn:active { transform: scale(0.9); }
.ep-btn:disabled, .rw-btn:disabled { color: var(--primary-strong); opacity: 0.5; cursor: default; }

/* ── Page calendrier « À venir » ─────────────────────────────── */
.cal-header { margin: 1rem 0 0.5rem; }
.cal-header h1 { margin: 0; }
.cal-sub { color: var(--text-color-muted); font-size: 0.9rem; }
.cal-section-title { margin: 1.5rem 0 0.6rem; font-size: 1.1rem; }

/* Grille 7 jours */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}
.cal-grid-day {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg-color);
    padding: 0.4rem;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.cal-grid-day.is-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cal-grid-head { text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 0.25rem; }
.cal-grid-label { display: block; font-weight: 700; font-size: 0.8rem; }
.cal-grid-date { display: block; font-size: 0.7rem; color: var(--text-color-muted); }
.cal-grid-body { display: flex; flex-direction: column; gap: 0.3rem; }
.cal-grid-empty { text-align: center; color: var(--border-color); font-size: 1.1rem; }
.cal-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    padding: 0.15rem;
    transition: background 0.15s;
}
.cal-chip:hover { background: color-mix(in srgb, var(--primary) 15%, transparent); }
.cal-chip img { width: 26px; height: 37px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.cal-chip-text { min-width: 0; display: flex; flex-direction: column; }
.cal-chip-title { font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip-ep { font-size: 0.66rem; color: var(--text-color-muted); }

/* Liste détaillée avec bannières */
.cal-list { display: flex; flex-direction: column; gap: 0.6rem; }
.cal-day { margin: 1.3rem 0 0.4rem; font-size: 1rem; color: var(--primary-strong); display: flex; align-items: baseline; gap: 0.6rem; }
.cal-day-date { font-size: 0.78rem; color: var(--text-color-muted); font-weight: 400; }
.cal-card {
    position: relative;
    display: flex;
    gap: 0.9rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg-color);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.1s;
}
.cal-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.cal-card.has-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--banner);
    background-size: cover;
    background-position: center;
    opacity: 0.14;
    z-index: 0;
}
.cal-card > * { position: relative; z-index: 1; }
.cal-card-poster { width: 60px; height: 86px; object-fit: cover; border-radius: 7px; flex: 0 0 auto; background: var(--border-color); }
.cal-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.cal-card-top { display: flex; align-items: center; gap: 0.5rem; }
.cal-badge { color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; }
.cal-countdown {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-strong);
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
}
.cal-card-title { margin: 0; font-weight: 700; font-size: 1rem; }
.cal-card-ep { margin: 0; font-size: 0.82rem; color: var(--text-color-muted); }
.cal-ep-name { color: var(--text-color); font-style: italic; }
.cal-card-overview {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--text-color-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cal-empty { text-align: center; padding: 3rem 1rem; color: var(--text-color-muted); }
.cal-empty-emoji { font-size: 3rem; margin-bottom: 0.5rem; }

@media (max-width: 760px) {
    .cal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .cal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-card-poster { width: 48px; height: 68px; }
}

/* Encart « À venir cette semaine » (barre latérale du tableau de bord) */
.upcoming-widget { margin-bottom: 1.5rem; }
.upcoming-list { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.4rem; }
.upcoming-item { display: flex; align-items: center; gap: 0.55rem; padding: 0.35rem 0.4rem; border-radius: 8px; text-decoration: none; color: inherit; transition: background 0.15s; }
.upcoming-item:hover { background: var(--card-bg-color); }
.upcoming-item img { width: 34px; height: 48px; object-fit: cover; border-radius: 5px; flex: 0 0 auto; background: var(--border-color); }
.upcoming-text { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.upcoming-title { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-meta { font-size: 0.75rem; color: var(--text-color-muted); display: flex; align-items: center; gap: 0.3rem; }
.upcoming-badge { color: #fff; border-radius: 999px; padding: 0.02rem 0.3rem; font-size: 0.7rem; }

/* ===== Bloc « À continuer » (Up Next façon TV Time) ===== */
.continue-watching {
    margin: 0 0 1.5rem;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 14px);
    padding: 1rem 1rem 0.6rem;
}
.cw-heading {
    margin: 0 0 0.8rem;
    font-size: 1.1rem;
}
.cw-row {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.cw-row::-webkit-scrollbar { height: 8px; }
.cw-row::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 999px; }
.cw-card {
    flex: 0 0 160px;
    width: 160px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.4s;
}
.cw-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.cw-card.cw-done { opacity: 0; transform: scale(0.92); }
.cw-card.cw-flash .cw-progress-bar { filter: brightness(1.25); }
.cw-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    background: var(--card-bg-color);
}
.cw-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-badge {
    position: absolute; top: 6px; left: 6px;
    color: #fff; border-radius: 999px;
    padding: 0.05rem 0.4rem; font-size: 0.8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.cw-info { padding: 0.55rem 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.3rem; }
.cw-title {
    margin: 0; font-weight: 700; font-size: 0.86rem; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cw-next { margin: 0; font-size: 0.8rem; color: var(--text-color-muted); }
.cw-next strong { color: var(--text-color); }
.cw-progress {
    height: 6px; border-radius: 999px;
    background: var(--border-color); overflow: hidden;
}
.cw-progress-bar {
    height: 100%; border-radius: 999px;
    background: var(--primary-strong);
    transition: width 0.35s ease;
}
.cw-count { margin: 0; font-size: 0.74rem; color: var(--text-color-muted); }
.cw-ongoing { font-size: 0.72rem; }
.cw-mark-btn {
    margin-top: 0.15rem;
    border: none; cursor: pointer;
    background: var(--primary-strong); color: #fff;
    border-radius: 999px; padding: 0.35rem 0.5rem;
    font-size: 0.78rem; font-weight: 600;
    transition: filter 0.15s, transform 0.1s;
}
.cw-mark-btn:hover { filter: brightness(1.08); }
.cw-mark-btn:active { transform: scale(0.96); }
.cw-mark-btn:disabled { opacity: 0.6; cursor: default; }
@media (max-width: 600px) {
    .cw-card { flex-basis: 140px; width: 140px; }
}

/* ===== Compteur de temps de visionnage ===== */
.watch-time {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
}
.wt-heading { margin: 0 0 0.4rem; font-size: 1rem; }
.wt-total { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--primary-strong); line-height: 1.2; }
.wt-sub { margin: 0.25rem 0 0.7rem; font-size: 0.78rem; color: var(--text-color-muted); }
.wt-breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.wt-breakdown li {
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
    font-size: 0.82rem; padding: 0.25rem 0.6rem;
    border-left: 4px solid var(--wt-color, var(--border-color));
    background: var(--bg-color); border-radius: 6px;
}
.wt-val { font-weight: 700; }

/* ===== Détail du temps de visionnage : comparaisons + mini-graphiques ===== */
.wt-fact { margin: 0 0 0.7rem; font-size: 0.85rem; font-weight: 600; }
.wt-fact:empty { display: none; }
.wt-more { margin: 0.7rem 0 0; font-size: 0.82rem; }
.ws-section { margin: 1.5rem 0; }
.watch-time + .ws-section { margin-top: 1.5rem; }
.ws-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.ws-fact {
    display: flex; flex-direction: column; gap: 0.2rem; align-items: center; text-align: center;
    background: var(--card-bg-color); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 0.9rem 0.7rem;
}
.ws-fact-emoji { font-size: 2rem; line-height: 1; }
.ws-fact-text { font-weight: 800; color: var(--primary-strong); font-size: 1.05rem; }
.ws-fact-note { font-size: 0.72rem; color: var(--text-color-muted); }
.ws-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.ws-chart {
    background: var(--card-bg-color); border: 1px solid var(--border-color);
    border-radius: 14px; padding: 1rem;
}
.ws-chart h3 { margin: 0 0 0.8rem; font-size: 1rem; }
.ws-donut-wrap { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
.ws-donut {
    width: 130px; height: 130px; border-radius: 50%; flex: 0 0 auto;
    -webkit-mask: radial-gradient(circle, transparent 42%, #000 43%);
    mask: radial-gradient(circle, transparent 42%, #000 43%);
}
.ws-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; }
.ws-dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 0.3rem; }
.ws-legend-time { color: var(--text-color-muted); font-size: 0.78rem; }
.ws-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.ws-bars li { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.ws-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-bar-track { height: 10px; border-radius: 999px; background: var(--border-color); overflow: hidden; display: block; }
.ws-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--primary-strong); }
.ws-bar-val { font-weight: 700; white-space: nowrap; font-size: 0.78rem; }
.ws-title-link { display: flex; align-items: center; gap: 0.5rem; min-width: 0; color: inherit; text-decoration: none; }
.ws-title-link img { width: 28px; height: 40px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }

/* Liens des colonnes latérales : couleur du thème, pas le bleu/violet souligné
   du navigateur (qui change une fois le lien visité). */
.dashboard-sidebar a:not(.btn):not(.upcoming-item),
.dashboard-sidebar a:not(.btn):not(.upcoming-item):visited,
.wt-more a, .wt-more a:visited {
    color: var(--link-color);
    font-weight: 600;
    text-decoration: none;
}
.dashboard-sidebar a:not(.btn):not(.upcoming-item):hover,
.wt-more a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Liens vers un profil (pseudos), partout sur le site : couleur du thème au
   lieu du bleu/violet souligné du navigateur, identique visité ou non. */
a[href^="/user/"]:not(.btn),
a[href^="/user/"]:not(.btn):visited {
    color: var(--link-color);
    font-weight: 600;
    text-decoration: none;
}
a[href^="/user/"]:not(.btn):hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.details-actions { justify-content: flex-start; margin: 4px 0 14px; }


/* --- AFFINEMENTS (refonte) --- */
.dash-nav { justify-content: flex-start; gap: 10px; }

/* Boutons de suppression dans les listes (amis…) : discrets, plus de gros bloc rouge */
#friend-list .btn-red {
    background: transparent;
    color: var(--text-color-muted);
    border: 1.5px solid var(--border-color);
    padding: 3px 12px;
    font-size: 0.78em;
    font-weight: 700;
}
#friend-list .btn-red:hover { background: var(--danger); border-color: var(--danger); color: #fff; opacity: 1; }

/* Liens « nus » (sans classe) : même style partout, plus de bleu navigateur */
a:not([class]), a:not([class]):visited { color: var(--link-color); text-decoration: none; font-weight: 600; }
a:not([class]):hover { color: var(--link-hover-color); text-decoration: underline; }

/* Bouton d'action principal des barres de recherche */
.search-row button[type="submit"], form button[type="submit"].btn-primary {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    color: #fff;
    border-radius: var(--radius-pill);
    padding: 10px 24px;
}
.search-row button[type="submit"]:hover { background: var(--link-hover-color); border-color: var(--link-hover-color); color: #fff; }

/* Tuiles de statistiques : hauteur au contenu, pas d'étirement */
.stats-grid { align-items: flex-start; }
.stat-card { box-shadow: 0 1px 2px rgba(59, 36, 48, 0.05); }
/* Titre de profil : pas de soulignement court sous le nom */
.main-container > h2:first-of-type { display: block; }

/* --- AVATARS ILLUSTRÉS --- */
.avatar-img {
    width: 1.55em; height: 1.55em;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: -0.4em;
    border: 2px solid var(--border-color);
    background: var(--card-bg-color);
}
.dash-header h2 .avatar-img, .main-container > h2 .avatar-img { width: 1.9em; height: 1.9em; vertical-align: -0.55em; margin-right: 4px; }
.avatar-portrait {
    width: 112px; height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 6px 14px var(--shadow-color);
    transition: transform 0.25s, border-color 0.2s, box-shadow 0.2s;
}
.avatar-card:not(.avatar-locked):hover .avatar-portrait { transform: scale(1.06) rotate(-3deg); }
.avatar-locked .avatar-portrait { border-color: var(--border-color); filter: grayscale(0.7) brightness(0.95); }
.avatar-selected .avatar-portrait { border-color: var(--accent-gold); box-shadow: 0 6px 18px var(--shadow-color), 0 0 0 5px color-mix(in srgb, var(--accent-gold) 30%, transparent); }

/* --- ILLUSTRATIONS (pages d'erreur, états vides, bannière) --- */
.error-illustration { max-width: min(400px, 90%); height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); margin-bottom: 8px; }
.error-page .error-code { font-size: 4em; margin-top: 8px; }
.empty-illustration { max-width: min(280px, 80%); height: auto; border-radius: var(--radius-lg); display: block; margin: 0 auto 14px; }
.feed-empty { text-align: center; }
.blindtest-banner {
    background:
        linear-gradient(90deg, rgba(59, 36, 48, 0.82) 0%, rgba(59, 36, 48, 0.45) 55%, rgba(59, 36, 48, 0) 100%),
        url('../img/illustrations/banner.webp') center / cover no-repeat;
    min-height: 96px;
}
.blindtest-banner { background-position: center, right center; }
.error-page .btn-add, .feed-empty .btn-add { background-color: var(--primary-strong); }

/* Admin : avatars illustrés */
.admin-user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.admin-avatar-pill .av-emoji { display: inline-flex; }
.admin-avatar-pill .av-emoji img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.admin-avatar-pill.av-locked .av-emoji img { filter: grayscale(.8); }

/* Blind test : cartes joueurs (style AMQ) */
.player-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 18px auto; max-width: 900px; }
.pcard {
    --tier: #c9a0b8; --tier-glow: rgba(201,160,184,.45);
    width: 118px; border-radius: 14px; overflow: hidden; position: relative; perspective: 600px;
    background: linear-gradient(160deg, #3a2a3e, #241a2a);
    border: 2px solid var(--tier); box-shadow: 0 4px 14px rgba(0,0,0,.28);
    color: #fff; text-align: center;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.pcard.tier-1 { --tier: #7fb4e8; --tier-glow: rgba(127,180,232,.5); }
.pcard.tier-2 { --tier: #c58be8; --tier-glow: rgba(197,139,232,.55); }
.pcard.tier-3 { --tier: #f2c14e; --tier-glow: rgba(242,193,78,.6); }
.pcard-name {
    font-family: var(--font-heading); font-size: .85em; padding: 5px 6px;
    background: rgba(0,0,0,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcard-me .pcard-name { background: var(--tier); color: #2a1a2e; font-weight: 700; }
.pcard-art {
    position: relative; padding: 10px 0 6px;
    background: radial-gradient(circle at 50% 55%, var(--tier-glow), transparent 70%),
                repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 6px, transparent 6px 12px);
}
.pcard-art img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--tier); background: #1d1424; }
.pcard-badge {
    position: absolute; right: 12px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%;
    display: none; align-items: center; justify-content: center; font-weight: 800; font-size: .95em; color: #fff;
}
.pcard-foot { font-size: .75em; padding: 5px 4px; background: rgba(0,0,0,.35); opacity: .8; }
.pcard.is-answered { border-color: #6fe3a3; box-shadow: 0 0 0 3px rgba(111,227,163,.25), 0 0 22px rgba(111,227,163,.55); }
.pcard.is-answered .pcard-badge { display: flex; background: #2fbf7a; }
.pcard.is-answered .pcard-foot { background: #2fbf7a; opacity: 1; font-weight: 700; }
.pcard.is-correct { border-color: #f2c14e; box-shadow: 0 0 26px rgba(242,193,78,.8); transform: translateY(-4px); }
.pcard.is-correct .pcard-badge { display: flex; background: #e0a82a; }
.pcard.is-correct .pcard-foot { background: #e0a82a; color: #2a1a2e; opacity: 1; font-weight: 700; }
.pcard.is-wrong { border-color: #e06a7a; filter: saturate(.6); }
.pcard.is-wrong .pcard-badge { display: flex; background: #d04a5c; }
.pcard.is-wrong .pcard-foot { background: #d04a5c; opacity: 1; }
.pcard.pop::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%);
    transform: translateX(-120%); animation: pcard-shine .7s ease-out;
}
/* "Changement de pose" : l'avatar est tassé au repos, bondit hors du cadre à la validation */
.pcard-art img { transform: translateY(8px) scale(.9); filter: brightness(.82) saturate(.8); transition: transform .35s, filter .35s; }
.pcard.is-answered .pcard-art img, .pcard.is-correct .pcard-art img {
    transform: translateY(-10px) scale(1.18) rotate(-6deg); filter: none;
}
.pcard.is-correct .pcard-art img { transform: translateY(-12px) scale(1.22) rotate(5deg); }
.pcard.is-wrong .pcard-art img { transform: translateY(12px) scale(.86) rotate(8deg); filter: grayscale(.7) brightness(.8); }
.pcard.pop .pcard-art img { animation: pcard-jump .6s cubic-bezier(.2,1.5,.4,1); }
.pcard.pop .pcard-badge { animation: pcard-stamp .45s .15s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pcard-jump {
    0% { transform: translateY(8px) scale(.9) rotate(0); }
    35% { transform: translateY(-26px) scale(1.3) rotate(-12deg); }
    70% { transform: translateY(2px) scale(1.05) rotate(4deg); }
}
@keyframes pcard-stamp { from { transform: scale(2.6) rotate(-25deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes pcard-shine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .pcard.pop::after, .pcard.pop .pcard-art img, .pcard.pop .pcard-badge { animation: none; } }
@media (max-width: 600px) { .pcard { width: 92px; } .pcard-art img { width: 64px; height: 64px; } }

/* Cartes : vraie 2e pose à la validation (l'image "ok" remplace l'image "idle") */
.pcard-art { display: grid; place-items: center; }
.pcard-art img { grid-area: 1 / 1; }
.pcard-art img.pose-ok { opacity: 0; }
.pcard.is-answered .pcard-art img.pose-ok, .pcard.is-correct .pcard-art img.pose-ok { opacity: 1; }
.pcard.is-answered .pcard-art img.pose-idle, .pcard.is-correct .pcard-art img.pose-idle { opacity: 0; }
.pcard.pop .pcard-art img.pose-idle { animation: none; }
.pcard-art img { transition: transform .35s, filter .35s, opacity .15s; }

/* Mini-avatars illustrés (listes de scores, salon, résultats) */
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; border: 1.5px solid var(--border-color, rgba(0,0,0,.15)); }
#score-list li { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Sélecteur rapide d'avatar (tableau de bord) */
.avatar-picker { display: inline-block; position: relative; vertical-align: middle; }
.avatar-picker summary { list-style: none; cursor: pointer; position: relative; display: inline-block; border-radius: 50%; transition: transform .15s; }
.avatar-picker summary::-webkit-details-marker { display: none; }
.avatar-picker summary:hover, .avatar-picker[open] summary { transform: scale(1.06); }
.avatar-picker summary:focus-visible { outline: 3px solid var(--link-color, #e0527f); outline-offset: 2px; }
.avatar-picker-edit {
    position: absolute; right: -4px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center; font-size: 12px; line-height: 1;
    background: var(--link-color, #e0527f); color: #fff; border: 2px solid var(--bg-color, #fff);
}
.avatar-picker-panel {
    position: absolute; left: 0; top: calc(100% + 10px); z-index: 50; width: min(340px, 86vw);
    padding: 14px; border-radius: 16px; background: var(--card-bg, var(--bg-color, #fff));
    border: 1px solid var(--header-border-color, rgba(0,0,0,.12)); box-shadow: 0 12px 34px rgba(0,0,0,.28);
    font-size: 1rem; font-weight: 400; text-align: left;
}
.avatar-picker-title { font-family: var(--font-heading); font-weight: 600; margin-bottom: 10px; }
.avatar-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avatar-picker-grid form { margin: 0; }
.avatar-opt {
    width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
    border: 2px solid transparent; border-radius: 12px; background: transparent; color: inherit; font: inherit; font-size: .72rem; cursor: pointer;
}
.avatar-opt img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
button.avatar-opt:hover { background: rgba(224,82,127,.12); border-color: var(--link-color, #e0527f); }
.avatar-opt.is-current { border-color: var(--link-color, #e0527f); background: rgba(224,82,127,.14); cursor: default; }
.avatar-opt.is-locked { opacity: .45; filter: grayscale(.8); cursor: not-allowed; }
.avatar-picker-more, .avatar-picker-more:visited { display: block; margin-top: 10px; font-size: .85rem; color: var(--link-color); font-weight: 600; text-decoration: none; }
.avatar-picker-more:hover { color: var(--link-hover-color); text-decoration: underline; }
@media (max-width: 480px) { .avatar-picker-panel { position: fixed; left: 8px; right: 8px; width: auto; top: 90px; } }

/* Avatars spéciaux (offert / propriétaire) */
.badge-special { color: #e9b949; font-weight: 600; }
.admin-avatar-pill.av-special { border-color: #e9b949; }
.admin-avatar-pill:disabled { cursor: not-allowed; opacity: .75; }

/* Migiude : l'assistant du site (bulle de chat) */
.faq-bot-bubble { overflow: hidden; padding: 0; }
.faq-bot-bubble img { width: 100%; height: 100%; object-fit: cover; display: block; }
.faq-bot-bubble.is-open img { display: none; }
.faq-bot-bubble.is-open::after { content: '✕'; }
.faq-bot-title { display: inline-flex; align-items: center; gap: 8px; }
.faq-bot-title img { border-radius: 50%; }
.faq-bot-typing { opacity: .7; font-style: italic; }
