/* 城堡守卫战 · 卡通塔防 */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E9641A;
  --orange-dark: #A8430D;
  --gold: #FFC94D;
  --cream: #FFF4DE;
  --ink: #2A1A0E;
  --green-dark: #122319;
  --glass: rgba(30, 21, 13, 0.62);
  --line: rgba(255, 240, 214, 0.16);
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0a130c;
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  justify-content: center;
  background:
    radial-gradient(90% 60% at 50% 0%, #1c3a24 0%, #0d1b12 55%, #070d08 100%);
}

button { font-family: inherit; border: 0; background: none; color: inherit; padding: 0; cursor: pointer; }

.stage {
  position: relative;
  width: min(100vw, 520px, 55vh);
  width: min(100vw, 520px, 55dvh);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #3f8c4b;
  isolation: isolate;
}

@media (min-width: 560px) {
  .stage {
    box-shadow: 0 0 0 1px rgba(255, 220, 160, 0.08), 0 30px 80px rgba(0, 0, 0, 0.55);
  }
}

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

.hidden { display: none !important; }

/* ---------- 顶部 HUD ---------- */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}

.hud-left, .hud-right { display: flex; align-items: center; gap: 6px; }

.stat-pill {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(36, 25, 15, 0.88), rgba(24, 16, 9, 0.9));
  border: 1px solid rgba(255, 226, 178, 0.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #FFF2DA;
  font-variant-numeric: tabular-nums;
}
.stat-pill b { font-weight: 800; }
.stat-pill .mp-icon { width: 17px; height: 17px; }
.stat-lives .mp-icon { color: #FF5F6D; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.stat-gold .mp-icon { color: var(--gold); }
.stat-wave {
  padding: 0 9px;
  font-size: 11.5px;
  color: #FFE3B8;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.stat-lives.low { animation: lowPulse 0.9s ease-in-out infinite; border-color: rgba(255, 95, 109, 0.65); }
@keyframes lowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 80, 90, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 80, 90, 0.22); }
}

