.pasture-main {
  max-width: 1320px;
  padding-top: 28px;
}
.pasture-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 22px;
  gap: 15px;
}
.pasture-title > div {
  display: grid;
  grid-template-columns: 58px 1fr;
  column-gap: 14px;
  align-items: center;
}
.pasture-mark {
  grid-row: span 2;
}
.pasture-mark .sheep-svg {
  width: 58px;
  height: 53px;
}
.pasture-title h1 {
  font-size: 28px;
  line-height: 1.5;
  font-weight: 600;
  margin: 0;
}
.pasture-title p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.pasture-main .toolbar {
  margin-bottom: 12px;
}
.herd-progress {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin: 24px 0 13px;
  font-size: 12px;
  color: var(--muted);
}
.herd-progress > div {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.herd-progress strong {
  color: var(--ink);
  font-weight: 500;
}
.herd-progress b {
  font-size: 20px;
  color: var(--green);
}
.herd-progress-bar {
  height: 5px;
  background: var(--line);
  border-radius: 5px;
  margin-bottom: 23px;
  overflow: hidden;
}
.herd-progress-bar i {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 0.4s;
  border-radius: 5px;
}
.pasture-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  align-items: stretch;
}
.pasture-field {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  min-width: 0;
  box-shadow: var(--shadow);
}
.field-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 19px 20px;
}
.field-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.field-heading h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}
.field-heading > span {
  font-size: 11px;
  color: var(--muted);
}
.field-count {
  font-size: 23px;
  color: var(--green);
}
.field-count small {
  font-size: 11px;
  color: var(--muted);
}
.field-marker {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a8b580;
}
.inside .field-marker {
  background: var(--green);
}
.field-ground {
  position: relative;
  height: 375px;
  background: #edf1dc;
  overflow: hidden;
}
.inside .field-ground {
  background: #e0ecd8;
}
.field-grass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at center, #78955530 0 1px, transparent 2px),
    radial-gradient(ellipse at center, #95a96026 0 1px, transparent 2px),
    radial-gradient(ellipse at 10% 90%, #a6bb7640, transparent 65%);
  background-size:
    37px 43px,
    57px 47px,
    100% 100%;
  background-position:
    6px 12px,
    17px 9px,
    0 0;
}
.sheep-roam {
  position: absolute;
  inset: 12px 10px 30px;
}
.sheep-token {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 67px;
  height: 67px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 15px;
  will-change: transform;
  transition:
    background 0.2s,
    border-color 0.2s;
  --facing: 1;
  background: transparent;
}
.sheep-token:hover,
.sheep-token:focus-visible {
  background: #ffffffa0;
  border-color: #79946d;
  outline: 2px solid #79946d40;
  outline-offset: 2px;
}
.sheep-token.selected {
  background: #ffffff80;
  border-color: #4b816b;
}
.sheep-direction {
  display: block;
  transform: scaleX(var(--facing));
  pointer-events: none;
}
.sheep-svg {
  display: block;
  width: 61px;
  height: 53px;
  overflow: visible;
  flex-shrink: 0;
}
.sheep-name {
  font-size: 10px;
  line-height: 1.15;
  color: #62734f;
  max-width: 100%;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 12px;
}
.caught .sheep-name {
  color: #365c45;
}
.caught .sheep-scarf {
  fill: #6e9a80;
}
.escaped .sheep-scarf {
  fill: #c69558;
}
.waiting .sheep-scarf {
  fill: #b8897b;
}
.sheep-favorite {
  position: absolute;
  top: 6px;
  right: 7px;
  color: #a38844;
  font-size: 7px;
  font-style: normal;
}
.sheep-escape {
  position: absolute;
  top: 2px;
  left: 6px;
  color: #a08243;
  font-size: 14px;
  font-style: normal;
}
.field-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  color: #6f8764;
  font-size: 14px;
  padding: 22px;
  pointer-events: none;
}
.field-empty small {
  font-size: 12px;
  color: #8b9880;
}
.field-fence {
  position: absolute;
  bottom: 10px;
  left: 15px;
  right: 15px;
  height: 11px;
  border-top: 2px solid #fffdf8b0;
  border-bottom: 2px solid #fffdf8b0;
  background: repeating-linear-gradient(90deg, transparent 0 30px, #fffdf8d0 30px 33px);
  pointer-events: none;
}
.field-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  color: var(--muted);
  font-size: 11px;
  min-height: 40px;
}
.field-footer > div {
  display: flex;
  align-items: center;
  gap: 11px;
}
.field-footer button {
  padding: 2px 6px;
  color: var(--green);
}
.field-footer button:disabled {
  opacity: 0.35;
}
.pasture-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--green);
}
.pasture-bridge > span {
  font-size: 25px;
}
.pasture-bridge small {
  font-size: 10px;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  color: var(--muted);
}
.herd-story {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 23px;
  margin: 21px 0;
}
.herd-story.catch {
  color: var(--green);
}
.herd-story.miss {
  color: var(--red);
}
.herd-story.escape {
  color: #a08243;
}
.pasture-return {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 23px 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}
.pasture-return strong {
  font-size: 16px;
  font-weight: 500;
}
.pasture-return p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}
.pasture-return .primary {
  white-space: nowrap;
}
.pasture-footnote {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 16px 0;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
}
.pasture-note {
  font-size: 12px;
  color: var(--muted);
  margin: 15px 0;
}
.herd-help p {
  line-height: 1.9;
  margin: 15px 0;
}
.pasture-peek {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0 24px;
  padding: 10px 18px;
  border-radius: 13px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--line);
}
.pasture-peek:hover {
  background: var(--surface);
}
.peek-sheep .sheep-svg {
  width: 40px;
  height: 35px;
}
.pasture-peek b {
  color: var(--green);
  font-weight: 500;
  margin-left: 6px;
}
.pasture-peek small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.peek-arrow {
  margin-left: auto;
  white-space: nowrap;
  color: var(--green);
}
@keyframes sheep-step {
  from {
    transform: rotate(-10deg);
  }
  to {
    transform: rotate(10deg);
  }
}
@keyframes sheep-bob {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 -1px;
  }
}
:root[data-theme='dark'] .field-ground {
  background: #2e3e2b;
}
:root[data-theme='dark'] .inside .field-ground {
  background: #294433;
}
:root[data-theme='dark'] .sheep-name {
  color: #b4c2a1;
}
:root[data-theme='dark'] .caught .sheep-name {
  color: #c6d9b9;
}
:root[data-theme='dark'] .field-empty {
  color: #a5b99b;
}
:root[data-theme='dark'] .sheep-token:hover,
:root[data-theme='dark'] .sheep-token:focus-visible,
:root[data-theme='dark'] .sheep-token.selected {
  background: #506d485c;
}
:root[data-theme='dark'] .herd-story.escape {
  color: #cbb95f;
}
@media (max-width: 1000px) {
  .field-heading > span {
    display: none;
  }
  .field-heading {
    padding: 15px;
  }
  .field-click-note {
    display: none;
  }
  .field-ground {
    height: 390px;
  }
}
@media (max-width: 700px) {
  .pasture-title > div {
    grid-template-columns: 43px 1fr;
    gap: 0 9px;
  }
  .pasture-mark .sheep-svg {
    width: 43px;
    height: 44px;
  }
  .pasture-title h1 {
    font-size: 23px;
  }
  .pasture-title p {
    font-size: 11px;
  }
  .pasture-title > .text-btn {
    font-size: 11px;
    white-space: nowrap;
  }
  .pasture-board {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .pasture-bridge {
    display: none;
  }
  .field-ground {
    height: 265px;
  }
  .field-heading > span {
    display: block;
    font-size: 10px;
  }
  .field-heading h2 {
    font-size: 15px;
  }
  .herd-progress {
    font-size: 11px;
    gap: 9px;
  }
  .herd-progress > div {
    gap: 10px;
  }
  .pasture-return {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }
  .pasture-return strong {
    font-size: 15px;
  }
  .pasture-return p {
    line-height: 1.8;
  }
  .pasture-return .primary {
    text-align: center;
  }
  .pasture-footnote {
    flex-direction: column;
    align-items: flex-start;
    font-size: 10px;
  }
  .pasture-peek {
    padding: 10px;
    gap: 7px;
  }
  .pasture-peek small {
    font-size: 10px;
    line-height: 1.5;
  }
  .peek-arrow {
    font-size: 10px;
  }
  .herd-story {
    font-size: 12px;
    line-height: 1.8;
  }
}
@media (prefers-reduced-motion: reduce) {
  .walking .sheep-body,
  .walking .leg-front,
  .walking .leg-back {
    animation: none;
  }
  .herd-progress-bar i {
    transition: none;
  }
  .sheep-token {
    will-change: auto;
  }
}

.pasture-wallet {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  margin: 0 0 18px;
}
.wallet-balance {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 140px;
}
.coin-icon {
  display: block;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  color: #a28424;
}
.wallet-balance > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wallet-balance span {
  font-size: 12px;
  color: var(--muted);
}
.wallet-balance strong {
  font-size: 29px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.wallet-totals {
  display: flex;
  gap: 7px 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.wallet-totals b {
  color: var(--ink);
  font-weight: 600;
}
.wallet-totals small {
  flex-basis: 100%;
  font-size: 12px;
}
.wallet-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.wallet-actions button {
  min-height: 42px;
}
.coin-reward {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.skin-shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 22px 0;
}
.shop-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.shop-wallet .coin-icon {
  width: 26px;
  height: 26px;
}
.shop-wallet strong {
  font-size: 22px;
}
.skin-section-heading {
  font-size: 15px;
  font-weight: 600;
  margin: 28px 0 16px;
}
.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.skin-tile {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 12px;
  min-width: 0;
}
.skin-tile.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
}
.skin-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 108px;
}
.skin-art .sheep-svg {
  width: 110px;
  height: 96px;
}
.skin-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  margin: 8px 0 4px;
}
.skin-caption strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.skin-tile > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin: 0 0 13px;
}
.skin-tile button {
  min-height: 38px;
  padding: 7px 18px;
  font-size: 12px;
}
.skin-shop-empty {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.coin-history-total {
  font-variant-numeric: tabular-nums;
}
.coin-history {
  list-style: none;
  padding: 0;
  margin: 22px 0;
}
.coin-history li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.coin-history li > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.coin-history strong {
  font-size: 14px;
  font-weight: 600;
}
.coin-history span {
  font-size: 14px;
}
.coin-history small {
  color: var(--muted);
  font-size: 11px;
}
.coin-income {
  color: var(--green);
}
.coin-expense {
  color: var(--muted);
}
:root[data-theme='dark'] .coin-icon {
  color: #d8c65f;
}
@media (max-width: 900px) {
  .pasture-wallet {
    gap: 20px;
    flex-wrap: wrap;
  }
  .wallet-actions {
    margin-left: auto;
  }
  .wallet-totals {
    flex: 1;
  }
}
@media (max-width: 700px) {
  .pasture-wallet {
    gap: 18px;
    padding: 18px 0;
  }
  .wallet-balance {
    min-width: 120px;
  }
  .wallet-balance strong {
    font-size: 26px;
  }
  .wallet-totals {
    gap: 6px 12px;
  }
  .wallet-actions {
    margin-left: 0;
    width: 100%;
  }
  .wallet-actions button {
    flex: 1;
  }
  .skin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .skin-art {
    min-height: 88px;
  }
  .skin-art .sheep-svg {
    width: 90px;
    height: 78px;
  }
  .skin-caption {
    font-size: 12px;
    gap: 5px;
  }
  .skin-tile {
    padding: 12px 8px;
  }
  .skin-shop-toolbar {
    gap: 12px;
  }
  .skin-shop-toolbar .primary,
  .skin-shop-toolbar .secondary {
    font-size: 12px;
  }
}

.modal-scroll:has(.skin-grid) > h2,
.modal-scroll:has(.coin-history) > h2 {
  font-weight: 600;
}
/* Count-sized sheep share the existing skins and roaming behaviour. */
.size-giant {
  --sheep-width: 128px;
}
.size-large {
  --sheep-width: 102px;
}
.size-medium {
  --sheep-width: 80px;
}
.size-small {
  --sheep-width: 58px;
}
.size-tiny {
  --sheep-width: 38px;
}
.sheep-token[class*='size-'] {
  width: max(44px, calc(var(--sheep-width) + 8px));
  height: max(44px, calc(var(--sheep-width) * 0.642857 + 8px));
  min-height: 44px;
  gap: 0;
}
.sheep-token[class*='size-'] .sheep-svg {
  width: var(--sheep-width);
  height: calc(var(--sheep-width) * 0.642857);
}
.sheep-legend {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 0 0 24px;
  padding: 0 4px;
}
.legend-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-unit strong,
.legend-unit small {
  display: block;
}
.legend-unit strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.legend-unit small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
}
.legend-sheep {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 52px;
  height: 48px;
}
.legend-sheep .sheep-svg {
  width: calc(var(--sheep-width) * 0.4);
  height: auto;
}
.field-footer {
  align-items: flex-start;
}
.field-footer > span:first-child {
  line-height: 1.7;
  flex: 1;
}
.field-footer > span:last-child {
  white-space: nowrap;
}
.field-heading h2 {
  font-weight: 600;
}
@media (max-width: 700px) {
  .sheep-legend {
    justify-content: flex-start;
    gap: 12px 20px;
  }
  .legend-unit {
    min-width: 120px;
  }
}
