:root {
  --orange: #FF8A3D;
  --orange-2: #FFA95E;
  --orange-deep: #F06A14;
  --orange-dark: #B84807;
  --gold: #FFC63D;
  --gold-deep: #E9A51B;
  --cream: #FFF6E2;
  --cream-2: #FFEBC7;
  --ink: #4A2A12;
  --ink-2: #7B4A24;
  --ink-3: #A57A52;
  --green: #5CC46A;
  --red: #E8462F;
  --shadow: 0 10px 24px rgba(126, 65, 12, 0.18);
  --shadow-soft: 0 4px 12px rgba(126, 65, 12, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body.sheet-open { overflow: hidden; }
body {
  margin: 0;
  background: #FFE7BB;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
button:active { transform: translateY(1px) scale(0.985); }
button:focus-visible { outline: 3px solid rgba(255, 138, 61, 0.55); outline-offset: 2px; }
.hidden { display: none !important; }

.bg-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 16px calc(env(safe-area-inset-bottom) + 18px);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* ---------- 顶部状态 ---------- */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}
.player-chip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  padding: 2px;
  background: linear-gradient(160deg, #FFF3C4, #FFB84D 55%, #F27A19);
  box-shadow: 0 3px 10px rgba(120, 60, 8, 0.25);
  flex: 0 0 auto;
  overflow: hidden;
}
.avatar-fallback, .avatar-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 13px;
  background: linear-gradient(180deg, #BFF0FF, #7CCBF4);
  overflow: hidden;
}
.avatar-fallback svg { width: 39px; height: 39px; display: block; }
.avatar-img { object-fit: cover; }
.player-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.player-meta strong {
  font-size: 12.5px;
  font-weight: 800;
  color: #5A2C0C;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}
.player-meta span { font-size: 9.5px; color: #9A6333; letter-spacing: 0.2px; }

.hud-right { display: flex; align-items: center; gap: 5px; }
.wallet-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 5px 0 5px;
  border: 2px solid #FFE0A0;
  border-radius: 19px;
  background: linear-gradient(180deg, #FFFDF4, #FFE8B9);
  box-shadow: 0 3px 10px rgba(120, 60, 8, 0.18), inset 0 1px 0 #FFF;
  color: #5A2C0C;
}
.wallet-pill b { font-size: 13px; font-weight: 900; letter-spacing: 0.1px; }
.wallet-pill i { font-style: normal; font-size: 9px; color: #9A6333; margin-left: 1px; }
.coin-ico {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
  background:
    radial-gradient(circle at 35% 30%, #FFF4B0 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #FFD85C 0 54%, #F3A81C 55% 72%, #FFE8A0 73% 100%);
  box-shadow: inset 0 -2px 3px rgba(160, 90, 0, 0.35), 0 1px 2px rgba(120, 60, 0, 0.2);
  position: relative;
}
.coin-ico::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid rgba(166, 94, 0, 0.5);
}
.coin-ico.tiny { width: 15px; height: 15px; vertical-align: -2px; }
.coin-ico.tiny::after { inset: 3px; border-width: 1px; }
.wallet-plus {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFD85C, #FF9E24);
  color: #6A3300;
  font-size: 13px;
  line-height: 15px;
  font-weight: 900;
  text-align: center;
  margin-left: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.invite-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 10px 0 8px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 19px;
  background: linear-gradient(180deg, #FFB25E, #FF7B25);
  color: #FFFDF6;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 1px rgba(150, 60, 0, 0.35);
  box-shadow: 0 4px 10px rgba(200, 90, 10, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.invite-pill .mp-icon { width: 18px; height: 18px; }

/* ---------- 主舞台 ---------- */
.stage { display: flex; flex-direction: column; gap: 11px; flex: 1; }

/* 当前最高龙 */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 86px;
  grid-template-rows: auto auto;
  gap: 3px 7px;
  padding: 10px 10px 9px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.15) 45%),
    linear-gradient(135deg, #FFF9E8 0%, #FFEDC4 52%, #FFD99B 100%);
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow), inset 0 1px 0 #FFF;
  overflow: hidden;
}
.hero-shine {
  position: absolute;
  width: 150px;
  height: 150px;
  left: -55px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent 68%);
  pointer-events: none;
}
.hero-dragon {
  grid-row: 1 / 3;
  align-self: center;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  filter: drop-shadow(0 5px 4px rgba(120, 60, 10, 0.22));
}
.hero-dragon .dragon-svg { width: 100%; height: 100%; }
.hero-main { min-width: 0; align-self: center; padding-top: 1px; }
.hero-title { display: flex; align-items: center; gap: 5px; min-width: 0; }
.hero-title > span {
  font-size: 14.5px;
  font-weight: 900;
  color: #5A2A0A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
.hero-tag {
  font-style: normal;
  font-size: 8px;
  line-height: 15px;
  padding: 0 5px;
  border-radius: 8px;
  color: #8A4A0A;
  background: linear-gradient(180deg, #FFE89C, #FFC94A);
  border: 1px solid rgba(190, 120, 10, 0.22);
  white-space: nowrap;
  flex: 0 0 auto;
}
.hero-output {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 4px;
  color: #8A5B33;
  font-size: 9.5px;
  white-space: nowrap;
}
.hero-output strong {
  font-size: 19px;
  line-height: 1;
  color: #E1570B;
  font-weight: 900;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 0 #FFF;
}
.hero-output em { font-style: normal; font-size: 9px; color: #A26B3B; }
.hero-sub {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  color: #8E6038;
  font-size: 9px;
  line-height: 1.25;
  min-height: 12px;
}
.hero-sub .mp-icon { width: 12px; height: 12px; flex: 0 0 auto; }
.hero-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-cta {
  grid-row: 1 / 2;
  grid-column: 3 / 4;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 62px;
  padding: 7px 5px;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 17px;
  background:
    radial-gradient(90% 70% at 20% 0%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(180deg, #FFB65F 0%, #FF8A3D 46%, #F26A12 100%);
  color: #FFFDF7;
  box-shadow: 0 6px 0 #C84F05, 0 10px 14px rgba(180, 70, 4, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 2px rgba(130, 50, 0, 0.4);
  flex-direction: column;
  line-height: 1.08;
}
.ad-cta:active { box-shadow: 0 3px 0 #C84F05, 0 6px 10px rgba(180, 70, 4, 0.25); transform: translateY(2px); }
.ad-play {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F06A14;
  box-shadow: 0 2px 4px rgba(140, 60, 0, 0.25);
}
.ad-play .mp-icon { width: 20px; height: 20px; margin-left: 1px; }
.ad-copy { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ad-copy b { font-size: 11.5px; font-weight: 900; letter-spacing: 0.3px; }
.ad-copy em { font-style: normal; font-size: 10px; font-weight: 700; opacity: 0.95; }
.ad-cta:disabled {
  filter: grayscale(0.7);
  background: linear-gradient(180deg, #D8CDBD, #B7A995);
  box-shadow: 0 4px 0 #948574, 0 7px 10px rgba(80, 50, 20, 0.16);
  color: #F8F2E6;
  text-shadow: none;
}
.ad-cta:disabled .ad-play { color: #9B8B78; }
.hero-foot {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 1px;
  font-size: 9px;
  color: #966137;
  white-space: nowrap;
}
.free-tag {
  font-size: 8.5px;
  font-weight: 800;
  color: #7A3A00;
  background: linear-gradient(180deg, #FFEBA4, #FFCE4D);
  border: 1px solid rgba(190, 120, 10, 0.28);
  border-radius: 7px;
  padding: 1px 4px;
  animation: freePulse 1.8s ease-in-out infinite;
}

/* ---------- 棋盘 ---------- */
.board-card {
  padding: 9px 9px 8px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 251, 238, 0.96), rgba(255, 238, 205, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow), inset 0 1px 0 #FFF;
}
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 7px;
  min-height: 32px;
}
.board-label { display: flex; align-items: center; gap: 5px; color: #6A3A13; }
.board-label .mp-icon { width: 17px; height: 17px; color: #D86A13; }
.board-label b { font-size: 14px; font-weight: 900; letter-spacing: 0.5px; }
.board-label > span {
  font-size: 9px;
  font-weight: 700;
  color: #8D5A2E;
  background: #F5DDB2;
  border-radius: 8px;
  padding: 1px 5px;
}
.board-tools { display: flex; align-items: center; gap: 5px; }

/* 五行收集进度 */
.element-track {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 2px 7px;
  min-height: 24px;
}
.element-track-label {
  font-size: 9px;
  font-weight: 800;
  color: #8A5A2E;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}
.element-chips { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.el-chip {
  flex: 1;
  min-width: 0;
  height: 22px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #B9A78E;
  background: rgba(255, 252, 242, 0.72);
  border: 1px solid #EBD8B4;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.el-chip.on { color: #FFFDF6; border-color: rgba(255, 255, 255, 0.5); transform: translateY(-1px); }
.el-chip.metal.on { background: linear-gradient(180deg, #FFE066, #E5A100); color: #5A3600; text-shadow: none; box-shadow: 0 2px 5px rgba(190, 130, 0, 0.32); }
.el-chip.wood.on { background: linear-gradient(180deg, #8BE08F, #2C9B4A); box-shadow: 0 2px 5px rgba(30, 130, 60, 0.3); }
.el-chip.water.on { background: linear-gradient(180deg, #7EC8FF, #246FD1); box-shadow: 0 2px 5px rgba(30, 100, 190, 0.3); }
.el-chip.fire.on { background: linear-gradient(180deg, #FF9A6A, #D52F18); box-shadow: 0 2px 5px rgba(190, 50, 20, 0.3); }
.el-chip.earth.on { background: linear-gradient(180deg, #D8B07A, #855526); box-shadow: 0 2px 5px rgba(120, 80, 30, 0.3); }
.element-track-count {
  flex: 0 0 auto;
  min-width: 26px;
  text-align: center;
  font-size: 9.5px;
  font-weight: 900;
  color: #8A5A2E;
  background: #F5DDB2;
  border-radius: 8px;
  padding: 1px 5px;
}
.element-track.all .element-track-count { color: #FFFDF6; background: linear-gradient(180deg, #FF9A3D, #E85E10); }

.gold-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  padding: 0 8px 0 5px;
  border: 1.5px solid #F1CB84;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFF9E8, #FFE5AE);
  color: #7A4517;
  font-size: 9.5px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(130, 70, 10, 0.1);
  white-space: nowrap;
}
.gold-pill .mp-icon { width: 15px; height: 15px; color: #E09413; }
.gold-pill:active { background: #FFE7B4; }
.gold-pill.is-done,
.gold-pill:disabled {
  background: linear-gradient(180deg, #EFE8DC, #DDD2BF);
  border-color: #D6C6AB;
  color: #8E7C66;
  box-shadow: none;
}
.gold-pill.is-done .mp-icon,
.gold-pill:disabled .mp-icon { color: #A28F75; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid #F1CB84;
  border-radius: 10px;
  background: linear-gradient(180deg, #FFF9E8, #FFE5AE);
  color: #9A5A1E;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 4px rgba(130, 70, 10, 0.1);
}
.icon-btn .mp-icon { width: 17px; height: 17px; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border-radius: 16px;
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
    linear-gradient(180deg, #F6D9A5 0%, #EFC886 100%);
  box-shadow: inset 0 3px 8px rgba(139, 82, 20, 0.18), inset 0 -2px 0 rgba(255, 255, 255, 0.45);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 30% 0%, rgba(255, 255, 255, 0.9), transparent 55%),
    linear-gradient(180deg, #FFF7DF 0%, #FCE9C4 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 3px 7px rgba(148, 88, 20, 0.14), 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  overflow: visible;
}
.cell.empty::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 18%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(173, 113, 44, 0.11);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.cell.selected {
  box-shadow: 0 0 0 3px #FFC63D, 0 0 16px rgba(255, 198, 61, 0.65), inset 0 3px 7px rgba(148, 88, 20, 0.1);
  transform: scale(1.035);
  z-index: 3;
}
.cell.drop-ok {
  background: linear-gradient(180deg, #FFF4C8, #FFDA8A);
  box-shadow: 0 0 0 3px #FF8A3D, 0 0 18px rgba(255, 138, 61, 0.55), inset 0 3px 7px rgba(148, 88, 20, 0.1);
  transform: scale(1.045);
  z-index: 4;
}
.cell.drag-source .dragon { opacity: 0.28; transform: scale(0.9); }
.cell.just-merged .dragon { animation: mergePop 0.46s cubic-bezier(0.2, 1.5, 0.4, 1); }
.cell.shake { animation: cellShake 0.34s ease; }
.cell .dragon {
  position: absolute;
  inset: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.12s, transform 0.12s;
}
.dragon-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dragon-normal .dragon-svg { filter: drop-shadow(0 2px 2px rgba(120, 50, 10, 0.18)); }
.dragon-high .dragon-svg {
  filter: drop-shadow(0 0 5px rgba(255, 190, 45, 0.75)) drop-shadow(0 2px 2px rgba(120, 50, 10, 0.18));
}
.dragon-special .dragon-svg {
  filter: drop-shadow(0 0 6px rgba(166, 106, 255, 0.8)) drop-shadow(0 2px 2px rgba(70, 20, 120, 0.25));
}
.dragon-element .dragon-svg { filter: drop-shadow(0 0 6px var(--aura, rgba(255, 190, 60, 0.75))); }
.dragon-dividend .dragon-svg {
  filter: drop-shadow(0 0 8px rgba(255, 198, 61, 0.95)) drop-shadow(0 0 18px rgba(255, 110, 30, 0.55));
  animation: dividendFloat 2.8s ease-in-out infinite;
}
.level-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 20px;
  height: 19px;
  padding: 0 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #8A5226, #5A2E0C);
  border: 1.5px solid #FFD978;
  color: #FFF5D6;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(70, 30, 0, 0.35);
  z-index: 2;
  white-space: nowrap;
}
.dragon-special .level-badge { background: linear-gradient(180deg, #8C5BE0, #4B2191); }
.dragon-dividend .level-badge { background: linear-gradient(180deg, #F05A2A, #A81D00); }
.dragon-element .level-badge { background: linear-gradient(180deg, #6B4321, #3A2008); }
.element-orb {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid #FFF9E3;
  color: #FFF;
  font-size: 9px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(60, 30, 0, 0.3);
  z-index: 2;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.element-orb.metal { background: linear-gradient(160deg, #FFE066, #E5A100); color: #5A3600; text-shadow: none; }
.element-orb.wood { background: linear-gradient(160deg, #8BE08F, #2C9B4A); }
.element-orb.water { background: linear-gradient(160deg, #7EC8FF, #246FD1); }
.element-orb.fire { background: linear-gradient(160deg, #FF9A6A, #D52F18); }
.element-orb.earth { background: linear-gradient(160deg, #D8B07A, #855526); }
.days-tag {
  position: absolute;
  left: -3px;
  bottom: -2px;
  font-size: 7.5px;
  font-weight: 800;
  line-height: 13px;
  padding: 0 4px;
  border-radius: 7px;
  color: #FFE9A8;
  background: rgba(74, 42, 18, 0.86);
  border: 1px solid rgba(255, 214, 120, 0.5);
  z-index: 2;
  white-space: nowrap;
}
.drag-ghost {
  position: fixed;
  z-index: 99;
  width: 74px;
  height: 74px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.12) rotate(-3deg);
  filter: drop-shadow(0 10px 10px rgba(70, 30, 0, 0.3));
  opacity: 0.96;
}
.drag-ghost .dragon { position: static; width: 100%; height: 100%; }
.drag-ghost .level-badge, .drag-ghost .element-orb, .drag-ghost .days-tag { transform: scale(1.05); }

.merge-elements {
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 13px;
  background:
    radial-gradient(90% 100% at 20% 0%, rgba(255, 255, 255, 0.6), transparent 55%),
    linear-gradient(90deg, #FFB52E, #FF7A2F 55%, #F2561C);
  color: #FFFDF4;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 0 #BB3E06, 0 8px 14px rgba(190, 70, 6, 0.28);
  text-shadow: 0 1px 2px rgba(120, 40, 0, 0.35);
  animation: elementGlow 1.8s ease-in-out infinite;
}
.merge-elements .mp-icon { width: 18px; height: 18px; }
.board-hint {
  margin-top: 6px;
  min-height: 14px;
  text-align: center;
  font-size: 9.5px;
  color: #94623A;
  letter-spacing: 0.15px;
  line-height: 1.35;
}
.board-hint.strong { color: #D95B0C; font-weight: 800; }

/* 回收 / 仓库入口 */
.board-func {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.func-btn {
  min-height: 46px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid #F1D6A4;
  border-radius: 13px;
  background: linear-gradient(180deg, #FFFDF4, #FFEDC9);
  color: #7A4517;
  box-shadow: 0 2px 4px rgba(130, 70, 10, 0.08), inset 0 1px 0 #FFF;
  text-align: left;
}
.func-btn:active { background: #FFE7B4; }
.func-btn.active {
  border-color: #FF8A3D;
  background: linear-gradient(180deg, #FFE8BC, #FFC46E);
  box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.2), 0 3px 7px rgba(190, 90, 10, 0.18);
}
.func-ico {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #FFF1CF, #FFD98C);
  border: 1px solid rgba(233, 165, 27, 0.28);
  color: #D87914;
}
.func-btn.active .func-ico {
  background: linear-gradient(180deg, #FF9A4D, #F26A12);
  border-color: #FFF0C8;
  color: #FFFDF6;
}
.func-ico .mp-icon { width: 18px; height: 18px; color: currentColor; }
.func-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; flex: 1; }
.func-copy b { font-size: 12px; font-weight: 900; color: #5A2A0A; letter-spacing: 0.3px; }
.func-copy small { font-size: 8.5px; font-weight: 700; color: #9A6A3E; white-space: nowrap; }
.func-btn.active .func-copy b { color: #A83E00; }
.func-btn.active .func-copy small { color: #B05010; }
.func-go { flex: 0 0 auto; display: flex; color: #C99A5C; }
.func-go .mp-icon { width: 15px; height: 15px; }

.recycle-tag {
  position: absolute;
  top: -4px;
  right: -3px;
  z-index: 4;
  padding: 0 4px;
  border-radius: 7px;
  border: 1.5px solid #FFF4D0;
  background: linear-gradient(180deg, #FFAD5A, #F25E12);
  color: #FFFDF6;
  font-size: 8px;
  font-weight: 900;
  line-height: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(150, 60, 0, 0.3);
  pointer-events: none;
}
.board.recycle-mode .cell:not(.empty) {
  box-shadow: 0 0 0 2px rgba(255, 112, 40, 0.32), inset 0 3px 7px rgba(148, 88, 20, 0.1);
}
.board.recycle-mode .cell:not(.empty) .dragon { animation: recycleWiggle 1.8s ease-in-out infinite; }
.cell.just-placed { animation: justPlaced 0.68s cubic-bezier(0.2, 1.3, 0.4, 1); z-index: 5; }

/* ---------- 金币 / 挂机 / 生产线 ---------- */
.coin-card {
  padding: 9px 10px 10px;
  border-radius: var(--radius);
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(255, 255, 255, 0.7), transparent 55%),
    linear-gradient(135deg, #FFF7E6 0%, #FFE8BE 100%);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow), inset 0 1px 0 #FFF;
}
.coin-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.coin-total > span { display: block; font-size: 9px; color: #8A5A2E; font-weight: 700; letter-spacing: 0.3px; }
.coin-total-amount { display: flex; align-items: baseline; gap: 2px; }
.coin-total-amount strong {
  font-size: 25px; line-height: 1.02; font-weight: 900; color: #E1570B;
  letter-spacing: -0.5px; text-shadow: 0 1px 0 #FFF;
}
.coin-total-amount em { font-style: normal; font-size: 9px; color: #9A6333; }
.coin-rate { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 0; }
.coin-rate span { font-size: 10px; font-weight: 800; color: #7A4517; white-space: nowrap; }
.coin-rate span b { color: #D95B0C; font-size: 12px; }
.coin-rate small { font-size: 8.5px; color: #9A6A3E; white-space: nowrap; }
.coin-rate small b { color: #C4550A; }
.coin-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.coin-tool {
  position: relative; min-height: 41px; padding: 3px 0 2px;
  border: 1.5px solid #F1D6A4; border-radius: 11px;
  background: linear-gradient(180deg, #FFFDF4, #FFEDC9);
  color: #7A4517; font-size: 9px; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  box-shadow: 0 2px 4px rgba(130, 70, 10, 0.08);
}
.coin-tool .mp-icon { width: 17px; height: 17px; color: #E08A2B; }
.coin-tool:active { background: #FFE7B4; }
.tool-dot {
  position: absolute; right: 5px; top: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: #E8462F; box-shadow: 0 0 0 2px #FFF7E2;
}
.tool-tag {
  position: absolute; right: 3px; top: 2px; font-style: normal; font-size: 7px; font-weight: 900;
  color: #FFFDF6; background: linear-gradient(180deg, #FF8A3D, #E8462F);
  border-radius: 5px; padding: 0 3px; line-height: 11px;
}
.contrib-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 7px; border-top: 1px dashed #EBCF9C;
}
.contrib-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.contrib-info > span { font-size: 9px; color: #8A5A2E; }
.contrib-info > span b { color: #D95B0C; font-size: 14px; }
.contrib-info small { font-size: 8.5px; color: #A07850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settle-btn {
  flex: 0 0 auto; min-height: 38px; padding: 0 10px;
  border: 2px solid rgba(255, 255, 255, 0.55); border-radius: 12px;
  background: linear-gradient(180deg, #FFB25E, #FF7B25);
  color: #FFFDF6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  box-shadow: 0 3px 0 #C84F05, 0 5px 8px rgba(180, 70, 4, 0.2);
  text-shadow: 0 1px 1px rgba(130, 50, 0, 0.3);
}
.settle-btn span { font-size: 11px; font-weight: 900; letter-spacing: 0.3px; }
.settle-btn small { font-size: 7.5px; font-weight: 600; opacity: 0.92; }
.settle-btn.dim { filter: grayscale(0.5); opacity: 0.82; }

/* 生产线弹层 */
.line-hero {
  border-radius: 18px; padding: 13px;
  background: linear-gradient(135deg, #FFF9EA, #FFE6BC);
  border: 1.5px solid #F0D5A4; text-align: center;
}
.line-hero > span { font-size: 10px; color: #95643A; }
.line-hero .line-big { display: block; font-size: 32px; font-weight: 900; color: #E1570B; line-height: 1.1; margin: 2px 0; }
.line-hero .line-big small { font-size: 10px; color: #A07850; font-weight: 700; }
.line-hero p { margin: 2px 0 0; font-size: 10px; color: #8A5A2E; }
.line-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.line-stat { background: #FFFCF2; border: 1.5px solid #F0DCB2; border-radius: 12px; padding: 8px 4px; text-align: center; }
.line-stat b { display: block; font-size: 16px; font-weight: 900; color: #D95B0C; line-height: 1.1; }
.line-stat span { font-size: 9px; color: #966A40; }

/* 图鉴 */
.codex-progress { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 10px; color: #7A4A22; }
.codex-progress b { font-size: 16px; color: #D95B0C; }
.codex-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.codex-cell {
  aspect-ratio: 1 / 1; border-radius: 9px; border: 1.5px solid #E7D6B7;
  background: #F4EAD6; color: #B9A78E; font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.codex-cell.on { color: #FFFDF6; background: linear-gradient(180deg, #FFB25E, #F26A12); border-color: #FFD29A; box-shadow: 0 2px 4px rgba(180, 70, 4, 0.18); }
.codex-cell.on.special { background: linear-gradient(180deg, #B68CFF, #5C3BB8); border-color: #D9C6FF; }
.codex-mile-list { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.codex-mile { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #FFF9EC; border: 1.5px solid #F0DCB2; border-radius: 12px; padding: 8px 10px; }
.codex-mile .mile-info { font-size: 10px; color: #7A4A22; line-height: 1.4; }
.codex-mile .mile-info b { color: #C4550A; }
.claim-btn {
  flex: 0 0 auto; min-height: 32px; padding: 0 9px; border: 0; border-radius: 10px;
  background: linear-gradient(180deg, #FFD15C, #FF9E24); color: #5A2A0A;
  font-size: 10px; font-weight: 900; box-shadow: 0 2px 0 #D07C05;
}
.claim-btn:disabled { background: #E3D6C1; color: #8E7C66; box-shadow: none; }

/* 仓库 */
.wh-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFF9EA, #FFE8BC);
  border: 1.5px solid #F0D5A4;
}
.wh-summary .wh-cap { display: flex; flex-direction: column; gap: 1px; flex: 0 0 auto; }
.wh-summary .wh-cap span { font-size: 9px; color: #95643A; }
.wh-summary .wh-cap b { font-size: 20px; line-height: 1.1; color: #E1570B; font-weight: 900; }
.wh-summary p { margin: 0; font-size: 9.5px; line-height: 1.45; color: #8A5A2E; text-align: right; }
.wh-empty-state {
  margin-top: 10px;
  padding: 17px 15px;
  border-radius: 17px;
  border: 1.5px dashed #E9D3A8;
  background: rgba(255, 252, 242, 0.72);
  text-align: center;
  color: #8A5A2E;
}
.wh-empty-state .mp-icon { width: 31px; height: 31px; color: #D7A45D; }
.wh-empty-state b { display: block; margin-top: 3px; font-size: 13px; color: #5A2A0A; }
.wh-empty-state p { margin: 3px 0 0; font-size: 9.5px; line-height: 1.5; color: #9A6A3E; }
.wh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.wh-item {
  min-height: 139px;
  padding: 7px 6px 6px;
  border-radius: 15px;
  background: #FFFCF2;
  border: 1.5px solid #F0DCB2;
  box-shadow: 0 2px 6px rgba(120, 70, 20, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wh-art { position: relative; width: 100%; height: 71px; flex: 0 0 auto; }
.wh-art .dragon { position: absolute; inset: 1px; }
.wh-name {
  width: 100%;
  text-align: center;
  font-size: 9.5px;
  font-weight: 900;
  color: #5A2A0A;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wh-sub { width: 100%; text-align: center; font-size: 8px; color: #A07850; line-height: 1.2; white-space: nowrap; }
.wh-take {
  width: 100%;
  min-height: 29px;
  margin-top: auto;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #FFD15C, #FF9E24);
  color: #5A2A0A;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 2px 0 #D07C05;
}
.wh-take:active { transform: translateY(1px) scale(0.99); }
.wh-empty {
  min-height: 139px;
  border-radius: 15px;
  border: 1.5px dashed #E7D6B7;
  background: rgba(255, 252, 242, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D3B98E;
}
.wh-empty .mp-icon { width: 21px; height: 21px; opacity: 0.65; }

/* 签到 */
.signin-streak { text-align: center; font-size: 11px; color: #7A4A22; margin-bottom: 2px; }
.signin-streak b { color: #D95B0C; font-size: 15px; }
.signin-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0 12px; }
.signin-day { border-radius: 10px; border: 1.5px solid #F0DCB2; background: #FFFCF2; padding: 6px 2px; text-align: center; }
.signin-day.done { background: #FFE9BE; }
.signin-day.today { border-color: #FF8A3D; background: #FFF1D6; box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.16); }
.signin-day .d { display: block; font-size: 8px; color: #966A40; white-space: nowrap; }
.signin-day .r { display: block; font-size: 9.5px; font-weight: 900; color: #D95B0C; white-space: nowrap; }
.signin-day .r small { font-size: 7px; font-weight: 700; color: #A07850; }

/* 活动 */
.activity-hero {
  position: relative; border-radius: 20px; padding: 15px 14px; overflow: hidden;
  background:
    radial-gradient(100% 120% at 0% 0%, rgba(255, 255, 255, 0.38), transparent 55%),
    linear-gradient(135deg, #FFB35B 0%, #FF7B25 60%, #E8462F 100%);
  color: #FFFDF7; box-shadow: 0 8px 18px rgba(200, 90, 10, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.activity-hero h4 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: 0.5px; }
.activity-hero p { margin: 3px 0 0; font-size: 10.5px; opacity: 0.92; }
.activity-timer { font-family: "SFMono-Regular", Consolas, monospace; font-size: 30px; font-weight: 900; text-align: center; letter-spacing: 1px; margin: 9px 0 2px; text-shadow: 0 2px 0 rgba(130, 50, 0, 0.2); }
.activity-state { text-align: center; font-size: 10px; font-weight: 700; opacity: 0.95; margin-bottom: 2px; }
.activity-badge { display: inline-block; margin-top: 7px; padding: 2px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.4); font-size: 9px; font-weight: 800; }

.end-dividend {
  display: flex; justify-content: space-between; gap: 6px;
  background: #FFFCF2; border: 1.5px solid #F0DCB2; border-radius: 12px;
  padding: 7px 9px; font-size: 9.5px; color: #8A5A2E; margin-bottom: 9px;
}
.end-dividend b { color: #D95B0C; }
.end-restart-btn { margin-top: 7px; min-height: 38px; font-size: 12px; border-radius: 13px; }

/* ---------- 收益 ---------- */
.wallet-card {
  display: flex;
  margin-top: auto;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #FFF9E9 0%, #FFEFC9 100%);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow), inset 0 1px 0 #FFF;
}
.coin-stack { width: 42px; height: 46px; position: relative; flex: 0 0 auto; }
.coin-stack i {
  position: absolute;
  left: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 35% 28%, #FFF4B0 0 15%, transparent 16%),
    radial-gradient(circle at 50% 50%, #FFD95E 0 52%, #F2A318 53% 72%, #FFE9A4 73% 100%);
  border: 1.5px solid #E5A018;
  box-shadow: inset 0 -2px 2px rgba(160, 90, 0, 0.35);
}
.coin-stack i:nth-child(1) { bottom: 0; left: 56%; }
.coin-stack i:nth-child(2) { bottom: 9px; left: 44%; }
.coin-stack i:nth-child(3) { bottom: 18px; left: 54%; }
.wallet-main { flex: 1; min-width: 0; }
.wallet-label { font-size: 9.5px; color: #8A5A2E; font-weight: 700; }
.wallet-amount { display: flex; align-items: baseline; gap: 2px; margin-top: -1px; }
.wallet-amount strong {
  font-size: 23px;
  line-height: 1.05;
  font-weight: 900;
  color: #E1570B;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 0 #FFF;
}
.wallet-amount em { font-style: normal; font-size: 10px; color: #9A6333; }
.progress {
  height: 7px;
  border-radius: 4px;
  background: #F2D8A8;
  box-shadow: inset 0 1px 2px rgba(130, 70, 10, 0.18);
  overflow: hidden;
  margin: 5px 0 3px;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #FFC94A, #FF8A3D 70%, #F26A12);
  box-shadow: 0 0 6px rgba(255, 138, 61, 0.5);
  transition: width 0.45s ease;
}
.wallet-main small { font-size: 8.8px; color: #9A6333; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.withdraw-btn {
  width: 78px;
  min-height: 56px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(180deg, #FFB25E, #FF7B25);
  color: #FFFDF6;
  box-shadow: 0 4px 0 #C84F05, 0 7px 12px rgba(180, 70, 4, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex: 0 0 auto;
  text-shadow: 0 1px 1px rgba(130, 50, 0, 0.3);
}
.withdraw-btn span { font-size: 14px; font-weight: 900; letter-spacing: 1px; }
.withdraw-btn small { font-size: 8px; font-weight: 600; opacity: 0.9; }
.withdraw-btn:disabled {
  background: linear-gradient(180deg, #DCD3C3, #B9AC99);
  box-shadow: 0 4px 0 #948574, 0 6px 10px rgba(80, 50, 20, 0.15);
  color: #F8F2E6;
  text-shadow: none;
  cursor: not-allowed;
}

/* ---------- 底部弹层 ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(58, 30, 8, 0.46);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 71;
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translate(-50%, 102%);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.25, 1);
  background:
    radial-gradient(120% 60% at 50% 0%, #FFFDF4 0%, #FFF6E2 55%, #FFF1D6 100%);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 30px rgba(70, 30, 0, 0.22);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #E7CFA6;
  margin: 2px auto 10px;
}
.sheet-body { padding-bottom: 2px; }
.sheet-body > .primary-btn { margin-top: 10px; }
.sheet-head { position: relative; padding: 0 34px 12px 2px; }
.sheet-head h3 { margin: 0; font-size: 19px; font-weight: 900; color: #5A2A0A; letter-spacing: 0.3px; }
.sheet-head p { margin: 3px 0 0; font-size: 11px; color: #95643A; line-height: 1.4; }
.sheet-close {
  position: absolute;
  right: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #F5E4C3;
  color: #8A5A2E;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sheet-close .mp-icon { width: 18px; height: 18px; }

.slot-list { display: flex; flex-direction: column; gap: 9px; }
.slot-card {
  border-radius: 16px;
  padding: 11px 12px 10px;
  background: #FFFCF2;
  border: 1.5px solid #F0DCB2;
  box-shadow: 0 2px 6px rgba(120, 70, 20, 0.06);
}
.slot-card.active {
  border-color: #FFB25E;
  background: linear-gradient(135deg, #FFF9EA, #FFF0CF);
  box-shadow: 0 3px 10px rgba(220, 120, 20, 0.12);
}
.slot-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.slot-name { font-size: 14px; font-weight: 900; color: #5A2A0A; }
.slot-range { font-size: 9.5px; color: #A07850; }
.slot-dots { display: flex; gap: 3px; margin: 8px 0 7px; }
.slot-dot { flex: 1; height: 5px; border-radius: 3px; background: #EEDDBB; }
.slot-dot.on { background: linear-gradient(90deg, #FFCB55, #FF8A3D); box-shadow: 0 0 3px rgba(255, 138, 61, 0.4); }
.slot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slot-status { font-size: 10px; color: #8A5A2E; }
.slot-status b { color: #D95B0C; font-size: 11px; }
.slot-action {
  min-width: 92px;
  height: 34px;
  padding: 0 11px;
  border-radius: 11px;
  border: 0;
  background: linear-gradient(180deg, #FFB25E, #FF7B25);
  color: #FFFDF6;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 3px 0 #C84F05, 0 5px 8px rgba(180, 70, 4, 0.2);
}
.slot-action:disabled {
  background: #E3D6C1;
  color: #8E7C66;
  box-shadow: none;
  cursor: not-allowed;
}
.sheet-note {
  margin-top: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #FFF2D7;
  color: #8A5A2E;
  font-size: 10px;
  line-height: 1.5;
}
.sheet-note b { color: #D95B0C; }

/* 邀请 */
.invite-hero {
  position: relative;
  border-radius: 20px;
  padding: 16px 14px;
  background:
    radial-gradient(100% 120% at 0% 0%, rgba(255, 255, 255, 0.38), transparent 55%),
    linear-gradient(135deg, #FFB35B 0%, #FF8A3D 48%, #F26A12 100%);
  color: #FFFDF7;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(200, 90, 10, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.invite-hero::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -40px;
  top: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42), transparent 68%);
}
.invite-hero h4 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: 0.5px; }
.invite-hero p { margin: 4px 0 12px; font-size: 10.5px; line-height: 1.45; opacity: 0.92; }
.invite-code-row { display: flex; align-items: center; gap: 8px; }
.invite-code {
  flex: 1;
  min-width: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  text-align: center;
  text-shadow: 0 1px 2px rgba(130, 50, 0, 0.25);
}
.invite-copy {
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  color: #C4550A;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.invite-actions { display: flex; gap: 8px; margin-top: 11px; }
.invite-actions button {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 0;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.invite-actions .primary-btn { height: 40px; min-height: 40px; font-size: 12px; box-shadow: 0 3px 0 #C84F05; }
.invite-actions .mp-icon { width: 16px; height: 16px; }
.ghost-btn {
  background: #FFF6E2;
  color: #8A5A2E;
  border: 1.5px solid #EFD7AD !important;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}
.stat {
  border-radius: 14px;
  padding: 9px 4px;
  background: #FFFCF2;
  border: 1.5px solid #F0DCB2;
  text-align: center;
}
.stat b { display: block; font-size: 17px; font-weight: 900; color: #D95B0C; line-height: 1.1; }
.stat span { font-size: 9px; color: #966A40; }
.rule-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #7A4A22;
  background: #FFF9EC;
  border-radius: 10px;
  padding: 8px 9px;
}
.rule-item .mp-icon { width: 15px; height: 15px; flex: 0 0 auto; color: #E08A2B; margin-top: 1px; }
.rule-item b { color: #C4550A; }

/* 提现 */
.withdraw-big {
  border-radius: 20px;
  padding: 15px 14px;
  background: linear-gradient(135deg, #FFF9EA, #FFEBC2);
  border: 1.5px solid #F3D9A7;
  text-align: center;
  margin-bottom: 12px;
}
.withdraw-big span { font-size: 10px; color: #95643A; }
.withdraw-big strong {
  display: block;
  margin: 2px 0 3px;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
  color: #E1570B;
  letter-spacing: -1px;
  text-shadow: 0 1px 0 #FFF;
}
.withdraw-big small { font-size: 10px; color: #A07850; }
.withdraw-big small b { color: #D95B0C; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 10.5px; font-weight: 800; color: #7A4A22; margin-bottom: 5px; }
.input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid #EAD2A6;
  background: #FFFDF7;
  padding: 0 12px;
  font-size: 14px;
  color: #4A2A12;
  outline: none;
}
.input:focus { border-color: #FFAA55; box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.16); }
.input::placeholder { color: #C3A784; }
.primary-btn {
  width: 100%;
  min-height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 15px;
  background:
    radial-gradient(90% 80% at 20% 0%, rgba(255, 255, 255, 0.5), transparent 60%),
    linear-gradient(180deg, #FFB25E, #FF7B25);
  color: #FFFDF6;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 0 #C84F05, 0 8px 14px rgba(180, 70, 4, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 2px rgba(130, 50, 0, 0.35);
}
.primary-btn:disabled {
  background: linear-gradient(180deg, #DCD3C3, #B9AC99);
  box-shadow: 0 4px 0 #948574;
  color: #F8F2E6;
  text-shadow: none;
  cursor: not-allowed;
}
.note { margin-top: 9px; text-align: center; font-size: 9px; line-height: 1.5; color: #A07850; }
.note b { color: #C4550A; }

/* ---------- 开始/结束 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.start-overlay {
  background:
    radial-gradient(90% 60% at 50% 18%, rgba(255, 246, 205, 0.45), transparent 68%),
    linear-gradient(180deg, rgba(54, 120, 190, 0.38), rgba(255, 176, 92, 0.5));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 85;
}
.start-card {
  width: 100%;
  max-width: 350px;
  text-align: center;
  padding: 20px 18px 16px;
  border-radius: 28px;
  background:
    radial-gradient(100% 70% at 50% 0%, #FFFDF4 0%, #FFF6E2 58%, #FFEDC9 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 45px rgba(90, 40, 4, 0.32), inset 0 1px 0 #FFF;
}
.start-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #9A5A1E;
  background: #FFEDC0;
  border: 1px solid #F3D18B;
  border-radius: 10px;
  padding: 3px 9px;
}
.start-dragon { width: 154px; height: 154px; margin: 3px auto -4px; filter: drop-shadow(0 8px 8px rgba(120, 60, 10, 0.2)); }
.start-dragon .dragon-svg { width: 100%; height: 100%; }
.start-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #FFB02E 0%, #F26512 55%, #C83E04 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #FFF1C9) drop-shadow(0 3px 3px rgba(150, 60, 0, 0.2));
}
.start-card > p { margin: 5px 0 14px; font-size: 12px; color: #8A5A2E; letter-spacing: 1px; }
.rules { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.rules > div {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(255, 252, 242, 0.82);
  border: 1.5px solid #F0DCB2;
  text-align: left;
}
.rules .mp-icon { width: 22px; height: 22px; color: #E08A2B; flex: 0 0 auto; }
.rules span { display: flex; flex-direction: column; font-size: 11px; font-weight: 800; color: #5A2A0A; }
.rules em { font-style: normal; font-size: 9.5px; font-weight: 500; color: #9A6A3E; margin-top: 1px; }
.start-card > small { display: block; margin-top: 10px; font-size: 9.5px; color: #A07850; }

.end-overlay {
  background: rgba(50, 24, 6, 0.56);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 84;
}
.end-card {
  width: 100%;
  max-width: 334px;
  text-align: center;
  padding: 22px 18px 16px;
  border-radius: 27px;
  background: radial-gradient(100% 70% at 50% 0%, #FFFDF4 0%, #FFF5DE 60%, #FFEBC4 100%);
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 45px rgba(40, 18, 2, 0.4), inset 0 1px 0 #FFF;
}
.end-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #FFF2A8, #FFC63D 55%, #EBA013);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A4A00;
  box-shadow: 0 5px 0 #C8860B, 0 8px 14px rgba(160, 100, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.end-icon .mp-icon { width: 33px; height: 33px; }
.end-card h2 { margin: 0; font-size: 24px; font-weight: 900; color: #5A2A0A; letter-spacing: 1px; }
.end-card > p { margin: 5px 0 14px; font-size: 11px; color: #8A5A2E; }
.end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; }
.end-stats > div { background: #FFFCF2; border: 1.5px solid #F0DCB2; border-radius: 14px; padding: 9px 4px; }
.end-stats b { display: block; font-size: 20px; font-weight: 900; color: #D95B0C; line-height: 1.1; }
.end-stats span { font-size: 9px; color: #966A40; }
.end-card > small { display: block; margin-top: 9px; font-size: 9px; color: #A07850; }

/* ---------- 广告/对话框 ---------- */
.ad-overlay {
  z-index: 90;
  background: rgba(30, 14, 46, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ad-box {
  width: 100%;
  max-width: 300px;
  border-radius: 24px;
  padding: 22px 18px 17px;
  text-align: center;
  background: linear-gradient(180deg, #3A2460, #1D1033);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color: #F6EEFF;
}
.ad-ring {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFD85C, #FF9E24);
  color: #6A3300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 7px rgba(255, 200, 80, 0.14), 0 0 22px rgba(255, 180, 50, 0.5);
  animation: adPulse 1.4s ease-in-out infinite;
}
.ad-ring .mp-icon { width: 33px; height: 33px; margin-left: 2px; }
.ad-box h3 { margin: 0; font-size: 18px; font-weight: 900; }
.ad-box p { margin: 5px 0 13px; font-size: 10.5px; color: #CFC0E8; }
.ad-progress { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.ad-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #FFD85C, #FF9E24);
  box-shadow: 0 0 8px rgba(255, 190, 60, 0.7);
}
.ad-box small { display: block; margin-top: 9px; font-size: 9px; color: #9F8FBE; }

.dialog-overlay {
  z-index: 95;
  background: rgba(50, 24, 6, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dialog {
  width: 100%;
  max-width: 312px;
  border-radius: 24px;
  padding: 20px 18px 16px;
  text-align: center;
  background: radial-gradient(100% 70% at 50% 0%, #FFFDF4, #FFF4DA);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 18px 45px rgba(40, 18, 2, 0.35);
}
.dialog-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #FFE9C2;
  color: #D95B0C;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialog-icon .mp-icon { width: 25px; height: 25px; }
.dialog h3 { margin: 0 0 6px; font-size: 18px; font-weight: 900; color: #5A2A0A; }
.dialog p { margin: 0 0 15px; font-size: 12px; line-height: 1.6; color: #7A4A22; word-break: break-word; }
.dialog-actions { display: flex; gap: 8px; }
.dialog-actions .primary-btn { flex: 1; min-height: 44px; font-size: 14px; }
.dialog-actions .ghost-btn { flex: 0 0 40%; min-height: 44px; font-size: 13px; font-weight: 800; border-radius: 15px; }
.withdraw-btn:disabled:active, .ad-cta:disabled:active, .slot-action:disabled:active, .primary-btn:disabled:active { transform: none; }

/* ---------- 提示/飘字 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 120;
  max-width: min(320px, calc(100vw - 40px));
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(60, 32, 12, 0.94);
  color: #FFF7E6;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 8px 22px rgba(40, 18, 2, 0.3);
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.float-reward {
  position: fixed;
  z-index: 100;
  color: #D95B0C;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 0 #FFF, 0 3px 8px rgba(120, 50, 0, 0.25);
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
}
.burst {
  position: fixed;
  width: 12px;
  height: 12px;
  z-index: 98;
  pointer-events: none;
}
.burst i {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFD24A;
  box-shadow: 0 0 8px #FFB02E;
  animation: particleFly 0.7s ease-out forwards;
  transform: rotate(var(--a)) translateX(0);
}
.burst i:nth-child(3n) { background: #FF7A2F; }
.burst i:nth-child(3n+1) { background: #FFF1A8; }

/* ---------- 动画 ---------- */
@keyframes mergePop {
  0% { transform: scale(0.55); opacity: 0.4; }
  55% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes cellShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-1deg); }
  45% { transform: translateX(4px) rotate(1deg); }
  70% { transform: translateX(-2px); }
}
@keyframes freePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes elementGlow {
  0%, 100% { box-shadow: 0 4px 0 #BB3E06, 0 8px 14px rgba(190, 70, 6, 0.28), 0 0 0 rgba(255, 190, 60, 0); }
  50% { box-shadow: 0 4px 0 #BB3E06, 0 8px 14px rgba(190, 70, 6, 0.28), 0 0 18px rgba(255, 190, 60, 0.75); }
}
@keyframes dividendFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes adPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}
@keyframes particleFly {
  0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(0.2); }
}
@keyframes recycleWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-2.5deg) scale(1.02); }
  75% { transform: rotate(2.5deg) scale(1.02); }
}
@keyframes justPlaced {
  0% { transform: scale(0.62); }
  55% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 400px) {
  .player-meta strong { max-width: 70px; font-size: 12px; }
  .wallet-plus { display: none; }
  .wallet-pill b { font-size: 12.5px; }
  .coin-ico { width: 22px; height: 22px; }
  .invite-pill { font-size: 10px; padding: 0 8px; }
  .invite-pill .mp-icon { width: 17px; height: 17px; }
}

@media (max-width: 374px) {
  .app { padding-left: 12px; padding-right: 12px; gap: 9px; }
  .hud { gap: 5px; }
  .player-meta strong { max-width: 66px; font-size: 12px; }
  .player-meta span { font-size: 8.5px; }
  .wallet-pill { height: 35px; padding-right: 4px; }
  .wallet-pill b { font-size: 12.5px; }
  .wallet-plus { display: none; }
  .invite-pill { height: 35px; padding: 0 8px; font-size: 10px; }
  .hero { grid-template-columns: 70px minmax(0, 1fr) 76px; padding: 8px; gap: 2px 5px; }
  .hero-dragon { width: 70px; height: 70px; }
  .hero-title > span { font-size: 12.5px; }
  .hero-output strong { font-size: 17px; }
  .ad-cta { min-height: 56px; }
  .ad-copy b { font-size: 10.5px; }
  .ad-copy em { font-size: 9px; }
  .board { gap: 5px; padding: 6px; }
  .board-label b { font-size: 13px; }
  .gold-pill { font-size: 8.5px; padding-right: 6px; }
  .wallet-card { padding: 9px; gap: 7px; }
  .coin-card { padding: 8px 8px 9px; }
  .coin-total-amount strong { font-size: 22px; }
  .coin-tool { min-height: 38px; font-size: 8.5px; }
  .coin-tool .mp-icon { width: 16px; height: 16px; }
  .func-btn { min-height: 43px; padding: 4px 7px; gap: 6px; }
  .func-ico { width: 27px; height: 27px; border-radius: 9px; }
  .func-copy b { font-size: 11.5px; }
  .func-copy small { font-size: 8px; }
  .wh-art { height: 64px; }
  .wh-item, .wh-empty { min-height: 130px; }
  .coin-stack { width: 34px; transform: scale(0.9); transform-origin: left center; }
  .wallet-amount strong { font-size: 20px; }
  .withdraw-btn { width: 70px; min-height: 52px; }
  .withdraw-btn span { font-size: 13px; }
  .start-card { padding: 16px 14px 14px; }
  .start-dragon { width: 132px; height: 132px; }
  .start-card h1 { font-size: 27px; }
}

@media (max-width: 340px) {
  .player-meta span { display: none; }
  .player-meta strong { max-width: 52px; }
  .invite-pill span { display: none; }
  .invite-pill { padding: 0 8px; }
  .wallet-pill { padding-right: 3px; }
  .element-track-label { display: none; }
  .element-chips { gap: 3px; }
  .el-chip { height: 21px; font-size: 9.5px; }
}

@media (max-height: 740px) {
  .app { gap: 8px; padding-top: calc(env(safe-area-inset-top) + 7px); padding-bottom: calc(env(safe-area-inset-bottom) + 10px); }
  .hero { padding-top: 8px; padding-bottom: 7px; }
  .hero-dragon { width: 74px; height: 74px; }
  .hero { grid-template-columns: 76px minmax(0, 1fr) 82px; }
  .board-card { padding-top: 7px; padding-bottom: 6px; }
  .board { gap: 5px; padding: 6px; }
  .coin-card { padding-top: 8px; padding-bottom: 8px; }
  .coin-tools { margin-top: 6px; }
  .contrib-row { margin-top: 6px; padding-top: 6px; }
  .wallet-card { padding-top: 8px; padding-bottom: 8px; }
  .start-dragon { width: 112px; height: 112px; }
  .start-card { padding-top: 15px; }
  .start-card h1 { font-size: 25px; }
  .start-card > p { margin-bottom: 10px; }
  .rules { gap: 5px; margin-bottom: 11px; }
  .rules > div { padding: 6px 9px; }
}

@media (min-width: 500px) {
  .app { padding-top: 18px; }
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .start-card h1 { color: #E1570B; background: none; filter: drop-shadow(0 2px 0 #FFF1C9); }
}
