*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.menu-page {
  position: relative;
  color: #14301a;
  font-family: "Nunito", sans-serif;
  background: #5faa45;
}

.sky {
  position: absolute;
  inset: 0 0 42% 0;
  background: linear-gradient(180deg, #7ec8e3 0%, #b8e0f0 55%, #d4f0c8 100%);
  z-index: 0;
}

.sun {
  position: absolute;
  top: 10%;
  right: 14%;
  width: min(18vw, 140px);
  height: min(18vw, 140px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6b0, #f0c43a 60%, #e09a20 100%);
  box-shadow: 0 0 60px rgba(240, 196, 58, 0.55);
  animation: sun-drift 12s ease-in-out infinite alternate;
  z-index: 1;
}

.clouds {
  position: absolute;
  inset: 0 0 42% 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.cloud {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 40px;
  filter: blur(0.5px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud::before {
  width: 60%;
  height: 80%;
  top: -40%;
  left: 12%;
}

.cloud::after {
  width: 45%;
  height: 70%;
  top: -30%;
  right: 10%;
}

.c1 {
  width: 120px;
  height: 40px;
  top: 18%;
  left: -10%;
  animation: cloud-drift 38s linear infinite;
}

.c2 {
  width: 160px;
  height: 48px;
  top: 28%;
  left: -20%;
  opacity: 0.75;
  animation: cloud-drift 52s linear infinite;
  animation-delay: -18s;
}

.c3 {
  width: 90px;
  height: 32px;
  top: 12%;
  left: -15%;
  opacity: 0.65;
  animation: cloud-drift 44s linear infinite;
  animation-delay: -30s;
}

.lawn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background:
    radial-gradient(ellipse 120% 40% at 50% 0%, rgba(255, 255, 200, 0.2), transparent 55%),
    repeating-linear-gradient(
      -12deg,
      #4f9a38 0 6px,
      #458c32 6px 12px
    ),
    linear-gradient(180deg, #62b048 0%, #3f8a30 55%, #2f6b24 100%);
  z-index: 0;
}

.lawn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 100%, rgba(40, 70, 20, 0.35), transparent 60%);
  pointer-events: none;
}

.fence {
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: 56%;
  height: 84px;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(40, 70, 20, 0.18));
}

.fence-rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(180deg, #a67a42 0%, #7a5328 55%, #5e3f1e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, 0.25);
}

.fence-rail-back {
  bottom: 46px;
  opacity: 0.95;
}

.fence-rail-front {
  bottom: 18px;
}

.fence-boards {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2px;
  padding: 0 4px;
  z-index: 0;
}

.fence-board {
  position: relative;
  flex: 0 0 auto;
  align-self: flex-end;
  border-radius: 2px 2px 1px 1px;
  box-shadow:
    inset -2px 0 0 rgba(60, 35, 10, 0.22),
    inset 2px 0 0 rgba(255, 230, 180, 0.18),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08);
  transform-origin: bottom center;
  background-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.08) 0%,
    transparent 35%,
    rgba(255, 255, 255, 0.1) var(--grain, 50%),
    transparent 70%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

.fence-board.is-post {
  z-index: 2;
  border-radius: 3px 3px 1px 1px;
  box-shadow:
    inset -3px 0 0 rgba(60, 35, 10, 0.28),
    inset 2px 0 0 rgba(255, 230, 180, 0.16),
    1px 2px 0 rgba(40, 25, 10, 0.2);
}

.fence-board.tip-point {
  clip-path: polygon(0 10%, 50% 0, 100% 10%, 100% 100%, 0 100%);
}

.fence-board.tip-flat {
  border-radius: 2px 2px 1px 1px;
}

.fence-board.tip-worn {
  clip-path: polygon(0 8%, 18% 2%, 40% 9%, 62% 1%, 82% 8%, 100% 3%, 100% 100%, 0 100%);
}

.fence-board .board-grain,
.fence-board .board-knot,
.fence-board .board-nail {
  position: absolute;
  display: block;
  pointer-events: none;
}

.fence-board .board-grain {
  left: 15%;
  right: 15%;
  height: 1px;
  background: rgba(70, 40, 15, 0.35);
  border-radius: 1px;
}

.fence-board .board-knot {
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #6b4420 0%, #3d2410 55%, #2a180a 100%);
  box-shadow: inset 0 0 0 1px rgba(90, 55, 25, 0.45);
}

.fence-board .board-nail {
  left: 50%;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #c0c4c0, #5a5e5a 70%);
  box-shadow: 0 0 0 1px rgba(30, 30, 30, 0.25);
}

.fence-rail-front {
  z-index: 2;
}

.grass-blades {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 10px,
    rgba(30, 80, 25, 0.35) 10px 12px,
    transparent 12px 22px,
    rgba(50, 110, 35, 0.4) 22px 24px
  );
  transform-origin: bottom center;
  animation: grass-sway 3.2s ease-in-out infinite alternate;
  z-index: 2;
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 3;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4vh 24px 30vh;
  max-width: 720px;
  margin: 0 auto;
}

