/* ============================================================
   know bible — color palette & base styles
   Cozy, homemade, brown-cream. All colors live here as
   variables so the whole site (and your drawings) stay in sync.
   Tweak a value here and it updates everywhere.
   ============================================================ */

:root {
  /* Core neutrals — the paper & ink of the site */
  --cream:      #F3EBE1;  /* page background */
  --warm-sand:  #E7D8C3;  /* cards & panels */
  --soft-tan:   #D8C3A5;  /* borders & lines */

  /* Browns — text, headings & buttons */
  --caramel:    #A9805A;  /* accents & hover */
  --coffee:     #6F5138;  /* buttons & headings */
  --espresso:   #4A3728;  /* body text */

  /* Pops from the logo — used sparingly */
  --sunbeam:    #F2C94C;  /* score & highlights */
  --sage:       #7C8C5A;  /* correct answer */
  --ribbon-red: #C0392B;  /* wrong answer */
}

/* ---------- base ---------- */

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

body {
  background: var(--cream);
  color: var(--espresso);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
}

/* ---------- header: logo + title ---------- */

.site-header {
  position: relative;
  margin-bottom: 0.75rem;
}

/* Logo hangs to the left of the title, so the title text itself
   stays at the exact center of the page. */
.logo {
  width: 90px;
  height: auto;
  position: absolute;
  right: 100%;
  margin-right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

h1 {
  color: var(--coffee);
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.tagline {
  color: var(--caramel);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 40ch;
}

/* ---------- difficulty cards ---------- */

.difficulties {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

.difficulty-card {
  background: var(--warm-sand);
  border: 2px solid var(--soft-tan);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  width: 100%;
  max-width: 420px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, border-color 0.15s ease,
              background 0.15s ease;
}

.difficulty-card:hover {
  transform: translateY(-4px);
  border-color: var(--caramel);
  background: #EDDFC9; /* a touch lighter than warm-sand */
}

.difficulty-name {
  color: var(--coffee);
  font-size: 1.5rem;
  font-weight: bold;
}

.difficulty-desc {
  color: var(--espresso);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- buttons (general, for quiz screens later) ---------- */

.btn {
  display: inline-block;
  background: var(--coffee);
  color: var(--cream);
  font-family: inherit;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  padding: 0.8rem 2rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--caramel);
  transform: translateY(-2px);
}

/* ---------- screens ---------- */

.hidden {
  display: none !important;
}

section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ---------- home: count picker + difficulty cards ---------- */

.home-layout {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* The picker hangs off the left edge of the centered card column,
   so the cards themselves stay at the exact center of the page. */
.count-picker {
  position: absolute;
  right: calc(50% + 260px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.count-label {
  color: var(--coffee);
  font-size: 1.05rem;
}

.count-display {
  color: var(--coffee);
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1.2;
}

.vslider-row {
  position: relative;
}

/* The slider is rotated 90° so it runs top-to-bottom (5 → 30).
   The wrapper reserves the vertical space the rotated input needs. */
.vslider-wrap {
  position: relative;
  width: 36px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#count-slider {
  width: 190px;
  transform: rotate(90deg);
  accent-color: var(--coffee);
  cursor: pointer;
}

/* Small lines in the bar marking each stop (5 / 10 / 30) */
.tick {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--caramel);
  pointer-events: none;
}

.tick-top { top: 9px;               transform: translate(-50%, -50%); }
.tick-mid { top: 50%;               transform: translate(-50%, -50%); }
.tick-bot { top: calc(100% - 9px);  transform: translate(-50%, -50%); }

/* Number labels float beside the bar, out of the layout flow,
   so the "Questions" label + count center on the bar itself. */
.vslider-marks {
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--caramel);
  font-size: 0.95rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--caramel);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--coffee);
}

/* ---------- quiz ---------- */

.progress {
  color: var(--caramel);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.quiz-card {
  background: var(--warm-sand);
  border: 2px solid var(--soft-tan);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.question-text {
  color: var(--espresso);
  font-size: 1.3rem;
  line-height: 1.5;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.choice {
  background: var(--cream);
  border: 2px solid var(--soft-tan);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--espresso);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--caramel);
}

.choice:disabled {
  cursor: default;
}

.choice.correct {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--cream);
}

.choice.wrong {
  background: var(--ribbon-red);
  border-color: var(--ribbon-red);
  color: var(--cream);
}

/* ---------- explanation panel ---------- */

.explain {
  background: var(--cream);
  border: 2px solid var(--soft-tan);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.explain-title {
  font-size: 1.1rem;
  font-weight: bold;
}

.explain-title.right {
  color: var(--sage);
}

.explain-title.wrong {
  color: var(--ribbon-red);
}

.explain-body {
  color: var(--espresso);
  font-size: 0.98rem;
  line-height: 1.6;
}

.explain .btn {
  align-self: flex-end;
  margin-top: 0.5rem;
}

/* ---------- results ---------- */

.results-card {
  background: var(--warm-sand);
  border: 2px solid var(--soft-tan);
  border-radius: 16px;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.results-label {
  color: var(--caramel);
  font-size: 1.1rem;
}

.results-score {
  color: var(--coffee);
  font-size: 3.5rem;
  font-weight: bold;
  line-height: 1.2;
  background: var(--sunbeam);
  border-radius: 16px;
  padding: 0.25rem 1.5rem;
}

.results-word {
  color: var(--espresso);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

/* Little handmade footer note */
footer {
  margin-top: auto;
  padding-top: 3rem;
  color: var(--soft-tan);
  font-size: 0.85rem;
}

/* ---------- small screens ---------- */

@media (max-width: 920px) {
  body {
    padding: 1.5rem 1.25rem;
  }

  h1 {
    font-size: 1.7rem;
  }

  .logo {
    width: 60px;
    margin-right: 0.6rem;
  }

  .home-layout {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  /* No room beside the cards — sit above them, and go horizontal:
     a tall slider would push the difficulties below the fold. */
  .count-picker {
    position: static;
    transform: none;
    gap: 0.25rem;
  }

  .count-display {
    font-size: 2rem;
  }

  .vslider-row {
    flex-direction: column;
    gap: 0.35rem;
  }

  .vslider-wrap {
    width: 230px;
    height: auto;
  }

  #count-slider {
    transform: none;
    width: 230px;
  }

  .vslider-marks {
    position: static;
    flex-direction: row;
    height: auto;
    width: 230px;
    justify-content: space-between;
  }

  /* Horizontal bar → vertical tick lines */
  .tick {
    width: 2px;
    height: 14px;
    left: auto;
    top: 50%;
  }

  .tick-top { left: 9px;               top: 50%; }
  .tick-mid { left: 50%;               top: 50%; }
  .tick-bot { left: calc(100% - 9px);  top: 50%; }

  .quiz-card {
    padding: 1.25rem;
  }

  .question-text {
    font-size: 1.15rem;
  }

  .results-card {
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 420px;
  }
}

