@import url('https://fonts.googleapis.com/css2?family=Arvo:wght@700&family=Raleway:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap');


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow: hidden;

    font-family:
        "Raleway",
        sans-serif;

    color: #ffffff;

    background: #000000;
}


/* =========================================================
   PAGE
   ========================================================= */

.page {
    position: relative;

    width: 100vw;
    height: 100vh;

    overflow: hidden;

    background-image:
        url("bg.jpeg");

    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}


/*
   Лёгкое затемнение поверх фона.
   Если захочешь более яркую картинку —
   уменьши opacity.
*/

.background-overlay {
    position: absolute;

    inset: 0;

    background:
        rgba(0, 0, 0, 0.08);

    pointer-events: none;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.content {
    position: relative;

    width: 100%;
    height: 100%;

    z-index: 2;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
    position: absolute;

    top: 10px;
    left: 50%;

    transform:
        translateX(-50%);

    width: 100%;

    text-align: center;
}


.header h1 {
    margin: 0;

    font-family:
        "Arvo",
        serif;

    font-size: 52px;

    font-weight: 700;

    line-height: 1.05;

    letter-spacing: 0;

    color: #ffffff;

    text-shadow:
        0 2px 5px rgba(0, 0, 0, 0.35);
}


/* =========================================================
   TIMER
   ========================================================= */

.timer {
    margin-top: 2px;

    font-family:
        "Arvo",
        serif;

    font-size: 29px;

    font-weight: 700;

    line-height: 1;

    color: #ffffff;

    text-shadow:
        0 2px 5px rgba(0, 0, 0, 0.35);
}


/* =========================================================
   LEADERBOARD SECTION
   ========================================================= */

.leaderboard-section {
    position: absolute;

    top: 168px;

    left: 50%;

    transform:
        translateX(-50%);

    width: 665px;
}


/* =========================================================
   LEADERBOARD TITLE
   ========================================================= */

.leaderboard-title {
    margin-bottom: 9px;

    text-align: center;

    font-family:
        "Raleway",
        sans-serif;

    font-size: 29px;

    font-weight: 400;

    line-height: 1;

    color: #ffffff;

    text-shadow:
        0 2px 5px rgba(0, 0, 0, 0.35);
}


/* =========================================================
   LEADERBOARD
   ========================================================= */

.leaderboard {
    width: 100%;

    /*
       7 строк × 31px
    */

    height: 217px;

    max-height: 217px;

    overflow-y: auto;

    overflow-x: hidden;

    background:
        rgba(0, 0, 0, 0.28);
}


/*
   Скроллбар
*/

.leaderboard::-webkit-scrollbar {
    width: 7px;
}

.leaderboard::-webkit-scrollbar-track {
    background:
        rgba(0, 0, 0, 0.25);
}

.leaderboard::-webkit-scrollbar-thumb {
    background:
        rgba(255, 255, 255, 0.45);

    border-radius: 0;
}

.leaderboard::-webkit-scrollbar-thumb:hover {
    background:
        rgba(255, 255, 255, 0.65);
}


/* Firefox */

.leaderboard {
    scrollbar-width: thin;

    scrollbar-color:
        rgba(255, 255, 255, 0.45)
        rgba(0, 0, 0, 0.25);
}


/* =========================================================
   PLAYER ROW
   ========================================================= */

.player {
    display: grid;

    grid-template-columns:
        39px
        1fr
        225px
        118px;

    width: 100%;

    height: 31px;

    min-height: 31px;

    background:
        rgba(4, 19, 34, 0.73);

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.24);

    font-family:
        "Raleway",
        sans-serif;

    font-size: 13px;

    font-weight: 500;

    color: #ffffff;
}


/*
   Последняя строка без лишней линии
*/

.player:last-child {
    border-bottom: none;
}


/* =========================================================
   PLAYER CELLS
   ========================================================= */

