/* ==========================================================================
   УСАДЬБА И СЫРЬЕВАЯ ФЕРМА (FARM & ORCHARD UI)
   Тактильный свайп сбора, грядки, вечный сад, индикатор амбара и Wheating-дроп
   ========================================================================== */

.farm-container {
  padding: 12px 14px 90px;
  max-width: 520px;
  margin: 0 auto;
}

#scr-farm:has(#seedDockModal.on) .farm-container {
  padding-bottom: 250px;
}

/* --- САРАЙ СЫРЬЯ (SILO HUD) --- */
.silo-card {
  background: linear-gradient(180deg, #fff7e4 0%, #faebd0 100%);
  border: 2px solid #c8a261;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 4px 0 #8b6530, 0 6px 14px rgba(0,0,0,0.15);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.silo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.silo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--wood-dark);
}

.silo-count {
  font-weight: 800;
  font-size: 15px;
  padding: 3px 10px;
  background: #f0dec0;
  border-radius: 12px;
  border: 1px solid #d4be94;
  color: #4a2e18;
}

.silo-count.full {
  background: #ffdeda;
  color: #a5281b;
  border-color: #e59085;
  animation: pulse-warn 1.2s infinite;
}

.silo-bar-track {
  width: 100%;
  height: 10px;
  background: #e3cca6;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.25);
}

.silo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #429352, #76c043);
  border-radius: 5px;
  transition: width 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.silo-bar-fill.warn {
  background: linear-gradient(90deg, #e5a420, #e05e1b);
}

.silo-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.silo-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: #fcf4e4;
  border: 1.5px solid #cbb58a;
  color: #5a381e;
  box-shadow: 0 2px 0 #9f7d4b;
  transition: transform 0.1s ease, background 0.1s ease;
}

.silo-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #9f7d4b;
}

/* --- СЕКЦИИ И ЗАГОЛОВКИ --- */
.farm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 2px 8px;
}

.farm-section-head h3 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 800;
  color: #f7ebd4;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.farm-swipe-tip {
  font-size: 13px;
  font-weight: 800;
  color: #fff1d0;
  background: rgba(46, 26, 12, 0.6);
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid #784c26;
}

/* --- СЕТКА ГРЯДОК (PLOTS GRID) --- */
.plots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  user-select: none;
  touch-action: pan-y;
}

