/* ============================================================
   VirtualNostalgia — Design System
   Thème sombre chaleureux, touches rétro, ultra moderne
   ============================================================ */

:root {
    --bg: #0f0d0b;
    --bg-soft: #171310;
    --surface: #1e1915;
    --surface-2: #262019;
    --surface-3: #322a20;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f4ede4;
    --text-soft: #b8ab9a;
    --text-faint: #7d7264;
    --accent: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.14);
    --accent-strong: #d97706;
    --accent-2: #e879f9;
    --accent-3: #38bdf8;
    --danger: #ef4444;
    --success: #34d399;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.3);
    --grain-opacity: 0.035;
    --hero-grad: linear-gradient(100deg, var(--accent), var(--accent-2));
    --brand-grad: linear-gradient(135deg, var(--accent), var(--accent-2));
    --font-display: 'Outfit', 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Manrope', 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-retro: 'VT323', monospace;
    --nav-h: 68px;
}

/* Les thèmes commutables sont définis dans themes.css (pilotés par variables). */

/* Thèmes d'époque (appliqués au profil) */
.era-theme-seventies { --accent: #e07b39; --accent-2: #c9a227; --accent-soft: rgba(224, 123, 57, 0.16); }
.era-theme-eighties { --accent: #ff4d9d; --accent-2: #22d3ee; --accent-soft: rgba(255, 77, 157, 0.14); }
.era-theme-nineties { --accent: #a78bfa; --accent-2: #4ade80; --accent-soft: rgba(167, 139, 250, 0.15); }
.era-theme-y2k { --accent: #38bdf8; --accent-2: #c0c0c0; --accent-soft: rgba(56, 189, 248, 0.14); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Grain nostalgique */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.18;
    letter-spacing: -0.025em;
    font-weight: 700;
    text-wrap: balance;
}

h1 { font-weight: 800; }

p { text-wrap: pretty; }

::selection { background: var(--accent); color: #1a1206; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ============ Navigation ============ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(15, 13, 11, 0.82);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.nav-logo img { height: 40px; width: auto; display: block; }

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-logo .logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--brand-grad);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    box-shadow: 0 0 18px var(--accent-soft);
}

.nav-logo em { font-style: normal; color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }

.nav-links a {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--text-soft);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

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

.nav-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.nav-burger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 8px 12px;
    font-size: 1.1rem;
}

/* Menu déroulant utilisateur */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
    z-index: 200;
}

.dropdown.open .dropdown-menu { display: block; animation: pop 0.18s ease; }

.dropdown-menu a, .dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    color: var(--text-soft);
    background: none;
    border: none;
    text-align: left;
    transition: all 0.15s;
}

.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--text); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* Sous-menu déroulant dans la barre de navigation (« Ma collection ») */
.nav-group { position: relative; }

.nav-group-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--text-soft);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.2s;
}

.nav-group-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-group.active-group > .nav-group-btn { color: var(--accent); background: var(--accent-soft); }
.nav-group-caret { opacity: 0.65; transition: transform 0.2s; }

.nav-group-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 214px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
    z-index: 200;
}

.nav-group-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-soft);
    white-space: nowrap;
    transition: all 0.15s;
}

.nav-group-menu a:hover { background: var(--surface-2); color: var(--text); }
.nav-group-menu a.active { color: var(--accent); background: var(--accent-soft); }

/* Ouverture au clic (fonctionne aussi au bureau) */
.nav-group.open > .nav-group-menu { display: block; animation: pop 0.18s ease; }

/* Bureau : ouverture aussi au survol et au clavier */
@media (min-width: 1181px) {
    .nav-group:hover .nav-group-menu,
    .nav-group:focus-within .nav-group-menu { display: block; animation: pop 0.18s ease; }
    .nav-group:hover .nav-group-caret { transform: rotate(180deg); }
}

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

/* ============ Boutons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s;
    line-height: 1.3;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #1a1206;
    box-shadow: 0 4px 20px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.45s ease;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-primary:hover::after { left: 130%; }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover { background: var(--surface-3); }

.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.btn-danger { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.22); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ============ Formulaires ============ */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 7px;
}

.input, .textarea, .select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea { resize: vertical; min-height: 100px; }

