@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700;800&display=swap');

:root {
    --bg: #17131f;
    --bg-soft: #211b2d;
    --card: rgba(38, 31, 51, .88);
    --card-border: rgba(255,255,255,.10);
    --text: #fff9f3;
    --muted: #c9bfcc;
    --accent: #f3bd55;
    --accent-2: #e9789e;
    --accent-3: #8fd8c3;
    --danger: #f28b8b;
    --radius: 24px;
    --shadow: 0 24px 70px rgba(0,0,0,.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 5%, rgba(233,120,158,.17), transparent 32rem),
        radial-gradient(circle at 90% 10%, rgba(243,189,85,.13), transparent 28rem),
        var(--bg);
    font-family: "DM Sans", system-ui, sans-serif;
    line-height: 1.5;
}

.background-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 30% 80%, rgba(143,216,195,.06), transparent 22rem);
}

.page-shell {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0 28px;
    position: relative;
}

.hero {
    text-align: center;
    padding: 30px 20px 48px;
    position: relative;
}

.hero.compact {
    padding-top: 18vh;
}

.hero-badge {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent), #f18d62);
    color: #241a18;
    font-family: "Playfair Display", serif;
    font-size: 31px;
    font-weight: 800;
    box-shadow: 0 14px 45px rgba(243,189,85,.25);
}

.confetti {
    position: absolute;
    top: 20px;
    right: 17%;
    color: var(--accent);
    font-size: 34px;
    transform: rotate(18deg);
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
}

h1, h2, h3 {
    margin-top: 0;
    font-family: "Playfair Display", Georgia, serif;
    line-height: 1.08;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(42px, 8vw, 74px);
    letter-spacing: -.03em;
}

h1 span {
    color: var(--accent);
}

.hero-subtitle {
    margin: 0;
    color: var(--accent-2);
    font-size: 22px;
    font-weight: 700;
}

.intro {
    width: min(620px, 100%);
    margin: 20px auto 0;
    color: var(--muted);
    font-size: 16px;
}

.section,
.challenge-card,
.mini-gallery {
    margin-bottom: 24px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: 30px;
}

.challenge-selector,
.challenge-card,
.mini-gallery,
.gallery-challenge {
    padding: 28px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.challenge-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.challenge-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: rgba(255,255,255,.025);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.challenge-tabs a:hover {
    transform: translateY(-2px);
    border-color: rgba(243,189,85,.5);
}

.challenge-tabs a.active {
    color: #2a201a;
    background: var(--accent);
    border-color: var(--accent);
}

.challenge-tabs strong {
    font-size: 22px;
    line-height: 1;
}

.challenge-tabs span {
    font-size: 11px;
    margin-top: 4px;
}

.challenge-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.challenge-card::before {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    top: -150px;
    right: -100px;
    border-radius: 50%;
    background: rgba(233,120,158,.12);
}

.challenge-number {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 50%;
    color: #2a201a;
    background: var(--accent);
    font-weight: 800;
    font-size: 20px;
}

.challenge-card h2 {
    max-width: 680px;
    margin: 0 auto 30px;
    font-size: clamp(27px, 5vw, 40px);
}

.upload-form {
    width: min(560px, 100%);
    margin: auto;
    text-align: left;
}

.field,
.file-drop {
    display: block;
    margin-bottom: 18px;
}

.field > span {
    display: block;
    font-weight: 700;
    margin-bottom: 3px;
}

.field small,
.file-drop small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.field input[type="text"] {
    width: 100%;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(0,0,0,.18);
    outline: none;
    font: inherit;
}

.field input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(243,189,85,.12);
}

.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 28px 20px;
    text-align: center;
    border: 1px dashed rgba(243,189,85,.5);
    border-radius: 18px;
    background: rgba(243,189,85,.035);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.file-drop:hover {
    background: rgba(243,189,85,.07);
    border-color: var(--accent);
}

.file-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.file-icon {
    font-size: 36px;
    margin-bottom: 7px;
}

