/*===================*/
/* STYLE DES MODALES */
/*===================*/

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(5, 4, 2, 0.82);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: overlayIn 0.25s ease forwards;
}

.modal-overlay.modal--hiding {
    animation: overlayOut 0.25s ease forwards;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes overlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: linear-gradient(145deg, #1a1610, #251f15);
    border: 1px solid #8a6d2e;
    border-radius: 4px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 16px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(201,168,76,0.15);
    animation: cardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-overlay.modal--hiding .modal-card {
    animation: cardOut 0.25s ease forwards;
}

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

@keyframes cardOut {
    from { opacity: 1; transform: translateY(0)    scale(1); }
    to   { opacity: 0; transform: translateY(12px) scale(0.97); }
}

/* Bordure intérieure décorative */
.modal-card::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(201,168,76,0.1);
    border-radius: 2px;
    pointer-events: none;
}

/* Coin décoratif */
.modal-card::after {
    content: '✦';
    position: absolute;
    top: 10px; left: 13px;
    color: #8a6d2e;
    font-size: 0.65rem;
    opacity: 0.6;
}

.modal-icon {
    font-size: 2rem;
    color: #c9a84c;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(201,168,76,0.4);
    display: block;
}

.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #e8c96a;
    text-shadow: 0 0 20px rgba(201,168,76,0.3);
    margin-bottom: 1rem;
}

.modal-text {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    color: #d4c49a;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.modal-btn {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 2px;
    transition: all 0.2s;
    font-weight: 700;
}

.modal-btn--primary {
    background: linear-gradient(135deg, #8a6d2e, #c9a84c);
    color: #2a1f0e;
    box-shadow: 0 4px 15px rgba(201,168,76,0.3);
}

.modal-btn--primary:hover {
    background: linear-gradient(135deg, #c9a84c, #e8c96a);
    box-shadow: 0 6px 20px rgba(201,168,76,0.45);
    transform: translateY(-1px);
}

.modal-btn--secondary {
    background: transparent;
    border: 1px solid #8a6d2e;
    color: #d4c49a;
}

.modal-btn--secondary:hover {
    border-color: #c9a84c;
    color: #e8c96a;
    background: rgba(201,168,76,0.06);
}

/* Bouton fermer */
.modal-close {
    position: absolute;
    top: 10px; right: 12px;
    background: transparent;
    border: none;
    color: #8a6d2e;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 4px;
}

.modal-close:hover { color: #e8c96a; }

@media (max-width: 480px) {
    .modal-card { padding: 2rem 1.25rem 1.5rem; }
}

/*============================*/
/* STYLE DU TRUC DE CONNEXION */
/*============================*/

#menuLogin {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: #d4c49a;
    background: linear-gradient(145deg, #1a1610, #251f15);
    border: 1px solid #8a6d2e;
    border-radius: 3px;
    padding: 0.55rem 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

#menuLogin:hover {
    color: #e8c96a;
    border-color: #c9a84c;
    background: linear-gradient(145deg, #1f1b11, #2d2418);
    box-shadow: 0 4px 20px rgba(201,168,76,0.2);
}

.menu-login-icon {
    color: #c9a84c;
    font-size: 0.8rem;
}

/*=====================*/
/* STYLE DU MENU LOGIN */
/*=====================*/

/* ── Bouton connecté ── */
#menuLogin,
#menuUserBtn {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 1000;
}

#menuLogin {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: #d4c49a;
    background: linear-gradient(145deg, #1a1610, #251f15);
    border: 1px solid #8a6d2e;
    border-radius: 3px;
    padding: 0.55rem 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

#menuLogin:hover {
    color: #e8c96a;
    border-color: #c9a84c;
    box-shadow: 0 4px 20px rgba(201,168,76,0.2);
}

.menu-login-icon { color: #c9a84c; font-size: 0.8rem; }

/* ── Wrapper utilisateur ── */
#menuUser {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 1000;
}

#menuUserBtn {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d4c49a;
    background: linear-gradient(145deg, #1a1610, #251f15);
    border: 1px solid #8a6d2e;
    border-radius: 3px;
    padding: 0.45rem 0.8rem 0.45rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

#menuUserBtn:hover,
#menuUserBtn[aria-expanded="true"] {
    color: #e8c96a;
    border-color: #c9a84c;
    box-shadow: 0 4px 20px rgba(201,168,76,0.2);
}

.menu-user-avatar {
    width: 26px; height: 26px;
    background: linear-gradient(135deg, #8a6d2e, #c9a84c);
    color: #2a1f0e;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 2px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.menu-user-chevron {
    font-size: 0.65rem;
    color: #8a6d2e;
    transition: transform 0.2s;
}

#menuUserBtn[aria-expanded="true"] .menu-user-chevron {
    transform: rotate(180deg);
}

/* ── Dropdown ── */
.menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 220px;
    background: linear-gradient(145deg, #1a1610, #251f15);
    border: 1px solid #8a6d2e;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7), inset 0 1px 0 rgba(201,168,76,0.1);
    overflow: hidden;
    /* état caché */
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.menu-dropdown-header {
    padding: 0.85rem 1rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.menu-dropdown-title {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #e8c96a;
    text-transform: uppercase;
}

.menu-dropdown-sub {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #8a6d2e;
}

.menu-dropdown-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #8a6d2e, transparent);
    margin: 0.2rem 0;
}

.menu-item {
    display: block;
    padding: 0.6rem 1rem;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    color: #d4c49a;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.menu-item:hover {
    background: rgba(201,168,76,0.08);
    color: #e8c96a;
}

.menu-item--danger { color: #c97070; }
.menu-item--danger:hover { background: rgba(139,26,26,0.15); color: #e08080; }

/*=======================*/
/* Particules flottantes */
/*=======================*/

.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -10px;
    font-size: 0.7rem;
    color: var(--gold-dark);
    opacity: 0;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0%   { opacity: 0;    transform: translateY(0)    rotate(0deg); }
    10%  { opacity: 0.4; }
    90%  { opacity: 0.15; }
    100% { opacity: 0;    transform: translateY(-100vh) rotate(360deg); }
}