/* ============ 星空农场 全局样式 ============ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #e7e9ff;
  background: radial-gradient(circle at 50% 30%, #171a3a, #0b0e20);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* ============ 顶部栏 ============ */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 8px;
  padding-left: 8px;
  background: linear-gradient(90deg, #22d3ee, #7c5cff 55%, #ff5ca8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(124, 92, 255, 0.45));
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  color: #dfe3ff;
  text-decoration: none;
  letter-spacing: 1px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.55);
  transform: translateY(-1px);
}

/* ============ 主布局 ============ */

.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 14px;
  padding: 0 16px;
}

/* ============ 农田舞台 ============ */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 70px rgba(124, 92, 255, 0.1);
}

#farm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
  cursor: pointer;
}

/* ============ HUD ============ */

.hud {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chip .k,
.chip .u {
  font-size: 12px;
  color: #9aa0c8;
  letter-spacing: 1px;
}

.chip .v {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chip-gold .v {
  color: #ffb347;
  text-shadow: 0 0 10px rgba(255, 179, 71, 0.55);
}

.v-cyan {
  color: #22d3ee !important;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
}

.v-pink {
  color: #ff5ca8 !important;
  text-shadow: 0 0 10px rgba(255, 92, 168, 0.6);
}

.w-icon {
  display: inline-flex;
  align-items: center;
}

.chip-event {
  border-color: rgba(255, 92, 168, 0.45);
  box-shadow: 0 0 16px rgba(255, 92, 168, 0.25);
  animation: chipPulse 1.2s ease-in-out infinite alternate;
}

@keyframes chipPulse {
  from { box-shadow: 0 0 10px rgba(255, 92, 168, 0.18); }
  to { box-shadow: 0 0 22px rgba(255, 92, 168, 0.5); }
}

/* 一天进度条 */

.day-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 4;
}

.day-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c5cff, #22d3ee);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
  transition: width 0.25s linear;
}

/* ============ 事件提示 ============ */

.toast-wrap {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 9px 20px;
  font-size: 14px;
  letter-spacing: 2px;
  color: #eef0ff;
  background: rgba(20, 23, 50, 0.82);
  border: 1px solid rgba(124, 92, 255, 0.5);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s ease, toastOut 0.4s ease 2.6s forwards;
  white-space: nowrap;
}

