/* ============================================================
   我的田地与果园 · 互动场景
   点空地 = 种下（落种、土花、冒芽）
   点幼苗 = 浇水（水滴、伸展、土变深）
   点成熟 = 收成（拔起、星点、学分飘字）
   ============================================================ */

.gg {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    radial-gradient(900px 520px at 20% -10%, #ffffffcc, transparent 62%),
    linear-gradient(165deg, #f2f6e6, #e6efd9 55%, #f7f5e8);
}

.gg-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px clamp(14px, 3.4vw, 52px) 8px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
.gg-top__titles { display: grid; gap: 2px; }
.gg-top__kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; color: #7b8b7f; }
.gg-top__title { font-size: clamp(22px, 2.6vw, 34px); font-weight: 900; color: #1d3f31; }

.gg-chips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.gg-chip {
  display: grid;
  justify-items: center;
  min-width: 78px;
  padding: 7px 14px;
  border-radius: 14px;
  background: #fdfbf2;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.gg-chip strong { font-size: 18px; color: #1d6543; line-height: 1.15; }
.gg-chip span { font-size: 11px; color: #87988f; font-weight: 700; }
.gg-chip--gold strong { color: #b4791f; }

/* 工具条 */
.gg-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 clamp(14px, 3.4vw, 52px) 12px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
.seed-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid #dfe7cd;
  background: #fdfcf4;
  font-weight: 800;
  font-size: 13.5px;
  color: #40584a;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.seed-tab:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.seed-tab[aria-selected="true"] {
  background: linear-gradient(180deg, #2d8a58, #1d6543);
  border-color: #1d6543;
  color: #fff;
  box-shadow: 0 8px 18px #1d654333;
}
.seed-tab b { font-size: 12px; opacity: .85; font-weight: 800; }
.gg-hint { font-size: 12.5px; color: #6b7d72; margin-left: auto; }

/* ---------------- 场景：天空 + 土垄 ---------------- */

.gg-stage {
  position: relative;
  margin: 0 clamp(12px, 3vw, 40px) 26px;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px #1d3b2c26, 0 0 0 1px #ffffff8c inset;
  display: grid;
  grid-template-rows: clamp(70px, 15vh, 150px) minmax(0, 1fr);
  min-height: clamp(430px, 58vh, 620px);
  background: #cfe8f7;
}

.gg-sky {
  position: relative;
  background: linear-gradient(180deg, #8fd3f4 0%, #c8ecf8 62%, #e9f7ee 100%);
  overflow: hidden;
}
.gg-sun {
  position: absolute;
  right: 12%;
  top: 18%;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #ffe680;
  box-shadow: 0 0 34px 12px #ffe68055;
}
.gg-cloud {
  position: absolute;
  width: 96px; height: 30px;
  border-radius: 999px;
  background: #ffffffd9;
  box-shadow: 22px 8px 0 -4px #ffffffd9, -26px 9px 0 -6px #ffffffd9;
  animation: cloudDrift 26s linear infinite;
}
.gg-cloud.c1 { top: 22%; left: 12%; animation-duration: 34s; }
.gg-cloud.c2 { top: 46%; left: 48%; width: 70px; height: 22px; animation-duration: 46s; opacity: .9; }
@keyframes cloudDrift {
  0% { transform: translateX(-14px); }
  50% { transform: translateX(18px); }
  100% { transform: translateX(-14px); }
}
/* 远处草坡，压住天空与土的交界 */
.gg-hill {
  position: absolute;
  left: -5%; right: -5%; bottom: -10px;
  height: 58%;
  background: linear-gradient(180deg, #a5d585, #86bf62);
  border-radius: 52% 48% 0 0 / 100% 100% 0 0;
  box-shadow: inset 0 8px 14px #ffffff40;
}

.gg-ground {
  position: relative;
  background:
    repeating-linear-gradient(180deg, #00000000 0 54px, #4a2e1d3d 54px 60px),
    radial-gradient(120% 60% at 50% 0%, #b98a56 0%, #96643d 38%, #7a4f2f 100%),
    #7a4f2f;
  box-shadow: inset 0 10px 18px #4a2e1d55;
}
/* 土壤纹理 */
.gg-ground::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 18% 30%, #5f3d25 0 3px, transparent 4px),
    radial-gradient(circle at 62% 18%, #5f3d25 0 2px, transparent 3px),
    radial-gradient(circle at 82% 62%, #5f3d25 0 3px, transparent 4px),
    radial-gradient(circle at 36% 78%, #5f3d25 0 2px, transparent 3px),
    radial-gradient(circle at 8% 66%, #c99a68 0 2px, transparent 3px);
  background-size: 120px 90px, 90px 70px, 140px 110px, 80px 60px, 100px 80px;
  pointer-events: none;
}
/* 垄头的一排小草 */
.gg-ground::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -7px;
  height: 14px;
  background: repeating-linear-gradient(90deg, #8ec267 0 3px, transparent 3px 26px);
  opacity: .85;
}

/* ---------------- 格子 ---------------- */

.bed {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(4px, 1vw, 14px);
  padding: clamp(14px, 2.4vw, 30px) clamp(10px, 2.6vw, 40px) clamp(12px, 2.2vw, 26px);
  height: 100%;
  align-items: end;
}

.slot {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: end;
  min-height: clamp(120px, 15vh, 190px);
  padding: 6px 4px 8px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 16px;
  transition: background .16s ease, transform .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.slot:hover { background: #ffffff1f; transform: translateY(-2px); }
.slot:focus-visible { outline: 3px solid #ffd257; outline-offset: 2px; }

/* 每格一小块土堆，不要整条大饼 */
.slot__soil {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: min(134px, 82%);
  height: 32px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 26%, #c99a68 0%, #96643d 55%, #6f472c 100%);
  box-shadow: inset 0 -5px 9px #3f27196b, 0 6px 10px #2f24183d;
}
.slot__soil::after {
  content: '';
  position: absolute;
  inset: 26% 24% auto;
  height: 34%;
  border-radius: 50%;
  background: #4a2e1d;
  opacity: .35;
  filter: blur(3px);
}

.slot__plant {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: end center;
  width: 100%;
  height: calc(100% - 52px);
}
.slot__plant svg { width: auto; height: 100%; max-height: 168px; overflow: visible; }

.slot__tag {
  position: relative;
  z-index: 3;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 900;
  color: #fdf6e4;
  background: #2f2418b3;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  backdrop-filter: blur(3px);
}
.slot__tag--mature { background: linear-gradient(180deg, #ffd66b, #f5b731); color: #5b4109; }

/* 空地提示：把加号压在土垄上 */
.slot--empty .slot__plus {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 21px;
  font-weight: 900;
  color: #fff;
  background: #8ec267d9;
  box-shadow: 0 6px 14px #2f24184d;
  transition: transform .18s ease, background .18s ease;
}
.slot--empty:hover .slot__plus { transform: translateX(-50%) scale(1.14) rotate(90deg); background: #6fb049; }
.slot--empty .slot__tag { background: #ffffff26; color: #fff2d9; }

.bed[data-armed="1"] .slot--empty .slot__plus { animation: armedPulse 1.6s ease-in-out infinite; }
@keyframes armedPulse {
  0%, 100% { box-shadow: 0 6px 14px #2f24184d, 0 0 0 0 #8ec26788; }
  50% { box-shadow: 0 6px 14px #2f24184d, 0 0 0 14px #8ec26700; }
}

/* ---------------- 种下 ---------------- */

.seed-fall {
  position: absolute;
  z-index: 6;
  left: calc(50% - 7px);
  top: 4%;
  width: 14px; height: 18px;
  border-radius: 50% 50% 48% 48%;
  background: linear-gradient(180deg, #c99a68, #7d5132);
  animation: seedFall .6s cubic-bezier(.55, .05, .85, .45) forwards;
}
@keyframes seedFall {
  0% { transform: translateY(-20px) rotate(-26deg) scale(.8); opacity: 0; }
  25% { opacity: 1; }
  80% { transform: translateY(52px) rotate(10deg) scale(1); }
  100% { transform: translateY(58px) rotate(14deg) scale(.7); opacity: 0; }
}

.soil-puff {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 16px;
  width: 26px; height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: radial-gradient(circle, #c99a68 0%, #a97c50 52%, #a97c5000 74%);
  animation: puff .65s ease-out forwards;
}
@keyframes puff {
  0% { transform: scale(.3); opacity: .95; }
  70% { opacity: .5; }
  100% { transform: scale(2.8) translateY(-6px); opacity: 0; }
}

.slot.planting .slot__plant { animation: sproutIn .62s cubic-bezier(.2, 1.5, .45, 1) both; }
@keyframes sproutIn {
  0% { transform: scale(.05) translateY(10px); opacity: 0; }
  55% { transform: scale(1.16) translateY(0); opacity: 1; }
  78% { transform: scale(.95); }
  100% { transform: scale(1); }
}

/* ---------------- 浇水 ---------------- */

.drop {
  position: absolute;
  z-index: 7;
  top: 2%;
  width: 7px; height: 12px;
  border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, #d8f2fb, #63b6d6);
  opacity: 0;
  animation: dropFall .7s ease-in forwards;
}
@keyframes dropFall {
  0% { transform: translateY(-16px) scale(.7); opacity: 0; }
  20% { opacity: 1; }
  85% { transform: translateY(96px) scale(1); opacity: 1; }
  100% { transform: translateY(104px) scale(.35); opacity: 0; }
}

.slot.watering .slot__plant { animation: drink 1.05s ease-in-out; }
@keyframes drink {
  0%, 100% { transform: scale(1) rotate(0); }
  28% { transform: scale(.92, 1.1) rotate(-2deg); }
  58% { transform: scale(1.07, .95) rotate(2deg); }
}

.soil-wet {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 30px;
  width: min(134px, 82%);
  height: 32px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 34%, #4a2e1d 0%, #3a2416 72%);
  animation: wetIn 1s ease forwards;
}
@keyframes wetIn { 0% { opacity: 0 } 55% { opacity: .75 } 100% { opacity: .55 } }

/* ---------------- 收成 ---------------- */

.slot.harvesting .slot__plant { animation: pickUp .85s cubic-bezier(.3, 1.2, .5, 1) forwards; }
@keyframes pickUp {
  0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
  30% { transform: translateY(-10px) rotate(-9deg) scale(1.1); }
  100% { transform: translateY(-86px) rotate(18deg) scale(.5); opacity: 0; }
}

.spark {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 40%;
  width: 12px; height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  opacity: 0;
  animation: sparkFly .9s ease-out forwards;
}
@keyframes sparkFly {
  0% { transform: translate(-50%, 0) scale(.5); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(0); opacity: 0; }
}

.reward-float {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 54%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe08a, #f5b731);
  color: #533a06;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 10px 22px #b4791f4d, 0 0 0 3px #fff8e299;
  animation: floatUp 1.4s ease-out forwards;
  pointer-events: none;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.8); }
  22% { opacity: 1; transform: translate(-50%, -4px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -58px) scale(1); }
}

/* 阶段推进 */
.slot.grow-in .slot__plant { animation: growIn .7s cubic-bezier(.2, 1.4, .5, 1) both; }
@keyframes growIn {
  0% { transform: scale(.8); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 成熟呼吸光 */
.slot--mature .slot__plant { animation: readyBreathe 2.2s ease-in-out infinite; }
@keyframes readyBreathe {
  0%, 100% { filter: drop-shadow(0 0 0 #ffd25700) brightness(1); }
  50% { filter: drop-shadow(0 0 18px #ffe08ad9) brightness(1.06); }
}
.slot--mature .slot__soil { box-shadow: inset 0 -5px 9px #3f27196b, 0 0 0 3px #ffd25799, 0 6px 10px #2f24183d; }

/* 生长进度条（贴在土垄上） */
.slot__bar {
  position: relative;
  z-index: 3;
  width: min(112px, 70%);
  height: 5px;
  margin: 3px 0 3px;
  border-radius: 99px;
  background: #ffffff38;
  box-shadow: 0 0 0 1px #ffffff42;
  overflow: hidden;
}
.slot__bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #a7e07e, #ffd257);
  transition: width .6s ease;
}

/* 侧栏 */
.gg-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 clamp(12px, 3vw, 40px) 32px;
}
.gg-card {
  background: #fdfbf2;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px clamp(14px, 2vw, 20px);
  box-shadow: var(--shadow-sm);
}
.gg-card h2 { font-size: 16px; color: var(--green-deep); margin-bottom: 6px; }
.gg-card p { margin: 0; font-size: 13px; color: #7c8b81; line-height: 1.75; }
.gg-card kbd {
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  background: #eef2df;
  border-radius: 6px;
  padding: 1px 6px;
  color: #4a5f52;
}

@media (max-width: 860px) {
  .bed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gg-side { grid-template-columns: minmax(0, 1fr); }
  .gg-hint { margin-left: 0; width: 100%; }
  .slot__tag { font-size: 10.5px; padding: 2px 8px; }
  .gg-stage { min-height: 460px; }
}
