/* 可玩版共享主题 —— 整页 + 卡片/按钮/选项都会随风格变化 */
:root {
  --bg: #070b16;
  --panel: #0d1426;
  --card: #0f1830;
  --txt: #e8eeff;
  --muted: #8ea0c4;
  --accent: #667eea;
  --accent2: #FFD93D;
  --line: rgba(130, 160, 255, .18);
  --radius: 18px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

body[data-theme="cartoon"] {
  --bg: #fff4e6;
  --panel: #fff9f2;
  --card: #ffffff;
  --txt: #34304a;
  --muted: #8a839c;
  --accent: #FF6B6B;
  --accent2: #FFB020;
  --line: rgba(52, 48, 74, .10);
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px rgba(255, 107, 107, .18);
  background-image: radial-gradient(1000px 600px at 80% -10%, rgba(255, 209, 102, .35), transparent 60%),
                    radial-gradient(900px 500px at 0% 110%, rgba(107, 203, 119, .18), transparent 60%);
}
body[data-theme="pixel"] {
  --bg: #070d09;
  --panel: #0b160e;
  --card: #07120b;
  --txt: #b9ffcb;
  --muted: #5f8f6f;
  --accent: #00ff41;
  --accent2: #ffff00;
  --line: rgba(0, 255, 65, .28);
  --radius: 0px;
  --radius-sm: 0px;
  --font: "Courier New", "Consolas", monospace;
  --shadow: 0 0 0 2px #00ff41, 0 0 24px rgba(0, 255, 65, .18);
  background-image: linear-gradient(rgba(0, 255, 65, .04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 255, 65, .04) 1px, transparent 1px);
  background-size: 32px 32px;
}
body[data-theme="tech"] {
  --bg: #04070f;
  --panel: #081226;
  --card: #0a1730;
  --txt: #dff6ff;
  --muted: #6f8fb5;
  --accent: #00e5ff;
  --accent2: #b388ff;
  --line: rgba(0, 229, 255, .22);
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 0 30px rgba(0, 229, 255, .16);
  background-image: radial-gradient(900px 600px at 75% 0%, rgba(0, 229, 255, .12), transparent 60%),
                    linear-gradient(rgba(0, 229, 255, .035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 229, 255, .035) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
}
body[data-theme="cute"] {
  --bg: #fff0f8;
  --panel: #fff7fc;
  --card: #fffafd;
  --txt: #5a3a52;
  --muted: #a07f97;
  --accent: #FF69B4;
  --accent2: #C77DFF;
  --line: rgba(255, 105, 180, .22);
  --radius: 28px;
  --radius-sm: 16px;
  --shadow: 0 18px 44px rgba(255, 105, 180, .2);
  background-image: radial-gradient(800px 500px at 15% 0%, rgba(199, 125, 255, .22), transparent 60%),
                    radial-gradient(800px 500px at 90% 100%, rgba(255, 182, 193, .28), transparent 60%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background-color: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  padding: 12px;
  transition: background-color .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
.page { max-width: 960px; margin: 0 auto; }
.page.play { max-width: 900px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel); color: var(--txt);
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border-color: transparent; box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}
body[data-theme="cartoon"] .btn.primary,
body[data-theme="cute"] .btn.primary { color: #fff; }
body[data-theme="pixel"] .btn.primary { color: #031007; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.small { padding: 6px 10px; font-size: 12px; }

.stage {
  position: relative; overflow: hidden;
  width: min(100%, calc((100vh - var(--reserved, 200px)) * 1.5));
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.stage canvas { display: block; width: 100%; height: auto; touch-action: none; }

.hud {
  position: absolute; inset: 10px 12px auto 12px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  pointer-events: none; font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.hud .left, .hud .right { display: flex; flex-direction: column; gap: 4px; }
.hud .right { text-align: right; }
.hud .row { display: flex; gap: 10px; align-items: center; }
.hud .pill {
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .18);
  padding: 4px 10px; border-radius: 999px; font-size: 13px; color: #fff;
  backdrop-filter: blur(6px);
}
body[data-theme="cartoon"] .hud .pill,
body[data-theme="cute"] .hud .pill,
body[data-theme="pixel"] .hud .pill { color: var(--txt); background: rgba(255, 255, 255, .55); border-color: var(--line); }
.hearts { letter-spacing: 2px; font-size: 15px; }

.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(4, 8, 16, .55); backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }
body[data-theme="cartoon"] .overlay,
body[data-theme="cute"] .overlay { background: rgba(255, 255, 255, .35); }
body[data-theme="pixel"] .overlay { background: rgba(0, 0, 0, .72); }

.card {
  width: 100%; max-width: 720px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--card); color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card h1 { font-size: 24px; margin-bottom: 6px; }
.card h2 { font-size: 20px; margin-bottom: 6px; }
.card p.sub { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 12px; }

.themeRow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.themeRow .btn.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }
body[data-theme="pixel"] .themeRow .btn.on { color: #031007; }

.options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.opt-group { border-top: 1px dashed var(--line); padding-top: 10px; }
.opt-group:first-child { border-top: none; padding-top: 0; }
.opt-label { font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.opt-hint { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt {
  background: var(--panel); border: 1px solid var(--line); color: var(--txt);
  padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: .15s; font-family: inherit;
}
body[data-theme="pixel"] .opt { border-radius: 0; }
.opt:hover { border-color: var(--accent); }
.opt.on { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
body[data-theme="pixel"] .opt.on { color: #031007; }
.opt small { opacity: .7; font-weight: 500; margin-left: 4px; }

.footerTip {
  margin: 10px 0 56px;
  color: var(--txt);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: .2px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.footerTip b { color: var(--txt); font-weight: 800; }

/* 塔防底部建造栏 */
.buildbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 8px; margin-top: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.towerBtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: var(--card); border: 1px solid var(--line); color: var(--txt);
  padding: 7px 12px; border-radius: var(--radius-sm); font-family: inherit;
  font-size: 12px; font-weight: 800; cursor: pointer; transition: .15s;
}
.towerBtn small { font-weight: 500; color: var(--muted); font-size: 11px; }
.towerBtn:hover { border-color: var(--accent); transform: translateY(-1px); }
.towerBtn.on { outline: 2px solid var(--accent); box-shadow: 0 0 18px rgba(0, 0, 0, .18); }
.towerBtn:disabled { opacity: .45; cursor: not-allowed; }
.spacer { flex: 1; }

.towerPanel {
  position: absolute; z-index: 30; min-width: 170px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 10px; font-size: 12px;
}
.towerPanel .title { font-weight: 800; margin-bottom: 4px; }
.towerPanel .meta { color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.towerPanel .row { display: flex; gap: 6px; }

.banner {
  position: absolute; left: 50%; top: 16%; transform: translateX(-50%);
  z-index: 15; padding: 8px 18px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; font-weight: 800;
  pointer-events: none; opacity: 0; transition: opacity .25s;
}
.banner.show { opacity: 1; }
body[data-theme="cartoon"] .banner,
body[data-theme="cute"] .banner { background: rgba(255, 255, 255, .8); color: var(--txt); }

@media (max-width: 640px) {
  body { padding: 10px; }
  .brand { font-size: 17px; }
  .card { padding: 14px; }
  .hud .pill { font-size: 11px; padding: 3px 8px; }
  .towerBtn { padding: 6px 9px; }
  .footerTip { font-size: 15px; line-height: 1.7; padding: 10px 12px; margin-bottom: 64px; }
}

@media (max-height: 820px) {
  .brand { font-size: 17px; }
  .brand small { font-size: 11px; }
  .btn { padding: 7px 12px; font-size: 12px; }
  .towerBtn { padding: 5px 8px; font-size: 11px; }
  .towerBtn small { font-size: 10px; }
  .hud .pill { font-size: 11px; padding: 3px 8px; }
  .footerTip { font-size: 15px; line-height: 1.65; }
  .buildbar { gap: 6px; padding: 6px; margin-top: 6px; }
  .buildbar .hint { display: none; }
  .buildbar .btn { padding: 6px 10px; font-size: 12px; }
}

#startBtn { position: static; }

#startScreen .card { display: flex; flex-direction: column; }
#startScreen .options { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 4px; }
#startScreen #startBtn { flex: 0 0 auto; margin-top: 12px; }

/* ============================================================
   风格强化：字体 / 形状 / 装饰 / 动画
   让四种风格不只是换色
   ============================================================ */
body[data-theme="cartoon"] { --font: "Comic Sans MS", "YouYuan", "PingFang SC", "Microsoft YaHei", sans-serif; }
body[data-theme="pixel"]   { --font: "Courier New", "SimSun", "Consolas", monospace; }
body[data-theme="tech"]    { --font: "Consolas", "SimHei", "Microsoft YaHei", monospace; }
body[data-theme="cute"]    { --font: "Comic Sans MS", "YouYuan", "PingFang SC", "Microsoft YaHei", sans-serif; }

.page { position: relative; z-index: 1; }

/* 整页背景装饰 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 1;
}
body[data-theme="cartoon"]::before {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.85) 0 10px, transparent 11px),
    radial-gradient(circle at 17% 22%, rgba(255,255,255,.85) 0 14px, transparent 15px),
    radial-gradient(circle at 82% 14%, rgba(255,255,255,.6) 0 12px, transparent 13px),
    radial-gradient(circle at 88% 19%, rgba(255,255,255,.55) 0 8px, transparent 9px);
  background-size: 420px 260px, 420px 260px, 520px 300px, 520px 300px;
  opacity: .7;
}
body[data-theme="pixel"]::before {
  background-image:
    repeating-linear-gradient(0deg, rgba(0,255,65,.07) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, rgba(0,255,65,.035) 0 1px, transparent 1px 8px);
}
body[data-theme="tech"]::before {
  background-image:
    linear-gradient(rgba(0,229,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
}
body[data-theme="cute"]::before {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,182,193,.45) 0 10px, transparent 11px),
    radial-gradient(circle at 27% 27%, rgba(255,255,255,.55) 0 6px, transparent 7px),
    radial-gradient(circle at 72% 62%, rgba(199,125,255,.28) 0 14px, transparent 15px),
    radial-gradient(circle at 42% 86%, rgba(255,217,61,.28) 0 9px, transparent 10px);
  background-size: 280px 280px, 280px 280px, 380px 380px, 240px 240px;
}

/* 卡片：不同轮廓语言 */
body[data-theme="cartoon"] .card {
  border: 4px solid #2b2b3a; border-radius: 28px;
  box-shadow: 10px 10px 0 rgba(43,43,58,.18);
}
body[data-theme="pixel"] .card {
  border: 3px solid #00ff41; border-radius: 0;
  box-shadow: 6px 6px 0 #003b12;
}
body[data-theme="tech"] .card {
  position: relative; border: 1px solid #00e5ff; border-radius: 0;
  box-shadow: 0 0 30px rgba(0,229,255,.3), inset 0 0 26px rgba(0,229,255,.07);
}
body[data-theme="cute"] .card {
  border: 3px solid #ffb6c1; border-radius: 34px;
  box-shadow: 0 18px 44px rgba(255,105,180,.3);
}

/* 按钮 / 选项 / 塔按钮 */
body[data-theme="cartoon"] .btn,
body[data-theme="cartoon"] .opt,
body[data-theme="cartoon"] .towerBtn {
  border: 3px solid #2b2b3a; border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(43,43,58,.18);
}
body[data-theme="pixel"] .btn,
body[data-theme="pixel"] .opt,
body[data-theme="pixel"] .towerBtn {
  border: 2px solid #00ff41; border-radius: 0;
  box-shadow: 3px 3px 0 #003b12;
}
body[data-theme="tech"] .btn,
body[data-theme="tech"] .opt,
body[data-theme="tech"] .towerBtn {
  border: 1px solid #00e5ff; border-radius: 0;
  box-shadow: 0 0 14px rgba(0,229,255,.25);
}
body[data-theme="cute"] .btn,
body[data-theme="cute"] .opt,
body[data-theme="cute"] .towerBtn {
  border: 2px solid #ffb6c1; border-radius: 999px;
  box-shadow: 0 8px 18px rgba(255,105,180,.22);
}
body[data-theme="cartoon"] .btn:hover,
body[data-theme="cartoon"] .opt:hover { transform: translate(-1px,-2px) rotate(-.6deg); }
body[data-theme="pixel"] .btn:hover,
body[data-theme="pixel"] .opt:hover { transform: translate(-2px,-2px); }
body[data-theme="tech"] .btn:hover,
body[data-theme="tech"] .opt:hover { box-shadow: 0 0 22px rgba(0,229,255,.5); }
body[data-theme="cute"] .btn:hover,
body[data-theme="cute"] .opt:hover { transform: scale(1.04); }

/* 舞台边框 + 装饰 */
body[data-theme="cartoon"] .stage {
  border: 5px solid #2b2b3a; border-radius: 30px;
  box-shadow: 10px 10px 0 rgba(43,43,58,.2);
}
body[data-theme="pixel"] .stage {
  border: 3px solid #00ff41; border-radius: 0;
  box-shadow: 6px 6px 0 #003b12;
}
body[data-theme="tech"] .stage {
  border: 1px solid #00e5ff; border-radius: 0;
  box-shadow: 0 0 44px rgba(0,229,255,.25);
}
body[data-theme="cute"] .stage {
  border: 5px solid #ffb6c1; border-radius: 34px;
  box-shadow: 0 22px 54px rgba(255,105,180,.3);
}

body[data-theme="pixel"] .stage canvas { image-rendering: pixelated; }
body[data-theme="tech"] .stage canvas { filter: saturate(1.15); }
body[data-theme="cute"] .stage canvas { filter: saturate(1.12) brightness(1.04); }

/* 像素扫描线覆盖 */
body[data-theme="pixel"] .stage::before {
  content: ''; position: absolute; inset: 0; z-index: 10; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 2px, transparent 2px 4px);
}
/* 科技四角括号 */
body[data-theme="tech"] .stage::before {
  content: ''; position: absolute; inset: 8px; z-index: 10; pointer-events: none;
  background:
    linear-gradient(#00e5ff,#00e5ff) left top/20px 2px no-repeat,
    linear-gradient(#00e5ff,#00e5ff) left top/2px 20px no-repeat,
    linear-gradient(#00e5ff,#00e5ff) right top/20px 2px no-repeat,
    linear-gradient(#00e5ff,#00e5ff) right top/2px 20px no-repeat,
    linear-gradient(#00e5ff,#00e5ff) left bottom/20px 2px no-repeat,
    linear-gradient(#00e5ff,#00e5ff) left bottom/2px 20px no-repeat,
    linear-gradient(#00e5ff,#00e5ff) right bottom/20px 2px no-repeat,
    linear-gradient(#00e5ff,#00e5ff) right bottom/2px 20px no-repeat;
}
/* 科技扫描光带 */
body[data-theme="tech"] .stage::after {
  content: ''; position: absolute; left: 0; right: 0; height: 90px; z-index: 10;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0,229,255,.08), transparent);
  animation: techScan 3.8s linear infinite;
}
@keyframes techScan { 0% { top: -90px; } 100% { top: 100%; } }

/* 可爱漂浮泡泡 */
body[data-theme="cute"] .stage::before {
  content: ''; position: absolute; inset: 0; z-index: 10; pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.35) 0 6px, transparent 7px),
    radial-gradient(circle at 84% 36%, rgba(255,255,255,.3) 0 5px, transparent 6px),
    radial-gradient(circle at 68% 78%, rgba(255,182,193,.4) 0 7px, transparent 8px);
  animation: cuteFloat 7s ease-in-out infinite;
}
@keyframes cuteFloat {
  0%,100% { transform: translateY(0) scale(1); opacity: .9; }
  50% { transform: translateY(-10px) scale(1.03); opacity: 1; }
}

/* HUD 风格 */
body[data-theme="cartoon"] .hud .pill {
  border: 2px solid #2b2b3a; border-radius: 999px;
  background: rgba(255,255,255,.9); color: #2b2b3a;
}
body[data-theme="pixel"] .hud .pill {
  border: 2px solid #00ff41; border-radius: 0;
  background: rgba(0,0,0,.72); color: #b9ffcb;
}
body[data-theme="tech"] .hud .pill {
  border: 1px solid #00e5ff; border-radius: 0;
  background: rgba(0,10,25,.65); color: #dff6ff;
  box-shadow: 0 0 12px rgba(0,229,255,.2);
}
body[data-theme="cute"] .hud .pill {
  border: 2px solid #ffb6c1; border-radius: 999px;
  background: rgba(255,255,255,.82); color: #5a3a52;
}

/* 底部建造栏 */
body[data-theme="cartoon"] .buildbar { border: 4px solid #2b2b3a; box-shadow: 8px 8px 0 rgba(43,43,58,.18); }
body[data-theme="pixel"] .buildbar { border: 3px solid #00ff41; box-shadow: 5px 5px 0 #003b12; }
body[data-theme="tech"] .buildbar { border: 1px solid #00e5ff; box-shadow: 0 0 26px rgba(0,229,255,.2); }
body[data-theme="cute"] .buildbar { border: 3px solid #ffb6c1; box-shadow: 0 16px 34px rgba(255,105,180,.22); }

/* 品牌小动效 */
body[data-theme="cartoon"] .brand { animation: brandBob 2.8s ease-in-out infinite; }
body[data-theme="cute"] .brand { animation: brandFloat 3.4s ease-in-out infinite; }
@keyframes brandBob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-.6deg); } }
@keyframes brandFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.redesign-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 800; font-size: 13px; text-decoration: none;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.3);
  transition: transform .15s, box-shadow .15s;
}
.redesign-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.32); }
body[data-theme="pixel"] .redesign-fab { border-radius: 0; color: #031007; }
@media (max-width: 640px) { .redesign-fab { right: 12px; bottom: 12px; padding: 9px 14px; font-size: 12px; } }

/* ============================================================
   嵌入模式（embed=1）：参考旧项目生成作品的展示逻辑
   隐藏页头/说明/浮动按钮，让游戏画面在手机屏幕中居中
   ============================================================ */
body.embed-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}
body.embed-mode .page.play {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}
body.embed-mode .topbar,
body.embed-mode .footerTip {
  display: none !important;
}
body.embed-mode .stage {
  width: min(100%, calc(100vh * 1.5));
  max-width: 100%;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.embed-mode .stage::before,
body.embed-mode .stage::after {
  display: none !important;
}
body.embed-mode .stage canvas { border-radius: 0; }
body.embed-mode .buildbar {
  width: min(100%, calc(100vh * 1.5));
  max-width: 100%;
  margin: 8px auto 0;
}
/* 嵌入模式下塔防建造栏更紧凑：塔类型单行横向滚动，按钮单独一行 */
body.embed-mode .buildbar { flex-wrap: wrap; }
body.embed-mode .buildbar .hint { display: none !important; }
body.embed-mode .buildbar .spacer { display: none; }
body.embed-mode #towerChoices {
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
body.embed-mode #towerChoices .towerBtn { flex: 0 0 auto; }
/* 嵌入模式下塔防建造栏用三列网格，减少高度，让画面更接近居中 */
body.embed-mode #towerChoices {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  overflow: visible;
  padding-bottom: 0;
}
body.embed-mode #towerChoices .towerBtn { width: 100%; padding: 6px 7px; font-size: 11px; }
body.embed-mode #towerChoices .towerBtn small { font-size: 10px; line-height: 1.35; }