/* Glückwunsch-Karte „Rang-Aufstieg“ (Riot_Progress_Rank_Up) auf der HUBAcademy-Startseite. */
.riot-rankup {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 5rem; /* Eigener Seitenabstand, damit auf der Startseite kein Container nötig ist. */
    padding: 20px 48px 20px 20px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(17, 17, 20, 0.92) 60%);
    color: #fff;
}

.riot-rankup__emblems {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.riot-rankup__from {
    width: 48px;
    height: 48px;
    opacity: 0.55;
    filter: grayscale(0.6);
}

.riot-rankup__to {
    width: 80px;
    height: 80px;
    animation: riot-rankup-pop 0.6s ease-out both;
}

.riot-rankup__arrow {
    font-size: 22px;
    color: #ef4444;
}

.riot-rankup__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.riot-rankup__text {
    margin: 0;
    opacity: 0.85;
}

.riot-rankup__button {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.riot-rankup__button:hover,
.riot-rankup__button:focus-visible {
    background: #dc2626;
    color: #fff;
}

.riot-rankup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.riot-rankup__action,
.riot-rankup-reopen {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.riot-rankup__action {
    padding: 8px 16px;
}

.riot-rankup__action:hover,
.riot-rankup__action:focus-visible,
.riot-rankup-reopen:hover,
.riot-rankup-reopen:focus-visible {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.18);
    color: #fff;
}

/* Bleibt nach dem Ausblenden stehen und holt den Glückwunsch zurück. */
.riot-rankup-reopen {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0 5rem;
    padding: 6px 14px 6px 8px;
    background: #111114;
}

.riot-rankup-reopen__icon {
    width: 28px;
    height: 28px;
}

.riot-rankup[hidden],
.riot-rankup-reopen[hidden] {
    display: none;
}

.riot-rankup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.riot-rankup__close:hover,
.riot-rankup__close:focus-visible {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Popup: nativer <dialog> über der Seite, Inhalt untereinander und mittig. */
.riot-rankup-dialog {
    width: min(420px, calc(100vw - 2rem));
    max-width: none;
    overflow: visible; /* Aufstiegsbewegung ragt kurz über den Rand, sonst Scrollbalken. */
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #111114;
    color: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.riot-rankup-dialog[open] {
    animation: riot-rankup-in 0.25s ease-out both;
}

.riot-rankup-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.riot-rankup-dialog .riot-rankup--popup {
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 32px 24px 24px;
    text-align: center;
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.22), rgba(17, 17, 20, 0.96) 55%);
}

.riot-rankup--popup .riot-rankup__to {
    width: 112px;
    height: 112px;
}

.riot-rankup--popup .riot-rankup__title {
    font-size: 22px;
}

.riot-rankup--popup .riot-rankup__button {
    display: block;
    margin-top: 16px;
    padding: 12px 16px;
}

.riot-rankup--popup .riot-rankup__actions {
    justify-content: center;
}

@keyframes riot-rankup-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Aufstieg im Popup: alte Liga erscheint und verblasst, Pfeil, neue Liga steigt auf und leuchtet,
   dann Texte nacheinander; Konfetti (JS) startet, wenn das neue Symbol gelandet ist. */
.riot-rankup-dialog .riot-rankup--popup {
    animation: riot-rankup-card 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.riot-rankup--popup .riot-rankup__from {
    animation: riot-rankup-from 1s ease both;
}

.riot-rankup--popup .riot-rankup__arrow {
    animation: riot-rankup-arrow 0.35s 0.6s ease-out both;
}

.riot-rankup--popup .riot-rankup__to {
    animation:
        riot-rankup-rise 0.7s 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both,
        riot-rankup-glow 1.6s 1.2s ease-out both,
        riot-rankup-float 3s 2.8s ease-in-out infinite;
}

.riot-rankup--popup .riot-rankup__title { animation: riot-rankup-up 0.4s 1.3s ease-out both; }
.riot-rankup--popup .riot-rankup__text { animation: riot-rankup-up 0.4s 1.4s ease-out both; }
.riot-rankup--popup .riot-rankup__button { animation: riot-rankup-up 0.4s 1.55s ease-out both; }
.riot-rankup--popup .riot-rankup__actions { animation: riot-rankup-up 0.4s 1.6s ease-out both; }

.riot-rankup__confetti {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

@keyframes riot-rankup-card {
    from { transform: translateY(16px) scale(0.94); }
    to { transform: none; }
}

@keyframes riot-rankup-from {
    0% { transform: scale(1.6); opacity: 0; filter: none; }
    30%, 55% { transform: scale(1.6); opacity: 1; filter: none; }
    100% { transform: scale(1); opacity: 0.55; filter: grayscale(0.6); }
}

@keyframes riot-rankup-arrow {
    from { transform: translateX(-12px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes riot-rankup-rise {
    0% { transform: translateY(36px) scale(0.3) rotate(-15deg); opacity: 0; }
    60% { transform: translateY(-6px) scale(1.15) rotate(4deg); opacity: 1; }
    100% { transform: none; opacity: 1; }
}

@keyframes riot-rankup-glow {
    0% { filter: drop-shadow(0 0 0 rgba(245, 197, 66, 0)); }
    35% { filter: drop-shadow(0 0 28px rgba(245, 197, 66, 0.95)); }
    100% { filter: drop-shadow(0 0 12px rgba(245, 197, 66, 0.45)); }
}

@keyframes riot-rankup-float {
    0%, 100% { transform: none; }
    50% { transform: translateY(-5px); }
}

@keyframes riot-rankup-up {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: none; opacity: 1; }
}


@keyframes riot-rankup-pop {
    from { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .riot-rankup__to,
    .riot-rankup-dialog[open],
    .riot-rankup-dialog .riot-rankup--popup,
    .riot-rankup--popup * { animation: none !important; }
}

@media (max-width: 600px) {
    .riot-rankup {
        flex-direction: column;
        margin: 0 1rem;
        text-align: center;
        padding: 20px;
    }

    .riot-rankup__actions {
        justify-content: center;
    }

    .riot-rankup-reopen {
        margin: 0 1rem;
    }
}
