:root {
  --ink: #273e34;
  --edge: #344839;
  --paper: #fff9e7;
  --soft: #52665b;
  --pixel: PasturePixel, "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  font:
    16px/1.3 "Microsoft YaHei",
    system-ui,
    sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #b6dbe2;
}
body {
  position: fixed;
  margin: 0;
  inset: max(env(safe-area-inset-top, 0px), var(--toy-top, 0px), var(--toolbar-top, 0px))
    max(env(safe-area-inset-right, 0px), var(--toy-right, 0px))
    max(env(safe-area-inset-bottom, 0px), var(--toy-bottom, 0px))
    max(env(safe-area-inset-left, 0px), var(--toy-left, 0px));
  overflow: hidden;
}
/* Toy previews can draw the native follow/share capsules even when safeArea.top is zero. */
@media (orientation: portrait) and (max-width: 1024px) {
  html[data-toy-frame] {
    --toolbar-top: 92px;
  }
}
@media (orientation: landscape) and (max-height: 600px), (orientation: landscape) and (pointer: coarse) {
  html[data-toy-frame] {
    --toolbar-top: 60px;
  }
}
#pasture {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--play-width, 100%);
  height: var(--play-height, 100%);
  transform: translate(-50%, -50%) rotate(var(--play-turn, 0deg));
  overflow: hidden;
  isolation: isolate;
  container: pasture / size;
}
/* Native modal dialogs enter the top layer, outside the transformed game surface. */
#pasture dialog:modal {
  position: fixed;
  inset: var(--play-cy) auto auto var(--play-cx);
  margin: 0;
  transform: translate(-50%, -50%) rotate(var(--play-turn));
  max-width: calc(var(--play-width) - 20px);
  max-height: calc(var(--play-height) - 24px);
}
#sky,
#field,
#float-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#sky {
  pointer-events: none;
}
#field {
  display: block;
  touch-action: none;
  cursor: var(--tool-cursor, crosshair);
  -webkit-tap-highlight-color: transparent;
}
#field.collect {
  cursor: pointer;
}
#float-layer {
  overflow: hidden;
  pointer-events: none;
}
.hud {
  position: absolute;
  inset: 24px 30px auto 30px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  pointer-events: none;
}
.heading h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  font: 36px/1.25 var(--pixel);
  letter-spacing: 1px;
  color: #263f36;
  text-shadow: 0 2px #f3f9e9;
}
.heading h1 img {
  width: 38px;
  height: 38px;
  image-rendering: pixelated;
}
.records {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin-top: 10px;
}
.records > div {
  display: flex;
  gap: 7px;
  align-items: baseline;
  white-space: nowrap;
}
.records > div + div {
  padding-left: 16px;
  border-left: 2px solid #718f87;
}
.record-label,
#seconds {
  color: #344f48;
  font: 15px/1.25 var(--pixel);
}
.records strong {
  font: 22px/1 var(--pixel);
  font-variant-numeric: tabular-nums;
}
.actions {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  pointer-events: auto;
}
button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #b66029;
  outline-offset: 3px;
}
.square,
.wallet,
.toolbelt,
.settings {
  border: 2px solid var(--edge);
  background: var(--paper);
  box-shadow:
    inset 0 2px #fffef4,
    inset 0 -3px #d5d0b6,
    0 3px 0 #687b69;
}
.square {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
}
.square img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}
.square:hover,
.square[aria-expanded="true"] {
  background: #e5ebcf;
}
.square:active,
#defaults:active {
  transform: translateY(2px);
}
.wallet {
  height: 46px;
  min-width: 89px;
  padding: 0 14px 0 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-right: 3px;
  font: 26px/1 var(--pixel);
}
.wallet img {
  width: 29px;
  height: 29px;
  image-rendering: pixelated;
}
.toolbelt {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 66px;
  padding: 6px 16px 7px 6px;
  gap: 11px;
  pointer-events: none;
}
.tool-slot {
  width: 48px;
  height: 48px;
  background: #c7d4b0;
  border: 2px solid #657957;
  box-shadow:
    inset 2px 2px #a0ae8d,
    inset -2px -2px #e6ecd1;
  display: grid;
  place-items: center;
}
.tool-slot img {
  width: 37px;
  height: 37px;
  image-rendering: pixelated;
}
.tool-name {
  white-space: nowrap;
  padding-right: 7px;
}
.tool-name b {
  display: block;
  font: 22px/1.15 var(--pixel);
}
.tool-name small {
  display: block;
  margin-top: 3px;
  font: 13px/1.2 var(--pixel);
  color: var(--soft);
}
.wool-meter {
  border-left: 2px solid #c6cbb4;
  padding: 2px 0 2px 15px;
  min-width: 142px;
}
.meter-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.meter-title span {
  font: 14px/1.2 var(--pixel);
  color: var(--soft);
  white-space: nowrap;
}
.meter-title b {
  font: 16px/1 var(--pixel);
  white-space: nowrap;
}
.track {
  height: 8px;
  border: 1px solid #617655;
  margin-top: 7px;
  background: #ced2bb;
}
.track i {
  display: block;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(90deg, #84a75c 0, #84a75c 10px, #afc586 10px, #afc586 12px);
  transition: width 0.1s linear;
}
.performance {
  position: absolute;
  left: 28px;
  bottom: 23px;
  display: flex;
  align-items: center;
  gap: 5px;
  font: 14px/1 var(--pixel);
  color: #3f6356;
  pointer-events: none;
}
.performance i {
  width: 6px;
  height: 6px;
  background: #62854c;
  margin-right: 2px;
}
.drop-meter {
  border-left: 1px solid #8da797;
  margin-left: 3px;
  padding-left: 8px;
}
.performance-setting {
  min-height: 44px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
}
.performance-setting input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #587744;
}
#crate-label {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  min-width: 60px;
  min-height: 44px;
  background: transparent;
  border: 0;
  padding: 0;
  display: grid;
  place-items: end center;
}
#crate-label span {
  padding: 5px 8px;
  background: #374a37;
  color: #fff6d9;
  font: 14px/1 var(--pixel);
  border: 1px solid #83956a;
  box-shadow: 0 2px 0 #2d3d2c55;
}
#crate-label b {
  font-weight: normal;
  color: #ffe095;
}
#crate-label:hover span,
#crate-label:focus-visible span {
  background: #50673e;
}
#crate-label[data-ready] span {
  background: #f9e6a8;
  color: #364932;
  border: 2px solid #50663e;
  box-shadow:
    inset 0 -2px #dbcb92,
    0 2px #46573c;
}
#crate-label[data-ready] b {
  color: #866020;
}
.cut-flash {
  position: absolute;
  pointer-events: none;
  animation: cut-flash 0.17s ease-out forwards;
}
.cut-flash.patch {
  background: linear-gradient(
    174deg,
    transparent 31%,
    #f57e8577 42%,
    #ffb9a9 48%,
    #fff0cd 50%,
    #ef82816e 54%,
    transparent 69%
  );
}
.cut-flash.band {
  border-left: 3px solid #b0e5c6;
  border-right: 2px solid #b0e5c6;
  background: #c0f1d23a;
}
@keyframes cut-flash {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.settings {
  position: absolute;
  top: 85px;
  right: 30px;
  width: min(284px, calc(100% - 24px));
  padding: 8px 17px 13px;
  z-index: 4;
  max-height: calc(100% - 100px);
  overflow: auto;
  overscroll-behavior: contain;
}
.drawer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-title h2 {
  margin: 0;
  font: 24px/1 var(--pixel);
}
.close {
  border: 0;
  background: transparent;
  font: 27px/1 var(--pixel);
  width: 44px;
  height: 44px;
  margin-right: -10px;
}
.setting-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-top: 3px;
}
.orientation-options {
  border: 0;
  margin: 2px 0 9px;
  padding: 0;
}
.orientation-options legend {
  padding: 0 0 4px;
  font-size: 14px;
}
.orientation-options div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.orientation-options button {
  min-height: 44px;
  border: 1px solid #8c9a7a;
  background: var(--paper);
  font: 17px var(--pixel);
}
.orientation-options [aria-pressed="true"] {
  color: #263f28;
  background: #dce7bf;
  border-color: #456440;
  box-shadow: inset 0 -3px #93ae71;
}
.setting-row output {
  font: 16px/1 var(--pixel);
  color: #49663d;
}
.setting-row input {
  width: 100%;
  height: 44px;
  margin: -5px 0 0;
  accent-color: #587744;
  cursor: pointer;
}
#defaults {
  min-height: 44px;
  border: 1px solid #98a388;
  padding: 0 12px;
  font: 15px var(--pixel);
  background: #eaf0db;
}
#touch-shears {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  pointer-events: none;
}
.floater {
  position: absolute;
  font: var(--float-size, 24px) / 1 var(--pixel);
  white-space: nowrap;
  color: #fffced;
  text-shadow:
    2px 0 #3d4c3a,
    -2px 0 #3d4c3a,
    0 -2px #3d4c3a,
    0 2px #3d4c3a,
    2px 3px #3d4c3a;
  animation: rise 0.72s ease-out forwards;
}
.floater.gold {
  color: #ffe073;
  text-shadow:
    2px 0 #6f512e,
    -2px 0 #6f512e,
    0 -2px #6f512e,
    0 2px #6f512e,
    2px 3px #6f512e;
}
@keyframes rise {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
  }
  18% {
    transform: translate(-50%, -80%) scale(1.06);
  }
  65% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--drift, 0px)), -240%);
    opacity: 0;
  }
}
#notice {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  background: var(--paper);
  padding: 14px 20px;
  border: 2px solid var(--edge);
  text-align: center;
  max-width: 88%;
}
@container pasture (max-width: 600px) {
  .hud {
    inset: 14px 13px auto 13px;
    gap: 4px;
  }
  .heading h1 {
    font-size: 26px;
    gap: 5px;
    letter-spacing: 0;
  }
  .heading h1 img {
    width: 27px;
    height: 27px;
  }
  .records {
    gap: 10px;
    position: absolute;
    left: 0;
    top: 43px;
    margin: 0;
  }
  .records > div {
    gap: 5px;
  }
  .records > div + div {
    padding-left: 10px;
  }
  .record-label,
  #seconds {
    font-size: 13px;
  }
  .records strong {
    font-size: 18px;
  }
  .actions {
    gap: 5px;
  }
  .square {
    width: 44px;
    height: 44px;
  }
  .wallet {
    min-width: 57px;
    height: 44px;
    padding: 0 6px;
    gap: 4px;
    margin: 0;
    font-size: 21px;
  }
  .wallet img {
    width: 23px;
    height: 23px;
  }
  .settings {
    top: 70px;
    right: 13px;
  }
  .toolbelt {
    bottom: 30px;
  }
  .performance {
    bottom: 8px;
    left: 14px;
    font-size: 12px;
  }
}
@container pasture (max-height: 520px) and (orientation: landscape) {
  .hud {
    top: 9px;
    left: 14px;
    right: 14px;
  }
  .heading h1 {
    font-size: 25px;
    gap: 7px;
  }
  .heading h1 img {
    width: 26px;
    height: 26px;
  }
  .records {
    margin-top: 5px;
    gap: 10px;
  }
  .record-label {
    font-size: 13px;
  }
  .records {
    text-shadow:
      1px 1px #e3edda,
      -1px -1px #e3edda,
      1px -1px #e3edda,
      -1px 1px #e3edda;
  }
  .records strong {
    font-size: 17px;
  }
  .toolbelt {
    bottom: 9px;
    height: 48px;
    padding: 3px 12px 3px 4px;
    gap: 8px;
  }
  .tool-slot {
    width: 35px;
    height: 35px;
  }
  .tool-slot img {
    width: 29px;
    height: 29px;
  }
  .tool-name b {
    font-size: 18px;
  }
  .tool-name small {
    margin-top: 0;
    font-size: 12px;
  }
  .performance {
    bottom: 11px;
    left: 14px;
  }
  .settings {
    top: 60px;
    max-height: calc(100% - 68px);
    right: 14px;
  }
}
@container pasture (max-width: 359px) {
  .heading h1 {
    font-size: 22px;
    gap: 3px;
  }
  .heading h1 img {
    width: 23px;
    height: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .track i {
    transition: none;
  }
  .floater {
    animation-duration: 0.42s;
  }
}
.wallet-text {
  display: grid;
  justify-items: start;
  line-height: 0.98;
}
.work-line,
.work-actions,
.work-switch,
.view-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.work-line {
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid #d5d9c4;
  gap: 3px;
}
.work-line strong,
.stock-count {
  font: 16px var(--pixel);
}
.stock-count {
  color: #4c6941;
  margin-top: 3px;
}
.work-switch .shop-action,
.work-actions .shop-action {
  min-width: 44px;
  padding: 0 6px;
}
.work-switch [aria-pressed="true"] {
  background: #c9dba9;
  border-color: #536b48;
}
.offline-rate {
  font:
    14px/1.6 "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--soft);
  margin: 6px 0;
}
#species-controls {
  position: absolute;
  top: 113px;
  left: 28px;
  pointer-events: none;
}
#species-status {
  display: block;
  width: fit-content;
  margin-bottom: 4px;
  padding: 3px 6px;
  background: #eaf2dfec;
  font: 15px var(--pixel);
  color: var(--ink);
}
#species-controls[data-spectrum] #species-status::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  background: var(--target-color);
  border: 1px solid #40594a;
}
.view-actions button,
#offline-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 2px solid var(--edge);
  box-shadow:
    inset 0 -2px #c0c7ab,
    0 2px #758770;
  background: var(--paper);
  font: 16px var(--pixel);
  pointer-events: auto;
}
.view-actions button:disabled {
  opacity: 0.65;
}
#offline-report {
  width: min(344px, calc(var(--play-width) - 30px));
  padding: 18px 19px;
  border: 2px solid var(--edge);
  color: var(--ink);
  background: var(--paper);
  box-shadow:
    inset 0 -3px #c9ceb4,
    0 4px #596f59;
}
#offline-report::backdrop {
  background: #263c3080;
}
#offline-report h2 {
  font: 25px var(--pixel);
  margin: 0 0 12px;
}
#offline-report p {
  margin: 6px 0;
}
#offline-report strong {
  font: 24px var(--pixel);
}
#away-result {
  color: #52713e;
}
#away-time {
  display: block;
  color: var(--soft);
  font-size: 13px;
  margin: 8px 0 15px;
}
@container pasture (max-width: 600px) {
  #species-controls {
    top: 82px;
    left: 12px;
  }
  #shop-tabs button {
    font-size: 15px;
  }
  .work-switch button,
  .work-actions button {
    font-size: 13px;
  }
}
@container pasture (max-height: 520px) and (orientation: landscape) {
  #species-controls {
    top: 72px;
    left: 12px;
  }
  #species-status {
    font-size: 13px;
  }
}
.heading h1 {
  white-space: nowrap;
}
@container pasture (max-width: 359px) {
  .heading h1 img {
    display: none;
  }
  .heading h1 {
    font-size: 21px;
  }
  .actions {
    flex-shrink: 0;
  }
  .wallet {
    padding: 0 5px;
    font-size: 18px;
  }
}
@container pasture (max-width: 420px) {
  .toolbelt {
    gap: 7px;
    padding-right: 9px;
    max-width: calc(100% - 16px);
  }
  .tool-name {
    padding: 0;
  }
  .tool-name b {
    font-size: 18px;
  }
  .tool-name small,
  .meter-title span {
    font-size: 12px;
  }
  .wool-meter {
    min-width: 112px;
    padding-left: 8px;
  }
  .meter-title {
    gap: 5px;
  }
  .meter-title b {
    font-size: 15px;
  }
}
.wallet-text small {
  font: 12px/1 var(--pixel);
  color: var(--soft);
  margin-bottom: 2px;
}
.wallet[aria-expanded="true"] {
  background: #e6edcf;
}
button.tool-slot {
  pointer-events: auto;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
}
#hotbar {
  position: absolute;
  left: 50%;
  bottom: 101px;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
}
.hot-slot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #f7f4dc;
  border: 2px solid #697b60;
  box-shadow: 0 2px #6e816a;
}
.hot-slot[aria-pressed="true"] {
  background: #dbe6b8;
  border-color: #3d5739;
  box-shadow:
    inset 0 -3px #abc487,
    0 2px #617650;
}
.hot-slot img,
.shop-icon img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
}
#shop {
  position: absolute;
  z-index: 5;
  top: 85px;
  right: 30px;
  width: min(385px, calc(100% - 24px));
  max-height: calc(100% - 104px);
  display: flex;
  flex-direction: column;
  padding: 5px 14px 10px;
  border: 2px solid var(--edge);
  background: var(--paper);
  box-shadow:
    inset 0 2px #fffef4,
    inset 0 -3px #d5d0b6,
    0 3px #687b69;
}
#shop .drawer-title {
  flex-shrink: 0;
}
#shop-tabs {
  display: flex;
  border-bottom: 2px solid #a5b298;
  flex-shrink: 0;
}
#shop-tabs button {
  min-height: 44px;
  flex: 1;
  font: 17px var(--pixel);
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--soft);
}
#shop-tabs button[aria-pressed="true"] {
  color: var(--ink);
  border-color: #5c7c44;
  background: #edf1dc;
}
#shop-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.shop-row {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #d5d9c4;
  min-height: 59px;
}
.shop-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #e8edda;
  border: 1px solid #b2bda3;
}
.shop-copy {
  flex: 1;
  min-width: 0;
}
.shop-copy strong,
.set-title {
  display: block;
  font: 19px/1.25 var(--pixel);
}
.shop-copy small,
.set-rule,
.upgrade-stat {
  font:
    13px/1.4 "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--soft);
}
.shop-copy small,
.upgrade-stat {
  display: block;
}
.upgrade-stat {
  color: #4e703e;
  font-variant-numeric: tabular-nums;
}
.shop-action {
  min-height: 44px;
  min-width: 72px;
  padding: 0 8px;
  background: #e0ebce;
  border: 1px solid #798e66;
  box-shadow: inset 0 -2px #c1cfab;
  font: 15px var(--pixel);
  white-space: nowrap;
}
.shop-action:disabled {
  cursor: default;
  background: #efefdf;
  border-color: #b8c1a8;
  color: #65765f;
  box-shadow: none;
}
.set-title {
  margin: 14px 0 2px;
}
.set-rule {
  margin: 0 0 6px;
}
.set-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  border-top: 1px solid #d5d9c4;
}
.set-row strong {
  font: 16px var(--pixel);
}
.swatches {
  display: flex;
  gap: 3px;
}
.swatches i {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--dye);
  background: #f7f4e5;
}
.swatches i.found {
  background: var(--dye);
  box-shadow: inset 0 -2px #0002;
}
.sample {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 24px;
}
.sample small {
  font: 11px/1.1 var(--pixel);
  color: var(--soft);
}
.set-reward {
  margin-left: auto;
  font: 14px var(--pixel);
  color: #56704b;
}
#wool-label[data-dye]::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--dye);
  border: 1px solid #566953;
  margin-right: 4px;
}
#announcement {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 85px;
  transform: translateX(-50%);
  margin: 0;
  max-width: 90%;
  padding: 7px 13px;
  font: 17px var(--pixel);
  color: #fff5cb;
  background: #344b38;
  box-shadow: 0 2px #748368;
  pointer-events: none;
  text-align: center;
}
#shop #announcement {
  position: static;
  transform: none;
  flex-shrink: 0;
  max-width: none;
  margin-top: 4px;
  padding: 5px 8px;
  box-shadow: none;
  font-size: 15px;
}