.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b8ab9a' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.field-error { color: #fca5a5; font-size: 0.82rem; margin-top: 5px; }
.field-hint { color: var(--text-faint); font-size: 0.8rem; margin-top: 5px; }

.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.checkbox-row label { margin: 0; }

/* ============ Cartes ============ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-pad { padding: 24px; }

.section-title {
    font-size: 1.5rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-sub { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 24px; }

/* Grille objets */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.25s;
    position: relative;
}

.item-card:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 158, 11, 0.12);
}

.item-card-img {
    aspect-ratio: 1;
    background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--surface-2));
    display: grid;
    place-items: center;
    overflow: hidden;
}

.item-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.item-card:hover .item-card-img img { transform: scale(1.05); }

.item-card-body { padding: 16px; }
.item-card-body h3 { font-size: 1.02rem; margin-bottom: 4px; }
.item-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.badge-era { border-color: transparent; }

/* ============ Fil / Publications ============ */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}

.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.post-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }

.post-head-info { flex: 1; min-width: 0; }
.post-head-info .name { font-weight: 600; font-size: 0.95rem; }
.post-head-info .meta { color: var(--text-faint); font-size: 0.8rem; }

.post-content { white-space: pre-wrap; word-wrap: break-word; font-size: 0.97rem; margin-bottom: 12px; }

.post-image {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.post-image img { width: 100%; max-height: 520px; object-fit: cover; }

.post-actions { display: flex; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }

.post-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.86rem;
    color: var(--text-soft);
    background: none;
    border: none;
    transition: all 0.15s;
}

