:root {
  --bg-1: #fce7f3;
  --bg-2: #ede9fe;
  --bg-3: #e0f2fe;
  --shell-bg: linear-gradient(180deg, #fff5fb 0%, #f5f3ff 48%, #ecfeff 100%);
  --ink: #3b235a;
  --ink-soft: #7c629e;
  --card-bg: rgba(255, 255, 255, 0.86);
  --card-border: rgba(216, 180, 254, 0.65);
  --pink: #f472b6;
  --pink-deep: #ec4899;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --gold: #f59e0b;
  --danger: #ef4444;
  --shadow-soft: 0 8px 24px rgba(139, 92, 246, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Rounded Mplus 1c", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(244, 114, 182, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.25) 0%, transparent 48%),
    radial-gradient(circle at 50% 90%, rgba(167, 139, 250, 0.26) 0%, transparent 50%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 52%, var(--bg-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 9:16 微信小程序竖屏外壳 */
.wx-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: min(100dvh, 860px);
  background: var(--shell-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(91, 33, 182, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.85) inset;
}

@media (min-width: 460px) {
  .wx-shell {
    border-radius: 28px;
    border: 3px solid rgba(255, 255, 255, 0.9);
  }
}

.wx-shell.fever-active {
  animation: shellFeverGlow 1.1s ease-in-out infinite alternate;
}

@keyframes shellFeverGlow {
  from {
    box-shadow:
      0 24px 60px rgba(236, 72, 153, 0.35),
      0 0 0 2px rgba(251, 191, 36, 0.85) inset;
  }
  to {
    box-shadow:
      0 24px 60px rgba(168, 85, 247, 0.42),
      0 0 0 3px rgba(56, 189, 248, 0.9) inset;
  }
}

/* 顶部微信导航栏 */
.wx-topbar {
  height: 46px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(216, 180, 254, 0.45);
  flex-shrink: 0;
  z-index: 15;
}

.wx-back-btn {
  text-decoration: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(243, 232, 255, 0.9);
  border: 1px solid rgba(192, 132, 252, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  transition: transform 0.14s ease, background 0.14s ease;
}

.wx-back-btn:active {
  transform: scale(0.94);
}

.wx-title {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
  flex: 1;
}

.wx-capsule {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(192, 132, 252, 0.48);
  border-radius: 999px;
  padding: 2px 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.cap-btn {
  border: none;
  background: transparent;
  width: 26px;
  height: 24px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background 0.14s ease, transform 0.12s ease;
}

.cap-btn:hover {
  background: rgba(233, 213, 255, 0.55);
}

.cap-btn:active {
  transform: scale(0.88);
}

.cap-sep {
  width: 1px;
  height: 13px;
  background: rgba(192, 132, 252, 0.45);
}

/* 主游戏舞台 */
.game-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 7px 10px 9px;
  gap: 6px;
}

/* HUD 顶部栏 */
.hud-top {
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.72fr;
  gap: 7px;
  flex-shrink: 0;
}

.hud-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 15px;
  padding: 5px 9px;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hud-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.best-mini {
  font-size: 9.5px;
  color: #a855f7;
  background: rgba(243, 232, 255, 0.9);
  padding: 1px 5px;
  border-radius: 999px;
}

.hud-score {
  font-size: 21px;
  line-height: 1.15;
  font-weight: 900;
  color: #db2777;
  font-variant-numeric: tabular-nums;
  transition: transform 0.12s ease;
}

.hud-score.pop {
  transform: scale(1.12);
}

.timer-card {
  align-items: center;
  text-align: center;
}

.hud-timer {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 900;
  color: #4f46e5;
  font-variant-numeric: tabular-nums;
}

.timer-card.fever {
  background: linear-gradient(135deg, #fef08a 0%, #fbcfe8 50%, #bae6fd 100%);
  border-color: #f59e0b;
  animation: pulseCard 0.75s ease-in-out infinite alternate;
}

.timer-card.fever .hud-label {
  color: #b45309;
}

.timer-card.fever .hud-timer {
  color: #be123c;
}

@keyframes pulseCard {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.next-card {
  align-items: center;
  padding: 3px 6px;
}

.next-preview-wrap {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(243, 232, 255, 0.75) 100%);
  border-radius: 50%;
  border: 1px dashed rgba(192, 132, 252, 0.7);
  margin-top: 1px;
}

#nextCanvas {
  width: 34px;
  height: 34px;
  display: block;
}

/* 动态订单条 */
.order-bar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(254, 243, 199, 0.78) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  border-radius: 14px;
  padding: 6px 10px 7px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.order-bar.completed {
  transform: scale(1.025);
  border-color: #10b981;
  background: linear-gradient(135deg, #d1fae5 0%, #fef08a 100%);
}

.order-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-icon {
  font-size: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
}

.order-texts {
  flex: 1;
  min-width: 0;
}

.order-title {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1px;
}

.order-reward {
  font-size: 10.5px;
  font-weight: 800;
  color: #d97706;
}

.order-prog-text {
  font-size: 10.5px;
  font-weight: 900;
  color: #7c3aed;
}

.order-prog-track {
  margin-top: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.24);
  overflow: hidden;
}

.order-prog-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #ec4899 55%, #a855f7 100%);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 画布主区域 */
.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.9) 0%, transparent 45%),
    radial-gradient(circle at 78% 72%, rgba(244, 114, 182, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(237, 233, 254, 0.6) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 2px 14px rgba(139, 92, 246, 0.08);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.fever-banner {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(90deg, #ec4899, #f59e0b, #8b5cf6);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.42);
  white-space: nowrap;
  pointer-events: none;
  animation: feverBounce 0.7s ease-in-out infinite alternate;
  z-index: 4;
}

@keyframes feverBounce {
  from { transform: translateX(-50%) scale(0.97); }
  to { transform: translateX(-50%) scale(1.04); }
}

.bomb-hint {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: rgba(239, 68, 68, 0.92);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.36);
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

.toast-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.4);
  pointer-events: none;
  z-index: 6;
  text-align: center;
  white-space: nowrap;
  animation: toastPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes toastPop {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(0.75); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 底部技能区 */
.skill-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.energy-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
}

.energy-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #7c3aed;
  flex-shrink: 0;
}

.energy-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(192, 132, 252, 0.25);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.energy-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 0%, #a855f7 55%, #f472b6 100%);
  transition: width 0.22s ease;
}

.energy-pct {
  font-size: 10px;
  font-weight: 900;
  color: var(--ink-soft);
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.skill-btn {
  position: relative;
  border: 1.8px solid rgba(216, 180, 254, 0.85);
  background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
  border-radius: 15px;
  padding: 6px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.12);
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.skill-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.skill-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.skill-btn.armed {
  border-color: #ec4899;
  background: linear-gradient(180deg, #fff1f2 0%, #fce7f3 100%);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.24), 0 6px 16px rgba(236, 72, 153, 0.25);
  transform: translateY(-2px);
}

.skill-btn.charged-flash {
  animation: skillPop 0.45s ease;
}

@keyframes skillPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.09); border-color: #f59e0b; }
  100% { transform: scale(1); }
}

.skill-emoji {
  font-size: 20px;
  line-height: 1.1;
}

.skill-name {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--ink);
}

.skill-desc {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.skill-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.35);
}

/* 遮罩与弹窗 */
.overlay {
  position: absolute;
  inset: 46px 0 0 0;
  background: rgba(59, 35, 90, 0.34);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 30;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: linear-gradient(180deg, #ffffff 0%, #fdf4ff 100%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 16px 15px 15px;
  box-shadow: 0 20px 50px rgba(88, 28, 135, 0.26);
  text-align: center;
}

.candy-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #9333ea;
  background: linear-gradient(90deg, #fce7f3, #ede9fe, #e0f2fe);
  border: 1px solid rgba(192, 132, 252, 0.55);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 0.6px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 52%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.hero-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 3px;
  margin-bottom: 11px;
}

/* 模式切换 */
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 11px;
}

.mode-btn {
  border: 2px solid rgba(216, 180, 254, 0.6);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.16s ease;
}

.mode-btn.active {
  border-color: #ec4899;
  background: linear-gradient(180deg, #fff1f2 0%, #fdf2f8 100%);
  box-shadow: 0 5px 14px rgba(236, 72, 153, 0.2);
  transform: translateY(-1px);
}

.mode-main {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink);
}

.mode-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 进化图鉴预览盒 */
.evo-box {
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid rgba(216, 180, 254, 0.65);
  border-radius: 16px;
  padding: 8px 8px 6px;
  margin-bottom: 10px;
}

.evo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 4px;
  padding: 0 2px;
}

.evo-tip {
  font-size: 10px;
  font-weight: 800;
  color: #ec4899;
}

#evoChainCanvas {
  width: 100%;
  height: auto;
  display: block;
}

