/* Murder Who Wrote? CSS */

/* fonts */

@import url("https://fonts.googleapis.com/css2?family=Corben:wght@400;700&family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap");

/* CSS variables */

:root {
  /* Fonts */
  --primary-font: "Corben";
  --secondary-font: "Work Sans";

  /* Colours */
  --primary-color: #222e50;
  --secondary-color:#8D99AE;
  
}

/* Removes all margings & padding so everything is customisable */

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

html,
body {
  margin: 0;
  font-family: var(--secondary-font);
  color: var(--primary-color);
}

header h1 a,
header h1 a:link,
header h1 a:visited,
header h1 a:active {
  text-decoration: none;
  color: inherit;
  transition: color .2s ease;
}

/* desktop / hover-capable */
header h1 a:hover {            
  color: var(--secondary-color);}

  /* mobile/touch version */
@media (hover: none) and (pointer: coarse) {
  header h1 a:active { color: var(--secondary-color); }
}

h1,
h2 {
  font-family: var(--primary-font);
  font-style: italic;
  color: var(--primary-color);
}

/* Containers */

.flex-container {
  background-color: #F2C57C;
  display: flex;
  width: 100vw;
  height: 100vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem;
}

#informationBox {
  flex-direction: column;
  text-align: center;
  font-family: var(--secondary-font);
  background-color: #F2C57C;
  opacity: 0.9;
  width: 80%;
  margin: auto;
  padding: 0.8rem;
  border-radius: 1.5rem;
  color: var(--primary-color);
}

#informationBox > p {
  padding: 1rem;
}

.quiz-container {
  display: flex;
  margin-bottom: 0.5rem;
  width: 100%;
  font-size: 1.5rem;
  border: 0.1rem solid rgb(86, 165, 235, 0.25);
  background-color: var(--secondary-color);
  color: var(--primary-color)
}


.option-prefix {
  font: var(--secondary-font);
  text-align: center;
  width: 20%;
}

.options {
  font: var(--secondary-font);
  text-align: center;
  width: 80%;
  padding: 5px;
  cursor: pointer;
}

.quiz-container.correct {
  background-color: #628b48; 
  /* Midsomer Murder green */ 
}

.quiz-container.incorrect {
  background-color: #D00000;
  /* Murder She Wrote Red */
}

.quiz-container,
.options {
  transition: background-color 200ms ease;
}

/* buttons */

button,
a.button {
  display: block;
  width: 60%;
  margin: 10px auto;
  color: black;
  text-align: center;
  font-size: 1.1em;
  font-family: var(--secondary-font);
  padding: 10px;
  border: 2px solid black;
  border-radius: 5px;
  text-decoration: none;
  background-color: #F2C57C;
}

/* Progress & Score */

#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hud-item {
  flex: 1;
  color: var(--primary-color);
}
.hud-item.score {
  flex: 0 0 auto;
  min-width: 110px;
  text-align: right;
}

.score-label {
  color: var(--primary-color);
  margin-right: 0.4rem;
  font-weight: 600;
}

.progress {
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}
#progressBar {
  height: 100%;
  width: 0;
  background: #628B48; /* green fill */
  transition: width 0.25s ease-in-out;
}

/* Modal */

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

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transform-origin: center;
  transition: 200ms ease-in-out;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  z-index: 1001;
  background-color: whitesmoke;
  width: 500px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.modal.active {
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.instructions-header {
  position: relative;
  padding: 10px 16px;
  padding-right: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  justify-content: flex-start;
}

.instructions-title {
  font-size: 1.05rem;
  font-weight: 700;
}
.close-instructions {
  all: unset;
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 1.25rem; 
  line-height: 1; 
  color: #666; 
  border-radius: 50%;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}
.close-instructions:hover {
  color: #000; /* darker on hover */
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}

.close-instructions:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.instructions-body {
  padding: 12px;
}

#overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 150ms ease;
}
#overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* End page */

#endPage {
  flex-direction: column;
  text-align: center;
  font-family: var(--secondary-font);
  background-color: #F2C57C;
  opacity: 0.9;
  width: 80%;
  margin: auto;
  padding: 0.8rem;
  border-radius: 1.5rem;
}

input {
  display: block;
  width: 60%;
  margin: 10px auto;
  color: black;
  text-align: center;
  font-size: 1.1em;
  font-family: var(--secondary-font);
  padding: 10px;
  border: 2px solid black;
  border-radius: 5px;
  text-decoration: none;
  background-color: #F2C57C;
}

/* High Score Pages */

#highScoresPanel {
  flex-direction: column;
  text-align: center;
  font-family: var(--secondary-font);
  background-color: #F2C57C;
  opacity: 0.9;
  width: 80%;
  margin: auto;
  padding: 0.8rem;
  border-radius: 1.5rem;
}

#highScoresList {
  list-style-position: inside;
  padding-left: 1rem;
  margin-top: 2rem;
  margin-bottom: 4rem;
  text-align: left;
}

.high-score {
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}
