/* De root gebruiken wij als variabele om de grootte van de carrousel te veranderen mocht dat nodig zijn. */
:root {
  --carousel-grootte: 24rem;
}

* {
  box-sizing: border-box;
}

/* Dit is de achtergrond van de website, de gokkast komt hiervoor te staan. */

body {
  font-family: Arial, Helvetica, sans-serif;
  background-image: url(../assets/achtergrondgokkast.png);
  background-size: 100%;
  background-size: cover;
}

/* In de main geven we een perspective, waardoor we de gokkast 3D kunnen maken zodra we hem transformen. */
main {
  perspective: 100em;
}

section {
  border: solid black;
  border-width: 10px;
}

/* De class display weergeeft het bovenste deel van de gokkast met de slots daarin. */
.display {
  margin: auto;
  margin-top: 2em;
  padding: 2em;
  max-width: 60%;
  
 background-color: rgb(190, 188, 188);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  justify-content: center;
  align-items: center;
  border-radius: 20px 20px 0 0;
}

.carrouselborder {
  background-color: black;
  border: solid black;
  border-width: 10px;
  border-radius: 10px;
  margin: 0 -5em 0 -5em;
  height: 25em;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  justify-content: center;
  align-items: center;
}

h1 {
    color: white;
    float: right;
    margin: auto;
    text-shadow: 0 0.1em darkslategrey;
}

ul {
    list-style: none;
    /* margin: 5em;    */
    margin: 0;
    padding:0;
    width: 12em;
}

/* Deze properties beschikken over elke losse afbeelding die gebruikt word in de slots. */
.card {
  background-color: white;
  display: block;
  position: absolute;
  /* width: 12em; */
  width:100%;
  height: 0;
  
}

.card > a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
  
.card-photo {
    border-bottom: solid black;
    border-top: solid black;
    border-width: 7px;
    width: 100%;
    height:18.41875em;
    object-fit: cover;
}

h2 {
  color: white;
  font-size: 1.75em;
  text-decoration: none;
  position: absolute;
  transform: translateY(7em);
  margin-left: 1em;
}

/* Vanaf dit punt kijken we naar het middelste vlak, waar de controls van de kast zitten. */
.controls {
  background-color: #888888;
  transform-origin: center top;
  transform: rotateX(45deg);
  height: 12em;
  max-width: 60%;
  margin: auto;
  padding: 3.3em;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  gap: 1.5em;

}

.spin-btn {
    text-shadow: 1px 1px pink, -1px -1px maroon;
	line-height: 1.6em;
	text-align: center;
	display: inline-block;
	-webkit-border-radius: 50%;
	-moz-border-radius: 50%;
	-o-border-radius: 50%;
		border-radius: 50%;
	background-color: darkred;
	-webkit-box-shadow:  0 .3em maroon;
	-moz-box-shadow:  0 .3em maroon;
	-o-box-shadow:  0 .3em maroon;
	box-shadow:  0 .3em maroon;
	color: white;
	margin: auto;
	background-color: red;
	cursor: pointer;
    font-size: 1.8em;
    padding: 0.4em;
    margin-right: 1em;
 

}

.swap-btn {
  text-align: center;
  display: inline-block;
  margin: 5px;
  font-weight: bold;
  padding: 10px;
  background-color: lightgray;
  text-shadow: -1px -1px black, 1px 1px white;
  color: gray;
  -webkit-border-radius: 7px;
  -moz-border-radius: 7px;
  -o-border-radius: 7px;
  border-radius: 7px;
  box-shadow: 0 0.3em rgb(87, 85, 85);
  cursor: pointer;
  font-size: 2.1em;
}

.spin-btn:active,
.swap-btn:active {
  box-shadow: none;
  position: relative;
  top: 0.2em;
}

/* De bottom is de onderkant van de kast, waar niks speciaals speelt. */
.bottom {
  transform-origin: top;
  background: rgb(87, 85, 85);
  background-size: cover;
  background-position: center;
  max-width: 60%;
  margin: auto;
  padding: 4em;
  transform: translateY(-3.62em) translateZ(8.39em);
}

/* De slotmachine heeft 3 rijen die draaien. We noemen ze per stuk een carrousel. */
.carousel-1,
.carousel-2,
.carousel-3 {
  transform-style: preserve-3d;
  /* transform: translateX(-7.28em) rotateX(14deg); */
  transform: rotateX(14deg);
  transition: 2s;
}

/* Hierbij komen ook animaties te pas, allemaal te maken met de carrousels. */
.start-spinning {
  animation: draai;
  animation-duration: 2s;
  animation-timing-function: ease-in;
}