.hud-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(36, 25, 15, 0.9), rgba(24, 16, 9, 0.92));
  border: 1px solid rgba(255, 226, 178, 0.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #FFE8C4;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: transform 0.08s ease, background 0.15s ease;
}
.hud-btn .mp-icon { width: 18px; height: 18px; }
.hud-btn:active { transform: scale(0.92); background: rgba(255, 138, 61, 0.24); }
.hud-btn.active { color: #FFD27C; border-color: rgba(255, 184, 94, 0.6); }

/* ---------- 波次条 ---------- */
.wavebar {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(300px, calc(100% - 44px));
  height: 48px;
  z-index: 7;
  overflow: hidden;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(42, 28, 15, 0.92), rgba(25, 16, 8, 0.95));
  border: 1px solid rgba(255, 206, 132, 0.32);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #FFF1D6;
  text-align: left;
  transition: transform 0.12s ease, opacity 0.2s ease;
  pointer-events: auto;
}
.wavebar:active { transform: translateX(-50%) scale(0.975); }
.wavebar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 138, 61, 0.22), rgba(255, 173, 72, 0.36));
  border-right: 1px solid rgba(255, 198, 112, 0.4);
  transition: width 0.2s linear;
  pointer-events: none;
}
.wavebar-main {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
}
.wavebar-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.wavebar-txt b { font-size: 13px; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.wavebar-txt small { font-size: 10px; color: rgba(255, 233, 199, 0.62); margin-top: 2px; white-space: nowrap; }
.wavebar-cta {
  flex: none;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  color: #43210A;
  background: linear-gradient(180deg, #FFD781, #FFAD45);
  box-shadow: 0 2px 0 #B45C12, inset 0 1px 0 rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.wavebar-cta em { font-style: normal; color: #8A3803; }
.wavebar-cta.off { display: none; }
.wavebar.hide-ui { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(16px); }

/* ---------- 波次横幅 ---------- */
.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  z-index: 9;
  text-align: center;
  pointer-events: none;
  padding: 0 20px;
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #FFF2CE;
  text-shadow: 0 2px 0 #8C3D0A, 0 4px 0 rgba(90, 36, 4, 0.7), 0 14px 30px rgba(0, 0, 0, 0.5);
  animation: bannerPop 1.45s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.banner small { display: block; margin-top: 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: #FFC96A; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
@keyframes bannerPop {
  0% { opacity: 0; transform: translateY(16px) scale(0.86); }
  14% { opacity: 1; transform: translateY(0) scale(1.04); }
  22% { transform: scale(1); }
  76% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-12px) scale(0.98); }
}

/* ---------- 提示 ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: calc(62px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 12;
  max-width: calc(100% - 48px);
  padding: 8px 13px;
  border-radius: 11px;
  background: rgba(22, 15, 9, 0.9);
  border: 1px solid rgba(255, 210, 140, 0.26);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  color: #FFE9C8;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  animation: toastIn 0.24s ease both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- 建造面板 ---------- */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  transform: translateY(112%);
  transition: transform 0.26s cubic-bezier(0.22, 0.9, 0.28, 1);
  background: linear-gradient(180deg, rgba(38, 26, 15, 0.97), rgba(20, 13, 8, 0.99));
  border-top: 1px solid rgba(255, 208, 138, 0.32);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  max-height: 66%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet.open { transform: translateY(0); }
.sheet-grip {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  margin: 0 auto 8px;
  background: rgba(255, 224, 178, 0.24);
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-kicker { margin: 0 0 2px; font-size: 10px; font-weight: 800; letter-spacing: 0.18em; color: var(--orange); text-transform: uppercase; }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: 0.02em; color: #FFF3DC; }
.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E7D3B4;
  flex: none;
  transition: transform 0.08s ease, background 0.15s ease;
}
.sheet-close:active { transform: scale(0.9); background: rgba(255, 138, 61, 0.2); }
.sheet-close .mp-icon { width: 18px; height: 18px; }
.sheet-body { margin-top: 10px; }

.build-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tower-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 4px 9px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 246, 226, 0.09), rgba(255, 246, 226, 0.03));
  border: 1px solid rgba(255, 232, 194, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.09s ease, border-color 0.15s ease, background 0.15s ease;
}
.tower-card:active { transform: scale(0.955); background: rgba(255, 138, 61, 0.16); }
.tower-card .tower-thumb { width: 48px; height: 48px; margin-bottom: 2px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35)); }
.tc-name { font-size: 12px; font-weight: 800; color: #FFF1D5; letter-spacing: 0.02em; }
.tc-role { font-size: 9px; color: rgba(255, 235, 204, 0.5); letter-spacing: 0.02em; }
.tc-cost {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  color: #FFD376;
  font-variant-numeric: tabular-nums;
}
.coin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE69B, #FFC23F 60%, #D68A12);
  box-shadow: inset 0 0 0 1px rgba(130, 74, 4, 0.5);
  display: inline-block;
  flex: none;
}
.tower-card.locked { opacity: 0.44; }
.tower-card.locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(10, 8, 5, 0.16);
}
.tower-card.locked .tc-cost { color: #FF8A8A; }

.tower-detail { display: flex; align-items: center; gap: 12px; }
.tower-detail .tower-thumb { width: 62px; height: 62px; flex: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)); }
.td-info { flex: 1; min-width: 0; }
.td-info h4 { margin: 0; font-size: 16px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.td-info h4 em { font-style: normal; font-size: 10px; font-weight: 800; color: #43210A; background: linear-gradient(180deg, #FFD781, #FFAD45); padding: 2px 7px; border-radius: 6px; }
.td-stats { display: flex; gap: 10px; margin-top: 5px; flex-wrap: wrap; }
.td-stat { font-size: 10px; color: rgba(255, 236, 205, 0.55); line-height: 1.3; }
.td-stat b { display: block; font-size: 12.5px; color: #FFF0D2; font-weight: 800; font-variant-numeric: tabular-nums; }
.td-stat b i { font-style: normal; color: #7BEA9A; font-size: 10px; margin-left: 2px; }

.td-actions { display: flex; gap: 8px; margin-top: 12px; }
.upgrade-btn, .sell-btn {
  height: 46px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.upgrade-btn {
  flex: 1;
  color: #FFF7E6;
  background: linear-gradient(180deg, #FFA750, #F2761E 70%, #E56412);
  border: 1px solid rgba(255, 198, 126, 0.65);
  box-shadow: 0 3px 0 #A8430D, 0 6px 14px rgba(240, 100, 20, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.upgrade-btn:active, .sell-btn:active { transform: translateY(2px) scale(0.99); }
.upgrade-btn.cant { filter: saturate(0.4) brightness(0.75); }
.upgrade-btn.maxed { background: rgba(255, 255, 255, 0.08); box-shadow: none; border-color: rgba(255, 255, 255, 0.14); color: rgba(255, 236, 205, 0.5); }
.sell-btn {
  flex: none;
  padding: 0 18px;
  color: #EAD8BC;
  background: rgba(255, 246, 226, 0.07);
  border: 1px solid rgba(255, 234, 198, 0.14);
}
.sell-btn small { font-size: 11px; color: #FFD376; font-weight: 800; }
.sheet-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 234, 200, 0.42);
  letter-spacing: 0.03em;
}

/* ---------- 全屏界面 ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.start-screen {
  justify-content: flex-start;
  padding: calc(22px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(6, 12, 8, 0.82) 0%, rgba(6, 12, 8, 0.58) 36%, rgba(6, 12, 8, 0.1) 66%, rgba(6, 12, 8, 0.4) 100%);
}
.start-inner {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: startRise 0.55s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes startRise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.crest {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFE3AE;
  background:
    radial-gradient(80% 70% at 50% 22%, rgba(255, 196, 102, 0.4), rgba(120, 52, 12, 0.3) 70%),
    linear-gradient(180deg, rgba(60, 36, 16, 0.94), rgba(30, 18, 9, 0.96));
  border: 1px solid rgba(255, 200, 120, 0.5);
  box-shadow: 0 6px 0 rgba(70, 34, 8, 0.7), 0 14px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  margin-bottom: 10px;
}
.crest .mp-icon { width: 36px; height: 36px; }
.eyebrow {
  margin: 0;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #FFB66B;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.game-title {
  margin: 4px 0 0;
  font-size: clamp(35px, 9.6vw, 44px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #FFF8DD 6%, #FFD77E 52%, #FF9B3F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(112, 48, 8, 0.6)) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}
.tagline {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 238, 210, 0.68);
  text-align: center;
  letter-spacing: 0.02em;
}
.best-line {
  margin-top: 8px;
  min-height: 17px;
  font-size: 10.5px;
  font-weight: 700;
  color: #FFCE83;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.best-line:empty { display: none; }

.diff-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 14px;
}
.diff-card {
  position: relative;
  min-height: 54px;
  padding: 9px 11px;
  border-radius: 13px;
  text-align: left;
  background: rgba(32, 24, 15, 0.55);
  border: 1px solid rgba(255, 240, 214, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.09s ease, border-color 0.15s ease, background 0.15s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.diff-card:active { transform: scale(0.975); }
.diff-card b { display: block; font-size: 14px; font-weight: 900; color: #FFF1D8; letter-spacing: 0.03em; }
.diff-card span { display: block; margin-top: 2px; font-size: 9.5px; color: rgba(255, 237, 208, 0.5); letter-spacing: 0.01em; }
.diff-card.active {
  border-color: rgba(255, 176, 85, 0.9);
  background: linear-gradient(180deg, rgba(255, 154, 68, 0.3), rgba(126, 54, 12, 0.35));
  box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.diff-card.active b { color: #FFD98F; }
.diff-card.active::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFC15A;
  box-shadow: 0 0 8px rgba(255, 193, 90, 0.9);
}

.primary-btn {
  position: relative;
  width: 100%;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  color: #FFF9EC;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #FFB361 0%, #FF832F 55%, #ED6517 100%);
  border: 1px solid #FFC983;
  box-shadow: 0 5px 0 #A8430D, 0 12px 26px rgba(236, 100, 20, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.primary-btn::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 4px;
  height: 42%;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.primary-btn .mp-icon { width: 21px; height: 21px; }
.primary-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #A8430D, 0 5px 14px rgba(236, 100, 20, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.start-hint,
.sheet-hint {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(255, 235, 204, 0.45);
  text-align: center;
  letter-spacing: 0.02em;
}

.modal-screen {
  justify-content: center;
  align-items: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  background: rgba(6, 11, 7, 0.68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.modal-card {
  width: 100%;
  max-width: 330px;
  border-radius: 22px;
  padding: 22px 20px 18px;
  text-align: center;
  background: linear-gradient(180deg, rgba(44, 30, 17, 0.98), rgba(22, 14, 8, 0.99));
  border: 1px solid rgba(255, 206, 132, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFD48B;
  background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 176, 88, 0.3);
}
.modal-icon .mp-icon { width: 27px; height: 27px; }
.modal-card h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #FFF3DC;
}
.modal-sub {
  margin: 6px 0 16px;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 236, 205, 0.55);
}
.modal-row { display: flex; gap: 8px; margin-top: 10px; }
.ghost-btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #F1DFC1;
  background: rgba(255, 246, 226, 0.07);
  border: 1px solid rgba(255, 234, 198, 0.14);
  transition: transform 0.08s ease, background 0.15s ease;
}
.ghost-btn:active { transform: scale(0.97); background: rgba(255, 138, 61, 0.14); }
.ghost-btn .mp-icon { width: 16px; height: 16px; }
.text-btn {
  margin-top: 12px;
  font-size: 11.5px;
  color: rgba(255, 234, 198, 0.45);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
}

.result-card { padding-top: 18px; }
.result-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
  min-height: 30px;
}
.result-stars .mp-icon { width: 30px; height: 30px; color: rgba(255, 255, 255, 0.14); }
.result-stars .mp-icon.on { color: #FFC94D; filter: drop-shadow(0 2px 8px rgba(255, 180, 40, 0.55)); }
.result-stars .mp-icon.on:nth-child(2) { transform: translateY(-2px); }
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 16px;
  padding: 11px 6px;
  border-radius: 14px;
  background: rgba(255, 246, 226, 0.05);
  border: 1px solid rgba(255, 234, 198, 0.1);
}
.result-stats .rs b { display: block; font-size: 20px; font-weight: 900; color: #FFD075; font-variant-numeric: tabular-nums; line-height: 1.15; }
.result-stats .rs span { display: block; margin-top: 2px; font-size: 9.5px; color: rgba(255, 236, 205, 0.5); letter-spacing: 0.04em; }

@media (max-height: 700px) {
  .crest { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 6px; }
  .crest .mp-icon { width: 30px; height: 30px; }
  .game-title { font-size: 32px; }
  .tagline { font-size: 10.5px; }
  .diff-grid { margin: 9px 0 11px; gap: 6px; }
  .diff-card { min-height: 48px; padding: 7px 10px; }
  .diff-card b { font-size: 13px; }
  .primary-btn { height: 50px; font-size: 17px; }
  .start-screen { padding-top: calc(12px + env(safe-area-inset-top)); }
}

@media (max-width: 350px) {
  .build-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-pill { padding: 0 8px; font-size: 12.5px; }
  .stat-wave { font-size: 10px; padding: 0 7px; }
  .hud-btn { width: 32px; height: 32px; }
  .hud { padding-left: 9px; padding-right: 9px; }
  .hud-right { gap: 4px; }
}

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