/* =========================================================
   HANGMAN RESCUE - PIRATE CHAMPIONSHIP MATCH
   ========================================================= */

.hr-championship-setup {
    display: none;
    align-items: center;
    gap: 8px;

    padding: 8px 10px;

    border: 2px solid rgba(222, 165, 57, 0.72);
    border-radius: 11px;

    background:
        rgba(17, 35, 53, 0.88);
}

.hr-championship-setup label {
    color: #f2d079;

    font-size: 11px;
    font-weight: 900;

    text-transform: uppercase;
}

.hr-championship-setup select {
    min-height: 35px;

    padding: 5px 9px;

    border: 2px solid #a76a1c;
    border-radius: 8px;

    background: #142c40;
    color: #ffffff;

    font-size: 12px;
    font-weight: 800;
}

.hr-championship-button {
    display: none;
}

#championshipRematchBtn {
    border-color: #ffe083 !important;

    background:
        linear-gradient(
            180deg,
            #d99118,
            #7f4109
        ) !important;

    color: #fff4c3 !important;
}

#championshipNewMatchBtn {
    border-color: #87c4e8 !important;

    background:
        linear-gradient(
            180deg,
            #316585,
            #17384e
        ) !important;

    color: #ffffff !important;
}

/* ---------------------------------------------------------
   RESCUE RACE PROGRESS
   --------------------------------------------------------- */

.hr-match-progress {
    display: grid;
    grid-template-columns:
        auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;

    margin-top: 9px;
    padding: 7px 8px;

    border: 1px solid rgba(225, 170, 61, 0.34);
    border-radius: 9px;

    background:
        rgba(8, 22, 36, 0.62);
}

.hr-match-progress__label {
    color: #d8bd77;

    font-size: 9px;
    font-weight: 900;

    text-transform: uppercase;
}

.hr-match-progress__markers {
    display: flex;
    justify-content: center;
    gap: 3px;

    min-width: 0;
}

.hr-rescue-marker {
    color: rgba(194, 213, 227, 0.45);

    font-size: 13px;

    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.65);
}

.hr-rescue-marker.hr-filled {
    color: #ffd55d;

    text-shadow:
        0 0 7px rgba(255, 201, 55, 0.65);
}

.hr-match-progress > strong {
    color: #ffe28e;

    font-size: 11px;
}

.hr-match-spectator {
    opacity: 0.72;

    filter:
        grayscale(0.28);
}

.hr-match-winner {
    border-color:
        #ffe16b !important;

    box-shadow:
        inset 0 0 0 2px rgba(255, 229, 130, 0.21),
        0 0 22px rgba(255, 197, 47, 0.42) !important;
}

/* ---------------------------------------------------------
   PIRATE CHAMPION SCREEN
   --------------------------------------------------------- */

.hr-match-champion-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;
    box-sizing: border-box;

    pointer-events: none;

    opacity: 0;
    visibility: hidden;

    z-index: 13000;

    background:
        radial-gradient(
            circle at center,
            rgba(255, 211, 75, 0.22),
            rgba(4, 11, 22, 0.84) 70%
        );

    transition:
        opacity 260ms ease,
        visibility 260ms ease;
}

.hr-match-champion-overlay.hr-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hr-match-champion-card {
    position: relative;

    width:
        min(610px, calc(100vw - 30px));

    overflow: hidden;

    padding: 25px 24px 22px;

    border: 5px solid #d79622;
    border-radius: 25px;

    background:
        radial-gradient(
            circle at 50% -10%,
            rgba(255, 220, 92, 0.24),
            transparent 47%
        ),
        linear-gradient(
            180deg,
            rgba(69, 40, 8, 0.99),
            rgba(12, 29, 49, 0.99)
        );

    box-shadow:
        inset 0 0 0 2px rgba(255, 235, 158, 0.28),
        0 25px 70px rgba(0, 0, 0, 0.77),
        0 0 42px rgba(255, 190, 36, 0.38);

    color: #ffffff;
    text-align: center;

    transform:
        translateY(28px)
        scale(0.82);

    opacity: 0;
}

