/* Cosy farm HUD — Hay Day-like soft pills */

#game.farm-mode .hud-stats {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  color: #1b3a28;
}

.hud-prestige {
  display: none;
  align-items: center;
  gap: 0.12rem;
  margin-left: 0.1rem;
  padding: 0.02rem 0.38rem 0.02rem 0.28rem;
  border-radius: 999px;
  border: none;
  background: #fff3d6;
  color: #8d4e00;
  font: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}
.hud-prestige-mark {
  font-size: 0.68rem;
  font-weight: 900;
  opacity: 0.85;
}

#game.farm-mode .hud-prestige:not(.hidden) {
  display: inline-flex;
}
#game.farm-mode .hud-prestige {
  background: #fff3d6;
  color: #8d4e00;
  box-shadow: inset 0 0 0 1px rgba(180, 110, 20, 0.18);
}
#game.farm-mode .hud-prestige:active {
  transform: scale(0.96);
}

#game.farm-mode .stat-energy {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #fff8e7;
  border-radius: 999px;
  padding: 0.15rem 0.4rem 0.15rem 0.35rem;
  font-weight: 800;
  color: #1b3a28;
}
#game.farm-mode .energy-bolt {
  color: #f9a825;
  font-size: 0.95rem;
}
#game.farm-mode .energy-plus {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #66bb6a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  margin-left: 0.1rem;
}

#game.farm-mode .hud-stats .label,
#game.farm-mode .hud-stats .xp-label-hud,
#game.farm-mode .stat-xp-top {
  color: #1b3a28;
}

#game.farm-mode .xp-bar-hud {
  background: rgba(0, 0, 0, 0.08) !important;
  height: 6px !important;
  border-radius: 999px;
  overflow: hidden;
}
#game.farm-mode .xp-fill {
  background: linear-gradient(90deg, #66bb6a, #43a047) !important;
}

#game.farm-mode .hud-stats .stat-cur {
  background: #fff8e7;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-weight: 800;
  min-width: 3.2rem;
  justify-content: center;
}

#game.farm-mode .hud-top-actions {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  gap: 0.35rem;
  padding: 0;
}

#game.farm-mode .hud-top-actions .btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  color: #2e7d32 !important;
}

#game.farm-mode .hud-left-dock {
  width: auto;
  max-width: none;
  left: auto;
  right: var(--hud-pad);
  bottom: calc(var(--hud-pad) + var(--safe-b, 0px));
  align-items: flex-end;
  gap: 0.35rem;
}

#game.farm-mode #chat,
#chat {
  display: none !important;
}

#game.farm-mode .chum-controls,
#game.farm-mode #cast-meter,
#game.farm-mode #struggle-hud,
#game.farm-mode #prompt,
#game.farm-mode #struggle-fx,
#game.farm-mode .hud-side {
  display: none !important;
}

#game.farm-mode .hud-ping {
  display: none !important;
}

.farm-dock {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
  padding: 0.4rem;
  max-width: min(280px, 72vw);
  pointer-events: auto;
  position: relative;
  background: rgba(255, 255, 255, 0.92) !important;
  border: none !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.farm-dock-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  width: 100%;
  justify-content: flex-end;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: 0.1rem;
}
.farm-dock-more.hidden { display: none; }

.farm-dock-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #7ed957, #4caf50);
  box-shadow: 0 3px 0 #2e7d32;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease;
  position: relative;
}
.farm-dock-btn .mail-badge {
  top: -4px;
  right: -4px;
  min-width: 1rem;
  height: 1rem;
  font-size: 0.62rem;
}
.mail-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.35rem 0 0.65rem;
  flex-wrap: wrap;
}
.mail-row.unread {
  font-weight: 700;
}
.mail-row-main {
  flex: 1;
}
.mail-row-meta {
  font-size: 0.75rem;
  white-space: nowrap;
}
.farm-dock-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2e7d32;
}
.farm-dock-btn-wide {
  width: auto;
  min-width: 40px;
  padding: 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.guestbook-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(60vh, 420px);
  overflow: auto;
}
.guestbook-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
}
.guestbook-row.unread {
  background: rgba(129, 199, 132, 0.28);
}
.village-marker.online .village-marker-pin {
  box-shadow: 0 0 0 3px #81c784, 0 4px 10px rgba(0, 0, 0, 0.25);
}
.village-marker.online .village-marker-label {
  color: #2e7d32;
  font-weight: 700;
}
.village-card.online {
  box-shadow: inset 0 0 0 2px rgba(76, 175, 80, 0.45);
}
.village-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  align-items: stretch;
}
.farm-dock-ico {
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}
.farm-dock-ico .ico svg {
  width: 1.28rem;
  height: 1.28rem;
}

.farm-hint {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  max-width: min(340px, 92vw);
  text-align: right;
  color: #1b3a28 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: none !important;
  backdrop-filter: none !important;
}
.farm-hint #farm-hint-text {
  pointer-events: none;
}
.farm-care-ping {
  pointer-events: auto;
  flex-shrink: 0;
  font-size: 0.72rem !important;
  padding: 0.22rem 0.5rem !important;
  border-radius: 999px !important;
}
.farm-care-ping.hidden {
  display: none !important;
}

#game.farm-mode .hud-ping {
  display: none !important;
}

