:root {
    --game-size: 6;
}

@font-face {
    font-family: "GravityBold8";
    src: url("./fonts/GravityBold8.ttf");
    font-display: swap;
}

@font-face {
    font-family: "GravityRegular5";
    src: url("./fonts/GravityRegular5.ttf");
    font-display: swap;
}

.text-regular {
    font-family: 'GravityRegular5', serif;
    font-weight: 500;
    font-style: normal;
}

.text-bold {
    font-family: 'GravityBold8', serif;
    font-weight: 500;
    font-style: normal;
}

.text-magenta {
    color: #E20074;
}

.no-decoration {
    text-decoration: none;
    text-underline: none;
    color: black;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.2;
}

html {
    background: url("./images/pc-bg-game.png") repeat-x;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

body {
    margin: 0;
    font-size: 14px;
    width: 100%;
    height: 100%;
    max-width: 414px;
    max-height: 736px;
}

.button {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    height: 94px;
    cursor: pointer;
    border-radius: 30px;
    background-color: white;
}

.button-left {
    width: 20px;
    height: 100%;
    background: url("./images/button-normal-left.png") no-repeat top left/contain;
}

.button-center {
    flex: 1;
    height: 100%;
    background: url("./images/button-normal-body.png") repeat-x top center/contain;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.button-right {
    width: 20px;
    height: 100%;
    background: url("./images/button-normal-right.png") no-repeat top right/contain;
}

.button__small .button-left {
    width: 13px;
}

.button__small .button-center {
    font-size: 10px;
}

.button__small .button-right {
    width: 13px;
}

.button:hover {
    background-color: transparent;
}

.button:hover span, .button:hover img {
    padding-top: 8px;
}

.button:hover .button-left {
    background: url("./images/button-pressed-left.png") no-repeat top left/contain;
}

.button:hover .button-center {
    background: url("./images/button-pressed-body.png") repeat-x top center/contain;
}

.button:hover .button-right {
    background: url("./images/button-pressed-right.png") no-repeat top right/contain;
}

.no-button {
    flex: 0 0 auto;
    align-self: flex-end;
    font-size: 12px;
    cursor: pointer;
}

.button.muted {
    opacity: 0.5;
    cursor: not-allowed;
}

.button .play-icon {
    width: 12px;
    height: 14px;
}

.button .restart-icon {
    width: 27px;
    height: 19px;
}

.button .times-icon {
    width: 18px;
    height: 12px;
}

.button .sound-icon {
    width: 46px;
    height: 42px;
}

#launchGameButton {
    width: 208px;
    height: 94px;
    margin-top: 64px;
}

#startGameButton {
    width: 100%;
    max-width: 132px;
    height: 60px;
}

#soundControlButtonOn, #soundControlButtonOff {
    width: 72px;
    height: 60px;
}

#endGameButton {
    height: 60px;
}

#careerPageButton, #restartGameButton {
    width: 100%;
    max-width: 292px;
    height: 94px;
}

.prevent-select {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

.screen {
    display: none;
}

#startGameScreen {
    width: 100%;
    height: 100%;
    background: url("./images/intro.jpg") top center/cover;
}

#startGameScreen .container {
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 54px;
    height: calc(100% - 64px);
    width: calc(100% - 52px);
    position: relative;
}

#startGameScreen .container h2 {
    margin-top: 72px;
    color: white;
    font-size: 21px;
    line-height: normal;
}

#startGameScreen .container .logo-start {
    width: 363px;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

#startGameScreen .container .t-mobile-logo {
    position: absolute;
    bottom: 32px;
}

#storyGameScreen {
    width: 100%;
    height: 100%;
    background-color: #E20074;
}

#storyGameScreen .container {
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

#storyGameScreen .container .plotter {
    padding: 32px 20px;
    background-color: white;
    border: 2px solid black;
    border-radius: 12px;
    line-height: 200%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100% - 150px);
    width: calc(100% - 40px);
    gap: 16px;
}


#storyGameScreen .container .plotter .content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 12px;
}

#storyGameScreen .container .plotter .content::-webkit-scrollbar,
#endGameScreen .container .plotter .content #endGameInfo::-webkit-scrollbar {
    width: 6px;
}