#back-home {
  display: inline-flex;
  align-items: center;
  gap: inherit;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-shadow: inherit;
  pointer-events: auto;
}
#back-home span {
  color: #577464;
  font: 23px/1 var(--pixel);
}
#home-screen {
  position: absolute;
  inset: 0;
  z-index: 2;
}
#home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #e5eedc70, transparent 53%);
}
.home-creator {
  position: absolute;
  top: 22px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 49px;
  padding: 3px 4px 3px 6px;
  font: 17px/1.15 var(--pixel);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--edge);
  box-shadow:
    inset 0 -2px #d2d7bb,
    0 3px #728471;
}
.creator-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.creator-profile img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 1px solid #746c59;
}
.creator-profile small {
  display: block;
  margin-top: 3px;
  font: 12px/1.1 var(--pixel);
  color: var(--soft);
}
.creator-profile:hover small {
  text-decoration: underline;
}
.creator-profile:focus-visible {
  outline: 3px solid #a95e24;
  outline-offset: 3px;
}
.follow-offer {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 4px 10px;
  border: 2px solid #67512f;
  background: #f3d690;
  color: #453719;
  box-shadow:
    inset 0 2px #fff0c8,
    inset 0 -3px #d4af64,
    0 2px #796644;
  text-align: left;
  white-space: nowrap;
}
.follow-offer:hover {
  background: #ffe5a2;
}
.follow-offer[data-active] {
  border-color: #516c46;
  background: #e1ebd1;
  color: #355332;
  box-shadow:
    inset 0 2px #f4f7e3,
    inset 0 -3px #b4c89a,
    0 2px #66775a;
}
.follow-offer img {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}
.offer-copy {
  display: grid;
  gap: 2px;
}
.offer-copy strong {
  font: 18px/1 var(--pixel);
}
.offer-copy small {
  font: 13px/1.1 var(--pixel);
}
#follow-hint {
  position: absolute;
  top: calc(100% + 9px);
  right: -2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  width: max-content;
  max-width: min(264px, calc(100cqw - 32px));
  padding: 7px 10px;
  border: 2px solid var(--edge);
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.35 var(--pixel);
  white-space: normal;
}
#follow-hint .hint-link {
  color: #604720;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