#btn-farm-skip.armed {
  outline: 2px solid #ffc107;
  background: #fff3c4 !important;
}

.plant-picker {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 40, 20, 0.35);
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
.plant-picker.hidden { display: none; }
.plant-picker-card {
  width: min(420px, 100%);
  max-height: min(52vh, 420px);
  overflow: auto;
  border-radius: 22px;
  padding: 0.9rem;
  background: #fff8e7 !important;
  border: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  color: #1b3a28;
}
.plant-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.plant-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.plant-pick {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 14px;
  border: none;
  background: #e8f5e9;
  color: #1b3a28;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 0 rgba(46, 125, 50, 0.25);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.plant-pick:hover {
  background: #c8e6c9;
  box-shadow: 0 3px 0 rgba(46, 125, 50, 0.3);
}
.plant-pick:active { transform: scale(0.98); }
.plant-pick-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}
.plant-pick-meta {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}
.plant-pick-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plant-pick-sub {
  font-size: 0.72rem;
  font-weight: 600;
}
.plant-pick-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: #fff3e0;
  color: #ef6c00;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.plant-pick-badge.plant-pick-locked {
  background: #eceff1;
  color: #546e7a;
}
.plant-pick.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.plant-pick-qty { opacity: 0.65; }
.plant-picker-empty {
  text-align: center;
  padding: 0.85rem 0.5rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.plant-picker-empty.hidden { display: none; }
.plant-picker-shop {
  margin-top: 0.25rem;
  min-width: 12rem;
  justify-content: center;
}

.plot-unlock-card {
  max-height: none;
  overflow: visible;
}
.plot-unlock-cost {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1b3a28;
}
.plot-unlock-have {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
}
.plot-unlock-buy {
  width: 100%;
  justify-content: center;
}
.plot-unlock-buy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.plot-unlock-short {
  color: #c62828;
  font-weight: 700;
}

/* —— Farm inventory / shop (cream cosy) —— */
.modal-card.farm-inv-card,
.modal-card.farm-shop-card {
  background: #fff8e7 !important;
  color: #1b3a28 !important;
  border: none !important;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22) !important;
  max-width: min(760px, 96vw);
  max-height: min(86vh, 720px);
}
.farm-inv-card .modal-head h2,
.farm-shop-card .modal-head h2,
.farm-inv-card .inv-slots,
.farm-shop-card .cur-pill {
  color: #1b3a28 !important;
}
.farm-inv-card .btn-ghost,
.farm-shop-card .btn-ghost {
  color: #1b3a28 !important;
  border-color: rgba(27, 58, 40, 0.22) !important;
}
.farm-inv-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.15rem 0.55rem;
  flex-wrap: wrap;
}
.farm-inv-tabs .chip {
  background: #e8f5e9;
  color: #1b3a28;
  border: none;
  font-weight: 700;
}
.farm-inv-tabs .chip.active {
  background: #81c784;
  color: #0d2818;
}
.farm-inv-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.45rem;
}
.farm-inv-toolbar.hidden { display: none !important; }
#inventory-modal.inv-barn-mode .farm-inv-body { display: none !important; }
#inventory-modal.inv-barn-mode .barn-panel {
  display: block;
  min-height: 240px;
  max-height: min(58vh, 480px);
  overflow: auto;
  padding: 0.15rem 0.1rem 0.5rem;
}
.farm-inv-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(200px, 0.85fr);
  gap: 0.75rem;
  min-height: 280px;
}
.farm-inv-card .inv-grid {
  background: rgba(46, 125, 50, 0.06);
  border-radius: 16px;
  padding: 0.45rem;
}
.farm-inv-card .inv-slot {
  background: #fff;
  border: 1px solid rgba(27, 58, 40, 0.12);
}
.farm-inv-card .inv-slot-empty {
  background: rgba(255, 255, 255, 0.35);
  border-style: dashed;
}
.farm-inv-card .inv-detail {
  background: #e8f5e9 !important;
  border: none !important;
  border-radius: 16px;
  color: #1b3a28;
}
.farm-inv-card .muted,
.farm-shop-card .muted { color: rgba(27, 58, 40, 0.58) !important; }

.farm-empty {
  text-align: center;
  padding: 1.6rem 1rem;
  color: #1b3a28;
}
.farm-empty strong { display: block; margin-bottom: 0.35rem; font-size: 1.05rem; }
.farm-empty p { margin: 0; }

