:root {
  --theme: #FF8A3D;
  --theme-deep: #E4671A;
  --theme-soft: #FFE2CB;
  --theme-glow: rgba(255, 138, 61, .38);
  --ink: #332417;
  --ink-2: #6F5945;
  --ink-3: #A18A73;
  --cream: #FFFBF3;
  --cream-2: #FFF4E5;
  --line: #EFDCC4;
  --gold: #F5B731;
  --gold-deep: #C88A10;
  --danger: #E9504D;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #2E4023;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

[hidden] { display: none !important; }

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #6FA94F;
}

.game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

/* ================= 顶部状态 ================= */
.hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20;
  padding: calc(var(--safe-t) + 8px) 13px 0;
  pointer-events: none;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 43px;
  padding: 0 9px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 253, 247, .97), rgba(255, 244, 229, .94));
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 5px 14px rgba(43, 27, 13, .22), inset 0 1px 0 #fff;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.hp-card {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 158px;
}

.hp-badge {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(180deg, #FF9B58, #E9504D);
  box-shadow: 0 3px 7px rgba(233, 80, 77, .35), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.hp-badge .mp-icon { width: 17px; height: 17px; }

.hp-bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 34px;
  height: 14px;
  border-radius: 7px;
  background: #E8D4BE;
  box-shadow: inset 0 2px 4px rgba(92, 56, 22, .25);
  overflow: hidden;
}
.hp-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: 7px;
  background: linear-gradient(180deg, #8FE07A, #4EB553 55%, #3B9A44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: width .28s cubic-bezier(.3, .8, .4, 1), background .3s;
}
.hp-bar > b {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 900;
  color: #fff;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(52, 77, 34, .7);
}

.gold-card { flex: 0 0 auto; padding-right: 10px; }
.coin-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A5B00;
  background: radial-gradient(circle at 34% 28%, #FFE58A, #FFC63F 58%, #E9A012);
  box-shadow: 0 2px 5px rgba(174, 116, 4, .34), inset 0 0 0 2px rgba(255, 255, 255, .34);
}
.coin-badge .mp-icon { width: 15px; height: 15px; }
.gold-txt { display: flex; flex-direction: column; line-height: 1.05; }
.gold-txt b { font-size: 14.5px; font-weight: 900; color: #7B4C05; }
.gold-txt small { font-size: 8.5px; font-weight: 700; color: #B08A54; letter-spacing: .01em; }
.gold-txt small.on { color: #E07A18; }

.wave-chip {
  flex: 0 0 auto;
  height: 43px;
  padding: 0 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  background: linear-gradient(180deg, #FFA65C, #F0721D 88%);
  border: 1px solid rgba(255, 255, 255, .38);
  box-shadow: 0 5px 14px rgba(217, 95, 21, .38), inset 0 1px 0 rgba(255, 255, 255, .5);
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
}
.wave-chip .mp-icon { width: 14px; height: 14px; opacity: .95; }

.icon-btn {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 253, 247, .97), rgba(255, 244, 229, .94));
  box-shadow: 0 5px 14px rgba(43, 27, 13, .22), inset 0 1px 0 #fff;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: transform .12s ease, box-shadow .12s ease;
}
.icon-btn .mp-icon { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.92); box-shadow: 0 2px 7px rgba(43, 27, 13, .2); }

.wave-dots {
  display: flex;
  gap: 5px;
  padding: 7px 3px 0;
}
.wave-dots i {
  flex: 1 1 0;
  height: 3.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 1px 2px rgba(30, 55, 18, .35);
  transition: background .25s ease, transform .25s ease;
}
.wave-dots i.done { background: #F0721D; }
.wave-dots i.now { background: #FFD9A8; animation: dotPulse 1.05s ease-in-out infinite; }
.wave-dots i.next { background: rgba(255, 255, 255, .78); }
@keyframes dotPulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(1.9); opacity: .72; }
}

/* ================= 横幅 / 提示 ================= */
.wave-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 33%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px) scale(.96);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, 1.2, .4, 1);
}
.wave-banner.show { opacity: 1; transform: translateY(0) scale(1); }
.wave-banner b {
  padding: 9px 18px;
  border-radius: 15px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .03em;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(55, 37, 22, .92), rgba(43, 28, 16, .94));
  border: 1px solid rgba(255, 190, 130, .45);
  box-shadow: 0 8px 22px rgba(30, 18, 8, .35), inset 0 1px 0 rgba(255, 255, 255, .16);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
