/* Pages particulières */
/* --- accueil publique ---------------------------------------------------------------------------------- */
.welcome {
    position: relative;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 2rem var(--gutter);
    overflow: hidden;
    text-align: center;
}

.welcome__inner {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 1.25rem;
}

.welcome__logo {
    width: clamp(150px, 32vw, 220px);
    filter: drop-shadow(6px 6px 0 var(--navy));
    animation: bonnet-flotte 4s ease-in-out infinite;
}

@keyframes bonnet-flotte {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }
    50% {
        transform: translateY(-12px) rotate(3deg);
    }
}

.welcome__title {
    font-size: clamp(2.5rem, 1.5rem + 5vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
}

.welcome__tagline {
    max-width: 34ch;
    color: var(--muted);
}

.welcome .actions {
    justify-content: center;
    margin-top: 0.5rem;
}

/* confettis aux couleurs du logo, en CSS seul */
.confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.confetti span {
    position: absolute;
    top: -20px;
    width: 12px;
    height: 18px;
    border: 2px solid var(--navy);
    border-radius: 3px;
    animation: confetti-tombe linear infinite;
    opacity: 0.9;
}

.confetti span:nth-child(1) {
    left: 37%;
    animation-duration: 8.6s;
    animation-delay: -1.3s;
    background: #2ee6e6;
}

.confetti span:nth-child(2) {
    left: 74%;
    animation-duration: 10.2s;
    animation-delay: -2.6s;
    background: #1f1fff;
}

.confetti span:nth-child(3) {
    left: 11%;
    animation-duration: 11.8s;
    animation-delay: -3.9s;
    background: #ffffff;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.confetti span:nth-child(4) {
    left: 48%;
    animation-duration: 13.4s;
    animation-delay: -5.2s;
    background: #ff5a5f;
}

.confetti span:nth-child(5) {
    left: 85%;
    animation-duration: 7s;
    animation-delay: -6.5s;
    background: #ffe500;
}

.confetti span:nth-child(6) {
    left: 22%;
    animation-duration: 8.6s;
    animation-delay: -7.8s;
    background: #2ee6e6;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.confetti span:nth-child(7) {
    left: 59%;
    animation-duration: 10.2s;
    animation-delay: -0.1s;
    background: #1f1fff;
}

.confetti span:nth-child(8) {
    left: 96%;
    animation-duration: 11.8s;
    animation-delay: -1.4s;
    background: #ffffff;
}

.confetti span:nth-child(9) {
    left: 33%;
    animation-duration: 13.4s;
    animation-delay: -2.7s;
    background: #ff5a5f;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.confetti span:nth-child(10) {
    left: 70%;
    animation-duration: 7s;
    animation-delay: -4s;
    background: #ffe500;
}

.confetti span:nth-child(11) {
    left: 7%;
    animation-duration: 8.6s;
    animation-delay: -5.3s;
    background: #2ee6e6;
}

.confetti span:nth-child(12) {
    left: 44%;
    animation-duration: 10.2s;
    animation-delay: -6.6s;
    background: #1f1fff;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.confetti span:nth-child(13) {
    left: 81%;
    animation-duration: 11.8s;
    animation-delay: -7.9s;
    background: #ffffff;
}

.confetti span:nth-child(14) {
    left: 18%;
    animation-duration: 13.4s;
    animation-delay: -0.2s;
    background: #ff5a5f;
}

/* sans animation : confettis posés, dispersés sur la page */
@media (prefers-reduced-motion: reduce) {
    .confetti span:nth-child(1) {
        top: 53%;
        transform: rotate(41deg);
    }
    .confetti span:nth-child(2) {
        top: 14%;
        transform: rotate(82deg);
    }
    .confetti span:nth-child(3) {
        top: 67%;
        transform: rotate(123deg);
    }
    .confetti span:nth-child(4) {
        top: 28%;
        transform: rotate(164deg);
    }
    .confetti span:nth-child(5) {
        top: 81%;
        transform: rotate(205deg);
    }
    .confetti span:nth-child(6) {
        top: 42%;
        transform: rotate(246deg);
    }
    .confetti span:nth-child(7) {
        top: 3%;
        transform: rotate(287deg);
    }
    .confetti span:nth-child(8) {
        top: 56%;
        transform: rotate(328deg);
    }
    .confetti span:nth-child(9) {
        top: 17%;
        transform: rotate(369deg);
    }
    .confetti span:nth-child(10) {
        top: 70%;
        transform: rotate(410deg);
    }
    .confetti span:nth-child(11) {
        top: 31%;
        transform: rotate(451deg);
    }
    .confetti span:nth-child(12) {
        top: 84%;
        transform: rotate(492deg);
    }
    .confetti span:nth-child(13) {
        top: 45%;
        transform: rotate(533deg);
    }
    .confetti span:nth-child(14) {
        top: 6%;
        transform: rotate(574deg);
    }
}

@keyframes confetti-tombe {
    to {
        transform: translateY(110vh) rotate(540deg);
    }
}

/* --- connexion, inscription ---------------------------------------------------------------------------- */
.auth {
    display: grid;
    gap: 1.5rem;
}

.auth__head {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    text-align: center;
}

.auth__head img {
    width: 84px;
    filter: drop-shadow(4px 4px 0 var(--navy));
}

.auth__foot {
    text-align: center;
    font-size: 0.875rem;
}

/* --- tirage -------------------------------------------------------------------------------------------- */
.draw-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.draw-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    background: var(--paper);
    border: var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Page des utilisateurs : cartes plus larges, actions alignées en bas de la carte */
.draw-grid--larges {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.draw-card--riche {
    display: flex;
    flex-direction: column;
}

.draw-card--riche > .draw-card__actions {
    margin-top: auto;
    padding-top: 0.5rem;
}

.draw-card.is-me {
    background: var(--yellow-soft);
    box-shadow: var(--shadow);
}

.draw-card__arrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
}

/* --- animation après le lancement d'un tirage (visuelle seulement) ------------------------------------- */
/* L'état final est l'état de base : sans animation (mouvement réduit), les noms sont directement validés. */
.tirage-anime .badge {
    --badge-bg: var(--yellow);
    animation: tirage-valide 0.45s ease-out backwards;
    animation-delay: calc(0.3s + var(--i) * 0.35s);
}

.tirage-anime .badge .icon {
    animation: tirage-coche 0.35s ease-out backwards;
    animation-delay: calc(0.45s + var(--i) * 0.35s);
}

.tirage-anime__revele {
    animation: tirage-revele 0.5s ease-out backwards;
    animation-delay: calc(0.5s + var(--nb) * 0.35s);
}

/* Boutons d'écriture sous « Ta personne tirée » : à distance du bloc, révélés en même temps que le nom */
.actions--messages {
    margin-block-start: 1.5rem;
}

/* Bloc adresse postale sous les boutons d'écriture */
.partage-adresse {
    margin-block-start: 1.5rem;
}

@keyframes tirage-valide {
    0% {
        background: var(--cyan);
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        background: var(--yellow);
        transform: scale(1);
    }
}

@keyframes tirage-coche {
    from {
        opacity: 0;
        transform: scale(0);
    }
}

@keyframes tirage-revele {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
}

/* --- pronostics d'une édition révélée ------------------------------------------------------------------ */
.pronostic-resultat > summary {
    cursor: pointer;
    padding: 0.35rem 0;
}

.pronostic-resultat[open] > summary {
    margin-bottom: 0.5rem;
}

/* --- page d'attente du tirage --------------------------------------------------------------------------- */
.attente {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
}

.attente__sablier .icon {
    width: 3.5rem;
    height: 3.5rem;
    animation: attente-sablier 2.4s ease-in-out infinite;
}

.attente__texte {
    font-size: 1.25rem;
    font-weight: 700;
}

@keyframes attente-sablier {
    0%, 40% {
        transform: rotate(0deg);
    }
    50%, 90% {
        transform: rotate(180deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- messagerie anonyme tirant ↔ tiré ---------------------------------------------------------------- */
.fil {
    display: grid;
    gap: 0.6rem;
}

.fil__bulle {
    max-width: min(34rem, 85%);
    padding: 0.6rem 0.9rem;
    background: var(--cyan-soft);
    border: var(--line);
    border-radius: var(--radius);
    overflow-wrap: anywhere;
}

.fil__bulle--moi {
    justify-self: end;
    background: var(--yellow-soft);
}

.fil__bulle--nouveau {
    box-shadow: var(--shadow-sm);
}

.fil__meta {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* --- adresse postale (docs/spec/adresse-postale.md) ---------------------------------------------------- */
address {
    font-style: normal;
    white-space: pre-line;
    user-select: all;
}

[data-copier][hidden] {
    display: none;
}

/* Fiche « tailles et goûts » (docs/spec/tailles-gouts.md) */
/* La fiche est en tête du composant liste : de l'air avant les souhaits */
.gouts { margin-block-end: 1.5rem; }
.gouts__titre { cursor: pointer; font-weight: 600; }
.gouts[open] .gouts__titre { margin-block-end: var(--space-3, 0.75rem); }
.gouts__champs { margin: 0; display: grid; gap: 0.5rem; }
.gouts__champ { display: grid; gap: 0.1rem; }
.gouts__champ dt { font-size: 0.85em; opacity: 0.75; }
.gouts__champ dd { margin: 0; }
.gouts__champ--allergies dt, .gouts__champ--allergies dd { font-weight: 700; opacity: 1; }