.hr-match-champion-overlay.hr-visible
.hr-match-champion-card {
    animation:
        hrMatchChampionEnter 760ms
        cubic-bezier(0.16, 0.86, 0.22, 1.16)
        forwards;
}

.hr-match-champion-treasure {
    display: block;

    font-size: 53px;

    animation:
        hrTreasureFloat 1500ms
        ease-in-out infinite;
}

.hr-match-champion-kicker {
    display: block;

    margin-top: 4px;

    color: #e3be58;

    font-size: 11px;
    font-weight: 900;

    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.hr-match-champion-name {
    display: block;

    margin: 5px 0;

    color: #ffe68d;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        clamp(34px, 8vw, 57px);

    font-weight: 900;
    line-height: 1;

    text-shadow:
        0 4px 0 #753705,
        0 7px 10px rgba(0, 0, 0, 0.72),
        0 0 20px rgba(255, 207, 57, 0.55);
}

.hr-match-champion-title {
    display: block;

    color: #ffffff;

    font-size: 17px;
    font-weight: 900;

    text-transform: uppercase;
}

.hr-match-champion-stats {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 8px;

    margin: 17px 0;
}

.hr-match-champion-stat {
    padding: 10px 6px;

    border: 1px solid rgba(255, 214, 93, 0.38);
    border-radius: 11px;

    background:
        rgba(7, 23, 39, 0.68);
}

.hr-match-champion-stat strong {
    display: block;

    color: #ffffff;

    font-size: 21px;
}

.hr-match-champion-stat small {
    display: block;

    margin-top: 3px;

    color: #bcd4e8;

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
}

.hr-match-final-rankings {
    margin:
        12px 0 16px;

    padding:
        10px;

    border-radius:
        12px;

    background:
        rgba(7, 20, 34, 0.61);
}

.hr-match-final-row {
    display: grid;
    grid-template-columns:
        34px minmax(0, 1fr) auto auto;
    gap: 7px;
    align-items: center;

    padding: 6px 5px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);

    text-align: left;
}

.hr-match-final-row:last-child {
    border-bottom: 0;
}

.hr-match-final-row strong {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-match-final-row span,
.hr-match-final-row small {
    color: #d3e5f3;

    font-size: 11px;
    font-weight: 800;
}

.hr-match-close {
    min-width: 170px;

    padding: 10px 19px;

    border: 2px solid #e9bd4f;
    border-radius: 11px;

    background:
        linear-gradient(
            180deg,
            #376886,
            #193c54
        );

    color: #ffffff;

    font-size: 12px;
    font-weight: 900;

    cursor: pointer;
}

@keyframes hrMatchChampionEnter {
    0% {
        opacity: 0;

        transform:
            translateY(30px)
            scale(0.78)
            rotate(-3deg);
    }

    68% {
        opacity: 1;

        transform:
            translateY(-6px)
            scale(1.04)
            rotate(1deg);
    }

    100% {
        opacity: 1;

        transform:
            translateY(0)
            scale(1)
            rotate(0);
    }
}

@keyframes hrTreasureFloat {
    0%,
    100% {
        transform:
            translateY(0)
            rotate(-2deg);
    }

    50% {
        transform:
            translateY(-7px)
            rotate(2deg);
    }
}

@media (max-width: 650px) {
    .hr-championship-setup {
        width: 100%;
        box-sizing: border-box;

        flex-direction: column;
        align-items: stretch;
    }

    .hr-championship-setup label {
        text-align: center;
    }

    .hr-match-progress__label {
        display: none;
    }

    .hr-match-progress {
        grid-template-columns:
            minmax(0, 1fr) auto;
    }

    .hr-match-champion-card {
        padding:
            19px 11px 17px;

        border-width:
            3px;
    }

    .hr-match-champion-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .hr-match-final-row {
        grid-template-columns:
            28px minmax(0, 1fr) auto;
    }

    .hr-match-final-row small {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hr-match-champion-overlay,
    .hr-match-champion-overlay * {
        animation:
            none !important;

        transition-duration:
            1ms !important;
    }
}
