
: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: absolute!important;
    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: 6.5rem;
}


.cube-wrapper {
    transform-style: preserve-3d;
    animation: bouncing 2s infinite;
    -webkit-transform-style: preserve-3d;
    -webkit-animation: bouncing 2s infinite;
}
  
.cube {
    transform-style: preserve-3d;
    transform: rotateX(45deg) rotateZ(45deg);
    animation: rotation 2s infinite;
    -webkit-transform-style: preserve-3d;
    -webkit-transform: rotateX(45deg) rotateZ(45deg);
    -webkit-animation: rotation 2s infinite;
}
  
.cube-faces {
    transform-style: preserve-3d;
    height: 80px;
    width: 80px;
    position: relative;
    transform-origin: 0 0;
    transform: translateX(0) translateY(0) translateZ(-40px);
    -webkit-transform-style: preserve-3d;
    -webkit-transform-origin: 0 0;
    -webkit-transform: translateX(0) translateY(0) translateZ(-40px);
}
  
.cube-face {
    position: absolute;
    inset: 0;
    background: #eeeeeeff;
    border: solid 1px #000000ff;
}
.cube-face.shadow {
    transform: translateZ(-80px);
    animation: bouncing-shadow 2s infinite;
    border: solid 0px;
    -webkit-transform: translateZ(-80px);
    -webkit-animation: bouncing-shadow 2s infinite;
}
.cube-face.top {
    transform: translateZ(80px);
    -webkit-transform: translateZ(80px);
}
.cube-face.front {
    transform-origin: 0 50%;
    transform: rotateY(-90deg);
    -webkit-transform-origin: 0 50%;
    -webkit-transform: rotateY(-90deg);
}
.cube-face.back {
    transform-origin: 0 50%;
    transform: rotateY(-90deg) translateZ(-80px);
    -webkit-transform-origin: 0 50%;
    -webkit-transform: rotateY(-90deg) translateZ(-80px);
}
.cube-face.right {
    transform-origin: 50% 0;
    transform: rotateX(-90deg) translateY(-80px);
    -webkit-transform-origin: 50% 0;
    -webkit-transform: rotateX(-90deg) translateY(-80px);
}
.cube-face.left {
    transform-origin: 50% 0;
    transform: rotateX(-90deg) translateY(-80px) translateZ(80px);
    -webkit-transform-origin: 50% 0;
    -webkit-transform: rotateX(-90deg) translateY(-80px) translateZ(80px);
}
  
@-webkit-keyframes rotation {
    0% {
      -webkit-transform: rotateX(45deg) rotateY(0) rotateZ(45deg);
              transform: rotateX(45deg) rotateY(0) rotateZ(45deg);
      -webkit-animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
              animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
    }
    50% {
      -webkit-transform: rotateX(45deg) rotateY(0) rotateZ(225deg);
              transform: rotateX(45deg) rotateY(0) rotateZ(225deg);
      -webkit-animation-timing-function: cubic-bezier(0.76, 0.05, 0.86, 0.06);
              animation-timing-function: cubic-bezier(0.76, 0.05, 0.86, 0.06);
    }
    99.9% {
      -webkit-transform: rotateX(45deg) rotateY(0) rotateZ(405deg);
              transform: rotateX(45deg) rotateY(0) rotateZ(405deg);
      -webkit-animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
              animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
    }
    100% {
      -webkit-transform: rotateX(45deg) rotateY(0) rotateZ(45deg);
              transform: rotateX(45deg) rotateY(0) rotateZ(45deg);
      -webkit-animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
              animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
    }
}

@keyframes rotation {
    0% {
      transform: rotateX(45deg) rotateY(0) rotateZ(45deg);
      animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
    }
    50% {
      transform: rotateX(45deg) rotateY(0) rotateZ(225deg);
      animation-timing-function: cubic-bezier(0.76, 0.05, 0.86, 0.06);
    }
    99.9% {
      transform: rotateX(45deg) rotateY(0) rotateZ(405deg);
      animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
    }
    100% {
      transform: rotateX(45deg) rotateY(0) rotateZ(45deg);
      animation-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
    }
}

@keyframes bouncing {
    0% {
      transform: translateY(-40px);
      animation-timing-function: cubic-bezier(0.76, 0.05, 0.86, 0.06);
    }
    45% {
      transform: translateY(40px);
      animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
    }
    100% {
      transform: translateY(-40px);
      animation-timing-function: cubic-bezier(0.76, 0.05, 0.86, 0.06);
    }
}

@keyframes bouncing-shadow {
    0% {
      transform: translateZ(-80px) scale(1.3);
      animation-timing-function: cubic-bezier(0.76, 0.05, 0.86, 0.06);
      opacity: 0.05;
    }
    45% {
      transform: translateZ(0);
      animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
      opacity: 0.3;
    }
    100% {
      transform: translateZ(-80px) scale(1.3);
      animation-timing-function: cubic-bezier(0.76, 0.05, 0.86, 0.06);
      opacity: 0.05;
    }
}         

@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;
}


.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;
    grid-auto-rows: 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: 9.5rem;
    font-size: 1.5rem;
    text-align: right;
}

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

.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, .weekly-description{
    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;
}