:root {
  --cream: #fff7df;
  --ink: #1d3323;
  --green: #2d6c3b;
  --yellow: #f6c94c;
  --orange: #eb8d32;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: Candara, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(rgba(211, 240, 225, 0.66), rgba(218, 235, 163, 0.62)),
    url("bg1.png") center / cover no-repeat fixed;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: 2rem;
  place-items: center;
}

.announcement {
  width: min(650px, 100%);
  padding: clamp(2rem, 6vw, 4.5rem);
  text-align: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.84), rgba(255, 250, 226, 0.8)),
    url("bg2.png") center / cover;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 34px;
  box-shadow: 0 24px 70px rgba(27, 72, 42, 0.22);
  backdrop-filter: blur(7px);
}

.eyebrow {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  margin: 0 0 1.4rem;
  padding: 0.5rem 0.85rem;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #e4f4ce;
  border-radius: 999px;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  background: #50ad48;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(80, 173, 72, 0.6);
  animation: pulse 1.7s infinite;
}

.tractor {
  margin: 0;
  font-size: clamp(3.5rem, 10vw, 5.4rem);
  filter: drop-shadow(0 7px 4px rgba(27, 72, 42, 0.17));
  animation: bounce 2.8s ease-in-out infinite;
}

h1 {
  margin: 0.2rem 0 1rem;
  font-family: Cambria, Georgia, serif;
  font-size: clamp(3.3rem, 11vw, 6.7rem);
  line-height: 0.8;
  letter-spacing: -0.07em;
}

h1 em {
  color: var(--green);
}

.lead {
  max-width: 460px;
  margin: 1.5rem auto 2rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.progress-wrap {
  margin: 0 auto 1.7rem;
  max-width: 450px;
  text-align: left;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 800;
}

.progress-track {
  height: 16px;
  overflow: hidden;
  background: #d8e5c8;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #75b949, var(--yellow));
  border-radius: inherit;
  transition: width 1.5s cubic-bezier(.2, .8, .2, 1);
}

.surprise-button {
  padding: 0.9rem 1.25rem;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--orange);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 5px 0 #b8661f, 0 10px 20px rgba(235, 141, 50, 0.24);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sound-button,
.game-button {
  padding: 0.55rem 0.85rem;
  color: var(--green);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(45, 108, 59, 0.35);
  border-radius: 999px;
  transition: background 0.2s, transform 0.2s;
}

.sound-button {
  margin-left: 0.5rem;
}

.sound-button:hover,
.sound-button:focus-visible,
.game-button:hover,
.game-button:focus-visible {
  background: #e4f4ce;
  transform: translateY(-2px);
}

.surprise-button:hover,
.surprise-button:focus-visible {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 8px 0 #b8661f, 0 15px 25px rgba(235, 141, 50, 0.28);
}

.surprise-button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #b8661f;
}

.hint {
  margin: 1.2rem 0 0;
  font-size: 0.84rem;
  opacity: 0.72;
}

.game {
  max-width: 450px;
  margin: 1.8rem auto 0;
  padding: 1rem;
  text-align: left;
  background: rgba(228, 244, 206, 0.68);
  border: 1px dashed rgba(45, 108, 59, 0.35);
  border-radius: 18px;
}

.game-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.game h2 {
  margin: 0;
  color: var(--green);
  font-size: 1.1rem;
}

.game p {
  margin: 0.2rem 0 0.75rem;
  font-size: 0.84rem;
}

.score {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  background: #fff7df;
  border-radius: 999px;
}

.game-field {
  position: relative;
  height: 110px;
  overflow: hidden;
  margin-bottom: 0.8rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(45, 108, 59, 0.08) 20px 22px);
  border: 2px solid rgba(45, 108, 59, 0.17);
  border-radius: 12px;
}

.chick {
  position: absolute;
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
  animation: chick-pop 0.3s ease-out;
}

.chick:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.game.active .chick {
  display: block;
}

@keyframes chick-pop {
  from { transform: scale(0) rotate(-25deg); }
  to { transform: scale(1) rotate(0); }
}

.animals {
  position: fixed;
  z-index: 2;
  right: 4vw;
  bottom: 2vh;
  display: flex;
  gap: 0.4rem;
  align-items: end;
  pointer-events: none;
}

.animal {
  display: inline-block;
  font-size: clamp(2.5rem, 7vw, 5rem);
  filter: drop-shadow(0 5px 3px rgba(27, 72, 42, 0.2));
  transform-origin: bottom center;
}

.animal-cow { animation: wobble 3s ease-in-out infinite; }
.animal-chicken { animation: hop 2s ease-in-out 0.7s infinite; }
.animal-sheep { animation: wobble 3.5s ease-in-out 1s infinite; }

.toast {
  position: fixed;
  z-index: 3;
  bottom: 2rem;
  left: 50%;
  padding: 0.8rem 1rem;
  color: #fff;
  font-weight: 800;
  background: var(--ink);
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, 1rem);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confetti {
  position: fixed;
  z-index: 4;
  top: -1rem;
  left: 0;
  width: 10px;
  height: 14px;
  pointer-events: none;
  animation: fall 2.8s linear forwards;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 0.45rem rgba(80, 173, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(80, 173, 72, 0); }
}

@keyframes bounce {
  50% { transform: translateY(-10px) rotate(-4deg); }
}

@keyframes wobble {
  50% { transform: rotate(4deg); }
}

@keyframes hop {
  45% { transform: translateY(-14px); }
  55% { transform: translateY(0); }
}

@keyframes fall {
  to { transform: translate(var(--drift), 110vh) rotate(720deg); }
}

@media (max-width: 600px) {
  .page-shell { padding: 1rem; }
  .announcement { padding: 2.2rem 1.25rem; border-radius: 25px; }
  .animals { right: 0.75rem; }
  .sound-button { margin: 0.8rem 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
