/* FoxLand stage 2, task 9. Only the statistics listing and its player dialog. */
.fox-stats-page {
    max-width: 1120px;
    margin-right: auto;
    margin-left: auto;
}

#stats > .fox-stat-row {
    grid-template-columns: 49px minmax(180px, 24%) minmax(0, 1fr);
    min-height: 68px;
    border-color: rgba(var(--fox-rgb-as4l14, 170, 100, 245), .46);
    box-shadow: inset 0 1px rgba(255, 255, 255, .045), 0 0 11px rgba(var(--fox-rgb-gs3l11, 139, 62, 226), clamp(0, calc(.13 * var(--fox-glow-strength, 1)), 1));
    cursor: default;
}

#stats > .fox-stat-row:hover {
    border-color: rgba(var(--fox-rgb-as4l15, 191, 125, 255), .53);
    box-shadow: inset 0 1px rgba(255, 255, 255, .045), 0 0 11px rgba(var(--fox-rgb-gs3l11, 139, 62, 226), clamp(0, calc(.13 * var(--fox-glow-strength, 1)), 1));
}

#stats .fox-stat-identity {
    flex: 1 1 auto;
}

#stats .fox-stat-nick,
#stats .fox-stat-nick a,
#stats .fox-stat-nick > span {
    overflow-wrap: anywhere;
}

#stats .fox-stat-hint {
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid rgba(var(--fox-rgb-as4l14, 180, 114, 246), .36);
    border-radius: 7px;
    background: rgba(var(--fox-rgb-as2l11, 133, 68, 209), .1);
    color: var(--fox-tone-as4l17, #d9baff);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

#stats .fox-stat-hint:hover,
#stats .fox-stat-hint:focus-visible {
    border-color: var(--fox-tone-as4l16, #d5a5ff);
    background: rgba(var(--fox-rgb-as3l13, 161, 89, 238), .22);
    color: #fff;
}

#stats .fox-stat-hint:focus-visible {
    outline: 2px solid var(--fox-tone-as4l17, #dfb5ff);
    outline-offset: 2px;
}

#stats .fox-stat-award {
    display: none;
}

#stats > .fox-stat-row[data-place="1"] {
    --metal-a: #b57619;
    --metal-b: #fff1b4;
    --metal-c: #f6bc4f;
    --metal-glow: rgba(255, 187, 56, .37);
    --metal-ink: #281a08;
}

#stats > .fox-stat-row[data-place="2"] {
    --metal-a: #8495b0;
    --metal-b: #f6fbff;
    --metal-c: #bccce0;
    --metal-glow: rgba(219, 235, 255, .33);
    --metal-ink: #18212f;
}

#stats > .fox-stat-row[data-place="3"] {
    --metal-a: #a45e36;
    --metal-b: #ffd0a4;
    --metal-c: #d78e5b;
    --metal-glow: rgba(239, 150, 89, .34);
    --metal-ink: #2b160d;
}

#stats > .fox-stat-row[data-place="1"],
#stats > .fox-stat-row[data-place="2"],
#stats > .fox-stat-row[data-place="3"] {
    min-height: 83px;
    border-width: 2px;
    background-size: 100% 100%, 220% 100%;
    box-shadow: 0 5px 19px var(--metal-glow), inset 0 1px rgba(255, 255, 255, .12);
    animation: fox-stats-border-9 5.8s linear infinite;
}

#stats > .fox-stat-row[data-place="1"]:hover,
#stats > .fox-stat-row[data-place="2"]:hover,
#stats > .fox-stat-row[data-place="3"]:hover {
    box-shadow: 0 7px 22px var(--metal-glow), inset 0 1px rgba(255, 255, 255, .13);
}

#stats > .fox-stat-row[data-place="1"]::before,
#stats > .fox-stat-row[data-place="2"]::before,
#stats > .fox-stat-row[data-place="3"]::before {
    background: linear-gradient(90deg, transparent, var(--metal-glow), rgba(255, 255, 255, .38), transparent);
    animation-duration: 5.1s;
}

#stats > .fox-stat-row[data-place="1"]::after,
#stats > .fox-stat-row[data-place="2"]::after,
#stats > .fox-stat-row[data-place="3"]::after {
    animation-duration: 3.7s;
}

#stats > .fox-stat-row[data-place="1"] > .fox-stat-row__place,
#stats > .fox-stat-row[data-place="2"] > .fox-stat-row__place,
#stats > .fox-stat-row[data-place="3"] > .fox-stat-row__place {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

#stats > .fox-stat-row[data-place="1"] .fox-stat-award,
#stats > .fox-stat-row[data-place="2"] .fox-stat-award,
#stats > .fox-stat-row[data-place="3"] .fox-stat-award {
    position: relative;
    display: grid;
    order: -1;
    place-items: center;
    width: 32px;
    height: 30px;
    color: var(--metal-b);
    filter: drop-shadow(0 2px 5px var(--metal-glow));
    animation: fox-stats-cup-9 3.4s ease-in-out infinite alternate;
}

#stats .fox-stat-award i {
    font-size: 23px;
    line-height: 1;
}

#stats .fox-stat-award b {
    position: absolute;
    right: -3px;
    bottom: -2px;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border: 1px solid var(--metal-b);
    border-radius: 50%;
    background: var(--metal-ink);
    color: var(--metal-b);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