.farm-sec-title {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #1b3a28;
}
.farm-tile-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.farm-tile {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: #e8f5e9;
}
.farm-tile-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.farm-tile-swatch.lg { width: 36px; height: 36px; }
.farm-tile-swatch.junk { background: #8d6e63; }
.farm-tile-swatch.cons { background: #7e57c2; }
.farm-tile-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.farm-tile-qty { font-weight: 800; font-size: 1.05rem; }
.farm-tile-actions { display: flex; align-items: center; gap: 0.4rem; }

.farm-shop-root {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  flex: 1;
}
#shop-modal.farm-shop-mode .tackle-layout { display: none !important; }
#shop-modal.farm-shop-mode .farm-shop-root { display: flex; }
#shop-modal.farm-shop-mode .modal-card {
  display: flex;
  flex-direction: column;
}
.farm-shop-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.farm-shop-tabs .chip {
  background: #e8f5e9;
  color: #1b3a28;
  border: none;
  font-weight: 700;
}
.farm-shop-tabs .chip.active {
  background: #81c784;
  color: #0d2818;
}
.fshop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 0.75rem;
  min-height: 320px;
  max-height: min(58vh, 520px);
}
.fshop-main {
  overflow: auto;
  border-radius: 16px;
  background: rgba(46, 125, 50, 0.06);
  padding: 0.35rem;
}
.fshop-side {
  background: #e8f5e9;
  border-radius: 16px;
  padding: 0.85rem;
  overflow: auto;
}
.fshop-list { display: flex; flex-direction: column; gap: 0.3rem; }
.fshop-row {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #1b3a28;
  cursor: pointer;
  font: inherit;
}
.fshop-row.static { cursor: default; }
.fshop-row.selected {
  outline: 2px solid #43a047;
  background: #c8e6c9;
}
.fshop-row.locked { opacity: 0.5; cursor: not-allowed; }
.fshop-row-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fshop-price, .fshop-lock { font-size: 0.85rem; font-weight: 700; }
.fshop-detail { display: flex; flex-direction: column; gap: 0.75rem; color: #1b3a28; }
.fshop-detail-head { display: flex; gap: 0.65rem; align-items: center; }
.fshop-qty {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: center;
}
.fshop-qty strong { min-width: 2rem; text-align: center; font-size: 1.2rem; }
.fshop-buy { width: 100%; justify-content: center; }
.fshop-quick { display: flex; gap: 0.35rem; }
.fshop-quick .btn { flex: 1; justify-content: center; }

@media (max-width: 720px) {
  .farm-inv-body,
  .fshop-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .fshop-side { min-height: 160px; }
}

@media (max-width: 640px) {
  #game.farm-mode .hud-left-dock {
    right: 0.4rem;
    left: calc(0.4rem + 124px);
    align-items: stretch;
  }
  .farm-dock {
    max-width: none;
    justify-content: center;
  }
  .farm-hint {
    text-align: center;
    max-width: none;
  }
}

/* —— Village map —— */
.map-screen.village-screen {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(120, 190, 90, 0.35), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(70, 140, 70, 0.4), transparent 50%),
    linear-gradient(180deg, #7cb342 0%, #558b2f 45%, #33691e 100%) !important;
  gap: 0.5rem;
}

.village-header {
  color: #1b3a28;
  background: rgba(255, 252, 240, 0.92) !important;
  border-radius: 16px;
  padding: 0.45rem 0.75rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.village-header h2 {
  flex: 1;
  color: #1b3a28;
  font-size: 1.15rem !important;
}

.village-header .map-hint {
  font-weight: 700;
  color: #33691e;
  font-size: 0.85rem;
}

.village-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 320px);
  gap: 0.65rem;
}

.village-stage {
  position: relative;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid rgba(255, 252, 240, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.village-meadow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 200, 0.25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(40, 100, 40, 0.2), transparent 45%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.04) 18px,
      rgba(255, 255, 255, 0.04) 20px
    ),
    linear-gradient(160deg, #8bc34a, #689f38 40%, #558b2f);
}

.village-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  z-index: 2;
  transition: transform 0.15s ease;
}

.village-marker:hover,
.village-marker:focus-visible {
  transform: translate(-50%, -100%) scale(1.08);
  outline: none;
  z-index: 3;
}

