:root {
  --leaf: #4f8f2f;
  --leaf-dark: #2f6d22;
  --leaf-soft: #dff2cc;
  --mint: #f2fbeb;
  --soil: #9c6a3a;
  --soil-dark: #70461f;
  --ripe: #ffd66b;
  --ink: #20331c;
  --muted: #66765e;
  --white: #fffdf7;
  --line: rgba(54, 101, 37, 0.16);
  --shadow: 0 18px 45px rgba(61, 112, 43, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 231, 138, 0.38), transparent 28%),
    linear-gradient(135deg, #effbdc 0%, #dff4d6 46%, #f8ffe9 100%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px clamp(12px, 4vw, 28px) 28px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: 0 10px 30px rgba(47, 109, 34, 0.1);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--leaf), #83bd39);
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.12);
}

.brand-text {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: 1px;
}

.brand-text em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.games-link,
.ghost-button,
.primary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.games-link {
  flex: 0 0 auto;
  padding: 0 18px;
  color: #fff;
  background: var(--leaf);
}

.games-link:hover,
.ghost-button:hover,
.primary-button:hover,
.danger-button:hover,
.crop-card:hover,
.land:hover {
  transform: translateY(-1px) scale(1.01);
}

button:disabled {
  cursor: not-allowed;
}

.primary-button:disabled,
.ghost-button:disabled {
  color: var(--muted);
  background: #e9efdf;
  box-shadow: none;
}

.game-shell {
  padding-top: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 16px;
}

.hero > div:first-child,
.coin-card,
.level-card,
.board-panel,
.seed-panel,
.actions-panel,
.decor-panel,
.feature-panel,
.guide-card,
.weather-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.84);
  box-shadow: var(--shadow);
}

.hero > div:first-child {
  padding: clamp(18px, 4vw, 30px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--leaf-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1;
}

h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.intro,
.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.status-cards {
  display: grid;
  gap: 14px;
  min-width: 210px;
}

.coin-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
}

.coin-icon {
  font-size: 34px;
}

.coin-card strong {
  display: block;
  color: var(--leaf-dark);
  font-size: 34px;
  line-height: 1;
}

.coin-card small {
  color: var(--muted);
  font-weight: 700;
}

.level-card {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px 18px;
}

.level-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.level-row strong {
  color: var(--leaf-dark);
  font-size: 26px;
}

.level-row span {
  color: var(--muted);
  font-weight: 800;
}

.exp-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e0edcf;
}

.exp-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7cbd42, #ffd66b);
  transition: width 0.25s ease;
}

.farm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.board-panel,
.seed-panel,
.actions-panel,
.decor-panel,
.feature-panel,
.guide-card,
.weather-panel {
  padding: clamp(14px, 3vw, 20px);
}

.farm-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.7);
  box-shadow: 0 10px 28px rgba(47, 109, 34, 0.08);
}

