/* =============================================
   Célébration des succès — succes_toast.css (toutes pages, utilisateur connecté)
   Préfixe "st-"
============================================= */

.st-confettis {
    position: fixed; inset: 0; z-index: 10001; pointer-events: none;
}

/* ── Toasts ── */
#st-toasts {
    position: fixed; right: 20px; bottom: 20px; z-index: 10000;
    display: flex; flex-direction: column-reverse; gap: 10px;
    pointer-events: none;
}
.st-toast {
    pointer-events: auto;
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 12px;
    width: 330px; max-width: calc(100vw - 32px);
    background: white; border-radius: 16px; padding: 12px 14px;
    box-shadow: 0 12px 34px rgba(0,0,0,0.18);
    border-left: 5px solid #267928;
    text-decoration: none; color: inherit;
    font-family: inherit;
    transform: translateX(120%) scale(0.9); opacity: 0;
    transition: transform 0.45s cubic-bezier(.2,1.4,.4,1), opacity 0.3s;
}
.st-toast.visible { transform: translateX(0) scale(1); opacity: 1; }
.st-toast.sortie  { transform: translateX(120%); opacity: 0; transition-duration: 0.35s; }

.st-medaille {
    width: 46px; height: 46px; min-width: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    background: #fff6d9; box-shadow: inset 0 0 0 3px #e5b024;
}
.st-toast.visible .st-medaille { animation: st-pop 0.6s 0.2s cubic-bezier(.2,1.6,.4,1) backwards; }
@keyframes st-pop {
    from { transform: scale(0) rotate(-40deg); }
}
.st-medaille--niveau {
    background: linear-gradient(135deg, #E88A26, #f5b25e); box-shadow: none;
    color: white; font-size: 1.3rem; font-weight: 900;
}
.st-textes { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-surtitre {
    font-size: 0.62rem; font-weight: 800; color: #E88A26;
    text-transform: uppercase; letter-spacing: 0.07em;
}
.st-nom { font-size: 0.95rem; font-weight: 800; color: #1a1a1a; line-height: 1.2; margin-top: 1px; }
.st-detail { font-size: 0.72rem; color: #999; margin-top: 1px; }
.st-xp {
    display: inline-block;
    font-size: 0.72rem; font-weight: 800; color: #E88A26;
    background: #fff0e0; border-radius: 6px; padding: 3px 7px; white-space: nowrap;
}
.st-toast-minuteur {
    position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    background: #267928; opacity: 0.25; transform-origin: left;
}
.st-toast.visible .st-toast-minuteur { animation: st-minuteur 6s linear forwards; }
.st-toast:hover .st-toast-minuteur { animation-play-state: paused; }
@keyframes st-minuteur { to { transform: scaleX(0); } }

.st-toast--niveau {
    border-left-color: #E88A26;
    background: linear-gradient(110deg, #fff8ef, #ffffff 60%);
}
.st-toast--secret { border-left-color: #6a4c93; }
.st-toast--secret .st-surtitre { color: #6a4c93; }

/* ── Modale de bienvenue ── */
.st-bienvenue-fond {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(20, 40, 20, 0.55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; transition: opacity 0.3s;
}
.st-bienvenue-fond.visible { opacity: 1; }
.st-bienvenue {
    background: white; border-radius: 24px;
    width: 520px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto;
    padding: 28px 30px 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.5s cubic-bezier(.2,1.3,.4,1);
    text-align: center;
}
.st-bienvenue-fond.visible .st-bienvenue { transform: none; }
.st-bienvenue h2 { font-size: 1.6rem; font-weight: 900; color: #267928; margin: 18px 0 8px; }
.st-bienvenue-intro { font-size: 0.92rem; color: #444; margin: 0 0 4px; }
.st-bienvenue-sous { font-size: 0.8rem; color: #999; margin: 10px 0 14px; }

/* Billet de train qui se fait composter */
.st-billet {
    display: flex; margin: 0 auto; width: 340px; max-width: 100%;
    border-radius: 12px; overflow: hidden; text-align: left;
    background: linear-gradient(110deg, #267928, #3a9a3c);
    color: white; box-shadow: 0 8px 22px rgba(38,121,40,0.35);
    transform: rotate(-3deg);
    animation: st-billet-entree 0.6s 0.15s cubic-bezier(.2,1.3,.4,1) backwards;
}
@keyframes st-billet-entree { from { transform: translateY(-40px) rotate(-12deg); opacity: 0; } }
.st-billet-gauche {
    flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px;
    border-right: 2px dashed rgba(255,255,255,0.4);
}
.st-billet-label { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; color: #f5b25e; }
.st-billet-trajet { font-size: 1.15rem; font-weight: 900; }
.st-billet-passager { font-size: 0.72rem; opacity: 0.85; }
.st-billet-droite {
    width: 80px; position: relative;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.08);
}
.st-billet-classe { font-size: 1.6rem; font-weight: 900; }
.st-billet-trou {
    position: absolute; width: 22px; height: 22px; border-radius: 50%;
    background: white; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.st-billet.composte { animation: st-composter 0.35s ease-out; }
.st-billet.composte .st-billet-trou { animation: st-trou 0.3s 0.1s cubic-bezier(.2,1.6,.4,1) forwards; }
.st-billet.composte .st-billet-classe { opacity: 0.25; }
@keyframes st-composter {
    40% { transform: rotate(-3deg) scale(0.94); }
}
@keyframes st-trou { to { transform: translate(-50%, -50%) scale(1); } }

.st-feuille-route {
    list-style: none; padding: 0; margin: 0 0 20px;
    display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.st-feuille-route li {
    display: flex; align-items: center; gap: 12px;
    background: #f7f5f1; border-radius: 12px; padding: 10px 14px;
    font-size: 0.78rem; color: #888; line-height: 1.35;
}
.st-feuille-route li > span { font-size: 1.4rem; }
.st-feuille-route strong { display: block; font-size: 0.86rem; color: #1a1a1a; }

.st-bienvenue-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.st-btn-principal {
    display: inline-block; width: 100%;
    background: #E88A26; color: white; text-decoration: none;
    font-size: 0.95rem; font-weight: 800;
    border-radius: 12px; padding: 13px 18px;
    box-shadow: 0 6px 18px rgba(232,138,38,0.4);
    transition: transform 0.15s;
}
.st-btn-principal:hover { transform: translateY(-2px); }
.st-btn-secondaire {
    background: none; border: none; cursor: pointer;
    font-size: 0.82rem; font-weight: 700; color: #999; padding: 6px;
}
.st-btn-secondaire:hover { color: #267928; }

@media (max-width: 740px) {
    #st-toasts { right: 16px; left: 16px; bottom: 16px; align-items: stretch; }
    .st-toast { width: auto; }
    .st-bienvenue { padding: 22px 18px 18px; }
    .st-bienvenue h2 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .st-toast, .st-bienvenue, .st-billet, .st-medaille { animation: none !important; transition: opacity 0.2s !important; }
}