.farm-plot {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: linear-gradient(180deg, #f3e2c0 0%, #e2c48f 100%);
  border: 2px solid #a67c45;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 3px 0 #6d4a22;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  color: #3b2412;
}

.farm-plot:active {
  transform: scale(0.96);
}

.farm-plot.empty {
  border-style: dashed;
  border-color: #8d6840;
  background: repeating-linear-gradient(90deg, #ecd7ad 0 12px, #e4cc9c 12px 14px);
}

.farm-container.is-sowing .farm-plot.empty {
  border-style: solid;
  border-color: #2f7d32;
  box-shadow: inset 0 0 0 2px #8fd18a, 0 3px 0 #6d4a22;
}

.plot-plus {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #6a4a28;
}

.plot-hint {
  font-size: 13px;
  font-weight: 800;
  color: #5c4630;
}

.farm-plot.growing {
  border-color: #3d7a32;
  background: linear-gradient(180deg, #e7f3d4 0%, #cfe6a8 100%);
}

.farm-plot.growing .plot-crop,
.farm-plot.ripe .plot-crop {
  font-size: 32px;
  line-height: 1;
}

.farm-plot.growing .plot-timer {
  background: #fffdf8;
  color: #3b2412;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid #8d6840;
}

.farm-plot.ripe {
  border-color: #d7a21a;
  background: linear-gradient(180deg, #fff6d2 0%, #f3d98a 100%);
  box-shadow: 0 0 0 2px rgba(215, 162, 26, 0.45), 0 3px 0 #6d4a22;
  animation: ripe-glow 2s infinite alternate;
}

.farm-plot.ripe .plot-crop {
  font-size: 32px;
  animation: crop-sway 2.4s ease-in-out infinite;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}

.farm-plot.ripe .plot-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #2f7d32;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 8px;
}

/* --- ВЕЧНЫЙ ФРУКТОВЫЙ САД (ORCHARD CARDS) --- */
.orchard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.orchard-card {
  background: linear-gradient(180deg, #fef5e0 0%, #f6e4bf 100%);
  border: 2px solid #c29d5b;
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 3px 0 #7e5a26, 0 5px 10px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.orchard-card:active {
  transform: scale(0.97);
}

.orchard-card.ripe {
  border-color: #f5b938;
  box-shadow: 0 0 12px rgba(245, 185, 56, 0.4), 0 3px 0 #7e5a26;
}

.orchard-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orchard-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.orchard-info {
  display: flex;
  flex-direction: column;
}

.orchard-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 13px;
  color: #3f2511;
  line-height: 1.2;
}

.orchard-status {
  font-size: 11px;
  font-weight: 700;
  color: #795738;
}

.orchard-status.ready {
  color: #278834;
  font-weight: 800;
}

.orchard-action {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  background: #508c3a;
  color: #fff;
  border: 1px solid #376326;
  box-shadow: 0 2px 0 #2b4f1e;
}

.orchard-action.wait {
  background: #e2ccaa;
  color: #694b2f;
  border-color: #bda37d;
  box-shadow: 0 2px 0 #927857;
}

/* --- ПЛАВАЮЩИЙ СЕРП / ТАКТИЛЬНЫЙ КУРСОР --- */
.floating-sickle-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 34px;
  transform: translate(-50%, -50%) rotate(-15deg);
  transition: transform 0.05s ease-out;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
  animation: sickle-slice 0.25s infinite alternate ease-in-out;
}

/* --- ВСПЛЫВАЮЩИЙ ТЕКСТ СБОРА (PARTICLES) --- */
.harvest-float {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 18px;
  color: #ffd74a;
  text-shadow: 0 2px 4px #000, 0 0 8px rgba(255, 215, 74, 0.7);
  animation: float-and-fade 0.85s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

/* --- WHEATING DROP TOAST --- */
.wheating-toast {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: linear-gradient(180deg, #ffd764 0%, #f09c24 100%);
  color: #3b1e05;
  border: 2px solid #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 15px rgba(255, 215, 100, 0.8);
  border-radius: 16px;
  padding: 10px 18px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 14px;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.wheating-toast.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* --- ПАЛИТРА ВЫБОРА СЕМЯН (SEED DOCK) --- */
.seed-dock-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: none;
  justify-content: center;
  padding: 0 10px 8px;
  background: none;
  pointer-events: none;
}

.seed-dock-modal.on {
  display: flex;
}

.seed-dock {
  background: linear-gradient(180deg, #fff7e4 0%, #f4e2bf 100%);
  border: 2px solid #b58d4a;
  border-radius: 22px;
  padding: 14px 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  pointer-events: auto;
}

.seed-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.seed-dock-head h4 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 800;
  color: #42250d;
}

.seed-items {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.seed-dock-note {
  margin: 6px 0 0;
  color: #5c4630;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.seed-card {
  flex: 0 0 96px;
  background: #fbf1da;
  border: 1.5px solid #d4b886;
  border-radius: 14px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 3px 0 #a47e45;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.seed-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #a47e45;
}

.seed-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.seed-card-ico {
  font-size: 26px;
}

.seed-card-name {
  font-size: 13px;
  font-weight: 800;
  color: #3b2412;
  margin-top: 4px;
  text-align: center;
  line-height: 1.2;
}

.seed-card-time {
  font-size: 12px;
  color: #5c4630;
  font-weight: 800;
  text-align: center;
}

.seed-card.selected {
  border-color: #2f7d32;
  box-shadow: 0 3px 0 #1f5c28;
  background: #f3ffe8;
}

.station-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
}

.station-recipe {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #c4a574;
  background: #fffdf8;
  color: #24170f;
  text-align: left;
  font: 800 15px/1.3 var(--f-display);
}

.station-recipe span {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: #5c4630;
}

.station-recipe.is-locked,
.station-recipe:disabled {
  background: #f6edd8;
  color: #6b5340;
}

.seed-plant-all-btn:disabled {
  opacity: 0.45;
}

/* --- АНИМАЦИИ --- */
@keyframes crop-sway {
  0% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.04); }
  100% { transform: rotate(-3deg) scale(1); }
}

@keyframes ripe-glow {
  0% { box-shadow: 0 0 8px rgba(255, 210, 77, 0.3), inset 0 3px 6px rgba(0,0,0,0.3), 0 4px 0 #1e0e05; }
  100% { box-shadow: 0 0 18px rgba(255, 210, 77, 0.7), inset 0 3px 6px rgba(0,0,0,0.3), 0 4px 0 #1e0e05; }
}

@keyframes sprout-breath {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(0.95); }
}

@keyframes sickle-slice {
  0% { transform: translate(-50%, -50%) rotate(-25deg); }
  100% { transform: translate(-50%, -50%) rotate(15deg); }
}

@keyframes float-and-fade {
  0% {
    transform: translate(-50%, 0) scale(0.7);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -15px) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -60px) scale(0.9);
    opacity: 0;
  }
}

@keyframes pulse-warn {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* --- МОДАЛЬНЫЕ ОКНА ФЕРМЫ (FARM BOTTOM SHEETS) --- */
.farm-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 10, 4, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9995;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.farm-modal.on {
  opacity: 1;
  pointer-events: auto;
}

.farm-modal-sheet {
  background: linear-gradient(180deg, #fff9ed 0%, #f7e6ca 100%);
  border: 2px solid #b58d4a;
  border-radius: 24px;
  padding: 16px 18px 20px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.45);
  transform: translateY(40px);
  transition: transform 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.farm-modal.on .farm-modal-sheet {
  transform: translateY(0);
}

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

.farm-modal-head h4 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 800;
  color: #42250d;
}

.farm-modal-desc {
  font-size: 12px;
  color: #6a4a2f;
  margin: 0 0 12px;
  line-height: 1.4;
}

.farm-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 4px;
}

/* Строка покупки саженца */
.tree-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fbf1dc;
  border: 1.5px solid #d8bf8d;
  border-radius: 14px;
  padding: 8px 12px;
  gap: 10px;
}