.wave-banner b em { font-style: normal; color: #FFB872; }
.wb-line {
  flex: 0 1 40px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #FFB066);
}
.wb-line:last-child { background: linear-gradient(90deg, #FFB066, transparent); }

.toast {
  position: absolute;
  left: 50%;
  top: 22%;
  z-index: 40;
  transform: translate(-50%, -6px) scale(.94);
  width: max-content;
  max-width: 86%;
  white-space: nowrap;
  padding: 9px 16px;
  border-radius: 14px;
  background: rgba(47, 32, 19, .92);
  border: 1px solid rgba(255, 203, 158, .28);
  box-shadow: 0 8px 20px rgba(28, 17, 8, .3);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.hurt {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 74%, rgba(255, 40, 32, 0) 34%, rgba(213, 34, 28, .52) 100%);
  transition: opacity .45s ease;
}
.hurt.on { opacity: 1; transition: opacity .06s ease; }

/* ================= 建造面板 ================= */
.dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 7px 13px calc(var(--safe-b) + 10px);
  border-radius: 25px 25px 0 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #FFFCF6 0%, #FFF5E8 62%, #FFEFDD 100%);
  border-top: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 -9px 28px rgba(47, 29, 12, .2), inset 0 1px 0 #fff;
}

.dock-grip {
  width: 38px;
  height: 4px;
  margin: 0 auto 5px;
  border-radius: 3px;
  background: #E7D3BB;
}

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 27px;
  padding: 0 2px;
}
.dock-titles { min-width: 0; }
.dock-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: .01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dock-sub {
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wave-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  background: #FFEBD8;
  color: #C86A22;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .02em;
}

.build-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 6px;
}

