﻿/* durations - variabler sätts i game.js */
:root
{
    --duration-step: 500ms;
    --duration-dying: 3000ms;
}

.bangers
{
    font-family: "Bangers", system-ui;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 2px;
}

body
{
    position: absolute;
    height: 100%;
    width: 100%;
}

#mainMenu
{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: whitesmoke;
    color: #333;
    padding-top: 3px;
}

.py-brand
{
    width: 40px;
    height: 40px;
    background-image: url(images/Logo.png);
    background-size: contain;
}

.logo-name
{
    width: 120px;
}

body.iphone .logo.name,
body.iphone .logo.name
{
    width: 55px;
}

#btnVolume > i
{
    display: none;
}

#btnVolume[data-volume='100'] > i.volume-100
{
    display: block;
}

#btnVolume[data-volume='50'] > i.volume-50
{
    display: block;
}

#btnVolume[data-volume='0'] > i.volume-0
{
    display: block;
}


#screenArea
{
    position: relative;
    top: 0;
    left: 0;
    margin-top: 50px;
    height: calc(100% - 50px);
    overflow: hidden;
    background-color: green;
}

#playerArea
{
    position: absolute;
    background: #ff787c;
    background: linear-gradient(147deg,rgba(255, 120, 124, 1) 0%, rgba(245, 159, 245, 1) 95%);
}

