/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v8.4.14,
* Autoprefixer: v10.4.7
* Browsers: last 4 version
*/

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Atma:wght@300;400;500;600;700&family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

/* CSS Variables */

:root {
  --primary-font: "Lato", sans-serif;
  --secondary-font: "Atma", system-ui;
  --primary-color: #1e3a8a;
  --text-color: #2f3441;
  --accent-color: #f4c542;
  --background-color: #fdfaf6;
}

body {
  background-color: var(--background-color);
  margin: 0;
  font-family: var(--primary-font);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../images/pattern.webp");
  background-repeat: repeat;
  background-size: 400px;
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

.home-panel {
  max-width: 600px;
  min-height: 100vh; /*fallback*/
  min-height: 100dvh;  /* better on mobile */
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  margin: 0 auto;
  padding: 1rem 0 1rem;
  background-color: #ffffff;
  border: 6px solid var(--primary-color);
  -webkit-box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.08),
    0 25px 60px rgba(0, 0, 0, 0.10),
    0 10px 25px rgba(0, 0, 0, 0.06);
          box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.08),
    0 25px 60px rgba(0, 0, 0, 0.10),
    0 10px 25px rgba(0, 0, 0, 0.06);
}

#intro h1 {
  font-family: var(--secondary-font);
  color: var(--primary-color);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: clamp(2.6rem, 9vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.title-stars {
  color: var(--accent-color);
  font-size: 2rem;
  letter-spacing: 0.4rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.15),
    0 0 8px rgba(244, 197, 66, 0.35);
}

#intro {
  margin-bottom: 1rem;
}

#tagline-col {
  padding-right: 0;
  margin-top: 3rem;
}

#welcome-tagline {
  margin: 0;
  padding: 0.5rem 0 0.5rem 1rem;
  font-family: var(--secondary-font);
  color: var(--primary-color);
  font-size: clamp(1.6rem, 6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  letter-spacing: 0.02em;
  text-shadow:
    0 2px 8px rgba(255, 255, 255, 0.7),
    0 0 3px rgba(255, 255, 255, 0.9);
  min-height: 250px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
      -ms-flex-align: start;
          align-items: flex-start;
  background-image: url(../images/eu-map.webp);
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 130%;
}

#start-btn,
#replay-btn {
  font-family: var(--secondary-font);
}

#start-btn {
  font-size: clamp(1.6rem, 2.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.03rem;
  background-color: var(--primary-color);
  padding: 1rem 1.8rem;
  margin-top: 4rem;
  border-radius: 999px;
  /*number high enough to keep the button fully rounded even if size changes*/
  border: none;
  -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10),
    0 4px 10px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
          box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10),
    0 4px 10px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  -webkit-transition: -webkit-transform 0.2s ease, -webkit-box-shadow 0.2s ease;
  transition: -webkit-transform 0.2s ease, -webkit-box-shadow 0.2s ease;
  -o-transition: transform 0.2s ease, box-shadow 0.2s ease;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transition: transform 0.2s ease, box-shadow 0.2s ease, -webkit-transform 0.2s ease, -webkit-box-shadow 0.2s ease;
}

#start-btn:hover,
#start-btn:focus {
  background-color: #2c4fd6;
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
  -webkit-box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14),
    0 6px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
          box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14),
    0 6px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

#start-btn:active {
  -webkit-transform: scale(0.97);
      -ms-transform: scale(0.97);
          transform: scale(0.97);
}


/*-------------------------------------------------------------Quiz Page*/

#game-mode {
  font-family: var(--secondary-font);
  color: var(--primary-color);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

#game-container {
  text-align: center;
}

#answers-area {
  margin-top: 1rem;
}

#question {
  color: var(--text-color);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 1rem;
}

#question-counter {
  font-size: 1rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

#flag-img {
  height: 7rem;
  width: auto;
  max-width: 100%;
  margin-top: 0.5rem;
  -o-object-fit: contain;
     object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  -webkit-box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
          box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.answer-btn {
  font-family: var(--primary-font);
  font-size: 1.2rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.75rem;
  background-color: #ffffff;
  -webkit-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
          box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}


@media (hover: hover) and (pointer: fine) {
  .answer-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
  }
}

/* highlight the correct answer */
.answer-btn.correct,
.answer-btn.correct:disabled {
  background-color: #43a047;
  border-color: #43a047;
  color: white;
}

/* highlight the wrong answer */
.answer-btn.wrong,
.answer-btn.wrong:disabled {
  background-color: #d64545;
  border-color: #d64545;
  color: white;
}


/*-------------------------------------------Results Page*/

#results {
  padding-top: 1rem;
}

#results h1 {
  font-family: var(--secondary-font);
  color: var(--primary-color);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  font-size: clamp(2.5rem, 6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  white-space: nowrap;
}

.results-icon {
  margin: 1.5rem 0;
}

.results-icon img {
  width: 100px;
  display: block;
  margin: 0 auto;
  -webkit-filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
          filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

#score {
  color: var(--text-color);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
}

#message {
  color: var(--text-color);
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  line-height: 1.4;
  margin-bottom: 2rem;
}