.brand {
  font-family: "Bungee", sans-serif;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1.05;
  color: #f4f7e4;
  text-shadow:
    0 3px 0 #2a5a1e,
    0 8px 24px rgba(20, 40, 10, 0.45);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  animation: rise-in 0.7s ease-out both;
}

.copy-block {
  max-width: 34rem;
  margin-bottom: 18px;
  padding: 14px 18px 16px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(20, 48, 24, 0.72) 0%,
    rgba(18, 40, 20, 0.66) 100%
  );
  border: 2px solid rgba(244, 247, 228, 0.18);
  box-shadow: 0 10px 28px rgba(10, 24, 12, 0.28);
  backdrop-filter: blur(2px);
  animation: rise-in 0.7s ease-out 0.12s both;
}

.headline {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: clamp(1.2rem, 3.2vw, 1.65rem);
  color: #f7ffe8;
  margin-bottom: 8px;
  text-shadow: 0 2px 0 rgba(10, 24, 12, 0.55);
}

.support {
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 700;
  color: #e7f5cf;
  max-width: 28rem;
  line-height: 1.45;
  margin: 0 auto;
  text-shadow: 0 1px 0 rgba(10, 24, 12, 0.45);
}

.name-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  animation: rise-in 0.7s ease-out 0.22s both;
}

.name-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: #f4f7e4;
  text-shadow: 0 1px 2px rgba(10, 24, 12, 0.55);
}

.name-input {
  width: min(260px, 72vw);
  padding: 10px 14px;
  border-radius: 8px;
  border: 3px solid #2a5a1e;
  background: rgba(255, 252, 235, 0.95);
  color: #1a2e1a;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
  outline: none;
  box-shadow: 0 3px 0 #2a5a1e;
}

.name-input:focus {
  background: #fffef6;
  border-color: #1f4a18;
}

.name-error {
  color: #fff4d2;
  background: rgba(120, 30, 20, 0.75);
  border: 1px solid rgba(255, 220, 160, 0.35);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.name-error.hidden {
  display: none;
}

.cta {
  display: inline-block;
  text-decoration: none;
  font-family: "Bungee", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #1a2e1a;
  background: #f0d24a;
  padding: 14px 42px;
  border-radius: 8px;
  border: 3px solid #2a5a1e;
  box-shadow: 0 5px 0 #2a5a1e;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  animation: rise-in 0.7s ease-out 0.32s both, cta-pulse 2.4s ease-in-out 1s infinite;
}

.leaderboard-panel {
  position: absolute;
  top: 14%;
  left: 18px;
  width: min(250px, 28vw);
  z-index: 3;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(20, 48, 24, 0.82) 0%,
    rgba(16, 36, 18, 0.78) 100%
  );
  border: 2px solid rgba(244, 247, 228, 0.16);
  box-shadow: 0 12px 28px rgba(10, 24, 12, 0.3);
  color: #f4f7e4;
  text-align: left;
  animation: rise-in 0.7s ease-out 0.18s both;
}

