/*-------- */
/* GENERAL */
/*-------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
  font: inherit;
}

html {
  overflow: hidden;
}

html:focus-within {
  scroll-behavior: smooth;
}

img,
picture,
svg {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
}

button img {
  -webkit-user-drag: none;
  pointer-events: none;
}

body {
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: url("./img/layers/repeating_layers/background_backdrop.png") no-repeat center center / cover;
  font-family: "Lora", Georgia, "Times New Roman", Times, serif;
  color: black;
}

a {
  color: #114403;
  font-weight: 700;
}

/*-------*/
/* UTILS */
/*-------*/

.success {
  color: #c8c500;
}

.success-shadow {
  text-shadow: 2px 2px 0 #000, 4px 4px 0 #444, 6px 6px 0 #222;
}

.fail {
  color: #ff3333;
}

.fail-shadow {
  text-shadow: 2px 2px 0 #000, 4px 4px 0 #660000;
}

.flex-space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/*-------- */
/* SCREENS */
/*-------- */
.game-container {
  position: relative;
  display: inline-block;
}

canvas {
  display: block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.start-screen {
  position: absolute;
  background: url("./img/misc/start_bg.jpg") no-repeat center center / cover;
  width: 720px;
  height: 480px;
}

.menu-btn {
  background: transparent;
  border: none;
  min-width: 80px;
  max-width: 125px;
  transition: all 250ms ease-in-out;
}

.menu-btn:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px rgba(131, 193, 60, 0.4));
}

.menu-btn-container {
  width: 100%;
  display: flex;
  justify-content: center;
  position: absolute;
  top: 70%;
  gap: 20px;
  padding-inline: 2rem;
}

#nara-gif {
  width: 20%;
  position: absolute;
  top: 23%;
  left: 12%;
}

.end-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #010d05;
  width: 720px;
  height: 480px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.end-screen-content {
  padding: 1rem;
}

.end-screen-text {
  text-align: center;
  margin-bottom: 4rem;
}

.end-screen h2 {
  font-family: "Cinzel", Georgia, "Times New Roman", Times, serif;
  font-size: 84px;
  letter-spacing: 8px;
}

.end-screen p {
  font-size: 24px;
}

.endscreen-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 36px;
}

#fullscreen:fullscreen {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url("./img/layers/repeating_layers/background_backdrop.png") no-repeat center center / cover;
}

#fullscreen:fullscreen #canvas,
#fullscreen:fullscreen #start-screen,
#fullscreen:fullscreen #win-end-screen,
#fullscreen:fullscreen #lose-end-screen {
  width: calc(720px * 1.5);
  height: calc(480px * 1.5);
}

/*--------- */
/* CONTROLS */
/*--------- */
.controls {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 20px;
  background: transparent;
}

.controls.active {
  justify-content: space-between;
}

.controls-container {
  display: flex;
  gap: 24px;
}

.controls-container button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #b9b9b9;
  background-color: black;
  border: none;
  box-shadow: 0 0 8px rgba(131, 193, 60, 0.6);
}

.controls-container button:hover,
.controls-container button.active {
  transform: scale(1.05);
  color: #83c13c;
}

.controls-container button.d-none {
  display: none;
}

.mobile-controls {
  display: none;
}

.mobile-controls.active {
  display: flex;
}

#craft-btn {
  padding: 4px;
}

/*------------------------ */
/* MOBILE PORTRAIT BLOCKER */
/*------------------------ */
.mobile-portrait-blocker {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #011005;
  color: #c8c500;
  font-size: 18px;
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 10px;
  text-align: center;
}

.mobile-portrait-blocker svg {
  transform: rotate(90deg);
  animation: 1500ms infinite rotate-device;
}

@keyframes rotate-device {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(90deg);
  }
}

.d-none {
  display: none;
}

/*-------------- */
/* MEDIA QUERIES */
/*-------------- */
@media only screen and (max-width: 720px), only screen and (max-height: 480px) {
  .start-screen,
  .end-screen {
    width: 100%;
  }
}

@media only screen and (max-width: 720px) {
  canvas,
  .start-screen,
  .end-screen,
  .overlay {
    width: 100%;
  }
}

@media only screen and (max-height: 480px) {
  canvas,
  .start-screen {
    height: 100dvh;
    height: 100vh; /* fallback for browsers without dvh */
  }

  .story-info-wrapper,
  .imprint-info-wrapper {
    font-size: 14px;
    margin: 48px 32px;
  }

  .overlay-title {
    font-size: 24px;
  }

  .controls-info-wrapper {
    transform: scale(0.9);
  }

  .end-screen h2 {
    font-size: 56px;
  }

  .end-screen p {
    font-size: 18px;
  }
}

@media only screen and (max-height: 390px) {
  .controls-info-wrapper {
    transform: scale(0.75);
    margin: 32px;
    padding: 16px 0;
  }
}

@media only screen and (max-height: 320px) {
  .story-info-wrapper,
  .imprint-info-wrapper {
    font-size: 14px;
    margin: 48px 54px;
  }
}
