* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
    
body {
    position: relative;
    overflow: hidden;
    background: transparent;
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    background: black;
    background-image: url(../img/wooden-planks.png);
    background-repeat: repeat;
    background-position: center;
    background-size: contain;
    
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.6);
    opacity: 1;
    transition: opacity 1.2s ease;
    pointer-events: none;
}

body.game-active::before{
    transform: scale(1.5);
}

body.game-active::after{
    opacity: 0;
}

main {
    width: 100vw;
    position: relative;
    z-index: 1;
}

#assets{
    transform: scale(1);
}

#menu,
#game {
    /* display: grid; */
    justify-items: center;
    gap: 1.5rem;
    padding: 2rem;
    text-align: center;
    width: 100%;
    /* border:solid red 2px; */
}

#menu[hidden],
#game[hidden] {
    display: none;
}

#menu nav
{
    display: grid;
    gap: 0.75rem;
    /* border: solid green 2px;; */
}

#game nav {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#message {
    /* position: absolute; */
    /* top: 120px;
    left: -80px; */
    /* transform: translatey(360px); */
    /* right: 50%; */
    width: min-width (70vw, 630px);
    overflow: hidden;
    white-space: nowrap;
    /* padding: 0.8rem 1.2rem; */
    color: white;
    font-family: 'VCR', monospace;
    font-size: 3rem;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}



#message span {
    display: inline-block;
}

#message .turn-message {
    animation: turnPulse 1.2s steps(12, end) infinite alternate;
    font-size: 2rem;
}

@keyframes turnPulse {
    0% {
        transform: scale(0.98);
        opacity: 1;
    }

    100% {
        transform: scale(1.01);
        opacity: 1;
    }
}

#message .winner-message {
    animation: carouselLeft 6.8s steps(32, end) infinite;
}

@keyframes carouselLeft {
    0% {
        transform: translateX(-110%);
        opacity: 1;
    }

    50% {
        transform: translateX(0);
        opacity: 1;
    }

    98% {
        transform: translateX(110%);
        opacity: 1;
    }

    99% {
        transform: translateX(110%);
        opacity: 0;
    }

    100% {
        transform: translateX(-110%);
        opacity: 0;
    }
}

button {
    cursor: pointer;
    font: inherit;
    font-family: 'Archivo', sans-serif;
    padding: 15px 25px;
    border: none;
    background: #3d3a3a;
    color: white;
    font-size: 15px;
    font-weight: 600px;
    box-shadow: 0 4px 0 rgba(39, 39, 39, 0.267);
    transition: 0.2s;
}

button:hover{
    background: #696464;
    transform: scale(1.05);
}

button:active{
    background: gray;
    transform: scale(0.88);
    transition: transform 0.2s ease-in-out;
}

#grille {
    width: calc(30vmin + 12px);
    height: calc(30vmin + 12px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: solid black 1px;
}

#grille .case {
    position: relative;
    border: solid black 2px;
    display: grid;
    place-items: center;
    height: 10vmin;
    width: 10vmin;
    margin: 1px;
    padding: 0;
    font-size: 2rem;
    overflow: hidden;
    background: transparent;
    transform: none;
    animation: none;
}

#grille .case::before {
    content: "";
    position: absolute;
    inset: 12%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.case.cd::before {
    background-image: url("../img/pixelated%20cd.png");
    animation: place .85s cubic-bezier(0.51, 0.3, 0.2, 1),
               backnforth 3.5s steps(6, end) infinite;
    animation-composition: replace, add;
}

.case.vinyle::before {
    background-image: url("../img/pixelated%20vinyle.png");
    animation: place .75s cubic-bezier(0.29, 0.89, 0.37, 0.51),
               backnforth 3.5s steps(6, end) infinite;
    animation-composition: replace, add;
}

@keyframes backnforth {
    0% {
        transform: rotate(0);
    }

    50% {
        transform: rotate(10deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes place {
    0% {
        opacity: 0;
        transform: scale(1.8) rotate(10deg);

    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);

    }
}

#grille .case:hover {
    outline: 2px solid pink;

}

@font-face {
    font-family: 'VCR';
    src: url('fonts/VCR_OSD_MONO_1.001.ttf') format('truetype');
}

@media (max-width: 600px) {

  .grille {
    width: calc(30vmin + 12px);
    height: calc(30vmin + 12px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: solid black 1px;
    transform: translatey(-150px)
  }

  #message {
    width: min-width (70vw, 630px);
    overflow: hidden;
    white-space: nowrap;
    color: white;
    font-family: 'VCR', monospace;
    font-size: 1.5rem;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
  }

} 

nav {
    margin-top: 1em;
}

h1{
    font-family: 'Archivo', sans-serif;
    padding:10px;
}