.post-action:hover { background: var(--surface-2); color: var(--text); }
.post-action.liked { color: #fb7185; }
.post-action.liked .heart-icon, .btn.liked .heart-icon { fill: #fb7185; color: #fb7185; }

/* Commentaires */
.comments { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; display: none; }
.comments.open { display: block; }

.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-bubble { background: var(--surface-2); border-radius: 14px; padding: 9px 14px; flex: 1; }
.comment-bubble .who { font-weight: 600; font-size: 0.83rem; }
.comment-bubble p { font-size: 0.9rem; color: var(--text-soft); }

.comment-form { display: flex; gap: 10px; margin-top: 10px; }
.comment-form input { flex: 1; }

/* ============ Profil ============ */
.profile-cover {
    height: 260px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: linear-gradient(120deg, var(--surface-3), var(--accent-soft), var(--surface-2));
    background-size: cover;
    background-position: center;
    position: relative;
}

.profile-head {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin-top: -64px;
    position: relative;
    z-index: 2;
    padding: 0 8px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 128px;
    height: 128px;
    border-radius: 28px;
    object-fit: cover;
    border: 4px solid var(--bg);
    box-shadow: var(--shadow-soft);
    background: var(--surface-2);
}

.profile-id { flex: 1; min-width: 200px; padding-bottom: 6px; }
.profile-id h1 { font-size: 1.7rem; }
.profile-id .username { color: var(--accent); font-size: 0.95rem; }
.profile-id .bio { color: var(--text-soft); font-size: 0.93rem; margin-top: 6px; max-width: 560px; }

.profile-stats { display: flex; gap: 22px; margin-top: 10px; flex-wrap: wrap; }
.profile-stats .stat { font-size: 0.88rem; color: var(--text-faint); }
.profile-stats .stat b { color: var(--text); font-size: 1.05rem; margin-right: 4px; }

.profile-actions { display: flex; gap: 10px; padding-bottom: 8px; flex-wrap: wrap; }

/* Onglets */
.tabs {
    display: flex;
    gap: 4px;
    margin: 28px 0 24px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

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

.tab {
    padding: 12px 20px;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text-faint);
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover { color: var(--text-soft); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.3s ease; }

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

/* ============ Alertes flash ============ */
.flash {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 500;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    max-width: 380px;
}

.flash-success { background: #0d2a1e; color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3); }
.flash-error { background: #2a0d0d; color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============ Hero (accueil / landing) ============ */
.hero {
    padding: 84px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -220px;
    left: 12%;
    width: 700px;
    height: 560px;
    background: radial-gradient(ellipse, var(--accent-soft), transparent 62%);
    pointer-events: none;
    animation: drift 14s ease-in-out infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -260px;
    right: 4%;
    width: 560px;
    height: 520px;
    background: radial-gradient(ellipse, rgba(232, 121, 249, 0.09), transparent 62%);
    pointer-events: none;
    animation: drift 18s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 26px) scale(1.08); }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 46px;
    align-items: center;
    position: relative;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(2.3rem, 5vw, 3.7rem);
    margin-bottom: 20px;
    position: relative;
}

.hero h1 .grad {
    background: var(--hero-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p.lead { color: var(--text-soft); font-size: 1.1rem; max-width: 540px; margin-bottom: 32px; position: relative; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; position: relative; }

.hero-stats {
    display: flex;
    gap: 44px;
    margin-top: 52px;
    flex-wrap: wrap;
    position: relative;
}

.hero-stats .hs b { display: block; font-family: var(--font-retro); font-size: 2.5rem; color: var(--accent); line-height: 1; }
.hero-stats .hs span { color: var(--text-faint); font-size: 0.84rem; }

/* Mockup TV rétro en pur CSS */
.hero-tv-wrap { position: relative; display: grid; place-items: center; }

.hero-tv {
    width: min(100%, 430px);
    background: linear-gradient(160deg, #8b5a2b, #6d4520 55%, #5a3719);
    border-radius: 24px;
    padding: 24px 24px 56px;
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,0.25),
        inset 0 -4px 8px rgba(0,0,0,0.4),
        0 30px 60px rgba(0,0,0,0.55);
    transform: rotate(-2deg);
    transition: transform 0.4s ease;
}

.hero-tv:hover { transform: rotate(0deg) scale(1.02); }

.hero-tv-screen {
    aspect-ratio: 4 / 3;
    border-radius: 30px / 24px;
    border: 6px solid #3a2812;
    background:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 2px, transparent 2px 4px),
        radial-gradient(ellipse at 32% 24%, rgba(255,255,255,0.14), transparent 46%),
        linear-gradient(160deg, #1d3a5e, #0b1526);
    box-shadow: inset 0 0 28px rgba(0,0,0,0.9);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.hero-tv-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, transparent 48%, rgba(255,255,255,0.05) 50%, transparent 52%);
    background-size: 100% 90px;
    animation: crt-roll 6s linear infinite;
}

@keyframes crt-roll {
    from { background-position: 0 -90px; }
    to { background-position: 0 100vh; }
}

.hero-tv-screen .on-air {
    font-family: var(--font-retro);
    color: #ffd98a;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 18px rgba(245, 158, 11, 0.65);
    z-index: 1;
}

.hero-tv-screen .on-air b { display: block; font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 400; }
.hero-tv-screen .on-air span { font-size: 1rem; opacity: 0.75; }

.hero-tv-panel { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.hero-tv-panel .knob { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f0d9a8, #b8923f 60%, #8a6a25); box-shadow: 0 3px 6px rgba(0,0,0,0.5); }
.hero-tv-panel .grill { flex: 1; height: 16px; border-radius: 6px; background: repeating-linear-gradient(90deg, #2c1e0d 0 3px, #46301a 3px 7px); }

/* Vignettes flottantes autour de la TV */
.float-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 25, 21, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-soft);
    box-shadow: var(--shadow-soft);
    animation: floaty 5s ease-in-out infinite;
}

.float-chip .icon { color: var(--accent); }
.float-chip.c1 { top: 4%; inset-inline-start: -4%; animation-delay: 0s; }
.float-chip.c2 { bottom: 16%; inset-inline-end: -5%; animation-delay: 1.4s; }
.float-chip.c3 { bottom: -4%; inset-inline-start: 8%; animation-delay: 2.6s; }

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============ Étapes (landing) ============ */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; counter-reset: step; }

.step-card {
    position: relative;
    padding: 30px 26px 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.step-card::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    position: absolute;
    top: 8px;
    inset-inline-end: 16px;
    font-family: var(--font-retro);
    font-size: 3.4rem;
    color: var(--accent);
    opacity: 0.16;
    line-height: 1;
}

.step-card h3 { font-size: 1.08rem; margin: 14px 0 8px; }
.step-card p { color: var(--text-soft); font-size: 0.9rem; }

/* ============ Bandeau CTA final ============ */
.cta-band {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(245, 158, 11, 0.16), transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(232, 121, 249, 0.12), transparent 55%),
        var(--surface);
    border: 1px solid var(--border-strong);
    overflow: hidden;
}

.cta-band h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: 12px; }
.cta-band p { color: var(--text-soft); max-width: 520px; margin: 0 auto 28px; }

/* ============ Apparition au défilement ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero::before, .hero::after, .float-chip, .hero-tv-screen::after { animation: none; }
}

@media (max-width: 920px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero-tv { transform: rotate(0); }
    .float-chip.c1 { inset-inline-start: 0; }
    .float-chip.c2 { inset-inline-end: 0; }
}

/* Sections accueil */
.home-section { padding: 60px 0; }

.era-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }

.era-card {
    padding: 26px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.era-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--era-color, var(--accent));
}

.era-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.era-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.era-card .years { font-family: var(--font-retro); font-size: 1.15rem; color: var(--era-color, var(--accent)); }
.era-card p { color: var(--text-soft); font-size: 0.88rem; margin-top: 8px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

.feature {
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.25s;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.feature .icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-soft);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--text-soft); font-size: 0.9rem; }

