@import url('https://fonts.googleapis.com/css2?family=Concert+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Chewy&display=swap');

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #211f30;
    background-image: url(../img/bg/bgBorder.png);
    background-position: center center;
    background-repeat: no-repeat;
    font-family: 'Concert One', cursive;
    overflow: hidden;
    margin: 0;
}

h1 {
  font-family: 'Chewy', cursive;
  /* font-family: 'Gloria Hallelujah', cursive; */
  color: #e9c46a;
  position: absolute;
  top: 20px;
  text-align: center;
  text-shadow: 2px 2px 1px rgba(20, 20, 20, 0.8);
}

h1 img {
  width: 500px;
}

#game {
  position: relative;
  width: 600px;
  height: 300px;
  background-color: #f0f0f0;
  overflow: hidden;
}

#start-screen,
#levels-screen {
  position: relative;
  width: 600px;
  height: 300px;
  background-image: url("../img/bg/pink.png");
  background-repeat: repeat;
  overflow: hidden;
}

#levels-screen {
  background-image: url("../img/bg/blue.png");
}

#levels {
  padding: 20px 60px;
}

.level-block {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #000;
  box-shadow: 0px 2px #000;
  border-radius: 5px;
  cursor: pointer;
  font-size: 18px;
  margin-bottom: 10px;
  padding: 10px 0;
  text-align: center;
}

.level-block:active {
  box-shadow: none;
  position: relative;
  top: 2px;
}

#game-title {
  text-align: center;
  margin-top: -10px;
}

#game-title img {
  width: 256px;
}

#version-info {
  position: absolute;
  bottom: 5px;
  left: 5px;
  font-size: 10px;
  text-shadow: 1px 1px 0px rgba(20, 20, 20, 0.4);
  color: #fff;
}

#levels-button {
  cursor: pointer;
  position: absolute;
  bottom: 8px;
  right: 10px;
}

#levels-button:active {
  bottom: 6px;
}

#back-button {
  cursor: pointer;
  position:absolute;
  top: 10px;
  left: 10px;
}

#back-button:active {
  top: 12px;
}

#start-button {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #000;
  box-shadow: 0px 2px #000;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Concert One', cursive;
  font-size: 18px;
  padding: 7px 9px 9px 9px;
  margin: 0 auto;
  position: relative;
  bottom: 10px;
  width: 100px;
  text-align: center;
}

#start-button:active {
  position: relative;
  bottom: 8px;
  box-shadow: none;
}

#level-display {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  font-size: 16px;
  text-shadow: 1px 1px 0px rgba(20, 20, 20, 0.8);
}

#restartBtn,
#nextLevelBtn {
  position: absolute;
  top: 10px;
  right: 10px;
}

#restartBtn:active,
#nextLevelBtn:active {
  top: 12px;
}

#nextLevelBtn {
  right: 35px;
}

#level-transition {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Svart bakgrund med 80% opacitet */
  display: none; /* Dölj elementet initialt */
  z-index: 10; /* Se till att den täcker allt */
  color: white;
  font-size: 32px;
  text-shadow: 2px 2px 1px rgba(20, 20, 20, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32px;
  background: brown;
  background-image: url('../img/misc/ground.png');
  background-repeat: repeat-x;
  z-index: 1; /* Marken är bakom spelaren */
}

.level {
  position: absolute;
  width: 100%;
  height: 100%;
}

.player {
  position: relative;
  width: 48px;
  height: 48px;
  background-size: cover;
  background-repeat: no-repeat;
}

.platform1 {
  position: absolute;
  width: 48px;
  height: 16px;
  background-color: #8b4513;
  background-image: url('../img/platforms/platform1.png');
}

.platform2 {
  position: absolute;
  width: 48px;
  height: 16px;
  background-color: #8b4513;
  background-image: url('../img/platforms/platform2.png');
}

.platform3 {
  position: absolute;
  width: 32px;
  height: 32px;
  background-color: #8b4513;
  background-image: url('../img/platforms/platform3.png');
}

.platform4 {
  position: absolute;
  width: 48px;
  height: 5px;
  background-color: #8b4513;
  background-image: url('../img/platforms/platform4.png');
}

.platform5 {
  position: absolute;
  width: 48px;
  height: 16px;
  background-color: #8b4513;
  background-image: url('../img/platforms/platform5.png');
}

.platform6 {
  position: absolute;
  width: 48px;
  height: 16px;
  background-color: transparent;
}

.apple {
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../img/fruits/apple.gif');
}

.banana {
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../img/fruits/banana.gif');
}

.kiwi {
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../img/fruits/kiwi.gif');
}

.pineapple {
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../img/fruits/pineapple.gif');
}

.cherry {
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../img/fruits/cherry.gif');
}

.orange {
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../img/fruits/orange.gif');
}

.melon {
  position: absolute;
  width: 32px;
  height: 32px;
  background-image: url('../img/fruits/melon.gif');
}

.spike {
  position: absolute;
  width: 16px;
  height: 16px;
  background-image: url('../img/traps/spikes.png');
  background-size: cover;
}

.fire {
  position: absolute;
  width: 16px;
  height: 32px;
  background-image: url('../img/traps/fire.gif');
  background-size: cover;
}

.saw {
  position: absolute;
  width: 38px;
  height: 38px;
  background-image: url('../img/traps/saw.gif');
  background-size: cover;
}

#levelComplete,
#allLevelsComplete {
  border-radius: 8px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 20px;
}

#levelComplete p,
#allLevelsComplete p {
  font-size: 18px;
  text-shadow: 2px 2px 1px rgba(20, 20, 20, 0.8);
  margin: 0;
  margin-bottom: 20px;
}

#levelComplete button,
#allLevelsComplete button {
  background: #fff;
  border: 1px solid #000;
  box-shadow: 0px 2px #000;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Concert One', cursive;
  font-size: 18px;
  padding: 7px 9px 9px 9px;
}

#levelComplete button img,
#allLevelsComplete button img {
  width: 16px;
  height: 16px;
  position: relative;
  top: 2px;
}

#levelComplete button:active,
#allLevelsComplete button:active {
  position: relative;
  top: 2px;
  box-shadow: none;
}

/* float animation */
.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px); /* Flytta uppåt */
  }
  100% {
    transform: translateY(0); /* Tillbaka till ursprunglig position */
  }
}

/* shake animation */
.shake {animation: shake 0.3s; animation-iteration-count: 1;}

/* animations */
@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* COLUMNS */
.one-half {width:48%;}
.one-third {width:30.66%;}
.two-third {width:65.33%;}
.one-fourth {width:22%;}
.three-fourth {width:74%;}
.one-fifth {width:16.8%;}
.two-fifth {width:37.6%;}
.three-fifth {width:58.4%;}
.four-fifth {width:67.2%;}
.one-sixth {width:13.33%;}
.five-sixth {width:82.67%;}
.one-half, .one-third, .two-third, .three-fourth, .one-fourth, .one-fifth, .two-fifth, .three-fifth, .four-fifth, .one-sixth, .five-sixth {position:relative; margin-right:4%; float:left;}
.last {margin-right:0 !important; clear:right;}