#storyGameScreen .container .plotter .content::-webkit-scrollbar-track,
#endGameScreen .container .plotter .content #endGameInfo::-webkit-scrollbar-track {
    background: transparent;
}

#storyGameScreen .container .plotter .content::-webkit-scrollbar-thumb,
#endGameScreen .container .plotter .content #endGameInfo::-webkit-scrollbar-track {
    background: #E20074;
}

#storyGameScreen .container .plotter .content::-webkit-scrollbar-thumb:hover,
#endGameScreen .container .plotter .content #endGameInfo::-webkit-scrollbar-track {
    background: #E20074;
}

#storyGameScreen .container .plotter .actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#storyGameScreen .container .plotter .actions .dialog-wrapper,
#introGameScreen .container .plotter .actions .dialog-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
}

#storyGameScreen .container .plotter .actions .miss-t {
    width: 38px;
    height: 46px;
    align-self: center;
}

#storyGameScreen .container .plotter .actions .more,
#introGameScreen .container .plotter .actions .more {
    display: none;
    width: 37px;
    height: 21px;
    align-self: center;
}

#introGameScreen {
    width: 100%;
    height: 100%;
    background-color: #E20074;
}

#introGameScreen .container {
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    height: calc(100% - 64px);
    width: calc(100% - 52px);
}

#introGameScreen .container .plotter {
    padding: 32px 20px;
    background-color: white;
    border: 2px solid black;
    border-radius: 12px;
    line-height: 200%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    height: calc(100% - 128px);
    width: calc(100% - 40px);
}

#introGameScreen .container .plotter .content {
    height: 420px;
    overflow-y: auto;
    padding-right: 12px;
}

#introGameScreen .container .plotter .content .enemy-table {
    display: grid;
    grid-template-columns: 50px 1fr;
    grid-template-rows: repeat(6, 50px);
    column-gap: 12px;
    row-gap: 20px;
    margin: 16px 0;
}

#introGameScreen .container .plotter .content .enemy-table img {
    width: 100%;
    height: 100%;
}

#introGameScreen .container .plotter .content .enemy-table .text-regular {
    font-size: 10px;
}

#introGameScreen .container .plotter .content::-webkit-scrollbar {
    width: 6px;
}

#introGameScreen .container .plotter .content::-webkit-scrollbar-track {
    background: transparent;
}

#introGameScreen .container .plotter .content::-webkit-scrollbar-thumb {
    background: #E20074;
}

#introGameScreen .container .plotter .content::-webkit-scrollbar-thumb:hover {
    background: #E20074;
}

#introGameScreen .container .plotter .actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#introGameScreen .container .plotter .actions .miss-t {
    width: 38px;
    height: 46px;
    align-self: center;
}

#introGameScreen .container .plotter .actions .button-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}


#gameScreen {
    width: 100%;
    height: 100%;
    background-color: #E20074;
}

#gameScreen .container {
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#gameScreen .container header {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
}

#gameScreen .container header .pathcleaner-logo {
    width: 150px;
    height: 45px;
    align-self: center;
}

#gameScreen .container header .stats {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
}

#gameScreen .container header .stats #score {
    font-size: 18px;
    line-height: 200%;
}

#gameScreen .container header .stats progress#clock {
    width: 62px;
    height: 23px;
    border: 4px solid black;
    border-radius: 8px;
    margin-top: 4px;
}

#gameScreen .container header .stats progress#clock::-webkit-progress-bar {
    background: rgb(0, 186, 202);
    background: linear-gradient(180deg, rgba(0, 186, 202, 1) 25%, rgba(0, 115, 125, 1) 25%);
}

#gameScreen .container header .stats progress#clock::-webkit-progress-value {
    background: rgb(109, 253, 254);
    background: linear-gradient(180deg, rgba(109, 253, 254, 1) 25%, rgba(0, 186, 202, 1) 25%);
}

#gameScreen .container #game {
    background: url("./images/board.png") no-repeat top left/cover;
    width: 288px;
    height: 288px;
    margin: 16px auto;
    position: relative;
}

