@import url('https://fonts.googleapis.com/css2?family=Jersey+20&family=Pixelify+Sans:wght@400..700&display=swap');

:root {
    --dark: #101020;
    --light: #eee;
    --col1: #f2b106;
    --col2: #09fff4;
    --col3: crimson;
    --pop-shadow: 0 0 7px var(--col3), 0 0 7px var(--col2) inset;

}

* {
    font-family: "Jersey 20", serif;

}

svg {
    width: 20px;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: var(--light);
    background: url('./imgs/1.webp');
    flex-direction: column;
}

.canvas {
    width: 500px;
    height: 670px;
    background-color: #2f2f68;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: url('./imgs/1.webp');
    box-shadow: 0 0 15px 0px #ac7063;
    filter: blur(4px);
}

.player {
    width: 60px;
    height: 55px;
    /* border-radius: 50%; */
    background-color: rgb(189, 189, 183);
    position: absolute;
    top: 600px;
    /* top: 200px; */
    background: url('./imgs/p0.png');
    background-size: cover;
}

.pause {
    animation-play-state: paused;
}

.bullet {
    width: 8px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--col3);
    position: absolute;
    background: url('./imgs/gmJ+GH.png');
    background-size: cover;
}

.invader-bullet {
    width: 10px;
    height: 20px;
    border: var(--col3) dotted;
    border-width: 0 4px;
    /* background-color: var(--col3); */
    position: absolute;
}

.enemy {
    width: 60px;
    height: 59px;
    border-radius: 5px;
    position: absolute;
    animation: alterBg 1s 0s infinite;
    /* background-color: red; */
}


@keyframes alterBg {
    0% {
        background: url('./imgs/vecteezy.png') no-repeat center / cover;

    }

    100% {
        background: url('./imgs/vecteezy1.png') no-repeat center / cover;

    }
}

/* ///////////optionsssssss */
.options {
    width: 500px;
    border-radius: 10px;
    box-shadow: 0 0 15px 0px #ac7063;
    padding: 10px;
    margin: 20px;
    background: #000;
    background: url('./imgs/1.webp');
    background: rgba(196, 60, 200, 0.2);
    box-sizing: border-box;
    color: var(--col1);
    font-size: 1.3rem;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-around;
    filter: blur(4px);
}

.options p {
    margin: 0;
    display: flex;
}

.options-lives svg {
    transform: scale(1);
    color: var(--col3);

}

.options-lives svg:last-child,
.heartbeat {
    animation-name: scale;
    animation-delay: 3s;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    margin-left: 5px;
}

@keyframes scale {
    0% {
        transform: scale(0.95);
    }

    30% {
        transform: scale(1.1);
        color: #e78195;
        opacity: 0.2;
    }

    60% {
        transform: scale(1.1);
        color: #e78195;
    }

    100% {
        transform: scale(0.95);
        opacity: 1;
    }
}

/* /////////////popups */

.popup {
    display: none;
    width: 350px;
    position: absolute;
    font-family: "Jersey 20", serif;
    font-weight: 700;
    background: url('./imgs/1.webp');
    border-radius: 14px 0;
    z-index: 2;
    padding: 2rem 1.5rem;
    color: var(--col1);
    background-color: #000;
    border: 2px solid var(--col1);
    box-shadow: var(--pop-shadow);
    user-select: none;
    text-transform: uppercase;
    text-align: center;
}

.popup h1,
.popup p {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 0 3px 0px red, 0 -3px 0px aqua;
    letter-spacing: 2px;
}

.popup button {
    width: 90%;
    padding: 10px;
    cursor: pointer;
    margin: 27px 0 0;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--col1);
    border-radius: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid var(--col2);
    background: rgba(71, 60, 200, 0.2);
    text-shadow: 0 2px 0px red, 0 -2px 0px aqua;
    box-shadow: 0 0 7px #d10f36 inset, 0 0 7px 2px var(--col1);
}

.popup button:hover {
    transform: translate(5px, 5px);
    text-shadow: 0 2px 0px aqua, 0 -2px 0px red;
}

.start-popup {
    display: block;
}

.start-popup h1 {
    margin: 0;
}

.playing .start-popup,
.playing .pause-popup {
    display: none;
}

.playing .canvas,
.playing .options {
    filter: none;
}

/* ///paused */

.paused .pause-popup {
    display: block;
}

.pause-popup .btns {
    display: flex;
    gap: 30px;
}

.paused .canvas,
.paused .options {
    filter: blur(4px);
}


/* ///over */

.over .restart-popup {
    display: block;
}

.over .restart-popup h1:nth-child(1) {
    color: crimson;
}

.over .canvas,
.over .options {
    filter: blur(4px);
}

/* //////////settings   */
nav {
    position: absolute;
    top: 5px;
    left: 5px;
}

nav svg {

    width: 20px;
    position: absolute;
    left: 0;
    top: 0;
}

.settings {
    position: absolute;
    z-index: 3;
    left: 7px;
    top: 4px;
    box-shadow: var(--pop-shadow);
    border-radius: 5px;
    margin: 10px;
    max-height: 0px;
    overflow: hidden;
    transition: max-height 0.3s;
    background: rgba(100, 60, 200, 0.2);
}

.open {
    max-height: 250px;
}

#open {
    width: 20px;
    height: 20px;
    position: inherit;
    right: -20px;
    cursor: pointer;
}

#open::after {
    content: "";
    position: absolute;
    width: 50%;
    height: 50%;
    top: 50%;
    left: 50%;
    border: 2px solid #000;
    border-width: 0 0 2px 2px;
    transform: translate(-50%, -50%) rotate(45deg);
}

.settings>div {
    margin: 10px 0;
    padding: 5px 10px;
}

.settings>div>div {
    display: flex;
}

.settings input {
    cursor: pointer;
    margin: 0 5px;
}


.expl {
    display: none;
    width: 25px;
    height: 25px;
    /* background-color: orange; */
    position: absolute;
    z-index: 2;
    background-image: url('./imgs/9YD9hk.gif');
    background-size: cover;
    background-repeat: no-repeat;

}

.todo {
    position: absolute;
    left: 10px;
    bottom: 0;
    color: #888;
}

.win .game-win-popup {
    display: block;
}

.win .canvas,
.win .options {
    filter: blur(4px);
}

@media screen and (max-width:580px) {

    .canvas,
    .options {
        width: 420px;
    }

    .popup {
        width: 220px;
    }
}

@media screen and (max-width:380px) {

    .canvas,
    .options {
        width: 280px;
    }

    .popup {
        width: 180px;
    }
}

.fpsDisplay{
    display: inline-block;
    width: 25px;
}