#follow-hint::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 15px;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--paper);
  border-top: 2px solid var(--edge);
  border-left: 2px solid var(--edge);
}
@container pasture (max-width: 740px) {
  #farm-benefits {
    position: absolute;
    top: calc(100% + 22px);
    right: 0;
    min-height: 44px;
    padding: 4px 9px;
  }
  #farm-benefits img {
    display: none;
  }
  #farm-benefits .offer-copy strong {
    font-size: 15px;
  }
  #farm-benefits .offer-copy small {
    font-size: 12px;
  }
  .actions:has([aria-expanded="true"]) #farm-benefits {
    display: none;
  }
}
@container pasture (max-width: 480px) {
  .hud {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .heading {
    container: farm-title / inline-size;
  }
  #species-status {
    max-width: calc(100cqw - 145px);
  }
  #play-ui:has(#species-controls:not([hidden])) #follow-hint {
    width: calc(100% + 4px);
    padding: 5px 7px;
    font-size: 13px;
  }
}
@container farm-title (max-width: 168px) {
  #back-home span {
    display: none;
  }
}
@container farm-title (max-width: 145px) {
  #back-home img {
    display: none;
  }
}
@container farm-title (max-width: 115px) {
  #back-home {
    font-size: clamp(15px, 19cqw, 22px);
  }
}
.home-menu {
  position: absolute;
  left: clamp(28px, 7.8cqw, 155px);
  top: 51%;
  transform: translateY(-50%);
  width: clamp(255px, 28cqw, 430px);
  text-align: center;
}
.pasture-sign {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(94px, 8.8cqw, 138px);
  margin: 0 -3px 25px;
  background-color: #b38a55;
  background-image: linear-gradient(#b88d5880, #835c3970), url("assets/textures/oak_planks.png");
  background-size:
    auto,
    88px 88px;
  image-rendering: pixelated;
  border: 4px solid #513d2e;
  box-shadow:
    inset 0 3px #e6c592,
    inset 0 -4px #785633,
    4px 5px 0 #503f32;
}
.pasture-sign::before,
.pasture-sign::after {
  content: "";
  position: absolute;
  top: -18px;
  width: 7px;
  height: 15px;
  background: #5f5445;
  border: 1px solid #443c32;
}
.pasture-sign::before {
  left: 12%;
}
.pasture-sign::after {
  right: 12%;
}
.pasture-sign h1 {
  margin: 4px 0 0;
  font: clamp(43px, 4.25cqw, 68px) / 1.12 var(--pixel);
  color: #fff2cf;
  letter-spacing: 1px;
  text-shadow:
    2px 0 #61452d,
    0 2px #61452d,
    3px 4px #59432e;
}
.sign-wool {
  display: grid;
  place-items: center;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -61%);
  width: 40px;
  height: 38px;
  background: #705238;
  border: 3px solid #503c2e;
  box-shadow:
    inset 0 2px #b59566,
    2px 2px #5b4931;
}
.sign-wool img {
  width: 29px;
  height: 29px;
  image-rendering: pixelated;
}
.home-actions,
.home-secondary {
  display: grid;
  gap: 8px;
}
.home-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-secondary button {
  padding-inline: 2px;
  white-space: nowrap;
}
.home-actions button,
.rank-action {
  min-height: 48px;
  border: 2px solid var(--edge);
  background: var(--paper);
  color: var(--ink);
  font: 19px/1.1 var(--pixel);
  box-shadow:
    inset 0 2px #fffdf0,
    inset 0 -3px #c8cbb1,
    0 2px #667861;
}
.home-actions button:hover,
.rank-action:hover {
  background: #e8eed6;
}
.home-actions button:active,
.rank-action:active {
  transform: translateY(2px);
}
.home-actions .home-start {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #628448;
  color: #fff9db;
  border-color: #344b31;
  font-size: 25px;
  text-shadow: 1px 2px #3e5b34;
  box-shadow:
    inset 0 3px #91ac64,
    inset 0 -4px #47683a,
    0 3px #42543a;
}
.home-actions .home-start:hover {
  background: #52793d;
}
.home-start img {
  position: absolute;
  left: 13px;
  width: 29px;
  height: 29px;
  image-rendering: pixelated;
}
.home-start i {
  position: absolute;
  right: 14px;
  width: 0;
  height: 0;
  border-block: 5px solid transparent;
  border-left: 7px solid #dfe9b4;
}
#home-save {
  margin: 14px 0 0;
  font: 15px/1.4 var(--pixel);
  color: #324e3c;
  text-shadow: 0 1px #eef3d9;
}
.home-dialog,
#home-settings-dialog {
  padding: 10px 19px 15px;
  width: min(430px, calc(var(--play-width) - 26px));
  max-height: calc(var(--play-height) - 28px);
  border: 2px solid var(--edge);
  background: var(--paper);
  color: var(--ink);
  box-shadow:
    inset 0 -3px #d2d4bb,
    0 4px #5b725c;
}
.home-dialog[open] {
  display: flex;
  flex-direction: column;
}
.home-dialog::backdrop,
#home-settings-dialog::backdrop {
  background: #29423577;
}
#home-settings-dialog {
  padding: 0;
  width: min(320px, calc(var(--play-width) - 28px));
}
#home-settings-dialog .settings {
  position: static;
  width: auto;
  max-height: none;
  border: none;
  box-shadow: none;
}
#rank-tabs {
  display: flex;
  border-bottom: 2px solid #a5b298;
}
#rank-tabs button {
  min-width: 44px;
  min-height: 44px;
  flex: 1;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  font: 18px var(--pixel);
}
#rank-tabs button[aria-pressed="true"] {
  background: #e7edd6;
  border-color: #63864b;
}
.rank-scroll {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.rank-personal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin: 17px 0 6px;
  font: 17px var(--pixel);
}
.rank-personal strong {
  font: 23px var(--pixel);
  color: #456a38;
}
.rank-rule,
#rank-status,
#rank-mine,
#rank-breakdown {
  font:
    14px/1.55 "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--soft);
  margin: 8px 0;
}
.benefit-entry {
  padding: 6px 12px;
  min-height: 44px;
  border: 1px solid #8a9e77;
  color: #345638;
  background: #e8efd8;
  font: 16px var(--pixel);
}
.community-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #c5ceb3;
}
.community-row h3 {
  margin: 0;
  font: 20px/1.2 var(--pixel);
}
.community-row h3 b {
  margin-left: 3px;
  color: #587941;
  font: 17px var(--pixel);
}
.community-row p,
.community-foot small {
  margin: 6px 0;
  font:
    14px/1.45 "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--soft);
}
.community-row small {
  font: 15px var(--pixel);
  color: #786143;
}
.community-row small[data-active] {
  color: #436c36;
}
.community-row a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  padding-inline: 8px;
}
.community-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #c5ceb3;
  padding-top: 10px;
}
#community-dialog {
  overflow: auto;
}
#rank-breakdown {
  white-space: pre-line;
  border-top: 1px solid #cad1b9;
  padding-top: 8px;
}
#rank-status {
  font-size: 13px;
}
.book-times {
  border-collapse: collapse;
  width: 100%;
  font: 16px var(--pixel);
}
.book-times th,
.book-times td {
  padding: 8px 4px;
  border-bottom: 1px solid #d9ddc8;
  text-align: left;
  font-weight: normal;
  overflow-wrap: anywhere;
}
.book-times tr > :last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.book-times thead {
  color: var(--soft);
}
#farm-times summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  font: 16px var(--pixel);
}
.rank-actions {
  display: flex;
  gap: 7px;
}
.rank-action {
  min-height: 44px;
  min-width: 44px;
  padding: 5px 14px;
  font-size: 16px;
}
.rank-action:disabled {
  opacity: 0.55;
  cursor: default;
}
#trial-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#record-title small {
  margin-left: 5px;
  font: 14px var(--pixel);
  color: var(--soft);
}
#sprint-best-hud {
  position: absolute;
  right: 27px;
  bottom: 23px;
  color: #3f6356;
  font: 14px/1 var(--pixel);
  pointer-events: none;
}
#sprint-best-hud b {
  font-weight: normal;
}
@container pasture (max-width: 600px) or (max-height: 520px) {
  #sprint-best-hud {
    right: 13px;
    bottom: 8px;
    font-size: 12px;
  }
}
#shop-tabs button {
  min-width: 44px;
  padding-inline: 1px;
}
.gold-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 0 10px;
  border-bottom: 1px solid #bdc4aa;
  font: 18px var(--pixel);
}
.gold-summary span {
  color: #765219;
}
#sheep-name {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  color: #fffbea;
  background: #293729d9;
  padding: 3px 7px;
  font: 17px var(--pixel);
  text-shadow: 1px 1px #1d241d;
  white-space: nowrap;
}
#name-dialog {
  width: min(330px, calc(var(--play-width) - 28px));
}
#name-form {
  display: grid;
  gap: 9px;
}
#name-form label {
  font-size: 14px;
}
#name-input {
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 2px solid var(--edge);
  background: #fffdf2;
  color: var(--ink);
  font: 19px var(--pixel);
  user-select: text;
  -webkit-user-select: text;
}
#harvest-card {
  width: min(530px, calc(var(--play-width) - 24px));
  padding: 5px 12px 12px;
  overflow: auto;
}
#harvest-card .drawer-title,
#harvest-card .card-actions,
#rebirth-review {
  flex-shrink: 0;
}
#harvest-picture {
  display: block;
  width: 100%;
  max-height: calc(var(--play-height) - 160px);
  object-fit: contain;
  min-height: 100px;
  user-select: auto;
  -webkit-user-select: auto;
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
#card-download {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
#card-rebirth,
#rebirth-confirm {
  background: #f1d68c;
  box-shadow:
    inset 0 2px #fff0c5,
    inset 0 -3px #d0b166,
    0 2px #687254;
}
#rebirth-review {
  border-top: 1px solid #b8bda3;
  margin-top: 7px;
  font-size: 14px;
}
#sprint-tools {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  width: max-content;
  max-width: calc(100% - 20px);
  white-space: nowrap;
  pointer-events: auto;
}
#sprint-tools button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 89px;
  min-height: 46px;
  padding: 5px 10px;
  border: 2px solid var(--edge);
  background: var(--paper);
  color: var(--ink);
  font: 17px var(--pixel);
}
#sprint-tools button[aria-pressed="true"] {
  background: #dbe7c1;
  box-shadow: inset 0 -4px #78914e;
}
#sprint-tools img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}
#trial-ui[data-countdown] #trial-time {
  color: #994d29;
}
#pasture[data-view="sprint"] #field {
  cursor: var(--challenge-cursor, crosshair);
}
@container pasture (max-width: 370px) {
  #shop {
    padding-inline: 9px;
  }
  #rank-tabs button {
    padding-inline: 2px;
    font-size: 16px;
  }
}
@container pasture (max-height: 440px) and (orientation: landscape) {
  #harvest-card[open] {
    display: block;
  }
  #harvest-picture {
    max-height: calc(var(--play-height) - 124px);
  }
}
.trial-meter {
  position: absolute;
  left: 15px;
  top: 15px;
  display: grid;
  gap: 4px;
  padding: 9px 13px;
  background: var(--paper);
  border: 2px solid var(--edge);
  font: 18px var(--pixel);
}
.trial-meter span {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.trial-meter small {
  font: 14px var(--pixel);
  color: var(--soft);
}
#trial-exit {
  position: absolute;
  right: 15px;
  top: 15px;
  pointer-events: auto;
}
#pasture[data-view="trial"] #field {
  cursor:
    url("assets/ui/cursor.png") 5 5,
    crosshair;
}
#notice {
  z-index: 10;
}
@container pasture (max-aspect-ratio: 94/100) {
  #home-screen {
    display: grid;
    grid-template: auto minmax(0, 1fr) auto auto / min(88%, 350px);
    justify-content: center;
    row-gap: 7px;
    padding: clamp(27px, 5cqh, 54px) 0 13px;
  }
  #home-screen:has(#home-save:not([hidden])) {
    padding-bottom: 35px;
  }
  #home-screen::before {
    background: linear-gradient(0deg, #e6efdce8, transparent 32%);
  }
  .home-creator {
    position: relative;
    inset: auto;
    grid-row: 3;
    justify-content: space-between;
    min-height: 44px;
    font-size: 15px;
  }
  .creator-profile img {
    width: 30px;
    height: 30px;
  }
  #home-benefits {
    min-height: 44px;
    padding-inline: 7px;
  }
  .home-menu {
    display: contents;
  }
  .pasture-sign {
    position: relative;
    grid-row: 1;
    justify-self: center;
    width: min(74cqw, 320px);
    min-height: clamp(61px, 8.6cqh, 92px);
    margin: 0;
  }
  .pasture-sign h1 {
    font-size: clamp(37px, 9.6cqw, 54px);
  }
  .sign-wool {
    width: 31px;
    height: 29px;
  }
  .sign-wool img {
    width: 22px;
    height: 22px;
  }
  .home-actions {
    position: relative;
    grid-row: 4;
  }
  #home-save {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    margin: 0;
    font-size: 13px;
  }
}
@container pasture (max-height: 520px) and (orientation: landscape) {
  .home-menu {
    left: 5.5%;
    top: 54%;
    width: clamp(210px, 30cqw, 286px);
  }
  .pasture-sign {
    min-height: 68px;
    margin-bottom: 13px;
  }
  .pasture-sign h1 {
    font-size: 36px;
  }
  .sign-wool {
    width: 28px;
    height: 27px;
  }
  .sign-wool img {
    width: 22px;
    height: 22px;
  }
  .home-actions,
  .home-secondary {
    gap: 5px;
  }
  .home-actions button,
  .home-actions .home-start {
    min-height: 44px;
  }
  .home-actions .home-start {
    font-size: 21px;
  }
  .home-creator {
    top: 8px;
    right: 12px;
    min-height: 44px;
    font-size: 14px;
  }
  .creator-profile img {
    width: 28px;
    height: 28px;
  }
  #home-save {
    margin-top: 9px;
    font-size: 13px;
  }
}
@container pasture (max-width: 350px) {
  .home-creator {
    gap: 4px;
    padding-inline: 4px;
    font-size: 14px;
  }
  .creator-profile {
    gap: 5px;
  }
  .creator-profile img {
    width: 24px;
    height: 24px;
  }
  #home-benefits {
    gap: 4px;
    padding-inline: 5px;
  }
  #home-benefits img {
    width: 18px;
    height: 18px;
  }
}
@container pasture (max-width: 370px) {
  #back-home span {
    display: none;
  }
}
#tool-mark {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  border: 1px dashed #f7e7ae;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
#tool-mark[data-mode="band"] {
  border-radius: 0;
  border: 0;
  background: repeating-linear-gradient(90deg, transparent 0 25%, #b6edc6 25% 30%, transparent 30% 33%);
  height: 14px !important;
}
#tool-mark[data-mode="patch"] {
  border-radius: 0;
  border: 2px solid #e99b91;
  box-shadow: inset 0 0 8px #ea77694d;
}
@container pasture (max-width: 600px) {
  #shop {
    right: 12px;
    top: 75px;
    max-height: calc(100% - 89px);
  }
  #hotbar {
    bottom: 104px;
  }
  .wallet-text small {
    font-size: 11px;
  }
  .shop-row {
    gap: 7px;
  }
  .shop-action {
    min-width: 64px;
  }
}
@container pasture (max-height: 520px) and (orientation: landscape) {
  #shop {
    top: 60px;
    max-height: calc(100% - 70px);
    right: 14px;
  }
  #hotbar {
    bottom: 63px;
  }
  #announcement {
    top: 63px;
  }
}
