@import url("https://fonts.googleapis.com/css2?family=Didact+Gothic&display=swap");

/* ============================================================
   GLOBAL RESET + BASE STYLES
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: "Irish Grover";
  src: url("../images/IrishGrover.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-size: 14px;
  background: rgba(250, 240, 188, 1);
  overflow-x: hidden;
  font-family: "Irish Grover", sans-serif;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

.page_container {
  width: 1440px;
  height: 716px;
  position: relative;
  overflow: hidden;
}

.title_text {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);

  max-width: 1000px;
  font-size: clamp(125px, 3.5vw, 24px);
  text-align: center;
}

#landing_page {
  height: 100vh;
  overflow: hidden;
}

#landing_page .quiz_container {
  height: 716px;
  min-height: unset;
}

.name_prompt {
  max-width: 800px;
  font-size: clamp(18px, 3vw, 40px);
  text-align: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */

#start_button_wrapper {
  position: absolute;
  bottom: 15%;

  width: clamp(250px, 40vw, 420px);
  height: clamp(60px, 12vw, 120px);

  cursor: pointer;
  animation: cheese_wobble 3s ease-in-out infinite;
}

.start_button_bg {
  width: 100%;
  height: 100%;
  background: rgba(160, 129, 95, 0.5);
  border-radius: 999px;
  transition:
    background-color 0.25s ease,
    opacity 0.25s ease;
  pointer-events: none;
}

#name_continue_wrapper {
  width: clamp(160px, 40vw, 210px);
  height: clamp(60px, 12vw, 90px);

  cursor: pointer;
  animation: cheese_wobble 3s ease-in-out infinite;
}

.continue_button_bg {
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 140px;
  min-height: 70px;
  background: rgba(160, 129, 95, 0.5);
  border-radius: 999px;
  transition:
    background-color 0.25s ease,
    opacity 0.25s ease;
  pointer-events: none;
}

.start_button_text {
  position: absolute;
  inset: 0;
  font-size: clamp(24px, 6vw, 60px);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.continue_button_text {
  position: absolute;
  inset: 0;
  font-size: clamp(18px, 3vw, 40px);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

#start_button_wrapper:hover .start_button_bg {
  background: rgba(200, 170, 120, 0.8);
}

#start_button_wrapper:hover .start_button_text {
  color: white;
}

#name_continue_wrapper:hover .start_button_bg {
  background: rgba(200, 170, 120, 0.8);
}

#name_continue_wrapper:hover .continue_button_text {
  color: white;
}

.result_buttons {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

.result_buttons button {
  padding: 10px 20px;
  font-size: 16px;
  font-family: "Irish Grover", cursive;
  border-radius: 50px;
  border: none;
  background: rgba(160, 129, 95, 0.5);
  color: black;
  cursor: pointer;
  transition: background 0.25s;
}

.result_buttons button:hover {
  background: rgba(200, 170, 120, 0.8);
  color: white;
}

.back_button {
  padding: 10px 20px;
  font-size: 16px;
  font-family: "Irish Grover", cursive;
  border-radius: 50px;
  border: none;
  background: rgba(160, 129, 95, 0.5);
  color: black;
  cursor: pointer;
  transition: background 0.25s;
}

.back_button:hover {
  background: rgba(200, 170, 120, 0.8);
  color: white;
}

/* ============================================================
   LANDING PAGE DECORATION
   ============================================================ */

.title_lil {
  top: -10%;
  left: -5%;
  width: clamp(500px, 80vw, 1100px);
  aspect-ratio: 1 / 1;
  background: url("../images/lil.png") center / contain no-repeat;
  position: absolute;

  z-index: 1000;
  pointer-events: none;
  transform: translateX(-10%);
}

.title_shan {
  top: -18%;
  left: 20%;
  width: clamp(500px, 80vw, 1100px);
  aspect-ratio: 1 / 1;
  background: url("../images/shan.png") center / contain no-repeat;
  position: absolute;

  z-index: 1000;
  pointer-events: none;
  transform: translateX(10%);
}

/* ============================================================
   QUIZ PAGE
   ============================================================ */

.quiz_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url("../images/Border.png") center / contain no-repeat;
  height: 100%;
  position: relative;
  padding: 8vh 10% 10vh;
  gap: 25px;
}

.option_box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  gap: 8px;
}

.quiz_option {
  width: 100%;
  height: 50px;
  background: rgba(160, 129, 95, 0.5);
  border: none;
  border-radius: 167px;
  font-family: "Didact Gothic";
  color: rgb(127, 122, 95);
  font-size: clamp(16px, 3vw, 20px);
  cursor: pointer;
  transition:
    background 0.25s,
    opacity 0.25s;
  padding: 0 20px;
}

