:root {
  --leaf: #4f9b60;
  --leaf-dark: #2f6f49;
  --leaf-soft: #9bd983;
  --tomato: #e55343;
  --sky: #d7f1f7;
  --sky-deep: #9bd5e0;
  --cream: #fff8e8;
  --cream-strong: #fff0bc;
  --soil: #76533f;
  --soil-dry: #b9895f;
  --wood: #926345;
  --wood-dark: #624130;
  --ink: #20352c;
  --muted: #64766e;
  --line: rgba(32, 53, 44, 0.18);
  --panel: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 46px rgba(34, 63, 47, 0.17);
  --ui-font:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 16px;
  line-height: 1.45;
  background:
    linear-gradient(180deg, #f4fbff 0%, #e8f5ed 48%, #f9f0d9 100%);
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button {
  touch-action: manipulation;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app {
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.title-screen,
.game-screen {
  width: min(1220px, calc(100vw - 28px));
  margin: 0 auto;
}

.title-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(310px, 0.92fr) minmax(360px, 1fr);
  gap: 34px;
  align-items: center;
  padding: 34px 0;
}

.title-copy {
  max-width: 610px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--leaf-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.28rem, 2vw, 1.8rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.title-copy > p:not(.eyebrow) {
  max-width: 570px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.setup-panel,
.side-panel,
.control-panel,
.top-bar {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(34, 63, 47, 0.1);
  backdrop-filter: blur(10px);
}

.setup-panel {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 16px;
}

.setup-field {
  display: grid;
  gap: 9px;
}

.setup-field label,
.field-label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  outline: 0;
}

input {
  padding: 0 12px;
}

select {
  padding: 0 34px 0 12px;
}

input:focus,
select:focus {
  border-color: rgba(50, 122, 77, 0.62);
  box-shadow: 0 0 0 3px rgba(80, 155, 96, 0.18);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.character-card {
  display: grid;
  min-height: 112px;
  justify-items: center;
  gap: 4px;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  text-align: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.character-card strong {
  font-size: 0.9rem;
}

.character-card span:last-child {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.character-card.selected {
  border-color: rgba(50, 122, 77, 0.74);
  background: #ecf7df;
  box-shadow: 0 8px 18px rgba(50, 122, 77, 0.16);
}

.avatar-preview {
  --avatar-body: #4f9b60;
  --avatar-apron: #fff0bc;
  --avatar-hair: #654233;
  position: relative;
  display: inline-block;
  width: 42px;
  height: 54px;
}

.avatar-preview::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f0b98c;
  box-shadow:
    0 -6px 0 -1px var(--avatar-hair),
    0 2px 0 10px transparent;
}

.avatar-preview::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 3px;
  width: 26px;
  height: 27px;
  border-radius: 10px 10px 7px 7px;
  background:
    linear-gradient(90deg, transparent 28%, var(--avatar-apron) 28% 72%, transparent 72%),
    var(--avatar-body);
}

.character-male {
  --avatar-body: #477f6d;
  --avatar-apron: #fff0bc;
  --avatar-hair: #59402f;
}

.character-female {
  --avatar-body: #b85670;
  --avatar-apron: #ffe6b8;
  --avatar-hair: #3f2e2c;
}

.character-neutral {
  --avatar-body: #566f9f;
  --avatar-apron: #f5e48f;
  --avatar-hair: #4f4a3b;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 6px;
  width: min(100%, 310px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.segmented-control button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 850;
}

.segmented-control button.selected {
  border-color: rgba(50, 122, 77, 0.36);
  background: #dff2d6;
  color: var(--leaf-dark);
}

.language-switch {
  width: min(100%, 270px);
}

.mini-language-switch {
  width: auto;
  grid-template-columns: repeat(2, 42px);
  padding: 4px;
}

.mini-language-switch button {
  min-height: 28px;
  font-size: 0.76rem;
}

.schedule-builder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.schedule-builder label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.title-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.primary-button,
.secondary-button,
.icon-panel-button,
.tool-button {
  border: 0;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  color: white;
  background: #327a4d;
  box-shadow: 0 8px 18px rgba(50, 122, 77, 0.24);
  font-weight: 850;
}

.secondary-button,
.icon-panel-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.compact-button {
  width: fit-content;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.lobby-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--leaf-dark);
  text-decoration: none;
}

.game-lobby-link {
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.84rem;
  line-height: 1.15;
}

.game-lobby-link > span:first-child {
  font-size: 1.08rem;
  line-height: 1;
}

.primary-button:hover,
.secondary-button:hover,
.icon-panel-button:hover,
.tool-button:hover,
.character-card:hover {
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.icon-panel-button:focus-visible,
.tool-button:focus-visible,
.character-card:focus-visible,
.segmented-control button:focus-visible,
.zone:focus-visible {
  outline: 3px solid rgba(229, 83, 67, 0.4);
  outline-offset: 3px;
}

.title-garden {
  position: relative;
  min-height: 590px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.36), transparent 44%),
    linear-gradient(to bottom, var(--sky) 0%, #e9f5e6 58%, #7ebf69 58%, #65aa57 100%);
  box-shadow: var(--shadow);
}

.title-sun {
  position: absolute;
  top: 48px;
  right: 78px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: #ffd56b;
  box-shadow: 0 0 60px rgba(255, 213, 107, 0.58);
}

.title-cloud {
  position: absolute;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

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

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

.title-cloud::after {
  right: 20px;
  width: 48px;
  height: 48px;
}

.title-cloud-one {
  left: 72px;
  top: 95px;
  width: 145px;
}

.title-cloud-two {
  right: 122px;
  top: 185px;
  width: 110px;
  opacity: 0.72;
}

.title-bed {
  position: absolute;
  left: 50%;
  bottom: 80px;
  width: min(78%, 520px);
  height: 150px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--soil);
  box-shadow:
    inset 0 16px 0 rgba(255, 255, 255, 0.08),
    0 18px 24px rgba(38, 64, 46, 0.16);
}

.crop-token {
  position: absolute;
  bottom: 72px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--tomato);
  box-shadow: inset 9px -8px 0 rgba(0, 0, 0, 0.08);
}

.crop-token::before {
  content: "";
  position: absolute;
  left: 17px;
  top: -46px;
  width: 9px;
  height: 54px;
  border-radius: 999px;
  background: var(--leaf-dark);
}

.crop-token::after {
  content: "";
  position: absolute;
  left: -2px;
  top: -30px;
  width: 34px;
  height: 19px;
  border-radius: 60% 8px 60% 8px;
  background: var(--leaf);
  transform: rotate(-20deg);
}

.token-tomato {
  left: 18%;
  background: #e55343;
}

.token-carrot {
  left: 34%;
  width: 26px;
  height: 58px;
  border-radius: 18px 18px 22px 22px;
  background: #f08c2f;
}

.token-strawberry {
  left: 50%;
  width: 38px;
  height: 48px;
  border-radius: 58% 58% 70% 70%;
  background: #d94d5f;
}

.token-pumpkin {
  right: 25%;
  width: 62px;
  height: 48px;
  border-radius: 48%;
  background: #e7902c;
}

.token-lettuce {
  right: 10%;
  width: 58px;
  height: 40px;
  border-radius: 50% 50% 44% 44%;
  background: #9fd66e;
}

.title-path {
  position: absolute;
  left: 50%;
  bottom: -70px;
  width: 500px;
  height: 180px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(255, 248, 232, 0.78);
}

.game-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px 18px;
}

.top-bar h2 {
  margin: 0;
}

.top-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  text-align: right;
}

.crop-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(50, 122, 77, 0.22);
  border-radius: 999px;
  background: #ecf7df;
  color: var(--leaf-dark);
  font-weight: 900;
}

.top-hint {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.garden {
  position: relative;
  min-height: clamp(420px, calc(100vh - 262px), 590px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.24), transparent 45%),
    linear-gradient(to bottom, var(--sky) 0%, var(--sky-deep) 42%, #9bd77c 42%, #6fb45d 100%);
  box-shadow: var(--shadow);
  touch-action: manipulation;
}

.garden.day-noon {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(to bottom, #c9f4f4 0%, #9edee1 42%, #9bd77c 42%, #6fb45d 100%);
}

.garden.day-afternoon {
  background:
    linear-gradient(to bottom, rgba(255, 225, 154, 0.24), transparent 50%),
    linear-gradient(to bottom, #f7dca9 0%, #d8dfb0 43%, #92c96d 43%, #68ab59 100%);
}

.garden.day-evening {
  background:
    linear-gradient(to bottom, rgba(255, 215, 147, 0.2), transparent 47%),
    linear-gradient(to bottom, #f0c58b 0%, #cda876 43%, #7eb66c 43%, #5b9a54 100%);
}

.sky-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.38), transparent 38%),
    linear-gradient(240deg, rgba(255, 241, 184, 0.26), transparent 46%);
}

.fence {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  display: flex;
  justify-content: space-around;
  height: 78px;
  opacity: 0.78;
}

.fence::before,
.fence::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.88);
}

