* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /*de padding en margin gaat van de box/div af waardoor als je een box hebt van 400px hij 400px blijft  */
    /* cursor: none; dit zorgt ervoor dat je geen cursor/muis ziet */
}

#doorway {
    width: 400px;
    aspect-ratio: 1/1.5;
    background:linear-gradient(90deg, #162c74 0%, #9caee8 40%, #9caee8 60%, #162c74 100%);    
    background-color:#162c74;
    background-repeat: no-repeat;
    /* border-radius: 50%/20% 50% 0 0; */
    /* border-radius: 50% 50% 0 0; */
    border-radius: 50% 50% 0 0/30%;
    position: relative; /* dit is nodig om de divs die eronder staan te positioneren */
    overflow: hidden;
    opacity:0.025;    
    transition: opacity 1500ms ease-in;
    
}

@keyframes shake {
    /* als 0% en 100% hetzelfde zijn kan je ze langs elkaar met een , zetten zodat je de code niet hoeft te herhalen */
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, 0);
    }
    50% {
        transform: translate(-10px, 0);
    }
    75% {
        transform: translate(5px, 0);
    }
    90% {
        transform: translate(-5px, 0);
    }
}

@keyframes slide_in {
    0% {
        transform: translatex(500px);
    }
    100% {
        transform: translatex(0px);
    }
}

#doorway.discoverd>div {
   animation-play-state: running;
   /* je laat het runnen zodat hij de gepauseerde code start */
}

#doorway.discoverd {
   /* als je het id doorway hebt en de class discoverd hebt geld de code*/
    animation-name:shake;
    animation-duration:0.3s;
    animation-iteration-count:20;
    animation-timing-function:linear;
    opacity:1;
}

#doorway>div{
    /* de 4 divs die onder doorway staan */
    width: 400px;
    aspect-ratio: 7/1;
    background-color: #191919;
    position: absolute;
    right: -40px;
    bottom: 0;
    animation-name: slide_in;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    animation-play-state: paused; /* dit zorgt ervoor dat de animatie niet afspeelt totdat je hem aanroept met javascript */
}

#doorway>div:nth-child(2){
    bottom: 70px;
    right: -120px;
    animation-delay: 0.5s; /* dit zorgt ervoor dat de animatie van de divs niet tegelijk afspeelt maar met een delay */
    /* houd de opmaak van de doorway>div en past alleen aan wat nodig is */
}

#doorway>div:nth-child(3){
    bottom: 140px;
    right: -190px;
    animation-delay: 1s;
}

#doorway>div:nth-child(4){
    bottom: 210px;
    right: -260px;
    animation-delay: 1.5s;
}

#doorway>div:nth-child(5){
    bottom: 280px;
    right: -330px;
    animation-delay: 2s;
}

body {
    background-color: #191919;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#torch {
    position: fixed;
    left: 100px;
    top: 100px;
    z-index: 10; /* dit zorgt ervoor dat de torch boven de doorway staat */
    transform: translate(-50%, -50%) ; /*dit zorgt ervoor dat de torch in het midden van de muis staat */
    /* pointer-events: none; dit zorgt ervoor dat je niet op de torch kan klikken */
    cursor: pointer; 
}

#torch img{
    position:relative;
    z-index:2;
}


#torch .glow{
    width:200px;
    aspect-ratio: 1;
    position:absolute;
    background: radial-gradient(#ffdd00 0%, #ff7b00 17%, #660000 53%, transparent 72%);
    opacity:0.3;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    z-index:1;
    animation-name: flicker;
    animation-duration: 3s;
    animation-iteration-count: infinite;
}

body.pickedup #torch {
    cursor: none; /* dit zorgt ervoor dat je geen cursor/muis ziet */
    transform:translate(-50%,-50%) rotate(20deg);
    pointer-events: none; /* dit zorgt ervoor dat je niet op de torch kan klikken */
}

body.pickedup {
    cursor: none;
}

/* @keyframes flicker {
    0% {opacity: 0.2; width: 200px;}
    25% {opacity: 0.4; width: 200px;}
    50% {opacity: 0.3; width: 200px;}
    75% {opacity: 0.4; width: 200px;}
    100% {opacity: 0.2; width: 200px;}
    /* dit zorgt ervoor dat de glow van de torch flikkert */
/* }  */

@keyframes flicker {
    0%   { opacity:0.2;width:200px; }
    25%  { opacity:0.4;width:400px; }
    50%  { opacity:0.3;width:300px; }
    75%  { opacity:0.4;width:400px; }
    100% { opacity:0.2;width:200px; }
}