.lb-title {
  font-family: "Bungee", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  color: #f0d24a;
  text-shadow: 0 2px 0 rgba(20, 40, 10, 0.45);
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 180px;
}

.lb-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 6px;
  align-items: baseline;
  font-size: 0.88rem;
  font-weight: 700;
}

.lb-rank {
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  font-variant-numeric: tabular-nums;
  color: #ffe56a;
}

.lb-note {
  margin-top: 10px;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.7;
  font-weight: 600;
}

.lb-empty {
  font-size: 0.85rem;
  opacity: 0.75;
  font-weight: 700;
  padding: 8px 0;
}

.cta:hover {
  background: #ffe56a;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #2a5a1e;
  animation-play-state: paused;
}

.cta:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #2a5a1e;
}

.burrow {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  width: 180px;
  height: 110px;
  z-index: 2;
  pointer-events: none;
  animation: burrow-in 0.9s ease-out 0.4s both;
}

.mound {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 55px;
  background: radial-gradient(ellipse at 50% 40%, #8b5a2b, #5c3a1e 70%);
  border-radius: 50%;
}

.hole {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 28px;
  background: #1a120c;
  border-radius: 50%;
}

.gopher {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  animation: peek 3.5s ease-in-out infinite;
}

.gopher-body {
  width: 36px;
  height: 28px;
  margin: 0 auto;
  background: #c4a35a;
  border-radius: 18px 18px 10px 10px;
}

.gopher-head {
  width: 34px;
  height: 28px;
  margin: -10px auto 0;
  background: #b8954c;
  border-radius: 50%;
  position: relative;
}

.gopher-head::before,
.gopher-head::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: #1a1a1a;
  border-radius: 50%;
  top: 10px;
  transform-origin: center 55%;
}

.gopher-head::before {
  left: 8px;
}

.gopher-head::after {
  right: 8px;
}

.gopher-head.is-blinking::before,
.gopher-head.is-blinking::after {
  animation: gopher-blink 0.16s ease-in-out;
}

.gopher-head.is-double-blinking::before,
.gopher-head.is-double-blinking::after {
  animation: gopher-double-blink 0.36s ease-in-out;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes burrow-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes sun-drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-18px, 10px);
  }
}

@keyframes cloud-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(120vw);
  }
}

@keyframes grass-sway {
  from {
    transform: skewX(-2deg);
  }
  to {
    transform: skewX(2deg);
  }
}

@keyframes cta-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes peek {
  0%,
  55%,
  100% {
    transform: translateX(-50%) translateY(16px);
  }
  65%,
  85% {
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes gopher-blink {
  0%,
  100% {
    transform: scaleY(1);
  }
  40%,
  60% {
    transform: scaleY(0.08);
    border-radius: 40%;
  }
}

@keyframes gopher-double-blink {
  0%,
  100% {
    transform: scaleY(1);
  }
  12%,
  22% {
    transform: scaleY(0.08);
    border-radius: 40%;
  }
  32% {
    transform: scaleY(1);
  }
  52%,
  62% {
    transform: scaleY(0.08);
    border-radius: 40%;
  }
}

@media (max-width: 900px) {
  .leaderboard-panel {
    position: relative;
    top: auto;
    left: auto;
    width: min(340px, 92vw);
    margin: 12px auto 0;
    z-index: 3;
  }

  .menu-page {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .hero {
    min-height: auto;
    padding: 4vh 16px 22vh;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-bottom: 28vh;
  }

  .burrow {
    transform: translateX(-50%) scale(0.85);
  }

  .sun {
    top: 8%;
    right: 8%;
  }

  .copy-block {
    padding: 12px 14px 14px;
  }
}