.fence::before {
  top: 17px;
}

.fence::after {
  bottom: 13px;
}

.fence span {
  width: 22px;
  height: 72px;
  border-radius: 7px 7px 4px 4px;
  background: rgba(255, 248, 232, 0.96);
}

.garden-sign {
  position: absolute;
  left: 47%;
  top: 50%;
  max-width: 140px;
  padding: 5px 9px;
  transform: rotate(-3deg);
  border: 2px solid var(--wood-dark);
  border-radius: 4px;
  background: var(--cream-strong);
  color: var(--wood-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.zone {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.zone-label {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  white-space: nowrap;
  color: rgba(32, 53, 44, 0.78);
  font-size: 0.78rem;
  font-weight: 850;
}

.water-zone {
  left: 10%;
  bottom: 21%;
  width: 128px;
  height: 148px;
}

.barrel {
  position: absolute;
  inset: 25px 20px 8px;
  border-radius: 20px 20px 16px 16px;
  background: linear-gradient(90deg, #7e5747, #9d6f55 45%, #725042);
  box-shadow:
    inset 12px 0 0 rgba(255, 255, 255, 0.08),
    0 10px 16px rgba(38, 64, 46, 0.12);
}

.barrel::before,
.barrel::after,
.barrel-band {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  height: 9px;
  border-radius: 999px;
  background: #5e766f;
}

.barrel::before {
  top: 22px;
}

.barrel::after {
  bottom: 22px;
}

.barrel-band {
  top: 54px;
}

.water-line {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 12px;
  height: 15px;
  border-radius: 50%;
  background: #7cced2;
}

.tomato-zone {
  left: 50%;
  bottom: 16%;
  width: 280px;
  height: 265px;
  transform: translateX(-50%);
}

.soil {
  position: absolute;
  left: 28px;
  bottom: 0;
  width: 224px;
  height: 82px;
  border-radius: 50%;
  background: var(--soil);
  box-shadow:
    inset 0 13px 0 rgba(255, 255, 255, 0.08),
    0 12px 22px rgba(37, 57, 43, 0.12);
  transition:
    background 220ms ease,
    filter 220ms ease;
}

.soil.dry {
  background: var(--soil-dry);
}

.soil.wet {
  background: #604b3d;
}

.soil.fed {
  filter: saturate(1.18) brightness(1.04);
}

.soil.wet::after {
  content: "";
  position: absolute;
  left: 62px;
  top: 22px;
  width: 48px;
  height: 14px;
  border-radius: 50%;
  background: rgba(105, 190, 198, 0.45);
}

.crack {
  position: absolute;
  width: 34px;
  height: 3px;
  border-radius: 99px;
  background: rgba(87, 61, 49, 0.48);
}

.soil:not(.dry) .crack {
  display: none;
}

.crack-one {
  left: 58px;
  top: 27px;
  transform: rotate(16deg);
}

.crack-two {
  right: 46px;
  top: 42px;
  transform: rotate(-21deg);
}

.plant {
  --crop-fruit: #e55343;
  --crop-unripe: #69b565;
  --crop-leaf: #4f9b60;
  --crop-leaf-dark: #317847;
  position: absolute;
  left: 50%;
  bottom: 47px;
  width: 142px;
  height: 182px;
  transform: translateX(-50%);
  transform-origin: bottom center;
  transition:
    filter 250ms ease,
    transform 250ms ease;
}

.plant.grow-pulse {
  animation: growPulse 900ms ease both;
}

.plant.wilted {
  filter: saturate(0.55) brightness(0.86);
  transform: translateX(-50%) rotate(1deg);
}

.seed-marker {
  position: absolute;
  left: 37px;
  bottom: 17px;
  z-index: 2;
  display: inline-flex;
  min-width: 74px;
  justify-content: center;
  padding: 5px 7px;
  transform: rotate(-4deg);
  border: 2px solid var(--wood-dark);
  border-radius: 4px;
  background: var(--cream-strong);
  color: var(--wood-dark);
  font-size: 0.68rem;
  font-weight: 900;
}

.seed-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 4px;
  height: 24px;
  transform: translateX(-50%);
  background: var(--wood-dark);
}

.stem,
.leaf,
.fruit {
  position: absolute;
  opacity: 0;
  transition:
    opacity 260ms ease,
    transform 260ms ease,
    background 260ms ease,
    width 260ms ease,
    height 260ms ease;
}

.stem {
  left: 66px;
  bottom: 14px;
  width: 10px;
  height: 132px;
  border-radius: 999px;
  background: var(--crop-leaf-dark);
}

.leaf {
  width: 58px;
  height: 32px;
  border-radius: 60% 8px 60% 8px;
  background: var(--crop-leaf);
  transform-origin: right center;
}

.leaf-left {
  left: 14px;
  bottom: 82px;
  transform: rotate(-22deg);
}

.leaf-right {
  right: 10px;
  bottom: 102px;
  transform: scaleX(-1) rotate(-20deg);
}

.leaf-low {
  left: 44px;
  bottom: 56px;
  width: 50px;
  height: 27px;
  transform: rotate(14deg);
}

.fruit {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--crop-unripe);
  box-shadow: inset 9px -8px 0 rgba(0, 0, 0, 0.08);
}

.fruit::before {
  content: "";
  position: absolute;
  left: 11px;
  top: -5px;
  width: 16px;
  height: 9px;
  border-radius: 50% 50% 4px 4px;
  background: var(--crop-leaf-dark);
}

.fruit-one {
  left: 35px;
  bottom: 116px;
}

.fruit-two {
  right: 24px;
  bottom: 84px;
}

.stage-seed .seed-marker {
  opacity: 1;
}

.stage-sprout .seed-marker,
.stage-leaf .seed-marker,
.stage-fruit .seed-marker,
.stage-ripe .seed-marker {
  opacity: 0;
}

.stage-sprout .stem {
  height: 75px;
  opacity: 1;
}

.stage-sprout .leaf-left,
.stage-sprout .leaf-right {
  opacity: 1;
  transform: scale(0.66) rotate(-18deg);
}

.stage-sprout .leaf-right {
  transform: scale(0.66) scaleX(-1) rotate(-18deg);
}

.stage-leaf .stem,
.stage-leaf .leaf,
.stage-fruit .stem,
.stage-fruit .leaf,
.stage-ripe .stem,
.stage-ripe .leaf,
.stage-fruit .fruit,
.stage-ripe .fruit {
  opacity: 1;
}

.stage-ripe .fruit {
  background: var(--crop-fruit);
}

.plant[data-crop="lettuce"] .stem {
  height: 76px;
}

.plant[data-crop="lettuce"] .fruit {
  left: 39px;
  bottom: 58px;
  width: 68px;
  height: 52px;
  border-radius: 50% 50% 44% 44%;
  background: var(--crop-fruit);
}

.plant[data-crop="lettuce"] .fruit-two {
  display: none;
}

.plant[data-crop="carrot"] .fruit {
  bottom: 18px;
  width: 28px;
  height: 76px;
  border-radius: 22px 22px 34px 34px;
  transform: rotate(7deg);
}

.plant[data-crop="carrot"] .fruit-one {
  left: 45px;
}

.plant[data-crop="carrot"] .fruit-two {
  right: 39px;
  transform: rotate(-8deg);
}

.plant[data-crop="strawberry"] .fruit {
  width: 30px;
  height: 38px;
  border-radius: 58% 58% 70% 70%;
}

.plant[data-crop="pumpkin"] .fruit {
  bottom: 38px;
  width: 66px;
  height: 52px;
  border-radius: 48%;
}

.plant[data-crop="pumpkin"] .fruit-one {
  left: 12px;
}

.plant[data-crop="pumpkin"] .fruit-two {
  right: 4px;
}

.plant[data-crop="pepper"] .fruit,
.plant[data-crop="cucumber"] .fruit {
  width: 30px;
  height: 58px;
  border-radius: 16px 16px 22px 22px;
}

.plant[data-crop="cucumber"] .fruit {
  width: 28px;
  height: 66px;
  border-radius: 999px;
  transform: rotate(-24deg);
}

.plant.wilted .leaf-left {
  transform: rotate(-55deg) translateY(12px);
}

.plant.wilted .leaf-right {
  transform: scaleX(-1) rotate(-55deg) translateY(12px);
}

.bugs,
.rodents {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.show-bugs .bugs,
.show-rodents .rodents {
  opacity: 1;
}

.bug {
  position: absolute;
  width: 14px;
  height: 12px;
  border-radius: 50%;
  background: #293a32;
  box-shadow:
    -5px 1px 0 -2px #293a32,
    5px 1px 0 -2px #293a32;
  animation: bugWiggle 900ms infinite ease-in-out alternate;
}

.bug::before,
.bug::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 7px;
  height: 7px;
  border-top: 1px solid #293a32;
  border-radius: 50%;
}

.bug::before {
  left: 0;
  transform: rotate(-28deg);
}

.bug::after {
  right: 0;
  transform: rotate(28deg);
}

.bug-one {
  left: 31px;
  bottom: 106px;
}

.bug-two {
  right: 29px;
  bottom: 126px;
  animation-delay: 300ms;
}

.bugs.fly-away .bug-one {
  animation: flyBugOne 820ms ease forwards;
}

.bugs.fly-away .bug-two {
  animation: flyBugTwo 820ms ease forwards;
}

.rodent {
  position: absolute;
  right: 20px;
  bottom: 25px;
  width: 42px;
  height: 22px;
  border-radius: 60% 50% 40% 60%;
  background: #7d7168;
  box-shadow: inset -8px -3px 0 rgba(0, 0, 0, 0.1);
  animation: rodentPeek 1200ms ease-in-out infinite alternate;
}

.rodent::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7d7168;
}

.rodent::after {
  content: "";
  position: absolute;
  right: -15px;
  top: 12px;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: #7d7168;
  transform: rotate(18deg);
}

.rodents.scurry-away .rodent {
  animation: scurryAway 760ms ease forwards;
}

.condition-chip {
  position: absolute;
  left: 50%;
  top: 8px;
  display: inline-flex;
  max-width: 230px;
  transform: translateX(-50%);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--leaf-dark);
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.25;
  box-shadow: 0 8px 18px rgba(43, 79, 56, 0.1);
}

