:root {
  color-scheme: light;
  --ranch-ink: #2c4639;
  --ranch-leaf: #448d4c;
  --ranch-leaf-dark: #286536;
  --ranch-cream: #fff8e8;
  --ranch-gold: #f5c75c;
  --ranch-terracotta: #c96b45;
  --ranch-wood: #85512e;
  --ranch-shadow: 0 14px 36px rgba(30, 57, 35, 0.25);
  font-family:
    Inter,
    ui-rounded,
    "Nunito",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #254d3d;
  color: var(--ranch-ink);
}
button,
a {
  font: inherit;
}
.farm-game [hidden] {
  display: none !important;
}
.farm-app-shell {
  overscroll-behavior: none;
}
.little-ranch-page {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  background: radial-gradient(
    circle at 50% 18%,
    #7fae72 0,
    #365f4b 48%,
    #1e3c31 100%
  );
}
.farm-game {
  position: relative;
  width: min(100vw, 430px);
  height: 100dvh;
  min-height: 568px;
  max-height: 100dvh;
  overflow: hidden;
  background: #83bd5b;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 60px rgba(0, 0, 0, 0.34);
}
.farm-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: #80bd56
    url("/theme-assets/investasiku-farming/farming/ranch/backgrounds/ranch-compact-pasture-v20.webp")
    center/cover no-repeat;
}
.farm-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.farm-stage canvas:active {
  cursor: grabbing;
}
.farm-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(20, 46, 76, 0.47),
    rgba(27, 35, 67, 0.38)
  );
  opacity: 0;
  transition: opacity 0.6s;
  z-index: 2;
}
.farm-game.is-night .farm-stage::after {
  opacity: 1;
}
.farm-game.is-night .ranch-hud,
.farm-game.is-night .ranch-compass,
.farm-game.is-night .ranch-compass-menu {
  filter: saturate(0.9) brightness(0.92);
}
.game-icon {
  display: inline-block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v3/little-ranch-icons.webp");
  background-size: 600% 500%;
  background-repeat: no-repeat;
}
.icon-wallet {
  background-position: 0 0;
}
.icon-compass {
  background-position: 20% 0;
}
.icon-feed {
  background-position: 40% 0;
}
.icon-hay {
  background-position: 60% 0;
}
.icon-premium-feed {
  background-position: 80% 0;
}
.icon-heart {
  background-position: 0 25%;
}
.icon-info {
  background-position: 20% 27%;
}
.icon-settings {
  background-position: 40% 25%;
}
.icon-mission {
  background-position: 60% 25%;
}
.icon-reward {
  background-position: 80% 25%;
}
.icon-avatar {
  background-position: 100% 25%;
}
.icon-coin {
  background-position: 0 50%;
}
.icon-deposit {
  background-position: 20% 50%;
}
.icon-withdraw {
  background-position: 40% 50%;
}
.icon-ledger {
  background-position: 60% 50%;
}
.icon-invite {
  background-position: 80% 50%;
}
.icon-community {
  background-position: 100% 50%;
}
.icon-cottage {
  background-position: 0 75%;
}
.icon-barn {
  background-position: 21.35% 77%;
}
.icon-pen {
  background-position: 40% 75%;
}
.icon-feed-shed {
  background-position: 60% 75%;
}
.icon-office {
  background-position: 80% 75%;
}
.icon-help {
  background-position: 100% 75%;
}
.icon-audio {
  background-position: 0 100%;
}
.icon-audio-off {
  background-position: 20% 100%;
}
.icon-sun {
  background-position: 40% 100%;
}
.icon-moon {
  background-position: 60% 100%;
}
.icon-close {
  background-position: 80% 100%;
}
.icon-back {
  background-position: 100% 102%;
}
.utility-icon {
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v3/little-ranch-utility-icons.webp");
  background-size: 500% 300%;
}
.icon-grade-a {
  background-position: 0 0;
}
.icon-grade-s {
  background-position: 25% 0;
}
.icon-pet-animal {
  background-position: 50% 0;
}
.icon-animal-detail {
  background-position: 75% 0;
}
.icon-feeding-complete {
  background-position: 100% 0;
}
.icon-animal-hungry {
  background-position: 0 50%;
}
.icon-animal-happy {
  background-position: 25% 50%;
}
.icon-utility-settings {
  background-position: 50% 50%;
}
.icon-utility-close {
  background-position: 75% 50%;
}
.icon-utility-back {
  background-position: 100% 50%;
}
.icon-confirm {
  background-position: 0 100%;
}
.icon-warning {
  background-position: 25% 100%;
}
.icon-loading {
  background-position: 50% 100%;
}
.icon-gold-button {
  background-position: 75% 100%;
}
.icon-blue-button {
  background-position: 100% 100%;
}
.ranch-hud {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 9px 6px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(27, 55, 39, 0.28), transparent);
}
.ranch-hud > * {
  pointer-events: auto;
}
.ranch-status-plate {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  max-width: 230px;
  min-height: 52px;
  padding: 6px 9px 6px 6px;
  border-radius: 15px;
  background: linear-gradient(180deg, #a76d3f, #754325);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.28),
    0 7px 18px rgba(46, 37, 24, 0.26);
  color: #fff8e8;
  text-align: left;
}
.farm-avatar {
  width: 38px;
  height: 38px;
  border: 2px solid #ffe3a6;
  border-radius: 12px;
  background-color: #dce9c7;
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 0 0;
  box-shadow: inset 0 -5px 10px rgba(39, 78, 39, 0.15);
}
.ranch-status-plate > span:nth-child(2) {
  min-width: 0;
  display: grid;
  line-height: 1.08;
}
.ranch-status-plate small {
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffe4a3;
}
.ranch-status-plate strong {
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-status-plate b {
  padding: 3px 5px;
  border-radius: 8px;
  background: #eac875;
  color: #614021;
  font-size: 9px;
}
.ranch-wallet-pouch {
  display: grid;
  justify-items: center;
  width: 78px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.ranch-wallet-pouch .game-icon {
  width: 51px;
  height: 51px;
  filter: drop-shadow(0 5px 6px rgba(42, 38, 24, 0.34));
}
.ranch-wallet-pouch small {
  max-width: 78px;
  margin-top: -4px;
  padding: 3px 6px;
  border-radius: 8px;
  background: rgba(50, 69, 46, 0.78);
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.farm-loading {
  --load-progress: 0%;
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(
    180deg,
    rgba(228, 246, 223, 0.6),
    rgba(115, 166, 78, 0.58)
  );
  backdrop-filter: blur(4px) saturate(0.82);
  transition: opacity 0.28s;
}
.farm-loading.is-done {
  opacity: 0;
  pointer-events: none;
}
.farm-loading[hidden] {
  display: none;
}
.farm-loading-card {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(302px, calc(100vw - 36px));
  padding: 17px 17px 15px;
  border: 3px solid #d49a49;
  border-radius: 25px;
  background:
    linear-gradient(rgba(205, 151, 76, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205, 151, 76, 0.09) 1px, transparent 1px),
    linear-gradient(155deg, #fff9dc, #f5df9f);
  background-size:
    17px 17px,
    17px 17px,
    auto;
  box-shadow:
    inset 0 0 0 3px rgba(255, 250, 218, 0.9),
    0 7px 0 #8b582d,
    0 15px 30px rgba(44, 72, 39, 0.3);
  color: #38533b;
  text-align: center;
}
.farm-loading-card::before,
.farm-loading-card::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 34% 30%,
    #fff3a9 0 15%,
    #d89530 38%,
    #8b5727 100%
  );
  box-shadow: 0 1px 1px rgba(76, 42, 20, 0.42);
}
.farm-loading-card::before {
  left: 9px;
}
.farm-loading-card::after {
  right: 9px;
}
.farm-loading-kicker {
  position: relative;
  z-index: 2;
  margin-bottom: 4px;
  color: #8b6539;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.farm-loading-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 900 / 346;
  margin-bottom: 5px;
  border: 2px solid #c68a43;
  border-radius: 18px;
  background: linear-gradient(180deg, #95d9f1 0 50%, #72b64f 50% 100%);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.78),
    inset 0 -5px rgba(65, 112, 48, 0.16),
    0 4px 8px rgba(68, 87, 43, 0.17);
  overflow: hidden;
  isolation: isolate;
}
.farm-loading-art {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.015);
  animation: ranch-loader-scene 4.2s ease-in-out infinite alternate;
  will-change: transform;
}
.farm-loading-scene.is-error .farm-loading-art {
  filter: grayscale(0.45) saturate(0.7);
  animation-play-state: paused;
}
.farm-loading-scene::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(
    112deg,
    transparent 35%,
    rgba(255, 255, 222, 0.2) 48%,
    transparent 61%
  );
  transform: translateX(-115%);
  animation: ranch-loader-sunbeam 3.6s ease-in-out infinite;
  pointer-events: none;
}
.farm-loading-leaves,
.farm-loading-leaves > i {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}
.farm-loading-leaves {
  inset: 0;
}
.farm-loading-leaves > i {
  top: -10px;
  width: 9px;
  height: 5px;
  border-radius: 90% 10% 90% 10%;
  background: #8ebd35;
  filter: drop-shadow(0 1px 1px rgba(48, 84, 29, 0.35));
  animation: ranch-loader-leaf 3.8s linear infinite;
}
.farm-loading-leaves > i:nth-child(1) {
  left: 15%;
  animation-delay: -0.7s;
}
.farm-loading-leaves > i:nth-child(2) {
  left: 54%;
  animation-delay: -2.4s;
  animation-duration: 4.6s;
}
.farm-loading-leaves > i:nth-child(3) {
  left: 83%;
  animation-delay: -1.5s;
  animation-duration: 4.2s;
}
.farm-loading strong {
  margin-top: 1px;
  color: #314d38;
  font:
    900 17px/1.15 Georgia,
    serif;
  text-shadow: 0 1px #fff8d8;
}
.farm-loading small {
  min-height: 17px;
  margin-top: 5px;
  color: #56704e;
  font-size: 10px;
  font-weight: 800;
}
.farm-loading-progress {
  position: relative;
  width: min(224px, 78%);
  height: 14px;
  margin-top: 10px;
  padding: 3px;
  border: 2px solid #9e6a37;
  border-radius: 99px;
  background: #fff8d8;
  box-shadow:
    inset 0 2px 3px rgba(99, 68, 35, 0.18),
    0 2px rgba(255, 255, 255, 0.68);
  overflow: hidden;
}
.farm-loading-progress > i {
  display: block;
  width: var(--load-progress);
  height: 100%;
  min-width: 5px;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.22) 0 7px,
      transparent 7px 14px
    ),
    linear-gradient(90deg, #68a849, #8dcc5d);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.55);
  transition: width 0.18s ease-out;
}
.farm-loading-tip {
  margin-top: 8px;
  color: #8a7146;
  font-size: 8px;
  font-weight: 800;
}
.farm-loading-tip i {
  color: #d19433;
  font-style: normal;
  animation: ranch-loader-sparkle 1.2s ease-in-out infinite alternate;
}
.farm-loading-retry {
  min-height: 36px;
  margin-top: 10px;
  padding: 7px 15px;
  border: 2px solid #9d6534;
  border-radius: 12px;
  background: linear-gradient(#fff0b7, #e3bd65);
  box-shadow: 0 3px 0 #85502c;
  color: #654326;
  font: 900 9px inherit;
  cursor: pointer;
}
.farm-loading-retry:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #85502c;
}
@keyframes ranch-loader-scene {
  from {
    transform: scale(1.015) translate3d(-0.4%, 0, 0);
  }
  to {
    transform: scale(1.045) translate3d(0.4%, -0.5%, 0);
  }
}
@keyframes ranch-loader-sunbeam {
  0%,
  20% {
    transform: translateX(-115%);
    opacity: 0;
  }
  46% {
    opacity: 1;
  }
  72%,
  100% {
    transform: translateX(115%);
    opacity: 0;
  }
}
@keyframes ranch-loader-leaf {
  0% {
    transform: translate3d(0, -8px, 0) rotate(0);
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  100% {
    transform: translate3d(28px, 104px, 0) rotate(420deg);
    opacity: 0;
  }
}
@keyframes ranch-loader-sparkle {
  from {
    opacity: 0.45;
    transform: scale(0.75);
  }
  to {
    opacity: 1;
    transform: scale(1.15);
  }
}
@media (max-height: 620px) {
  .farm-loading-card {
    padding-block: 12px;
  }
  .farm-loading-scene {
    max-height: 79px;
  }
  .farm-loading-tip {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .farm-loading-art,
  .farm-loading-scene::after,
  .farm-loading-leaves > i {
    animation: none;
  }
}
.farm-toast {
  position: absolute;
  z-index: 38;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(38, 64, 44, 0.92);
  box-shadow: var(--ranch-shadow);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.farm-toast.is-error {
  background: rgba(151, 50, 43, 0.94);
}
.farm-status-pill,
.farm-quality {
  position: absolute;
  z-index: 16;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 11px;
  border-radius: 99px;
  background: rgba(49, 76, 48, 0.87);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}
.farm-status-pill {
  top: 78px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.farm-status-pill button {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #8a5b34;
  border-radius: 999px;
  background: #fff3c6;
  color: #4b604b;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.farm-quality {
  bottom: 96px;
}
.ranch-world-hint {
  position: absolute;
  z-index: 5;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 9px;
  border-radius: 99px;
  background: rgba(255, 248, 232, 0.76);
  color: #49624d;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  animation: ranch-hint 4s forwards;
}
.ranch-compass {
  position: absolute;
  z-index: 26;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 3px solid rgba(255, 234, 174, 0.85);
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #fff3c7, #a86c36);
  box-shadow:
    0 8px 0 #68462b,
    0 13px 26px rgba(28, 49, 29, 0.33);
}
.ranch-compass .game-icon {
  width: 54px;
  height: 54px;
}
.ranch-compass small {
  position: absolute;
  bottom: -4px;
  padding: 2px 7px;
  border-radius: 8px;
  background: #71482a;
  color: #fff5dc;
  font-size: 8px;
  font-weight: 900;
}
.ranch-compass[aria-expanded="true"] {
  transform: translateX(-50%) translateY(3px);
  box-shadow:
    0 5px 0 #68462b,
    0 10px 20px rgba(28, 49, 29, 0.3);
}
.ranch-compass-menu {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: 96px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: calc(100% - 18px);
  padding: 8px;
  border: 2px solid rgba(255, 231, 170, 0.78);
  border-radius: 21px;
  transform: translateX(-50%);
  background: rgba(255, 248, 232, 0.94);
  box-shadow: var(--ranch-shadow);
  backdrop-filter: blur(12px);
  animation: ranch-rise 0.2s ease-out;
}
.ranch-compass-menu button {
  display: grid;
  place-items: center;
  gap: 0;
  min-width: 0;
  padding: 3px 1px 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #405c47;
  font-weight: 900;
}
.ranch-compass-menu button:active,
.ranch-compass-menu button:focus-visible {
  background: #e7f0d7;
}
.ranch-compass-menu .game-icon {
  width: 38px;
  height: 38px;
}
.ranch-compass-menu small {
  font-size: 8px;
}
.farm-context-actions {
  position: absolute;
  z-index: 18;
  left: 50%;
  bottom: 98px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  padding: 6px;
  border: 2px solid #e8c47e;
  border-radius: 18px;
  background: rgba(255, 248, 232, 0.95);
  box-shadow: var(--ranch-shadow);
  backdrop-filter: blur(10px);
  animation: ranch-rise 0.18s ease-out;
}
.farm-context-actions button {
  display: grid;
  justify-items: center;
  min-width: 52px;
  padding: 3px 6px 5px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #315d3a;
  font-weight: 900;
}
.farm-context-actions button:disabled {
  opacity: 0.42;
}
.farm-context-actions .game-icon {
  width: 34px;
  height: 34px;
}
.farm-context-actions small {
  font-size: 8px;
}
.farm-animal-bubble {
  position: absolute;
  z-index: 17;
  left: 56%;
  top: 35%;
  max-width: 170px;
  padding: 8px 11px;
  border: 2px solid #dba35d;
  border-radius: 16px 16px 16px 5px;
  background: #fff8e8;
  box-shadow: 0 8px 22px rgba(31, 67, 36, 0.18);
  font-size: 10px;
  font-weight: 900;
}
.farm-animal-bubble::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #fff8e8;
  transform: rotate(45deg);
}
.farm-sheet {
  position: absolute;
  z-index: 34;
  left: 50%;
  bottom: max(94px, calc(82px + env(safe-area-inset-bottom)));
  width: calc(100% - 18px);
  max-height: min(70dvh, 610px);
  overflow: auto;
  padding: 8px 14px 15px;
  transform: translateX(-50%);
  border: 2px solid #e3bd76;
  border-radius: 22px;
  background: rgba(255, 248, 232, 0.98);
  box-shadow: 0 -8px 38px rgba(27, 64, 33, 0.24);
  backdrop-filter: blur(16px);
  animation: ranch-rise 0.22s ease-out;
}
.farm-sheet-handle {
  display: block;
  width: 42px;
  height: 5px;
  margin: 0 auto 9px;
  border: 0;
  border-radius: 99px;
  background: #c8b89d;
}
.farm-sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.farm-sheet-title small,
.farm-animal-heading small,
.ranch-building-heading small {
  display: block;
  color: #8a755c;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.farm-sheet-title h2,
.farm-animal-heading h2,
.ranch-building-heading h2 {
  margin: 1px 0 0;
  font-size: 17px;
}
.farm-sheet-title .game-icon {
  width: 44px;
  height: 44px;
}
.farm-primary-action {
  width: 100%;
  min-height: 43px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #5eac57, #35833f);
  box-shadow:
    0 5px 0 #286932,
    0 9px 16px rgba(42, 112, 53, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.farm-primary-action:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #286932;
}
.farm-primary-action:disabled {
  filter: grayscale(0.6);
  opacity: 0.64;
  box-shadow: none;
}
.ranch-wallet-balances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 11px 0;
}
.ranch-wallet-balances > div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #ead6ad;
  border-radius: 15px;
  background: #fffdf5;
}
.ranch-wallet-balances small {
  font-size: 8px;
  color: #7f735f;
}
.ranch-wallet-balances strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranch-wallet-balances a,
.ranch-building-actions a,
.ranch-building-actions button {
  padding: 7px;
  border: 0;
  border-radius: 10px;
  background: #e6f0d8;
  color: #2d7038;
  text-decoration: none;
  text-align: center;
  font-size: 9px;
  font-weight: 900;
}
.ranch-wallet-balances > div:nth-child(2) a {
  background: #f9e4d4;
  color: #914f31;
}

/* V23.4 compact wallet HUD and purchase context -------------------------- */
.ranch-wallet-pouch {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 92px;
  max-width: 118px;
}
.ranch-wallet-pouch > span:last-child {
  display: grid;
  min-width: 0;
  text-align: left;
}
.ranch-wallet-pouch > span:last-child b {
  overflow: hidden;
  color: #fff3c2;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-wallet-pouch > span:last-child small {
  overflow: hidden;
  max-width: 66px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-wallet-balances.is-single {
  grid-template-columns: minmax(0, 1fr);
}
.ranch-wallet-balances.is-single:has(.is-historical) {
  grid-template-columns: 1.3fr 0.9fr;
}
.ranch-wallet-balances .is-historical {
  border-style: dashed;
  background: #f5ecd4;
}
.ranch-wallet-balances .is-historical span {
  color: #76684e;
  font-size: 8px;
}
.ranch-wallet-inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.ranch-wallet-panel-note {
  margin: 0 0 8px;
  color: #6f654f;
  font-size: 9px;
  line-height: 1.45;
}
@media (max-width: 359px) {
  .ranch-wallet-pouch {
    min-width: 78px;
    max-width: 92px;
  }
  .ranch-wallet-pouch > span:last-child b {
    display: none;
  }
  .ranch-wallet-balances.is-single:has(.is-historical) {
    grid-template-columns: 1fr;
  }
}

.ranch-text-link {
  display: block;
  color: #59745d;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
}
.ranch-building-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ranch-building-heading .game-icon {
  width: 52px;
  height: 52px;
}
.ranch-building-sheet .farm-sheet-body > p {
  margin: 9px 1px 12px;
  color: #657566;
  font-size: 10px;
  line-height: 1.45;
}
.ranch-building-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.ranch-building-actions a,
.ranch-building-actions button {
  min-height: 38px;
  display: grid;
  place-items: center;
}
.ranch-building-actions .is-primary {
  background: #3f8b47;
  color: #fff;
}
.farm-animal-heading {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
}
.farm-animal-heading > .game-icon {
  width: 42px;
  height: 42px;
}
.farm-contract-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 11px 0;
}
.farm-contract-grid div {
  min-width: 0;
  padding: 8px;
  border-radius: 12px;
  background: #eff3e8;
}
.farm-contract-grid dt {
  font-size: 8px;
  color: #758173;
}
.farm-contract-grid dd {
  margin: 3px 0 0;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.farm-grade-list {
  display: grid;
  gap: 6px;
  margin: 11px 0;
}
.farm-grade {
  display: grid;
  grid-template-columns: 17px 34px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #f1f5eb;
  cursor: pointer;
}
.farm-grade.is-selected {
  border-color: #58a451;
  background: #e7f4dc;
}
.farm-grade.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.farm-grade input {
  accent-color: #438e43;
}
.farm-grade .game-icon {
  width: 34px;
  height: 34px;
}
.farm-grade strong,
.farm-grade small {
  display: block;
}
.farm-grade small {
  margin-top: 2px;
  color: #778174;
  font-size: 8px;
}
.farm-grade b {
  font-size: 9px;
}
.farm-safe-note {
  margin: 10px 3px 0;
  color: #778174;
  font-size: 8px;
  text-align: center;
}
.farm-character-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0;
}
.farm-character-list button {
  min-width: 0;
  padding: 4px 3px 6px;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #f1f5eb;
  color: var(--ranch-ink);
}
.farm-character-list button.is-selected {
  border-color: #4d994b;
  background: #e5f2d8;
}
.farm-character-list span {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  margin-bottom: 3px;
  border-radius: 9px;
  background-color: #dce9c7;
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 0 0;
}
.farm-character-list strong,
.farm-character-list small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.farm-character-list strong {
  font-size: 9px;
}
.farm-character-list small {
  font-size: 7px;
  color: #748072;
}
.farm-empty {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  width: min(80%, 280px);
  padding: 20px;
  border: 2px solid #e3bd76;
  border-radius: 22px;
  background: rgba(255, 248, 232, 0.94);
  box-shadow: var(--ranch-shadow);
  text-align: center;
}
.farm-empty > .game-icon {
  width: 60px;
  height: 60px;
}
.farm-empty p {
  margin: 5px 0 12px;
  color: #657466;
  font-size: 10px;
}
.farm-empty a {
  padding: 8px 16px;
  border-radius: 11px;
  background: var(--ranch-leaf);
  color: #fff;
  text-decoration: none;
  font-size: 10px;
  font-weight: 900;
}
.ranch-rotate {
  display: none;
}
@keyframes ranch-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ranch-rise {
  from {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@keyframes ranch-hint {
  0%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 359px) {
  .farm-game {
    min-height: 520px;
  }
  .ranch-status-plate {
    max-width: 205px;
  }
  .ranch-status-plate > span:nth-child(2) {
    max-width: 92px;
  }
  .ranch-wallet-pouch {
    width: 66px;
  }
  .ranch-compass-menu {
    grid-template-columns: repeat(4, 1fr);
  }
  .farm-character-list {
    grid-template-columns: repeat(2, 1fr);
    max-height: 190px;
    overflow: auto;
  }
  .farm-character-list span {
    aspect-ratio: 1.5/1;
  }
  .farm-sheet {
    bottom: 82px;
  }
}
@media (min-width: 431px) {
  .farm-game {
    border-radius: 22px;
  }
  .little-ranch-page {
    padding: 14px;
  }
  .farm-game {
    height: calc(100dvh - 28px);
    min-height: min(568px, calc(100dvh - 28px));
    max-height: 932px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .ranch-rotate {
    position: absolute;
    z-index: 100;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    padding: 30px;
    background: linear-gradient(160deg, #35634b, #213f34);
    color: #fff;
    text-align: center;
  }
  .ranch-rotate .game-icon {
    width: 74px;
    height: 74px;
  }
  .ranch-rotate strong {
    font-size: 17px;
  }
  .ranch-rotate small {
    max-width: 260px;
    color: #dce9db;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* V15 — one Ranch Board entry, one catalog sheet and one contextual edit toolbar. */
.ranch-game-button--decorate {
  grid-template-columns: 38px minmax(0, 1fr);
  width: 100%;
  margin: 0 0 9px;
  text-align: left;
  border-color: #5c8d50;
  background: linear-gradient(145deg, #edf6d4, #cfe6b4);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.72),
    0 3px 0 #648d4f;
  color: #315f3b;
}
.ranch-game-button--decorate .game-icon {
  width: 36px;
  height: 36px;
}
.ranch-game-button--decorate > span:last-child {
  display: grid;
  justify-self: stretch;
}
.ranch-game-button--decorate strong {
  font:
    800 14px Georgia,
    serif;
}
.ranch-game-button--decorate small {
  color: #637557;
  font-size: 8px;
}

.farm-game.is-decoration-mode .ranch-decoration-sheet {
  display: flex;
  flex-direction: column;
  top: auto;
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: calc(100% - 14px);
  height: min(34dvh, 274px);
  max-height: 274px;
  padding: 12px 12px 10px;
  overflow: hidden;
  transform: translateX(-50%);
  border: 4px solid #89532f;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff8df, #f2dfad);
  box-shadow:
    inset 0 0 0 2px #efc879,
    inset 0 3px rgba(255, 255, 255, 0.8),
    0 6px 0 #613c26,
    0 12px 28px rgba(22, 49, 29, 0.34);
  backdrop-filter: none;
  animation: ranch-rise 0.2s ease-out;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet::before,
.farm-game.is-decoration-mode .ranch-decoration-sheet::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1ad, #c9842c 58%, #71401e);
}
.farm-game.is-decoration-mode .ranch-decoration-sheet::before {
  left: 9px;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet::after {
  right: 9px;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet .farm-sheet-grabber {
  display: none;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet .farm-sheet-close {
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet .farm-sheet-title {
  flex: 0 0 auto;
  min-height: 45px;
  padding: 0 43px 7px 0;
  border-bottom: 1px solid rgba(151, 98, 47, 0.22);
}
.farm-game.is-decoration-mode
  .ranch-decoration-sheet
  .farm-sheet-title--leading-icon {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 7px;
}
.farm-game.is-decoration-mode
  .ranch-decoration-sheet
  .farm-sheet-title
  .farm-sheet-icon {
  width: 40px;
  height: 40px;
  margin: 0;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet .farm-sheet-title h2 {
  margin: 0;
  color: #315440;
  font-size: 17px;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet .farm-sheet-title > b {
  padding: 4px 7px;
  border-radius: 999px;
  background: #e4f0cb;
  color: #397044;
  font-size: 9px;
}
.farm-game.is-decoration-mode .ranch-decoration-sheet .farm-sheet-body {
  overflow-y: auto;
  padding: 7px 1px 3px;
}
.ranch-decoration-categories {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 1px 1px 6px;
  scrollbar-width: none;
}
.ranch-decoration-categories::-webkit-scrollbar {
  display: none;
}
.ranch-decoration-categories button,
.ranch-decoration-card button,
.ranch-decoration-confirm button,
.ranch-decoration-help button {
  min-height: 34px;
  border: 1px solid #bc8547;
  border-radius: 11px;
  background: linear-gradient(#fff5d7, #ead19a);
  box-shadow: 0 2px 0 #936035;
  color: #6b4b2e;
  font-size: 8px;
  font-weight: 900;
}
.ranch-decoration-categories button {
  flex: 0 0 auto;
  min-width: 66px;
  padding: 5px 9px;
}
.ranch-decoration-categories button.is-active {
  border-color: #438548;
  background: #dcefc9;
  box-shadow:
    inset 0 0 0 1px #83b877,
    0 2px 0 #5e9158;
  color: #2e713b;
}
.ranch-decoration-catalog {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 1px 2px 7px;
}
.ranch-decoration-card {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 76px;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid #d6ae68;
  border-radius: 15px;
  background: rgba(255, 252, 229, 0.9);
  box-shadow:
    inset 0 1px #fff,
    0 2px 0 rgba(126, 77, 36, 0.14);
}
.ranch-decoration-card.is-locked {
  filter: saturate(0.55);
  opacity: 0.72;
}
.ranch-decoration-thumb {
  width: 54px;
  height: 54px;
  background: center/contain no-repeat;
  filter: drop-shadow(0 3px 2px rgba(69, 45, 24, 0.2));
}
.ranch-decoration-card > div {
  display: grid;
  min-width: 0;
}
.ranch-decoration-card small {
  overflow: hidden;
  color: #987648;
  font-size: 7.5px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-decoration-card strong {
  color: #345841;
  font:
    800 13px Georgia,
    serif;
  line-height: 1.18;
}
.ranch-decoration-card div > span {
  margin-top: 3px;
  color: #6e7157;
  font-size: 8px;
  line-height: 1.25;
}
.ranch-decoration-card button {
  min-width: 58px;
  padding: 5px 9px;
}
.ranch-decoration-card button:disabled {
  opacity: 0.6;
  box-shadow: none;
}
.ranch-decoration-unlock {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 3px 2px 7px;
  padding: 11px 12px;
  border: 1px solid #d2a45c;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(255, 252, 226, 0.98),
    rgba(230, 241, 198, 0.96)
  );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.9),
    0 2px 0 rgba(126, 77, 36, 0.16);
  color: #405c42;
}
.ranch-decoration-unlock-icon {
  width: 38px;
  height: 38px;
  margin-top: 0;
  filter: drop-shadow(0 2px 1px rgba(70, 62, 35, 0.18));
}
.ranch-decoration-unlock-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.ranch-level-guide-full {
  grid-column: 1 / -1;
  width: 100%;
}
.ranch-decoration-unlock-copy > small {
  color: #92703e;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}
.ranch-decoration-unlock-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.ranch-decoration-unlock-title strong {
  min-width: 0;
  color: #31573d;
  font:
    900 14px/1.15 Georgia,
    serif;
}
.ranch-decoration-unlock-title span {
  flex: 0 0 auto;
  max-width: 48%;
  padding: 4px 7px;
  border: 1px solid rgba(83, 137, 72, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 238, 0.7);
  color: #4c714f;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}
.ranch-decoration-unlock-copy p {
  margin: 0;
  color: #49624b;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.28;
}
.ranch-decoration-level-progress {
  height: 6px;
  margin-top: 1px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(120, 100, 56, 0.18);
  box-shadow: inset 0 1px 1px rgba(69, 59, 35, 0.18);
}
.ranch-decoration-level-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62aa4e, #9cc957);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.45);
  transition: width 0.28s ease-out;
}
.ranch-decoration-unlock-copy > span {
  color: #72806b;
  font-size: 8px;
  line-height: 1.3;
}
.ranch-decoration-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin: 2px 2px 0;
}
.ranch-decoration-help span {
  color: #687564;
  font-size: 8.5px;
  line-height: 1.25;
}
@media (max-width: 359px) {
  .ranch-decoration-unlock {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 7px;
    padding: 9px;
  }
  .ranch-decoration-unlock-icon {
    width: 32px;
    height: 32px;
    margin-top: 0;
  }
  .ranch-decoration-unlock-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .ranch-decoration-unlock-title span {
    max-width: 100%;
    padding: 3px 6px;
  }
  .ranch-decoration-unlock-copy p {
    font-size: 9px;
  }
}
.ranch-decoration-help button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
}
.ranch-decoration-confirm {
  position: absolute;
  z-index: 4;
  inset: auto 10px 9px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 2px solid #ba7b3f;
  border-radius: 14px;
  background: #fff3ce;
  box-shadow: 0 5px 14px rgba(67, 42, 25, 0.24);
}
.ranch-decoration-confirm[hidden] {
  display: none;
}
.ranch-decoration-confirm strong,
.ranch-decoration-confirm span {
  grid-column: 1;
}
.ranch-decoration-confirm strong {
  color: #6e4129;
  font-size: 9px;
}
.ranch-decoration-confirm span {
  color: #806b51;
  font-size: 7px;
}
.ranch-decoration-confirm button {
  grid-row: 1/3;
  padding: 5px 7px;
}
.ranch-decoration-confirm .is-danger {
  border-color: #ad5544;
  background: #f7d4bd;
  color: #843c31;
}

.ranch-decoration-toolbar {
  position: absolute;
  z-index: 36;
  left: 50%;
  bottom: calc(88px + min(34dvh, 274px) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: auto 42px;
  align-items: center;
  width: calc(100% - 18px);
  min-height: 77px;
  gap: 4px;
  padding: 5px 6px;
  transform: translateX(-50%);
  border: 3px solid #85512f;
  border-radius: 17px;
  background: linear-gradient(#fff2c9, #e8ca8e);
  box-shadow:
    inset 0 1px #fff,
    0 4px 0 #603d27,
    0 8px 18px rgba(31, 56, 32, 0.28);
}
.ranch-decoration-toolbar[hidden] {
  display: none;
}
.farm-game.is-decoration-catalog-open .ranch-decoration-toolbar {
  display: none;
}
.ranch-decoration-toolbar > span {
  display: grid;
  grid-column: 1 / -1;
  min-width: 0;
  padding: 0 4px 2px;
}
.ranch-decoration-toolbar > span small {
  overflow: hidden;
  color: #3f7d49;
  font-size: 6.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-decoration-toolbar > span small.is-invalid {
  color: #b54136;
}
.ranch-decoration-toolbar > span strong {
  overflow: hidden;
  color: #4d4e32;
  font:
    800 10px Georgia,
    serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-decoration-toolbar button {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 2px;
  border: 1px solid #ad773e;
  border-radius: 11px;
  background: #fff4d1;
  box-shadow: 0 2px 0 #8b5931;
  color: #694327;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.ranch-decoration-toolbar button small {
  font-size: 6px;
  line-height: 1;
}
.ranch-decoration-toolbar button .game-icon {
  width: 25px;
  height: 25px;
}
.ranch-decoration-toolbar button.is-save {
  border-color: #397c43;
  background: linear-gradient(#69b85f, #3e8c47);
  color: #fff;
  box-shadow: 0 2px 0 #286533;
}
.ranch-decoration-toolbar button:disabled {
  opacity: 0.48;
  box-shadow: none;
}
.farm-game.is-decoration-mode .ranch-hud,
.farm-game.is-decoration-mode .ranch-secondary-hud,
.farm-game.is-decoration-mode .ranch-farm-dock {
  pointer-events: none;
  filter: saturate(0.7) brightness(0.92);
}
.farm-game.is-decoration-mode .farm-context-actions,
.farm-game.is-decoration-mode [data-guided-care],
.farm-game.is-decoration-mode [data-guided-result] {
  display: none !important;
}
.farm-game.is-decoration-mode [data-farm-canvas].is-placing-decoration {
  cursor: crosshair;
}

@media (max-width: 359px) {
  .ranch-decoration-toolbar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
  }
  .ranch-decoration-toolbar button {
    min-width: 38px;
    min-height: 40px;
  }
  .ranch-decoration-toolbar > span strong {
    font-size: 9px;
  }
}
@media (max-height: 650px) {
  .farm-game.is-decoration-mode .ranch-decoration-sheet {
    height: 218px;
  }
  .ranch-decoration-toolbar {
    bottom: calc(306px + env(safe-area-inset-bottom));
  }
}

/* Little Ranch V21: member announcement, guide, and invited-member panels. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.ranch-announcement-sheet {
  width: min(390px, calc(100% - 30px));
  max-height: min(560px, calc(100dvh - 140px));
}
.ranch-announcement-body {
  display: grid;
  gap: 13px;
}
.ranch-announcement-body time {
  justify-self: start;
  padding: 4px 9px;
  border: 1px solid #d6ad68;
  border-radius: 99px;
  background: #fff5ce;
  color: #8a6742;
  font-size: 9px;
  font-weight: 800;
}
.ranch-announcement-body [data-announcement-body] {
  padding: 14px;
  border: 1px dashed #d2aa64;
  border-radius: 15px;
  background: linear-gradient(
    145deg,
    rgba(255, 253, 235, 0.92),
    rgba(238, 247, 216, 0.88)
  );
  color: #405a42;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
}
.ranch-help-sheet,
.ranch-referral-sheet {
  width: min(430px, calc(100% - 26px));
  max-height: min(680px, calc(100dvh - 112px));
}
.ranch-help-body,
.ranch-referral-body {
  display: grid;
  gap: 10px;
}
.ranch-panel-search input,
.ranch-referral-filters input,
.ranch-referral-filters select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #c99d5c;
  border-radius: 11px;
  outline: none;
  background: #fffdf1;
  color: #31533a;
  font:
    700 11px system-ui,
    sans-serif;
}
.ranch-panel-search input:focus,
.ranch-referral-filters input:focus,
.ranch-referral-filters select:focus {
  border-color: #57935d;
  box-shadow: 0 0 0 2px rgba(73, 137, 83, 0.18);
}
.ranch-help-categories {
  display: flex;
  gap: 7px;
  min-height: 41px;
  padding: 2px 1px 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.ranch-help-categories button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #c58c49;
  border-radius: 99px;
  background: #fff1c8;
  color: #6b4b2e;
  font-size: 9px;
  font-weight: 900;
}
.ranch-help-categories button.is-active {
  border-color: #43844c;
  background: #d9eec7;
  color: #2e6a3c;
  box-shadow: 0 2px 0 #34713e;
}
.ranch-panel-status {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  background: #fff6d7;
  color: #756344;
  font-size: 10px;
  text-align: center;
}
.ranch-help-list,
.ranch-referral-list {
  display: grid;
  gap: 9px;
}
.ranch-help-item {
  overflow: hidden;
  border: 1px solid #d5a257;
  border-radius: 15px;
  background: linear-gradient(145deg, #fffbed, #f4e9bd);
  box-shadow: 0 3px 0 rgba(167, 109, 54, 0.65);
}
.ranch-help-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 3px 8px;
  align-items: center;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}
.ranch-help-item summary::-webkit-details-marker {
  display: none;
}
.ranch-help-item summary span {
  grid-column: 1;
  color: #94704a;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ranch-help-item summary strong {
  grid-column: 1;
  color: #31553b;
  font:
    800 13px/1.2 Georgia,
    serif;
}
.ranch-help-item summary i {
  grid-column: 2;
  grid-row: 1 / 3;
  color: #3d7d47;
  font: 900 20px/1 system-ui;
  transition: transform 0.18s ease;
}
.ranch-help-item[open] summary i {
  transform: rotate(45deg);
}
.ranch-help-answer {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px dashed #d8b679;
  color: #5c5b48;
  font-size: 10px;
  line-height: 1.5;
}
.ranch-help-answer p {
  margin: 10px 0 0;
}
.ranch-help-answer ol {
  margin: 0;
  padding-left: 20px;
}
.ranch-help-image {
  padding: 0;
  overflow: hidden;
  border: 2px solid #bf8747;
  border-radius: 13px;
  background: #b9d98b;
  box-shadow: 0 3px 0 #84572e;
}
.ranch-help-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.ranch-help-preview {
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 22px;
  border: 0;
  background: rgba(34, 54, 40, 0.82);
}
.ranch-help-preview img {
  width: 100%;
  max-height: 100%;
  border: 4px solid #fff0c5;
  border-radius: 15px;
  object-fit: contain;
}
.ranch-referral-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.ranch-referral-summary article {
  display: grid;
  gap: 2px;
  padding: 9px 6px;
  border: 1px solid #cfaa69;
  border-radius: 12px;
  background: linear-gradient(#f1f8dc, #dbeabf);
  text-align: center;
}
.ranch-referral-summary strong {
  color: #397546;
  font:
    900 17px/1 Georgia,
    serif;
}
.ranch-referral-summary small {
  color: #766249;
  font-size: 8px;
  font-weight: 800;
}
.ranch-referral-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(100px, 0.8fr) minmax(
      100px,
      0.8fr
    );
  gap: 7px;
}
.ranch-referral-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d5a257;
  border-radius: 15px;
  background: linear-gradient(145deg, #fffbed, #f5e8bb);
  box-shadow: 0 3px 0 rgba(167, 109, 54, 0.6);
}
.ranch-referral-card > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid #5a914f;
  border-radius: 50%;
  background: #dceec8;
  color: #35623d;
  font:
    900 17px/1 Georgia,
    serif;
}
.ranch-referral-card > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ranch-referral-card strong {
  overflow: hidden;
  color: #31553b;
  font:
    800 12px/1.2 Georgia,
    serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-referral-card small,
.ranch-referral-card time {
  color: #77664d;
  font-size: 8px;
}
.ranch-referral-card > b {
  padding: 5px 7px;
  border-radius: 99px;
  background: #eee0bd;
  color: #806544;
  font-size: 8px;
  white-space: nowrap;
}
.ranch-referral-card > b.is-active {
  background: #d5edcb;
  color: #317040;
}
.ranch-panel-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 13px;
  border: 1px dashed #cba366;
  border-radius: 15px;
  background: rgba(255, 249, 222, 0.82);
  color: #5e5a43;
  text-align: center;
}
.ranch-panel-empty .game-icon {
  width: 54px;
  height: 54px;
}
.ranch-panel-empty strong {
  color: #31553b;
  font:
    800 14px Georgia,
    serif;
}
.ranch-panel-empty small {
  max-width: 250px;
  font-size: 9px;
  line-height: 1.45;
}
@media (max-width: 380px) {
  .ranch-help-sheet,
  .ranch-referral-sheet {
    width: calc(100% - 18px);
  }
  .ranch-referral-filters {
    grid-template-columns: 1fr 1fr;
  }
  .ranch-referral-filters input {
    grid-column: 1 / -1;
  }
  .ranch-referral-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .ranch-referral-card > span {
    width: 36px;
    height: 36px;
  }
  .ranch-referral-card > b {
    grid-column: 2;
    justify-self: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .farm-game.is-decoration-mode .ranch-decoration-sheet {
    animation: none;
  }
}

/* Little Ranch V4: anchored controls, automatic ambience and premium in-world surfaces. */
.farm-game {
  --ranch-safe-bottom: max(12px, env(safe-area-inset-bottom));
  --mood-overlay: transparent;
  --mood-alpha: 0;
}
.farm-stage::after {
  background: linear-gradient(
    180deg,
    var(--mood-overlay),
    color-mix(in srgb, var(--mood-overlay) 72%, transparent)
  );
  opacity: var(--mood-alpha);
  transition:
    opacity 4.2s ease,
    background 4.2s ease;
  mix-blend-mode: multiply;
}
.farm-game[data-ambience="morning"] {
  --mood-overlay: rgba(255, 205, 128, 0.18);
  --mood-alpha: 0.42;
}
.farm-game[data-ambience="golden"] {
  --mood-overlay: rgba(224, 118, 58, 0.22);
  --mood-alpha: 0.58;
}
.farm-game[data-ambience="evening"] {
  --mood-overlay: rgba(77, 70, 128, 0.23);
  --mood-alpha: 0.62;
}
.farm-game[data-ambience="night"] {
  --mood-overlay: rgba(22, 43, 84, 0.34);
  --mood-alpha: 0.76;
}
.farm-game[data-ambience="evening"] .ranch-hud,
.farm-game[data-ambience="night"] .ranch-hud {
  filter: saturate(0.92) brightness(0.94);
  transition: filter 4.2s ease;
}

.ranch-hud {
  padding: max(9px, env(safe-area-inset-top)) 10px 8px;
  background: linear-gradient(
    180deg,
    rgba(24, 52, 36, 0.35),
    rgba(24, 52, 36, 0.06) 76%,
    transparent
  );
}
.ranch-status-plate {
  position: relative;
  gap: 8px;
  min-height: 55px;
  padding: 6px 10px 6px 6px;
  border: 3px solid #d4a05f;
  border-radius: 17px;
  background: linear-gradient(180deg, #b97a45 0, #87512f 52%, #704025 100%);
  box-shadow:
    inset 0 2px rgba(255, 244, 207, 0.38),
    inset 0 -3px rgba(75, 38, 22, 0.28),
    0 3.5px 0 rgb(83 49 28 / 81%);
}
.ranch-status-plate::before,
.ranch-status-plate::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1ad, #d3932f 55%, #77451f);
  box-shadow: 0 35px 0 #bc762a;
}
.ranch-status-plate::before {
  left: 4px;
}
.ranch-status-plate::after {
  right: 4px;
}
.farm-avatar {
  border: 3px solid #ffe4a3;
  border-radius: 13px;
  box-shadow:
    inset 0 -5px 10px rgba(39, 78, 39, 0.15),
    0 2px 0 rgba(86, 47, 27, 0.55);
}
.ranch-status-plate b {
  padding: 4px 6px;
  border: 1px solid #ffe18a;
  border-radius: 99px;
  background: linear-gradient(#ffe7a0, #dba84b);
  box-shadow:
    inset 0 1px #fff5ca,
    0 2px 0 #784c27;
  color: #62401f;
}
.ranch-wallet-pouch {
  position: relative;
  width: 70px;
  padding-bottom: 5px;
}
.ranch-wallet-pouch .game-icon {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 6px 5px rgba(41, 34, 22, 0.38));
  transition: transform 0.16s ease;
}
.ranch-wallet-pouch:active .game-icon {
  transform: translateY(2px) scale(0.96);
}
.ranch-wallet-pouch small {
  position: relative;
  min-width: 70px;
  max-width: 82px;
  margin-top: -5px;
  padding: 4px 7px;
  border: 2px solid #d3a45b;
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    rgba(63, 84, 51, 0.96),
    rgba(38, 64, 45, 0.96)
  );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.22),
    0 3px 8px rgba(28, 45, 29, 0.3);
  font-size: 8px;
  letter-spacing: 0.01em;
}

.ranch-compass {
  bottom: calc(var(--ranch-safe-bottom) + 7px);
  width: 76px;
  height: 76px;
  border: 3px solid #ffe4a0;
  background: radial-gradient(
    circle at 38% 30%,
    #fff5cc 0 20%,
    #d49a4d 66%,
    #81512d 100%
  );
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.55),
    0 7px 0 #604028,
    0 13px 28px rgba(26, 47, 29, 0.38);
  isolation: isolate;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.3s ease;
}
.ranch-compass::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -17px;
  width: 104px;
  height: 32px;
  transform: translateX(-50%);
  border: 3px solid #71452a;
  border-radius: 50%;
  background: linear-gradient(180deg, #ba7b45, #704127);
  box-shadow:
    inset 0 4px rgba(255, 220, 154, 0.28),
    0 7px 14px rgba(27, 47, 29, 0.3);
}
.ranch-compass::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 17px;
  width: 16px;
  height: 7px;
  border-radius: 50%;
  transform: rotate(-28deg);
  background: rgba(255, 255, 255, 0.42);
  pointer-events: none;
}
.ranch-compass .game-icon {
  position: relative;
  z-index: 1;
  width: 57px;
  height: 57px;
  filter: drop-shadow(0 2px 2px rgba(79, 47, 24, 0.24));
}
.ranch-compass small {
  z-index: 3;
  bottom: -8px;
  padding: 3px 9px;
  border: 1px solid #e6b868;
  border-radius: 9px;
  background: linear-gradient(#84512e, #603b25);
  box-shadow: 0 2px 0 rgba(67, 39, 22, 0.7);
  font-size: 8px;
  letter-spacing: 0.03em;
}
.ranch-compass:active,
.ranch-compass[aria-expanded="true"] {
  transform: translateX(-50%) translateY(3px) scale(0.97);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.45),
    0 4px 0 #604028,
    0 9px 19px rgba(28, 49, 29, 0.3);
}

.ranch-compass-menu {
  bottom: calc(var(--ranch-safe-bottom) + 108px);
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: calc(100% - 24px);
  padding: 15px 12px 12px;
  border: 4px solid #86532f;
  border-radius: 23px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 24%),
    repeating-linear-gradient(
      90deg,
      rgba(147, 91, 45, 0.055) 0 2px,
      transparent 2px 16px
    ),
    linear-gradient(180deg, #fff6d9, #f3dfb5);
  box-shadow:
    inset 0 0 0 2px #e8bd72,
    inset 0 3px rgba(255, 255, 255, 0.66),
    0 8px 0 rgba(91, 53, 30, 0.62),
    0 17px 32px rgba(24, 48, 29, 0.28);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translate(-50%, 14px) scale(0.96);
  transform-origin: 50% 100%;
  animation: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ranch-compass-menu::before,
.ranch-compass-menu::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2ae, #c7832b 58%, #72401e);
  box-shadow: 0 116px 0 #b36e29;
}
.ranch-compass-menu::before {
  left: 8px;
}
.ranch-compass-menu::after {
  right: 8px;
}
.ranch-compass-menu.is-open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.ranch-compass-menu.is-closing {
  pointer-events: none;
}
.ranch-compass-menu button {
  min-height: 63px;
  padding: 4px 3px 6px;
  border: 1px solid rgba(181, 135, 74, 0.36);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 253, 239, 0.86),
    rgba(237, 230, 194, 0.66)
  );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(155, 111, 59, 0.18);
  transition:
    transform 0.14s ease,
    background 0.14s ease;
}
.ranch-compass-menu button:active,
.ranch-compass-menu button:focus-visible {
  transform: translateY(1px) scale(0.97);
  background: linear-gradient(#e9f2d7, #d5e5bd);
}
.ranch-compass-menu .game-icon {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 2px rgba(71, 54, 31, 0.18));
}
.ranch-compass-menu small {
  margin-top: -1px;
  font-size: 8px;
  letter-spacing: 0.01em;
}

.farm-context-actions {
  bottom: calc(var(--ranch-safe-bottom) + 103px);
  border: 3px solid #976039;
  background: linear-gradient(180deg, #fff6d8, #edddb8);
  box-shadow:
    inset 0 0 0 2px #e8bf78,
    0 6px 0 rgba(98, 57, 31, 0.56),
    0 14px 26px rgba(28, 54, 32, 0.24);
}
.farm-sheet {
  bottom: calc(var(--ranch-safe-bottom) + 98px);
}
.farm-animal-bubble {
  left: var(--bubble-x, 56%);
  top: var(--bubble-y, 35%);
  min-width: 104px;
  max-width: min(188px, 72vw);
  padding: 10px 13px 11px;
  transform: translate(-50%, -100%);
  border: 3px solid #9b6238;
  border-radius: 19px 19px 16px 16px;
  background: linear-gradient(180deg, #fffdf0, #f6e5bd);
  box-shadow:
    inset 0 0 0 2px #f0c979,
    inset 0 2px rgba(255, 255, 255, 0.8),
    0 6px 0 rgba(100, 59, 33, 0.42),
    0 13px 24px rgba(26, 52, 31, 0.22);
  color: #38523e;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  animation: ranch-bubble-pop 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
.farm-animal-bubble::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 8px;
  width: 8px;
  height: 5px;
  border-radius: 80% 20%;
  transform: rotate(-28deg);
  background: #78a951;
  box-shadow: -5px 2px 0 #4f843c;
}
.farm-animal-bubble::after {
  bottom: -11px;
  left: 25px;
  width: 16px;
  height: 16px;
  border-right: 3px solid #9b6238;
  border-bottom: 3px solid #9b6238;
  background: #f6e5bd;
}
.farm-animal-bubble.tail-right::after {
  left: auto;
  right: 25px;
}
.farm-animal-bubble[data-bubble-kind="success"] {
  border-color: #568a45;
  background: linear-gradient(#fffdeb, #e9f2cc);
  box-shadow:
    inset 0 0 0 2px #c4db81,
    0 6px 0 rgba(64, 104, 50, 0.45),
    0 13px 24px rgba(26, 52, 31, 0.22);
}
.ranch-world-hint {
  padding: 6px 12px 7px;
  border: 2px solid #b57a43;
  border-radius: 12px;
  background: linear-gradient(#fff7dd, #ecd8ab);
  box-shadow:
    inset 0 0 0 1px #f8d98d,
    0 4px 0 rgba(101, 63, 35, 0.38),
    0 8px 16px rgba(33, 59, 34, 0.16);
  color: #49604c;
  font-size: 8px;
}
.ranch-world-hint::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 2px solid #b57a43;
  border-bottom: 2px solid #b57a43;
  background: #ecd8ab;
}
.farm-toast {
  padding: 10px 15px 11px;
  border: 3px solid #85512f;
  border-radius: 17px;
  background: linear-gradient(#fff8df, #ecd5a5);
  box-shadow:
    inset 0 0 0 2px #e8bd72,
    0 5px 0 rgba(88, 51, 29, 0.5),
    0 12px 24px rgba(26, 48, 29, 0.24);
  color: #3e5943;
  animation: ranch-toast-in 0.22s cubic-bezier(0.2, 0.85, 0.25, 1.2);
}
.farm-toast.is-notice::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #6c9a4b;
  box-shadow: 0 0 0 3px #dce9b9;
}
.farm-toast.is-error {
  border-color: #8f4637;
  background: linear-gradient(#fff1df, #efc4ac);
  box-shadow:
    inset 0 0 0 2px #dc8b68,
    0 5px 0 rgba(114, 53, 39, 0.52),
    0 12px 24px rgba(61, 32, 24, 0.24);
  color: #7a3029;
}
.farm-status-pill,
.farm-quality {
  border: 2px solid #9a693d;
  background: linear-gradient(#fff2d1, #e2c997);
  box-shadow: 0 4px 0 rgba(85, 52, 30, 0.42);
  color: #4b604b;
}

.ranch-rotate {
  border: 3px solid #c89a57;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 40%, #416d54, #203f34);
  box-shadow: inset 0 0 0 2px rgba(242, 210, 144, 0.25);
}
@keyframes ranch-bubble-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -88%) scale(0.78);
  }
  70% {
    transform: translate(-50%, -103%) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}
@keyframes ranch-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
@media (max-width: 359px) {
  .ranch-compass {
    width: 70px;
    height: 70px;
  }
  .ranch-compass .game-icon {
    width: 52px;
    height: 52px;
  }
  .ranch-compass-menu {
    bottom: calc(var(--ranch-safe-bottom) + 99px);
    gap: 5px;
    padding: 12px 9px 10px;
  }
  .ranch-compass-menu button {
    min-height: 57px;
  }
  .farm-context-actions {
    bottom: calc(var(--ranch-safe-bottom) + 94px);
  }
  .farm-sheet {
    bottom: calc(var(--ranch-safe-bottom) + 87px);
  }
}

/* Little Ranch V8 UI reliability: explicit dismissal, atlas VFX and stable typography. */
.farm-game,
.farm-game button,
.farm-game a,
.farm-game input {
  font-family:
    "Plus Jakarta Sans",
    ui-rounded,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
.farm-panel-backdrop {
  position: absolute;
  z-index: 33;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}
.farm-sheet {
  padding-top: 13px;
  scrollbar-width: thin;
  scrollbar-color: #b48b58 transparent;
}
.farm-sheet-grabber {
  display: block;
  width: 42px;
  height: 5px;
  margin: 0 auto 8px;
  border-radius: 99px;
  background: #c8b89d;
}
.farm-sheet-close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  filter: drop-shadow(0 2px 2px rgba(62, 40, 25, 0.22));
  cursor: pointer;
}
.farm-sheet-close:focus-visible {
  outline: 3px solid #f4c95e;
  outline-offset: 2px;
}
.farm-sheet-close:active {
  transform: translateY(2px) scale(0.94);
}
.farm-sheet-title > .game-icon {
  margin-right: 34px;
}
.farm-animal-bubble {
  --bubble-tail-scale: 1;
  min-width: 142px;
  min-height: 72px;
  max-width: min(198px, 78vw);
  padding: 20px 27px 23px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #38523e;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  isolation: isolate;
}
.farm-animal-bubble > span,
.ranch-world-hint > span {
  position: relative;
  z-index: 1;
}
.farm-animal-bubble::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -15px -25px;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v3/little-ranch-effects.webp");
  background-repeat: no-repeat;
  background-size: 400% 200%;
  background-position: 66.6667% 100%;
  box-shadow: none;
  filter: drop-shadow(0 7px 5px rgba(57, 39, 23, 0.28));
  transform: scaleX(var(--bubble-tail-scale));
  transform-origin: center;
}
.farm-animal-bubble::after {
  display: none;
}
.farm-animal-bubble.tail-right {
  --bubble-tail-scale: -1;
}
.farm-animal-bubble[data-bubble-kind="success"] {
  border: 0;
  background: none;
  box-shadow: none;
  color: #315337;
}
.ranch-world-hint {
  padding: 13px 23px 16px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #49604c;
  isolation: isolate;
}
.ranch-world-hint::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -12px -19px;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v3/little-ranch-effects.webp");
  background-repeat: no-repeat;
  background-size: 400% 200%;
  background-position: 66.6667% 100%;
  box-shadow: none;
  filter: drop-shadow(0 4px 3px rgba(57, 39, 23, 0.22));
  transform: none;
}

/* V8.1: centered mobile-game popup. The ranch remains full-bleed behind it. */
.farm-panel-backdrop {
  background: linear-gradient(
    180deg,
    rgba(24, 55, 37, 0.22),
    rgba(45, 83, 44, 0.42)
  );
  backdrop-filter: blur(2px) saturate(0.88);
  animation: ranch-backdrop-in 0.18s ease-out;
}
.farm-game.is-panel-open .farm-sheet {
  top: 50%;
  bottom: auto;
  width: calc(100% - 30px);
  max-height: calc(
    100dvh -
      max(104px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 72px)
  );
  padding: 17px 16px 16px;
  transform: translate(-50%, -50%);
  overflow: auto;
  border: 4px solid #89532f;
  border-radius: 27px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(180deg, #fff8df, #f4e3b9);
  box-shadow:
    inset 0 0 0 2px #efc879,
    inset 0 3px rgba(255, 255, 255, 0.85),
    0 7px 0 #613c26,
    0 17px 34px rgba(18, 43, 27, 0.42);
  backdrop-filter: none;
  animation: ranch-popup-in 0.24s cubic-bezier(0.2, 0.86, 0.28, 1.18);
}
.farm-game.is-panel-open .farm-sheet::before,
.farm-game.is-panel-open .farm-sheet::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1ad, #c9842c 58%, #71401e);
  pointer-events: none;
}
.farm-game.is-panel-open .farm-sheet::before {
  left: 10px;
}
.farm-game.is-panel-open .farm-sheet::after {
  right: 10px;
}
.farm-game.is-panel-open .farm-sheet > *:not(.farm-sheet-close) {
  position: relative;
  z-index: 1;
}
.farm-game.is-panel-open .farm-sheet-grabber {
  display: none;
}
.farm-game.is-panel-open .farm-sheet-close {
  top: 10px;
  right: 10px;
  width: 43px;
  height: 43px;
  filter: drop-shadow(0 3px 2px rgba(62, 40, 25, 0.32));
  transition:
    transform 0.14s ease,
    filter 0.14s ease;
}
.farm-game.is-panel-open .farm-sheet-title {
  min-height: 54px;
  margin: -5px -3px 8px;
  padding: 6px 48px 10px 4px;
  border-bottom: 2px solid rgba(161, 107, 57, 0.2);
}
.farm-game.is-panel-open .farm-sheet-title h2,
.farm-game.is-panel-open .farm-animal-heading h2,
.farm-game.is-panel-open .ranch-building-heading h2 {
  font-size: 18px;
  letter-spacing: -0.025em;
}
.farm-game.is-panel-open .farm-sheet-title > .game-icon {
  margin-right: 0;
}
.farm-game.is-panel-open .farm-character-list {
  gap: 8px;
  margin: 10px 0 12px;
}
.farm-game.is-panel-open .farm-character-list button {
  padding: 5px 4px 7px;
  border-radius: 15px;
  background: rgba(229, 239, 210, 0.82);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8);
}
.farm-game.is-panel-open .farm-character-list button.is-selected {
  border-color: #438f48;
  background: #e9f5d8;
  box-shadow:
    inset 0 0 0 1px #87be72,
    0 3px 0 rgba(54, 111, 57, 0.18);
}
.farm-game.is-panel-open .farm-primary-action {
  min-height: 49px;
  border: 2px solid #4c984b;
  border-radius: 16px;
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.22),
    0 5px 0 #286932,
    0 10px 18px rgba(42, 112, 53, 0.22);
  font-size: 13px;
}
.farm-game.is-panel-open .ranch-compass,
.farm-game.is-panel-open .ranch-compass-menu,
.farm-game.is-panel-open .farm-context-actions {
  opacity: 0;
  pointer-events: none;
}
@keyframes ranch-popup-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes ranch-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Little Ranch V9: one popup system with material-specific game surfaces. */
.farm-game.is-panel-open .farm-sheet[data-panel-kind] {
  isolation: isolate;
  transform-origin: 50% 58%;
}
.farm-game.is-panel-open .farm-sheet[data-panel-kind]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8.5px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 20px;
  pointer-events: none;
}
.farm-game.is-panel-open .farm-sheet[data-panel-kind="animal"] {
  background:
    radial-gradient(
      circle at 82% 13%,
      rgba(188, 220, 139, 0.4),
      transparent 24%
    ),
    linear-gradient(145deg, #fffbea, #ecf1d4);
  animation: ranch-panel-leaf 0.25s cubic-bezier(0.2, 0.86, 0.28, 1.18);
}
.farm-game.is-panel-open .farm-sheet[data-panel-kind="feed"] {
  background:
    radial-gradient(
      circle at 88% 10%,
      rgba(239, 190, 79, 0.34),
      transparent 25%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(151, 102, 52, 0.035) 0 2px,
      transparent 2px 15px
    ),
    linear-gradient(145deg, #fff7dc, #f0dcae);
  animation: ranch-panel-scoop 0.28s cubic-bezier(0.2, 0.9, 0.26, 1.2);
}
.farm-game.is-panel-open .farm-sheet[data-panel-kind="character"] {
  background:
    radial-gradient(
      circle at 84% 12%,
      rgba(80, 151, 101, 0.2),
      transparent 23%
    ),
    linear-gradient(145deg, #fff8df, #e8edd2);
  animation: ranch-panel-card 0.24s cubic-bezier(0.2, 0.86, 0.28, 1.18);
}
.farm-game.is-panel-open .farm-sheet[data-panel-kind="wallet"] {
  border-color: #a36b35;
  background:
    radial-gradient(
      circle at 86% 12%,
      rgba(255, 206, 74, 0.3),
      transparent 24%
    ),
    linear-gradient(145deg, #fff3c9, #ead09a);
  animation: ranch-panel-pouch 0.28s cubic-bezier(0.2, 0.92, 0.24, 1.22);
}
.farm-game.is-panel-open .farm-sheet[data-panel-kind="wood"] {
  border-color: #704228;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(113, 66, 35, 0.04) 0 2px,
      transparent 2px 17px
    ),
    linear-gradient(145deg, #fff0ca, #e4c080);
  box-shadow:
    inset 0 0 0 2px #d99d50,
    inset 0 3px rgba(255, 255, 255, 0.64),
    0 7px 0 #4c2e1d,
    0 17px 34px rgba(18, 43, 27, 0.42);
  animation: ranch-panel-plank 0.27s cubic-bezier(0.2, 0.86, 0.28, 1.18);
}
@keyframes ranch-panel-leaf {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) rotate(-1.2deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0) scale(1);
  }
}
@keyframes ranch-panel-scoop {
  from {
    opacity: 0;
    transform: translate(-50%, -43%) scale(0.86);
  }
  70% {
    transform: translate(-50%, -51%) scale(1.015);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes ranch-panel-card {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) rotate(0.8deg) scale(0.91);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0) scale(1);
  }
}
@keyframes ranch-panel-pouch {
  from {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.82);
  }
  65% {
    transform: translate(-50%, -51%) scale(1.02);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes ranch-panel-plank {
  from {
    opacity: 0;
    transform: translate(-50%, -47%) scaleX(0.9) scaleY(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .farm-game.is-panel-open .farm-sheet[data-panel-kind] {
    animation-duration: 0.01ms !important;
  }
  .farm-panel-backdrop {
    animation-duration: 0.01ms !important;
  }
}
@media (max-width: 359px) {
  .farm-game.is-panel-open .farm-sheet {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 64px);
    padding: 14px 12px;
  }
  .farm-game.is-panel-open .farm-character-list {
    grid-template-columns: repeat(2, 1fr);
    max-height: 230px;
  }
  .farm-game.is-panel-open .farm-character-list span {
    aspect-ratio: 1.35/1;
  }
}

/* Little Ranch V10 daily care */
.care-sprite {
  display: inline-block;
  width: 42px;
  height: 42px;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v10/runtime/little-ranch-care-atlas.webp");
  background-repeat: no-repeat;
  background-size: 400% 300%;
  filter: drop-shadow(0 2px 2px rgba(62, 40, 25, 0.2));
}
.care-bucket {
  background-position: 0 0;
}
.care-trough {
  background-position: 33.333% 0;
}
.care-pour {
  background-position: 66.667% 0;
}
.care-ripple {
  background-position: 100% 0;
}
.care-broom {
  background-position: 0 50%;
}
.care-debris-mud {
  background-position: 33.333% 50%;
}
.care-debris-straw {
  background-position: 66.667% 50%;
}
.care-debris-wool {
  background-position: 100% 50%;
}
.care-sparkle {
  background-position: 0 100%;
}
.care-board {
  background-position: 33.333% 100%;
}
.care-milk {
  background-position: 66.667% 100%;
}
.care-product {
  background-position: 100% 100%;
}
.ranch-routine-board {
  position: absolute;
  z-index: 15;
  top: 84px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 174px;
  padding: 3px 9px 4px 4px;
  border: 2px solid #8d5734;
  border-radius: 13px;
  background: linear-gradient(180deg, #e9b864, #a96932);
  box-shadow:
    inset 0 0 0 2px rgba(255, 226, 153, 0.55),
    0 4px 0 #613c26,
    0 8px 16px rgba(28, 54, 32, 0.24);
  color: #fff;
  text-align: left;
}
.ranch-routine-board .care-sprite {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}
.ranch-routine-board small {
  display: block;
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ranch-routine-board strong {
  display: block;
  font-size: 10px;
  line-height: 1.2;
}
.farm-game.is-panel-open .ranch-routine-board {
  opacity: 0;
  pointer-events: none;
}
.farm-context-actions [data-context-water] .care-sprite {
  width: 34px;
  height: 34px;
}
.ranch-routine-sheet {
  --care-green: #3f8c49;
}
.ranch-routine-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 10px;
}
.ranch-routine-progress > span {
  height: 12px;
  flex: 1;
  overflow: hidden;
  border: 2px solid #8c5b35;
  border-radius: 99px;
  background: #e2c898;
  box-shadow: inset 0 2px 3px rgba(75, 48, 28, 0.2);
}
.ranch-routine-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6fbd5f, #358b45);
  transition: width 0.35s ease;
}
.ranch-routine-progress strong {
  min-width: 34px;
  color: #315d3a;
  font-size: 11px;
}
.ranch-routine-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}
.ranch-routine-tabs button {
  min-height: 34px;
  border: 1px solid #c59b60;
  border-radius: 10px;
  background: #f4e7c7;
  color: #6a4a31;
  font-size: 9px;
  font-weight: 900;
}
.ranch-routine-tabs button.is-active {
  border-color: #397c46;
  background: #e1f0d5;
  color: #2f6b3c;
  box-shadow: inset 0 0 0 1px #79ad70;
}
.ranch-care-list,
.ranch-production-list,
.ranch-history-list {
  display: grid;
  gap: 7px;
}
.ranch-care-card,
.ranch-production-card,
.ranch-history-item,
.ranch-enclosure-card {
  padding: 8px;
  border: 1px solid #d4b780;
  border-radius: 14px;
  background: rgba(255, 252, 235, 0.76);
}
.ranch-care-card header,
.ranch-production-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ranch-care-card h3,
.ranch-production-card h3 {
  margin: 0;
  font-size: 11px;
}
.ranch-care-card header small,
.ranch-production-card small,
.ranch-history-item small {
  font-size: 8px;
  color: #816f59;
}
.ranch-care-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 7px;
}
.ranch-care-actions button,
.ranch-enclosure-card button {
  min-height: 34px;
  border: 1px solid #b98b52;
  border-radius: 10px;
  background: #fff3cf;
  color: #67442b;
  font-size: 9px;
  font-weight: 900;
}
.ranch-care-actions button.is-done,
.ranch-enclosure-card button.is-done {
  border-color: #65a66a;
  background: #e1f2d9;
  color: #347344;
}
.ranch-care-actions button:disabled,
.ranch-enclosure-card button:disabled {
  opacity: 0.72;
}
.ranch-condition {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ranch-condition span {
  width: 52px;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #dfcfaa;
}
.ranch-condition i {
  display: block;
  height: 100%;
  background: #56a858;
}
.ranch-condition b {
  font-size: 9px;
  color: #315d3a;
}
.ranch-enclosure-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.ranch-enclosure-card > span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ranch-enclosure-card > span > span > small {
  display: block;
  font-size: 10px;
}
.ranch-enclosure-card .care-sprite {
  width: 34px;
  height: 34px;
}
.ranch-production-card .care-sprite {
  width: 48px;
  height: 48px;
}
.ranch-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ranch-history-item strong {
  font-size: 10px;
}
.ranch-text-button {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #a67a48;
  border-radius: 10px;
  background: #f8e9c5;
  color: #6d492d;
  font-weight: 900;
}
.ranch-cleaning-help {
  margin: 2px 0 8px;
  color: #6e5c47;
  font-size: 9px;
}
.ranch-debris-field {
  position: relative;
  height: 230px;
  overflow: hidden;
  border: 2px solid #8d623b;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(127, 174, 82, 0.28),
      transparent 28%
    ),
    linear-gradient(#c4d77f 0 56%, #b98958 57%);
  box-shadow: inset 0 0 20px rgba(72, 49, 28, 0.18);
}
.ranch-debris-field button {
  position: absolute;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  background: transparent;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}
.ranch-debris-field button[data-debris="0"] {
  left: 8%;
  top: 14%;
}
.ranch-debris-field button[data-debris="1"] {
  right: 9%;
  top: 31%;
}
.ranch-debris-field button[data-debris="2"] {
  left: 37%;
  bottom: 4%;
}
.ranch-debris-field button .care-sprite {
  width: 72px;
  height: 72px;
}
.ranch-debris-field button.is-cleaning {
  animation: ranch-sweep 0.55s ease;
}
.ranch-debris-field button.is-clean {
  opacity: 0;
  transform: scale(0.45);
  pointer-events: none;
}
.ranch-cleaning-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 900;
  color: #315d3a;
}
.ranch-cleaning-status .care-sprite {
  width: 36px;
  height: 36px;
  animation: ranch-sparkle 0.7s ease both;
}
.ranch-cleaning-farmer {
  position: absolute;
  z-index: 3;
  left: 45%;
  top: 34%;
  width: 54px;
  height: 66px;
  transform: translate(-50%, -50%);
  transition:
    left 0.38s ease,
    top 0.38s ease;
  filter: drop-shadow(0 4px 3px rgba(41, 55, 29, 0.28));
}
.ranch-cleaning-farmer.is-sweeping {
  animation: ranch-farmer-sweep 0.55s ease;
}
@keyframes ranch-sweep {
  50% {
    transform: translateY(-5px) rotate(-5deg);
    filter: brightness(1.2);
  }
}
@keyframes ranch-farmer-sweep {
  35% {
    transform: translate(-50%, -50%) rotate(-9deg);
  }
  70% {
    transform: translate(-50%, -50%) rotate(7deg);
  }
}
@keyframes ranch-sparkle {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-18deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@media (max-width: 359px) {
  .ranch-routine-board {
    top: 76px;
    left: 9px;
  }
  .ranch-routine-board .care-sprite {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  .ranch-debris-field {
    height: 205px;
  }
}

/* V10.1 HUD alignment and dismissible empty-ranch notice. */
.ranch-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: start;
  column-gap: 8px;
}
.ranch-status-plate {
  justify-self: start;
}
.ranch-wallet-pouch {
  justify-self: end;
  min-height: 52px;
  margin-top: 5px;
}
.ranch-wallet-pouch .game-icon {
  transform: translateY(-10px);
}
.ranch-wallet-pouch:active .game-icon {
  transform: translateY(-16px) scale(0.96);
}
.ranch-wallet-pouch small {
  margin-top: -23px;
}
.ranch-routine-board {
  top: 72px;
  left: 10px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px;
  width: min(174px, calc(100% - 100px));
  min-height: 52px;
  padding: 4px 10px 5px 5px;
  border-radius: 14px;
}
.ranch-routine-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 2px 2px rgba(62, 40, 25, 0.24));
}
.ranch-routine-board > span:last-child {
  min-width: 0;
}
.ranch-routine-board small {
  font-size: 7px;
  letter-spacing: 0.07em;
}
.ranch-routine-board strong {
  overflow: hidden;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-routine-title-icon {
  width: 52px;
  height: 52px;
  margin-right: 34px;
  filter: drop-shadow(0 3px 2px rgba(62, 40, 25, 0.2));
}

.farm-empty {
  isolation: isolate;
  width: min(78%, 286px);
  padding: 29px 21px 20px;
  border: 4px solid #8a522d;
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 50% 8%,
      rgba(255, 255, 255, 0.75),
      transparent 27%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(137, 87, 43, 0.035) 0 2px,
      transparent 2px 17px
    ),
    linear-gradient(155deg, #fff9df, #f1dfae);
  box-shadow:
    inset 0 0 0 2px #efc674,
    inset 0 3px rgba(255, 255, 255, 0.84),
    0 7px 0 #603a24,
    0 18px 35px rgba(26, 50, 30, 0.35);
  animation: ranch-empty-pop 0.28s cubic-bezier(0.2, 0.88, 0.3, 1.2);
}
.farm-empty::before,
.farm-empty::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1ad, #c9842c 58%, #71401e);
}
.farm-empty::before {
  left: 12px;
}
.farm-empty::after {
  right: 12px;
}
.farm-empty-ribbon {
  position: absolute;
  top: -13px;
  left: 50%;
  min-width: 104px;
  padding: 5px 14px;
  transform: translateX(-50%);
  border: 2px solid #774225;
  border-radius: 10px;
  background: linear-gradient(#bd7840, #854a2a);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.3),
    0 3px 0 #5c341f;
  color: #fff4d4;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.farm-empty-close {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 7px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background-color: transparent;
  filter: drop-shadow(0 3px 2px rgba(62, 40, 25, 0.3));
  cursor: pointer;
}
.farm-empty-close:active {
  transform: translateY(2px) scale(0.94);
}
.farm-empty-icon {
  width: 70px !important;
  height: 70px !important;
  margin: -2px 0 -4px;
  filter: drop-shadow(0 4px 3px rgba(62, 40, 25, 0.25));
}
.farm-empty > strong {
  color: #35563b;
  font-size: 17px;
  line-height: 1.2;
  text-shadow: 0 1px #fff;
}
.farm-empty p {
  max-width: 230px;
  margin: 7px 0 15px;
  color: #6b705d;
  font-size: 10px;
  line-height: 1.45;
}
.farm-empty a {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 16px 8px;
  border: 2px solid #4b914a;
  border-radius: 13px;
  background: linear-gradient(#61b85d, #3d8c47);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.22),
    0 4px 0 #286833,
    0 8px 14px rgba(46, 104, 48, 0.2);
  font-size: 10px;
  text-shadow: 0 1px rgba(0, 0, 0, 0.18);
}
.farm-empty a .game-icon {
  width: 24px;
  height: 24px;
}
.farm-empty.is-leaving {
  pointer-events: none;
  animation: ranch-empty-out 0.18s ease-in forwards;
}
@keyframes ranch-empty-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.84) rotate(-1deg);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
}
@keyframes ranch-empty-out {
  to {
    opacity: 0;
    transform: translate(-50%, -54%) scale(0.9);
  }
}
@media (max-width: 359px) {
  .ranch-hud {
    grid-template-columns: minmax(0, 1fr) 66px;
  }
  .ranch-wallet-pouch .game-icon {
    transform: translateY(-17px);
  }
  .ranch-wallet-pouch small {
    margin-top: -22px;
  }
  .ranch-routine-board {
    top: 68px;
    left: 9px;
    grid-template-columns: 36px minmax(0, 1fr);
    width: min(166px, calc(100% - 84px));
    min-height: 46px;
  }
  .ranch-routine-icon {
    width: 36px;
    height: 36px;
  }
  .farm-empty {
    width: calc(100% - 38px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .farm-empty,
  .farm-empty.is-leaving {
    animation-duration: 0.01ms !important;
  }
}

/* Collision-safe secondary HUD rail: mission and guidance share measured columns. */
.ranch-secondary-hud {
  position: absolute;
  z-index: 15;
  top: 72px;
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: clamp(156px, 42vw, 174px) minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.ranch-secondary-hud .ranch-routine-board {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  pointer-events: auto;
}
.ranch-secondary-hud .ranch-world-hint {
  position: relative;
  top: auto;
  left: auto;
  justify-self: start;
  max-width: 100%;
  margin: 0;
  padding: 10px 14px 12px;
  transform: none;
  color: #49604c;
  font-size: clamp(7px, 1.8vw, 8px);
  line-height: 1.2;
  white-space: nowrap;
}
.ranch-secondary-hud .ranch-world-hint::before {
  inset: -8px -12px;
}
.farm-game.is-panel-open .ranch-secondary-hud {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 359px) {
  .ranch-secondary-hud {
    top: 68px;
    left: 9px;
    right: 9px;
    grid-template-columns: minmax(148px, 156px) minmax(0, 1fr);
    gap: 12px;
  }
  .ranch-secondary-hud .ranch-routine-board {
    left: auto;
    width: 100%;
  }
  .ranch-secondary-hud .ranch-world-hint {
    justify-self: stretch;
    padding: 8px 7px 10px;
    font-size: 6.5px;
    text-align: center;
  }
  .ranch-secondary-hud .ranch-world-hint::before {
    inset: -6px -7px;
  }
}

/* Little Ranch V10.3: consistent modal title alignment and game-popup motion. */
.farm-game.is-panel-open .farm-sheet-title--leading-icon {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  justify-content: initial;
  gap: 10px;
  padding-right: 56px;
}
.farm-game.is-panel-open .farm-sheet-title--leading-icon > .farm-sheet-icon {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  width: 44px;
  height: 44px;
  margin: 0;
  filter: drop-shadow(0 3px 2px rgba(82, 53, 28, 0.2));
}
.farm-game.is-panel-open .farm-sheet-title--leading-icon > div {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
}
.farm-game.is-panel-open .farm-sheet[data-panel-kind] {
  animation: ranch-panel-pouch 0.28s cubic-bezier(0.2, 0.92, 0.24, 1.22);
}
@media (prefers-reduced-motion: reduce) {
  .farm-game.is-panel-open .farm-sheet[data-panel-kind] {
    animation-duration: 0.01ms;
  }
}

/* Little Ranch V11: management, tactile controls, and flexible speech surfaces. */
.farm-game button {
  appearance: none;
  -webkit-appearance: none;
}
.ranch-compass-menu {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ranch-compass-menu::before,
.ranch-compass-menu::after {
  box-shadow: none;
}

.ranch-game-button,
.ranch-management-tabs button,
.ranch-collection-filters button,
.ranch-care-actions button,
.ranch-enclosure-card button,
.ranch-building-actions button,
.ranch-building-actions a,
.ranch-wallet-balances a,
.ranch-text-button,
.ranch-collection-state button,
.ranch-management-enclosure > button {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 7px 10px 8px;
  border: 2px solid #b57d42;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8dd, #ead09a);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.7),
    0 3px 0 #8e5b31,
    0 6px 10px rgba(67, 48, 29, 0.12);
  color: #684729;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}
.ranch-game-button:active,
.ranch-management-tabs button:active,
.ranch-collection-filters button:active,
.ranch-care-actions button:active,
.ranch-enclosure-card button:active,
.ranch-building-actions button:active,
.ranch-building-actions a:active,
.ranch-wallet-balances a:active,
.ranch-text-button:active,
.ranch-collection-state button:active,
.ranch-management-enclosure > button:active {
  transform: translateY(2px) scale(0.985);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.45),
    0 1px 0 #8e5b31;
}
.ranch-game-button:focus-visible,
.ranch-management-sheet button:focus-visible {
  outline: 3px solid #f3c85f;
  outline-offset: 2px;
}
.ranch-game-button:disabled,
.ranch-management-sheet button:disabled,
.ranch-care-actions button:disabled,
.ranch-enclosure-card button:disabled {
  filter: saturate(0.65);
  opacity: 0.68;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.5),
    0 2px 0 #99866b;
  transform: none;
}
.ranch-game-button--primary,
.ranch-building-actions .is-primary {
  border-color: #397c43;
  background: linear-gradient(180deg, #68bb61, #3d8d48);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.25),
    0 4px 0 #286633,
    0 8px 14px rgba(45, 101, 48, 0.18);
  color: #fff;
  text-shadow: 0 1px rgba(0, 0, 0, 0.18);
}
.ranch-care-actions button.is-done,
.ranch-enclosure-card button.is-done {
  border-color: #72a667;
  background: linear-gradient(#edf7db, #d7ebc3);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.75),
    0 3px 0 #79a66c;
  color: #347344;
}

.ranch-management-sheet {
  --management-green: #3f8d4a;
}
.ranch-management-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 1px 0 11px;
}
.ranch-management-tabs button {
  min-height: 38px;
}
.ranch-management-tabs button.is-active,
.ranch-collection-filters button.is-active {
  border-color: #397b44;
  background: linear-gradient(#edf7db, #d6eac2);
  box-shadow:
    inset 0 0 0 1px #8cbd77,
    0 3px 0 #5e9657;
  color: #2e6d3a;
}
.ranch-management-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.ranch-management-summary article {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
  padding: 7px 5px;
  border: 1px solid #d7b87d;
  border-radius: 13px;
  background: rgba(255, 253, 237, 0.78);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.75);
}
.ranch-management-summary .game-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}
.ranch-management-summary div {
  display: grid;
  min-width: 0;
}
.ranch-management-summary strong {
  font-size: 15px;
  line-height: 1;
  color: #315b3a;
}
.ranch-management-summary small {
  overflow: hidden;
  color: #79664f;
  font-size: 7px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-progression {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #d3a85e;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff8d8, #e9f1ca);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 3px 0 rgba(123, 78, 34, 0.18);
}
.ranch-progression .game-icon {
  width: 42px;
  height: 42px;
}
.ranch-progression div {
  display: grid;
  min-width: 0;
}
.ranch-progression small {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a7049;
}
.ranch-progression strong {
  font:
    800 16px Georgia,
    serif;
  color: #315b3a;
}
.ranch-progression p {
  margin: 2px 0 0;
  font-size: 9px;
  line-height: 1.3;
  color: #71644d;
}
.ranch-progression b {
  align-self: start;
  padding: 4px 7px;
  border: 1px solid #a8894e;
  border-radius: 999px;
  background: #fff8dc;
  color: #6b552d;
  font-size: 9px;
}
.ranch-management-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 11px 1px;
}
.ranch-management-progress > span {
  height: 12px;
  flex: 1;
  overflow: hidden;
  border: 2px solid #8f6038;
  border-radius: 99px;
  background: #dec598;
  box-shadow: inset 0 2px 3px rgba(77, 48, 27, 0.18);
}
.ranch-management-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #73c565, #378d48);
  transition: width 0.32s ease;
}
.ranch-management-progress strong {
  min-width: 70px;
  color: #356440;
  font-size: 9px;
  text-align: right;
}
.ranch-management-sheet .ranch-game-button--primary {
  width: 100%;
  min-height: 43px;
}
.ranch-community-sheet {
  --community-green: #3e8449;
}
.ranch-community-body {
  display: grid;
  gap: 10px;
}
.ranch-community-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ranch-community-tabs button {
  min-height: 42px;
  border: 2px solid #c58c49;
  border-radius: 13px;
  background: linear-gradient(#fff7d7, #f1d69c);
  box-shadow: 0 3px 0 #986235;
  color: #69472b;
  font-size: 10px;
  font-weight: 900;
}
.ranch-community-tabs button.is-active {
  border-color: #448c4e;
  background: linear-gradient(#e3f4cf, #bedea8);
  box-shadow: 0 3px 0 #35733f;
  color: #2e6a3c;
}
.ranch-community-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 7px;
  border: 1px solid #d7b879;
  border-radius: 14px;
  background: rgba(255, 253, 234, 0.78);
}
.ranch-community-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #c99d5c;
  border-radius: 10px;
  outline: none;
  background: #fffdf3;
  color: #31533a;
  font:
    700 11px system-ui,
    sans-serif;
}
.ranch-community-search input:focus {
  border-color: #57935d;
  box-shadow: 0 0 0 2px rgba(73, 137, 83, 0.18);
}
.ranch-community-search button,
.ranch-community-pagination button {
  min-height: 38px;
  padding: 0 13px;
  border: 2px solid #9c6938;
  border-radius: 10px;
  background: linear-gradient(#e9b963, #c58338);
  box-shadow: 0 2px 0 #704424;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}
.ranch-community-status {
  margin: 0;
  padding: 12px;
  border-radius: 13px;
  background: #fff8dc;
  color: #6f6247;
  font-size: 9px;
  text-align: center;
}
.ranch-community-list {
  display: grid;
  gap: 11px;
}
.ranch-community-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 2px solid #d5a257;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffbed, #f7e6b8);
  box-shadow: 0 4px 0 #af7139;
  overflow: hidden;
}
.ranch-community-picture {
  display: block;
  align-self: stretch;
  min-height: 128px;
  overflow: hidden;
  border: 2px solid #a86e3a;
  border-radius: 13px;
  background: #a9cf83;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}
.ranch-community-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ranch-community-card > div {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}
.ranch-community-card small {
  color: #8d7047;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ranch-community-card strong {
  color: #31553b;
  font:
    800 14px/1.1 Georgia,
    serif;
  overflow-wrap: anywhere;
}
.ranch-community-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #665f49;
  font-size: 8px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.ranch-community-card > div > a {
  display: grid;
  place-items: center;
  justify-self: start;
  min-width: 80px;
  min-height: 32px;
  margin-top: 2px;
  padding: 0 12px;
  border: 2px solid #377b43;
  border-radius: 10px;
  background: linear-gradient(#64b962, #398c48);
  box-shadow: 0 2px 0 #286435;
  color: #fff;
  text-decoration: none;
  font-size: 9px;
  font-weight: 900;
}
.ranch-community-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 26px 16px;
  border: 2px dashed #c79b5d;
  border-radius: 18px;
  background: #fff8dc;
  color: #516346;
  text-align: center;
}
.ranch-community-empty .game-icon {
  width: 58px;
  height: 58px;
}
.ranch-community-empty strong {
  font:
    800 14px Georgia,
    serif;
}
.ranch-community-empty small {
  font-size: 9px;
  line-height: 1.4;
}
.ranch-community-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.ranch-community-pagination span {
  color: #635237;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}
.ranch-community-pagination button:last-child {
  justify-self: stretch;
}
.ranch-community-pagination button:disabled {
  filter: grayscale(0.65);
  opacity: 0.55;
}
@media (max-width: 350px) {
  .ranch-community-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }
  .ranch-community-picture {
    min-height: 116px;
  }
  .ranch-community-search button {
    padding-inline: 9px;
  }
}

.ranch-collection-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-width: none;
}
.ranch-collection-filters::-webkit-scrollbar {
  display: none;
}
.ranch-collection-filters button {
  display: flex;
  grid: none;
  align-items: center;
  gap: 5px;
  min-width: max-content;
  min-height: 33px;
  padding: 6px 9px;
}
.ranch-collection-filters small {
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(96, 68, 39, 0.12);
  font-size: 7px;
}
.ranch-animal-collection,
.ranch-enclosure-list {
  display: grid;
  gap: 8px;
}
.ranch-collection-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid #d4b276;
  border-radius: 15px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.72),
    rgba(246, 235, 197, 0.78)
  );
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.78);
}
.ranch-animal-portrait {
  width: 58px;
  height: 58px;
  border: 2px solid #b9874c;
  border-radius: 14px;
  background-color: #dce9bf;
  background-repeat: no-repeat;
  background-size: var(--ranch-portrait-size, 400% 400%);
  background-position: 0 0;
  box-shadow: inset 0 -7px 12px rgba(66, 104, 53, 0.14);
}
.ranch-collection-copy {
  display: grid;
  min-width: 0;
}
.ranch-collection-copy > small {
  color: #826c51;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ranch-collection-copy > strong {
  overflow: hidden;
  margin-top: 1px;
  color: #34583b;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-collection-copy > span {
  overflow: hidden;
  color: #786c59;
  font-size: 7px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-care-chips {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}
.ranch-care-chips i {
  padding: 3px 5px;
  border-radius: 7px;
  background: #ead8b6;
  color: #8b6741;
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
}
.ranch-care-chips i.is-done {
  background: #d9edcb;
  color: #397541;
}
.ranch-collection-state {
  display: grid;
  justify-items: stretch;
  min-width: 0;
  text-align: center;
}
.ranch-collection-state > b {
  color: #367342;
  font-size: 15px;
  line-height: 1;
}
.ranch-collection-state > small {
  min-height: 18px;
  margin: 2px 0;
  color: #796b59;
  font-size: 6px;
  line-height: 1.2;
}
.ranch-collection-state button {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 7px;
}
.ranch-management-enclosure {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 2px solid #c59658;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff9df, #ead3a0);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.7),
    0 3px 0 rgba(126, 82, 42, 0.2);
}
.ranch-management-enclosure > .game-icon {
  width: 46px;
  height: 46px;
}
.ranch-management-enclosure > div {
  display: grid;
  min-width: 0;
}
.ranch-management-enclosure small {
  color: #80684e;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.ranch-management-enclosure strong {
  color: #34583b;
  font-size: 11px;
}
.ranch-management-enclosure p {
  margin: 2px 0 5px;
  color: #756b58;
  font-size: 7px;
}
.ranch-management-enclosure i {
  justify-self: start;
  padding: 3px 6px;
  border-radius: 7px;
  background: #f3d4ae;
  color: #915333;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}
.ranch-management-enclosure i.is-done {
  background: #dcefcf;
  color: #397443;
}
.ranch-management-enclosure > button {
  min-height: 31px;
  padding: 5px;
  font-size: 7px;
}

.farm-animal-bubble {
  width: max-content;
  min-width: 0;
  min-height: 0;
  max-width: min(224px, 72vw);
  padding: 10px 14px 11px;
  border: 3px solid #9b6238;
  border-radius: 17px;
  background: linear-gradient(180deg, #fffdf0, #f5e5ba);
  box-shadow:
    inset 0 0 0 2px #f0ca7b,
    inset 0 2px rgba(255, 255, 255, 0.8),
    0 5px 0 rgba(100, 59, 33, 0.42),
    0 12px 22px rgba(26, 52, 31, 0.2);
  line-height: 1.4;
  overflow-wrap: anywhere;
  isolation: isolate;
}
.farm-animal-bubble[data-bubble-size="short"] {
  max-width: min(154px, 62vw);
  padding: 8px 12px 9px;
}
.farm-animal-bubble[data-bubble-size="long"] {
  max-width: min(248px, 78vw);
  padding: 11px 15px 12px;
  text-align: left;
}
.farm-animal-bubble > span {
  position: relative;
  z-index: 2;
  display: block;
}
.farm-animal-bubble::before {
  content: none;
  display: none;
}
.farm-animal-bubble::after {
  content: "";
  position: absolute;
  z-index: 0;
  display: block;
  left: 25px;
  right: auto;
  bottom: -9px;
  width: 15px;
  height: 15px;
  border: 0;
  border-right: 3px solid #9b6238;
  border-bottom: 3px solid #9b6238;
  background: #f5e5ba;
  transform: rotate(45deg);
}
.farm-animal-bubble.tail-right::after {
  right: 25px;
  left: auto;
}
.farm-animal-bubble[data-bubble-kind="success"] {
  border: 3px solid #568a45;
  background: linear-gradient(#fffdeb, #e7f1ca);
  box-shadow:
    inset 0 0 0 2px #c4db81,
    0 5px 0 rgba(64, 104, 50, 0.45),
    0 12px 22px rgba(26, 52, 31, 0.18);
}
.farm-animal-bubble[data-bubble-kind="success"]::after {
  border-color: #568a45;
  background: #e7f1ca;
}
.farm-toast {
  max-width: min(312px, calc(100% - 28px));
  line-height: 1.35;
}

@media (max-width: 359px) {
  .ranch-management-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ranch-collection-card {
    grid-template-columns: 52px minmax(0, 1fr) 62px;
    gap: 6px;
    padding: 6px;
  }
  .ranch-animal-portrait {
    width: 52px;
    height: 52px;
  }
  .ranch-management-enclosure {
    grid-template-columns: 40px minmax(0, 1fr) 66px;
    padding: 8px;
    gap: 6px;
  }
  .ranch-management-enclosure > .game-icon {
    width: 40px;
    height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ranch-game-button,
  .ranch-management-sheet button {
    transition: none;
  }
}

/* Little Ranch V11.1: narrow-screen readability and consistent interaction states. */
.ranch-status-plate b {
  min-width: 54px;
  text-align: center;
  font-size: 8px;
  letter-spacing: 0.02em;
}

.ranch-management-sheet {
  display: flex;
  flex-direction: column;
  height: min(70dvh, 610px);
  overflow: hidden;
  padding-bottom: 12px;
}
.ranch-management-sheet > .farm-sheet-title {
  flex: 0 0 auto;
  padding-right: 46px;
}
.ranch-management-tabs {
  flex: 0 0 auto;
}
.ranch-management-tabs button {
  min-height: 44px;
  font-size: 9px;
}
.ranch-management-sheet > [data-management-view] {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 2px 6px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c69a5c transparent;
}
.ranch-management-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  margin: 0;
  color: #6f604c;
  font-size: 9px;
  font-weight: 900;
}
.ranch-management-loading .game-icon {
  width: 30px;
  height: 30px;
  animation: ranch-spin 0.85s linear infinite;
}
.ranch-management-sheet.is-loading > [data-management-view] {
  opacity: 0.58;
  pointer-events: none;
}
.ranch-management-summary article {
  min-height: 48px;
  padding: 8px 6px;
}
.ranch-management-summary small {
  font-size: 8px;
}
.ranch-management-progress strong {
  font-size: 10px;
}
.ranch-management-sheet .ranch-game-button--primary {
  min-height: 46px;
  font-size: 10px;
}

.ranch-collection-filters {
  position: relative;
  min-height: 43px;
  margin-right: -2px;
  padding: 2px 24px 7px 1px;
  mask-image: linear-gradient(
    90deg,
    #000 0,
    #000 calc(100% - 24px),
    transparent 100%
  );
}
.ranch-collection-filters button {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 9px;
}
.ranch-collection-filters small {
  font-size: 8px;
}
.ranch-collection-card {
  grid-template-columns: 64px minmax(0, 1fr) 76px;
  gap: 9px;
  padding: 9px;
}
.ranch-animal-portrait {
  width: 64px;
  height: 64px;
}
.ranch-collection-copy > small {
  font-size: 8px;
  line-height: 1.25;
  white-space: normal;
}
.ranch-collection-copy > strong {
  margin-top: 2px;
  font-size: 11px;
}
.ranch-collection-copy > span {
  margin-top: 2px;
  font-size: 8px;
}
.ranch-care-chips {
  flex-wrap: wrap;
  margin-top: 6px;
}
.ranch-care-chips i {
  font-size: 7px;
}
.ranch-collection-state > b {
  font-size: 17px;
}
.ranch-collection-state > small {
  min-height: 24px;
  font-size: 7px;
  line-height: 1.3;
}
.ranch-collection-state button,
.ranch-management-enclosure > button {
  min-height: 44px;
  font-size: 8px;
}
.ranch-management-enclosure small,
.ranch-management-enclosure p,
.ranch-management-enclosure i {
  font-size: 8px;
}
.ranch-management-enclosure strong {
  font-size: 12px;
}

.farm-primary-action,
.ranch-building-actions a,
.ranch-building-actions button,
.ranch-wallet-balances a,
.ranch-routine-tabs button,
.ranch-care-actions button,
.ranch-enclosure-card button,
.ranch-text-button {
  min-height: 44px;
}
.farm-context-actions button {
  min-width: 58px;
  min-height: 54px;
  border-radius: 13px;
}
.farm-character-list button {
  min-height: 74px;
}
.farm-grade {
  min-height: 54px;
}
.farm-sheet-close {
  width: 44px;
  height: 44px;
}
.farm-game button:focus-visible,
.farm-game a:focus-visible {
  outline: 3px solid #f3c85f;
  outline-offset: 2px;
}
.ranch-game-button.is-loading,
.farm-primary-action.is-loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}
.ranch-game-button.is-loading::after,
.farm-primary-action.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ranch-spin 0.7s linear infinite;
}

.farm-animal-bubble::after,
.farm-animal-bubble.tail-right::after {
  left: var(--bubble-tail-x, 25px);
  right: auto;
}
.farm-animal-bubble[data-bubble-size="long"] {
  max-height: 132px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.42;
}

@media (max-width: 359px) {
  .ranch-status-plate {
    grid-template-columns: 38px minmax(0, 1fr);
    max-width: 220px;
  }
  .ranch-status-plate b {
    display: none;
  }
  .ranch-management-sheet {
    height: min(72dvh, 500px);
  }
  .ranch-management-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ranch-collection-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }
  .ranch-animal-portrait {
    width: 64px;
    height: 64px;
  }
  .ranch-collection-state {
    grid-column: 1/-1;
    grid-template-columns: 38px minmax(0, 1fr) 88px;
    align-items: center;
    gap: 7px;
    text-align: left;
  }
  .ranch-collection-state > b {
    text-align: center;
  }
  .ranch-collection-state > small {
    min-height: 0;
    margin: 0;
    font-size: 8px;
  }
  .ranch-collection-state button {
    padding: 6px 8px;
  }
}

/* V12.0.1 game-feel pass: a deliberate HUD rhythm keeps notices clear of controls. */
.farm-game {
  --ranch-secondary-top: 75px;
  --ranch-notice-top: 158px;
}
.ranch-secondary-hud {
  top: var(--ranch-secondary-top);
}
.farm-toast {
  z-index: 140;
  top: var(--ranch-notice-top);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: min(342px, calc(100% - 34px));
  min-height: 42px;
  padding: 9px 16px;
  border: 2px solid rgba(255, 245, 207, 0.72);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(54, 91, 57, 0.97),
    rgba(38, 68, 44, 0.97)
  );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.28),
    0 5px 0 rgba(29, 53, 34, 0.32),
    0 12px 24px rgba(25, 45, 31, 0.3);
  color: #fffaf0;
  text-shadow: 0 1px rgba(20, 42, 28, 0.34);
}
.farm-toast[hidden] {
  display: none !important;
}
.farm-toast::before,
.farm-toast.is-notice::before,
.farm-toast.is-error::before {
  content: none;
  display: none;
}
.farm-toast-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: #f7e6a6;
  color: #386840;
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    inset 0 0 0 2px rgba(100, 76, 37, 0.14),
    0 2px 3px rgba(31, 53, 34, 0.18);
}
.farm-toast-icon::before {
  content: "✓";
}
.farm-toast > [data-farm-toast-message] {
  display: block;
  min-width: 0;
  color: inherit;
  text-shadow: inherit;
}
.farm-toast.is-error {
  border-color: #e2a47a;
  background: linear-gradient(180deg, #a94f3f, #81352e);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.24),
    0 5px 0 #612b27,
    0 12px 24px rgba(67, 31, 27, 0.3);
  color: #fff8e9;
}
.farm-toast.is-error .farm-toast-icon {
  background: #fff1cf;
  color: #963f31;
}
.farm-toast.is-error .farm-toast-icon::before {
  content: "!";
}
.farm-game.is-panel-open .farm-toast {
  z-index: 140;
  top: max(94px, calc(env(safe-area-inset-top) + 78px));
  max-width: min(330px, calc(100% - 40px));
  animation: ranch-toast-drop 0.22s cubic-bezier(0.2, 0.86, 0.28, 1.16);
}
@keyframes ranch-toast-drop {
  from {
    opacity: 0;
    transform: translate(-50%, -9px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
@media (max-width: 359px) {
  .farm-game {
    --ranch-secondary-top: 76px;
    --ranch-notice-top: 147px;
  }
  .farm-toast {
    max-width: calc(100% - 26px);
    padding: 9px 13px 10px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .farm-game.is-panel-open .farm-toast {
    animation-duration: 0.01ms;
  }
}

/* V12.3: shared mobile dock, explicit audio control, and selection-only care actions. */
.ranch-audio-controls {
  position: absolute;
  top: max(77px, calc(env(safe-area-inset-top) + 65px));
  right: 10px;
  display: grid;
  gap: 8px;
}
.ranch-audio-control {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 4px;
  border: 2px solid #d7a758;
  border-radius: 15px;
  background: linear-gradient(#fff5c9, #ddb75f);
  box-shadow:
    inset 0 0 0 2px #fff1b8,
    0 4px 0 #6a4329,
    0 8px 15px rgba(33, 53, 34, 0.24);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}
.ranch-audio-control .game-icon {
  width: 38px;
  height: 38px;
  justify-self: center;
  filter: drop-shadow(0 2px 1px rgba(91, 56, 29, 0.2));
}
.ranch-news-control .ranch-news-icon {
  display: block;
  width: 39px;
  height: 39px;
  background: url("/theme-assets/investasiku-farming/farming/ranch/v23.12/runtime/ranch-news-board.webp")
    center / contain no-repeat;
  filter: drop-shadow(0 2px 1px rgba(91, 56, 29, 0.2));
}
.ranch-front-popup {
  box-sizing: border-box;
}
.ranch-audio-control:not(.is-audio-ready) {
  filter: saturate(0.62) brightness(0.94);
  opacity: 0.88;
}
.ranch-decoration-control:not(.is-audio-ready),
.ranch-admin-control:not(.is-audio-ready),
.ranch-qa-preview-control:not(.is-audio-ready) {
  filter: none;
  opacity: 1;
}
.ranch-qa-preview-control.is-active {
  border-color: #69a85d;
  background: linear-gradient(#efffd2, #8fce69);
  box-shadow:
    inset 0 0 0 2px #f5ffdc,
    0 4px 0 #396538,
    0 8px 15px rgba(33, 76, 38, 0.24);
}
.ranch-audio-control:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 0 0 2px #fff1b8,
    0 1px 0 #6a4329,
    0 4px 9px rgba(33, 53, 34, 0.2);
}
.ranch-farm-dock {
  position: absolute;
  z-index: 26;
  left: 8px;
  right: 8px;
  bottom: max(7px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  min-height: 67px;
  padding: 6px;
  border: 3px solid #d6a552;
  border-radius: 20px;
  background: linear-gradient(#8b562f, #60371f);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.2),
    0 7px 0 rgba(70, 41, 27, 0.76),
    0 13px 24px rgba(34, 49, 31, 0.28);
}
.ranch-farm-dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 51px;
  border-radius: 13px;
  color: #fbe8b0;
  font-size: 8px;
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 0.14s ease,
    background 0.14s ease;
}
.ranch-farm-dock a:active {
  transform: translateY(2px) scale(0.97);
}
.ranch-farm-dock a.is-active {
  background: linear-gradient(#fff5c8, #e7c66e);
  box-shadow:
    inset 0 0 0 2px #fff9df,
    0 3px 0 #45291c;
  color: #4f592f;
}
.ranch-farm-dock .game-icon {
  width: 31px;
  height: 31px;
}
.ranch-farm-dock small {
  margin-top: -1px;
  font-size: 8px;
}
.farm-context-actions {
  z-index: 27;
  bottom: calc(max(7px, env(safe-area-inset-bottom)) + 84px);
  animation: ranch-care-actions-in 0.2s cubic-bezier(0.2, 0.86, 0.28, 1.18);
}
.farm-game.is-panel-open .ranch-farm-dock,
.farm-game.is-panel-open .farm-context-actions {
  opacity: 0;
  pointer-events: none;
}
@keyframes ranch-care-actions-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
@media (max-width: 359px) {
  .ranch-audio-controls {
    top: max(78px, calc(env(safe-area-inset-top) + 68px));
    right: 8px;
    gap: 6px;
  }
  .ranch-audio-control {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 3px;
  }
  .ranch-audio-control .game-icon {
    width: 35px;
    height: 35px;
  }
  .ranch-news-control .ranch-news-icon {
    width: 36px;
    height: 36px;
  }
  .ranch-farm-dock {
    left: 5px;
    right: 5px;
    gap: 1px;
    padding-inline: 4px;
  }
  .ranch-farm-dock .game-icon {
    width: 28px;
    height: 28px;
  }
  .farm-context-actions {
    bottom: calc(max(6px, env(safe-area-inset-bottom)) + 80px);
    gap: 2px;
    padding: 5px;
  }
  .farm-context-actions button {
    min-width: 51px;
  }
}

@keyframes ranch-mission-focus {
  0% {
    transform: scale(0.97);
  }
  55% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}
.ranch-care-card.is-mission-target {
  border-color: #3f914c;
  background: #f1f9dc;
  box-shadow:
    0 0 0 3px rgba(93, 166, 79, 0.22),
    0 7px 14px rgba(82, 94, 41, 0.14);
  animation: ranch-mission-focus 0.7s ease both;
}

/* Little Ranch V14 contextual daily care */
.ranch-secondary-hud .ranch-world-hint {
  display: none;
}
.ranch-guided-start {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 48px;
  padding: 4px 7px;
  border: 2px solid #d6a354;
  border-radius: 14px;
  background: linear-gradient(#fff7c9, #f2d58d);
  box-shadow:
    0 3px 0 #89532f,
    0 7px 14px rgba(48, 70, 35, 0.18);
  color: #385d3e;
  pointer-events: auto;
}
.ranch-guided-start .game-icon {
  width: 34px;
  height: 34px;
}
.ranch-guided-start span:last-child {
  display: grid;
  min-width: 0;
  text-align: left;
}
.ranch-guided-start small {
  font-size: 6.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ranch-guided-start strong {
  overflow: hidden;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-guided-start:disabled {
  filter: grayscale(0.35);
  opacity: 0.72;
}

.farm-context-actions {
  padding-top: 10px;
}
.farm-context-title {
  position: absolute;
  top: -14px;
  left: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  padding: 3px 9px;
  border: 2px solid #e8c47e;
  border-radius: 10px;
  background: #fff7d8;
  color: #48653f;
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.farm-context-actions button {
  position: relative;
  transition:
    transform 0.16s ease,
    background 0.16s ease;
}
.farm-context-actions button.is-primary {
  background: #dff1cc;
  box-shadow: inset 0 0 0 2px #69a75f;
  transform: translateY(-2px);
}
.farm-context-actions button[data-status="COMPLETED"]::after {
  content: "✓";
  position: absolute;
  top: 1px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #4a9854;
  color: #fff;
  font-size: 9px;
}

.ranch-guided-care,
.ranch-guided-result {
  position: absolute;
  z-index: 28;
  left: 50%;
  bottom: calc(max(7px, env(safe-area-inset-bottom)) + 158px);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  width: min(calc(100% - 18px), 410px);
  min-height: 54px;
  padding: 6px 7px;
  border: 3px solid #9a6237;
  border-radius: 18px;
  transform: translateX(-50%);
  background: linear-gradient(100deg, #fff6cf, #f3d98e);
  box-shadow:
    0 4px 0 #684126,
    0 9px 20px rgba(37, 56, 29, 0.25);
  color: #36583a;
  animation: ranch-care-actions-in 0.2s ease-out;
}
.ranch-guided-care[data-action="clean"] {
  bottom: calc(max(7px, env(safe-area-inset-bottom)) + 88px);
}
.ranch-guided-care > span,
.ranch-guided-result > span {
  width: 36px;
  height: 36px;
}
.ranch-guided-care > div,
.ranch-guided-result > div {
  display: grid;
  min-width: 0;
}
.ranch-guided-care small,
.ranch-guided-result small {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ranch-guided-care strong,
.ranch-guided-result strong {
  overflow: hidden;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-guided-care button,
.ranch-guided-result button {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #b7793e;
  border-radius: 10px;
  background: #4c9b50;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}
.ranch-guided-care [data-guided-cancel],
.ranch-guided-result [data-guided-later] {
  background: #fff3d5;
  color: #755031;
}
.ranch-guided-care button:disabled {
  filter: grayscale(0.5);
  opacity: 0.65;
}
.ranch-guided-result {
  bottom: calc(max(7px, env(safe-area-inset-bottom)) + 86px);
  background: linear-gradient(100deg, #eaf7d8, #ffe7a7);
}
.farm-game.is-panel-open .ranch-guided-care,
.farm-game.is-panel-open .ranch-guided-result {
  opacity: 0;
  pointer-events: none;
}

.ranch-guided-sheet-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 0 15px;
  width: 100%;
}
.ranch-guided-sheet-start .game-icon {
  width: 30px;
  height: 30px;
}
.ranch-premium-confirm {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  padding: 8px;
  border: 2px solid #d39b49;
  border-radius: 14px;
  background: #fff3c7;
}
.ranch-premium-confirm .game-icon {
  width: 42px;
  height: 42px;
}
.ranch-premium-confirm div {
  display: grid;
}
.ranch-premium-confirm strong {
  font-size: 10px;
  color: #38583c;
}
.ranch-premium-confirm small {
  font-size: 7px;
  line-height: 1.25;
  color: #776245;
}
.ranch-premium-confirm button {
  padding: 7px;
  border: 1px solid #ae713b;
  border-radius: 9px;
  background: #fff8dd;
  color: #6d4a31;
  font-size: 8px;
  font-weight: 900;
}
.ranch-premium-confirm [data-premium-accept] {
  background: #4d9b52;
  color: #fff;
}

.ranch-daily-complete {
  text-align: center;
}
.ranch-completion-stamp {
  display: inline-grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin: 4px auto 12px;
  border: 5px double #a85e35;
  border-radius: 50%;
  transform: rotate(-4deg);
  background: #f7dfa0;
  color: #88462d;
  box-shadow: inset 0 0 0 4px #fff0bd;
}
.ranch-completion-stamp .game-icon {
  width: 54px;
  height: 54px;
}
.ranch-completion-stamp b {
  margin-top: -15px;
  font-size: 11px;
  letter-spacing: 0.14em;
}
.ranch-completion-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 0 0 12px;
}
.ranch-completion-stats div {
  padding: 8px;
  border: 1px solid #e3bd74;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.ranch-completion-stats dt {
  font-size: 7px;
  color: #7b6a4c;
}
.ranch-completion-stats dd {
  margin: 2px 0 0;
  color: #315c3a;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 359px) {
  .ranch-guided-start {
    grid-template-columns: 29px minmax(0, 1fr);
    padding-inline: 4px;
  }
  .ranch-guided-start .game-icon {
    width: 29px;
    height: 29px;
  }
  .ranch-guided-care,
  .ranch-guided-result {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 4px;
  }
  .ranch-guided-care [data-guided-cancel],
  .ranch-guided-result [data-guided-later] {
    position: absolute;
    top: -22px;
    right: 8px;
    min-width: 44px;
    min-height: 28px;
    padding: 2px 7px;
  }
  .ranch-premium-confirm {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
  .ranch-premium-confirm [data-premium-cancel] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ranch-guided-care,
  .ranch-guided-result,
  .ranch-completion-stamp {
    animation: none;
    transform: translateX(-50%);
  }
  .ranch-completion-stamp {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ranch-care-card.is-mission-target {
    animation-duration: 0.01ms;
  }
}

/* V12.3.2: optically center the uneven artwork inside the shared icon atlas. */
.game-icon:not(.utility-icon) {
  position: relative;
  background-image: none;
  --icon-scale: 1;
}
.game-icon:not(.utility-icon)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v3/little-ranch-icons.webp");
  background-position: inherit;
  background-repeat: no-repeat;
  background-size: 600% 500%;
  transform: translate(var(--icon-shift-x), var(--icon-shift-y))
    scale(var(--icon-scale));
  transform-origin: center;
}
.game-icon.icon-egg::before {
  background-image: url("/theme-assets/investasiku-farming/farming/rewards/egg-surprise/v1/runtime/egg/crack-01.webp");
  background-position: center;
  background-size: contain;
  transform: none;
  filter: drop-shadow(0 3px 2px rgba(86, 52, 22, 0.28));
}
.icon-wallet {
  --icon-scale: 1.068;
  --icon-shift-x: -7.6%;
  --icon-shift-y: -14.4%;
}
.icon-compass {
  --icon-scale: 0.953;
  --icon-shift-x: 3.5%;
  --icon-shift-y: -6.3%;
}
.icon-feed {
  --icon-scale: 0.945;
  --icon-shift-x: -1.1%;
  --icon-shift-y: -10.9%;
}
.icon-hay {
  --icon-scale: 0.995;
  --icon-shift-x: -0.4%;
  --icon-shift-y: -14.8%;
}
.icon-premium-feed {
  --icon-scale: 1.025;
  --icon-shift-x: 1.3%;
  --icon-shift-y: -8.1%;
}
.icon-heart {
  --icon-scale: 1.073;
  --icon-shift-x: -7.9%;
  --icon-shift-y: -11.4%;
}
.icon-info {
  --icon-scale: 0.899;
  --icon-shift-x: -4.6%;
  --icon-shift-y: 0.2%;
}
.icon-settings {
  --icon-scale: 1.046;
  --icon-shift-x: -1.5%;
  --icon-shift-y: -9.6%;
}
.icon-mission {
  --icon-scale: 1.068;
  --icon-shift-x: 1.5%;
  --icon-shift-y: -7.6%;
}
.icon-reward {
  --icon-scale: 1.01;
  --icon-shift-x: 3.9%;
  --icon-shift-y: -11.8%;
}
.icon-avatar {
  --icon-scale: 1.005;
  --icon-shift-x: 4.1%;
  --icon-shift-y: -7.6%;
}
.icon-coin {
  --icon-scale: 1.062;
  --icon-shift-x: -5.9%;
  --icon-shift-y: -9.4%;
}
.icon-deposit {
  --icon-scale: 1.057;
  --icon-shift-x: -2.2%;
  --icon-shift-y: -7.6%;
}
.icon-withdraw {
  --icon-scale: 1.046;
  --icon-shift-x: 0.4%;
  --icon-shift-y: -6.6%;
}
.icon-ledger {
  --icon-scale: 1;
  --icon-shift-x: 5%;
  --icon-shift-y: -9%;
}
.icon-invite {
  --icon-scale: 0.911;
  --icon-shift-x: -0.4%;
  --icon-shift-y: -9.4%;
}
.icon-community {
  --icon-scale: 0.958;
  --icon-shift-x: 3.7%;
  --icon-shift-y: -4.6%;
}
.icon-cottage {
  --icon-scale: 0.94;
  --icon-shift-x: -2%;
  --icon-shift-y: -7.6%;
}
.icon-barn {
  --icon-scale: 0.899;
  --icon-shift-x: 0.2%;
  --icon-shift-y: -3.7%;
}
.icon-pen {
  --icon-scale: 0.949;
  --icon-shift-x: -1.5%;
  --icon-shift-y: -13.5%;
}
.icon-feed-shed {
  --icon-scale: 0.94;
  --icon-shift-x: 0.7%;
  --icon-shift-y: -8.7%;
}
.icon-office {
  --icon-scale: 0.899;
  --icon-shift-x: 0.2%;
  --icon-shift-y: -3.7%;
}
.icon-help {
  --icon-scale: 1.025;
  --icon-shift-x: 0.7%;
  --icon-shift-y: -5.9%;
}
.icon-audio {
  --icon-scale: 1.03;
  --icon-shift-x: -6.1%;
  --icon-shift-y: -6.1%;
}
.icon-audio-off {
  --icon-scale: 0.949;
  --icon-shift-x: -3.9%;
  --icon-shift-y: -6.3%;
}
.icon-sun {
  --icon-scale: 1.057;
  --icon-shift-x: -2.6%;
  --icon-shift-y: -3.1%;
}
.icon-moon {
  --icon-scale: 1.12;
  --icon-shift-x: -2.4%;
  --icon-shift-y: -4.1%;
}
.icon-close {
  --icon-scale: 1.12;
  --icon-shift-x: -2.2%;
  --icon-shift-y: -5.9%;
}
.icon-back {
  --icon-scale: 1.02;
  --icon-shift-x: 3.5%;
  --icon-shift-y: 6.3%;
}

/* Admin popup icon names map directly to this compact social atlas. */
.game-icon:is(
    .brand-whatsapp,
    .brand-telegram,
    .brand-facebook,
    .brand-instagram,
    .brand-tiktok,
    .brand-youtube,
    .brand-x,
    .brand-twitter,
    .brand-linkedin,
    .brand-google-play,
    .brand-email,
    .brand-mail,
    .brand-website,
    .brand-phone
  )::before {
  inset: -7%;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v23.12/runtime/ranch-social-badge-cartoon-v2.png?v=23.12.26");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  transform: none;
  filter: none;
}
.game-icon:is(
    .brand-whatsapp,
    .brand-telegram,
    .brand-facebook,
    .brand-instagram,
    .brand-tiktok,
    .brand-youtube,
    .brand-x,
    .brand-twitter,
    .brand-linkedin,
    .brand-google-play,
    .brand-email,
    .brand-mail,
    .brand-website,
    .brand-phone
  )::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 20%;
  pointer-events: none;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v23.12/runtime/ranch-social-icons.svg?v=23.12.26");
  background-position: inherit;
  background-size: 1200% 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 1px rgba(74, 43, 19, 0.28));
}
.brand-whatsapp {
  background-position: 0 0;
}
.brand-telegram {
  background-position: 9.0909% 0;
}
.brand-facebook {
  background-position: 18.1818% 0;
}
.brand-instagram {
  background-position: 27.2727% 0;
}
.brand-tiktok {
  background-position: 36.3636% 0;
}
.brand-youtube {
  background-position: 45.4545% 0;
}
.brand-x,
.brand-twitter {
  background-position: 54.5455% 0;
}
.brand-linkedin {
  background-position: 63.6364% 0;
}
.brand-google-play {
  background-position: 72.7273% 0;
}
.brand-email,
.brand-mail {
  background-position: 81.8182% 0;
}
.brand-website {
  background-position: 90.9091% 0;
}
.brand-phone {
  background-position: 100% 0;
}

/* Utility artwork uses the same optical-centering model, including back/close controls. */
.game-icon.utility-icon {
  background-image: none;
  --icon-scale: 1;
  --icon-shift-x: 0%;
  --icon-shift-y: 0%;
}
.game-icon.utility-icon:not(.farm-sheet-close):not(.ranch-close):not(
    .farm-empty-close
  ) {
  position: relative;
}
.game-icon.utility-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v3/little-ranch-utility-icons.webp");
  background-position: inherit;
  background-repeat: no-repeat;
  background-size: 500% 300%;
  transform: translate(var(--icon-shift-x), var(--icon-shift-y))
    scale(var(--icon-scale));
  transform-origin: center;
}
.icon-grade-a {
  --icon-shift-x: -4%;
  --icon-shift-y: -5.4%;
}
.icon-grade-s {
  --icon-shift-x: -4%;
  --icon-shift-y: -4.8%;
}
.icon-pet-animal {
  --icon-shift-x: -2%;
  --icon-shift-y: -6.7%;
}
.icon-animal-detail {
  --icon-shift-x: 1.9%;
  --icon-shift-y: -7.3%;
}
.icon-feeding-complete {
  --icon-shift-x: 3.1%;
  --icon-shift-y: -9.9%;
}
.icon-animal-hungry {
  --icon-shift-x: -2.8%;
  --icon-shift-y: -0.9%;
}
.icon-animal-happy {
  --icon-shift-x: -1.4%;
  --icon-shift-y: -2.8%;
}
.icon-utility-settings {
  --icon-shift-x: -0.6%;
  --icon-shift-y: 3.1%;
}
.icon-utility-close {
  --icon-shift-x: 1.9%;
  --icon-shift-y: 2.9%;
}
.icon-utility-back {
  --icon-shift-x: 3.6%;
  --icon-shift-y: -2.9%;
}
.icon-confirm {
  --icon-shift-x: -1.5%;
  --icon-shift-y: 4%;
}
.icon-warning {
  --icon-shift-x: 2.6%;
  --icon-shift-y: 5.6%;
}
.icon-loading {
  --icon-shift-x: 11.5%;
  --icon-shift-y: 4.6%;
}
.icon-gold-button {
  --icon-shift-x: 0.2%;
  --icon-shift-y: 4.6%;
}
.icon-blue-button {
  --icon-shift-x: 2.9%;
  --icon-shift-y: 4.6%;
}

/* One modal shell: title and close control remain fixed; only content scrolls. */
.farm-game.is-panel-open .farm-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.farm-game.is-panel-open .farm-sheet-title {
  flex: 0 0 auto;
}
.farm-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 2px 7px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b48b58 transparent;
}
.farm-animal-heading > .farm-animal-portrait {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  width: 48px;
  height: 48px;
  margin-left: -2px;
  border: 2px solid #c6904d;
  border-radius: 15px;
  background-color: #dfedc8;
  background-repeat: no-repeat;
  background-size: var(--ranch-portrait-size, 400% 400%);
  background-position: 0 0;
  box-shadow:
    inset 0 -7px 11px rgba(58, 91, 42, 0.14),
    0 3px 0 rgba(112, 68, 34, 0.2);
  filter: drop-shadow(0 2px 2px rgba(82, 53, 28, 0.15));
  animation: ranch-portrait-bob 2.6s ease-in-out infinite;
}
.farm-animal-heading > .farm-animal-portrait.is-chicken {
  background-color: #fff0bb;
}
.farm-animal-heading > .farm-animal-portrait.is-goat {
  background-color: #e6f1cf;
}
.farm-animal-heading > .farm-animal-portrait.is-sheep {
  background-color: #e3eee0;
}
.farm-animal-greeting {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin: 4px 0 10px;
  padding: 8px 10px;
  border: 1px solid #dfc27f;
  border-radius: 13px;
  background: linear-gradient(90deg, #fff5d4, #edf3d7, #fff5d4);
  color: #b27d32;
}
.farm-animal-greeting p {
  display: grid;
  margin: 0;
  color: #476044;
}
.farm-animal-greeting strong {
  font-size: 9px;
}
.farm-animal-greeting small {
  margin-top: 2px;
  color: #7a735e;
  font-size: 7px;
  line-height: 1.3;
}
.farm-animal-greeting > .farm-animal-sparkle {
  font-size: 12px;
  animation: ranch-sparkle 1.8s ease-in-out infinite;
}
.farm-care-status {
  --care-pulse-ring: rgba(214, 157, 38, 0.38);
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f1bd43;
  color: #68420d;
  box-shadow: 0 1px 2px rgba(91, 60, 18, 0.18);
  animation: ranch-care-status-pulse 1.35s ease-in-out infinite;
}
.farm-care-status::before {
  content: "!";
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
.farm-care-status::after {
  position: absolute;
  inset: -3px;
  border: 2px solid var(--care-pulse-ring);
  border-radius: 50%;
  content: "";
  animation: ranch-care-status-ring 1.35s ease-out infinite;
}
.farm-care-status.is-fed {
  --care-pulse-ring: rgba(54, 143, 75, 0.38);
  background: #54ad63;
  color: #fff;
  box-shadow: 0 1px 2px rgba(38, 98, 51, 0.2);
}
.farm-care-status.is-fed::before {
  content: "\2713";
  font-size: 15px;
}
.farm-care-status.is-preview {
  --care-pulse-ring: rgba(112, 105, 83, 0.25);
  background: #aaa287;
  color: #fff;
  box-shadow: 0 1px 2px rgba(78, 72, 55, 0.16);
}
.farm-care-status.is-preview::before {
  content: "i";
}
.farm-contract-grid div {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(109, 145, 83, 0.16);
  background: linear-gradient(145deg, #f5f7e9, #e8f0dc);
}
.farm-contract-grid div:after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(83, 139, 74, 0.08);
}
@keyframes ranch-portrait-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-2px) rotate(1deg);
  }
}
@keyframes ranch-sparkle {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.86);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}
@keyframes ranch-care-status-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.05);
    filter: brightness(1.06);
  }
}
@keyframes ranch-care-status-ring {
  0% {
    opacity: 0.75;
    transform: scale(0.82);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}
@media (prefers-reduced-motion: reduce) {
  .farm-animal-heading > .farm-animal-portrait,
  .farm-animal-greeting > .farm-animal-sparkle,
  .farm-care-status {
    animation: none;
  }
  .farm-care-status::after {
    animation: none;
    opacity: 0.45;
  }
}
.ranch-management-sheet > .ranch-management-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ranch-management-body > .ranch-management-tabs {
  flex: 0 0 auto;
}
.ranch-management-body > [data-management-view] {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 2px 6px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c69a5c transparent;
}
.ranch-management-sheet.is-loading
  > .ranch-management-body
  > [data-management-view] {
  opacity: 0.58;
  pointer-events: none;
}

/* V12.3 feed shop: one native game panel for catalog, inventory, cart and history. */
.ranch-feed-shop {
  height: min(72dvh, 620px);
}
.ranch-feed-insufficient {
  width: min(calc(100% - 28px), 390px);
}
.ranch-feed-insufficient-body {
  display: grid;
  gap: 11px;
  text-align: center;
}
.ranch-feed-insufficient-scene {
  position: relative;
  display: grid;
  min-height: 112px;
  place-items: center;
  overflow: hidden;
  border: 2px solid #d9b66d;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 48%),
    linear-gradient(180deg, #dff0c8 0 58%, #9ec66f 59% 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 250, 224, 0.72);
}
.ranch-feed-insufficient-scene::before {
  position: absolute;
  right: 18px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f5cf55;
  box-shadow: 0 0 0 7px rgba(255, 232, 135, 0.35);
  content: "";
}
.ranch-feed-insufficient-scene .icon-feed-shed {
  width: 90px;
  height: 90px;
  transform: translateX(-17px);
  filter: drop-shadow(0 5px 3px rgba(74, 71, 37, 0.22));
}
.ranch-feed-insufficient-scene .icon-wallet {
  position: absolute;
  right: 52px;
  bottom: 15px;
  width: 54px;
  height: 54px;
  filter: grayscale(0.15) drop-shadow(0 4px 3px rgba(74, 71, 37, 0.24));
}
.ranch-feed-insufficient-body > strong {
  color: #355b3f;
  font:
    900 17px/1.15 Georgia,
    serif;
}
.ranch-feed-insufficient-body > p {
  margin: -5px 8px 0;
  color: #716348;
  font-size: 9px;
  line-height: 1.5;
}
.ranch-feed-insufficient-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px dashed #c79b55;
  border-radius: 11px;
  background: rgba(255, 249, 222, 0.74);
  color: #806744;
  font-size: 8px;
}
.ranch-feed-insufficient-wallet strong {
  color: #2f6940;
  font-size: 10px;
}
.ranch-feed-deposit-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}
.ranch-feed-back-button {
  min-height: 39px;
  border: 1px solid #bd8745;
  border-radius: 12px;
  background: linear-gradient(#fff7d9, #f2d797);
  box-shadow: 0 3px 0 #9b6237;
  color: #68472c;
  font-size: 9px;
  font-weight: 900;
}
.ranch-feed-shop-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 11px 0;
}
.ranch-feed-shop-tabs button {
  min-height: 38px;
  border: 1px solid #c99a55;
  border-radius: 12px;
  background: #fff2cd;
  color: #6c4b2d;
  font-size: 9px;
  font-weight: 900;
}
.ranch-feed-shop-tabs button.is-active {
  border-color: #438f49;
  background: #deefd1;
  color: #2d6d38;
  box-shadow: inset 0 0 0 2px #fff;
}
.ranch-feed-catalog,
.ranch-feed-inventory,
.ranch-feed-history {
  display: grid;
  gap: 9px;
}
.ranch-feed-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: start;
  column-gap: 9px;
  row-gap: 3px;
  overflow: hidden;
  padding: 10px 10px 11px;
  border: 2px solid #dfb965;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffdf5 0%, #fff5d8 62%, #ffedbd 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 0 rgba(145, 91, 39, 0.12);
}
.ranch-feed-item::after {
  position: absolute;
  right: -18px;
  bottom: -25px;
  width: 74px;
  height: 74px;
  border: 10px solid rgba(219, 174, 83, 0.09);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.ranch-feed-item > .game-icon {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  margin-top: 0;
  place-self: start center;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  filter: drop-shadow(0 3px 2px rgba(83, 55, 28, 0.18));
}
.ranch-feed-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-top: 1px;
}
.ranch-feed-item small,
.ranch-feed-item strong,
.ranch-feed-item p {
  margin: 0;
}
.ranch-feed-heading {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}
.ranch-feed-heading > strong {
  min-width: 0;
  flex: 1;
  padding-right: 74px;
  color: #34533d;
  font:
    900 12px/1.12 Georgia,
    serif;
}
.ranch-feed-item p {
  max-width: none;
  margin-top: 5px;
  padding-right: 74px;
  color: #766a55;
  font-size: 9px;
  line-height: 1.2;
}
.ranch-feed-facts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 2px;
}
.ranch-feed-facts > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 5px 6px;
  border: 1px solid rgba(191, 147, 76, 0.42);
  border-radius: 8px;
  background: rgba(255, 250, 224, 0.68);
}
.ranch-feed-facts small {
  color: #9b7446;
  font-size: 8px;
  line-height: 1.05;
}
.ranch-feed-facts b {
  overflow: hidden;
  color: #49624b;
  font-size: 9.2px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-feed-compatible {
  display: block;
  grid-column: 1 / -1;
  margin-top: 5px !important;
  color: #75654c;
  font-size: 8.4px !important;
  line-height: 1.25;
  text-transform: none !important;
}
.ranch-feed-compatible b {
  color: #49624b;
  font-size: inherit;
}
.ranch-feed-compatible span {
  color: #91764f;
}
.ranch-feed-price {
  position: absolute;
  top: 0;
  right: 0;
  flex: 0 0 auto;
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid #33783d;
  border-radius: 11px;
  background: linear-gradient(#55a95a, #3f9048);
  box-shadow: 0 2px 0 #2f7139;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
}
.ranch-feed-price.is-free {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-color: #b98a43;
  background: #fff0bd;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.52);
  color: #7b572e;
}
.ranch-feed-price:disabled {
  border-color: #a78f68;
  background: #c9b98f;
  box-shadow: 0 2px 0 #8e7958;
  cursor: not-allowed;
}
.ranch-feed-item em {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  color: #8a7656;
  font-size: 8px;
  font-style: normal;
  line-height: 1.12;
}
.ranch-feed-item em > span {
  display: grid;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  place-items: center;
  border: 1px solid #c7a96d;
  border-radius: 50%;
  font-size: 7px;
  font-weight: 900;
}
.ranch-feed-cart {
  position: sticky;
  z-index: 3;
  bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 9px;
  border: 2px solid #9b6536;
  border-radius: 15px;
  background: #f5d889;
  box-shadow: 0 5px 0 #704326;
}
.ranch-feed-cart span {
  display: grid;
}
.ranch-feed-cart small {
  font-size: 7px;
}
.ranch-feed-cart strong {
  font-size: 10px;
}
.ranch-feed-cart button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  background: #3f8e48;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}
.ranch-feed-cart button:disabled {
  filter: grayscale(1);
  opacity: 0.55;
}
.ranch-feed-record {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  min-height: 72px;
  padding: 9px 10px;
  border: 2px solid #dfb965;
  border-radius: 17px;
  background: linear-gradient(145deg, #fffdf5, #fff3cf);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 0 rgba(145, 91, 39, 0.11);
}
.ranch-feed-record::after {
  position: absolute;
  right: -22px;
  bottom: -31px;
  width: 74px;
  height: 74px;
  border: 10px solid rgba(219, 174, 83, 0.08);
  border-radius: 50%;
  content: "";
}
.ranch-feed-record > .game-icon {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  place-self: center;
  border: 0;
  background-color: transparent;
  filter: drop-shadow(0 3px 2px rgba(83, 55, 28, 0.17));
}
.ranch-feed-record-copy {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  gap: 1px;
}
.ranch-feed-record-copy > small {
  color: #9b7446;
  font-size: 6.6px;
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ranch-feed-record-copy > strong {
  overflow: hidden;
  color: #34533d;
  font:
    900 10.5px/1.15 Georgia,
    serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-feed-record-copy > span {
  color: #786b55;
  font-size: 7px;
  line-height: 1.2;
}
.ranch-feed-record-copy > .ranch-feed-active {
  width: fit-content;
  margin-top: 3px;
  padding: 3px 5px;
  border: 1px solid #9bc17e;
  border-radius: 8px;
  background: #e4f2d4;
  color: #337341;
  font-size: 6.6px;
  font-weight: 800;
}
.ranch-feed-record-copy i {
  padding: 0 2px;
  color: #c08b43;
  font-style: normal;
}
.ranch-feed-record-value {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 54px;
  padding: 6px 7px;
  border-radius: 11px;
  background: linear-gradient(#e2f2d4, #cde5bc);
  box-shadow: inset 0 0 0 1px #98bd83;
  color: #2f7139;
  text-align: center;
}
.ranch-feed-record-value > small {
  font-size: 6.2px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.ranch-feed-record-value > strong {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1;
}
.ranch-feed-record--history .ranch-feed-record-value {
  min-width: 72px;
  background: linear-gradient(#fff0c1, #f5daa0);
  box-shadow: inset 0 0 0 1px #d4ae69;
  color: #7b562d;
}
.ranch-feed-record--history .ranch-feed-record-value > strong {
  font-size: 8px;
  white-space: nowrap;
}
.ranch-feed-empty {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 20px 14px;
  border: 2px dashed #d8b66e;
  border-radius: 18px;
  background: linear-gradient(#fffaf0, #ffefc8);
  color: #6e5938;
  text-align: center;
}
.ranch-feed-empty > .game-icon {
  width: 48px;
  height: 48px;
  border: 0;
  background-color: transparent;
  filter: drop-shadow(0 3px 2px rgba(83, 55, 28, 0.16));
}
.ranch-feed-empty > strong {
  font:
    900 11px/1.15 Georgia,
    serif;
}
.ranch-feed-empty > small {
  max-width: 210px;
  color: #88765a;
  font-size: 7.5px;
  line-height: 1.25;
}
.ranch-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ranch-history-item > span {
  display: grid;
  min-width: 0;
}
.ranch-history-item > b {
  max-width: 48%;
  color: #87683a;
  font-size: 7px;
  text-align: right;
}
.ranch-history-item > b.is-credited {
  color: #2d7b3c;
  font-size: 9px;
  font-weight: 900;
  text-shadow: 0 1px rgba(255, 255, 255, 0.7);
}
.ranch-history-item > b.is-recorded {
  color: #786b54;
}
.ranch-history-item > b.is-period-credited {
  color: #8a6425;
  font-weight: 800;
  line-height: 1.2;
}
.ranch-bonus-float {
  position: absolute;
  z-index: 90;
  left: 50%;
  top: 45%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 2px solid #e6bd52;
  border-radius: 999px;
  background: rgba(84, 58, 25, 0.9);
  box-shadow: 0 0 18px rgba(255, 212, 82, 0.75);
  color: #ffe995;
  pointer-events: none;
  transform: translate(-50%, 0);
  animation: ranch-bonus-rise 1.2s ease-out forwards;
}
.ranch-bonus-float .game-icon {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}
.ranch-bonus-float strong {
  font:
    900 15px Georgia,
    serif;
}
@keyframes ranch-bonus-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.86);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58px) scale(1.06);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ranch-bonus-float {
    animation: none;
    opacity: 1;
  }
}
@media (max-height: 650px) {
  .ranch-feed-cart {
    position: relative;
    bottom: auto;
  }
}

/* Grouped production summary: informational only, with no claim or wallet action. */
.ranch-production-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  justify-content: initial;
  width: 100%;
  min-height: 80px;
  gap: 9px;
  padding: 9px 10px;
  text-align: left;
  color: #4a5438;
  overflow: hidden;
}
.ranch-production-card > div {
  min-width: 0;
}
.ranch-production-card h3 {
  font-size: 13px;
}
.ranch-production-card p {
  margin: 3px 0 0;
  font-size: 9px;
  color: #746a58;
  line-height: 1.2;
}
.production-sprite {
  display: block;
  width: 58px;
  height: 58px;
  min-width: 58px;
  aspect-ratio: 1;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 3px 2px rgba(62, 40, 25, 0.2));
  transform-origin: 50% 78%;
}
.production-milk {
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v23.10.7/products/milk-jar.webp");
  background-size: 120%;
}
.production-egg {
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v23.10.7/products/egg-basket.webp");
  background-size: 115%;
}
.production-wool {
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v23.10.7/products/wool-bundle.webp");
  background-size: 110%;
}
.production-fertilizer {
  background-image: url("/theme-assets/investasiku-farming/farming/ranch/v23.10.8/products/organic-fertilizer.webp");
  background-size: 112%;
}
@media (max-width: 359px) {
  .ranch-production-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 7px;
  }
  .production-sprite {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }
}

/* Little Ranch V18.0.5: direct world tools replace duplicate Ranch Board cards. */
/* V18.0.8: Tata Ranch follows the centered modal geometry. */
.farm-game.is-decoration-mode .ranch-decoration-sheet {
  top: 50%;
  bottom: auto;
  width: calc(100% - 30px);
  height: auto;
  max-height: min(
    64dvh,
    520px,
    calc(
      100dvh -
        max(
          118px,
          env(safe-area-inset-top) + env(safe-area-inset-bottom) + 86px
        )
    )
  );
  transform: translate(-50%, -50%);
  animation: ranch-popup-in 0.24s cubic-bezier(0.2, 0.86, 0.28, 1.18);
}
.farm-game.is-decoration-mode .ranch-decoration-sheet .farm-sheet-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.farm-game.is-decoration-mode .ranch-decoration-toolbar {
  bottom: calc(88px + env(safe-area-inset-bottom));
}
@media (max-width: 359px) {
  .farm-game.is-decoration-mode .ranch-decoration-sheet {
    width: calc(100% - 20px);
  }
}
@media (max-height: 650px) {
  .farm-game.is-decoration-mode .ranch-decoration-sheet {
    max-height: min(58dvh, 300px);
  }
  .farm-game.is-decoration-mode .ranch-decoration-toolbar {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* V21.0.8: every in-world modal uses the Routine Ranch parchment surface. */
.farm-game.is-panel-open .farm-sheet,
.farm-game.is-panel-open .farm-sheet[data-panel-kind],
.farm-game.is-decoration-mode .ranch-decoration-sheet {
  border-color: #704228;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(113, 66, 35, 0.04) 0 2px,
      transparent 2px 17px
    ),
    linear-gradient(145deg, #fff0ca, #e4c080);
  box-shadow:
    inset 0 0 0 2px #d99d50,
    inset 0 3px rgba(255, 255, 255, 0.64),
    0 7px 0 #4c2e1d,
    0 17px 34px rgba(18, 43, 27, 0.42);
}

/* V23.4 final cascade: keep the wallet HUD compact after legacy layers. */
.ranch-hud .ranch-wallet-pouch {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 92px;
  max-width: 118px;
}
.ranch-hud .ranch-wallet-pouch > span:last-child {
  display: grid;
  min-width: 0;
  text-align: left;
}

/* V23.11.7: lively cleaning mission scene. */
.ranch-cleaning-sheet .farm-sheet-title {
  margin-bottom: 5px;
}
.ranch-cleaning-body {
  display: grid;
  gap: 8px;
}
.ranch-cleaning-intro {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(156, 102, 52, 0.28);
  border-radius: 13px;
  background: linear-gradient(
    135deg,
    rgba(255, 251, 225, 0.9),
    rgba(231, 242, 201, 0.78)
  );
  color: #5c5c43;
}
.ranch-cleaning-intro .care-sprite {
  width: 32px;
  height: 32px;
}
.ranch-cleaning-intro p {
  margin: 0;
  font-size: 9px;
  line-height: 1.35;
}
.ranch-cleaning-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #d4aa64;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff9df, #f5e5b9);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.82),
    0 2px 0 rgba(142, 91, 46, 0.24);
}
.ranch-cleaning-hud > span:first-child {
  display: grid;
  gap: 1px;
}
.ranch-cleaning-hud small {
  color: #9b7447;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ranch-cleaning-hud strong {
  color: #315d3a;
  font-size: 11px;
}
.ranch-cleaning-steps {
  display: flex;
  gap: 5px;
}
.ranch-cleaning-steps i {
  width: 22px;
  height: 8px;
  border: 1px solid #c69b59;
  border-radius: 99px;
  background: #e7d7af;
  box-shadow: inset 0 1px 2px rgba(105, 70, 37, 0.17);
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.ranch-cleaning-steps i.is-done {
  border-color: #5c984f;
  background: linear-gradient(90deg, #8cc767, #4c9b50);
  box-shadow: 0 0 8px rgba(91, 161, 78, 0.42);
  transform: translateY(-1px);
}
.ranch-debris-field {
  isolation: isolate;
  height: 250px;
  border: 3px solid #8c5933;
  border-radius: 22px;
  background:
    radial-gradient(
      ellipse at 50% 112%,
      rgba(87, 52, 29, 0.22) 0 42%,
      transparent 43%
    ),
    linear-gradient(
      180deg,
      transparent 0 50%,
      rgba(116, 160, 70, 0.2) 50% 56%,
      transparent 56%
    ),
    linear-gradient(180deg, #9fd8ef 0 34%, #bfe38b 34% 58%, #c28c55 58% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 235, 166, 0.55),
    inset 0 -16px 24px rgba(105, 62, 33, 0.18),
    0 4px 0 rgba(102, 57, 30, 0.42);
}
.ranch-debris-field::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -4%;
  right: -4%;
  top: 42%;
  height: 28%;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(ellipse at 12% 100%, #5e9945 0 32%, transparent 34%),
    radial-gradient(ellipse at 38% 100%, #6ca74d 0 38%, transparent 40%),
    radial-gradient(ellipse at 67% 100%, #5d9843 0 37%, transparent 39%),
    radial-gradient(ellipse at 92% 100%, #74ae50 0 32%, transparent 34%);
  opacity: 0.92;
}
.ranch-debris-field::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 58% 0 0;
  background:
    radial-gradient(
      ellipse at 25% 18%,
      rgba(82, 52, 30, 0.18) 0 7%,
      transparent 8%
    ),
    radial-gradient(
      ellipse at 72% 36%,
      rgba(82, 52, 30, 0.14) 0 6%,
      transparent 7%
    ),
    repeating-linear-gradient(
      165deg,
      transparent 0 22px,
      rgba(99, 62, 35, 0.07) 23px 25px
    );
}
.ranch-cleaning-sun {
  position: absolute;
  z-index: -1;
  top: 13px;
  right: 24px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 36% 34%,
    #fff9bd 0 20%,
    #ffd55e 48%,
    #f5a936 72%
  );
  box-shadow: 0 0 18px rgba(255, 216, 91, 0.72);
  animation: ranch-cleaning-sun-glow 2.4s ease-in-out infinite alternate;
}
.ranch-cleaning-cloud {
  position: absolute;
  z-index: -1;
  width: 46px;
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 244, 0.88);
  box-shadow:
    12px -6px 0 1px rgba(255, 255, 244, 0.88),
    25px 0 0 rgba(255, 255, 244, 0.88);
  animation: ranch-cleaning-cloud-drift 7s ease-in-out infinite alternate;
}
.ranch-cleaning-cloud--one {
  top: 22px;
  left: 19px;
}
.ranch-cleaning-cloud--two {
  top: 54px;
  right: 75px;
  transform: scale(0.68);
  opacity: 0.72;
  animation-delay: -3.2s;
}
.ranch-cleaning-fence {
  position: absolute;
  z-index: 0;
  top: 91px;
  left: 0;
  width: 100%;
  height: 29px;
  border-top: 7px solid #ac713c;
  border-bottom: 6px solid #88552f;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 34px,
    #9b6336 35px 43px,
    transparent 44px 67px
  );
  filter: drop-shadow(0 3px 2px rgba(79, 48, 27, 0.22));
  opacity: 0.88;
}
.ranch-cleaning-animal {
  position: absolute;
  z-index: 1;
  display: block;
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 0 0;
  filter: drop-shadow(0 3px 2px rgba(61, 48, 29, 0.24));
  pointer-events: none;
}
.ranch-cleaning-animal--chicken {
  top: 78px;
  right: 14px;
  width: 48px;
  height: 48px;
  animation: ranch-cleaning-chicken 2.1s steps(1, end) infinite;
}
.ranch-cleaning-animal--sheep {
  top: 88px;
  left: 8px;
  width: 57px;
  height: 57px;
  animation: ranch-cleaning-sheep 3s ease-in-out infinite;
}
.ranch-debris-field button {
  z-index: 2;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}
.ranch-debris-field button::before,
.ranch-debris-field button::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ead3a5;
  opacity: 0;
  pointer-events: none;
}
.ranch-debris-field button::before {
  left: 16px;
  bottom: 13px;
  box-shadow:
    16px 7px 0 #d6b682,
    29px -1px 0 #f0dfba;
}
.ranch-debris-field button::after {
  right: 15px;
  bottom: 17px;
  box-shadow:
    -12px -4px 0 #e5c99a,
    8px 4px 0 #cfa877;
}
.ranch-debris-field button[data-debris="0"] {
  left: 12%;
  top: 51%;
}
.ranch-debris-field button[data-debris="1"] {
  right: 9%;
  top: 54%;
}
.ranch-debris-field button[data-debris="2"] {
  left: 39%;
  bottom: 1%;
}
.ranch-cleaning-target-ring {
  position: absolute;
  z-index: -1;
  inset: 9px;
  border: 2px dashed rgba(255, 246, 185, 0.88);
  border-radius: 50%;
  background: rgba(255, 242, 164, 0.12);
  box-shadow: 0 0 0 5px rgba(87, 134, 63, 0.12);
  animation: ranch-cleaning-target 1.55s ease-in-out infinite;
}
.ranch-debris-field button:hover .ranch-cleaning-target-ring,
.ranch-debris-field button:focus-visible .ranch-cleaning-target-ring,
.ranch-debris-field button.is-targeted .ranch-cleaning-target-ring {
  border-color: #fff7b4;
  background: rgba(255, 236, 114, 0.28);
  box-shadow:
    0 0 0 7px rgba(255, 225, 90, 0.16),
    0 0 15px rgba(255, 239, 138, 0.64);
}
.ranch-debris-field button .care-sprite {
  position: relative;
  z-index: 2;
  width: 68px;
  height: 68px;
  transition: filter 0.2s ease;
}
.ranch-debris-field button.is-cleaning {
  animation: none;
}
.ranch-debris-field button.is-cleaning::before,
.ranch-debris-field button.is-cleaning::after {
  animation: ranch-cleaning-dust 0.58s ease-in-out infinite;
}
.ranch-debris-field button.is-cleaning .care-sprite {
  animation: ranch-cleaning-debris-wiggle 0.45s ease-in-out infinite alternate;
  filter: brightness(1.08) drop-shadow(0 3px 2px rgba(62, 40, 25, 0.22));
}
.ranch-debris-field button.is-clean {
  opacity: 0;
  transform: scale(0.32) rotate(12deg);
}
.ranch-cleaning-farmer {
  z-index: 5;
  width: 70px;
  height: 74px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: var(--cleaning-idle-size, 400% 400%);
  background-position: 0 0;
  box-shadow: none;
  filter: drop-shadow(0 5px 3px rgba(54, 43, 26, 0.32));
  transition:
    left 0.42s cubic-bezier(0.3, 0.72, 0.35, 1),
    top 0.42s cubic-bezier(0.3, 0.72, 0.35, 1);
  will-change: left, top, background-position, transform;
}
.ranch-cleaning-farmer::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 1px;
  width: 45px;
  height: 10px;
  border-radius: 50%;
  background: rgba(68, 43, 27, 0.22);
  transform: translateX(-50%);
  filter: blur(1px);
}
.ranch-cleaning-farmer.is-idle {
  animation: ranch-cleaner-idle 1.8s ease-in-out infinite;
}
.ranch-cleaning-farmer.is-moving {
  background-image: var(--cleaning-walk-image) !important;
  background-size: var(--cleaning-walk-size, 400% 400%);
  animation: ranch-cleaner-walk 0.34s steps(1, end) infinite;
}
.ranch-cleaning-farmer.is-sweeping {
  background-image: var(--cleaning-action-image) !important;
  background-size: var(--cleaning-action-size, 600% 400%);
  animation: ranch-cleaner-sweep 0.72s steps(1, end) infinite;
}
.ranch-cleaning-broom {
  position: absolute;
  z-index: 6;
  right: -11px;
  bottom: 0;
  display: none;
  width: 36px;
  height: 36px;
  transform-origin: 42% 22%;
  pointer-events: none;
}
.ranch-cleaning-farmer.is-sweeping .ranch-cleaning-broom {
  display: block;
  animation: ranch-cleaning-broom-swing 0.56s ease-in-out infinite;
}
.ranch-cleaning-celebration {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(255, 253, 195, 0.34),
    transparent 56%
  );
}
.ranch-cleaning-celebration[hidden] {
  display: none;
}
.ranch-cleaning-celebration .care-sprite {
  position: absolute;
  width: 56px;
  height: 56px;
  animation: ranch-cleaning-sparkle-pop 0.9s ease-in-out infinite alternate;
}
.ranch-cleaning-celebration .care-sprite:nth-child(1) {
  top: 17%;
  left: 19%;
}
.ranch-cleaning-celebration .care-sprite:nth-child(2) {
  top: 25%;
  right: 14%;
  animation-delay: -0.32s;
}
.ranch-cleaning-celebration .care-sprite:nth-child(3) {
  bottom: 13%;
  left: 45%;
  animation-delay: -0.58s;
}
.ranch-cleaning-celebration b {
  padding: 8px 14px;
  border: 2px solid #4b8f49;
  border-radius: 99px;
  background: linear-gradient(#faffdc, #bfe88f);
  box-shadow:
    0 4px 0 #37723e,
    0 9px 20px rgba(49, 104, 55, 0.28);
  color: #2e6c3d;
  font:
    900 13px Georgia,
    serif;
  animation: ranch-cleaning-badge-pop 0.45s cubic-bezier(0.18, 0.9, 0.3, 1.35)
    both;
}
.ranch-cleaning-status {
  min-height: 25px;
  margin: 1px 0 0;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(255, 247, 213, 0.72);
  color: #55704e;
  font-size: 9px;
}
.ranch-cleaning-status > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7db45c;
  box-shadow: 0 0 0 3px rgba(125, 180, 92, 0.14);
  animation: ranch-cleaning-status-pulse 1.4s ease-in-out infinite;
}

@keyframes ranch-cleaning-cloud-drift {
  to {
    transform: translateX(12px);
  }
}
@keyframes ranch-cleaning-sun-glow {
  to {
    transform: scale(1.06);
    box-shadow: 0 0 25px rgba(255, 221, 102, 0.88);
  }
}
@keyframes ranch-cleaning-target {
  50% {
    transform: scale(1.12);
    opacity: 0.58;
  }
}
@keyframes ranch-cleaning-chicken {
  0%,
  24% {
    background-position: 0 0;
    transform: translateY(0) rotate(-1deg);
  }
  25%,
  49% {
    background-position: 33.333% 0;
    transform: translateY(2px) rotate(2deg);
  }
  50%,
  74% {
    background-position: 66.666% 0;
    transform: translateY(0) rotate(-1deg);
  }
  75%,
  100% {
    background-position: 100% 0;
    transform: translateY(1px) rotate(1deg);
  }
}
@keyframes ranch-cleaning-sheep {
  50% {
    transform: translateY(-3px) rotate(1deg);
  }
}
@keyframes ranch-cleaner-idle {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
    background-position: 0 0;
  }
  50% {
    transform: translate(-50%, -50%) translateY(-2px);
    background-position: 33.333% 0;
  }
}
@keyframes ranch-cleaner-walk {
  0%,
  24% {
    transform: translate(-50%, -50%) translateY(0);
    background-position: 0 var(--cleaning-direction-row, 100%);
  }
  25%,
  49% {
    transform: translate(-50%, -50%) translateY(-3px);
    background-position: 33.333% var(--cleaning-direction-row, 100%);
  }
  50%,
  74% {
    transform: translate(-50%, -50%) translateY(0);
    background-position: 66.666% var(--cleaning-direction-row, 100%);
  }
  75%,
  100% {
    transform: translate(-50%, -50%) translateY(-3px);
    background-position: 100% var(--cleaning-direction-row, 100%);
  }
}
@keyframes ranch-cleaner-sweep {
  0%,
  16% {
    transform: translate(-50%, -50%) rotate(-3deg);
    background-position: 0 var(--cleaning-direction-row, 100%);
  }
  17%,
  32% {
    transform: translate(-50%, -50%) rotate(4deg);
    background-position: 20% var(--cleaning-direction-row, 100%);
  }
  33%,
  49% {
    transform: translate(-50%, -50%) rotate(-5deg);
    background-position: 40% var(--cleaning-direction-row, 100%);
  }
  50%,
  65% {
    transform: translate(-50%, -50%) rotate(3deg);
    background-position: 60% var(--cleaning-direction-row, 100%);
  }
  66%,
  82% {
    transform: translate(-50%, -50%) rotate(-4deg);
    background-position: 80% var(--cleaning-direction-row, 100%);
  }
  83%,
  100% {
    transform: translate(-50%, -50%) rotate(3deg);
    background-position: 100% var(--cleaning-direction-row, 100%);
  }
}
@keyframes ranch-cleaning-broom-swing {
  0%,
  100% {
    transform: rotate(-22deg) translateY(0);
  }
  50% {
    transform: rotate(24deg) translateY(3px);
  }
}
@keyframes ranch-cleaning-debris-wiggle {
  to {
    transform: translateY(-3px) rotate(4deg) scale(0.96);
  }
}
@keyframes ranch-cleaning-dust {
  0% {
    opacity: 0;
    transform: translate(0, 4px) scale(0.5);
  }
  48% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(7px, -13px) scale(1.2);
  }
}
@keyframes ranch-cleaning-sparkle-pop {
  from {
    opacity: 0.5;
    transform: scale(0.7) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1.15) rotate(10deg);
  }
}
@keyframes ranch-cleaning-badge-pop {
  from {
    opacity: 0;
    transform: scale(0.55) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes ranch-cleaning-status-pulse {
  50% {
    transform: scale(1.24);
    box-shadow: 0 0 0 5px rgba(125, 180, 92, 0.08);
  }
}

@media (max-height: 650px) {
  .ranch-cleaning-intro {
    display: none;
  }
  .ranch-debris-field {
    height: 210px;
  }
  .ranch-cleaning-fence {
    top: 73px;
  }
  .ranch-cleaning-animal--chicken {
    top: 61px;
  }
  .ranch-cleaning-animal--sheep {
    top: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ranch-cleaning-sun,
  .ranch-cleaning-cloud,
  .ranch-cleaning-animal,
  .ranch-cleaning-farmer,
  .ranch-cleaning-target-ring,
  .ranch-cleaning-status > i,
  .ranch-cleaning-celebration .care-sprite,
  .ranch-cleaning-broom {
    animation: none !important;
  }
}
.ranch-hud .ranch-wallet-pouch > span:last-child b {
  overflow: hidden;
  color: #fff3c2;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-hud .ranch-wallet-pouch > span:last-child small {
  overflow: hidden;
  max-width: 66px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-wallet-panel .ranch-wallet-balances.is-single {
  grid-template-columns: minmax(0, 1fr);
}
.ranch-wallet-panel .ranch-wallet-balances.is-single:has(.is-historical) {
  grid-template-columns: 1.3fr 0.9fr;
}
.ranch-wallet-panel {
  background: #fff1c9;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
@media (max-width: 359px) {
  .ranch-hud .ranch-wallet-pouch {
    min-width: 78px;
    max-width: 92px;
  }
  .ranch-hud .ranch-wallet-pouch > span:last-child b {
    display: none;
  }
  .ranch-wallet-panel .ranch-wallet-balances.is-single:has(.is-historical) {
    grid-template-columns: 1fr;
  }
}

/* V23.12.20: keep standalone Android safe-area insets from pushing the Ranch HUD inward. */
.farm-game {
  --ranch-world-hud-top: max(9px, min(env(safe-area-inset-top, 0px), 14px));
  --ranch-world-dock-bottom: max(
    7px,
    min(env(safe-area-inset-bottom, 0px), 12px)
  );
  --ranch-secondary-top: calc(var(--ranch-world-hud-top) + 66px);
}
.ranch-hud {
  padding-top: var(--ranch-world-hud-top);
}
.ranch-secondary-hud {
  top: var(--ranch-secondary-top);
}
.ranch-audio-controls {
  top: calc(var(--ranch-world-hud-top) + 68px);
}
.ranch-farm-dock {
  bottom: var(--ranch-world-dock-bottom);
}
.farm-context-actions {
  bottom: calc(var(--ranch-world-dock-bottom) + 84px);
}
@media (max-width: 359px) {
  .ranch-audio-controls {
    top: calc(var(--ranch-world-hud-top) + 69px);
  }
  .farm-context-actions {
    bottom: calc(var(--ranch-world-dock-bottom) + 80px);
  }
}

/* V23.12.21: visually balance the empty-Ranch close control while preserving its tap area. */
.farm-empty > .game-icon.utility-icon.farm-empty-close {
  width: 38px;
  height: 38px;
  --icon-scale: 0.86;
  filter: drop-shadow(0 2px 1px rgba(62, 40, 25, 0.26));
}
.farm-empty > .farm-empty-close::after {
  content: "";
  position: absolute;
  inset: -3px;
}

/* Admin impersonation: keep the escape hatch visible in the Ranch HUD. */
.ranch-secondary-hud {
  column-gap: 22px;
  row-gap: 8px;
}
.ranch-secondary-hud.has-impersonation-session {
  z-index: 45;
}
.ranch-impersonation-return {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 9px 5px 6px;
  border: 2px solid #8d5734;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff1be, #dfad5d);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.72),
    0 4px 0 #704429,
    0 8px 15px rgba(45, 52, 30, 0.22);
  color: #633a26;
  text-decoration: none;
  pointer-events: auto;
}
.ranch-impersonation-return .game-icon {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 1px rgba(77, 46, 24, 0.2));
}
.ranch-impersonation-return > span:last-child {
  display: grid;
  min-width: 0;
  text-align: left;
}
.ranch-impersonation-return small {
  overflow: hidden;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-impersonation-return strong {
  overflow: hidden;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ranch-impersonation-return:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.65),
    0 2px 0 #704429,
    0 5px 10px rgba(45, 52, 30, 0.18);
}
@media (max-width: 359px) {
  .ranch-secondary-hud {
    column-gap: 12px;
    row-gap: 7px;
  }
  .ranch-impersonation-return {
    grid-template-columns: 27px minmax(0, 1fr);
    min-height: 37px;
    padding-right: 7px;
  }
  .ranch-impersonation-return .game-icon {
    width: 27px;
    height: 27px;
  }
  .ranch-impersonation-return strong {
    font-size: 8.5px;
  }
}

/* V23.12.48: Telur Kejutan matches the compact right-side HUD controls. */
.ranch-egg-shortcut {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  pointer-events: auto;
  isolation: isolate;
}
.ranch-secondary-hud.has-impersonation-session .ranch-egg-shortcut {
  grid-row: 3;
}
.ranch-egg-shortcut img {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  margin: -8px;
  object-fit: contain;
  filter: drop-shadow(0 5px 3px rgba(62, 42, 23, 0.3));
  transform-origin: 50% 82%;
  animation: ranch-egg-shortcut-wobble 3.6s ease-in-out infinite;
  will-change: transform;
}
.ranch-egg-shortcut__badge,
.ranch-promotion-shortcut__badge {
  position: absolute;
  z-index: 4;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid #fff4bd;
  border-radius: 999px;
  background: linear-gradient(180deg, #ef5b43, #b72720);
  box-shadow:
    0 3px 0 #76251e,
    0 5px 9px rgba(73, 30, 20, 0.28);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px rgba(87, 22, 17, 0.55);
}
.ranch-egg-shortcut:active {
  transform: translateY(2px);
  box-shadow: none;
}
@keyframes ranch-egg-shortcut-wobble {
  0%,
  14%,
  36%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  19% {
    transform: rotate(-8deg) translateY(-2px);
  }
  24% {
    transform: rotate(7deg) translateY(-2px);
  }
  29% {
    transform: rotate(-5deg) translateY(-1px);
  }
  33% {
    transform: rotate(3deg) translateY(0);
  }
}
@media (max-width: 359px) {
  .ranch-egg-shortcut {
    width: 44px;
    height: 44px;
    margin-left: 3px;
    margin-top: 11px;
  }
  .ranch-egg-shortcut img {
    width: 58px;
    height: 58px;
    margin: -7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ranch-egg-shortcut img {
    animation: none !important;
  }
}

/* V24.0.96: direct Misi Promosi shortcut below Telur Kejutan. Keep the megaphone
   visually aligned with the egg artwork even though the source artwork has a
   much tighter transparent canvas. */
.ranch-promotion-shortcut {
  position: relative;
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  text-decoration: none;
  pointer-events: auto;
  isolation: isolate;
}
.ranch-secondary-hud.has-impersonation-session .ranch-promotion-shortcut {
  grid-row: 4;
}
.ranch-promotion-shortcut img {
  position: relative;
  z-index: 2;
  width: 50px;
  height: 50px;
  margin: -1px;
  object-fit: contain;
  filter: drop-shadow(0 5px 3px rgba(62, 42, 23, 0.3));
  transform-origin: 50% 78%;
  animation: ranch-promotion-shortcut-invite 3.8s ease-in-out infinite;
  will-change: transform;
}
.ranch-promotion-shortcut:active {
  transform: translateY(2px);
}
@keyframes ranch-promotion-shortcut-invite {
  0%,
  18%,
  44%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  24% {
    transform: translateY(-3px) rotate(-3deg);
  }
  31% {
    transform: translateY(-1px) rotate(3deg);
  }
  37% {
    transform: translateY(-2px) rotate(-1deg);
  }
}
@media (max-width: 359px) {
  .ranch-promotion-shortcut {
    width: 44px;
    height: 44px;
    margin-left: 3px;
  }
  .ranch-promotion-shortcut img {
    width: 46px;
    height: 46px;
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ranch-promotion-shortcut img {
    animation: none !important;
  }
}

/* V23.4.3: restore the pouch-over-balance HUD and enrich the wallet office. */
.ranch-hud .ranch-wallet-pouch {
  display: grid;
  grid-template-rows: 48px auto;
  justify-items: center;
  align-items: start;
  gap: 0;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  min-height: 76px;
  margin-top: 2px;
  padding: 0;
}
.ranch-hud .ranch-wallet-pouch .game-icon {
  width: 58px;
  height: 58px;
  transform: translateY(-6px);
  margin-right: -1em;
}
.ranch-hud .ranch-wallet-pouch:active .game-icon {
  transform: translateY(-3px) scale(0.96);
}
.ranch-hud .ranch-wallet-pouch > span:last-child {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: 92px;
  margin: 0;
  text-align: center;
}
.ranch-hud .ranch-wallet-pouch > span:last-child b {
  display: none;
}
.ranch-hud .ranch-wallet-pouch > span:last-child small {
  position: static;
  width: auto;
  min-width: 74px;
  max-width: 92px;
  margin: -10px 0 0 15px;
  padding: 5px 8px;
  overflow: hidden;
  border: 2px solid #d3a45b;
  border-radius: 11px;
  background: linear-gradient(
    180deg,
    rgba(63, 84, 51, 0.98),
    rgba(38, 64, 45, 0.98)
  );
  color: #fff8d9;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.22),
    0 3px 0 rgba(83, 50, 28, 0.55);
  font-size: 8px;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-wallet-panel-body {
  display: grid;
  gap: 12px;
}
.ranch-wallet-panel .ranch-wallet-summary {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 2px solid #d0a158;
  border-radius: 15px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(132, 84, 37, 0.025) 0 1px,
      transparent 1px 17px
    ),
    linear-gradient(180deg, #fff9e2, #f7e7bc);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.78),
    0 3px 0 rgba(119, 72, 34, 0.2);
}
.ranch-wallet-primary-balance {
  display: grid;
  gap: 3px;
}
.ranch-wallet-primary-balance small,
.ranch-wallet-secondary-balance small {
  color: #836941;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.ranch-wallet-primary-balance strong {
  color: #31563c;
  font:
    900 20px/1.05 Georgia,
    serif;
}
.ranch-wallet-secondary-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(155, 104, 52, 0.48);
}
.ranch-wallet-secondary-balance > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.ranch-wallet-secondary-balance em {
  color: #7b6b50;
  font-size: 8px;
  font-style: normal;
  line-height: 1.3;
}
.ranch-wallet-secondary-balance > strong {
  color: #31563c;
  font:
    900 13px/1 Georgia,
    serif;
  text-align: right;
  white-space: nowrap;
}
.ranch-wallet-panel .ranch-wallet-inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.ranch-wallet-panel .ranch-wallet-inline-actions a {
  min-height: 40px;
  padding: 11px 8px 8px;
  border: 1px solid #c58a43;
  border-radius: 11px;
  background: linear-gradient(180deg, #fff5d5, #edcf8c);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.76),
    0 3px 0 #9a6132;
  color: #654429;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}
.ranch-wallet-panel-note {
  margin: 0;
  padding-top: 9px;
  border-top: 1px dashed rgba(155, 104, 52, 0.48);
  color: #665238;
  font-size: 8px;
  line-height: 1.4;
}
.ranch-wallet-center-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 7px 10px;
  border: 2px solid #a8733d;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff8dd, #ead09a);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.7),
    0 3px 0 #8e5b31;
  color: #604429;
  text-decoration: none;
}
.ranch-wallet-center-link .game-icon {
  width: 36px;
  height: 36px;
}
.ranch-wallet-center-link span:last-child {
  display: grid;
}
.ranch-wallet-center-link strong {
  font-size: 9px;
}
.ranch-wallet-center-link small {
  color: #7b674d;
  font-size: 7px;
}
@media (max-width: 359px) {
  .ranch-hud .ranch-wallet-pouch {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
  }
  .ranch-hud .ranch-wallet-pouch > span:last-child {
    width: 82px;
  }
  .ranch-hud .ranch-wallet-pouch > span:last-child small {
    min-width: 68px;
    max-width: 82px;
  }
}

/* Daily care rewards: keep each action compact while making its bonus visible. */
.ranch-care-actions button {
  align-content: center;
  min-width: 0;
  min-height: 56px;
  padding: 6px 4px 7px;
  gap: 4px;
}
.ranch-enclosure-card button {
  align-content: center;
  min-width: 88px;
  min-height: 56px;
  padding: 6px 8px 7px;
  gap: 4px;
}
.ranch-care-action-label {
  display: block;
  overflow: hidden;
  max-width: 100%;
  font-size: 9px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranch-care-action-bonus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 3px 7px 2px;
  border: 1px solid rgba(35, 126, 59, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, #75d66f, #3fa954);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(33, 106, 49, 0.24);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ranch-care-actions button.is-done .ranch-care-action-bonus,
.ranch-enclosure-card button.is-done .ranch-care-action-bonus {
  border-color: rgba(116, 110, 96, 0.42);
  background: linear-gradient(180deg, #e7e3d9, #c8c1b2);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.55);
  color: #746e62;
  text-shadow: none;
}
@media (max-width: 359px) {
  .ranch-care-actions {
    gap: 4px;
  }
  .ranch-care-actions button {
    padding-inline: 2px;
  }
  .ranch-care-action-label,
  .ranch-care-action-bonus {
    font-size: 8px;
  }
  .ranch-care-action-bonus {
    padding-inline: 5px;
  }
}
