/*
Author: Nozhin Azarpanah
Date: March 14, 2026
JS Individual Assignment
*/

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

#startPage{
  background-image:url("../images/opening.jpg");
  width: min(100vw, calc((100dvh - 40px) * 2 / 3));
  height: min(calc(100dvh - 40px), calc(100vw * 3 / 2));
  aspect-ratio: 2 / 3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

#startPage h2 {
  position: absolute;
  left: 50%;
  top: 10%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-family:"Betania Patmos", cursive;
  font-size: 36px;
  color: white;
  text-align: center;
  white-space: nowrap;
}

#startButton {
  font-family:"Betania Patmos", cursive;
  font-size:18px;
  width: 190px;
  height: 44px;
  border-radius: 999px;
  border: none;
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translate(-50%, -46%);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  background-color: rgb(15, 15, 31);
  color:rgb(255, 197, 104);
  box-shadow: 0 10px 18px rgb(255, 197, 104);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

#startButton.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

#startButton:hover {
  transform: translate(-50%, calc(-50% - 2px));
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
  filter: brightness(1.05);
}

#startButton:active {
  transform: translate(-50%, calc(-50% + 1px)) scale(0.98);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#helpToggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
}

#helpToggle summary {
  list-style: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgb(15, 15, 31);
  color: rgb(255, 197, 104);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Betania Patmos", cursive;
  font-size: 18px;
  cursor: pointer;
  border: 1px solid rgba(255, 197, 104, 0.7);
}

#helpToggle summary::-webkit-details-marker {
  display: none;
}

#helpPanel {
  width: 250px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 15, 31, 0.9);
  color: white;
  position: absolute;
  right: 36px;
  bottom: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  line-height: 1.25;
}

#helpPanel h3 {
  margin: 0 0 6px;
  font-family: "Betania Patmos", cursive;
  font-size: 17px;
  color: rgb(255, 197, 104);
}

#helpPanel p {
  margin: 0 0 4px;
}

#helpPanel p:last-child {
  margin-bottom: 0;
}

@media (hover: none) and (pointer: coarse) {
  #startButton {
    transition: none;
  }

  #startButton:hover,
  #startButton:active {
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 18px rgb(255, 197, 104);
    filter: none;
  }
}

body {
  background-color: black;
  width: 100vw;
  height: 100dvh;
  padding: 20px 0;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

canvas {
  display: block;
  background: url('../images/background.jpg') no-repeat center center;
  background-size: contain;
  background-color: black;
}

#playAgainButton,
#resumeButton {
  font-family:"Betania Patmos", cursive;
  font-size:18px;
  border-radius: 999px;
  border: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  background-color: rgb(15, 15, 31);
  color:rgb(255, 197, 104);
  box-shadow: 0 10px 18px rgb(255, 197, 104);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  z-index: 20;
}

#playAgainButton {
  width: 190px;
  height: 44px;
}

#resumeButton {
  width: 190px;
  height: 44px;
  font-size:18px;
}

#playAgainButton:hover,
#resumeButton:hover {
  transform: translate(-50%, calc(-50% - 2px));
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
  filter: brightness(1.05);
}

#playAgainButton:active,
#resumeButton:active {
  transform: translate(-50%, calc(-50% + 1px)) scale(0.98);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.85);
  color: rgb(255, 197, 104);
  font-family: "Betania Patmos", cursive;
  font-size: 28px;
  z-index: 50;
}

@media (hover: none) and (pointer: coarse) {
  #playAgainButton,
  #resumeButton {
    transition: none;
  }

  #playAgainButton:hover,
  #playAgainButton:active,
  #resumeButton:hover,
  #resumeButton:active {
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 18px rgb(255, 197, 104);
    filter: none;
  }
}

@media (max-width: 300px) {
  #startPage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    aspect-ratio: auto;
  }

  canvas {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  body {
    width: 100%;
    height: 100%;
    padding: 0;
  }
}