.tool-shelf {
  position: absolute;
  right: 9%;
  bottom: 20%;
  width: 150px;
  height: 166px;
}

.shelf-top {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 42px;
  height: 12px;
  border-radius: 4px;
  background: var(--wood-dark);
}

.shelf-body {
  position: absolute;
  left: 25px;
  right: 25px;
  top: 54px;
  height: 70px;
  border-radius: 5px;
  background: var(--wood);
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.08);
}

.shelf-body span {
  position: absolute;
  top: 12px;
  width: 8px;
  height: 45px;
  border-radius: 999px;
  background: var(--cream-strong);
}

.shelf-body span:nth-child(1) {
  left: 22px;
  transform: rotate(-10deg);
}

.shelf-body span:nth-child(2) {
  left: 46px;
}

.shelf-body span:nth-child(3) {
  right: 21px;
  transform: rotate(12deg);
}

.basket {
  position: absolute;
  left: 37px;
  bottom: 8px;
  width: 76px;
  height: 42px;
  border-radius: 6px 6px 20px 20px;
  background: #b87952;
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.1);
}

.basket::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: -24px;
  height: 42px;
  border: 6px solid #8a5d44;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.flowers {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 10%;
  height: 48px;
  pointer-events: none;
}

.flowers span {
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 28px;
  border-radius: 999px;
  background: var(--leaf-dark);
}

