/* ============================================================
 * farm.css —— 农场页（等距场景 + HUD + 商店面板）
 * ============================================================ */
.farmstage {
  position: relative;
  width: 100%;
  height: calc(100vh - 0px);
  min-height: 520px;
  overflow: hidden;
  border-radius: 0 0 26px 26px;
  background: #bfe6ff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
#farmCanvas { display: block; width: 100%; height: 100%; }

/* ---------- 顶部 HUD ---------- */
.fhud {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.62) 70%, rgba(255,255,255,0));
  z-index: 4;
}
.fhud-left { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.fhud-back {
  width: 42px; height: 42px; border-radius: 14px; border: 0;
  background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(40,70,40,.16);
  font-size: 24px; line-height: 1; color: #2c5a3a; cursor: pointer;
}
.fhud-title { font-size: 19px; font-weight: 800; color: #23543a; letter-spacing: .5px; }
.fhud-stats { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.fstat {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.95);
  border-radius: 999px; padding: 7px 14px;
  box-shadow: 0 3px 10px rgba(40,70,40,.14);
  font-size: 15px; font-weight: 800; color: #2f4a33;
}
.fstat span { font-size: 17px; }
.fstat.lv { padding: 5px 14px 5px 8px; gap: 9px; }
.lvbadge {
  background: linear-gradient(135deg,#ffd54a,#f6a623);
  color: #6b3d00; border-radius: 999px; padding: 3px 9px;
  font-size: 12.5px; font-weight: 900; letter-spacing: .3px;
}
.lvbar { width: 86px; height: 9px; border-radius: 999px; background: #e7eee2; overflow: hidden; }
.lvbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#8fe07a,#4fc267); transition: width .4s; }
.fhud-tools { display: flex; gap: 8px; }
.ftool {
  border: 0; background: rgba(255,255,255,.95); border-radius: 16px;
  padding: 7px 12px; display: flex; flex-direction: column; align-items: center;
  font-size: 19px; line-height: 1.1; cursor: pointer;
  box-shadow: 0 3px 10px rgba(40,70,40,.14); color: #2f4a33;
}
.ftool em { font-style: normal; font-size: 10.5px; color: #6b7d6f; margin-top: 2px; }

/* ---------- 底部操作条 ---------- */
.fbar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.94);
  border-radius: 20px; padding: 10px 14px;
  box-shadow: 0 8px 26px rgba(30,60,40,.2);
  z-index: 4; max-width: calc(100% - 32px);
}
.fbar-hint { font-size: 13.5px; color: #4d6355; font-weight: 700; padding-left: 4px; }
.fbar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fbtn {
  border: 0; border-radius: 14px; padding: 9px 14px;
  background: #eef6ea; color: #2f6b41; font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.fbtn.primary { background: linear-gradient(135deg,#ffd75e,#f7b32b); color: #6b4400; }
.fbtn:active { transform: translateY(1px); }

/* ---------- 气泡提示 ---------- */
.ftip {
  position: absolute; left: 50%; top: 88px; transform: translate(-50%, -8px);
  background: rgba(38,58,44,.9); color: #fff; font-size: 14px; font-weight: 700;
  padding: 9px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 6; max-width: 80%; text-align: center;
}
.ftip.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 商店 / 弹层 ---------- */
.fsheet { position: absolute; inset: 0; z-index: 9; }
.sheet-mask { position: absolute; inset: 0; background: rgba(20,40,26,.32); }
.sheet-card {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: min(760px, calc(100% - 24px));
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 16px 18px 22px; box-shadow: 0 -10px 34px rgba(20,40,26,.24);
  transition: transform .24s cubic-bezier(.2,.9,.3,1);
  max-height: 82%; overflow: auto;
}
.fsheet.on .sheet-card { transform: translate(-50%, 0); }
.fsheet.on .sheet-mask { animation: fmask .2s ease both; }
@keyframes fmask { from { opacity: 0; } to { opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 800; color: #23543a; }
.sheet-coins { margin-left: auto; background: #fff6d8; color: #8a5b00; border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.sheet-x { border: 0; background: #f1f4ef; width: 34px; height: 34px; border-radius: 12px; font-size: 15px; color: #55635a; cursor: pointer; }
.seed-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; margin: 14px 0 6px;
}
.seedcard {
  border: 2px solid #e5efe2; background: #fbfff9; border-radius: 18px;
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; font-family: inherit;
}
.seedcard .sc-emoji { font-size: 30px; }
.seedcard .sc-name { font-size: 14.5px; font-weight: 800; color: #2f4a33; }
.seedcard .sc-meta { font-size: 12.5px; color: #8a5b00; font-weight: 800; }
.seedcard .sc-sub { font-size: 11px; color: #7d8b81; }
.seedcard.locked { opacity: .55; background: #f4f6f2; cursor: not-allowed; }
.seedcard.poor { border-color: #ffe0e0; }
.sheet-foot { font-size: 12px; color: #7d8b81; text-align: center; margin-top: 10px; }

/* ---------- 升级弹层 ---------- */
.sheet-card.center { text-align: center; padding: 26px 22px 22px; }
.fl-badge {
  display: inline-block; font-size: 26px; font-weight: 900; color: #6b3d00;
  background: linear-gradient(135deg,#ffe07a,#f7b32b); border-radius: 999px; padding: 8px 22px;
  box-shadow: 0 8px 20px rgba(240,170,20,.35);
}
.fl-title { font-size: 21px; font-weight: 900; color: #23543a; margin: 12px 0 4px; }
.fl-sub { font-size: 14px; color: #6b7d6f; margin-bottom: 18px; }

/* ---------- 首页入口卡 ---------- */
.farmhome {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 14px;
  background: linear-gradient(165deg,#cdeedd 0%,#9fdcb5 55%,#7fcd93 100%);
  box-shadow: 0 16px 34px rgba(46,120,78,.18);
  display: flex; flex-direction: column; gap: 10px; cursor: pointer;
  border: 0; text-align: left; font-family: inherit;
}
.farmhome::after {
  content: ""; position: absolute; right: -30px; bottom: -34px; width: 150px; height: 120px;
  background: radial-gradient(circle at 40% 40%, rgba(255,255,255,.55), transparent 65%);
  pointer-events: none;
}
.fh-top { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; color: #1f5c3a; }
.fh-lv { margin-left: auto; background: rgba(255,255,255,.85); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: #2f6b41; }
.fh-scene {
  position: relative; height: 118px; border-radius: 16px;
  background: linear-gradient(180deg,#a9ddff 0%,#cfeecb 62%,#8fd39a 100%);
  overflow: hidden;
}
.fh-sun { position: absolute; right: 14px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: #ffe066; box-shadow: 0 0 20px rgba(255,224,102,.8); }
.fh-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; background: linear-gradient(180deg,#8fd39a,#6bbd74); }
.fh-plot {
  position: relative; bottom: auto; width: 54px; height: 30px;
  background: radial-gradient(circle at 50% 120%, #7b5132 0%, #59391f 78%);
  border-radius: 50%/38%; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
  display: flex; align-items: flex-end; justify-content: center;
}
.fh-plot span { font-size: 24px; transform: translateY(-8px); }

/* 农场页整屏 */
.app.fullbleed { max-width: none; padding: 0; margin: 0; width: 100%; }
.fh-stats { display: flex; gap: 8px; }
.fh-chip {
  flex: 1; background: rgba(255,255,255,.8); border-radius: 12px; padding: 7px 10px;
  font-size: 11.5px; color: #4f6b58; font-weight: 700; text-align: center;
}
.fh-chip b { display: block; font-size: 15px; color: #1f5c3a; }
.fh-go {
  border: 0; border-radius: 14px; padding: 11px; font-size: 14.5px; font-weight: 800;
  background: linear-gradient(135deg,#ffd75e,#f7b32b); color: #6b4400; cursor: pointer;
  font-family: inherit;
}
@media (max-width: 860px) {
  .fbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .fbar-hint { text-align: center; }
  .fhud { flex-wrap: wrap; gap: 8px; }
  .fhud-stats { margin-left: 0; }
}