body.menu-top #playerArea
{
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

body.menu-left #playerArea
{
    top: 0;
    left: 0;
    width: 80px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body.menu-left #scoreBoard
{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

body.menu-top #scoreBoard
{
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: 10px;
}

#scoreBoard .score
{
    position: relative;
}

#score-score
{
    width: 100px;
    height: 100px;
    font-size: 48px;
}

#scoreBoard .score-number
{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 24px;
}

#score-score .score-number
{
    font-size: 48px;
}



#scoreBoard .score .score-changer
{
    display: none;
    position: absolute;
    z-index: 2;
    color: #333;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

    #scoreBoard .score .score-changer::after
    {
        content: attr(data-change);
    }


#scoreBoard .score.impact .score-changer
{
    display: block;
    animation: 1200ms ease-out score-impact;
}

@keyframes score-impact
{
    from
    {
        /* pushes the sun down past the viewport */
        transform: translate(-50%, -50%);
        opacity: 1;
        font-size: 24px;
    }

    to
    {
        /* returns the sun to its default position */
        transform: translate(100%, -100%);
        opacity: 0;
        font-size: 64px;
    }
}

.score-icon
{
    width: 64px;
    height: 64px;
    overflow: hidden;
}

.score-icon > img
{
    width: 100%;
}

body.menu-left #assetBoard
{
    width: 80px;
}

body.menu-top #assetBoard
{
    height: 80px;
}

#asset-chest
{
    width: 80px;
    height: 80px;
    padding: 5px;
    position: relative;
    cursor: pointer;
}

    #asset-chest > div > img
    {
        width: 100%;
    }

    #asset-chest > *
    {
        display: none;
    }

    #asset-chest.open > .open
    {
        display: block;
    }

    #asset-chest.closed > .closed
    {
        display: block;
    }

body[asset-count='0'] #asset-chest
{
    filter: grayscale(80%);
}

body[asset-count='0'] #dlg-assets #assets-list
{
    display: none;
}

#dlg-assets .empty-assets-list
{
    display: none;
}

body[asset-count='0'] #dlg-assets .empty-assets-list
{
    display: block;
}

body[asset-count='0'] #dlg-assets .has-assets
{
    display: none;
}

#dlg-assets .img-chest
{
    width: 256px;
}

body:not([asset-count='0']) #dlg-assets .img-chest
{
    width: 64px;
}

body[asset-count='0'] #dlg-assets .img-chest
{
    filter: grayscale(80%);
}

#gamePad
{
    position: absolute;
    background: #949494;
    background: linear-gradient(147deg, rgba(148, 148, 148, 1) 0%, rgba(84, 84, 84, 1) 95%);
}

body.menu-top #gamePad
{
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

body.menu-left #gamePad
{
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#gamePad .steer
{
    position: relative;
    width: 100px;
    height: 100px;
}

    #gamePad .steer button
    {
        position: absolute;
        font-size: 20px;
        border-radius: 15px;
        width: 30px;
        height: 30px;
        color: #999;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        background: #636363;
        background: linear-gradient(138deg,rgba(99, 99, 99, 1) 0%, rgba(18, 18, 18, 1) 95%);
        cursor: pointer;
    }

        #gamePad .steer button:hover
        {
            background: #8c8c8c;
            background: linear-gradient(138deg,rgba(140, 140, 140, 1) 0%, rgba(71, 71, 71, 1) 95%);
        }

        #gamePad .steer button.up
        {
            top: 5px;
            left: 35px;
        }

        #gamePad .steer button.left
        {
            top: 35px;
            left: 5px;
        }

        #gamePad .steer button.right
        {
            top: 35px;
            left: 65px;
        }

        #gamePad .steer button.down
        {
            top: 65px;
            left: 35px;
        }


body.menu-left #gamePad .player-actions
{
    margin-top: 50px;
}

body.menu-top #gamePad .player-actions
{
    margin-left: 50px;
}


#gamePad .player-actions
{
    position: relative;
    width: 100px;
    height: 100px;
}

    #gamePad .player-actions button
    {
        position: absolute;
        font-size: 20px;
        border-radius: 15px;
        width: 30px;
        height: 30px;
        color: #999;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        background: #636363;
        background: linear-gradient(138deg,rgba(99, 99, 99, 1) 0%, rgba(18, 18, 18, 1) 95%);
        cursor: pointer;
    }

        #gamePad .player-actions button:hover
        {
            background: #bab8b8;
            background: linear-gradient(138deg,rgba(186, 184, 184, 1) 0%, rgba(92, 92, 92, 1) 95%);
        }

        #gamePad .player-actions button.triangle
        {
            top: 5px;
            left: 35px;
            color: lawngreen;
        }

        #gamePad .player-actions button.square
        {
            top: 35px;
            left: 5px;
            color: mediumpurple;
        }

        #gamePad .player-actions button.circle
        {
            top: 35px;
            left: 65px;
            color: red;
        }

        #gamePad .player-actions button.cross
        {
            top: 65px;
            left: 35px;
            color: powderblue
        }

#stageArea
{
    position: absolute;
}

body.menu-top #stageArea
{
    left: 0px;
    top: 100px;
    right: 0px;
    bottom: 80px;
}

body.menu-left #stageArea
{
    left: 80px;
    top: 0px;
    right: 100px;
    bottom: 0px;
}


#gameArea
{
    position: absolute;
    left: 0px;
    top: 0px;
    right: 0px;
    bottom: 0px;
    overflow: hidden;
    background-color: blue;
    margin: auto;
}


.error-message
{
    position: absolute;
    z-index: 10000;
    top: 30vh;
    border-radius: 0.1vmin;
    border: 2px solid rgba(100, 22, 22, 1);
    background: #9b2a2a;
    background: linear-gradient(147deg, rgba(155, 42, 42, 1) 0%, rgba(199, 87, 199, 1) 86%);
    color: white;
}

span.flag.sv > span:after
{
    content: 'SV';
}

span.flag.en > span:after
{
    content: 'EN';
}

span.flag.ja > span:after
{
    content: 'JA';
}

#btnLangToggle
{
    transform: scale(0.8);
    transform-origin: center top;
}

    #btnLangToggle span.nav-svg-image
    {
        display: inline-block;
        width: 23px;
        margin-top: -6px;
    }

.icon-text
{
    font-size: 12px;
    display: block;
    margin-bottom: -22px;
    white-space: nowrap;
    color: #333;
}

.speech-on, .speech-off
{
    display: none;
}

body.no-speech .speech-off
{
    display: initial;
}

body:not(.no-speech) .speech-on
{
    display: initial;
}

#error-message
{
    position: absolute;
    margin: auto;
    z-index: 1000;
}

#games-selector
{
    cursor: pointer;
}

    #games-selector > li:hover
    {
        background-color: rgba(199, 87, 199, 0.5);
    }

#dlg-gameOver .modal-body
{
    font-size: 36px;
}

.shake
{
    animation: shaking 0.25s linear infinite;
}

@keyframes shaking
{
    0%
    {
        transform: translate(0, 0) rotate(0deg);
    }

    25%
    {
        transform: translate(5px, 5px) rotate(5deg);
    }

    50%
    {
        transform: translate(0, 0) rotate(0eg);
    }

    75%
    {
        transform: translate(-5px, 5px) rotate(-5deg);
    }

    100%
    {
        transform: translate(0, 0) rotate(0deg);
    }
}

.jump
{
    animation: jump var(--duration-step) linear;
}


@keyframes jump
{
    0%
    {
        transform: translate(0, 0) rotate(0deg);
    }

    45%
    {
        transform: translate(5px, -40px) rotate(5deg);
    }

    50%
    {
        transform: translate(0, -50px) rotate(0deg);
    }

    55%
    {
        transform: translate(5px, -40px) rotate(-5deg);
    }

    100%
    {
        transform: translate(0, 0) rotate(0deg);
    }
}


#asset-list > li
{
    display: flex;
    flex-direction: row;
    align-items: center;
}

    #asset-list > li .object
    {
        width: 64px;
        height: 64px;
        margin-right: 24px;
    }

    #asset-list > li .asset-text
    {
        font-size: 200%;
    }