.flowers span::before {
  content: "";
  position: absolute;
  left: -8px;
  top: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f5d36b;
  box-shadow:
    12px 0 0 -4px #f18c78,
    -10px 3px 0 -5px #b96ea4,
    4px -8px 0 -5px #f18c78;
}

.flowers span:nth-child(1) {
  left: 23%;
}

.flowers span:nth-child(2) {
  left: 31%;
  height: 22px;
}

.flowers span:nth-child(3) {
  right: 28%;
}

.flowers span:nth-child(4) {
  right: 20%;
  height: 22px;
}

.stepping-stones {
  position: absolute;
  left: 23%;
  right: 24%;
  bottom: 5%;
  height: 68px;
  pointer-events: none;
}

.stepping-stones span {
  position: absolute;
  width: 70px;
  height: 30px;
  border-radius: 50%;
  background: rgba(232, 241, 219, 0.82);
}

.stepping-stones span:nth-child(1) {
  left: 5%;
  bottom: 14px;
}

.stepping-stones span:nth-child(2) {
  left: 43%;
  bottom: 2px;
}

.stepping-stones span:nth-child(3) {
  right: 6%;
  bottom: 18px;
}

.player {
  --x: 48%;
  --y: 69%;
  --shirt: var(--avatar-body);
  --apron-color: var(--avatar-apron);
  --hair-color: var(--avatar-hair);
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 10;
  width: 56px;
  height: 104px;
  transform: translate(-50%, -100%);
  transition: filter 200ms ease;
  pointer-events: none;
}

