/* Base Setup */
@import url('https://fonts.googleapis.com/css2?family=Almendra+SC&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bgColor: #1f1f1f99;
  --fftext: 'Almendra SC';
}

html,
body {
  height: 100dvh;
  background-color: var(--bgColor);
}

a {
  color: #fff;
  text-decoration: none;
}

body {
  position: relative;
  color: #fff;
  font-family: var(--fftext);
  background: url(../assets/imgs/freepik__giant-arched-doors-inside-an-ominous-dungeon-flank__79577.png);
  background-size: 100% 100dvh;
  background-position: center;
}

/* Layout Containers */
.main-container {
  height: 100%;
  padding: 2rem;
  position: relative;
}

/* Header */
.main-container .header {
  display: grid;
  align-items: center;
  justify-items: center;
}

.main-container .header h1 {
  font-size: 8rem;
  text-shadow: 4px 4px 12px #000;
  line-height: 1;
}

.main-container .header p,
.main-container .header .copyright {
  width: 100%;
  text-align: center;
  padding: 1rem;
  font-size: 1.4rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px #000;
}

/* Battle Scene */
.main-container .battle-scene {
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.battle-description {
  font-size: 2rem;
  background-color: #1f1f1f;
  padding: 1rem;
  border: 12px groove #000;
  border-radius: 0.4rem;
  text-align: center;
}

.battle-description p {
  text-shadow: 2px 2px 4px #000;
}

.text-box {
  background-color: #1f1f1f;
  font-size: 2.5rem;
  width: 80%;
  border: 12px ridge #000;
  border-radius: 0.4rem;
  padding: 2rem;
  font-family: var(--fftext);
  text-shadow: 2px 2px 4px #000;
  display: grid;
  align-items: center;
  justify-items: center;
}

/* Buttons */
.button-container {
  display: flex;
  flex-direction: row;
  gap: 2rem;
}

.button-container .button {
  font-family: var(--fftext);
  font-size: 2.4rem;
  font-weight: bold;
  padding: 0.4em 1.5em;
  border: 8px ridge #000;
  color: inherit;
  border-radius: 0.4rem;
  background-color: #1f1f1f;
  text-shadow: 2px 2px 4px #000;
  transition: transform 0.1s ease-out;
}

.button-container .button:hover {
  cursor: pointer;
  transform: scale(1.05);
}

.button-container .button:active {
  transform: scale(1);
}

.button-container button:disabled {
  opacity: 0.6;
}

.button-container button:disabled:hover {
  transform: none;
}

/* Credits */
.credits {
  font-size: 2rem;
  text-shadow: 2px 2px 4px #000;
  display: flex;
  gap: 0.4rem;
  position: absolute;
  bottom: 1rem;
}

.credits a:hover {
  opacity: 0.6;
}

/* Audio + Mute */
audio {
  visibility: hidden;
  position: absolute;
  bottom: 0;
  right: 0;
}

.mute-btn {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background-color: #1f1f1f;
  color: #fff;
  text-shadow: 2px 2px 4px #000;
  font-family: inherit;
  font-size: 1.4rem;
  padding: 0.4rem 1rem;
  border: 8px ridge #000;
  border-radius: 0.4rem;
  opacity: 0;
  animation: menuFadeIn 4s ease-out 2s forwards;
}

.mute-btn:hover {
  cursor: pointer;
  opacity: 0.85;
}

.menu-screen,
#gameScreen {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  inset: 0;
  background-color: var(--bgColor);
}

#gameScreen.hidden,
.menu-screen.hidden {
  display: none;
}

/* Menu */
.menu-button {
  background-color: #1f1f1f;
  color: #fff;
  text-shadow: 2px 2px 4px #000;
  font-family: inherit;
  font-size: 3rem;
  padding: 0.4rem 1rem;
  border: 8px ridge #000;
  border-radius: 0.4rem;
  opacity: 0;
  transition: transform 0.1s ease-out;
  animation: menuFadeIn 2s ease-out 2.5s forwards;
}

.menu-button:hover {
  cursor: pointer;
  transform: scale(1.1);
}

.menu-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  height: 100%;
  text-align: center;

  .credits {
    font-size: 2rem;
    text-shadow: 2px 2px 4px #000;
    display: flex;
    gap: 0.4rem;
    position: absolute;
    bottom: 1rem;
    opacity: 0;
    animation: menuFadeIn 3s ease-out 2s forwards;
  }
}

.menu-screen .title {
  text-shadow: 3px 3px 6px #000;
  filter: drop-shadow(0 0 0px #fff);
  font-size: 8rem;
  opacity: 0;
  animation:
    menuFadeIn 5s ease-out 0.4s forwards,
    titleGlow 5s ease-out 0.4s infinite;
}

.menu-screen .subtitle {
  font-size: 1.4rem;
  color: #ccc;
  text-shadow: 1px 1px 2px #000;
  opacity: 0;
  animation: menuFadeIn 3s ease-out 1.5s forwards;
}

#fadeOverlay {
  position: absolute;
  background-color: #000;
  height: 100%;
  width: 100%;

  animation: screenLighten 8s ease-out forwards;
}

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

@keyframes screenLighten {
  0% {
    background-color: #000;
  }
  25% {
    background-color: #000;
  }
  100% {
    background-color: transparent;
  }
}

@keyframes titleGlow {
  0% {
    filter: drop-shadow(0 0 12px #6f706d);
  }
  50% {
    filter: drop-shadow(0 0 16px #6f706d);
  }
  100% {
    filter: drop-shadow(0 0 12px #6f706d);
  }
}

@media (max-width: 798px) {
  .menu-screen .title {
    font-size: 7rem;
  }

  .menu-screen .subtitle {
    font-size: 1.4rem;
  }
  .main-container .header h1 {
    font-size: 6rem;
    text-align: center;
    transform: translateY(-40px);
  }

  .battle-description {
    font-size: 1.4rem;
  }

  .text-box {
    padding: 0.6rem;
    font-size: 1.8rem;
    text-align: center;
  }

  .button-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 1rem;
  }

  .button-container .button {
    font-size: 1.4rem;
    padding: 0.2em 0.4em;
  }

  .mute-btn {
    position: absolute;
    top: 40px;
    right: 24px;
    height: 60px;
  }
}
