﻿/* ============================================================================
   Farm ðŸŒ¾ â€” styles for 18-farm.js (view: #farmView, prefix: farm-)
   ----------------------------------------------------------------------------
   Uses the chalkboard design tokens from styles.css (--ink/--chalk/--yellow/
   --coral/--sky/--wood). Cards echo the .stat "chalk chip" look: translucent
   chalk fill + thin chalk border. Buttons reuse the global .btn classes; the
   .farm-mini sizing needs !important because styles.css globally enlarges .btn
   with !important rules of its own.
   ============================================================================ */

.farm-wrap{
  text-align: left;
}

/* ---- Top bar: back button / title / market toggle ---- */
.farm-topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.farm-title{
  font-family: 'Patrick Hand', cursive;
  font-size: clamp(26px, 6vw, 38px);
  margin: 0;
  color: var(--chalk);
  text-shadow: 0 0 12px rgba(244,241,232,0.15);
  flex: 1;
  text-align: center;
}
.farm-back-btn{ flex-shrink: 0; }
.farm-market-btn{ flex-shrink: 0; }

/* ---- Header strip: cash / feed / fertilizer / plots / capacity ---- */
.farm-strip{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 14px;
}
.farm-chip{
  background: rgba(244,241,232,0.06);
  border: 1px solid rgba(244,241,232,0.15);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--chalk);
  white-space: nowrap;
}
.farm-chip-cash{
  border-color: rgba(242,193,78,0.55);
  color: var(--yellow);
}

/* ---- Section headings ---- */
.farm-h{
  font-family: 'Patrick Hand', cursive;
  font-size: 24px;
  color: var(--yellow);
  margin: 18px 0 8px;
  border-bottom: 1px dashed rgba(244,241,232,0.2);
  padding-bottom: 4px;
}
.farm-h-sub{
  font-family: 'Quicksand', sans-serif;
  font-size:15px;
  color: var(--chalk-dim);
  font-weight: 700;
  margin-left: 8px;
}

/* ---- Card grid (plots, stalls, market wares) ---- */
.farm-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.farm-card{
  background: rgba(244,241,232,0.06);
  border: 1px solid rgba(244,241,232,0.14);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.farm-card-icon{
  font-size: 38px;
  line-height: 1.1;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.35));
}
.farm-card-name{
  font-family: 'Patrick Hand', cursive;
  font-size: 19px;
  color: var(--chalk);
}
.farm-card-sub{
  font-size:14px;
  font-weight: 600;
  color: var(--chalk-dim);
  min-height: 2.2em;
}
.farm-status{
  font-size:15px;
  font-weight: 700;
  color: var(--sky);
}
.farm-status-ready{ color: var(--yellow); }
.farm-status-hungry{ color: var(--coral); }
.farm-fert-tag{
  font-size:14px;
  font-weight: 700;
  color: var(--chalk-dim);
  border: 1px dashed rgba(244,241,232,0.25);
  border-radius: 999px;
  padding: 2px 10px;
}
.farm-why{
  font-size:14px;
  font-weight: 700;
  color: var(--coral);
}

/* Empty plot / stall: dashed "chalk outline" look */
.farm-empty{
  border-style: dashed;
  border-color: rgba(244,241,232,0.22);
  background: rgba(244,241,232,0.03);
}
.farm-empty .farm-card-icon{ opacity: 0.6; }
.farm-empty .farm-card-name{ color: var(--chalk-dim); }

/* Ready to harvest / sell: warm glow + gentle bob */
.farm-ready{
  border-color: rgba(242,193,78,0.65);
  box-shadow: 0 0 14px rgba(242,193,78,0.18), inset 0 0 10px rgba(242,193,78,0.06);
}
.farm-ready .farm-card-icon{
  animation: farm-bob 1.6s ease-in-out infinite;
}
@keyframes farm-bob{
  0%, 100%{ transform: translateY(0); }
  50%     { transform: translateY(-5px); }
}
.farm-hungry{
  border-color: rgba(240,112,94,0.5);
}

/* Market card that can't be bought right now */
.farm-cant .farm-card-icon,
.farm-cant .farm-card-name,
.farm-cant .farm-card-sub{ opacity: 0.55; }

/* ---- Solves-progress bar ---- */
.farm-bar{
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(244,241,232,0.1);
  border: 1px solid rgba(244,241,232,0.15);
  overflow: hidden;
}
.farm-bar-fill{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky), var(--yellow));
  transition: width 0.4s ease;
}

/* ---- Buttons inside cards: compact but still chunky-tappable ----
   (!important needed: styles.css force-sizes .btn globally with !important) */
.farm-card .farm-mini{
  width: 100%;
  font-size: 14px !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
  border-radius: 10px;
}
.farm-card .btn[disabled]{
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ---- Onboarding banner + footer note ---- */
.farm-onboard{
  background: rgba(110,193,228,0.1);
  border: 1px solid rgba(110,193,228,0.4);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--chalk);
  margin-bottom: 6px;
}
.farm-onboard strong{ color: var(--yellow); }
.farm-note{
  text-align: center;
  font-size:15px;
  font-weight: 600;
  color: var(--chalk-dim);
  margin: 14px 0 2px;
}

/* ---- Narrow screens ---- */
@media (max-width: 640px){
  .farm-topbar{ justify-content: center; }
  .farm-title{ flex-basis: 100%; order: -1; }
  .farm-grid{ grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
  .farm-card-icon{ font-size: 32px; }
  .farm-card-name{ font-size: 17px; }
  .farm-chip{ font-size:14px; padding: 4px 9px; }
  .farm-h{ font-size: 21px; }
}

/* ---- Reduced motion: no bobbing, no bar animation ---- */
@media (prefers-reduced-motion: reduce){
  .farm-ready .farm-card-icon{ animation: none; }
  .farm-bar-fill{ transition: none; }
}