.player.walk .leg-left {
  animation: stepLeft 360ms ease-in-out infinite alternate;
}

.player.walk .leg-right {
  animation: stepRight 360ms ease-in-out infinite alternate;
}

.player.use .arm-right {
  animation: useArm 520ms ease;
}

.player.happy {
  animation: happyHop 620ms ease;
}

.player.worried {
  filter: saturate(0.78);
}

.hat,
.hair,
.head,
.body,
.apron,
.arm,
.leg,
.held-tool {
  position: absolute;
}

.hat {
  left: 10px;
  top: 4px;
  width: 38px;
  height: 14px;
  border-radius: 50% 50% 8px 8px;
  background: #f1d37c;
}

.hat::before {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  bottom: -5px;
  height: 8px;
  border-radius: 50%;
  background: #dcb965;
}

.hair {
  left: 12px;
  top: 15px;
  width: 34px;
  height: 25px;
  border-radius: 48% 48% 42% 42%;
  background: var(--hair-color);
}

.character-female .hair {
  left: 8px;
  width: 42px;
  height: 35px;
}

.character-neutral .hat {
  background: #98b8d9;
}

.head {
  left: 13px;
  top: 20px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #f2bc8e;
  box-shadow: inset 8px -4px 0 rgba(0, 0, 0, 0.04);
}

