:root {
  color-scheme: light;
  font-family:
    Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  background: #9bdcff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body {
  min-height: 100svh;
}

.farm-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, #88d9ff 0%, #ddf7ff 48%, #d4b06e 49%, #7b4c27 100%);
}

#farm-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.back-button,
.home-link {
  position: fixed;
  z-index: 4;
  display: grid;
  place-items: center;
  color: #17415c;
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0.55rem 1.6rem rgba(65, 50, 25, 0.16);
  backdrop-filter: blur(14px);
}

.back-button {
  top: max(0.75rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
}

.back-button[hidden] {
  display: none;
}

.back-button span {
  display: block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  border-bottom: 0.3rem solid currentColor;
  border-left: 0.3rem solid currentColor;
  transform: rotate(45deg);
}

.home-link {
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  min-width: 4.6rem;
  min-height: 3.25rem;
  padding: 0 1rem;
  color: #17415c;
  font-weight: 900;
  text-decoration: none;
  border-radius: 999px;
}

.farm-menu {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
  min-height: 100svh;
  padding: max(1rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 3rem)
    max(1rem, env(safe-area-inset-bottom));
}

.farm-menu[hidden] {
  display: none;
}

.farm-menu p {
  width: min(50rem, 100%);
  margin: 0 auto;
  color: #17415c;
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 950;
  text-shadow: 0 0.15rem 0 rgba(255, 255, 255, 0.74);
}

.farm-menu__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.85rem, 2.5vw, 1.3rem);
  width: min(50rem, 100%);
  margin: 0 auto;
}

.farm-menu__grid button {
  display: grid;
  min-height: clamp(7rem, 22svh, 11rem);
  padding: 1rem;
  color: #17415c;
  font: inherit;
  font-size: clamp(1.25rem, 4vw, 2.25rem);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.52)),
    #f5c25b;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 0.5rem;
  box-shadow: 0 0.7rem 1.8rem rgba(65, 50, 25, 0.16);
}

.farm-menu__grid button:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.52)),
    #ead16d;
}

.farm-menu__grid span {
  align-self: center;
}

.back-button:active,
.home-link:active,
.farm-menu__grid button:active {
  transform: scale(0.97);
}

@media (max-width: 42rem) {
  .farm-menu {
    justify-content: flex-start;
    padding-top: max(5.2rem, env(safe-area-inset-top));
  }

  .farm-menu__grid {
    grid-template-columns: 1fr;
  }

  .farm-menu__grid button {
    min-height: 6.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-button:active,
  .home-link:active,
  .farm-menu__grid button:active {
    transform: none;
  }
}