.build-card {
  position: relative;
  height: 72px;
  padding: 6px 3px 5px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, #FFFFFF, #FFFBF4);
  box-shadow: 0 2px 0 #ECDBc7, 0 5px 9px rgba(88, 52, 18, .07);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--ink);
  font-family: inherit;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.build-card:active { transform: translateY(2px) scale(.985); box-shadow: 0 1px 0 #ECDBc7; }
.build-card.sel {
  border-color: var(--theme);
  background: linear-gradient(180deg, #FFFDF8, #FFF1E1);
  box-shadow: 0 0 0 2.5px rgba(255, 138, 61, .22), 0 2px 0 #E9BE9A, 0 6px 14px rgba(230, 103, 26, .18);
}
.build-card.sel::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme);
  box-shadow: 0 0 0 2px #fff;
}
.build-card.poor { opacity: .72; }
.build-card.poor .bc-icon { filter: grayscale(.42); opacity: .82; }
.build-card.poor .bc-name { color: #7D6A57; }
.build-card.poor.sel { opacity: .78; }
.build-card.hint {
  animation: cardHint 1.5s ease-in-out infinite;
  border-color: var(--theme);
}
@keyframes cardHint {
  0%, 100% { box-shadow: 0 2px 0 #ECDBc7, 0 5px 9px rgba(88, 52, 18, .07), 0 0 0 0 rgba(255, 138, 61, .0); }
  50% { box-shadow: 0 2px 0 #ECDBc7, 0 5px 9px rgba(88, 52, 18, .07), 0 0 0 4px rgba(255, 138, 61, .28); }
}

.bc-icon {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 3px 6px var(--cs), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.bc-icon .mp-icon { width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .22)); }
.bc-name { font-size: 11.5px; font-weight: 900; line-height: 1.1; }
.bc-cost {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--gold-deep);
  line-height: 1.1;
}
.bc-cost .mp-icon { width: 10px; height: 10px; }

.tower-panel {
  height: 72px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 7px 6px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: linear-gradient(180deg, #FFFFFF, #FFF8EE);
  box-shadow: 0 2px 0 #ECDBc7, inset 0 1px 0 #fff;
}
.tp-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(160deg, var(--c1, #FFB066), var(--c2, #E4671A));
  box-shadow: 0 4px 9px var(--cs, rgba(228, 103, 26, .32)), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.tp-icon .mp-icon { width: 24px; height: 24px; }
.tp-stats {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: space-around;
  gap: 2px;
}
.tp-stats div { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.tp-stats b { font-size: 13px; font-weight: 900; color: var(--ink); }
.tp-stats span { margin-top: 2px; font-size: 8px; font-weight: 700; color: var(--ink-3); }

.up-btn {
  flex: 0 0 auto;
  min-width: 70px;
  height: 44px;
  padding: 3px 10px;
  border: 0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  background: linear-gradient(180deg, #FFB066, #EE761F);
  box-shadow: 0 3px 0 #C25714, inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .12s ease, box-shadow .12s ease, opacity .15s ease;
}
.up-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #C25714; }
.up-btn b {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 10px;
  font-weight: 800;
  color: #FFF3C9;
}
.up-btn b .mp-icon { width: 10px; height: 10px; }
.up-btn.maxed { background: linear-gradient(180deg, #D8C6B2, #BFA78D); box-shadow: 0 3px 0 #A38A70; }
.up-btn.poor { opacity: .6; }

.sell-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 44px;
  padding: 0;
  border: 1.5px solid #EFDCC4;
  border-radius: 12px;
  background: #FFFBF4;
  color: #A58B70;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, background .15s ease;
}
.sell-btn:active { transform: scale(.94); background: #F8E9D8; }
.sell-btn .mp-icon { width: 17px; height: 17px; }

.dock-foot { margin-top: 7px; }
.wave-btn {
  position: relative;
  width: 100%;
  height: 53px;
  padding: 0 13px;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  color: #fff;
  font-family: inherit;
  text-align: left;
  background: linear-gradient(180deg, #FFAC60 0%, #FB8B33 42%, #ED6E1B 100%);
  box-shadow: 0 4px 0 #C25714, 0 9px 18px rgba(231, 105, 25, .32), inset 0 1px 0 rgba(255, 255, 255, .48);
  transition: transform .12s ease, box-shadow .12s ease, filter .15s ease;
}
.wave-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #C25714, 0 4px 10px rgba(231, 105, 25, .26); }
.wave-btn.ready { animation: btnBreathe 2.6s ease-in-out infinite; }
@keyframes btnBreathe {
  0%, 100% { box-shadow: 0 4px 0 #C25714, 0 9px 18px rgba(231, 105, 25, .30), inset 0 1px 0 rgba(255, 255, 255, .48); }
  50% { box-shadow: 0 4px 0 #C25714, 0 10px 26px rgba(255, 138, 61, .55), inset 0 1px 0 rgba(255, 255, 255, .58); }
}
.wb-play {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ED6E1B;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 5px rgba(139, 58, 5, .22), inset 0 -1px 0 rgba(0, 0, 0, .06);
}
.wb-play .mp-icon { width: 19px; height: 19px; }
.wb-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.wb-text b { font-size: 15px; font-weight: 900; letter-spacing: .01em; text-shadow: 0 1px 1px rgba(150, 63, 7, .25); }
.wb-text small { margin-top: 1px; font-size: 10px; font-weight: 700; color: rgba(255, 246, 232, .92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 0;
  background: rgba(255, 238, 210, .8);
  transition: width .3s linear;
}

.wave-btn.busy {
  background: linear-gradient(180deg, #F8ECD9, #EFDCC4);
  box-shadow: 0 3px 0 #D9C0A0, inset 0 1px 0 #fff;
  color: #8B6D4F;
  animation: none;
}
.wave-btn.busy .wb-play { color: #B09371; background: rgba(255, 255, 255, .72); }
.wave-btn.busy .wb-text b { color: #7B603F; text-shadow: none; }
.wave-btn.busy .wb-text small { color: #A3866A; }
.wave-btn.busy .wb-progress { background: linear-gradient(90deg, #FFB066, #F07A22); }
.wave-btn.busy:active { transform: none; box-shadow: 0 3px 0 #D9C0A0; }

/* ================= 弹层 ================= */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 21, 13, .58);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}
.sheet {
  width: 100%;
  max-width: 326px;
  padding: 27px 20px 19px;
  border-radius: 25px;
  background:
    radial-gradient(120% 80% at 50% 0%, #FFFFFF, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #FFFCF6, #FFF2E1);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 26px 54px rgba(17, 10, 5, .44), inset 0 1px 0 #fff;
  text-align: center;
  animation: sheetPop .24s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes sheetPop { from { opacity: .5; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.sheet-badge {
  width: 58px;
  height: 58px;
  margin: -55px auto 8px;
  border-radius: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(160deg, #FFAE64, #E96A1E);
  border: 3px solid #FFF6E8;
  box-shadow: 0 10px 22px rgba(219, 93, 17, .4), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.sheet-badge .mp-icon { width: 29px; height: 29px; }
.sheet-badge.danger { background: linear-gradient(160deg, #FF8D7E, #D83C36); box-shadow: 0 10px 22px rgba(190, 45, 39, .4); }
.sheet-badge.win { background: linear-gradient(160deg, #FFD56E, #F0A21F); box-shadow: 0 10px 22px rgba(213, 139, 12, .42); }
.sheet h2 { margin: 2px 0 6px; font-size: 21px; font-weight: 900; letter-spacing: .01em; }
.sheet p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.ov-stats { display: flex; gap: 7px; margin-top: 14px; }
.ov-stats div {
  flex: 1;
  padding: 9px 4px 8px;
  border-radius: 13px;
  background: linear-gradient(180deg, #FFF6E8, #FBEAD5);
  border: 1px solid #F1DDC5;
}
.ov-stats b { display: block; font-size: 18px; font-weight: 900; color: #D86A1A; line-height: 1.1; }
.ov-stats span { display: block; margin-top: 2px; font-size: 9.5px; font-weight: 700; color: var(--ink-3); }

.primary-btn {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #FFAC60, #EE741E);
  box-shadow: 0 4px 0 #C25714, 0 8px 16px rgba(231, 105, 25, .3), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .12s ease, box-shadow .12s ease;
}
.primary-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #C25714; }

.ghost-btn {
  width: 100%;
  height: 43px;
  margin-top: 9px;
  border: 1.5px solid #EBD7BF;
  border-radius: 14px;
  background: #FFFBF4;
  color: #8B6D4F;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  transition: transform .12s ease, background .15s ease;
}
.ghost-btn:active { transform: scale(.98); background: #F9EBD9; }

/* ================= 小屏适配 ================= */
@media (max-width: 370px) {
  .hud { padding-left: 10px; padding-right: 10px; }
  .hud-row { gap: 5px; }
  .stat { height: 40px; padding: 0 7px; border-radius: 13px; }
  .hp-card { max-width: 132px; }
  .hp-badge { width: 23px; height: 23px; border-radius: 8px; }
  .hp-badge .mp-icon { width: 15px; height: 15px; }
  .gold-txt b { font-size: 13.5px; }
  .wave-chip { height: 40px; padding: 0 8px; font-size: 10.5px; }
  .wave-chip .mp-icon { display: none; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .dock { padding-left: 10px; padding-right: 10px; }
  .build-card { height: 68px; }
  .tower-panel { height: 68px; gap: 5px; }
  .tp-icon { width: 42px; height: 42px; }
  .up-btn { min-width: 62px; padding: 3px 7px; }
  .wave-btn { height: 50px; }
  .wb-text b { font-size: 14px; }
}

@media (max-height: 700px) {
  .dock { padding-top: 6px; padding-bottom: calc(var(--safe-b) + 8px); }
  .dock-grip { margin-bottom: 3px; }
  .dock-head { min-height: 23px; }
  .dock-title { font-size: 14px; }
  .dock-sub { font-size: 10px; }
  .build-card { height: 63px; }
  .bc-icon { width: 28px; height: 28px; }
  .tower-panel { height: 63px; }
  .tp-icon { width: 40px; height: 40px; }
  .wave-btn { height: 47px; }
  .dock-foot { margin-top: 6px; }
  .build-row { margin-top: 5px; }
}

@media (max-height: 620px) {
  .hud { padding-top: calc(var(--safe-t) + 5px); }
  .stat, .wave-chip, .icon-btn { height: 38px; }
  .stat { height: 38px; }
  .build-card { height: 57px; }
  .bc-icon { width: 25px; height: 25px; border-radius: 8px; }
  .bc-icon .mp-icon { width: 15px; height: 15px; }
  .tower-panel { height: 57px; }
  .wave-btn { height: 43px; }
  .wb-play { width: 27px; height: 27px; }
  .wb-text b { font-size: 13px; }
}
