* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Standard */

    -webkit-touch-callout: none;
    -webkit-user-callout: none;
    -webkit-user-drag: none;
    -webkit-user-modify: none;
    -webkit-highlight: none;

    touch-action: manipulation;

    -webkit-tap-highlight-color: transparent;
}

button {
    all: unset;
}

body {
    background-color: #12131c;
    font-family: Arial, Helvetica, sans-serif;
    background-image: url("assets/background.png");
    overflow: hidden;
}

.modalBackdrop {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background: #000000A6;
    overflow: hidden;
}

.modalBackdrop.active {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    animation: fadein 0.35s;
}

.modalBackdrop.fadeout {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    animation: fadeout 0.35s;
}

@keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeout {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#modal-rules {
    top: auto;
    min-width: 280px;
    width: 700px;
    max-width: calc(100dvw - 40px);
    min-height: 280px;
    height: 550px;
    max-height: calc(100dvh - 40px);
    display: none;
}

#modal-rules > .modal-header {
    background: rgb(125, 125, 125);
    background: linear-gradient(180deg,rgb(125, 125, 125) 0%, rgb(80, 80, 80) 100%);
}

#endGame-level-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px 8px 10px;
    border-bottom: 1px solid #303030;
}

#endGame-level-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #cacaca;
}

#endGame-level-progress-bar-background {
    background-color: #939393;
    width: 100%;
    height: 16px;
    border-radius: 3px;
    position: relative;
}

.endGame-level-progress-bar-foreground {
    height: 100%;
    border-radius: 3px;
    position: absolute;
}

#endGame-level-progress-bar-foreground-diff {
    background-color: #ffc40077;
    width: 40%;
    z-index: 2;
}

#endGame-level-progress-bar-foreground-final {
    background-color: #ffc400;
    width: 30%;
    z-index: 3;
}

#endGame-level-points {
    font-size: 14px;
    color: #cacaca;
    margin-top: 6px;
    width: 100%;
    text-align: center;
}

.modal-scrollable-container {
    width: 100%;
    overflow-y: scroll;
}

.modal-scrollable-container::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 6px;
  background: #1b1c25;
}

.modal-scrollable-container::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgb(220, 220, 220);
  box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

#modal-rules-content {
    margin: 15px 20px 0 20px;
    color: white;
}

#modal-rules-content > h3 {
    margin-bottom: 6px;
    font-size: 20px;
}

#modal-rules-content > p {
    margin-bottom: 6px;
    font-size: 16px;
    margin-left: 4px;
}

#modal-rules-content > img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 6px;
}


#modal-rules-action-button {
    margin-top: 10px;
    margin-bottom: 10px;
}

.modal {
    min-width: 280px;
    width: 400px;
    max-width: calc(100dvw - 20px);
    min-height: 338px;
    max-height: calc(100dvh - 20px);
    background-color: #12131c;
    border-radius: 27px;
    color: white;
    position: absolute;
    align-items: center;
    flex-direction: column;
    box-shadow: 0px 5px 10px 2px rgba(34, 34, 34, 0.4);
    display: none;
    cursor: default;
}

.modal-header {
    width: 100%;
    height: 54px;
    background: #549140;
    background: linear-gradient(180deg,rgba(84, 145, 64, 1) 0%, rgba(65, 115, 50, 1) 100%);
    border-radius: 27px 27px 0 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.modal-header-title {
    width: 100%;
    font-size: 30px;
    text-shadow: 1px 1px 1px rgb(77, 77, 77);
    text-align: center;
    color: #cacaca;
    font-family: Tahoma, Verdana, sans-serif;
    font-weight: 700;
}

.endGame-counters-container {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.endGame-counterWithTitle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.endGame-counter-title {
    font-size: 14px;
    color: #939393;
    margin-bottom: 6px;
    padding-top: 12px;
}

.endGame-counter-value {
    font-size: 26px;
    color: #cacaca;
    font-weight: 800;
}

.endGame-bestCounter-value {
    font-size: 22px;
    color: #cacaca;
    font-weight: 700;
}

.endGame-bestCounter-value.opacity0 {
    opacity: 0;
    transition: opacity 0.35s linear;
}

.endGame-bestCounter-value.opacity1 {
    opacity: 1;
    transition: opacity 0.35s linear;
}

.modal-action-button {
    margin-top: 8px;
    margin-bottom: 8px;
    height: 44px;
    padding: 0 44px 0 44px;
    border-radius: 999px;
    color: rgb(230, 230, 230);
    font-size: 19px;
    font-weight: 500;
    background-color: #549140;
    flex-shrink: 0;
}

@media (hover: hover) {
    .modal-action-button:hover {
        background-color: #4a7b39;
        cursor: pointer;
    }
}

.modal-action-button:active {
    background-color: #4a7b39;
    cursor: pointer;
}

#modalNewGameButton {
    margin-top: 20px;
    margin-bottom: 15px;
}

#header-container {
    width: 968px;
    left: 0;
    right: 0;
    margin: 0 auto;
    position: absolute;
}

