@font-face {
  font-family: "DungeonCrawler";
  src: url("../fonts/DungeonCrawler.ttf") format("truetype");
}

@font-face {
  font-family: "TimesSansSerif";
  src: url("../fonts/TimesSansSerif.ttf") format("truetype");
}

body {
  background-color: lightblue;
  margin: 0px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* head { display: block; } */
/* title { display: block; font-size: 200%; font-weight: bold; } */

main {
  width: 60vw;
  height: 60vh;
  display: flex;
  flex-wrap: wrap;
  border-radius: 12px;
}

#gameMenu {
  position: absolute;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 5;
}

@keyframes slice-in-bottom {
  0% {
    mask-position: 0 0;
  }
  100% {
    mask-position: 0 -200%;
  }
}

header {
  font-size: 70px;
  font-family: "DungeonCrawler";
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translate(-50%, -50%);
  color: white;
  line-height: 1;
  z-index: 5;
  overflow: hidden;
}

header > p:first-child {
  position: relative;
  display: inline-block;
  mask-image: linear-gradient(
    to top,
    transparent 0%,
    black 100%,
    transparent 50%
  );
  mask-size: 100% 200%;
  animation: slice-in-bottom 2s forwards;
}

#swordFigure {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: fadeIn 1s ease-in-out 0.5s forwards;
}

.remove {
  display: none;
}

.fadeOut {
  animation: fadeOut 1s ease-in-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#swordTopLogo {
  width: 200px;
  height: 200px;
  position: relative;
  z-index: 7;
}

#swordCircle {
  width: 125px;
  height: 25px;
  background-color: #f3f3f3;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%) skewX(200deg);
  border-radius: 50%;
  z-index: 5;
}

#start {
  position: absolute;
  padding: 20px 60px;
  border-radius: 12px;
  border: none;
  box-shadow: 2px 2px 5px 2px rgb(49, 49, 49);
  font-family: monospace;
  color: white;
  font-size: 34px;
  background-color: #004258d0;
  cursor: pointer;
  left: 50%;
  top: 75%;
  transform: translate(-50%, -50%);
}

#start:hover {
  box-shadow: 2px 2px 8px 3px rgb(49, 49, 49);
  background-color: #045d7ad0;
}

#restart,
#continue {
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  box-shadow: 2px 2px 5px 2px rgb(49, 49, 49);
  font-family: monospace;
  color: black;
  font-size: 28px;
  background-color: #84c5dbd0;
  cursor: pointer;
}

#restart:hover {
  background-color: #a3cbd8d0;
}

#roundCounter {
  display: none;
  font-size: 40px;
}

#results {
  width: 50vw;
  height: 40vh;
  background-color: rgba(173, 216, 230, 0.75);
  position: absolute;
  border: 20px solid transparent;
  border-image: linear-gradient(to bottom right, #00ebdbb2, #004258b2) 1;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  font-family: "TimesSansSerif";
  z-index: 4;
}

.exitDoor {
  position: absolute;
  width: 5vw;
  height: 10vh;
  /* background: radial-gradient(circle, #faecef 0%, #cca2ab 50%, #3d3d3d 100%); */
}

