/* Farm office visuals: the living scene (farm-scene.js) and picture choices (farm-visuals.js).
   Loaded before theme.css. Uses the --fh-* tokens so it works in light and dark. */

/* ------------------------------------------------------------------ living scene */
.fs-scene {
  position: relative;
  margin: 0 0 16px;
  overflow: hidden;
  isolation: isolate;
  background: #2c3d2a;
  color: #fff;
}
.fs-scene[data-kind='hero'] {
  height: clamp(150px, 22vw, 250px);
  border-radius: 18px;
  /* A window onto the farm with a rolling hill line along the bottom. */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V88Q82 98 62 92T28 94T0 90Z'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V88Q82 98 62 92T28 94T0 90Z'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}
.fs-scene[data-kind='strip'] {
  height: 78px;
  margin-top: -2px;
  border-radius: 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.fs-media,
.fs-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fs-media img,
.fs-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: 50% 50%;
  will-change: transform;
}
.fs-sky {
  pointer-events: none;
}
.fs-cap {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 2px;
  padding: 40px 22px 22px;
  background: linear-gradient(180deg, transparent, #0b1a10b3 70%);
  text-shadow: 0 1px 3px #0009;
  font-size: 14px;
}
.fs-cap b {
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: 0.01em;
  line-height: 1.05;
}
.fs-cap em {
  font-style: normal;
  font-size: 13px;
  opacity: 0.92;
  max-width: 62ch;
}
.fs-scene[data-kind='strip'] .fs-cap {
  inset: 0;
  align-content: center;
  padding: 0 11%;
  background: linear-gradient(90deg, #0b1a10a6, #0b1a1033 60%, transparent);
  font-size: 15px;
  font-weight: 600;
}
.fs-scene[data-kind='strip'] .fs-cap small {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.9;
}
.fh-solo .fs-scene[data-kind='hero'] {
  margin-top: 10px;
}
@media (max-width: 700px) {
  .fs-scene[data-kind='strip'] {
    height: 60px;
  }
  .fs-scene[data-kind='strip'] .fs-cap {
    font-size: 13px;
  }
  .fs-cap {
    padding: 30px 16px 18px;
  }
}

/* ------------------------------------------------------------------ picture choices */
.pic-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}
.pic-field {
  display: grid;
  gap: 6px;
  position: relative;
}
.pic-label {
  font-weight: 700;
  font-size: 13px;
}
.pic-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.pic-field.compact .pic-pick {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.pic-card {
  display: grid;
  gap: 3px;
  align-content: start;
  text-align: left;
  padding: 6px 6px 9px;
  border: 1px solid var(--fh-line-strong);
  border-radius: 12px;
  background: var(--fh-surface);
  color: var(--fh-ink);
  font: inherit;
  cursor: pointer;
  position: relative;
}
.pic-card .fa-art {
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  border-radius: 8px;
  display: block;
  margin-bottom: 4px;
}
.pic-field.compact .pic-card .fa-art {
  aspect-ratio: 120 / 34;
}
.pic-card b {
  font-size: 14px;
  padding: 0 4px;
}
.pic-card small {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--fh-muted);
  padding: 0 4px;
}
.pic-card[aria-checked='true'] {
  border-color: var(--fh-accent-ink);
  box-shadow: 0 0 0 2px var(--fh-accent-soft);
}
.pic-card[aria-checked='true']::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  background: var(--fh-accent-ink);
  color: var(--fh-surface);
}
.pic-card:focus-visible {
  outline: 3px solid var(--fh-accent-ink);
  outline-offset: 2px;
}
.pic-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.pic-field.disabled .pic-card[aria-checked='false'] {
  opacity: 0.4;
}
html[data-motion='full'] .pic-card {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
html[data-motion='full'] .pic-card:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px #14291e24;
}
html[data-motion='full'] .pic-card[aria-checked='true'] .fa-art > g,
html[data-motion='full'] .level-option:has(input:checked) .fa-level > g {
  animation: fa-sway 3.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
@keyframes fa-sway {
  0%,
  100% {
    rotate: -1.5deg;
  }
  50% {
    rotate: 1.5deg;
  }
}

/* Level cards on the setup screen. */
.level-option .fa-level {
  width: 100%;
  aspect-ratio: 5 / 2;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* Machine cards in Equipment & land. */
.fh-machine .fa-machine {
  width: 100%;
  aspect-ratio: 12 / 5;
  height: auto;
  border-radius: 8px;
  display: block;
}
.fh-machine .fa-tier-old {
  filter: saturate(0.8);
}

/* The crop growing on each field tile. */
.fh-tile {
  position: relative;
  overflow: hidden;
}
.fh-tile .fa-stage {
  position: absolute;
  right: 4px;
  bottom: 22px;
  width: 84px;
  height: 55px;
  pointer-events: none;
  opacity: 0.95;
}
.fh-tile > span {
  position: relative;
}
html[data-motion='full'] .fh-tile .fa-stage > g {
  animation: fa-sway 4.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
html[data-motion='full'] .fh-tile .fa-stage > g:nth-of-type(2) {
  animation-delay: -1.3s;
}
html[data-motion='full'] .fh-tile .fa-stage > g:nth-of-type(3) {
  animation-delay: -2.6s;
}

/* ------------------------------------------------------------------ quick picks under number boxes */
.quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.quick-pick {
  display: grid;
  gap: 1px;
  text-align: left;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--fh-line-strong);
  border-radius: 10px;
  background: var(--fh-surface);
  color: var(--fh-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.quick-pick small {
  font-size: 11px;
  font-weight: 400;
  color: var(--fh-muted);
}
.quick-pick.active {
  border-color: var(--fh-accent-ink);
  box-shadow: 0 0 0 2px var(--fh-accent-soft);
}
.quick-pick:focus-visible {
  outline: 3px solid var(--fh-accent-ink);
  outline-offset: 2px;
}
.quick-pick:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------ "how this page works" steps */
.step-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 16px;
}
.step-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 420px;
}
.step-strip li {
  flex: 1 1 120px;
  display: flex;
}
.step-strip button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px 10px;
  min-height: 44px;
  border: 1px solid var(--fh-line-strong);
  border-radius: 12px;
  background: var(--fh-surface);
  color: var(--fh-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.step-strip button small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--fh-muted);
}
.step-n {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--fh-accent-soft);
  color: var(--fh-accent-ink);
  border: 1px solid var(--fh-accent-ink);
}
.step-strip li.done .step-n {
  background: var(--fh-good);
  border-color: var(--fh-good);
  color: #fff;
}
.step-strip button:hover {
  border-color: var(--fh-accent-ink);
}
.step-strip button:focus-visible,
.step-ask:focus-visible {
  outline: 3px solid var(--fh-accent-ink);
  outline-offset: 2px;
}
.step-ask {
  flex: 0 1 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 44px;
  border: 1px dashed var(--fh-accent-ink);
  border-radius: 12px;
  background: var(--fh-accent-soft);
  color: var(--fh-ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.step-ask-face {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--fh-accent-ink);
  color: var(--fh-surface);
}
.step-flash {
  animation: step-flash 1.4s ease-out;
  border-radius: 12px;
}
@keyframes step-flash {
  0%,
  30% {
    box-shadow: 0 0 0 4px var(--fh-accent-soft);
    background-color: var(--fh-accent-soft);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
html[data-motion='calm'] .step-flash,
html[data-motion='off'] .step-flash {
  animation: none;
  outline: 3px solid var(--fh-accent-ink);
}
@media (prefers-reduced-motion: reduce) {
  .step-flash {
    animation: none;
    outline: 3px solid var(--fh-accent-ink);
  }
}

/* ------------------------------------------------------------------ tank-mix product picker */
.kind-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--kind) 16%, transparent);
  color: var(--kind);
  vertical-align: middle;
}
.kind-badge svg {
  width: 18px;
  height: 18px;
}
.mix-row .kind-badge {
  margin-right: 2px;
}
.mix-pick {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--fh-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--fh-surface) 70%, transparent);
}
.mix-pick-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mix-pick-head input {
  flex: 0 1 240px;
  min-height: 40px;
}
.mix-kinds button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mix-kinds .kind-badge {
  width: 20px;
  height: 20px;
}
.mix-kinds .kind-badge svg {
  width: 14px;
  height: 14px;
}
.mix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  padding: 2px;
}
.mix-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-content: start;
  text-align: left;
  padding: 9px 10px;
  border: 1px solid var(--fh-line-strong);
  border-radius: 12px;
  background: var(--fh-surface);
  color: var(--fh-ink);
  font: inherit;
  cursor: pointer;
}
.mix-card[hidden] {
  display: none;
}
.mix-card .kind-badge {
  grid-row: span 2;
}
.mix-card b {
  font-size: 13.5px;
  line-height: 1.2;
}
.mix-card small {
  font-size: 11.5px;
  color: var(--fh-muted);
}
.mix-card-desc {
  grid-column: 1 / -1;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--fh-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mix-card-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
}
.mix-card-foot em {
  font-style: normal;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--fh-fair-bg);
  color: var(--fh-fair);
}
.mix-card-foot em.have {
  background: var(--fh-good-bg);
  color: var(--fh-good);
}
.mix-card-foot i {
  margin-left: auto;
  font-style: normal;
  font-weight: 800;
  color: var(--fh-accent-ink);
}
.mix-card.in-tank {
  border-color: var(--fh-good);
  background: var(--fh-good-bg);
}
.mix-card.in-tank .mix-card-foot i {
  color: var(--fh-good);
}
.mix-card:hover {
  border-color: var(--fh-accent-ink);
}
.mix-card:focus-visible {
  outline: 3px solid var(--fh-accent-ink);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ little pictures in tabs and pickers */
.field-picker button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.field-pick-art .fa-stage {
  width: 34px;
  height: 22px;
  display: block;
}
.seg-art .fa-art {
  width: 34px;
  height: 22px;
  border-radius: 5px;
  display: block;
}
.fh-seg button:has(.seg-art) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.setup-grid > .pic-field {
  grid-column: 1 / -1;
}
.cover-form,
#level-form {
  margin-top: 10px;
}