.tips-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 9px;
}

.tip-chip {
  font-size: 10.5px;
  font-weight: 800;
  color: #6d28d9;
  background: rgba(243, 232, 255, 0.85);
  padding: 4px 8px;
  border-radius: 999px;
}

.start-best-row {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.start-best-row strong {
  color: #db2777;
  font-size: 14px;
}

/* 按钮样式 */
.primary-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #f472b6 0%, #a855f7 55%, #38bdf8 100%);
  box-shadow: 0 10px 22px rgba(168, 85, 247, 0.34);
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.primary-btn:active {
  transform: scale(0.97);
}

.pulse-btn {
  animation: ctaPulse 1.8s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 10px 22px rgba(168, 85, 247, 0.34); }
  50% { box-shadow: 0 12px 28px rgba(236, 72, 153, 0.48); }
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
  border: 2px solid rgba(192, 132, 252, 0.7);
  border-radius: 16px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 900;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
}

.secondary-btn:active {
  transform: scale(0.97);
}

.ghost-btn {
  display: inline-block;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  padding: 8px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.modal-actions.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
}

/* 暂停卡 */
.pause-card {
  max-width: 320px;
  padding: 22px 18px;
}

.pause-emoji {
  font-size: 40px;
  margin-bottom: 6px;
}

.modal-title {
  font-size: 21px;
  font-weight: 900;
  color: var(--ink);
}