.village-marker-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 8%;
  transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.village-marker.kind-home .village-marker-pin {
  background: linear-gradient(135deg, #ffb74d, #ef6c00);
}
.village-marker.kind-npc .village-marker-pin {
  background: linear-gradient(135deg, #81d4fa, #0288d1);
}
.village-marker.kind-friend .village-marker-pin {
  background: linear-gradient(135deg, #ce93d8, #8e24aa);
}
.village-marker.kind-forage .village-marker-pin {
  background: linear-gradient(135deg, #dce775, #9e9d24);
  width: 26px;
  height: 26px;
}
.village-marker.kind-land-claimed .village-marker-pin {
  background: linear-gradient(135deg, #a5d6a7, #43a047);
}
.village-marker.kind-land-active .village-marker-pin {
  background: linear-gradient(135deg, #81c784, #2e7d32);
  box-shadow: 0 0 0 3px rgba(255, 255, 200, 0.85), 0 4px 10px rgba(0, 0, 0, 0.25);
}
.village-marker.kind-land-fog .village-marker-pin,
.village-marker.fog .village-marker-pin {
  background: linear-gradient(135deg, #bdbdbd, #616161);
  opacity: 0.65;
}
.village-marker.kind-land-fog .village-marker-label,
.village-card.fog {
  opacity: 0.55;
  filter: grayscale(0.35);
}
.atlas-deed {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}
.land-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.land-switcher-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.land-switcher-cur {
  flex: 1;
  text-align: center;
}
.land-switch-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 180px;
  overflow: auto;
}
.land-switch-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(40, 80, 40, 0.15);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}
.land-switch-item.active {
  border-color: #4caf50;
  background: rgba(200, 240, 180, 0.7);
}
.land-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2e7d32;
}
.village-marker.kind-khutor .village-marker-pin {
  background: linear-gradient(135deg, #ffcc80, #ef6c00);
  box-shadow: 0 0 0 3px rgba(239, 108, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.25);
}
.village-marker.kind-khutor.self .village-marker-pin {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7), 0 4px 10px rgba(0, 0, 0, 0.25);
}
.village-marker.kind-khutor .village-marker-label {
  background: rgba(255, 236, 179, 0.96);
}

.village-khutor {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.village-khutor-progress {
  height: 12px;
  border-radius: 999px;
  background: #e8f5e9;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}
.village-khutor-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f9a825, #ef6c00);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.village-khutor-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}
.village-khutor-form input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 10px;
  border: 2px solid #c5e1a5;
  padding: 0.4rem 0.55rem;
  background: #fff;
  color: #1b3a28;
}
.village-khutor-code {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #fff3e0;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
}

.village-marker-label {
  transform: rotate(0);
  margin-top: 0.15rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 252, 240, 0.94);
  color: #1b3a28;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.village-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.65rem !important;
  background: rgba(255, 252, 240, 0.94) !important;
  border: none !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  color: #1b3a28;
}

.village-side-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.village-side-tabs .chip {
  background: #e8f5e9;
  color: #2e7d32;
  border: none;
  font-weight: 700;
}
.village-side-tabs .chip.active {
  background: #b6e07a;
  color: #1b3a28;
}

.village-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.village-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.village-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: none;
  background: #f3f8e8;
  color: #1b3a28;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.village-card.row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: default;
}
.village-card:not(.row):hover {
  background: #e7f3c8;
}

.village-friends-head {
  margin-bottom: 0.65rem;
}
.village-friends-head code {
  font-size: 0.85rem;
  background: #e8f5e9;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.village-add-friend {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  width: 100%;
}
.village-add-friend input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border-radius: 10px;
  border: 2px solid #c5e1a5;
  padding: 0.4rem 0.55rem;
  background: #fff;
  color: #1b3a28;
}
.village-add-friend .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.village-feed {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.farm-emotes {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 252, 240, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.farm-emotes.hidden { display: none !important; }
.farm-emotes button {
  border: none;
  background: transparent;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 8px;
}
.farm-emotes button:hover { background: rgba(0,0,0,0.06); }
.farm-emotes button:active { transform: scale(0.92); }

.visit-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.45rem 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.96);
  color: #5d4037;
  font-weight: 800;
  font-size: 0.78rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-width: min(52vw, 280px);
}
.visit-banner-budget {
  font-weight: 700;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
}
#game.farm-mode .visit-banner .btn {
  width: auto;
  height: 28px;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

@media (max-width: 820px) {
  .village-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 1fr) minmax(200px, 42%);
  }
  .village-marker-label {
    max-width: 5.5rem;
    font-size: 0.65rem;
  }
}

/* �� Tech tree PoE stage �� */
.tech-modal-card {
  width: min(960px, 96vw) !important;
  max-width: 96vw !important;
}
.tech-rp-bar {
  margin-bottom: 0.35rem;
  font-weight: 800;
  color: #1b3a28;
}
.tech-stage {
  position: relative;
  min-height: 60vh;
  height: min(70vh, 640px);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(129, 199, 132, 0.25), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(79, 195, 247, 0.18), transparent 50%),
    linear-gradient(160deg, #e8f5e9 0%, #f1f8e9 45%, #e3f2fd 100%);
  border: 1px solid rgba(46, 125, 50, 0.18);
  touch-action: none;
  cursor: grab;
}
.tech-stage:active { cursor: grabbing; }
.tech-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tech-hint {
  position: absolute;
  left: 0.75rem;
  bottom: 0.55rem;
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0.75;
}
.tech-edge {
  stroke: rgba(27, 58, 40, 0.35);
  stroke-width: 3;
  fill: none;
}
.tech-node-g { cursor: pointer; }
.tech-node-g.owned { cursor: default; }
.tech-node-g.can { cursor: pointer; }
.tech-node-circle {
  stroke: rgba(27, 58, 40, 0.35);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}
.tech-node-g.owned .tech-node-circle {
  stroke: #2e7d32;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 6px rgba(76, 175, 80, 0.55));
}
.tech-node-g.can .tech-node-circle {
  stroke: #f9a825;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 8px rgba(255, 235, 59, 0.7));
}
.tech-node-g.locked {
  opacity: 0.42;
}
.tech-node-g.cluster-eternal .tech-node-circle {
  stroke: #c9a227;
}
.tech-node-name {
  font-size: 11px;
  font-weight: 800;
  fill: #1b3a28;
  pointer-events: none;
}
.tech-node-cost {
  font-size: 10px;
  font-weight: 700;
  fill: rgba(27, 58, 40, 0.75);
  pointer-events: none;
}
.fshop-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(27, 58, 40, 0.55);
  padding: 0.45rem 0.35rem 0.15rem;
}

.fshop-buyer-order {
  margin: 0.25rem 0.35rem 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 214, 120, 0.45), rgba(255, 236, 179, 0.55));
  font-size: 0.82rem;
  color: #3a2a10;
}
.fshop-buyer-tag {
  color: #b8860b;
  font-weight: 800;
  font-size: 0.72rem;
}
.fshop-buyer-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #6b5420;
}