#header {
    background-color: #12131cdd;
    height: 40px;
    align-items: center;
    display: flex;
    justify-content: space-between;
    border-radius: 6px;
    margin: 8px;
    opacity: 0;
}

.header-label-value-container {
    align-items: center;
    display: flex;
}

.header-counter-label {
    font-size: 20px;
    color: #c0c0c0;
    margin-right: 3px;
}

.header-counter-value {
    margin-top: 1px;
    font-size: 22px;
    font-weight: 600;
    text-align: left;
    color: #ffdd00;
}

#auto-finish-container {
    position: absolute;
    left: 0;
    right: 0;
    width: fit-content;
    margin: 0 auto;
    bottom: 20px;
}

#auto-finish-button {
    padding: 12px 24px;
    border-radius: 6px;
    background: #8ed41eAA;
    color: white;
    text-shadow: 1px 1px 1px rgb(77, 77, 77);
    font-size: 22px;
    margin: 16px 16px 0px 16px;
    z-index: 2;
    display: block;
}

@media (hover: hover) {
    #auto-finish-button:hover {
        background: #8ed41edb;
        cursor: pointer;
    }
}

#auto-finish-button:active {
        background: #8ed41edb;
    }

#auto-finish-close-button {
    width: 40px;
    height: 40px;
    top: 0;
    right: 0;
    position: absolute;
    display: block;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAABlmWCKAAAKMUlEQVR4Ac2aCawV1RnHeRQXBKEiFmtE8VltBYWoIGpNQcU1liqSqFFwCWCqiIYmr03dQG1sbeqCCyqIFlyqYkS0GqNBRSVKCVRpRVzwQdyFViyCK6+//7yZeXPnnm3m3fvgS/7MOd9+vrPMmctr6FRHamlp6YL7QWB/0BijD8/uoBvYBnwJNoAvQDNYBd4GixsaGtbyrCs11No7g9bgTgQjwBCwAyhLKsRL4DGKsaKsE5ddzQrAwDXL54BjwPag1rQShw+CuRTj61o5b3cBGPhAkpkIhtUqKY+fz5DPAH+rRSFKF4CB9ySJJnAqKO0H27K0BsOpFEFbpDSVSpzBH0fEKaBX6ci1M3wcV1MohA7SwlSoAAy8CxF+C8YWjlRfg9W4n0QR3iwaJrgADL4Hzm8HBxcNYtFvgb8Z/MAiL8r+CoMmivB0EcOgAjD43ji9G+xbxHmsu4nnEvAq0GvtPbAObCTZzfjejvaOoC/QXUGH6uFgD1CUvsfgCvzODTX0FiAe/AM4LJKQZvZ58Ch4joS+5VmIiKtinBJjl0LGnTpdRcz7QmycBSAJXWLuBQNCnKGjgetQmk4Cmul2EzlsixO9ac4HPw50qDwuIQfvdrAWgMCdcaL37RGBQd9AT8tveaB+ITXy6YqB7hvngpBzQ5els8lnGU8ruQpwIVaTrJZtAh1mKtSNBNMerCtRiAMIMA3sFhDoI3R+RV7rbbrGAhBEJ/0c4Ku0DrjJBFhgC1APPvnpEnYzGBrg/1ny02QaScu8gnCuU/k64Bu8vt7O6+jBK9l4RsfRfFZ9D41gTCNtOlUFQFGOd7cZxHy9cyeQyFKPXt3ExP4G59q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QB9r0qcw2kojge6FIWQtu9EctC9xknOAsiSBLTf7gON6geSCrEIPAr0h4rGA8jli7j7IT8FjAS6FYaSYl9OzIdDDLwFkJO4CLoj6K5dlL7BYBl4FbwDVgF97HwJvgO6Mu8I+gIVWb9A6WTfFRQlzfzvGPz8UMOgAsgZRdCFQ2fCoepvhaRVVvjPdkMOk2isVHUDjfPADKBltjXRuyQzmhy9ez6fdPAKyBqyGo6kr0/fXbL8LdR+hLjXMPiNZeKXKoACUQTt28ngdBC8ktCtFeksuZKBL26Pw9IFSIJSiJ/RvhAcA9rtL/HreH6ITL8r6u8G2/1ZXrOEKYQ+SM4Buhrr0lJreh2HD4J5DFxvj5pQzQqQZEMhdHk6FowAemP0AGVoM0YrwItAf6Wqg67mVPMCZDOkGDob+oMDQGOMPjy1QvRa1feDDi/dCT4HzUB7W9fqJQxaP2HVlf4PibPHQIkSPPUAAAAASUVORK5CYII=");
    background-size: 32px 32px;
    background-repeat:   no-repeat;
    background-position: center center;    
    border-radius: 20px;
    z-index: 3;
    background-color: #0000001a;
}