/* ============ Layout deux colonnes (fil) ============ */
.feed-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
    padding: 28px 0;
}

.feed-side { position: sticky; top: calc(var(--nav-h) + 20px); }

.side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}

.side-card h3 { font-size: 1rem; margin-bottom: 14px; }

.suggestion { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.suggestion img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.suggestion .info { flex: 1; min-width: 0; }
.suggestion .info .n { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion .info .u { font-size: 0.76rem; color: var(--text-faint); }

/* Composeur */
.composer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 22px; }
.composer textarea { border: none; background: transparent; width: 100%; color: var(--text); font-size: 1rem; resize: none; min-height: 60px; }
.composer textarea:focus { outline: none; }
.composer-bar { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.composer-bar .spacer { flex: 1; }

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-soft);
    border: 1px dashed var(--border-strong);
    cursor: pointer;
    transition: all 0.15s;
}

.file-label:hover { color: var(--accent); border-color: var(--accent); }
.file-label input { display: none; }

/* ============ Pagination ============ */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-soft);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #1a1206; border-color: var(--accent); font-weight: 700; }
.pagination .disabled { opacity: 0.35; }

/* ============ Vide ============ */
.empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-faint);
}
.empty .icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.6; }
.empty h3 { color: var(--text-soft); margin-bottom: 8px; }
.empty p { font-size: 0.92rem; max-width: 400px; margin: 0 auto 20px; }

/* ============ Filtres catalogue ============ */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 26px;
}

.filter-bar .input, .filter-bar .select { width: auto; }
.filter-bar .search { flex: 1; min-width: 200px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

.chip {
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-soft);
    transition: all 0.2s;
}

.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ============ Auth ============ */
.auth-wrap {
    min-height: calc(100vh - var(--nav-h));
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 38px 34px;
    box-shadow: var(--shadow);
}

.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 26px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--text-soft); }
.auth-alt a { color: var(--accent); font-weight: 600; }

/* ============ Footer ============ */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 60px;
    color: var(--text-faint);
    font-size: 0.86rem;
}

.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer a:hover { color: var(--accent); }

/* ============ Membres ============ */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.member-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    transition: all 0.25s;
}

.member-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.member-card img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 3px solid var(--accent-soft); }
.member-card h3 { font-size: 1.05rem; }
.member-card .u { color: var(--accent); font-size: 0.84rem; margin-bottom: 10px; }
.member-card .counts { display: flex; justify-content: center; gap: 16px; font-size: 0.8rem; color: var(--text-faint); }

/* ============ Détail objet ============ */
.item-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 36px 0; align-items: start; }

.item-detail-img {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--surface));
    position: sticky;
    top: calc(var(--nav-h) + 20px);
}

.collectors-row { display: flex; margin-top: 14px; }
.collectors-row img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--bg); margin-left: -8px; object-fit: cover; }
.collectors-row img:first-child { margin-left: 0; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
    .feed-layout { grid-template-columns: 1fr; }
    .feed-side { position: static; order: -1; }
    .item-detail { grid-template-columns: 1fr; }
    .item-detail-img { position: static; }
}

