body, html, * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    font-family: sans-serif;
    color: #424243;
    user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}

body {
    --moves-badge-display: flex;
    --moves-badge-counter: 0;

    --blow-color-badge-display: none;
    --blow-color-badge-counter: 0;
    --blow-color-bg-height: 0%;

    --blow-nearby-badge-display: none;
    --blow-nearby-badge-counter: 0;
    --blow-nearby-bg-height: 0%;

    --any-color-badge-display: none;
    --any-color-badge-counter: 0;
    --any-color-bg-height: 0%;
}

html, body {
    width: 100%;
    height: 100%;
}

p {
    margin: 12px 0;
}

p > svg {
    display: block;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    float: left;
}

p > span {
    display: block;
}

h3 {
    margin: 16px 0;
}

.app {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    transition: all 0.1s ease-in;
}

.app-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    align-items: center;
    gap: 12px;
    overflow: visible;
}

.timer {
    width: 100%;
    height: 8px;
    font-weight: 700;
    border-radius: 6px;
    box-sizing: border-box;
    box-shadow: inset 1px 1px 3px #999, inset -1px -1px 3px #ccc;
}

.timer_filler {
    display: block;
    width: 100%;
    height: 100%;
    background-color: unset;
    border-radius: 1px;
    transition: all 0.3s linear;
}


.header {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 12px;
    width: 100%;
    overflow: visible;
}

.score-counter-container, .score-counter, .best-score, .new-game-button-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: center;
    align-items: center;
    text-align: left;
    gap: 6px;
    transition: transform 0.1s ease-in;
    transform-origin: center center;
    transform: scale(1);
    font-size: 24px;
    font-weight: 700;
    padding: 0 12px;
    overflow: visible;
}

.score-counter__bounce {
    transform: scale(1.5);
    color: rgb(0, 119, 237);
}

.pulse {
    border-radius: 6px;
    animation-name: pulse-animation;
    animation-duration: 2s;
    animation-fill-mode: both;
    animation-direction: normal;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    z-index: 1;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
        opacity: 1;
        transform: scale(1, 1);
    }
    50% {
        box-shadow: rgba(0, 0, 0, 0.2) 0 10px 16px 0, rgba(0, 119, 237, 0.1) 0 6px 20px 0;
        opacity: 1;
        transform: scale(1.02, 1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
        opacity: 1;
        transform: scale(1, 1);
    }
}

.boosters {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    overflow: visible;
}

.button {
    position: relative;
    background-color: rgb(255, 255, 255);
    border: 2px solid rgb(0, 119, 237);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    overflow: visible;
    transition: all 0.3s;
    z-index: 1;
}

.button:active {
    background-color: rgba(255, 78, 64, .06);
    border: 2px solid rgb(255, 78, 64);
}

.button:active > svg {
    fill: rgb(255, 78, 64);
}

.button:disabled {
    border: 2px solid rgb(204, 204, 204);
    cursor: default;
}

.button:disabled > svg {
    fill: rgb(204, 204, 204);
}

#booster-blow-color .button-badge,
#booster-show-move .button-badge,
#booster-blow-nearby .button-badge,
#booster-any-color .button-badge {
    display: none;
    content: unset;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    align-items: center;
    text-align: center;
    color: white;
    min-width: 2em;
    min-height: 2em;
    font-size: small;
    position: absolute;
    right: -0.75em;
    top: -0.75em;
    background-color: rgb(0, 119, 237);
    border-radius: 50%;
    border: 2px solid white;
}

#booster-blow-color .button-badge {
    content: var(--blow-color-badge-counter);
    display: var(--blow-color-badge-display);
}

#booster-show-move .button-badge {
    content: var(--moves-badge-counter);
    display: var(--moves-badge-display);
}

#booster-blow-nearby .button-badge {
    content: var(--blow-nearby-badge-counter);
    display: var(--blow-nearby-badge-display);
}

#booster-any-color .button-badge {
    content: var(--any-color-badge-counter);
    display: var(--any-color-badge-display);
}

#booster-blow-color:before, #booster-blow-nearby:before, #booster-any-color:before {
    position: absolute;
    content: '';
    display: block;
    box-sizing: border-box;
    width: 100%;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 119, 237, .1);
    z-index: -1;
    transition: height 0.3s;
}

#booster-blow-color:before {
    height: var(--blow-color-bg-height);
}

#booster-blow-nearby:before {
    height: var(--blow-nearby-bg-height);
}

#booster-any-color:before {
    height: var(--any-color-bg-height);
}

#booster-show-move[disabled=disabled]:before {
    position: absolute;
    content: '';
    display: block;
    width: 100%;
    height: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 119, 237, .1);
    z-index: -1;
    animation-name: height-rise;
    animation-duration: 5s;
    animation-delay: 0s;
    animation-iteration-count: 1;
    animation-timing-function: linear;
    transition: height 0.3s;
}