.spinning {
  animation: draai;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* @keyframes draai {
    0% {
        transform: translateX(-7.28em) rotateX(360deg);
    }
    100% {
        transform: translateX(-7.28em) rotateX(0deg);
    }
} */

@keyframes draai {
    0% {
        transform: rotateX(360deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

/* De volgende zeëen aan code zijn om de carrousel 3D en rond te maken om te draaien. */
/* Carrousel 1 */
li:nth-of-type(1) {
  transform: rotateX(24deg) translateZ(38em);
}

li:nth-of-type(2) {
  transform: rotateX(48deg) translateZ(38em);
}

li:nth-of-type(3) {
  transform: rotateX(72deg) translateZ(38em);
}

li:nth-of-type(4) {
  transform: rotateX(96deg) translateZ(38em);
}

li:nth-of-type(5) {
  transform: rotateX(120deg) translateZ(38em);
}

li:nth-of-type(6) {
  transform: rotateX(144deg) translateZ(38em);
}

li:nth-of-type(7) {
  transform: rotateX(168deg) translateZ(38em);
}

li:nth-of-type(8) {
  transform: rotateX(192deg) translateZ(38em);
}

li:nth-of-type(9) {
  transform: rotateX(216deg) translateZ(38em);
}

li:nth-of-type(10) {
  transform: rotateX(240deg) translateZ(38em);
}

li:nth-of-type(11) {
  transform: rotateX(264deg) translateZ(38em);
}

li:nth-of-type(12) {
  transform: rotateX(288deg) translateZ(38em);
}

li:nth-of-type(13) {
  transform: rotateX(312deg) translateZ(38em);
}

li:nth-of-type(14) {
  transform: rotateX(336deg) translateZ(38em);
}

li:nth-of-type(15) {
  transform: rotateX(360deg) translateZ(38em);
}

/* Carrousel 2 */
li:nth-of-type(16) {
  transform: rotateX(24deg) translateZ(38em);
}

li:nth-of-type(17) {
  transform: rotateX(48deg) translateZ(38em);
}

li:nth-of-type(18) {
  transform: rotateX(72deg) translateZ(38em);
}

li:nth-of-type(19) {
  transform: rotateX(96deg) translateZ(38em);
}

li:nth-of-type(20) {
  transform: rotateX(120deg) translateZ(38em);
}

li:nth-of-type(21) {
  transform: rotateX(144deg) translateZ(38em);
}

li:nth-of-type(22) {
  transform: rotateX(168deg) translateZ(38em);
}

li:nth-of-type(23) {
  transform: rotateX(192deg) translateZ(38em);
}

li:nth-of-type(24) {
  transform: rotateX(216deg) translateZ(38em);
}

li:nth-of-type(25) {
  transform: rotateX(240deg) translateZ(38em);
}

li:nth-of-type(26) {
  transform: rotateX(264deg) translateZ(38em);
}

li:nth-of-type(27) {
  transform: rotateX(288deg) translateZ(38em);
}

li:nth-of-type(28) {
  transform: rotateX(312deg) translateZ(38em);
}

li:nth-of-type(29) {
  transform: rotateX(336deg) translateZ(38em);
}

li:nth-of-type(30) {
  transform: rotateX(360deg) translateZ(38em);
}

/* Carrousel 3 */
li:nth-of-type(31) {
  transform: rotateX(24deg) translateZ(38em);
}

li:nth-of-type(32) {
  transform: rotateX(48deg) translateZ(38em);
}

li:nth-of-type(33) {
  transform: rotateX(72deg) translateZ(38em);
}

li:nth-of-type(34) {
  transform: rotateX(96deg) translateZ(38em);
}

li:nth-of-type(35) {
  transform: rotateX(120deg) translateZ(38em);
}

li:nth-of-type(36) {
  transform: rotateX(144deg) translateZ(38em);
}

li:nth-of-type(37) {
  transform: rotateX(168deg) translateZ(38em);
}

li:nth-of-type(38) {
  transform: rotateX(192deg) translateZ(38em);
}

li:nth-of-type(39) {
  transform: rotateX(216deg) translateZ(38em);
}

li:nth-of-type(40) {
  transform: rotateX(240deg) translateZ(38em);
}

li:nth-of-type(41) {
  transform: rotateX(264deg) translateZ(38em);
}

li:nth-of-type(42) {
  transform: rotateX(288deg) translateZ(38em);
}

li:nth-of-type(43) {
  transform: rotateX(312deg) translateZ(38em);
}

li:nth-of-type(44) {
  transform: rotateX(336deg) translateZ(38em);
}

li:nth-of-type(45) {
  transform: rotateX(360deg) translateZ(38em);
}

/* Vanaf dit punt gaan we werken aan de mobiele weergave van de website. */
@media only screen and (max-width: 600px) {
    body {
        background-image: url(../assets/achtergrondgokkast.png);
        background-size: 100%;
        background-repeat: no-repeat;
      }
  
    .display {
    margin: auto;
    padding: 8em;
    max-width: 90%;
    background-color: rgb(190, 188, 188);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    justify-content: center;
    margin: auto;
  }

  .carrouselborder {
    border: solid black;
    height: 25em;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    justify-content: center;
    align-content: center;
    align-items: center;
    
  }
  

  section,
  ul {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.8em;
    
    
  }

  .controls {
    max-width: 90%;
    height: 10em;
    margin: auto;
    padding: 3.3em;
    background-color: rgb(190, 188, 188);
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 1.5em;

  }

  .bottom {
    transform-origin: top;
    background-color: rgb(190, 188, 188);
    background-size: cover;
    background-position: center;
    max-width: 90%;
    margin: auto;
    padding: 10em;
    transform: translateY(-2.92em) translateZ(7.07em);
  }
}