.head::before,
.head::after {
  content: "";
  position: absolute;
  top: 13px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1f2924;
}

.head::before {
  left: 8px;
}

.head::after {
  right: 8px;
}

.body {
  left: 12px;
  top: 53px;
  width: 34px;
  height: 37px;
  border-radius: 12px 12px 8px 8px;
  background: var(--shirt);
}

.apron {
  left: 18px;
  top: 58px;
  width: 22px;
  height: 34px;
  border-radius: 7px;
  background: var(--apron-color);
}

.arm {
  top: 58px;
  width: 9px;
  height: 28px;
  border-radius: 999px;
  background: #f2bc8e;
  transform-origin: top center;
}

.arm-left {
  left: 7px;
  transform: rotate(18deg);
}

.arm-right {
  right: 8px;
  transform: rotate(-18deg);
}

.leg {
  top: 87px;
  width: 10px;
  height: 23px;
  border-radius: 999px;
  background: #405f65;
  transform-origin: top center;
}

.leg-left {
  left: 18px;
}

.leg-right {
  right: 17px;
}

.held-tool {
  right: 1px;
  top: 70px;
  width: 24px;
  height: 6px;
  border-radius: 999px;
  background: var(--wood-dark);
  transform: rotate(-25deg);
  opacity: 0;
}

.held-tool::after {
  content: "";
  position: absolute;
  right: -7px;
  top: -4px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  background: #5fbfd1;
}

.held-tool[data-tool="sun"]::after {
  border-radius: 50%;
  background: #ffd56b;
}

.held-tool[data-tool="fertilizer"]::after {
  background: #8f6c4d;
}

.held-tool[data-tool="bugs"]::after,
.held-tool[data-tool="rodents"]::after {
  background: #dfe9e5;
  border: 2px solid #5e766f;
}

.held-tool[data-tool="harvest"]::after {
  background: #b87952;
}

.player.use .held-tool {
  opacity: 1;
}

.sparkles {
  position: absolute;
  left: 50%;
  bottom: 42%;
  z-index: 12;
  width: 150px;
  height: 110px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
}

.sparkles.show {
  opacity: 1;
}

.sparkles::before,
.sparkles::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff2a8;
  box-shadow:
    30px 18px 0 -2px #fff2a8,
    74px -8px 0 -4px #dff2d6,
    102px 28px 0 -3px #ffd7ab;
  animation: sparkleFloat 850ms ease both;
}