.player > div {
    display: flex;

    align-items: center;

    min-width: 0;

    height: 31px;

    padding:
        0 8px;

    border-right:
        1px solid
        rgba(255, 255, 255, 0.24);

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/*
   Убираем границу у последней колонки
*/

.player > div:last-child {
    border-right: none;
}


/* =========================================================
   RANK
   ========================================================= */

.player-rank {
    justify-content: center;

    padding:
        0 4px !important;

    font-family:
        "Arvo",
        serif;

    font-size: 13px;

    font-weight: 700;
}


/* =========================================================
   PLAYER NAME
   ========================================================= */

.player-name {
    justify-content: flex-start;

    font-size: 13px;

    font-weight: 500;
}


/* =========================================================
   SCORE
   ========================================================= */

.player-score {
    justify-content: flex-start;

    font-size: 13px;

    font-weight: 500;
}


/* =========================================================
   TRIES
   ========================================================= */

.player-games {
    justify-content: flex-start;

    font-size: 13px;

    font-weight: 500;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading {
    width: 100%;

    height: 31px;

    display: flex;

    align-items: center;

    padding-left: 10px;

    font-family:
        "Raleway",
        sans-serif;

    font-size: 13px;

    background:
        rgba(4, 19, 34, 0.73);
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;

    height: 110px;

    z-index: 5;
}


/* =========================================================
   MIKU
   ========================================================= */

.miku {
    position: absolute;

    left: 0;
    bottom: 0;

    width: 225px;

    height: auto;

    max-height: 310px;

    object-fit: contain;

    object-position: bottom left;

    pointer-events: none;

    user-select: none;
}


/* =========================================================
   TWITCH BUTTON
   ========================================================= */

.twitch-button {
    position: absolute;

    left: 50%;

    bottom: 42px;

    transform:
        translateX(-50%);

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    color: #ffffff;

    text-decoration: none;

    font-family:
        "Raleway",
        sans-serif;

    font-size: 23px;

    font-weight: 400;

    font-style: italic;

    line-height: 1;

    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.5);

    transition:
        opacity 0.2s ease;
}


.twitch-button:hover {
    opacity: 0.75;
}


/* =========================================================
   TWITCH ICON
   ========================================================= */

.twitch-icon {
    display: block;

    width: 21px;

    height: 21px;

    object-fit: contain;

    flex-shrink: 0;
}


/* =========================================================
   REGISTRATION BUTTON
   ========================================================= */

.details-button {
    position: absolute;

    /*
       Правый край кнопки совпадает
       с правым краем лидерборда.

       665px — ширина лидерборда.
    */

    right:
        max(
            calc((100vw - 665px) / 2),
            20px
        );

    bottom: 42px;

    width: 152px;

    height: 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    color: #ffffff;

    text-decoration: none;

    background:
        rgba(0, 0, 0, 0.63);

    font-family:
        "Raleway",
        sans-serif;

    font-size: 20px;

    font-weight: 400;

    font-style: italic;

    line-height: 1;

    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.4);

    transition:
        background 0.2s ease,
        opacity 0.2s ease;
}


.details-button:hover {
    background:
        rgba(0, 0, 0, 0.80);

    opacity: 0.95;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

/*
   Если экран уже 900px,
   немного уменьшаем таблицу.
*/

@media (max-width: 900px) {

    .leaderboard-section {
        width: 90vw;
    }

    .player {
        grid-template-columns:
            39px
            1fr
            180px
            100px;
    }

    .details-button {
        right: 5vw;
    }

}


/*
   Телефон / очень узкий экран
*/

@media (max-width: 600px) {

    .header h1 {
        font-size: 38px;
    }

    .timer {
        font-size: 21px;
    }

    .leaderboard-section {
        top: 130px;

        width: 94vw;
    }

    .leaderboard-title {
        font-size: 24px;
    }

    .player {
        grid-template-columns:
            38px
            1fr
            130px
            85px;

        font-size: 11px;
    }

    .player > div {
        padding:
            0 5px;
    }

    .player-name,
    .player-score,
    .player-games {
        font-size: 11px;
    }

    .miku {
        width: 145px;
    }

    .twitch-button {
        bottom: 22px;

        font-size: 18px;
    }

    .twitch-icon {
        width: 18px;
        height: 18px;
    }

    .details-button {
        right: 3vw;

        bottom: 20px;

        width: 125px;

        height: 40px;

        font-size: 16px;
    }

}