:root {
    --bg: transparent;
    --paper: #c8a96e;
    --paper-dark: #9a7a45;
    --ink: #2a1005;
    --red: #c0392b;
    --gold: #f0c040;
    --font-title: 'Noto Sans Mono', monospace;
    --font-mono: 'Noto Sans Mono', monospace;
}

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

body {
    background-color: transparent;
    color: var(--paper);
    font-family: var(--font-mono);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('assets/bg-primes.png');
    background-size: 100% auto;
    background-repeat: repeat-y;
    filter: blur(4px);
    z-index: -1;
}

.valider-btn.pending {
    background: var(--accent);
    color: #111;
}

#validation-modal {
    display: none;
    position: fixed !important;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

#validation-modal.show {
    display: flex;
}

.val-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.val-modal-box {
    position: relative;
    z-index: 1;
    background: var(--paper);
    color: var(--ink);
    border-radius: 12px;
    padding: 36px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: modalIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#val-titre {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--ink);
}

#val-defi {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

#val-gain {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--red);
}

#val-msg {
    font-size: 0.85rem;
    min-height: 1em;
    font-weight: 700;
    color: #555;
}

/* ── NAV ── */
#primes-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 2px solid rgba(192, 150, 80, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(26, 10, 0, 0.10);
    backdrop-filter: blur(8px);
}

#back-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: sepia(1) saturate(2) hue-rotate(5deg);
    transition: transform 0.2s;
}

#back-btn:hover img {
    transform: translateX(-4px);
}

.nav-logo {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--gold);
    text-decoration: none;
    margin-left: 12vw;
}

#player-score {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(192, 150, 80, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
}

#player-name {
    font-size: 0.85rem;
    color: var(--paper-dark);
}

#player-prime {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

.berries-label {
    font-size: 0.75rem;
    color: var(--paper-dark);
}

/* ── MAIN ── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.section-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: 0.08em;
}

#top3-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
}

.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.podium-crown {
    font-size: 1.8rem;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.podium-rank {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--gold);
}

.podium-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--paper);
    text-align: center;
}

.podium-prime {
    font-size: 0.85rem;
    color: var(--gold);
}

.podium-bar {
    width: 100%;
    background: linear-gradient(180deg, rgba(192, 150, 80, 0.4), rgba(192, 150, 80, 0.1));
    border: 1px solid rgba(192, 150, 80, 0.4);
    border-radius: 6px 6px 0 0;
}

#podium-1 .podium-bar {
    background: linear-gradient(180deg, rgba(240, 192, 64, 0.5), rgba(240, 192, 64, 0.1));
    border-color: var(--gold);
}

#podium-2 .podium-bar {
    background: linear-gradient(180deg, rgba(180, 180, 180, 0.4), rgba(180, 180, 180, 0.1));
    border-color: #aaa;
}

#podium-3 .podium-bar {
    background: linear-gradient(180deg, rgba(180, 100, 40, 0.4), rgba(180, 100, 40, 0.1));
    border-color: #b46428;
}

/* ── GRILLE MEMBRES ── */
#membres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 32px;
}

#val-demander {
    width: fit-content;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    border: none;
    align-self: center;
    padding: 8px 8px;
}

/* ── CARTE WANTED ── */
.wanted-card {
    position: relative;
    transition: transform 0.2s;
    animation: cardIn 0.4s ease both;
}

.wanted-card:hover {
    transform: translateY(-6px) rotate(-1deg);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wanted-frame {
    width: 100%;
    display: block;
}

.wanted-photo {
    position: absolute;
    top: 28.4%;
    left: 23.5%;
    width: 53%;
    aspect-ratio: 4/3;
    height: 28%;
    object-fit: cover;
    object-position: center 20%;
}

.wanted-info {
    position: absolute;
    top: 58%;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 16px;
    align-items: center;
}

.wanted-nom {
    font-family: var(--font-title);
    font-size: 0.8rem;
    color: var(--ink);
    line-height: 1.1;
    font-weight: 200;
}

.wanted-prime-val {
    font-family: var(--font-title);
    font-size: 0.6rem;
    color: var(--red);
    margin-top: 2px;
}

.wanted-defi {
    display: none;
}

.wanted-done {
    position: absolute;
    top: 8%;
    right: 5%;
    background: var(--red);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    transform: rotate(15deg);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    #primes-nav {
        padding: 12px 16px;
    }

    .nav-logo {
        font-size: 1.0rem;
    }

    #player-score {
        padding: 3px 5px;
        gap: 6px;
    }

    #membres-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    #top3-podium {
        gap: 8px;
    }

    .podium-slot {
        min-width: 90px;
    }

    .podium-rank {
        font-size: 1.1rem;
    }

    .podium-name {
        font-size: 0.75rem;
    }
}