.tree-buy-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tree-buy-ico {
  font-size: 28px;
  flex-shrink: 0;
}

.tree-buy-info {
  display: flex;
  flex-direction: column;
}

.tree-buy-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 14px;
  color: #42250d;
}

.tree-buy-sub {
  font-size: 11px;
  color: #7b593a;
  font-weight: 600;
}

.tree-buy-btn {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(180deg, #59b342 0%, #3e882b 100%);
  color: #fff;
  border: 1.5px solid #2d6b1d;
  box-shadow: 0 2px 0 #204e14;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.tree-buy-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #204e14;
}

.tree-buy-btn:disabled {
  background: #c9b99e;
  border-color: #a89578;
  color: #6d5b45;
  box-shadow: none;
  cursor: not-allowed;
}

/* Строка запасов сарая */
.silo-stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fbf1dc;
  border: 1.5px solid #d8bf8d;
  border-radius: 14px;
  padding: 8px 12px;
  gap: 8px;
}

.silo-sell-btn {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #faebcd;
  border: 1.5px solid #caa86c;
  color: #553313;
  box-shadow: 0 2px 0 #9f7d4b;
  cursor: pointer;
}

.silo-sell-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #9f7d4b;
}

.seed-dock-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.seed-plant-all-btn {
  flex: 1;
  padding: 8px 12px;
  background: linear-gradient(180deg, #4aa638 0%, #348024 100%);
  color: #fff;
  border: 1.5px solid #256616;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 0 #1b490f;
  cursor: pointer;
}

.seed-plant-all-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1b490f;
}

.seed-card.selected {
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px #4caf50, 0 3px 0 #2e7d32;
  background: #e8f5e9;
}

/* заголовок секции не сжимается рядом с подсказкой и кнопкой: если не влезают — уходят на следующую строку */
.farm-section-head{flex-wrap:wrap!important;gap:6px 10px}
.farm-section-head h3{white-space:nowrap;flex:0 0 auto}
.farm-section-head .farm-swipe-tip,.farm-section-head .btn{flex:0 0 auto;margin-left:auto}
