:root {
    --bg: #0f1115;
    --card: #181b22;
    --card-2: #1f232c;
    --text: #e7e9ee;
    --muted: #9aa3b2;
    --accent: #1db954;
    --accent-2: #3b82f6;
    --border: #2a2f3a;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent-2); }

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

header.site {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 16px;
    max-width: 720px;
    margin: 0 auto;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #ff6ec4, #7873f5, #38bdf8, #4ade80) 1;
}

header.site h1 {
    font-size: 26px;
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.5px;
}
header.site h1,
header.site h1 a {
    background: linear-gradient(90deg, #ff6ec4, #7873f5, #38bdf8, #4ade80, #ff6ec4);
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-decoration: none;
    animation: title-shimmer 8s linear infinite;
}
@keyframes title-shimmer {
    to { background-position: 250% center; }
}

header.site .nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
header.site .nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--card-2);
    border: 1px solid var(--border);
    transition: transform .12s ease, border-color .12s ease, color .12s ease, background .12s ease;
}
header.site .nav a:hover {
    transform: translateY(-1px);
    border-color: #7873f5;
    background: rgba(120, 115, 245, 0.15);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    header.site h1, header.site h1 a { animation: none; }
}

.intro {
    position: relative;
    background:
        linear-gradient(135deg, rgba(255,110,196,0.12), rgba(120,115,245,0.12) 45%, rgba(56,189,248,0.10));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 22px 20px 26px;
    margin-bottom: 24px;
    overflow: hidden;
}
/* barre d'accent dégradée à gauche */
.intro::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #ff6ec4, #7873f5, #38bdf8);
}
.intro p { margin: 0; }
.intro p:first-child {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(90deg, #ff6ec4, #7873f5, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.intro p:last-child { color: var(--text); opacity: 0.85; }

.project {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: 0; }
.project-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.project-head a {
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}
.project-desc { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.for-sale {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(29,185,84,0.12);
    border: 1px solid var(--accent);
    color: var(--accent);
}
.contact-email { font-size: 18px; }
.contact-email a { font-weight: 600; }

.post {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 22px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.post:hover {
    transform: translateY(-3px);
    border-color: rgba(120, 115, 245, 0.5);
    box-shadow: 0 12px 34px rgba(120, 115, 245, 0.18);
}

.post .caption {
    font-size: 16px;
    margin: 0 0 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post .gif img,
.post .gif video {
    width: 100%;
    border-radius: 10px;
    display: block;
    margin-bottom: 12px;
}

/* Placeholder avant chargement de la vidéo (lazy) pour limiter le saut visuel */
.post .gif video.post-video:not([src]) {
    min-height: 200px;
    background: var(--card-2);
}

.thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.post .spotify iframe {
    width: 100%;
    border: 0;
    border-radius: 12px;
}

.post .meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 48px 0;
}

/* ---- Formulaires / admin ---- */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 22px;
}
.card h2 { margin-top: 0; font-size: 16px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }

input[type=text], input[type=password], input[type=url], textarea, select {
    width: 100%;
    background: var(--card-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}
textarea { resize: vertical; min-height: 70px; }

button, .btn {
    background: var(--accent);
    color: #06210f;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button.secondary, .btn.secondary {
    background: var(--card-2);
    color: var(--text);
    border: 1px solid var(--border);
}
button.danger, .btn.danger { background: var(--danger); color: #fff; }
button:hover, .btn:hover { filter: brightness(1.05); }

.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; }

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.error { background: rgba(239,68,68,0.12); border: 1px solid var(--danger); color: #fca5a5; }
.alert.ok { background: rgba(29,185,84,0.12); border: 1px solid var(--accent); color: #86efac; }

/* ---- Grille de gifs Tenor ---- */
.gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
    max-height: 360px;
    overflow-y: auto;
}
.gif-grid img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}
.gif-grid img.selected { border-color: var(--accent); }

.selected-gif {
    margin-top: 12px;
}
.selected-gif img { max-width: 100%; border-radius: 10px; }

table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th, table.users td {
    text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border);
}
table.users .badge {
    font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: var(--card-2); border: 1px solid var(--border); color: var(--muted);
}
table.users .badge.admin { color: var(--accent); border-color: var(--accent); }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}
.pager-info { color: var(--muted); font-size: 13px; }
.btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Posts cassés */
.post-row.broken {
    background: rgba(239, 68, 68, 0.08);
    border-radius: 8px;
}
.broken-badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
}
.broken-list { margin-top: 10px; }
.broken-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