#replay-btn {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.03rem;
  background-color: var(--primary-color);
  padding: 1rem 2rem;
  border-radius: 999px;
  border: none;
  -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10),
    0 4px 10px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
          box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10),
    0 4px 10px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  -webkit-transition: -webkit-transform 0.2s ease, -webkit-box-shadow 0.2s ease;
  transition: -webkit-transform 0.2s ease, -webkit-box-shadow 0.2s ease;
  -o-transition: transform 0.2s ease, box-shadow 0.2s ease;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transition: transform 0.2s ease, box-shadow 0.2s ease, -webkit-transform 0.2s ease, -webkit-box-shadow 0.2s ease;
}

#replay-btn:hover,
#replay-btn:focus {
  background-color: #2c4fd6;
  color: #ffffff;
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
  -webkit-box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14),
    0 6px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
          box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14),
    0 6px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

#replay-btn:active {
  -webkit-transform: scale(0.97);
      -ms-transform: scale(0.97);
          transform: scale(0.97);
}

.back-btn {
  font-family: var(--secondary-font);
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  opacity: 0.8;
  background-color: var(--accent-color);
  border: 2px solid var(--accent-color);
  color: var(--primary-color);
}

.back-btn:hover,
.back-btn:focus {
  background-color: #f1d36b;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/*-------------------------------------------------------- Modal Styling */

.modal-content {
  border: none;
  border-radius: 20px;
}

.modal-header {
  border-bottom: none;
}

.modal-title {
  font-family: var(--secondary-font);
  font-size: clamp(1rem, 4vw, 2rem) !important;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.02em;
}

.modal-body legend {
  font-family: var(--secondary-font);
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e3a8a;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.modal-body .form-label {
  font-family: var(--secondary-font);
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a8a;
  letter-spacing: 0.02em;
}

.modal-body .form-check-label,
.modal-body .form-select {
  font-family: var(--primary-font);
}

.modal-footer .btn-primary {
  background-color: var(--primary-color);
  border: none;
  font-family: var(--secondary-font);
  letter-spacing: 0.02em;
}

.modal-footer .btn-primary:hover,
.modal-footer .btn-primary:focus {
  background-color: #2c4fd6;
}

.modal-footer .btn-secondary {
  font-family: var(--secondary-font);
  letter-spacing: 0.02em;
}


#error-code {
  font-family: var(--secondary-font);
  color: var(--primary-color);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 600;
  line-height: 1;
  margin: 0 0 0.5rem;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/*------------------------------------------ 404 Page */

#error-title {
  font-family: var(--secondary-font);
  color: var(--primary-color);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 1rem;
}

#error-text {
  max-width: 32rem;
  color: var(--text-color);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

#redirect-btn {
  margin-top: 0;
  font-family: var(--secondary-font);
  font-size: 1.5rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  opacity: 0.8;
  background-color: var(--accent-color);
  border: 2px solid var(--accent-color);
  color: var(--primary-color);
}

#redirect-btn:hover {
  background-color: #f1d36b;
  color: var(--primary-color);
  border-color: var(--primary-color);
}


/*-------------------------------------Media Queries */

@media screen and (min-width: 768px) {
  #intro h1 {
    margin-top: 2rem;
  }

  #welcome-tagline {
    min-height: 400px;
    margin-top: 2rem;
    line-height: 1.4;
    letter-spacing: 0.04em;
    background-size: auto 100%;
  }

  #start-btn {
    margin-top: 5rem;
  }

  .title-stars {
    font-size: 2rem;
    letter-spacing: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  #game-mode {
    margin-top: 2rem;
    margin-bottom: 2rem;
    line-height: 1.2;
  }

  #answers-area {
    margin-top: 2rem;
  }

  #flag-img {
    height: 8rem;
  }

  #results {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

}

@media screen and (min-width: 992px) {
  .home-panel {
    max-width: 760px;
  }

  #welcome-tagline {
    min-height: 500px;
    margin-top: 2rem;
    background-size: auto 110%;
  }

  #tagline-col {
   margin-top: 1rem;
}

  #start-btn {
    margin-top: 3rem;
  }

  .title-stars {
    font-size: 2.7rem;
    letter-spacing: 0.8rem;
  }

  #replay-btn {
    margin-bottom: 1rem;
  }
}

@media screen and (min-width:1200px) {
  .home-panel {
    max-width: 800px;
  }

  #intro h1 {
    margin-top: 1rem;
  }

  .title-stars {
    font-size: 2.7rem;
    letter-spacing: 0.8rem;
    margin-top: 0;
    margin-bottom: 0rem;
  }

  #welcome-tagline {
    min-height: 380px;
    margin-top: 0.5rem;
    padding-top: 2rem;
    background-size: auto 130%;
  }

  #start-btn {
    margin-top: 1.5rem;
  }

  #game-mode {
    margin-top: 1rem;
    margin-bottom: 1rem;
    line-height: 1;
  }

  #answers-area {
    margin-top: 1rem;
  }

  #results {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  #replay-btn {
    margin-bottom: 0;
  }

  #message {
    margin-bottom: 1rem;
  }

}