.tab-button {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  color: var(--leaf-dark);
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.tab-button:hover {
  transform: translateY(-1px);
  background: var(--leaf-soft);
}

.tab-button.is-active {
  color: #fff;
  background: var(--leaf);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.decor-panel {
  margin-bottom: 14px;
}

.guide-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  background: rgba(255, 248, 217, 0.9);
}

.guide-card[hidden] {
  display: none;
}

.guide-card ol {
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.weather-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.weather-icon {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 20px;
  font-size: 34px;
  background: linear-gradient(135deg, #fff8d9, #dff2cc);
}

.decor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.decor-badge {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 18px;
  font-size: 30px;
  background: linear-gradient(135deg, #f8fff0, #dff2cc);
  box-shadow: inset 0 -5px 0 rgba(47, 109, 34, 0.08);
}

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

.section-head.compact {
  align-items: flex-start;
}

.land-count {
  margin-bottom: 2px;
}

.ghost-button {
  flex: 0 0 auto;
  padding: 0 18px;
  color: var(--leaf-dark);
  background: var(--leaf-soft);
}

.land-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 14px);
}

.land {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 8px;
  overflow: hidden;
  border: 3px solid rgba(112, 70, 31, 0.18);
  border-radius: 22px;
  color: var(--soil-dark);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(135deg, #bd8651, var(--soil));
  background-size: 18px 18px, 18px 18px, auto;
  cursor: pointer;
  box-shadow: inset 0 -9px 0 rgba(73, 42, 16, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.land-hit {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  place-items: center;
  border: 0;
  color: inherit;
  cursor: pointer;
  background: transparent;
}

.land.empty {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(135deg, #c4915e, #9d6331);
  background-size: 20px 20px, 20px 20px, auto;
}

.land.growing {
  border-color: rgba(79, 143, 47, 0.35);
  background:
    radial-gradient(circle at 50% 84%, rgba(75, 130, 38, 0.22), transparent 35%),
    linear-gradient(135deg, #bd8651, #9c6a3a);
}

.land.ready {
  border-color: rgba(223, 164, 21, 0.6);
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 244, 169, 0.8), transparent 46%),
    linear-gradient(135deg, #c9965f, #a56b32);
  box-shadow: inset 0 -9px 0 rgba(73, 42, 16, 0.12), 0 0 22px rgba(255, 209, 78, 0.48);
}

.land-content {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.land-emoji {
  font-size: clamp(30px, 8vw, 58px);
  line-height: 1;
  filter: drop-shadow(0 5px 6px rgba(59, 40, 18, 0.18));
}

.land-title {
  font-weight: 800;
  line-height: 1.2;
}

.land-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--soil-dark);
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 253, 247, 0.78);
  word-break: keep-all;
}

.land.ready .land-state {
  color: #744900;
  background: var(--ripe);
}

.land-watered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--leaf-dark);
  font-size: 11px;
  font-weight: 800;
  background: rgba(223, 242, 204, 0.92);
}

.fertilizer-button {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  background: var(--leaf);
  box-shadow: 0 6px 16px rgba(47, 109, 34, 0.2);
}

.fertilizer-button:disabled {
  color: var(--muted);
  background: rgba(255, 253, 247, 0.86);
}

.land.growing .land-content {
  padding-bottom: 30px;
}

.control-panel {
  display: grid;
  gap: 14px;
}

.crop-list {
  display: grid;
  gap: 10px;
}

.crop-card {
  width: 100%;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 18px;
  color: var(--ink);
  background: var(--mint);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.crop-card.is-selected {
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(79, 143, 47, 0.12);
  background: #f8fff0;
}

.crop-card.is-locked {
  cursor: not-allowed;
  filter: grayscale(0.25);
  opacity: 0.68;
}

.crop-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.crop-emoji {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  font-size: 25px;
  background: #fff;
}

.crop-name {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

.crop-desc {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.crop-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.crop-meta span {
  min-width: 0;
  padding: 9px 7px;
  border-radius: 12px;
  color: var(--leaf-dark);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
}

.actions-panel {
  display: grid;
  gap: 10px;
}

.task-list,
.achievement-list,
.shop-grid,
.settings-grid,
.log-list {
  display: grid;
  gap: 10px;
}

.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.mini-card,
.shop-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--mint);
}

.mini-card h3,
.shop-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.mini-card p,
.shop-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mini-card small,
.shop-card small {
  display: inline-block;
  margin-top: 5px;
  color: var(--leaf-dark);
  font-weight: 800;
}

.mini-card.is-ready {
  border-color: rgba(223, 164, 21, 0.6);
  background: #fff8d9;
}

.mini-card.is-claimed,
.shop-card.is-claimed {
  background: #eef4e5;
  opacity: 0.78;
}

.mini-action {
  flex: 0 0 auto;
  width: auto;
  min-width: 104px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
}

.product-card {
  justify-content: flex-start;
}

.product-icon,
.shop-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  font-size: 28px;
  background: #fff;
}

.shop-card {
  align-items: stretch;
}

.shop-card > div:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  color: var(--leaf-dark);
  font-weight: 700;
  cursor: pointer;
  background: var(--leaf-soft);
}

.log-panel {
  margin-top: 14px;
}

.log-list {
  max-height: 420px;
  overflow: auto;
}

.log-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--mint);
}

.log-time {
  display: block;
  margin-bottom: 4px;
  color: var(--leaf-dark);
  font-size: 12px;
  font-weight: 800;
}

.log-text {
  color: var(--ink);
  line-height: 1.5;
}

.primary-button,
.full-button,
.danger-button {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
}

.primary-button {
  color: #fff;
  background: var(--leaf);
}

.danger-button {
  color: #7b2b18;
  background: #ffe1d8;
}

@media (max-width: 820px) {
  .page {
    padding-top: 10px;
  }

  .site-header,
  .hero,
  .farm-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
  }

  .games-link {
    width: 100%;
  }

  .status-cards,
  .coin-card {
    min-width: 0;
  }

  .farm-layout {
    gap: 12px;
  }

  .board-panel {
    order: 1;
  }

  .farm-layout > .status-cards {
    order: 2;
  }

  .farm-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guide-card,
  .weather-panel {
    display: grid;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    order: 3;
  }

  .section-head {
    align-items: flex-start;
  }

}

@media (max-width: 480px) {
  .brand-text strong {
    font-size: 15px;
  }

  .hero > div:first-child,
  .coin-card,
  .level-card,
  .board-panel,
  .seed-panel,
  .actions-panel,
  .decor-panel,
  .feature-panel,
  .guide-card,
  .weather-panel {
    border-radius: 18px;
  }

  .farm-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-card,
  .shop-card {
    display: grid;
  }

  .mini-action {
    width: 100%;
  }

  .land {
    border-radius: 16px;
  }

  .land-title {
    font-size: 13px;
  }

  .land-state {
    padding-inline: 7px;
    font-size: 11px;
  }

  .crop-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .crop-meta span {
    padding: 7px 5px;
    font-size: 15px;
  }
}
