/* IMPORTING WEBFONTS */
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700,800,300');
@import url('https://fonts.googleapis.com/css?family=Press+Start+2P');
@import url('https://fonts.googleapis.com/css2?family=Honk&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Stick&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Londrina+Shadow&family=Stick&display=swap');

html {
  animation: 90s linear 0s normal none infinite animate;
  background-color: #74EBD5;
  background-image: url("../img/bg.png"), linear-gradient(0deg, #74EBD5 0%, #9FACE6 100%); /* background pattern: https://patternico.com/ */
  height: 100%;
}

/* ANIMATE BACKGROUND */
@keyframes animate {
	from {background-position: bottom left;}
	to {background-position: top right;}
}

body {
	margin: 0;
	overflow: hidden;
}

#game-container {
	background-size: cover;
	box-shadow:5px 5px rgba(90, 90, 90, 0.1), 10px 10px rgba(70, 70, 70, 0.1), 15px 15px rgba(50, 50, 50, 0.1);
	height: 500px; /*400px*/
	margin: 0 auto;
	margin-top: 50px;
	position: relative;
	width: 900px; /*800px*/
}

#ground {
	background: url(../img/ground2.png) repeat-x;
	background-size: contain;
	height: 64px;
	width: 100%;
	position: absolute;
	bottom: 0;
}

#game-title {
	color: rgba(255, 255, 255, 0.9);
  font-family: "Honk", system-ui;
  font-family: "Stick", sans-serif;
  font-family: 'Press Start 2P', cursive;
	text-align: center;
	text-shadow: 0px 2px rgba(50, 50, 50, 0.1);
}

.block {
	position: absolute;
	bottom: 64px;
	width: 64px;
	height: 64px;
	transform: translateX(-50%);
}

#block0 {
	background-image: url(../img/character0Right.png);
	background-repeat: no-repeat;
	background-position: center center;
	left: 30px;
}

#block1 {
	background-image: url(../img/character1Left.png);
	background-repeat: no-repeat;
	background-position: center center;
	right: -35px;
}

.coin {
	position: absolute;
	width: 32px;
	height: 32px;
}

.bullet {
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: #333333;
}

#score-player1,
#score-player2 {
	position: absolute;
	top: 10px;
	font-family: 'Press Start 2P', cursive;
	color: #fff;
	text-shadow: 1px 1px 0 #555;
	font-size: 14px;
}

#score-player1 {left: 10px;}
#score-player2 {right: 10px;}

#version-info {
  bottom: 0px;
  color: rgba(50, 50, 50, 0.3);
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  left: 10px;
  position: absolute;
}

#timer {
  position: absolute;
	top: 10px;
	font-family: 'Press Start 2P', cursive;
	color: #fff;
	text-shadow: 1px 1px 0 #555;
	font-size: 14px;
  left: 45%;
}

.full-screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#start-btn {
  animation-direction:alternate;
	animation-duration:800ms;
	animation-iteration-count:infinite;
	animation-name:blink;
  border: 1px solid #fff;
  box-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5), 2px 2px 0px rgba(255, 255, 255, 0.5), 3px 3px 0px rgba(255, 255, 255, 0.5);
  color: white;
  cursor: pointer;
  font-family: 'Press Start 2P', cursive;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 1px 0 #555;
  user-select: none;
}

#start-btn:active {
  box-shadow: none;
  left: 3px;
  position: relative;
  top: 3px;
}

#start-btn:focus {
  outline: none;
}

@keyframes blink {
  from {opacity:1;}
  to {opacity:0;}
}

#fullscreen-button {
  right: 10px;
  bottom: 5px;
  position: absolute;
}

#fullscreen-button img {
  filter: opacity(0.8);
  width: 32px;
}

/* Added spin animation for the jumping class */
/*
.block.jumping {
	animation: spin 0.6s ease-in-out;
}

@keyframes spin {
	0% {
		transform: translateX(-50%) rotate(0deg);
	}
	100% {
		transform: translateX(-50%) rotate(var(--spin-direction, 0deg));
	}
}
*/

/* MODAL BOX */
.swal-modal {
  background: rgba(200, 200, 200, 0.8);
  border-radius: 0px;
  box-shadow:5px 5px rgba(90, 90, 90, 0.1), 10px 10px rgba(70, 70, 70, 0.1), 15px 15px rgba(50, 50, 50, 0.1);
  margin-top: -10%;
}

.swal-title {
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Press Start 2P', cursive;
  font-weight:600;
  text-shadow: 0px 2px rgba(50, 50, 50, 0.2);
}

.swal-text {
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Press Start 2P', cursive;
  font-size:14px;
  text-shadow: 0px 2px rgba(50, 50, 50, 0.2);
}

.swal-button {
	background: rgba(50, 50, 50, 0.6);
  border-radius: 0px;
  color:#fff;
  font-family: 'Press Start 2P', cursive;
  font-weight:normal;
  font-size:16px;
  padding:5px 20px;
}
.swal-button:focus {box-shadow:none;}
.swal-button:hover {background: rgba(50, 50, 50, 0.8) !important;}
.swal-button:active {background: rgba(50, 50, 50, 0.8); box-shadow:none; position:relative; top:2px;}

/* Added spin animation */
@keyframes spinRight {
	0% {
		transform: translateX(-50%) rotate(0deg);
	}

	100% {
		transform: translateX(-50%) rotate(360deg);
	}
}

@keyframes spinLeft {
	0% {
		transform: translateX(-50%) rotate(0deg);
	}

	100% {
		transform: translateX(-50%) rotate(-360deg);
	}
}

/* Apply spin animation only when jumping */
.block.jumping.right {
	animation: spinRight 0.6s infinite linear;
}

.block.jumping.left {
	animation: spinLeft 0.6s infinite linear;
}

/* Added shake animation for the stunned class */
.block.stunned {
  animation: shake 0.3s ease-in-out 0s 3;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(-50%);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(-50%) translateX(5px);
  }
  30%, 50%, 70%, 90% {
    transform: translateX(-50%) translateX(-5px);
  }
}


/* Apply styles for screens with a maximum width of 780px (common for mobile devices) */
@media only screen and (max-width: 780px) {
    #game-container {
        background-size: cover;
        box-shadow: none;
        height: 100vh;
        margin-top: 0px;
        width: 100vw;
        position: relative;
    }

    #game-title {
      display: none;
    }

    .swal-modal {
      margin-top: 0px;
    }
}