@keyframes height-rise {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

.game-field {
    border: 2px solid #ccc;
    border-radius: 6px;
    position: relative;
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
}

canvas {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.game-field-overlay {
    position: absolute;
    display: flex;
    gap: 12px;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    align-items: center;
    z-index: 2;
    /*background-color: white;*/
    padding: 12px;
    /*border-radius: 6px;
    border: 2px solid #cccccc;*/
}

.game-field-overlay span {
    fill: white;
    color: white;
    text-shadow: 1px 1px 3px #000;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.times-up, .no-moves {
    display: none;
}

.overlay-times-up > .times-up {
    display: block;
}
.overlay-no-moves > .no-moves {
    display: block;
}


.controllers {
    width: 100%;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 12px;
    overflow: visible;
}

.controllers-item {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    border: 2px solid rgb(0, 119, 237);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    background-color: rgb(255, 255, 255);
    color: rgb(0, 119, 237);
    cursor: pointer;
    transition: all 0.5s;
    position: relative;
    overflow: visible;
}

.controllers-item__enabled {
    background-color: rgb(0, 119, 237);
    color: rgb(255, 255, 255);
    cursor: pointer;
}


.controllers-item[data-role="checkbox"] {
    border: 2px solid #ccc;
}

.controllers-item__enabled.controllers-item[data-role="checkbox"] {
    border: 2px solid rgb(0, 119, 237);
}

.controllers-item[data-role="checkbox"]::before {
    content: '';
    position: absolute;
    left: 0.5em;
    display: block;
    width: 1em;
    height: 1em;
    background-color: white;
    border: 2px solid rgb(0, 119, 237);
    border-radius: 3px;
    transition: all 0.25s ease-in-out;
}

.controllers-item__enabled.controllers-item[data-role="checkbox"]::before {
    content: '✅';
}

#show-move-button.controllers-item:after {
    display: var(--moves-badge-display);
    justify-content: center;
    align-content: center;
    align-items: center;
    text-align: center;
    color: white;
    min-width: 1.5em;
    min-height: 1.5em;
    font-size: small;
    content: var(--moves-badge-counter);
    position: absolute;
    right: -0.5em;
    top: -0.75em;
    background-color: rgb(0, 119, 237);
    border-radius: 50%;
    border: 2px solid white;
}

.statistics {
    width: 100%;
    height: 16px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-content: center;
    align-items: center;
    gap: 2px;
    transition: all 1s;
}

.statistics > div {
    width: 0;
    height: 16px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    transition: all 0.5s;
}

@media (orientation: landscape) {
    .app-container, .app-container > .game-field {
        width: 480px;
    }

    .controllers-item {
        font-size: 16px;
    }

    body, html {
        overflow-y: scroll;
        overflow-x: hidden;
    }
}

@media (orientation: portrait) {
    .app-container, .app-container > .game-field {
        width: 100%;
    }

    .controllers-item {
        font-size: 12px;
    }

    body, html {
        overflow: hidden;
    }
}

.header > *, .timer > *, .statistics > *, .boosters > *, .controllers > * {
    pointer-events: none;
}

/* The Modal - https://www.w3schools.com/howto/howto_css_modals.asp */
.faq-modal {
    display: none;
    align-content: center;
    justify-content: center;
    align-items: center;
    position: fixed; /* Stay in place */
    z-index: 100; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0, 0, 0); /* Fallback color */
    background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}

.faq-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: small;
    background-color: #fefefe;
    padding: 16px;
    border: 1px solid #888;
    width: 90%;
    max-width: 480px;
    height: 90%;
    box-shadow: rgba(0, 0, 0, 0.5) 0 2px 12px 0;
    box-sizing: border-box;
    border-radius: 6px;
}

.faq-modal-close-button {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
}

.faq-modal-close-button:hover > svg,
.faq-modal-close-button:focus > svg {
    fill: black;
    cursor: pointer;
}

.faq-header {
    display: flex;
    justify-content: space-between;
    align-content: center;
    align-items: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
}

.faq-content {
    display: block;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
}

/* Snackbar (toast) - https://www.w3schools.com/howto/howto_js_snackbar.asp*/
#snackbar {
    visibility: hidden; /* Hidden by default. Visible on click */
    width: 90%; /* Set a default minimum width */
    max-width: 450px;
    background-color: rgb(66, 66, 67); /* Black background color */
    color: #fff;
    font-size: smaller;
    font-weight: normal;
    text-align: left; /* Centered text */
    border-radius: 2px; /* Rounded borders */
    padding: 12px; /* Padding */
    position: fixed; /* Sit on top of the screen */
    z-index: 100; /* Add a z-index if needed */
    bottom: 16px; /* 30px from the bottom */
    box-shadow: rgba(0, 0, 0, 0.5) 0 2px 12px 0;
    box-sizing: border-box;
}

#snackbar.snackbar-show {
    visibility: visible;
    animation: snackbar-fadein 0.5s, snackbar-fadeout 0.5s 2.5s;
}

@-webkit-keyframes snackbar-fadein {
    from {
        bottom: 0;
        opacity: 0;
    }
    to {
        bottom: 16px;
        opacity: 1;
    }
}

@keyframes snackbar-fadeout {
    from {
        bottom: 16px;
        opacity: 1;

    }
    to {
        bottom: 0;
        opacity: 0;
    }
}

.footer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;

    width: 100%;
    overflow: visible;
    margin-top: 32px;
    font-size: 12px;
    font-weight: 700;
    color: rgb(0, 119, 237);
}

.footer > div {
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    color: rgb(0, 119, 237);
    cursor: pointer;
}

.footer > div > svg {
    display: block;
    width: 24px;
    height: 24px;
    margin-right: 5px;
    fill: rgba(66, 66, 67, .7);
}
.footer > div > span {
    color: rgba(66, 66, 67, .7);
}

.footer > div:hover > svg, .footer > div:hover > span {
    fill: rgba(66, 66, 67, 1);
    color: rgba(66, 66, 67, 1);
}



[data-lang="ru"], [data-lang="en"] {
    display: none;
}

.
