
:root {
    --default-scale: 1;
    font-size: 16px;
}

html,
body {
    height: 100%;
    margin: 0;
    background-color: #404040;
    font-family: sans-serif;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
    overflow: hidden;
}

#game {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

#mask-background {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: absolute;
    background-color: #000;
    opacity: 0;
    z-index: 1;
}

canvas {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    position: relative;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
    pointer-events: initial;
    z-index: 10;
    position: absolute;
}

#logo-bottom {
    width: 100%;
    display: none;
    position: relative;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 100%;
}

#logo-bottom img {
    width: 100%
}

@media (max-aspect-ratio: 750/1275) {
    canvas {
        top: calc(50% - 5.2vw / 2 - (100vh - 170vw ) / 6);
    }

    #logo-bottom {
        width: 100%;
        display: block;
        top: calc(50% + 162vw / 2 + (100vh - 170vw ) / 6);
    }
}

.backdrop {
    width: 100%;
    height: 100%;
    background-color: #00000077;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    position: absolute;
    top: 0;
    color: white;
    flex-direction: column;
    gap: 0.625rem;
    font-size: 2em;
    padding-left: 2rem;
    padding-right: 2rem;
    box-sizing: border-box;
}

.loading-screen {
    gap: 5rem;
}

@keyframes fadeInKeyFrames {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeOutKeyFrames {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.fadeIn {
    animation: fadeInKeyFrames 0.2s ease-out;
}

.fadeOut {
    animation: fadeOutKeyFrames 0.2s ease-in;
}

@keyframes loading-1 {
    0% {
        transform:translateX(-110%) scale(0) translateY(-50%);
    }
    30% {
        transform: translateX(-35%) scale(0.6)  translateY(-50%);
    }
    50% {
        transform: translateX(-35%) scale(0.6)  translateY(-50%);
    }
    80% {
        transform: translateX(100%) scale(0.6)  translateY(-50%);
    }
    90% {
        transform:translateX(100%) scale(0)  translateY(-50%);
    }
    90.1% {
        transform:translateX(-110%) scale(0)  translateY(-50%);
    }
    100% {
        transform:translateX(-110%) scale(0)  translateY(-50%);
    }
}

@keyframes loading-3 {
    0% {
        transform:translateX(110%) scale(0) translateY(-50%);
    }
    30% {
        transform: translateX(35%) scale(0.6)  translateY(-50%);
    }
    50% {
        transform: translateX(35%) scale(0.6)  translateY(-50%);
    }
    80% {
        transform: translateX(-100%) scale(0.6)  translateY(-50%);
    }
    80.1% {
        transform:translateX(-100%) scale(0)  translateY(-50%);
    }
    100% {
        transform:translateX(110%) scale(0)  translateY(-50%);
    }
}

@keyframes loading-2 {
    0% {
        transform: scale(1.4) translateY(-50%);
    }
    30% {
        transform: scale(1)  translateY(-50%);
    }
    65% {
        transform: scale(1)  translateY(-50%);
    }
    75% {
        transform: scale(1.4)  translateY(-50%);
    }
    100% {
        transform: scale(1.4)  translateY(-50%);
    }
}

.loading-element:nth-child(1) {
    animation-name: loading-1;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.loading-element:nth-child(3) {
    animation-name: loading-3;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.loading-element:nth-child(2) {
    animation-name: loading-2;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.button {
    border-radius: 0.6rem;
    background-color: #ffffffdd;
}

.button:hover {
    background-color: #f7f7f7dd;
}

.button:active {
    background-color: #eeeeeedd;
}

.leaderboard-screen {
    gap: 0;
    overflow: hidden;
}

.backdrop .container {
    width: calc(1px * var(--canvas-width));
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-flow: column;
}

.leaderboard-screen .header {
    width: 100%;
    box-sizing: border-box;
    height: 5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.leaderboard-screen .main {
    width: 100%;
    height: calc(100% - 5rem);
    display: grid;
    align-items: stretch;
    grid-template-rows: auto min-content;
}

.title {
    font-size: 3.4rem;
    display: block;
}

.leaderboard-screen .main .tabs {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: 50% 50%;
    grid-template-rows: min-content auto;
    border-radius: 1.5rem 1.5rem 0rem 0rem;
    overflow: hidden;
}

.leaderboard-screen .main .tabs label {
    order: 1;
    display: flex;
    justify-content: center;
    padding: 0.25rem 0rem;
    cursor: pointer;
    background: #00000022;
    font-weight: bold;
    transition: background ease 0.2s;
    width: 100%;
    grid-row: 1;
}

.leaderboard-screen .main .tabs .tab {
    order: 99;
    flex-grow: 1;
    width: 100%;
    height: 100%;
    display: none;
    background: #ffffff22;
    grid-row: 2;
    grid-column: 1/3;

    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */

    grid-template-rows: repeat(25, min-content);
}

.leaderboard-screen .main .tabs .tab.loading {
    align-items: center;
    justify-content: center;
    display: flex;
    cursor: default;
    grid-template-rows: 100%;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.leaderboard-screen .main .tabs .tab::-webkit-scrollbar {
    display: none;
}

.tabs input[type='radio'] {
    display: none !important;
}

.tabs input[type='radio']:checked + label {
    background: #ffffff22;
}

.leaderboard-screen .main .tabs input[type='radio'] + label + .tab {
    display: none;
    cursor: default;
    overflow: auto;
}

.leaderboard-screen .main .tabs input[type='radio']:checked + label + .tab {
    display: inherit;
    cursor: grab;
    overflow: auto;
}

.tabs .tab {
    overflow-y: scroll;
}

.leader {
    width: 100%;
    height: 6rem;
    display: flex;
    flex-direction: row;
    padding: 1.5rem;
    box-sizing: border-box;
    align-items: center;
}

.leader.my {
    background-color: #ffffff77;
}

.leader.my {
    background-color: #ffffff77;
    height: calc(6rem + 0.125rem);
}

.leader .avatar {
    width: 4rem;
    height: 4rem;
    margin-right: 1.5rem;
    font-size: 0.8rem;
}

.leader .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 100%;
}

.leader .right {
    width: 13rem;
    font-size: 1.5rem;
    text-align: right;
}

.leader .main {
    width: calc(100% - 5.5rem - 13rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.leader .main .name {
    font-size: 1.6rem;
}

.leader .main .rank {
    font-size: 1.4rem;
}

.tab .game-leaderboard-spacer {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12.727922061357855' height='9' viewBox='0.7071067811865475 0 12.727922061357855 9' fill='%23ffffff' opacity='0.7'%3E%3Crect x='0' y='8' width='10' height='1' transform='rotate(-45 0 8)'/%3E%3Crect x='7.071067811865475' y = '0.9289321881345254' width='10' height='1' transform='rotate(45 7.071067811865475 0.9289321881345254)' /%3E%3C/svg%3E")
        0 50% repeat-x;
    height: 1rem;
    padding: 0.8rem 0;
    width: 100%;
}

.mock-ad {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mock-ad button {
    font-size: 5rem;
}

.warning-not-login{
    width: 100%;
    height: 6rem;
    display: flex;
    padding: 1.5rem;
    box-sizing: border-box;
    align-items: center;
    background-color: #ffffff77;
    text-align: center;
    vertical-align: middle;
    display: flex;
    justify-content: center;
}

.warning-max-score {
    width: 100%;
    height: 8rem;
    font-size: 1.85rem;
    display: flex;
    padding: 1.5rem;
    box-sizing: border-box;
    align-items: center;
    background-color: #ffffff77;
    text-align: center;
    vertical-align: middle;
    display: flex;
    justify-content: center;
}