/* ---------- Harriet's Word Safari ---------- */

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

:root {
  --green: #2eb872;
  --green-dark: #1f8f57;
  --green-soft: #e3f7ec;
  --orange: #ff8a3d;
  --orange-dark: #e06a1c;
  --orange-soft: #fff0e3;
  --ink: #3b3024;
  --ink-soft: #7a6a55;
  --card: #fffdf7;
}

html, body { height: 100%; }

body {
  font-family: 'Fredoka', 'Comic Sans MS', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #cdeffd 0%, #fdf3d8 55%, #d8f3dc 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen {
  width: 100%;
  max-width: 600px;
  padding: 24px 16px 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hidden { display: none !important; }

.card {
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(80, 60, 20, 0.15);
  padding: 28px 24px;
  width: 100%;
  text-align: center;
}

/* ---------- Start screen ---------- */

.start-card { margin-top: 6vh; }

.start-mascots span {
  font-size: 44px;
  display: inline-block;
  margin: 0 4px;
}

.bob { animation: bob 1.6s ease-in-out infinite; }

/* The hand-drawn capybara (no emoji exists for the world's chillest rodent) */
.capy { display: inline-block; vertical-align: bottom; }
.capy svg { display: block; }
.start-capy svg { width: 88px; height: auto; margin: 0 2px; }
.parade .capy svg { width: 68px; height: auto; }
.mascot svg { width: 92px; height: auto; margin: 0 auto 4px; }
.result-mascots span svg { width: 58px; height: auto; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

h1 {
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  margin: 12px 0 14px;
  background: linear-gradient(90deg, var(--green-dark), var(--orange-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 22px;
}

.word-count {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.big-btn {
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--green-dark), 0 10px 18px rgba(46, 184, 114, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.big-btn:hover { transform: translateY(-2px); }
.big-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--green-dark);
}

/* Walking animal parade along the bottom */
.parade {
  position: fixed;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 64px;
  overflow: hidden;
  pointer-events: none;
}

.parade span {
  position: absolute;
  bottom: 0;
  left: -80px;
  font-size: 46px;
  animation-name: walk;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes walk {
  0%   { transform: translateX(0) scaleX(-1); }
  49%  { transform: translateX(calc(100vw + 90px)) scaleX(-1); }
  50%  { transform: translateX(calc(100vw + 90px)) scaleX(1); }
  100% { transform: translateX(0) scaleX(1); }
}

/* ---------- Quiz screen ---------- */

.progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.progress .paw {
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  border-radius: 50%;
  filter: grayscale(1);
  opacity: 0.35;
  transition: all 0.3s ease;
}

.progress .paw.current { opacity: 0.8; transform: scale(1.15); }

.progress .paw.right {
  filter: none;
  opacity: 1;
  background: var(--green-soft);
  box-shadow: 0 0 0 2px var(--green);
}

.progress .paw.wrong {
  filter: none;
  opacity: 1;
  background: var(--orange-soft);
  box-shadow: 0 0 0 2px var(--orange);
}

.mascot {
  font-size: 58px;
  line-height: 1;
  margin-bottom: 6px;
  display: inline-block;
  animation: bob 2s ease-in-out infinite;
}

.mascot.happy { animation: jump 0.6s ease; }

@keyframes jump {
  0%   { transform: translateY(0) rotate(0); }
  30%  { transform: translateY(-26px) rotate(-12deg); }
  60%  { transform: translateY(0) rotate(8deg); }
  80%  { transform: translateY(-8px) rotate(0); }
  100% { transform: translateY(0); }
}

.prompt {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 10px;
}

.word-box {
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 3px dashed var(--green);
  border-radius: 18px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

.options {
  display: grid;
  gap: 10px;
  text-align: left;
}

.option {
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  border: 2px solid #e8dfd0;
  border-radius: 16px;
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.option .letter {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--green);
}

.option:disabled { cursor: default; }

.option.correct {
  background: var(--green-soft);
  border-color: var(--green);
  animation: pulse 0.5s ease;
}

.option.correct .letter { background: var(--green); color: #fff; }

.option.wrong {
  background: var(--orange-soft);
  border-color: var(--orange);
  animation: shake 0.45s ease;
}

.option.wrong .letter { background: var(--orange); color: #fff; }

.option.faded { opacity: 0.45; }

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.praise {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
  animation: pop 0.4s ease;
}

@keyframes pop {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.feedback {
  margin-top: 18px;
  background: var(--orange-soft);
  border: 2px solid var(--orange);
  border-radius: 18px;
  padding: 16px;
  animation: pop 0.3s ease;
}

.feedback-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--orange-dark);
  margin-bottom: 6px;
}

.feedback-def { font-size: 16px; margin-bottom: 8px; }

.feedback-example {
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 14px;
  line-height: 1.45;
}

.feedback-example strong { color: var(--orange-dark); }

/* ---------- Result screen ---------- */

.result-card { margin-top: 5vh; }

.result-mascots span {
  font-size: 40px;
  display: inline-block;
  margin: 0 3px;
  animation: pop 0.5s ease backwards;
}

h2 {
  font-size: 30px;
  font-weight: 700;
  margin: 10px 0 16px;
  color: var(--green-dark);
}

.score-circle {
  width: 130px;
  height: 130px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(46, 184, 114, 0.4);
  animation: pop 0.5s ease;
}

.score-circle span { font-size: 48px; font-weight: 700; line-height: 1; }
.score-circle small { font-size: 14px; opacity: 0.9; }

.result-message {
  font-size: 19px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.missed {
  text-align: left;
  background: var(--orange-soft);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.missed h3 { font-size: 17px; margin-bottom: 10px; color: var(--orange-dark); }

.missed li {
  list-style: none;
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.4;
}

.missed li strong { color: var(--orange-dark); }
.missed li em { color: var(--ink-soft); display: block; font-size: 14px; }

/* ---------- Confetti ---------- */

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

#confetti span {
  position: absolute;
  top: -50px;
  font-size: 26px;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

@media (max-width: 420px) {
  .card { padding: 22px 16px; }
  .option { font-size: 15.5px; }
}