#stats > .fox-stat-row[data-place="1"] .fox-stat-rank,
#stats > .fox-stat-row[data-place="2"] .fox-stat-rank,
#stats > .fox-stat-row[data-place="3"] .fox-stat-rank {
    width: 35px;
    padding: 3px 2px;
    font-size: 11px;
}

#stats > .fox-stat-row[data-place="1"] .fox-stat-hint,
#stats > .fox-stat-row[data-place="2"] .fox-stat-hint,
#stats > .fox-stat-row[data-place="3"] .fox-stat-hint {
    border-color: var(--metal-a);
    color: var(--metal-b);
}

@keyframes fox-stats-border-9 {
    from { background-position: 0 0, 0% 50%; }
    to { background-position: 0 0, 100% 50%; }
}

@keyframes fox-stats-cup-9 {
    from { transform: translateY(1px) rotate(-3deg); }
    to { transform: translateY(-2px) rotate(3deg); }
}

.fox-stats-player-modal {
    --stats-accent: var(--fox-tone-as4l15, #bd80ff);
    --stats-accent-soft: rgba(var(--fox-rgb-as3l13, 162, 87, 235), .18);
    --stats-accent-glow: rgba(var(--fox-rgb-gs3l11, 150, 71, 221), clamp(0, calc(.26 * var(--fox-glow-strength, 1)), 1));
}

.fox-stats-player-modal[data-place="1"] {
    --stats-accent: #f8cc65;
    --stats-accent-soft: rgba(230, 167, 51, .18);
    --stats-accent-glow: rgba(234, 169, 48, .27);
}

.fox-stats-player-modal[data-place="2"] {
    --stats-accent: #dce8f7;
    --stats-accent-soft: rgba(193, 214, 238, .17);
    --stats-accent-glow: rgba(191, 213, 239, .25);
}

.fox-stats-player-modal[data-place="3"] {
    --stats-accent: #e9ad79;
    --stats-accent-soft: rgba(216, 137, 80, .18);
    --stats-accent-glow: rgba(225, 139, 80, .26);
}

.fox-stats-player-modal .modal-dialog {
    max-width: min(920px, calc(100vw - 28px));
    margin: min(4vh, 32px) auto;
}

.fox-stats-page .fox-stats-player-modal .modal-content {
    display: flex;
    max-height: calc(100vh - 32px);
    max-height: min(88dvh, 820px);
    flex-direction: column;
    overflow: hidden;
    border: 2px solid var(--stats-accent);
    border-radius: 16px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, .58), 0 0 29px var(--stats-accent-glow);
}

.fox-stats-page .fox-stats-player-modal .modal-header {
    flex: 0 0 auto;
    border-color: var(--stats-accent-soft);
    background: linear-gradient(110deg, var(--stats-accent-soft), rgba(var(--fox-rgb-ts2l2, 22, 15, 35), .96));
}

.fox-stats-page .fox-stats-player-modal .modal-header .modal-title {
    max-width: calc(100% - 42px);
    color: var(--stats-accent);
    overflow-wrap: anywhere;
}

.fox-stats-page .fox-stats-player-modal .modal-header .close {
    color: var(--stats-accent);
    opacity: .85;
    text-shadow: 0 0 10px var(--stats-accent-glow);
}

.fox-stats-page .fox-stats-player-modal .modal-header .close:hover,
.fox-stats-page .fox-stats-player-modal .modal-header .close:focus-visible {
    opacity: 1;
}

.fox-stats-page .fox-stats-player-modal .modal-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    scrollbar-color: var(--stats-accent) var(--fox-tone-as2l2, #100b1c);
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.fox-stats-page .fox-stats-player-modal .modal-body::-webkit-scrollbar {
    width: 10px;
}

.fox-stats-page .fox-stats-player-modal .modal-body::-webkit-scrollbar-track {
    border-radius: 10px;
    background: var(--fox-tone-as2l2, #100b1c);
}

.fox-stats-page .fox-stats-player-modal .modal-body::-webkit-scrollbar-thumb {
    border: 2px solid var(--fox-tone-as2l2, #100b1c);
    border-radius: 10px;
    background: var(--stats-accent);
}

.fox-stats-page .fox-stats-player-modal .modal-body > .table-responsive {
    border-color: var(--stats-accent-soft);
}

.fox-stats-page .fox-stats-player-modal .modal-body .table td,
.fox-stats-page .fox-stats-player-modal .modal-body .table th {
    border-color: var(--stats-accent-soft);
}

@media (max-width: 1050px) {
    #stats > .fox-stat-row {
        grid-template-columns: 46px minmax(164px, 27%) minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    #stats > .fox-stat-row {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    #stats .fox-stat-hint {
        min-height: 36px;
    }

    .fox-stats-player-modal .modal-dialog {
        max-width: calc(100vw - 20px);
        margin: 10px auto;
    }

    .fox-stats-page .fox-stats-player-modal .modal-content {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .fox-stats-page .fox-stats-player-modal .modal-body {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #stats > .fox-stat-row[data-place="1"],
    #stats > .fox-stat-row[data-place="2"],
    #stats > .fox-stat-row[data-place="3"],
    #stats > .fox-stat-row[data-place="1"] .fox-stat-award,
    #stats > .fox-stat-row[data-place="2"] .fox-stat-award,
    #stats > .fox-stat-row[data-place="3"] .fox-stat-award {
        animation: none;
    }

    #stats .fox-stat-hint {
        transition: none;
    }
}
