@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&display=swap');

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* Ändrat från overflow-y till hidden */
  position: fixed;  /* Låser fast hela sidan på skärmen */
  width: 100%;
  overscroll-behavior: none; /* Inaktiverar "studs-effekten" i moderna webbläsare */
}

#game-title {
  margin-top: 100px;
}

#game-title h1, h2 {
  margin-top: 50px;
  font-family: 'Amatic SC', cursive;
  color: #000000;
  text-align: center;
  animation: fadein 2s;
}

#game-title h1 {
  font-size: 48px;
}

#game-title h2 {
  font-size: 28px;
  color: #555555;
  margin-top: -25px;
}

#game-info {
  color: #000000;
  font-family: 'Amatic SC', cursive;
  font-size: 24px;
  margin-top: 40px;
  text-align: center;
  line-height: 24px;
  animation: fadein 2s;
}

#start-button {
  background: #ffffff;
  border: 1px solid #000000;
  box-shadow: 1px 1px 0px 0px #555555;
  color: #000000;
  cursor: pointer;
  font-family: 'Amatic SC', cursive;
  font-size: 24px;
  font-weight: 700;
}

#start-button:active {
  position: relative;
  top: 1px;
  left: 1px;
  box-shadow: none;
}

#playground {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  background: url(../img/forest.png);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  animation: fadein 0.5s;

  touch-action: none;
}

#countdown {
  background-color: rgba(255, 255, 255, 1);
  border: 1px groove #000000;
  font-family: 'Amatic SC', cursive;
  font-size: 24px;
  font-weight: 400;
  padding: 2px 8px;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  animation: fadein 0.5s;
}

#counter {
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid #000000;
  font-family: 'Amatic SC', cursive;
  font-size: 24px;
  font-weight: 400;
  padding: 2px 8px;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  animation: fadein 0.5s;
}

#counter img {
  height: 24px;
  margin-right: 5px;
  position: relative;
  top: 2px;
  width:16px;
}

.object {
  background: url(../img/kid.png);
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;
  width: 8px;
  height: 16px;
}

.object.animate-circle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  animation: pulse 2s infinite;
  border: 2px solid red;
}

#character {
  background: url(../img/char-front.png);
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;
  width: 16px;
  height: 32px;
}

#version-info {
  bottom: 8px;
  font-family: 'Amatic SC', cursive;
  font-size: 16px;
  left: 10px;
  position: absolute;
}

#credit-info {
  bottom: 8px;
  font-family: 'Amatic SC', cursive;
  font-size: 16px;
  right: 10px;
  position: absolute;
}

#version-info p,
#credit-info p {
  margin-bottom: 0;
}

#credit-info a {
  color: #000;
}

.hide-cursor {
  cursor: none;
}

/* MODAL BOX */
.swal-modal {
  background: #fff;
  border: 1px solid #000000;
  border-radius: 0px;
  box-shadow: none;
  margin-top: -15%;
}

.swal-title {
  color: #000;
  font-family: 'Amatic SC', cursive;
  font-size: 36px;
  font-weight:600;
}

.swal-text {
  color: #000;
  font-family: 'Amatic SC', cursive;
  font-size: 24px;
}

.swal-button {
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 0;
  box-shadow: 1px 1px 0px 0px #555555 !important;
  color: #000000;
  cursor: pointer;
  font-family: 'Amatic SC', cursive;
  font-size: 18px;
  font-weight: 700;
  padding: 5px 20px;
}
.swal-button:focus {box-shadow:none;}
.swal-button:hover {background: #fff !important;}
.swal-button:active {background: #fff; box-shadow:none !important; position:relative; top:1px; left: 1px;}

/* pulse animation */
@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* shake animation */
.shake {animation: shake 0.3s; animation-iteration-count: 1;}

/* Animate shake */
@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-2px, 0px) rotate(1deg); }
  30% { transform: translate(2px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-2px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Animate fadeIn */
@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