.file-drop strong {
    font-size: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 14px;
    border: 0;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.button-primary {
    width: 100%;
    color: #241a18;
    background: linear-gradient(135deg, var(--accent), #f19a72);
}

.button-secondary {
    color: var(--text);
    background: rgba(255,255,255,.07);
    border: 1px solid var(--card-border);
}

.gallery-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.privacy-note {
    margin: 18px auto 0;
    max-width: 600px;
    color: #9d94a3;
    font-size: 11px;
    text-align: center;
}

.flash {
    margin: 0 auto 24px;
    padding: 15px 18px;
    border-radius: 14px;
    text-align: center;
    font-weight: 600;
}

.flash.success {
    color: #dff8ed;
    background: rgba(68,167,130,.17);
    border: 1px solid rgba(143,216,195,.25);
}

.flash.error {
    color: #ffe1e1;
    background: rgba(215,81,81,.15);
    border: 1px solid rgba(242,139,139,.3);
}

.mini-counts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.mini-counts a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 13px 7px;
    color: var(--muted);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    text-decoration: none;
}

.mini-counts span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.mini-counts strong {
    color: var(--text);
    font-size: 22px;
}

.mini-counts small {
    font-size: 10px;
}

.gallery-challenge {
    margin-bottom: 18px;
}

.challenge-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.challenge-title h3 {
    margin-bottom: 0;
    font-size: 22px;
}

.number {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #241a18;
    font-weight: 800;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.photo-card {
    overflow: hidden;
    color: var(--text);
    border-radius: 14px;
    background: #17131f;
    text-decoration: none;
}

.photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform .25s ease;
}

.photo-card:hover img {
    transform: scale(1.035);
}

.photo-card span {
    display: block;
    overflow: hidden;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty {
    margin: 0;
    color: #9d94a3;
    font-size: 14px;
}

.honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

footer {
    padding: 24px 0 5px;
    color: #807786;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 680px) {
    .page-shell {
        width: min(100% - 20px, 960px);
        padding-top: 15px;
    }

    .hero {
        padding: 25px 10px 32px;
    }

    .hero-badge {
        width: 68px;
        height: 68px;
        font-size: 25px;
    }

    .confetti {
        right: 4%;
        top: 10px;
    }

    .challenge-selector,
    .challenge-card,
    .mini-gallery,
    .gallery-challenge {
        padding: 20px;
        border-radius: 20px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
    }

    .challenge-tabs {
        grid-template-columns: repeat(3, 1fr);
    }

    .mini-counts {
        grid-template-columns: repeat(3, 1fr);
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 390px) {
    .photo-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .challenge-card,
    .challenge-selector,
    .mini-gallery,
    .gallery-challenge {
        padding: 17px;
    }
}


.upload-form-disabled { opacity: .62; }
.upload-form-disabled .file-drop { cursor: not-allowed; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.02); }
.upload-form-disabled .file-drop:hover { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.02); }
.upload-form-disabled input[type="text"]:disabled { cursor: not-allowed; color: #9d94a3; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; filter: none; }
.disabled-notice { display:flex; flex-direction:column; gap:2px; margin:18px auto 0; padding:13px 16px; max-width:560px; border:1px solid rgba(255,255,255,.09); border-radius:14px; color:#b8afbd; background:rgba(255,255,255,.035); text-align:center; font-size:12px; }
.disabled-notice strong { color:var(--text); font-size:13px; }

.file-drop { transition: border-color .2s, background .2s; }

.file-preview {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: .75rem;
}

.file-drop.has-file {
    border-color: #3ddc84;
    background: rgba(61, 220, 132, .12);
}
.file-drop.has-file .file-title {
    color: #3ddc84;
    font-size: 1.25rem;
}
.file-drop.has-file .file-hint {
    word-break: break-all; /* noms de fichiers type IMG_20261007_223145.jpg */
}

.file-drop.has-error {
    border-color: #ff5d5d;
    background: rgba(255, 93, 93, .12);
}
.file-drop.has-error .file-title { color: #ff5d5d; }