.sparkles::after {
  left: 22px;
  top: 42px;
  animation-delay: 120ms;
}

.progress-bubble {
  position: absolute;
  left: 50%;
  bottom: 58%;
  z-index: 14;
  transform: translateX(-50%);
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--leaf-dark);
  font-size: 0.86rem;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(43, 79, 56, 0.12);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.gardener-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.gardener-card span:not(.avatar-preview) {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.gardener-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.icon-panel-button {
  width: 100%;
  text-align: left;
}

.crop-panel,
.stress-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.panel-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crop-panel strong {
  display: block;
  margin-top: 2px;
  font-size: 1.08rem;
}

.crop-panel p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.need-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.need-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef5f6;
  color: #365c5d;
  font-size: 0.72rem;
  font-weight: 850;
}

.stress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 850;
}

.stress-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 999px;
  background: #dff2d6;
  color: var(--leaf-dark);
  font-size: 0.82rem;
}

.stress-track {
  height: 10px;
  margin: 12px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8d9;
}

.stress-fill {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: var(--leaf);
  transition:
    width 180ms ease,
    background 180ms ease;
}

.stress-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(230px, 0.88fr) minmax(520px, 1.5fr) 160px;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.objective-row p {
  margin: 0;
}

#objectiveText {
  font-size: 1rem;
  font-weight: 900;
}

#thoughtText {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.tools {
  display: grid;
  grid-template-columns: repeat(7, minmax(62px, 1fr));
  gap: 8px;
}

.tool-button {
  position: relative;
  min-height: 78px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

.tool-button.selected {
  z-index: 1;
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(50, 122, 77, 0.75);
  box-shadow: 0 8px 18px rgba(50, 122, 77, 0.18);
}

.tool-icon {
  position: relative;
  display: block;
  width: 36px;
  height: 34px;
  margin: 0 auto 5px;
}

.tool-label {
  display: block;
  font-size: 0.72rem;
  line-height: 1.15;
}

.inspect-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 20px;
  height: 20px;
  border: 4px solid #446f68;
  border-radius: 50%;
}

.inspect-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 5px;
  border-radius: 999px;
  background: #446f68;
  transform: rotate(42deg);
}

.water-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  width: 23px;
  height: 19px;
  border: 4px solid #47777e;
  border-top: 0;
  border-radius: 4px 4px 12px 12px;
}

.water-icon::after {
  content: "";
  position: absolute;
  right: 0;
  top: 7px;
  width: 15px;
  height: 9px;
  border: 4px solid #47777e;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.water-badge {
  position: absolute;
  right: 2px;
  bottom: 0;
  width: 11px;
  height: 15px;
  border-radius: 60% 60% 60% 6px;
  background: #5fbfd1;
  transform: rotate(42deg);
}

.sun-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffd56b;
  box-shadow:
    0 -9px 0 -5px #d99a2e,
    0 9px 0 -5px #d99a2e,
    9px 0 0 -5px #d99a2e,
    -9px 0 0 -5px #d99a2e,
    7px 7px 0 -6px #d99a2e,
    -7px -7px 0 -6px #d99a2e,
    7px -7px 0 -6px #d99a2e,
    -7px 7px 0 -6px #d99a2e;
}

.fertilizer-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 4px;
  width: 22px;
  height: 24px;
  border-radius: 6px 6px 9px 9px;
  background: #8f6c4d;
  box-shadow: inset 0 7px 0 rgba(255, 255, 255, 0.18);
}

.fertilizer-icon::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dff2d6;
}

.bug-icon::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 16px;
  height: 14px;
  border-radius: 50%;
  background: #293a32;
  box-shadow:
    -7px 3px 0 -4px #293a32,
    7px 3px 0 -4px #293a32;
}

.bug-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 22px;
  height: 28px;
  border-top: 3px solid #293a32;
  border-radius: 50%;
}

.rodent-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 13px;
  width: 24px;
  height: 15px;
  border-radius: 60% 50% 40% 60%;
  background: #7d7168;
}

.rodent-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #7d7168;
  box-shadow: 17px 11px 0 -4px #7d7168;
}

.basket-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 3px;
  width: 26px;
  height: 18px;
  border-radius: 4px 4px 11px 11px;
  background: #a36b4b;
}