#gameScreen .container #game #achievement-wrapper {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    background-color: #CF2C73;
    opacity: 0.9;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#gameScreen .container #game #board {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1/1;

    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(var(--game-size), 1fr);
    grid-template-rows: repeat(var(--game-size), 1fr);
    gap: 4px;
    padding: 8px;
}

#gameScreen .container #game #board .field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
}

#gameScreen .container #game #board.move .field:not(.supported) .candy {
    opacity: 0.5;
}

#gameScreen .container #game #board.move .field.active .candy {
    opacity: 0.75;
    animation: tilt-shaking 300ms infinite;
}

#gameScreen .container #game #board .candy {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1/1;
}

#gameScreen .container #game #board .candy.destroyed {
    animation: fallAway forwards 300ms ease-out 1;
}

#gameScreen .container .panel-control {
    width: 100%;
    display: grid;
    grid-template-rows: repeat(1, 1fr);
    grid-template-columns: repeat(2, 1fr);
}

#gameScreen .container .panel-control > div {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
}

#gameScreen .container .panel-control > div:first-child {
    justify-content: start;
}

#gameScreen .container .panel-control > div:last-child {
    justify-content: end;
}

#gameScreen .container footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#gameScreen .container footer .t-mobile-logo {
    width: 31px;
    height: 37px;
    margin-top: 18px;
}

#endGameScreen {
    width: 100%;
    height: 100%;
    background-color: #E20074;
}

#endGameScreen .container {
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

#endGameScreen .container .plotter {
    padding: 32px 20px;
    background-color: black;
    border: 2px solid white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 64px);
}

#endGameScreen .container .plotter .content {
    color: white;
    line-height: 200%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
}

#endGameScreen .container .plotter .content h2 {
    font-size: 22px;
}

#endGameScreen .container .plotter .content #endGameInfo {
    font-size: 14px;
    overflow-y: auto;
    padding-right: 12px;
}

#endGameScreen .container .plotter .content .button-wrapper {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.w-75 {
    width: 75%;
}

.mx-auto {
    margin: 0 auto;
}

#endGameScreen #title-placeholder {
    width: 100%;
    position: relative;
    height: 60px;
}

#endGameScreen #title-placeholder #game-over-text {
    opacity: 1;
    position: absolute;
    top: 0;
}

#endGameScreen #title-placeholder #final-result {
    opacity: 0;
    position: absolute;
    top: 0;
}

@keyframes fallAway {
    0% {
        transform: rotateZ(0deg);
        top: 0;
        opacity: 1;
    }
    25% {
        transform: rotateZ(-15deg);
    }
    100% {
        top: 300px;
        transform: rotateZ(-5deg);
        opacity: 0;
    }
}

@keyframes tilt-shaking {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

@media screen and (min-width: 375px) {
    #storyGameScreen .container {
        gap: 40px;
    }

    #storyGameScreen .container .plotter {
        gap: 16px;
    }

    #storyGameScreen .container .plotter .actions .dialog-wrapper .more,
    #introGameScreen .container .plotter .actions .dialog-wrapper .more {
        display: flex;
        animation: blink-animation 2s steps(5, start) infinite;
    }

    #introGameScreen .container .plotter .content .enemy-table .text-regular {
        font-size: 12px;
    }

    #gameScreen .container header .pathcleaner-logo {
        width: 200px;
        height: 59px;
    }

    #gameScreen .container header .stats #score {
        font-size: 28px;
        line-height: 200%;
    }

    #gameScreen .container #game {
        margin: 8px auto;
        width: 342px;
        height: 342px;
    }

    #gameScreen .container .panel-control {
        grid-template-rows: repeat(1, 1fr);
        grid-template-columns: repeat(2, 1fr);
    }

    #gameScreen .container header .stats progress#clock {
        width: 96px;
        margin-top: 0;
    }

    #gameScreen .container .panel-control > div {
        gap: 8px;
    }

    #endGameScreen .container .plotter .content h2 {
        font-size: 32px;
    }

    #endGameScreen .container .plotter .content .button-wrapper {
        margin-top: 10px;
        gap: 12px;
    }
}

@media screen and (min-width: 414px) {
    #gameScreen .container #game {
        width: 382px;
        height: 382px;
    }
}