.tile {
  width: 5vw;
  height: 10vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  background-color: #008b8a;
  border: 2px inset transparent;
  border-image: linear-gradient(to bottom right, #0ce6d8, #000907) 1;
}

.grassTile {
  width: 5vw;
  height: 10vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  background-image: url("../image/grass.png");
  background-size: cover;
}

.dirtTile {
  width: 5vw;
  height: 10vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  background-image: url("../image/dirt.jpg");
  background-size: cover;
}

.stoneTile {
  width: 5vw;
  height: 10vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  background-image: url("../image/stone.jpg");
}

.tree {
  width: 5vw;
  height: 10vh;
}

.fire {
  width: 5vw;
  height: 10vh;
}

.oldCat {
  width: 5vw;
  height: 10vh;
}

.swordTop {
  width: 5vw;
  height: 10vh;
}

.wall {
  width: 5vw;
  height: 10vh;
  background-color: #008b8a;
  box-sizing: border-box;
  border: 20px inset transparent;
  border-image: linear-gradient(to bottom right, #00ebdc, #004258) 1;
}

.caveWall {
  width: 5vw;
  height: 10vh;
  background-image: url("../image/caveTile.png");
}

.caveExit,
.caveEntrance,
.towerEntrance {
  width: 5vw;
  height: 10vh;
  background: radial-gradient(circle, #0a0809 0%, #222222 50%, #7b7b7b 100%);
}

.outdoorWall {
  width: 5vw;
  height: 10vh;
  background-image: url("../image/grass.png");
  background-size: cover;
}

.outdoorDirtPath {
  width: 5vw;
  height: 10vh;
  background-image: url("../image/dirt.jpg");
  background-size: cover;
}

.wallTop {
  position: absolute;
  top: -10vh;
}

.wallBottom {
  position: absolute;
  bottom: -10vh;
}

.wallLeft {
  position: absolute;
  left: -5vw;
}

.wallRight {
  position: absolute;
  right: -5vw;
}

.catImg {
  width: 5vw;
  height: 10vh;
  z-index: 3;
}

.dogImg,
.dogImg-0,
.dogImg-1,
.dogImg-2,
.dogImg-3,
.dogImg-5,
.dogImg-6,
.dogImg-7,
.dogImg-9 {
  width: 4vw;
  height: 8vh;
  z-index: 2;
}

.buffDogeImg,
.dogImg-4,
.dogImg-8 {
  width: 6vw;
  height: 12vh;
  z-index: 2;
}

.moveUp {
  animation: moveUp 0.1s forwards;
}

.boulderShadow {
  position: absolute;
  width: 1vw;
  height: 1vh;
  border-radius: 50%;
  background-color: #2b2b2bb2;
  animation: growShadow 1s forwards;
}

.terrianBoulder {
  width: 5vw;
  height: 10vh;
  position: absolute;
}

.boulder {
  width: 5vw;
  height: 10vh;
  position: absolute;
  animation: dropBoulder 1s forwards;
}

@keyframes dropBoulder {
  0% {
    transform: translateY(-60vh);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes growShadow {
  0% {
    width: 1vw;
    height: 2vh;
    background-color: #2b2b2bb2;
  }
  100% {
    width: 3vw;
    height: 7vh;
    background-color: #2b2b2b;
  }
}

@keyframes moveUp {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-10vh);
  }
}

.moveDown {
  animation: moveDown 0.1s forwards;
}

@keyframes moveDown {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(10vh);
  }
}

.moveLeft {
  animation: moveLeft 0.1s forwards;
}

@keyframes moveLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-5vw);
  }
}

.moveRight {
  animation: moveRight 0.1s forwards;
}

@keyframes moveRight {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(5vw);
  }
}

.laserBeam {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
}