.toast.t-cyan { border-color: rgba(34, 211, 238, 0.6); color: #bdf4fb; }
.toast.t-pink { border-color: rgba(255, 92, 168, 0.6); color: #ffc4dd; }
.toast.t-amber { border-color: rgba(255, 179, 71, 0.65); color: #ffd9a3; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ============ 作物选择弹层 ============ */

.crop-pop {
  position: absolute;
  z-index: 8;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: rgba(23, 26, 58, 0.92);
  border: 1px solid rgba(124, 92, 255, 0.45);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 22px rgba(124, 92, 255, 0.18);
  animation: popIn 0.16s ease;
}

.crop-pop.col {
  flex-direction: column;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.crop-card {
  width: 132px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  color: #dfe3ff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.crop-card:hover {
  background: rgba(124, 92, 255, 0.16);
  border-color: rgba(124, 92, 255, 0.65);
  transform: translateY(-2px);
}

.crop-card.is-poor {
  opacity: 0.45;
  cursor: not-allowed;
}

.cc-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 7px;
}

.cc-line {
  display: block;
  font-size: 12px;
  line-height: 1.8;
  color: #9aa0c8;
  font-variant-numeric: tabular-nums;
}

.cc-line b {
  color: #d9dcf5;
  font-weight: 600;
}

/* 小色点 */

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.dot-wheat { background: #ffd86b; color: #ffd86b; }
.dot-corn { background: #ffc84d; color: #ffc84d; }
.dot-strawberry { background: #ff5ca8; color: #ff5ca8; }

/* ============ 侧边面板 ============ */

.sidebar {
  flex: 0 0 302px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 2px;
}

.glass-panel {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #eef0ff;
  margin-bottom: 12px;
}

.title-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-cyan { background: #22d3ee; box-shadow: 0 0 8px #22d3ee; }
.dot-purple { background: #7c5cff; box-shadow: 0 0 8px #7c5cff; }
.dot-amber { background: #ffb347; box-shadow: 0 0 8px #ffb347; }

/* 行情列表 */

.goods-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.goods-row:last-child {
  margin-bottom: 0;
}

.goods-info {
  flex: 1 1 auto;
  min-width: 0;
}

.goods-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.goods-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #858bb5;
  font-variant-numeric: tabular-nums;
}

.goods-price {
  font-size: 17px;
  font-weight: 700;
  color: #ffd86b;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 216, 107, 0.35);
}

.goods-trend {
  width: 52px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trend-up { color: #22d3ee; }
.trend-flat { color: #858bb5; }
.trend-down { color: #ff7b9c; }

.panel-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #858bb5;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

/* 商店列表 */

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.shop-item:last-child {
  margin-bottom: 0;
}

.shop-info {
  flex: 1 1 auto;
  min-width: 0;
}

.shop-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.shop-desc {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.5;
  color: #858bb5;
}

.btn-buy {
  flex: 0 0 auto;
  min-width: 82px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: linear-gradient(135deg, #8b6dff, #6a4bff);
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.btn-buy:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.btn-buy.is-off {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  color: #858bb5;
  cursor: default;
}

.btn-buy.is-poor {
  filter: grayscale(0.5) brightness(0.8);
  cursor: not-allowed;
}

/* 今日目标 */

.goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #b9bee5;
  font-variant-numeric: tabular-nums;
}

.goal-head b {
  color: #fff;
  font-size: 15px;
}

.goal-reward {
  color: #ffb347;
  font-size: 12px;
}

.goal-reward b {
  color: #ffb347;
}

.progress {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c5cff, #ffb347);
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.55);
  transition: width 0.35s ease;
}

.goal-status {
  margin-top: 9px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #9aa0c8;
}

.goal-status.done {
  color: #22d3ee;
}

.btn-restart {
  width: 100%;
  margin-top: 14px;
  padding: 9px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  color: #ff9db7;
  cursor: pointer;
  background: rgba(255, 92, 168, 0.08);
  border: 1px solid rgba(255, 92, 168, 0.3);
  border-radius: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-restart:hover {
  background: rgba(255, 92, 168, 0.18);
  border-color: rgba(255, 92, 168, 0.55);
}

/* ============ 遮罩面板 ============ */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 9, 22, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.panel {
  width: min(470px, 92%);
  padding: 36px 38px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 10px;
  padding-left: 10px;
  background: linear-gradient(90deg, #22d3ee, #7c5cff 55%, #ff5ca8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(124, 92, 255, 0.55));
}

.title-sm {
  font-size: 30px;
  letter-spacing: 6px;
  padding-left: 6px;
}

.desc {
  margin: 18px 0 16px;
  font-size: 14px;
  line-height: 1.9;
  color: #b9bee5;
}

.guide-list {
  list-style: none;
  margin: 0 0 24px;
  text-align: left;
}

.guide-list li {
  position: relative;
  padding: 7px 0 7px 22px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #c5c9ec;
}

.guide-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
}

.btn-primary {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 13px 36px;
  color: #ffffff;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, #8b6dff, #6a4bff);
  box-shadow: 0 8px 28px rgba(124, 92, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 12px 36px rgba(124, 92, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ============ 底部提示 ============ */

.tips {
  flex: 0 0 auto;
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: #858bb5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 响应式 ============ */

@media (max-width: 920px) {
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
  }

  .layout {
    flex-direction: column;
    overflow: visible;
    padding: 0 10px;
  }

  .stage {
    min-height: 58vh;
    height: 58vh;
  }

  .sidebar {
    flex: 1 1 auto;
    overflow: visible;
    padding-bottom: 4px;
  }

  .tips {
    white-space: normal;
    font-size: 11px;
    line-height: 1.7;
    padding: 10px 12px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 10px 14px;
  }

  .logo {
    font-size: 18px;
    letter-spacing: 5px;
  }

  .btn-ghost {
    padding: 8px 12px;
    font-size: 13px;
  }

  .hud {
    top: 10px;
    left: 10px;
    gap: 7px;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
  }

  .chip {
    padding: 6px 10px;
    border-radius: 12px;
  }

  .chip .v {
    font-size: 16px;
  }

  .crop-card {
    width: 118px;
  }

  .toast {
    font-size: 12px;
    letter-spacing: 1px;
    padding: 8px 16px;
  }

  .panel {
    padding: 28px 22px;
  }

  .title {
    font-size: 28px;
    letter-spacing: 5px;
  }
}