.visit-forage {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: min(280px, 52vw);
  padding: 0.4rem 0.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
}
.visit-forage.hidden { display: none !important; }
.visit-forage-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.visit-forage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}
.visit-forage-list button {
  font-size: 0.72rem;
  padding: 0.28rem 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(80, 140, 100, 0.35);
  background: rgba(232, 250, 236, 0.95);
  cursor: pointer;
}
.visit-forage-list button:active {
  transform: scale(0.97);
}

body.farm-only #hud-energy-wrap { display: none !important; }

.farm-dock-btn {
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.farm-dock-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 4px 0 #2e7d32;
}
.farm-dock-btn:focus-visible {
  outline: 2px solid #fff59d;
  outline-offset: 2px;
}

.farm-hint-ready {
  background: linear-gradient(90deg, rgba(255, 249, 196, 0.98), rgba(255, 255, 255, 0.95)) !important;
  box-shadow: 0 2px 10px rgba(255, 193, 7, 0.28);
}
.farm-hint-wilt {
  background: linear-gradient(90deg, rgba(239, 235, 233, 0.98), rgba(255, 255, 255, 0.95)) !important;
}
.farm-hint-water {
  background: linear-gradient(90deg, rgba(227, 242, 253, 0.98), rgba(255, 255, 255, 0.95)) !important;
  box-shadow: 0 2px 10px rgba(33, 150, 243, 0.2);
}

.farm-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.4rem;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.94) !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  margin-top: 0.25rem;
}
.farm-tools.hidden { display: none; }