@media (hover: hover) {
    #auto-finish-close-button:hover {
        background-color: #00000065;
        cursor: pointer;
    }
}

#auto-finish-close-button:active {
        background-color: #00000065;
    }

@media screen and (min-height: 500px) {
    .modal {
        top: 23%;
    }
}

@media screen and (min-height: 430px) and (min-width: 400px) {
    .modal {
        max-width: calc(100dvw - 40px);
        max-height: calc(100dvh - 40px);
    }

    .modal-header-title {
        font-size: 32px;
    }

    .endGame-counter-title {
        font-size: 16px;
        padding-top: 20px;
    }

    .endGame-counter-value {
        font-size: 30px;
    }

    .endGame-bestCounter-value {
        font-size: 26px;
    }

    #endGame-level-container {
        padding: 12px 15px 12px 15px;
    }

    #endGame-level-title {
        font-size: 22px;
        margin-bottom: 8px;
    }

    #endGame-level-progress-bar-background {
        height: 20px;
    }

    #endGame-level-points {
        font-size: 16px;
        margin-top: 8px;
    }
}

@media screen and (min-height: 430px) and (min-width: 500px) {
    #auto-finish-button {
        padding: 16px 28px;
        font-size: 24px;
    }
}

#loader {
    width: 44px;
    padding: 8px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #e3e3e3;
    --_m: 
      conic-gradient(#0000 10%,#000),
      linear-gradient(#000 0 0) content-box;
    -webkit-mask: var(--_m);
            mask: var(--_m);
    -webkit-mask-composite: source-out;
            mask-composite: subtract;
    animation: l3 1s infinite linear;
    position: absolute;
    text-align: center;
    top: 40%;
    left: calc(50% - 22px);
}
@keyframes l3 {to{transform: rotate(1turn)}}

#top-menu {
    margin: 0 16px 16px 16px;
    height: 32px;
    justify-content: space-between;
    align-items: center;
    display: none;
}

#top-menu-left-container {
    height: 100%;
    display: flex;
    gap: 8px;
    align-items: start;
}

#top-menu-right-container {
    height: 100%;
    display: flex;
    gap: 8px;
    align-items: end;
}

#left-menu {
    position: absolute;
    left: 0;
    width: 200px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.top-menu-button {
    background-color: #12131cee;
    height: 32px;
    min-width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 5px;
    padding: 0 6px 0 6px;
}

@media (hover: hover) {
    .top-menu-button:hover {
        cursor: pointer;
        background-color: #222325ee;
        transform: scale(0.97);
    }
}

.top-menu-button:active {
    cursor: pointer;
    background-color: #222325ee;
    transform: scale(0.97);
}

.top-menu-button:disabled {
    background-color: #12131cee;
    cursor: auto;
    opacity: 60%;
    transform: scale(1);
}

.top-menu-button-img {
    width: 16px;
    height: 16px;
}

.top-menu-button-text {
    font-size: 14px;
    color: #dedede;
    white-space: nowrap;
}