.basket-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 2px;
  width: 16px;
  height: 19px;
  border: 4px solid #7a513f;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.use-area {
  display: grid;
  gap: 7px;
}

.use-area .primary-button {
  width: 100%;
}

#distanceHint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.modal {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(32, 53, 44, 0.28);
}

.modal::backdrop {
  background: rgba(32, 53, 44, 0.38);
  backdrop-filter: blur(4px);
}

.modal form,
.modal > div {
  padding: 22px;
}

.modal p {
  color: var(--muted);
  line-height: 1.6;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-head h2,
.modal-head p {
  margin-bottom: 0;
}

.journal-modal {
  width: min(980px, calc(100vw - 28px));
}

.journal-modal form {
  max-height: min(82vh, 760px);
  overflow: auto;
}

.journal-content {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
}

.journal-card,
.crop-guide-card,
.note-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf3;
}

.journal-card {
  padding: 14px;
}

.journal-card h3,
.crop-guide-card h3,
.note-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.journal-card p,
.crop-guide-card p,
.note-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.cycle-list,
.note-list,
.crop-guide-grid {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cycle-list li,
.note-card {
  padding: 12px;
}

.cycle-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.cycle-list strong,
.cycle-list span {
  display: block;
}

.cycle-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.journal-main {
  display: grid;
  gap: 14px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.crop-guide-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crop-guide-card {
  padding: 12px;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.guide-meta span {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef5f6;
  color: #365c5d;
  font-size: 0.72rem;
  font-weight: 850;
}

.result-label {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #dff2d6;
  color: var(--leaf-dark);
  font-weight: 900;
}

.next-garden {
  font-weight: 850;
}

@keyframes growPulse {
  0% {
    transform: translateX(-50%) scale(0.92);
  }
  55% {
    transform: translateX(-50%) scale(1.08);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes bugWiggle {
  from {
    transform: translateY(0) rotate(-6deg);
  }
  to {
    transform: translateY(-3px) rotate(7deg);
  }
}

@keyframes flyBugOne {
  to {
    opacity: 0;
    transform: translate(-65px, -62px) rotate(-24deg);
  }
}

@keyframes flyBugTwo {
  to {
    opacity: 0;
    transform: translate(70px, -72px) rotate(25deg);
  }
}

@keyframes rodentPeek {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-8px);
  }
}

@keyframes scurryAway {
  to {
    opacity: 0;
    transform: translateX(95px);
  }
}

@keyframes stepLeft {
  to {
    transform: rotate(14deg);
  }
}

@keyframes stepRight {
  to {
    transform: rotate(-14deg);
  }
}

@keyframes useArm {
  0%,
  100% {
    transform: rotate(-18deg);
  }
  45% {
    transform: rotate(-70deg);
  }
}

@keyframes happyHop {
  50% {
    transform: translate(-50%, -106%);
  }
}

@keyframes sparkleFloat {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.82);
  }
  35% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-18px) scale(1.08);
  }
}

@media (max-width: 1050px) {
  .control-panel {
    grid-template-columns: 1fr;
  }

  .tools {
    grid-template-columns: repeat(7, minmax(74px, 1fr));
  }
}

@media (max-width: 920px) {
  .title-screen {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .title-copy {
    max-width: none;
  }

  .title-garden {
    min-height: 360px;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    align-items: stretch;
  }

  .garden {
    min-height: clamp(420px, calc(100vh - 278px), 520px);
  }

  .journal-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .title-screen,
  .game-screen {
    width: min(100vw - 16px, 1220px);
  }

  .character-grid,
  .schedule-builder {
    grid-template-columns: 1fr;
  }

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

  .top-meta {
    justify-content: flex-start;
    text-align: left;
  }

  .game-lobby-link {
    max-width: 100%;
  }

  .garden {
    min-height: 430px;
  }

  .water-zone {
    left: 2%;
    transform: scale(0.82);
  }

  .tomato-zone {
    width: 232px;
    transform: translateX(-50%) scale(0.9);
  }

  .tool-shelf {
    right: 0;
    transform: scale(0.82);
  }

  .tools {
    grid-template-columns: repeat(2, minmax(122px, 1fr));
  }

  .side-panel,
  .note-grid,
  .crop-guide-grid {
    grid-template-columns: 1fr;
  }

  .modal-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
