.analytics {
    background: var(--block-background);
    border-radius: 2em;
    padding: 2em 1em;
    margin-top: 2em;
}

.analytics-item {
    font-size: 1.2em;
}

.analytics-item-label {
    font-weight: bold;
}

.analytics-plot {
    margin-top: 1em;
    overflow-x: auto;
}

.analytics-plot svg {
    height: 300px;
}

.games-result {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-gap: 2em;
}

.analytics-chart {
    text-align: center;
}

.analytics-chart svg {
    width: 250px;
    height: 250px;
}

.analytics-blocks {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

.analytics-block {
    display: grid;
    grid-template-columns: 16px 1fr;
    grid-gap: 8px;
    min-height: 250px;
}

.analytics-block-bar {
    height: 100%;
    width: 100%;
    border-radius: 48px;
}

.analytics-block-bar div {
    border-radius: 48px;
}

.analytics-block-value {
    font-size: 3em;
    font-weight: bold;
}

.analytics-categories-chart {
    margin-bottom: 2em;
}

.analytics-categories-bar {
    margin-bottom: 0.5em;
    border-radius: 0.5em;
    position: relative;
    user-select: none;
    cursor: pointer;
    height: 2em;
}

.analytics-categories-bar-main {
    border-radius: 0.5em;
    position: relative;
    height: 100%;
    display: inline-block;
}

.analytics-categories-bar-label {
    font-weight: bold;
    position: absolute;
    left: 0.5em;
    top: 0;
    bottom: 0;
    display: grid;
    align-items: center;
    white-space: nowrap;
}

.analytics-categories-bar-value {
    position: absolute;
    right: 0.5em;
    top: 0;
    bottom: 0;
    display: inline-grid;
    align-items: center;
}

.analytics-categories-info {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s;
    font-size: 0.9em;
}

.analytics-categories-info-open {
    border-radius: 1em;
    margin-bottom: 1em;
    border-width: 1px;
    border-style: solid;
    padding: 1em;
    max-height: 1000px;
    overflow: auto;
    transition: max-height 0.2s;
}

.analytics-categories-info .games-result {
    margin-bottom: 2em;
}

.top-players {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-auto-rows: 1fr;
    grid-gap: 1em;
    font-size: 16px;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 1em;
}

.top-players .user {
    background: radial-gradient(67.48% 311.93% at 73.22% 40.75%, #a1dbff99 0%, #ed9ddc00 100%), #c69dee80;
}

.games-controls {
    margin-bottom: 1em;
}

.games-controls select {
    margin-left: 0.5em;
    margin-top: 0.5em;
    background-color: #fddc8180;
}

.games-controls label {
    font-weight: bold;
    cursor: pointer;
}

.games-organizer img {
    width: 25px;
    vertical-align: middle;
    margin-right: 5px;
}

.games-participants {
    display: grid;
    grid-auto-columns: 30px;
    grid-auto-flow: column;
    grid-gap: 5px;
    max-width: 170px;
    overflow-x: auto;
}

.games-participants img {
    width: 100%;
    border-radius: 100%;
}

.months-top-players {
    max-width: 100%;
    overflow: auto;
    display: inline-grid;
    grid-auto-flow: column;
    grid-template-rows: 1fr 27px;
    grid-gap: 0 5px;
    font-size: 10px;
}

.months-top-players-profiles {
    display: grid;
    grid-auto-flow: row;
    grid-auto-rows: 1fr;
    background: radial-gradient(311.93% 67.48% at 40.75% 73.22%, #a1dbff99 0%, #ed9ddc00 100%), #c69dee80;
    border-radius: 8px;
    padding: 4px 2px;
}

.months-top-players-profiles img {
    width: 36px;
    height: 36px;
    border-radius: 100%;
    padding: 2px;
}

.months-top-players-profile-current {
    border: 2px solid var(--main-color);
    padding: 0 !important;
}

.months-top-players-date {
    white-space: nowrap;
    text-align: center;
}

.analytics-labels {
    overflow-x: auto;
    max-width: 100%;
    white-space: nowrap;
}

.analytics-label {
    display: inline-block;
    background-color: #fddc81;
    border-radius: 0.5em;
    padding: 0.4em 0.7em;
    margin-right: 0.5em;
    cursor: pointer;
    color: #2e2836b2;
}

.analytics-label:last-child {
    margin-right: 0;
}

.analytics-label-selected {
    font-weight: bold;
    cursor: default;
    background-color: #f9dc5c;
    color: var(--text-color);
}

.analytics-plots {
    margin-bottom: 3em;
}

@media (max-width: 1200px) {
    .top-players {
        grid-template-columns: 1fr 1fr;
        grid-gap: 0.75em;
    }
}

@media (max-width: 1023px) {
    .games-result {
        grid-template-columns: 1fr;
        grid-template-rows: 250px 1fr
    }
}

@media (max-width: 767px) {
    .analytics {
        border-radius: 1em;
        padding: 1em;
    }

    .analytics-block {
        grid-template-columns: 8px 1fr;
        min-height: 150px;
    }

    .analytics-block-bar {
        border-radius: 24px;
    }

    .analytics-block-value {
        font-size: 2em;
    }

    .analytics-block-label {
        font-size: 0.9em;
    }

    .top-players {
        grid-template-columns: 1fr;
        grid-gap: 0.5em;
        font-size: 0.9em;
    }

    .games-controls select {
        display: block;
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 479px) {
    .analytics-block {
        min-height: 100px;
    }

    .analytics-block-value {
        font-size: 1.4em;
    }

    .analytics-block-label {
        font-size: 0.6em;
    }
}