/* Le menu passe en tiroir dès que les liens ne tiennent plus (8 entrées) */
@media (max-width: 1180px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(15, 13, 11, 0.97);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border-strong);
        padding: 14px 20px 18px;
        gap: 4px;
        max-height: calc(100vh - var(--nav-h));
        overflow-y: auto;
        box-shadow: var(--shadow);
    }

    body.theme-logo .nav-links { background: rgba(18, 14, 38, 0.97); }

    .nav-links.open { display: flex; animation: pop 0.18s ease; }
    .nav-links a { padding: 13px 16px; border-radius: 12px; font-size: 0.98rem; }
    .nav-burger { display: block; flex-shrink: 0; }

    /* Sous-menu en accordéon dans le tiroir mobile */
    .nav-group { width: 100%; }
    .nav-group-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 13px 16px;
        border-radius: 12px;
        font-size: 0.98rem;
    }
    .nav-group-btn .nav-group-caret { margin-inline-start: auto; }
    .nav-group-menu {
        position: static;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        min-width: 0;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.03);
        padding: 4px;
        margin: 4px 0 4px 14px;
    }
    .nav-group.open .nav-group-menu { display: flex; }
    .nav-group.open .nav-group-caret { transform: rotate(180deg); }
    .nav-group-menu a { padding: 12px 14px; font-size: 0.95rem; }
}

@media (max-width: 768px) {
    .nav-inner { gap: 10px; padding: 0 14px; }
    .nav-logo span:not(.logo-mark) { font-size: 1.05rem; }
    .nav-logo img { height: 34px; }
    .lang-btn span { display: none; }
    .lang-btn { padding: 8px 10px; }
    .nav-actions { gap: 6px; }
    .nav-actions .btn-sm { padding: 6px 11px; font-size: 0.78rem; }

    .hero { padding: 56px 0 46px; }
    .hero-stats { gap: 28px; }
    .profile-head { gap: 16px; }
    .profile-avatar { width: 96px; height: 96px; }
    .auth-card { padding: 28px 22px; }
    .container, .container-narrow { padding: 0 14px; }
    .card-pad { padding: 18px; }
    .section-title { font-size: 1.3rem; }
    .tabs { gap: 0; }
    .tab { padding: 11px 13px; font-size: 0.86rem; }
    .items-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .post-card { padding: 15px; }
    .filter-bar .search { min-width: 140px; }
    .flash { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}

@media (max-width: 400px) {
    .nav-logo span:not(.logo-mark) { display: none; }
    .hero h1 { font-size: 1.9rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============ Icônes ============ */
.icon { vertical-align: -0.18em; flex-shrink: 0; }

.nav-links a, .dropdown-menu a, .dropdown-menu button, .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-links a .icon { opacity: 0.75; }
.nav-links a.active .icon { opacity: 1; }

.section-title .icon { color: var(--accent); }

.icon-chip {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

/* ============ Sélecteur de langue ============ */
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.lang-btn:hover { color: var(--text); border-color: var(--border-strong); }

.dropdown-menu a.lang-active { color: var(--accent); background: var(--accent-soft); }

.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand .icon { color: var(--accent); }

/* ============ Arabe (Cairo) & RTL ============ */
body.lang-ar,
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3, body.lang-ar h4,
body.lang-ar .btn, body.lang-ar input, body.lang-ar textarea, body.lang-ar select {
    font-family: 'Cairo', 'Segoe UI', sans-serif !important;
    letter-spacing: 0;
}

[dir="rtl"] .dropdown-menu { right: auto; left: 0; }
[dir="rtl"] .flash { right: auto; left: 24px; }
[dir="rtl"] .admin-sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .admin-sidebar .count-pill { margin-left: 0; margin-right: auto; }
[dir="rtl"] .cell-actions { justify-content: flex-start; }
[dir="rtl"] .collectors-row img { margin-left: 0; margin-right: -8px; }
[dir="rtl"] .collectors-row img:first-child { margin-right: 0; }
[dir="rtl"] .select { background-position: left 14px center; padding-right: 16px; padding-left: 40px; }

@keyframes slideInRtl {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

[dir="rtl"] .flash { animation-name: slideInRtl; }