/* ------------------------------------------------------------------ stand counts and the planter shop */
.stand-card .stand-row {
  width: 100%;
  height: 56px;
  border-radius: 8px;
  display: block;
  margin: 4px 0 10px;
}
.stand-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
}
.stand-score > b {
  font-size: 28px;
  line-height: 1;
}
.stand-score > span:not(.stand-bar) {
  color: var(--fh-muted);
  font-size: 13px;
}
.stand-bar {
  flex: 1;
  min-width: 120px;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--fh-bad-bg), var(--fh-warn-bg) 45%, var(--fh-good-bg));
  position: relative;
  overflow: hidden;
  border: 1px solid var(--fh-line);
}
.stand-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--fh-good);
  border-radius: 5px;
  opacity: 0.75;
}
.stand-facts li b {
  min-width: 3.2em;
  display: inline-block;
}
.retrofit .retro-art {
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  border-radius: 8px;
  display: block;
  margin-bottom: 6px;
}
.retrofit.on {
  border-color: var(--fh-good);
}
.retro-effect {
  font-weight: 700;
  color: var(--fh-good);
  margin: 4px 0;
}

/* ------------------------------------------------------------------ next-season notes */
.note-form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.note-form .inline-search input {
  flex: 1;
  min-height: 44px;
}
.note-tags button i {
  font-style: normal;
}
.note-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 10px;
}
.note-ideas .chip {
  text-align: left;
  white-space: normal;
}
.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.note-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--fh-line);
  border-radius: 10px;
  background: var(--fh-surface);
}
.note-item .setup-check {
  flex: 1;
}
.note-item.done span {
  text-decoration: line-through;
  color: var(--fh-muted);
}
.note-tag {
  font-style: normal;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: var(--fh-fair-bg);
  color: var(--fh-fair);
  vertical-align: middle;
}
.note-planter {
  background: var(--fh-good-bg);
  color: var(--fh-good);
}
.note-soil {
  background: var(--fh-warn-bg);
  color: var(--fh-warn);
}
.note-spray {
  background: var(--fh-info-bg);
  color: var(--fh-info);
}
.note-storage {
  background: var(--fh-bad-bg);
  color: var(--fh-bad);
}
.note-done {
  margin-top: 10px;
}
.season-notes {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--fh-line);
}

/* Tank mix tools: each field keeps its own mix */
.mix-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 10px;
}
.mix-tools small {
  flex-basis: 100%;
  color: var(--fh-muted, inherit);
}
.mix-tools .mix-copy {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mix-row .icon-btn.mix-del {
  width: auto;
  padding: 0 10px;
  white-space: nowrap;
  font-weight: 700;
}
