:root {
  color-scheme: light;
  --ink: #27362f;
  --muted: #5f7468;
  --leaf: #7fcf9b;
  --leaf-dark: #2f8067;
  --sun: #ffd66b;
  --basket: #c97937;
  --panel: #ffffff;
  --shadow: 0 12px 28px rgba(35, 80, 62, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #dff6ff 0%, #f9ffe8 62%, #ffe0a6 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  letter-spacing: 0;
  touch-action: manipulation;
  user-select: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
}

.app {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  min-height: 100svh;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.top-bar,
.status-panel,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--leaf-dark);
  font-size: 1rem;
  font-weight: 850;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1;
}

.home-link,
.start-button,
.reset-button {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(47, 128, 103, 0.22);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--panel);
  box-shadow: 0 7px 0 rgba(47, 128, 103, 0.14);
  font-weight: 900;
  text-decoration: none;
}

.start-button {
  background: var(--leaf);
  color: #ffffff;
}

.status-panel {
  min-height: 76px;
  border: 3px solid rgba(47, 128, 103, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.label,
.big-text,
.message {
  margin: 0;
  text-align: center;
  font-weight: 900;
}

.label {
  color: var(--muted);
  font-size: 0.9rem;
}

.big-text {
  min-width: 54px;
  font-size: 2rem;
  line-height: 1;
}

.small-text {
  font-size: 1.6rem;
}

.message {
  flex: 1;
  color: var(--leaf-dark);
  font-size: clamp(1.05rem, 4vw, 1.7rem);
}

.field {
  position: relative;
  overflow: hidden;
  touch-action: none;
  min-height: 420px;
  border: 4px solid rgba(47, 128, 103, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 42%),
    linear-gradient(180deg, #bfeeff 0%, #edffd8 74%, #9dd779 75%);
  box-shadow: var(--shadow);
}

.sun,
.cloud {
  position: absolute;
  pointer-events: none;
}

.sun {
  top: 22px;
  right: 24px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 12px rgba(255, 214, 107, 0.28);
}

.cloud {
  width: 92px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.cloud::before,
.cloud::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 16px;
  top: -18px;
  width: 38px;
  height: 38px;
}

.cloud::after {
  right: 15px;
  top: -12px;
  width: 32px;
  height: 32px;
}

.cloud-one {
  top: 56px;
  left: 28px;
}

.cloud-two {
  top: 116px;
  right: 118px;
  transform: scale(0.82);
}

.fruit {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid rgba(39, 54, 47, 0.12);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 16px rgba(35, 80, 62, 0.16);
  font-size: 2.1rem;
  line-height: 1;
}

.fruit.is-helper {
  background: #f4f0ff;
  border-color: rgba(95, 111, 181, 0.25);
}

.basket {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  width: 124px;
  height: 82px;
  border: 4px solid #8e5428;
  border-top-width: 12px;
  border-radius: 12px 12px 28px 28px;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.2) 18px 24px),
    var(--basket);
  box-shadow: 0 10px 0 rgba(95, 57, 29, 0.22);
  cursor: grab;
  touch-action: none;
  transform: translateX(-50%);
}

.basket-face {
  display: block;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  transform: translateY(-2px);
}

.basket.is-happy {
  animation: pop 180ms ease;
}

.controls {
  justify-content: center;
  flex-wrap: wrap;
}

.sound-button {
  background: #eef1ff;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.settings-panel {
  flex: 1 1 100%;
}

.settings-summary {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(47, 128, 103, 0.22);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 14px;
  box-shadow: 0 7px 0 rgba(47, 128, 103, 0.14);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.chip {
  min-height: 44px;
  border: 3px solid rgba(47, 128, 103, 0.22);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--panel);
  box-shadow: 0 7px 0 rgba(47, 128, 103, 0.14);
  font-weight: 900;
}

.chip.is-active {
  color: #fff;
  background: var(--leaf-dark);
}

@keyframes pop {
  50% {
    transform: translateX(-50%) scale(1.08);
  }
}

@media (max-width: 700px) {
  .app {
    gap: 10px;
    padding: 12px;
  }

  .top-bar {
    align-items: flex-start;
  }

  .home-link {
    min-height: 40px;
    padding: 7px 10px;
  }

  .status-panel {
    display: grid;
    grid-template-columns: repeat(3, auto);
    min-height: 68px;
    padding: 8px;
  }

  .status-panel .message {
    grid-column: 1 / -1;
  }

  .field {
    min-height: 58svh;
  }

  .basket {
    width: 110px;
    height: 74px;
  }

  .fruit {
    width: 52px;
    height: 52px;
    font-size: 1.9rem;
  }

  .start-button,
  .reset-button,
  .settings-summary,
  .chip {
    min-height: 42px;
    padding: 7px 10px;
  }
}