.quiz_option:hover {
  color: white;
}

/* Scenario prompt */
.quiz_prompt {
  max-width: 800px;
  font-size: clamp(18px, 3.5vw, 24px);
  text-align: center;
}

.quiz_image {
  width: clamp(300px, 80%, 600px);
  aspect-ratio: 2 / 1;
  overflow: hidden;
  box-sizing: border-box;
  object-fit: contain;
}

.quiz_image_box {
  position: relative;
  width: 100%;
  max-width: 620px; /* slightly wider */
  aspect-ratio: 2 / 1.7;

  /* image control */
  background-size: 98% 95%;
  background-position: center;
  background-repeat: no-repeat;

  margin-top: 16px;
  overflow: hidden;
}

.loading_container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.loading_text {
  font-family: "Irish Grover", cursive;
  font-size: 24px;
  animation: pulse 1.5s infinite;
}

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

.result_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.result_image {
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  box-sizing: border-box;
}

/* squiggly border ABOVE image, no covering */
.quiz_image_box::after {
  content: "";
  position: absolute;
  inset: 0;

  background: url("../images/squiggly_border.png") center / 100% 100% no-repeat;

  pointer-events: none;
  z-index: 2;
}

#all_cheeses .quiz_centerer {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

#all_cheeses .quiz_scale_wrapper {
  height: auto;
  min-height: 716px;
}

#all_cheeses .result_container {
  min-height: auto;
  padding: 40px 20px;
}

/* ============================================================
   QUIZ PAGE SCALING
   ============================================================ */

.quiz_centerer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

.quiz_scale_wrapper {
  width: 1440px;
  height: 716px;
  transform-origin: top center;
  transform: scale(var(--quiz-scale));
  margin: 2vh auto;
}

:root {
  --quiz-scale: 1;
}

/* ============================================================
   WOBBLE ANIMATION (USED BY START BUTTON ONLY)
   ============================================================ */

@keyframes cheese_wobble {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(0.4deg) scale(1.01);
  }
  50% {
    transform: rotate(0deg) scale(1);
  }
  75% {
    transform: rotate(-0.4deg) scale(1.01);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

/* ============================================================
   NAME PAGE
   ============================================================ */

.name_container {
  gap: 40px;
}

.name_input {
  font-family: "Irish Grover", cursive;
  font-size: 24px;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  width: 320px;
  text-align: center;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
}

.name_input::placeholder {
  opacity: 0.6;
}

.name_input:focus {
  box-shadow: 0 0 0 4px rgba(200, 170, 120, 0.5);
}

.name_continue_wrapper {
  margin-top: 10px;
  width: 260px;
  height: 90px;
  cursor: pointer;
  position: relative;
  animation: cheese_wobble 3s ease-in-out infinite;
}

/* ------------------------
   Mobile optimizations
------------------------ */
@media (max-width: 940px) {
  .quiz_container {
    width: 95%;
    min-height: 100vh;
    margin: 2vh auto;
    padding: 3vh 5%;
    background: none;
  }

  .quiz_option {
    height: 45px;
    font-size: clamp(15px, 3vw, 16px);
  }
}

@media (max-width: 480px) {
  .quiz_container {
    width: 98%;
    min-height: 100vh;
    margin: 1.5vh auto;
    padding: 2vh 3%;
    background: none;
  }

  .quiz_option {
    height: 40px;
    font-size: clamp(14px, 3.5vw, 15px);
  }

  .title_text {
    font-size: clamp(70px, 8vw, 90px);
    top: 5%;
  }

  .title_lil {
    top: 20%;
    left: -20%;
    width: clamp(500px, 80vw, 1100px);
    aspect-ratio: 1 / 1;
    background: url("../images/lil.png") center / contain no-repeat;
    position: absolute;

    z-index: 1000;
    pointer-events: none;
    transform: translateX(-10%);
  }

  .title_shan {
    top: 20%;
    left: -28%;
    width: clamp(500px, 80vw, 1100px);
    aspect-ratio: 1 / 1;
    background: url("../images/shan.png") center / contain no-repeat;
    position: absolute;

    z-index: 1000;
    pointer-events: none;
    transform: translateX(10%);
  }

  .name_prompt {
    font-size: 6vw;
  }

  #start_button_wrapper {
    width: 70vw; /* scale button width */
    height: 18vw; /* scale button height */
  }

  #name_continue_wrapper {
    width: 40vw;
    height: 13vw;
  }

  .continue_button_bg {
    min-width: unset;
    min-height: unset;
  }

  .start_button_text {
    font-size: 8vw;
  }

  .continue_button_text {
    font-size: 6vw;
  }

  .result_buttons {
    gap: 8px;
  }
}