.laserBeamVertical {
  width: 3vw;
  height: 10vh;
  animation: growAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamVertical {
  width: 12vw;
  height: 10vh;
  animation: bigBeamGrowAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamVerticalRounded {
  width: 3vw;
  height: 10vh;
  border-radius: 50%;
  animation: growAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamVerticalStartFireUp {
  width: 3vw;
  height: 10vh;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: growAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamVerticalStartFireUp {
  width: 12vw;
  height: 10vh;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: bigBeamGrowAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamVerticalEndFireUp {
  width: 3vw;
  height: 10vh;
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  animation: growAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}
.bigLaserBeamVerticalEndFireUp {
  width: 12vw;
  height: 10vh;
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  animation: bigBeamGrowAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamVerticalStartFireDown {
  width: 3vw;
  height: 10vh;
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  animation: growAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamVerticalStartFireDown {
  width: 12vw;
  height: 10vh;
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  animation: bigBeamGrowAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamVerticalEndFireDown {
  width: 3vw;
  height: 10vh;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: growAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamVerticalEndFireDown {
  width: 12vw;
  height: 10vh;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: bigBeamGrowAndShrinkVertical 1s forwards;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamHorizontal {
  width: 5vw;
  height: 6vh;
  animation: growAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamHorizontal {
  width: 5vw;
  height: 24vh;
  animation: bigBeamGrowAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamHorizontalRounded {
  width: 5vw;
  height: 6vh;
  border-radius: 50%;
  animation: growAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamHorizontalStartFireLeft {
  width: 5vw;
  height: 6vh;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: growAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamHorizontalStartFireLeft {
  width: 5vw;
  height: 24vh;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: bigBeamGrowAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamHorizontalEndFireLeft {
  width: 5vw;
  height: 6vh;
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
  animation: growAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamHorizontalEndFireLeft {
  width: 5vw;
  height: 24vh;
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
  animation: bigBeamGrowAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamHorizontalStartFireRight {
  width: 5vw;
  height: 6vh;
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
  animation: growAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamHorizontalStartFireRight {
  width: 5vw;
  height: 24vh;
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
  animation: bigBeamGrowAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.laserBeamHorizontalEndFireRight {
  width: 5vw;
  height: 6vh;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: growAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

.bigLaserBeamHorizontalEndFireRight {
  width: 5vw;
  height: 24vh;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  animation: bigBeamGrowAndShrinkHorizontal 1s forwards;
  background: linear-gradient(
    0deg,
    rgba(255, 0, 0, 1) 0%,
    rgba(245, 177, 177, 1) 50%,
    rgba(255, 0, 0, 1) 100%
  );
}

@keyframes growAndShrinkVertical {
  0%,
  100% {
    width: 0vw; /* Start and end width */
  }
  50% {
    width: 3vw; /* Middle width */
  }
}

@keyframes growAndShrinkHorizontal {
  0%,
  100% {
    height: 0vh; /* Start and end height */
  }
  50% {
    height: 6vh; /* Middle height */
  }
}

@keyframes bigBeamGrowAndShrinkVertical {
  0%,
  100% {
    width: 0vw; /* Start and end width */
  }
  50% {
    width: 12vw; /* Middle width */
  }
}

@keyframes bigBeamGrowAndShrinkHorizontal {
  0%,
  100% {
    height: 0vh; /* Start and end height */
  }
  50% {
    height: 24vh; /* Middle height */
  }
}

@keyframes swordSwipe {
  0% {
    opacity: 1;
    transform: translate(50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 50%);
  }
}

.swordSwing {
  position: relative;
}

.sword-animation {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  animation: swordSwipe 0.5s ease-out forwards;
}

.sword-animation-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 4px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.animateDeath {
  animation: deathAnimation 1s linear forwards;
}

@keyframes deathAnimation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(90deg);
  }
}

/* ------dialogue box------- */

/* Dialogue Box styling */
.dialogue-box {
  position: absolute; /* Position absolute for dialog placement */
  left: 50%;
  bottom: 25vh;
  transform: translate(-50%, 50%);
  background-color: rgba(0, 0, 0, 0.8); /* Slightly opaque black background */
  color: #fff; /* White text */
  border-radius: 10px; /* Slight border radius */
  padding: 20px;
  width: 30vw;
  min-height: 15vh;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 0 0 6px rgba(255, 215, 0, 0.8);
  text-align: start;
  overflow: hidden; /* Ensures content does not overflow the border radius */
  z-index: 10; /* Ensures the dialogue box appears on top */
}

.dialogue-title {
  margin: 0;
  font-size: 1.5em;
  margin-bottom: 10px;
}

.dialogue-content {
  font-family: "TimesSansSerif";
  margin: 0;
  font-size: 1.5em;
  margin-bottom: 20px;
}

/* -----------boss fight-------------- */

.cloneLeft {
  animation: cloneLeft 1s forwards;
}

@keyframes cloneLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-10vw);
  }
}

.cloneRight {
  animation: cloneRight 1s forwards;
}

@keyframes cloneRight {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(10vw);
  }
}

.bossImg {
  width: 6vw;
  height: 12vh;
  z-index: 2;
  position: relative;
}

.logImg {
  width: 6vw;
  height: 12vh;
  z-index: 2;
  position: absolute;
}

.shadowCloneDog1-animate,
.shadowCloneDog2-animate {
  width: 6vw;
  height: 12vh;
  z-index: 2;
  position: absolute;
}

.shadowCloneDog1,
.shadowCloneDog2 {
  width: 6vw;
  height: 12vh;
  z-index: 2;
  position: relative;
}

/* ----------music logic------------- */

#audioControlContainer {
  position: fixed;
  bottom: 50px;
  left: 50px;
  display: flex;
  align-items: center;
  z-index: 21;
}

#audioButton {
  background: #333;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  transition: opacity 0.5s ease; /* Smooth transition for opacity */
}

.faded {
  opacity: 0.5;
}

#audioButton:hover,
#volumeSlider:hover {
  opacity: 1; /* Full opacity on hover */
}

#audioControlContainer:hover #audioButton {
  opacity: 1; /* Full opacity on hover */
}

#volumeSlider {
  width: 100px;
  margin-left: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: #eee;
  border-radius: 5px;
}

#audioControlContainer:hover #volumeSlider {
  opacity: 1;
}

/* ---------Octo Slash----------- */

/* General styles for the sword slash effect container */
.swordEffectContainer {
  position: relative;
}

/* General styles for the sword animation */
.swordSlashEffect {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  animation: swordSwing 0.5s ease-out forwards;
}

/* Horizontal sword slash effect line */
.horizontalSlashEffectLine {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 5px; /* Thickness of the sword slash */
  width: 5vw; /* Full width for the horizontal slash */
  background-color: #ffffff; /* Color of the sword slash */
  border-radius: 4px; /* Rounded edges for the sword slash */
  transform: translate(-50%, -50%) rotate(0deg); /* Horizontal line */
}

/* Vertical sword slash effect line */
.verticalSlashEffectLine {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px; /* Thickness of the sword slash */
  height: 10vh; /* Full height for the vertical slash */
  background-color: #ffffff; /* Color of the sword slash */
  border-radius: 4px; /* Rounded edges for the sword slash */
  transform: translate(-50%, -50%) rotate(180deg); /* Vertical line */
}

/* Diagonal sword slash effect from bottom-left to top-right */
.diagonalSlashBLTRLine {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px; /* Adjust the size of the sword slash */
  height: 5px;
  background-color: #ffffff; /* Color of the sword slash */
  border-radius: 4px; /* Rounded edges for the sword slash */
  transform: translate(-50%, -50%) rotate(-45deg); /* Bottom-left to top-right diagonal */
}

/* Diagonal sword slash effect from top-left to bottom-right */
.diagonalSlashTLBRLine {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px; /* Adjust the size of the sword slash */
  height: 5px;
  background-color: #ffffff; /* Color of the sword slash */
  border-radius: 4px; /* Rounded edges for the sword slash */
  transform: translate(-50%, -50%) rotate(45deg); /* Top-left to bottom-right diagonal */
}

/* Keyframe animation for the sword swipe effect */
@keyframes swordSwing {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1); /* Start at full opacity and scale */
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5); /* End with opacity fading out and scale */
  }
}

/* ------------start ending ------------- */

#endingContainer {
  position: absolute;
  width: 100vw;
  height: 100vh;
  background-color: black;
  opacity: 0;
  display: none;
  z-index: 12;
  animation: fadeIn 1s ease-in-out 0.5s forwards;
}

.endingSceneContainer {
  position: absolute;
  width: 100vw;
  height: 40vh;
  top: 50%;
  background-color: black;
  transform: translateY(-50%);
  z-index: 13;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 0 0 6px rgba(255, 215, 0, 0.8);
  overflow: hidden;
}

.cardboardCat {
  position: absolute;
  width: 7vw;
  height: 12vh;
  left: 40%;
  top: 45%;
  transform: translate(-50%, -50%);
  animation: flyThroughSpace 3s ease-in-out infinite;
}

@keyframes flyThroughSpace {
  0%,
  100% {
    transform: translate(-50%, -20%);
  }
  50% {
    transform: translate(-50%, -70%);
  }
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: white;
  border-radius: 50%;
  opacity: 0.8;
  /* Multiple stars will be created and animated for a seamless effect */
  animation: moveStars 10s linear infinite;
}

@keyframes moveStars {
  0% {
    transform: translateX(
      100vw
    ); /* Start from the right side of the viewport */
  }
  100% {
    transform: translateX(-100vw); /* Move to the left side of the viewport */
  }
}

/* Adding a layer of stars to enhance the effect */
.star-layer {
  position: absolute;
  width: 100vw;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  animation: moveStars 10s linear infinite;
}

.endingHeader {
  font-family: "DungeonCrawler";
  position: absolute;
  font-size: 44px;
  left: 50%;
  top: 20%;
  color: #f3f3f3;
  transform: translate(-50%, -50%);
  z-index: 20;
  opacity: 0;
  animation: fadeIn 2s ease forwards;
}

.attributeText {
  position: absolute;
  font-family: "TimesSansSerif";
  font-size: 36px;
  left: 50%;
  top: 20%;
  color: #f3f3f3;
  transform: translate(-50%, -50%);
  z-index: 20;
}

/* ------------end ending ------------- */

.highscoresInputDiv {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 60vw;
  height: 20vh;
  left: 50%;
  top: 85%;
  background-color: #2b2b2b2b;
  transform: translate(-50%, -50%);
  border-radius: 12pt;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 0 0 6px rgba(255, 215, 0, 0.8);
}

.highscoresInputContainer {
  display: flex;
  width: 90%;
  height: 90%;
  justify-content: space-between;
  font-size: 24px;
  font-family: "TimesSansSerif";
}
/* -------Left Container---------- */

.highscoresLeftContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30vw;
}

.highscoresLeftScoreLabel {
  color: rgba(255, 215, 0, 0.8);
}

.highscoresLeftScoreValue {
  margin-left: 15px;
  color: #f3f3f3;
}

/* -------Right Container---------- */

.highscoresRightContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30vw;
}

.highscoresRightNameLabel {
  color: rgba(255, 215, 0, 0.8);
}

.highscoresRightNameValue {
  margin-left: 15px;
  background-color: transparent;
  border-color: #f3f3f3;
  padding: 15px 20px;
  color: #f3f3f3;
  border-radius: 12pt 0 0 12pt;
  width: 100px;
}

.highscoresRightNameButton {
  background-color: rgba(255, 215, 0, 0.8);
  padding: 15px 20px;
  border-radius: 0 12pt 12pt 0;
  border: 2px solid #f3f3f3;
}

/* --------------- */

.newHighscoreToast {
  position: absolute;
  font-family: "TimesSansSerif";
  font-size: 20px;
  color: rgba(255, 215, 0, 0.8);
  left: 50%;
  top: 15%;
  transform: translate(-50%, -50%);
}

/* ---------------------------------- */

#highscoresIcon {
  position: fixed;
  bottom: 50px;
  right: 50px;
  display: flex;
  align-items: center;
  z-index: 21;
  width: 60px;
  height: 60px;
  background-color: #333;
  border-radius: 50%;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#highscoresIcon:hover {
  background-color: #3d3d3d;
}

.highscoresIconImg {
  width: 100%;
}

/* ------------------ */

.highscoresBoard {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 50vw;
  height: 70vh;
  background-color: #333;
  z-index: 23;
  display: none;
  opacity: 0.95;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 0 0 6px rgba(255, 215, 0, 0.8);
  overflow-y: auto;
}

.topScoresLabel {
  color: #f3f3f3;
  margin: 35px 0px;
  font-size: 32px;
  font-family: "TimesSansSerif";
}

.scoreRow {
  display: flex;
  justify-content: space-between;
  color: #f3f3f3;
  margin: 25px 0px;
  font-size: 24px;
  font-family: "TimesSansSerif";
}

.scoreIndex {
  display: flex;
  justify-content: flex-end;
}

.scoreScore {
  display: flex;
  justify-content: flex-start;
}

.fadeInAndOut {
  animation: fadeInAndOut 5s ease-in-out;
}

@keyframes fadeInAndOut {
  0% {
    opacity: 0;
  }
  12.5% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  87.5% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* -------------------------------- */

.endingSamuraiDoge {
  position: absolute;
  left: 70%;
  top: 0%;
  width: 30vw;
  height: auto;
  z-index: 14;
}

.endingSwordCatBack {
  position: absolute;
  left: 10%;
  top: 15%;
  width: 45vw;
  height: auto;
  z-index: 15;
}

.endingSceneBackground {
  object-fit: fill;
  width: 100%;
  height: 100%;
}

.slideLeft {
  animation: slideLeft 5s 1s linear forwards;
}

.slideRight {
  animation: slideRight 5s 1s linear forwards;
}

@keyframes slideLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50vw);
  }
}