.crop-wheel {
  position: absolute;
  left: calc(var(--hud-pad, 12px) + var(--safe-l, 0px));
  bottom: calc(var(--hud-pad, 12px) + var(--safe-b, 0px) + 6px);
  top: auto;
  z-index: 28;
  display: flex;
  align-items: center;
  pointer-events: auto;
  overflow: visible;
}
.crop-wheel.hidden { display: none !important; }
.crop-wheel-btn {
  position: relative;
  z-index: 2;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: radial-gradient(circle at 35% 30%, #c8e6a0, #66bb6a 58%, #2e7d32);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24), 0 4px 0 #1b5e20;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.2rem;
  user-select: none;
  transition: transform 0.16s ease;
}
.crop-wheel-btn:active { transform: scale(0.96); }
.crop-wheel.open .crop-wheel-btn {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24), 0 0 0 4px rgba(255, 235, 59, 0.55);
}
.crop-wheel-icon {
  font-size: 3.1rem;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.35));
}
.crop-wheel-label {
  display: none;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.05;
  color: #fff8e1;
  text-shadow: 0 1px 0 #1b5e20;
  text-align: center;
  max-width: 92px;
}
.crop-wheel.is-empty .crop-wheel-icon {
  font-size: 2.35rem;
}
.crop-wheel.is-empty .crop-wheel-label {
  display: block;
}
.crop-wheel.is-empty .crop-wheel-qty {
  display: none;
}
.crop-wheel-qty {
  position: absolute;
  right: 2px;
  bottom: 4px;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: #fff8e1;
  color: #1b3a28;
  font-size: 0.85rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 #c9a227;
}
.crop-wheel-panel {
  position: absolute;
  left: 128px;
  top: 50%;
  width: max-content;
  max-width: min(560px, calc(100vw - 160px));
  max-height: none;
  padding: 0.42rem 0.48rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  z-index: 1;
  transform: translateY(-50%) translateX(calc(-100% - 12px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
  overflow: hidden;
}
.crop-wheel.open .crop-wheel-panel {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.crop-wheel-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.32rem;
  width: max-content;
  max-width: 100%;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.crop-wheel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  flex: 0 0 auto;
  width: 76px;
  min-width: 76px;
  border: none;
  background: #f1f8e9;
  border-radius: 16px;
  padding: 0.42rem 0.28rem 0.38rem;
  cursor: pointer;
  text-align: center;
  color: #1b3a28;
}
.crop-wheel-item:active { transform: scale(0.96); }
.crop-wheel-item.is-active {
  background: linear-gradient(180deg, #dcedc8, #aed581);
  box-shadow: 0 2px 0 #7cb342;
}
.crop-wheel-item-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.8), 0 1px 3px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.crop-wheel-item-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
  line-height: 1.1;
}
.crop-wheel-item-meta strong {
  font-size: 0.72rem;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crop-wheel-item-meta span {
  font-size: 0.68rem;
  color: #5d7a62;
}
.crop-wheel-empty {
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #5d7a62;
  white-space: nowrap;
}

.farm-tool-wide {
  width: auto;
  min-width: 42px;
  height: 42px;
  padding: 0 0.85rem;
  border-radius: 14px;
  border: none;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0d47a1;
  background: linear-gradient(180deg, #e3f2fd, #90caf9);
  box-shadow: 0 3px 0 #1565c0;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.farm-tool-wide:active { transform: translateY(2px); box-shadow: 0 0 0 #1565c0; }
.farm-tool-wide:disabled {
  opacity: 0.45;
  cursor: default;
}
.farm-timers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}
.farm-timers.hidden {
  display: none !important;
}
.farm-plot-timer {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1b3a28;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.7);
  will-change: transform;
}
.farm-plot-timer.hidden {
  visibility: hidden;
}
.farm-plot-timer.is-ready {
  background: linear-gradient(180deg, #fff59d, #ffe082);
  color: #5d4037;
  border-color: rgba(255, 193, 7, 0.45);
}
.farm-plot-timer.is-dry {
  background: linear-gradient(180deg, #e3f2fd, #bbdefb);
  color: #0d47a1;
  border-color: rgba(33, 150, 243, 0.35);
}
@media (max-width: 640px) {
  .farm-plot-timer {
    font-size: 0.62rem;
    padding: 0.12rem 0.35rem;
  }
}

.plot-uproot-hud {
  position: fixed;
  z-index: 80;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  pointer-events: none;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}
.plot-uproot-hud.hidden { display: none !important; }
.plot-uproot-svg {
  position: absolute;
  inset: 0;
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}
.plot-uproot-track {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3.2;
}
.plot-uproot-fill {
  stroke: #e53935;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 91.1;
  stroke-dashoffset: 91.1;
  transition: none;
}
.plot-uproot-ico {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  font-size: 1.15rem;
  line-height: 1;
}

.mission-progress {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.mission-progress-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.mission-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #81c784, #43a047);
}
.mission-progress-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #2e7d32;
  white-space: nowrap;
}
.farm-dock-btn .mission-badge,
.farm-dock-btn .mail-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.farm-dock-btn .mission-badge {
  background: #43a047;
}
#btn-farm-skip.armed {
  outline: 2px solid #ffb300;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 179, 0, 0.25);
}

.visit-budget-low {
  background: #ffebee !important;
  color: #c62828 !important;
}

.plant-picker-card {
  animation: farmSheetIn 0.28s ease;
}
@keyframes farmSheetIn {
  from { transform: translateY(18px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}

.fshop-row {
  transition: background 0.12s ease, transform 0.1s ease;
}
.fshop-row:hover:not(.static):not(.locked) {
  background: rgba(129, 199, 132, 0.22);
}
.fshop-row.selected {
  background: rgba(102, 187, 106, 0.28);
  box-shadow: inset 0 0 0 2px rgba(67, 160, 71, 0.45);
}

.farm-empty {
  text-align: center;
  padding: 1.4rem 1rem;
  color: #5d6b5a;
}
.farm-empty strong {
  display: block;
  color: #1b3a28;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.mail-tabs .chip {
  border: none;
  background: #e8f5e9;
  color: #1b3a28;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
}
.mail-tabs .chip:hover { background: #c8e6c9; }
.mail-tabs .chip.active {
  background: linear-gradient(180deg, #7ed957, #4caf50);
  color: #fff;
  box-shadow: 0 2px 0 #2e7d32;
}
.mail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.35rem;
}
.mail-row.unread {
  background: rgba(129, 199, 132, 0.28);
}

.village-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.village-tabs .chip,
.village-tab {
  border: none;
  background: rgba(255, 255, 255, 0.75);
  color: #1b3a28;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.village-tabs .chip.active,
.village-tab.active {
  background: linear-gradient(180deg, #7ed957, #4caf50);
  color: #fff;
  box-shadow: 0 2px 0 #2e7d32;
}
.village-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.village-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

#game.farm-mode .toast,
.toast.farm-toast {
  border-radius: 14px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .plant-picker-card { animation: none; }
  .farm-dock-btn,
  .fshop-row,
  .village-card,
  .plant-pick { transition: none; }
  #hud-caps.hud-caps-pop,
  #menu-caps.hud-caps-pop,
  #shop-caps.hud-caps-pop { animation: none; }
  .fx-cap-particle { display: none !important; }
  .fx-loot-item.is-settled { animation: none; }
}

.missions-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.mission-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}
.mission-row.done {
  background: rgba(129, 199, 132, 0.28);
  box-shadow: inset 0 0 0 1px rgba(67, 160, 71, 0.25);
}
.mission-row.claimed { opacity: 0.62; }
.mission-row-body { min-width: 0; flex: 1; }
.mission-row-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}
.mission-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.mission-tag.chapter { background: #e3f2fd; color: #1565c0; }
.mission-tag.eternal { background: #fff3e0; color: #ef6c00; }
.mission-reward {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #2e7d32;
}
.mission-claim:disabled { opacity: 0.55; }

[data-village-tab] {
  border: none;
  background: rgba(255, 255, 255, 0.75);
  color: #1b3a28;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
[data-village-tab].active {
  background: linear-gradient(180deg, #7ed957, #4caf50);
  color: #fff;
  box-shadow: 0 2px 0 #2e7d32;
}

/* ——— Bazaar: cosy cream theme (farm-only) ——— */
body.farm-only .bazaar-card {
  background: #fff8e7 !important;
  color: #1b3a28 !important;
  border: none !important;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22) !important;
}
body.farm-only .bazaar-card .modal-head h2,
body.farm-only .bazaar-card .cur-pill {
  color: #1b3a28 !important;
}
body.farm-only .bazaar-card .btn-ghost {
  color: #1b3a28 !important;
  border-color: rgba(27, 58, 40, 0.22) !important;
}
body.farm-only .bazaar-hint {
  color: rgba(27, 58, 40, 0.62);
}
body.farm-only .bazaar-tabs .chip {
  background: #e8f5e9;
  color: #1b3a28;
  border: none;
  font-weight: 700;
  transition: background 0.12s ease;
}
body.farm-only .bazaar-tabs .chip:hover { background: #c8e6c9; }
body.farm-only .bazaar-tabs .chip.active {
  background: linear-gradient(180deg, #7ed957, #4caf50);
  color: #fff;
  box-shadow: 0 2px 0 #2e7d32;
}
body.farm-only .bazaar-filters .chip {
  background: #e8f5e9;
  color: #1b3a28;
  border: none;
  font-weight: 700;
}
body.farm-only .bazaar-filters .chip.active {
  background: linear-gradient(180deg, #7ed957, #4caf50);
  color: #fff;
  box-shadow: 0 2px 0 #2e7d32;
}
body.farm-only .bazaar-search,
body.farm-only .bazaar-sort,
body.farm-only .bz-bid-input,
body.farm-only .bazaar-sell-form input,
body.farm-only .bazaar-sell-form select {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(80, 140, 100, 0.3);
  border-radius: 10px;
  color: #1b3a28;
}
body.farm-only .bazaar-lot {
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-left: 4px solid rgba(27, 58, 40, 0.15);
  border-radius: 14px;
  color: #1b3a28;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
body.farm-only .bazaar-lot:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
body.farm-only .bazaar-lot.rarity-uncommon { border-left-color: #66bb6a; }
body.farm-only .bazaar-lot.rarity-rare { border-left-color: #42a5f5; }
body.farm-only .bazaar-lot.rarity-epic { border-left-color: #ab47bc; }
body.farm-only .bazaar-lot.rarity-legendary {
  border-left-color: #f9a825;
  box-shadow: 0 0 0 1px rgba(249, 168, 37, 0.35);
  background: linear-gradient(135deg, rgba(255, 248, 225, 0.9), rgba(255, 255, 255, 0.6));
}
body.farm-only .bazaar-chip {
  background: #e8f5e9;
  color: #33691e;
  font-weight: 600;
}
body.farm-only .bazaar-rarity-badge {
  background: rgba(27, 58, 40, 0.08);
  color: #1b3a28;
}
body.farm-only .bazaar-rarity-badge.rarity-epic { background: #f3e5f5; color: #7b1fa2; }
body.farm-only .bazaar-rarity-badge.rarity-legendary { background: #fff8e1; color: #ef6c00; }
body.farm-only .bazaar-own-badge,
body.farm-only .bazaar-status {
  background: rgba(27, 58, 40, 0.08);
  color: #1b3a28;
}
body.farm-only .bazaar-status-active { background: #e8f5e9; color: #2e7d32; }
body.farm-only .bazaar-status-sold,
body.farm-only .bazaar-status-sold_pending { background: #fff8e1; color: #b8860b; }
body.farm-only .bazaar-status-returned,
body.farm-only .bazaar-status-expired { background: #eceff1; color: #546e7a; }
body.farm-only .bazaar-status-cancelled_seller,
body.farm-only .bazaar-status-cancelled_spoil { background: #ffebee; color: #c62828; }
body.farm-only .bazaar-pager .bazaar-pager-label { color: rgba(27, 58, 40, 0.7); }
body.farm-only .bazaar-sell-form label { color: #1b3a28; }
body.farm-only .bazaar-card .muted { color: rgba(27, 58, 40, 0.58) !important; }

/* ——— Toasts: cosy in farm mode ——— */
body.farm-only .toast {
  background: rgba(255, 248, 231, 0.97) !important;
  border: none !important;
  color: #1b3a28 !important;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
body.farm-only .toast.good { color: #2e7d32 !important; }
body.farm-only .toast.bomb { color: #c62828 !important; }

/* ——— Caps fly-to HUD ——— */
.fx-caps-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}
.fx-cap-particle {
  position: fixed;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  will-change: left, top, transform, opacity;
}
.fx-cap-particle svg {
  width: 1.2rem;
  height: 1.2rem;
}
#hud-caps.hud-caps-pop,
#menu-caps.hud-caps-pop,
#shop-caps.hud-caps-pop,
#dg-wallet.hud-caps-pop,
#btn-inventory.hud-bag-pop,
#dock-inv.hud-bag-pop {
  display: inline-block;
  animation: hudCapsPop 0.4s ease;
}
#btn-inventory.hud-bag-pop,
#dock-inv.hud-bag-pop {
  display: inline-flex;
}
@keyframes hudCapsPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); color: #c9a227; }
  100% { transform: scale(1); }
}

/* ——— Ground loot ——— */
.fx-loot-layer {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}
.fx-loot-item {
  position: fixed;
  width: 2.6rem;
  height: 2.6rem;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: rgba(255, 248, 231, 0.95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  pointer-events: auto;
  cursor: pointer;
  z-index: 56;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
}
.fx-loot-item.is-settled {
  animation: lootBob 1.4s ease-in-out infinite;
}
.fx-loot-item.rarity-epic {
  box-shadow: 0 4px 16px rgba(156, 39, 176, 0.45), inset 0 0 0 2px rgba(206, 147, 216, 0.8);
}
.fx-loot-item.rarity-legendary {
  box-shadow: 0 4px 18px rgba(255, 193, 7, 0.55), inset 0 0 0 2px rgba(255, 236, 179, 0.9);
}
.fx-loot-sprite {
  font-size: 1.45rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  pointer-events: none;
}
.fx-loot-sprite svg,
.fx-loot-sprite img {
  width: 1.5rem;
  height: 1.5rem;
}
.fx-loot-shard {
  position: fixed;
  width: 0.9rem;
  height: 0.9rem;
  pointer-events: none;
  z-index: 57;
  font-size: 0.85rem;
}
@keyframes lootBob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .fx-loot-item.is-settled { animation: none; }
}

/* ——— Tech tree readability ——— */
.tech-node-g.can .tech-node-circle {
  animation: techCanPulse 2.2s ease-in-out infinite;
}
@keyframes techCanPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 235, 59, 0.55)); }
  50% { filter: drop-shadow(0 0 12px rgba(255, 235, 59, 0.9)); }
}
.tech-node-g.can:hover .tech-node-circle {
  stroke-width: 4.5;
}
@media (prefers-reduced-motion: reduce) {
  .tech-node-g.can .tech-node-circle { animation: none; }
}

/* ——— Almanac marks ——— */
.almanac-marks {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #b8860b;
}
.almanac-row {
  transition: background 0.12s ease;
}
.almanac-row.known:hover { background: #dcedc8; }

/* Legacy fishing junk-sell hidden on farm product (junk sells via shop barn tab) */
body.farm-only #btn-sell-junk { display: none !important; }

/* Home button duplicates settings at home and visit-banner has its own «Домой» */
#game.farm-mode #btn-leave { display: none !important; }

/* base.css .chip uses !important — cream chips must out-gun it */
.farm-shop-tabs .chip,
.farm-inv-tabs .chip,
.mail-tabs .chip,
body.farm-only .bazaar-tabs .chip,
body.farm-only .bazaar-filters .chip {
  background: #e8f5e9 !important;
  color: #1b3a28 !important;
  border: none !important;
  font-weight: 700;
}
.farm-shop-tabs .chip:hover,
.farm-inv-tabs .chip:hover,
.mail-tabs .chip:hover,
body.farm-only .bazaar-tabs .chip:hover,
body.farm-only .bazaar-filters .chip:hover {
  background: #c8e6c9 !important;
}
.farm-shop-tabs .chip.active,
.farm-inv-tabs .chip.active,
.mail-tabs .chip.active,
body.farm-only .bazaar-tabs .chip.active,
body.farm-only .bazaar-filters .chip.active {
  background: linear-gradient(180deg, #7ed957, #4caf50) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 0 #2e7d32;
}

/* ——— Cream theme for mail / daily / settings / premium modals (farm-only) ——— */
body.farm-only #mail-modal .modal-card,
body.farm-only #daily-modal .modal-card,
body.farm-only #settings-modal .modal-card,
body.farm-only #premium-modal .modal-card {
  background: #fff8e7 !important;
  color: #1b3a28 !important;
  border: none !important;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22) !important;
}
body.farm-only #mail-modal h2,
body.farm-only #daily-modal h2,
body.farm-only #settings-modal h2,
body.farm-only #premium-modal h2 {
  color: #1b3a28 !important;
}
body.farm-only #mail-modal .btn-ghost,
body.farm-only #daily-modal .btn-ghost,
body.farm-only #settings-modal .btn-ghost,
body.farm-only #premium-modal .btn-ghost {
  color: #1b3a28 !important;
  border-color: rgba(27, 58, 40, 0.22) !important;
}
body.farm-only #mail-modal .muted,
body.farm-only #daily-modal .muted,
body.farm-only #settings-modal .muted,
body.farm-only #premium-modal .muted {
  color: rgba(27, 58, 40, 0.58) !important;
}
body.farm-only .mail-row {
  background: rgba(255, 255, 255, 0.72);
  color: #1b3a28;
}
body.farm-only .mail-row.unread {
  background: rgba(129, 199, 132, 0.32);
}
body.farm-only #daily-modal .daily-row {
  background: rgba(255, 255, 255, 0.65);
  border: none;
  border-radius: 12px;
  color: #1b3a28;
}
body.farm-only #daily-modal .daily-row.ready {
  background: rgba(255, 249, 196, 0.85);
  box-shadow: inset 0 0 0 2px rgba(249, 168, 37, 0.4);
}
body.farm-only #daily-modal .daily-countdown { color: rgba(27, 58, 40, 0.62); }
body.farm-only #settings-modal .settings-row { color: #1b3a28; }
body.farm-only #settings-modal select,
body.farm-only #settings-modal input[type='range'] {
  background: rgba(255, 255, 255, 0.92);
  color: #1b3a28;
  border: 1px solid rgba(80, 140, 100, 0.3);
  border-radius: 8px;
}

/* Fishing leftovers — hide in farm-only product surface */
body.farm-only #set-catch-feed,
body.farm-only label.settings-row:has(#set-catch-feed) {
  display: none !important;
}
body.farm-only #bestiary-tabs [data-bestiary-tab="fish"],
body.farm-only #catch-feed {
  display: none !important;
}
body.farm-only #lake-loadout-remember,
body.farm-only .loadout-check {
  display: none !important;
}

