﻿/* =========================================================
   方块后院防线 —— UI 样式
   视觉方向：体素 / 印刷感 / 暖纸色面板 + 深林绿底 + 阳光金
   ========================================================= */

:root {
  --ink: #16211b;
  --ink-soft: #2b3a2f;
  --paper: #f7f0dd;
  --paper-dim: #e8dfc7;
  --gold: #ffcd4a;
  --gold-deep: #e0a521;
  --green: #5c9a45;
  --green-deep: #2f5f31;
  --red: #c9523b;
  --sky: #bfe3f7;
  --shadow-hard: 6px 6px 0 rgba(8, 14, 10, 0.35);
  --shadow-soft: 0 18px 60px rgba(3, 8, 5, 0.45);
  --radius: 4px;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --font-display: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #101a15;
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 天空由 CSS 渐变提供（画布透明），按主题切换。 */
body[data-theme="lawn"] {
  background:
    radial-gradient(120% 80% at 74% 4%, rgba(255, 251, 224, 0.95) 0%, rgba(255, 251, 224, 0) 46%),
    linear-gradient(180deg, #dff1ff 0%, #bfe3f7 42%, #9fd3ea 76%, #7fb9d2 100%);
}
body[data-theme="roof"] {
  background:
    radial-gradient(120% 80% at 22% 6%, rgba(255, 238, 196, 0.95) 0%, rgba(255, 238, 196, 0) 50%),
    linear-gradient(180deg, #ffeccd 0%, #ffd7ab 46%, #f0b07f 80%, #d98f63 100%);
}
body[data-theme="dusk"] {
  background:
    radial-gradient(90% 70% at 18% 12%, rgba(255, 178, 122, 0.55) 0%, rgba(255, 178, 122, 0) 55%),
    linear-gradient(180deg, #8d7ab8 0%, #6e5f96 46%, #4b4270 78%, #332e52 100%);
}
body[data-theme="storm"] {
  background:
    radial-gradient(110% 70% at 50% 0%, rgba(160, 186, 224, 0.35) 0%, rgba(160, 186, 224, 0) 60%),
    linear-gradient(180deg, #52627f 0%, #35415f 44%, #232c44 78%, #161d2f 100%);
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

.is-hidden { display: none !important; }

/* ---------------------------------------------------------
   启动 / 致命错误
   --------------------------------------------------------- */
.boot-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 42%, #22362a 0%, #101a15 68%);
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 0.08em;
  z-index: 40;
  transition: opacity 0.35s ease;
}
.boot-screen.is-done { opacity: 0; pointer-events: none; }
.boot-cube {
  width: 42px;
  height: 42px;
  background: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: inset -10px -10px 0 rgba(0, 0, 0, 0.18), 6px 6px 0 rgba(0, 0, 0, 0.35);
  animation: hop 1.1s ease-in-out infinite;
}
@keyframes hop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(10deg); }
}

.fatal-panel {
  position: absolute;
  z-index: 60;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 40px));
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-hard);
  padding: 26px 28px;
}
.fatal-panel h2 { margin: 0 0 10px; font-size: 22px; }
.fatal-panel p { margin: 0 0 12px; line-height: 1.6; font-size: 14px; }
.fatal-panel pre {
  margin: 0;
  padding: 10px 12px;
  background: #efe7d2;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

/* ---------------------------------------------------------
   HUD
   --------------------------------------------------------- */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px clamp(14px, 3vw, 34px) 18px;
}
.hud > * { pointer-events: none; }
.hud button, .hud .seed-card, .hud .seed-tray { pointer-events: auto; }

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 18px;
}

.sun-meter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 12px;
  background: rgba(13, 21, 16, 0.86);
  border: 2px solid rgba(255, 205, 74, 0.5);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  min-width: 108px;
}
.sun-dot {
  width: 26px;
  height: 26px;
  background: var(--gold);
  border-radius: 3px;
  box-shadow: inset -5px -5px 0 rgba(160, 104, 0, 0.35), 0 0 14px rgba(255, 205, 74, 0.55);
  animation: sunPulse 2.6s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.sun-count {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffe9a3;
  letter-spacing: 0.02em;
}
.sun-meter.is-pulse .sun-count { animation: countPop 0.32s ease-out; }
@keyframes countPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); color: #fff; }
  100% { transform: scale(1); }
}