.modal-desc {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* 结算报告卡 */
.report-card {
  padding: 16px 15px 15px;
}

.report-ribbon {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(90deg, #f59e0b, #ec4899);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.report-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 12px;
}

.report-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fdf2f8 0%, #f5f3ff 100%);
  border: 1.5px solid rgba(244, 114, 182, 0.45);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 10px;
  text-align: left;
}

.rank-stamp {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 55%, #8b5cf6 100%);
  box-shadow: 0 8px 18px rgba(236, 72, 153, 0.34);
  flex-shrink: 0;
  transform: rotate(-5deg);
}

.report-score-block {
  flex: 1;
}

.report-score-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.new-record-tag {
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  background: #ef4444;
  padding: 1px 6px;
  border-radius: 999px;
}

.report-score-val {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 900;
  color: #db2777;
  font-variant-numeric: tabular-nums;
}

.report-best-val {
  font-size: 11.5px;
  font-weight: 800;
  color: #7c3aed;
}

.highest-slime-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(192, 132, 252, 0.55);
  border-radius: 16px;
  padding: 8px 12px;
  margin-bottom: 10px;
  text-align: left;
}

#reportSlimeCanvas {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}

.highest-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.highest-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  margin: 1px 0;
}

.highest-tier {
  font-size: 11px;
  font-weight: 800;
  color: #a855f7;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(216, 180, 254, 0.55);
  border-radius: 14px;
  padding: 8px 4px;
}

.stat-num {
  font-size: 18px;
  font-weight: 900;
  color: #4f46e5;
}

.stat-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-top: 2px;
}