@keyframes slideRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(50vw);
  }
}

.endingDialogueContainer {
  position: absolute;
  left: 50%;
  bottom: 20vh;
  transform: translate(-50%, 50%);
  background-color: transparent;
  color: #fff; /* White text */
  border-radius: 10px; /* Slight border radius */
  padding: 20px;
  width: 50vw;
  height: 15vh;
  text-align: start;
  overflow: hidden; /* Ensures content does not overflow the border radius */
  z-index: 15; /* Ensures the dialogue box appears on top */
}

.endingDialogueText {
  font-size: 1.5em;
  font-family: "TimesSansSerif";
}

.endingCloseUpSamuraiDoge {
  position: absolute;
  left: 60%;
  top: 90%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: auto;
  z-index: 14;
}

.endingCloseUpSwordCat {
  position: absolute;
  left: 50%;
  top: 90%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: auto;
  z-index: 14;
}
.samuraiDogeContainer {
  position: absolute;
  left: 20%;
  top: 0%;
  width: 30vw;
  height: auto;
  z-index: 14;
  animation: grow 1s 3s ease-in-out forwards,
    slideBottomRight 1s 3s ease-in-out forwards;
}

.endingScene4SamuraiDoge {
  width: 100%;
  height: auto;
}

.swordCatContainer {
  position: absolute;
  left: 55%;
  top: 15%;
  z-index: 15;
  width: 45vw;
  height: auto;
  animation: shrink 1s 3s ease-in-out forwards,
    slideTopLeft 1s 3s ease-in-out forwards;
}

.endingScene4SwordCatBack {
  width: 100%;
  height: auto;
}

@keyframes slideBottomRight {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(40vw, 6vh);
  }
}

@keyframes slideTopLeft {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-40vw, -6vh);
  }
}

@keyframes grow {
  from {
    width: 30vw;
  }
  to {
    width: 40vw;
  }
}

@keyframes shrink {
  from {
    width: 40vw;
  }
  to {
    width: 25vw;
  }
}

.sweatDropImage {
  position: absolute;
  z-index: 16;
  width: 5vw;
  height: auto;
  top: 5vh;
  left: 4.5vw;
  animation: moveSweatDropDown 1s linear forwards;
}

@keyframes moveSweatDropDown {
  from {
    top: 5vh;
  }
  to {
    top: 7vh;
  }
}

.endingContainerOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    29deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0;
}

.overlayFadeInAndOut {
  animation: overlayFadeInAndOut 1s ease-in-out;
}

@keyframes overlayFadeInAndOut {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.endingContainerOverlay2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  opacity: 0;
  z-index: 20;
}

.showEndingContainerOverlay2 {
  animation: fadeIn 2s ease-in-out forwards;
}