.level-block {
  justify-self: center;
  width: min(520px, 100%);
  text-align: center;
  padding: 8px 16px 9px;
  background: rgba(13, 21, 16, 0.56);
  border: 1px solid rgba(255, 205, 74, 0.28);
  border-radius: 8px;
  backdrop-filter: blur(3px);
}
.level-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
}
.level-chip {
  padding: 2px 8px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
  border-radius: 2px;
  letter-spacing: 0.06em;
}
#level-title {
  font-size: 17px;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.wave-bar {
  display: flex;
  gap: 4px;
  height: 9px;
  padding: 2px;
  background: rgba(10, 17, 13, 0.72);
  border: 1px solid rgba(247, 240, 221, 0.25);
  border-radius: 2px;
}
.wave-seg {
  flex: 1;
  background: rgba(247, 240, 221, 0.24);
  transition: background 0.25s ease;
}
.wave-seg.is-big { box-shadow: inset 0 0 0 1px rgba(255, 205, 74, 0.55); }
.wave-seg.is-filled { background: var(--gold); }
.wave-seg.is-current { background: #fff1b8; animation: segBlink 1.1s ease-in-out infinite; }
@keyframes segBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.wave-caption {
  margin-top: 5px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(247, 240, 221, 0.78);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  justify-self: end;
}
.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  color: var(--paper);
  background: rgba(13, 21, 16, 0.86);
  border: 2px solid rgba(247, 240, 221, 0.32);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.icon-btn.is-active { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.icon-btn.is-muted { color: rgba(247, 240, 221, 0.4); }

/* 底部卡槽 */
.toolbelt {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  width: 100%;
}
.seed-tray {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(13, 21, 16, 0.82);
  border: 2px solid rgba(247, 240, 221, 0.24);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}
.seed-card {
  position: relative;
  width: 96px;
  flex: 0 0 auto;
  padding: 8px 8px 10px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid #1a271f;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.12s ease, filter 0.2s ease;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.seed-card:hover { transform: translateY(-3px); }
.seed-card.is-selected {
  transform: translateY(-6px);
  box-shadow: 0 0 0 3px var(--gold), 6px 6px 0 rgba(0, 0, 0, 0.45);
}
.seed-card.is-poor { filter: grayscale(0.75) brightness(0.78); }
.seed-card.is-locked { cursor: not-allowed; }
.seed-icon {
  display: block;
  width: 100%;
  height: 52px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}
.seed-name {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seed-cost {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  background: #1d2a21;
  color: #ffe9a3;
  font-size: 11px;
  font-weight: 800;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.seed-key {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  color: rgba(22, 33, 27, 0.4);
}
.seed-cd {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0%;
  background: rgba(16, 26, 21, 0.58);
  pointer-events: none;
  transition: height 0.12s linear;
}
.seed-cd-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.shovel-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 16px;
  white-space: nowrap;
  flex: 0 0 auto;
  background: rgba(13, 21, 16, 0.86);
  color: var(--paper);
  border: 2px solid rgba(247, 240, 221, 0.3);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}
.shovel-btn:hover { border-color: var(--gold); }
.shovel-btn.is-active { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* 提示条 / 新手引导 */
.tip-banner {
  position: absolute;
  left: 50%;
  bottom: 148px;
  transform: translateX(-50%);
  padding: 9px 18px;
  background: rgba(13, 21, 16, 0.92);
  border-left: 4px solid var(--gold);
  border-radius: 3px;
  font-size: 13px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: tipIn 0.22s ease-out;
  z-index: 12;
}
.tip-banner.is-deny { border-left-color: var(--red); }
@keyframes tipIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.tutorial-card {
  position: absolute;
  left: clamp(14px, 3vw, 34px);
  bottom: 132px;
  width: min(330px, calc(100% - 28px));
  padding: 14px 16px 16px;
  background: rgba(247, 240, 221, 0.96);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-hard);
  border-radius: 4px;
  z-index: 12;
}
.tutorial-card::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  bottom: -3px;
  width: 6px;
  background: var(--green);
}
.tutorial-card p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}
.tutorial-dots {
  display: flex;
  gap: 5px;
}
.tutorial-dots span {
  width: 16px;
  height: 5px;
  background: rgba(22, 33, 27, 0.18);
}
.tutorial-dots span.is-done { background: var(--green); }
.tutorial-dots span.is-current { background: var(--gold-deep); }

.float-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.float-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 18px;
  color: #ffe9a3;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 12px rgba(255, 205, 74, 0.5);
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}
.float-text.is-bad { color: #ffb4a0; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
  25% { opacity: 1; transform: translate(-50%, -60%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}

/* ---------------------------------------------------------
   全屏界面
   --------------------------------------------------------- */
.screens {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.screen {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 48px);
  background: radial-gradient(circle at 50% 42%, rgba(12, 22, 16, 0.34) 0%, rgba(7, 12, 9, 0.76) 76%);
  backdrop-filter: blur(5px);
  overflow-y: auto;
}
.screen.is-hidden { display: none !important; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.screen-title { text-align: center; justify-content: center; }
.title-art {
  position: relative;
  width: 220px;
  height: 96px;
  margin-bottom: 18px;
}
.art-block {
  position: absolute;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}
.art-block.a1 { left: 8px; bottom: 0; width: 58px; height: 34px; background: var(--green); }
.art-block.a2 { left: 8px; bottom: 34px; width: 26px; height: 26px; background: #7cba58; }
.art-block.a3 { left: 100px; bottom: 0; width: 40px; height: 70px; background: #8d7cab; }
.art-block.a4 { left: 100px; top: 0; width: 40px; height: 26px; background: #a9bb84; }
.art-block.a5 { left: 152px; bottom: 0; width: 52px; height: 48px; background: #c25f4c; }
.art-sun {
  position: absolute;
  left: 60px;
  top: 2px;
  width: 34px;
  height: 34px;
  background: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: 0 0 24px rgba(255, 205, 74, 0.7);
  animation: sunPulse 3s ease-in-out infinite;
}
.screen-title h1 {
  margin: 0;
  font-size: clamp(46px, 9vw, 92px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  font-weight: 900;
  color: var(--paper);
  text-shadow: 4px 4px 0 #0f1a14, 8px 8px 0 rgba(0, 0, 0, 0.35);
}
.screen-title h1 em {
  font-style: normal;
  color: var(--gold);
  text-shadow: 4px 4px 0 #6b4a10, 8px 8px 0 rgba(0, 0, 0, 0.35);
}
.title-sub {
  margin: 18px 0 30px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: rgba(247, 240, 221, 0.82);
  max-width: 46ch;
  line-height: 1.7;
}
.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.title-foot {
  margin: 34px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(247, 240, 221, 0.42);
}

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 13px 26px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 3px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}
.btn:hover { transform: translate(-1px, -2px); box-shadow: 7px 8px 0 rgba(0, 0, 0, 0.42); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4); }
.btn-primary { background: var(--gold); }
.btn-primary:hover { background: #ffd96f; }
.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(247, 240, 221, 0.4);
  box-shadow: none;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* 选关 */
.screen-levels, .screen-help { justify-content: flex-start; padding-top: clamp(30px, 7vh, 72px); }
.screen-head {
  width: min(980px, 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.screen-head h2 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.level-grid {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 16px;
}
.level-card {
  position: relative;
  text-align: left;
  padding: 16px 16px 14px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.level-card:hover { transform: translateY(-4px); box-shadow: 7px 9px 0 rgba(0, 0, 0, 0.42); }
.level-card.is-locked { filter: grayscale(0.85) brightness(0.72); cursor: not-allowed; }
.level-card.is-locked:hover { transform: none; }
.level-card.is-endless { background: #20302a; color: var(--paper); border-color: #82b06a; }
.level-card.is-endless .level-index { color: rgba(255, 205, 74, 0.35); }
.level-index {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  color: rgba(22, 33, 27, 0.22);
  letter-spacing: -0.02em;
}
.level-name { font-size: 17px; font-weight: 800; margin: 6px 0 2px; }
.level-sub { font-size: 11px; opacity: 0.66; line-height: 1.5; }
.level-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.level-stars { font-size: 15px; letter-spacing: 2px; color: rgba(22, 33, 27, 0.18); }
.level-stars .on { color: var(--gold-deep); }
.level-card.is-endless .level-stars .on { color: var(--gold); }
.level-best { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; opacity: 0.6; }
.level-lock {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #4a3c2e;
  background: rgba(22, 33, 27, 0.1);
  padding: 3px 7px;
  border-radius: 2px;
}
.screen-note {
  width: min(980px, 100%);
  margin: 22px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(247, 240, 221, 0.52);
}

/* 结算 */
.result-card {
  width: min(460px, 100%);
  padding: 30px 32px 28px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-hard);
  text-align: center;
  animation: cardIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.result-card.compact { width: min(400px, 100%); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.result-card .eyebrow { color: var(--green-deep); }
.result-card h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 900;
  letter-spacing: 0.04em;
}
.stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 20px;
  font-size: 38px;
  line-height: 1;
}
.stars span { color: rgba(22, 33, 27, 0.14); }
.stars span.on {
  color: var(--gold-deep);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
  animation: starPop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes starPop {
  from { transform: scale(0.2) rotate(-25deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.result-stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0 0 24px;
  text-align: left;
  font-size: 13px;
}
.result-stats dt { color: rgba(22, 33, 27, 0.6); }
.result-stats dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.pause-hint {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(22, 33, 27, 0.66);
}

.result-card .result-actions { margin-top: 4px; }
.result-card .btn-ghost {
  color: var(--ink);
  border-color: rgba(22, 33, 27, 0.38);
}
.result-card .btn-ghost:hover { color: var(--green-deep); border-color: var(--green-deep); }

/* 说明页 */
.help-card {
  width: min(880px, 100%);
  padding: clamp(20px, 3.4vw, 34px);
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-hard);
}
.help-card .screen-head { margin-bottom: 18px; align-items: center; }
.help-card .eyebrow { color: var(--green-deep); }
.help-card .btn-ghost { color: var(--ink); border-color: rgba(22, 33, 27, 0.35); }
.help-card .btn-ghost:hover { color: var(--green-deep); border-color: var(--green-deep); }
.help-steps {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  counter-reset: step;
}
.help-steps li {
  position: relative;
  padding: 10px 12px 10px 44px;
  background: rgba(22, 33, 27, 0.05);
  border-left: 3px solid var(--green);
}
.help-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--green-deep);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
}
.help-steps strong { font-size: 14px; }
.help-steps p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.55; color: rgba(22, 33, 27, 0.72); }
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.help-grid h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(22, 33, 27, 0.5);
}
.roster { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.roster li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  padding: 5px 8px;
  background: rgba(22, 33, 27, 0.04);
}
.roster b { font-size: 12.5px; }
.roster span { color: rgba(22, 33, 27, 0.62); }
.help-card .screen-note { color: rgba(22, 33, 27, 0.55); margin-top: 18px; }

/* Toast */
.toast {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  font-size: 12.5px;
  font-weight: 700;
  z-index: 30;
  animation: tipIn 0.2s ease-out;
}

/* 竖屏提示 */
.rotate-hint {
  position: absolute;
  top: 124px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 15px;
  background: rgba(13, 21, 16, 0.9);
  border: 1px solid rgba(255, 205, 74, 0.5);
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.rotate-hint button {
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
@media (min-width: 821px), (orientation: landscape) {
  .rotate-hint { display: none !important; }
}

/* ---------------------------------------------------------
   响应式
   --------------------------------------------------------- */
@media (max-width: 860px) {
  .topbar { grid-template-columns: auto auto; grid-template-areas: "sun actions" "level level"; gap: 10px; }
  .sun-meter { grid-area: sun; }
  .topbar-actions { grid-area: actions; }
  .level-block { grid-area: level; width: 100%; }
  .seed-card { width: 82px; }
  .seed-icon { height: 42px; }
  .tutorial-card { left: 10px; bottom: 118px; width: min(290px, calc(100% - 20px)); padding: 11px 13px 13px; }
  .tip-banner { bottom: 128px; font-size: 12px; }
  .help-grid { grid-template-columns: 1fr; }
  .title-art { transform: scale(0.85); }
}

@media (max-width: 520px) {
  .hud { padding: 10px 10px 12px; }
  .sun-meter { min-width: 92px; padding: 6px 12px 6px 8px; }
  .sun-count { font-size: 22px; }
  .sun-dot { width: 20px; height: 20px; }
  .icon-btn { width: 36px; height: 36px; font-size: 13px; }
  .seed-tray { gap: 7px; padding: 8px; }
  .seed-card { width: 72px; padding: 6px; border-width: 2px; }
  .seed-icon { height: 34px; }
  .seed-name { font-size: 10.5px; }
  .seed-cost { font-size: 10px; }
  .shovel-btn { height: 44px; padding: 0 10px; font-size: 12px; }
  .toolbelt { gap: 8px; }
  .result-card { padding: 24px 20px; }
  .stars { font-size: 30px; }
  .title-actions .btn { padding: 11px 18px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}
