/* ============================================================
   钢铁前线 Steel Front — 现代军事 / 工业 / 科技风
   主色：深黑 #0b0f14 · 深灰 #171c24 · 蓝灰 #232c3a
   强调：金黄 #f5b301 · 敌方红 #d05454 · 我方青绿 #4fc28e
   ============================================================ */

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

:root {
  --bg-0: #0b0f14;
  --bg-1: #11161d;
  --bg-2: #171e28;
  --bg-3: #1f2835;
  --line: #2c3644;
  --gold: #f5b301;
  --gold-hi: #ffd34d;
  --gold-lo: #b97f00;
  --text: #e8edf4;
  --text-dim: #8b98a9;
  --red: #d05454;
  --green: #4fc28e;
}

html, body {
  width: 100%;
  height: 100%;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------- 屏幕切换 ---------------- */
.screen {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ---------------- 通用：顶栏 / 金币 ---------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  z-index: 10;
}
.gold-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #1d2530, #131a23);
  border: 1px solid #3a4556;
  border-radius: 999px;
  padding: 7px 16px 7px 9px;
  font-size: 18px; font-weight: 700; color: var(--gold-hi);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.45);
  letter-spacing: .5px;
}
.coin-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 55%, #8a5f00);
  border: 1px solid #6d4c00;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.35);
  position: relative; flex: none;
}
.coin-icon::after {
  content: "￥"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #5b3f00;
}
.gold-num.bump { animation: goldBump .45s ease; }
@keyframes goldBump {
  0% { transform: scale(1); } 40% { transform: scale(1.35); color: #fff; } 100% { transform: scale(1); }
}

.icon-btn {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(180deg, #232d3b, #161d27);
  border: 1px solid #3a4556;
  color: var(--text); font-size: 19px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 6px rgba(0,0,0,.4);
  transition: transform .08s, filter .15s;
}
.icon-btn:active { transform: translateY(1px) scale(.96); filter: brightness(1.2); }

/* ---------------- 通用：按钮 ---------------- */
.btn {
  font-family: inherit; cursor: pointer; color: var(--text);
  border: 1px solid #46536a; border-radius: 12px;
  background: linear-gradient(180deg, #27303e, #171e28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -3px 6px rgba(0,0,0,.35),
    0 4px 12px rgba(0,0,0,.45);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.btn:active { transform: translateY(2px); filter: brightness(1.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 4px rgba(0,0,0,.5); }
.btn:disabled, .btn.disabled {
  cursor: not-allowed; filter: grayscale(.75) brightness(.6);
  transform: none;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, var(--gold-lo));
  border: 1px solid #8a5f00;
  color: #2b1d00; font-weight: 900;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -4px 8px rgba(90,60,0,.45),
    0 6px 20px rgba(245,179,1,.35),
    0 2px 6px rgba(0,0,0,.5);
}
.btn-gold:active { filter: brightness(1.1); }

.btn-xl {
  font-size: 26px; letter-spacing: .35em; text-indent: .35em;
  padding: 18px 64px; border-radius: 14px;
}
.btn-sm { font-size: 15px; padding: 9px 16px; }
.btn-metal { background: linear-gradient(180deg, #2b3542, #1a2230); }

/* ============================================================
   首页 · 机库场景
   ============================================================ */
.hangar-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}
.hangar-wall {
  position: absolute; inset: 0 0 34% 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 118px, rgba(255,255,255,.035) 118px 120px),
    repeating-linear-gradient(0deg, transparent 0 78px, rgba(0,0,0,.35) 78px 80px),
    linear-gradient(180deg, #131a22 0%, #0e1319 100%);
}
.hangar-wall::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background: repeating-linear-gradient(90deg, #f5b301 0 26px, #14171c 26px 52px);
  opacity: .55;
}
.hangar-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 36%;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(245,179,1,.10), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 2px, transparent 2px 90px),
    linear-gradient(180deg, #1a2027 0%, #0c0f13 100%);
  border-top: 2px solid #05070a;
}
.hangar-lightcone {
  position: absolute; left: 50%; top: -6%;
  width: 720px; height: 640px; transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 62% at 50% 0%, rgba(255,214,110,.16), rgba(255,214,110,.05) 45%, transparent 70%);
  pointer-events: none;
}

.home-center {
  position: relative; z-index: 5;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding-bottom: 24px;
}
.game-title {
  font-size: clamp(44px, 8vw, 76px); font-weight: 900;
  letter-spacing: .18em; text-indent: .18em;
  background: linear-gradient(180deg, #fff8e6 5%, var(--gold-hi) 38%, #a8740a 75%, #6d4c00);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.7)) drop-shadow(0 8px 24px rgba(245,179,1,.25));
}
.game-subtitle {
  color: var(--text-dim); font-size: clamp(12px, 2vw, 16px);
  letter-spacing: .5em; text-indent: .5em; margin-top: -4px;
}
.tank-stage { position: relative; margin: 8px 0 6px; width: min(92vw, 520px); }
.tank-stage canvas {
  display: block; position: relative; z-index: 2;
  width: 100% !important; height: auto !important;
}
.tank-float { animation: tankFloat 3.2s ease-in-out infinite; }
.name-tag {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 8px 14px;
  background: rgba(12, 18, 26, .72);
  border: 1px solid #3a4a5e; border-radius: 12px;
}
.name-tag-label {
  color: var(--gold-hi); font-size: 13px; font-weight: 800;
  letter-spacing: .18em; white-space: nowrap;
}
.name-tag-input {
  width: min(180px, 42vw); height: 34px;
  padding: 0 12px; border-radius: 8px;
  border: 1px solid #4a5a70; background: #0f1620;
  color: #e8eef6; font-size: 15px; font-weight: 700;
  letter-spacing: .06em; outline: none;
}
.name-tag-input::placeholder { color: #6a7688; font-weight: 600; }
.name-tag-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,179,1,.18); }
@keyframes tankFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.tank-shadow {
  position: absolute; left: 50%; bottom: 4px; z-index: 1;
  width: 300px; height: 42px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,.75), transparent 68%);
  animation: shadowPulse 3.2s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .85; }
  50% { transform: translateX(-50%) scale(.88); opacity: .55; }
}
.home-footer {
  position: relative; z-index: 5;
  text-align: center; color: #5c6878; font-size: 12px;
  letter-spacing: .15em; padding: 14px 0 18px;
}
.home-version {
  position: absolute; right: 18px; bottom: 14px; z-index: 6;
  color: #6a7688; font-size: 13px; font-weight: 700;
  letter-spacing: .14em;
  pointer-events: none;
}
.btn-server {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 18px; border-radius: 12px;
  border-color: #4a6a95; color: #c8daf0;
  font-size: 14px; letter-spacing: .12em;
  margin-bottom: 2px;
}
.btn-server .server-label { font-weight: 700; opacity: .9; }
.btn-server .server-id {
  min-width: 36px; padding: 3px 10px; border-radius: 8px;
  background: linear-gradient(180deg, #ffd34d, #f5b301);
  color: #1a1400; font-weight: 900; font-size: 16px;
  letter-spacing: .08em; text-align: center;
}
.btn-server:hover { border-color: #7fa3cc; color: #e8f2fd; }

/* ============================================================
   机库 / 坦克详情
   ============================================================ */
#screen-hangar {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245,179,1,.07), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 118px, rgba(255,255,255,.02) 118px 120px),
    linear-gradient(180deg, #10151c, #0b0f14);
}
.hangar-main {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(280px, 1fr) 1.25fr;
  gap: 14px; padding: 4px 16px 10px;
}
.hangar-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.panel {
  background: linear-gradient(180deg, rgba(31,40,53,.92), rgba(19,26,35,.92));
  border: 1px solid #33405299;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.4);
  padding: 14px;
}
.panel-title {
  font-size: 13px; color: var(--text-dim); letter-spacing: .3em;
  border-left: 3px solid var(--gold); padding-left: 8px; margin-bottom: 10px;
}
.tank-card { flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.tank-card canvas { max-width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.tank-name { font-size: 20px; font-weight: 800; letter-spacing: .12em; margin-top: 4px; }
.tank-name em { font-style: normal; color: var(--gold-hi); }

.upgrade-col { display: flex; flex-direction: column; gap: 10px; }
.btn-upgrade {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 13px 10px; font-size: 19px; font-weight: 800; letter-spacing: .1em;
  border-color: #5a4a1a;
  background: linear-gradient(180deg, #33301f, #1c1a12);
}
.btn-upgrade:not(:disabled) { border-color: #7a6420; box-shadow: inset 0 1px 0 rgba(255,220,130,.18), inset 0 -3px 6px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.45); }
.up-name { pointer-events: none; }
.up-sub { font-size: 12px; font-weight: 500; color: var(--gold-hi); letter-spacing: .04em; pointer-events: none; }
.btn-upgrade:disabled .up-sub { color: #98a2b1; }
.btn-upgrade.done { filter: none; border-color: #2f4d3d; background: linear-gradient(180deg, #1d2b24, #131b16); }
.btn-upgrade.done .up-name { color: var(--green); }
.btn-upgrade.done .up-sub { color: #6f8f80; }

.hangar-stats { display: flex; flex-direction: column; min-height: 0; }
.stats-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; }
.stats-scroll::-webkit-scrollbar { width: 8px; }
.stats-scroll::-webkit-scrollbar-thumb { background: #334056; border-radius: 4px; }

.stat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stat-label { width: 44px; font-size: 15px; font-weight: 700; color: #c4cedd; flex: none; }
.stat-bar { flex: 1; height: 14px; background: #10151c; border: 1px solid #2c3644; border-radius: 7px; overflow: hidden; }
.stat-fill {
  height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, #7a5a00, var(--gold) 60%, var(--gold-hi));
  box-shadow: 0 0 8px rgba(245,179,1,.5);
  transition: width .5s ease;
}
.stat-num { width: 26px; text-align: right; font-weight: 800; color: var(--gold-hi); font-size: 16px; flex: none; }
.stat-num .up { color: var(--green); font-size: 12px; }

.stats-h { font-size: 13px; color: var(--text-dim); letter-spacing: .25em; margin: 16px 0 8px; border-top: 1px dashed #2c3644; padding-top: 14px; }
.stats-p { font-size: 14px; line-height: 1.8; color: #b8c2d1; }
.stats-li { font-size: 14px; color: #b8c2d1; line-height: 1.9; padding-left: 18px; position: relative; }
.stats-li::before { content: "▸"; position: absolute; left: 0; color: var(--gold); }
.upg-row { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; border-bottom: 1px solid #232c3a; color: #b8c2d1; }
.upg-state { font-weight: 700; }
.upg-state.off { color: #7d8899; }
.upg-state.on { color: var(--green); }

.hangar-bottom {
  display: flex; justify-content: center; align-items: center; gap: 16px;
  padding: 10px 16px 18px;
}
.btn-home { width: 58px; height: 58px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--gold-hi); }
.btn-friends { color: #9ed0ff; border-color: #4a6a95; }
.btn-lobby { color: #9ecbff; border-color: #4a6a95; }

/* ============================================================
   好友
   ============================================================ */
#screen-friends {
  background:
    radial-gradient(ellipse 60% 35% at 50% 0%, rgba(90,160,255,.08), transparent 55%),
    linear-gradient(180deg, #0c121a, #070a10 60%);
  overflow: auto;
}
.friends-title {
  text-align: center; font-size: 30px; font-weight: 900;
  letter-spacing: .28em; text-indent: .28em; margin: 8px 0 6px;
  color: #e8eef6;
}
.friends-tip {
  text-align: center; font-size: 13px; color: #8b98a9; margin-bottom: 12px; padding: 0 16px;
}
.friends-tip b { color: var(--gold-hi); letter-spacing: .12em; }
.friends-add-row {
  display: flex; justify-content: center; gap: 10px; padding: 0 16px 14px; flex-wrap: wrap;
}
.friend-code-input {
  width: min(220px, 60vw); height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid #4a5a70; background: #0f1620; color: #e8eef6;
  font-size: 15px; font-weight: 700; letter-spacing: .14em; outline: none;
}
.friend-code-input:focus { border-color: var(--gold); }
.friends-tabs {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 0 12px 12px;
}
.friends-tab {
  background: #151c26; border: 1px solid #334056; color: #9aa8ba;
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.friends-tab.active { color: #0d1116; background: linear-gradient(180deg, #ffd34d, #f5b301); border-color: #ffd34d; }
.f-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: #d05454; color: #fff; font-size: 11px; line-height: 18px;
}
.f-badge.hidden { display: none; }
.friends-panel {
  width: min(720px, 94%); margin: 0 auto 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.friend-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #1d2530, #131a23);
  border: 1px solid #334056; border-radius: 14px; padding: 14px 16px;
}
.friend-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #5a8ec8, #24344a);
  color: #fff; font-weight: 900; font-size: 18px;
  border: 2px solid #6aa8e8;
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 17px; font-weight: 800; color: #e8eef6; }
.friend-meta { font-size: 12px; color: #8b98a9; margin-top: 4px; }
.friend-meta .online { color: #8fe66e; }
.friend-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.friend-actions .btn { font-size: 13px; padding: 8px 12px; }
.friends-empty { text-align: center; color: #7d8899; padding: 40px 16px; font-size: 14px; }
.skin-grid-mini {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.skin-chip {
  background: #151c26; border: 1px solid #334056; border-radius: 12px;
  padding: 12px; text-align: center;
}
.skin-chip .swatch {
  width: 48px; height: 28px; border-radius: 6px; margin: 0 auto 8px;
  border: 1px solid rgba(255,255,255,.15);
}
.skin-chip .sn { font-size: 13px; font-weight: 800; color: #e8eef6; }
.tank-skin-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.tank-skin-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 6px;
}
.tank-skin-thumb {
  width: 72px; height: 56px; border-radius: 8px;
  background: rgba(0,0,0,.25); border: 1px solid #2a3545;
}
.tank-skin-chip .sg {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; opacity: .85;
}
.tank-skin-chip .sg.grade-epic { color: #c8b070; }
.tank-skin-chip .sg.grade-elite { color: #c9a0e8; }
.tank-skin-chip .sg.grade-heavy { color: #e0a080; }
.tank-skin-chip .sg.grade-medium { color: #e0d080; }
.tank-skin-chip .sg.grade-light { color: #a0c0e0; }
.gift-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.62); display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.gift-modal.hidden { display: none; }
.gift-panel {
  width: min(400px, 94%);
  background: linear-gradient(180deg, #1f2835, #131a23);
  border: 1px solid #3a4556; border-radius: 16px; padding: 20px;
}
.gift-panel h3 { margin: 0 0 12px; font-size: 20px; letter-spacing: .12em; }
.gift-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 280px; overflow: auto; }
.gift-opt {
  text-align: left; background: #151c26; border: 1px solid #334056; border-radius: 10px;
  padding: 10px 12px; color: #e8eef6; cursor: pointer; font-size: 14px;
}
.gift-opt:hover { border-color: var(--gold); }
.gift-opt:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   关卡选择
   ============================================================ */
#screen-levels {
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(245,179,1,.06), transparent 60%),
    linear-gradient(180deg, #10151c, #0b0f14);
  align-items: center;
}
#screen-levels .topbar { width: 100%; }
.levels-title { font-size: 30px; letter-spacing: .25em; text-indent: .25em; color: #f2e7c8; margin-top: 6px; text-shadow: 0 2px 0 rgba(0,0,0,.6); }
.levels-tip { color: #67748a; font-size: 13px; margin: 8px 0 18px; letter-spacing: .05em; }
.level-list {
  width: min(720px, 92%); flex: 1; min-height: 0;
  overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  padding-bottom: 30px;
}
.level-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, #1d2530, #131a23);
  border: 1px solid #334056; border-radius: 14px;
  padding: 16px 18px; cursor: pointer; text-align: left; width: 100%;
  color: var(--text); font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 4px 12px rgba(0,0,0,.35);
  transition: transform .1s, border-color .15s, filter .15s;
}
.level-card:not(.locked):hover { border-color: var(--gold); transform: translateX(4px); }
.level-card:not(.locked):active { filter: brightness(1.2); }
.level-card.locked { filter: grayscale(.8) brightness(.55); cursor: not-allowed; }
.level-num {
  width: 56px; height: 56px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #2b1d00;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 3px 8px rgba(0,0,0,.4);
}
.level-card.locked .level-num { background: linear-gradient(180deg, #4a5566, #2a323e); color: #1a2029; }
.level-info { flex: 1; min-width: 0; }
.level-name { font-size: 19px; font-weight: 800; letter-spacing: .08em; }
.level-name .boss-tag { color: #ff6b6b; font-size: 13px; margin-left: 6px; border: 1px solid #ff6b6b66; border-radius: 4px; padding: 1px 6px; vertical-align: 2px; }
.level-desc { font-size: 13px; color: #8b98a9; margin-top: 4px; }
.level-meta { font-size: 12px; color: var(--gold-hi); margin-top: 5px; letter-spacing: .03em; }
.level-status { flex: none; font-size: 14px; font-weight: 700; color: #7d8899; }
.level-status.open { color: var(--green); }
.level-status.cleared { color: var(--gold-hi); }
.level-status.locked-hint { font-size: 12px; font-weight: 600; color: #5d6a7c; }

/* ============================================================
   战斗
   ============================================================ */
#screen-battle { background: #05070a; touch-action: none; }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.battle-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 10px 12px; gap: 10px;
  background: linear-gradient(180deg, rgba(5,7,10,.75), transparent);
  pointer-events: none;
}
.battle-hud > * { pointer-events: auto; }
.hud-left { display: flex; align-items: center; gap: 8px; }
.hp-label { font-size: 13px; font-weight: 700; color: #c4cedd; text-shadow: 0 1px 2px #000; }
.hp-bar {
  width: min(220px, 26vw); height: 16px; border-radius: 8px;
  background: rgba(10,14,19,.85); border: 1px solid #3a4556; overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}
#hpFill {
  height: 100%; width: 100%; border-radius: 8px;
  background: linear-gradient(90deg, #1e7a4c, var(--green) 70%, #8fe6bd);
  transition: width .25s ease;
}
#hpFill.low { background: linear-gradient(90deg, #8a2020, var(--red) 70%, #ff9a8a); animation: hpBlink .8s infinite; }
@keyframes hpBlink { 50% { filter: brightness(1.5); } }
.hp-text { font-size: 13px; font-weight: 800; color: #e8edf4; text-shadow: 0 1px 2px #000; min-width: 58px; }
.hud-center { text-align: center; }
#hudLevelName { font-size: 15px; font-weight: 800; letter-spacing: .12em; color: #f2e7c8; text-shadow: 0 1px 3px #000; }
#hudEnemies { font-size: 12px; color: #ff9a8a; margin-top: 3px; letter-spacing: .08em; text-shadow: 0 1px 2px #000; }
.hud-right { display: flex; align-items: center; gap: 8px; }
.hud-right .gold-chip { padding: 5px 13px 5px 7px; font-size: 15px; }
.hud-right .coin-icon { width: 18px; height: 18px; }
.hud-right .icon-btn { width: 36px; height: 36px; font-size: 15px; background: rgba(22,29,39,.85); }

/* 开场横幅 */
.level-banner {
  position: absolute; top: 24%; left: 50%; transform: translateX(-50%);
  z-index: 30; text-align: center; pointer-events: none;
  font-size: clamp(26px, 5vw, 42px); font-weight: 900; letter-spacing: .2em; text-indent: .2em;
  color: #f2e7c8; text-shadow: 0 0 24px rgba(245,179,1,.6), 0 3px 0 #000;
  animation: bannerIn 2.4s ease forwards;
  white-space: nowrap;
}
.level-banner .sub { display: block; font-size: .42em; color: var(--gold-hi); letter-spacing: .3em; margin-top: 10px; }
@keyframes bannerIn {
  0% { opacity: 0; transform: translateX(-50%) scale(1.4); }
  15% { opacity: 1; transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* 虚拟摇杆 */
.joystick {
  position: absolute; left: 26px; bottom: 30px; z-index: 25;
  width: 128px; height: 128px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(43,53,66,.55), rgba(16,21,28,.75));
  border: 2px solid rgba(90,104,128,.5);
  box-shadow: inset 0 2px 10px rgba(0,0,0,.5);
  display: none;
}
.joy-knob {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #4a5a70, #232c3a 70%);
  border: 2px solid #5a6a84;
  box-shadow: 0 4px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.2);
}
body.touch .joystick { display: block; }

/* 开火按钮 */
.fire-btn {
  position: absolute; right: 30px; bottom: 34px; z-index: 25;
  width: 96px; height: 96px; border-radius: 50%;
  font-family: inherit; font-size: 22px; font-weight: 900; letter-spacing: .15em; text-indent: .15em;
  color: #2b1d00; cursor: pointer;
  background: radial-gradient(circle at 35% 28%, #ffe9a8, var(--gold) 45%, var(--gold-lo));
  border: 3px solid #8a5f00;
  box-shadow: 0 0 24px rgba(245,179,1,.45), inset 0 2px 0 rgba(255,255,255,.6), inset 0 -6px 12px rgba(90,60,0,.5), 0 6px 16px rgba(0,0,0,.5);
  transition: transform .07s, filter .12s;
}
.fire-btn:active { transform: scale(.92); filter: brightness(1.2); }

/* 受击红屏 */
#hitVignette {
  position: absolute; inset: 0; z-index: 15; pointer-events: none;
  box-shadow: inset 0 0 120px rgba(208,60,60,0);
  transition: box-shadow .35s ease;
}
#hitVignette.hit { box-shadow: inset 0 0 120px rgba(208,60,60,.55); transition: none; }

/* 结算浮层 */
.battle-overlay {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,7,10,.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: ovFade .3s ease;
}
@keyframes ovFade { from { opacity: 0; } }
.overlay-panel {
  width: min(420px, 88%);
  background: linear-gradient(180deg, #1f2835, #131a23);
  border: 1px solid #3a4556; border-radius: 18px;
  padding: 28px 24px 24px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  animation: ovPop .35s cubic-bezier(.2,1.6,.4,1);
}
@keyframes ovPop { from { transform: scale(.8); opacity: 0; } }
.overlay-title { font-size: 34px; font-weight: 900; letter-spacing: .22em; text-indent: .22em; }
.overlay-title.win { color: var(--gold-hi); text-shadow: 0 0 26px rgba(245,179,1,.55), 0 2px 0 #000; }
.overlay-title.lose { color: var(--red); text-shadow: 0 0 26px rgba(208,84,84,.5), 0 2px 0 #000; }
.overlay-stats { margin: 18px 0 22px; display: flex; flex-direction: column; gap: 8px; }
.ov-row { display: flex; justify-content: space-between; font-size: 16px; color: #b8c2d1; padding: 6px 10px; border-bottom: 1px dashed #2c3644; }
.ov-row b { color: var(--gold-hi); font-size: 18px; }
.overlay-btns { display: flex; flex-direction: column; gap: 10px; }
.overlay-btns .btn { font-size: 17px; font-weight: 800; padding: 13px; letter-spacing: .12em; }
.overlay-btns .btn-gold { font-size: 19px; }

/* ============================================================
   我的机库（坦克收藏）
   ============================================================ */
.btn-lg { font-size: 20px; font-weight: 800; letter-spacing: .15em; text-indent: .15em; padding: 16px 34px; border-radius: 14px; color: var(--gold-hi); }

#screen-garage {
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(245,179,1,.06), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 118px, rgba(255,255,255,.02) 118px 120px),
    linear-gradient(180deg, #10151c, #0b0f14);
  align-items: center;
}
#screen-garage .topbar { width: 100%; }
.garage-title { font-size: 30px; letter-spacing: .3em; text-indent: .3em; color: #f2e7c8; margin-top: 6px; text-shadow: 0 2px 0 rgba(0,0,0,.6); }
.garage-tip { color: #67748a; font-size: 13px; margin: 8px 0 16px; letter-spacing: .05em; }
.tank-grid {
  width: min(1080px, 94%); flex: 1; min-height: 0;
  overflow-y: auto; padding: 4px 4px 30px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px;
}
.tank-grid::-webkit-scrollbar { width: 8px; }
.tank-grid::-webkit-scrollbar-thumb { background: #334056; border-radius: 4px; }
.tank-item {
  position: relative;
  background: linear-gradient(180deg, #1d2530, #131a23);
  border: 1px solid #334056; border-radius: 14px;
  padding: 10px 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 4px 12px rgba(0,0,0,.35);
  transition: border-color .15s, transform .12s;
}
.tank-item:hover { border-color: #4a5a74; transform: translateY(-2px); }
.tank-item.current { border-color: var(--gold); box-shadow: 0 0 18px rgba(245,179,1,.25), inset 0 1px 0 rgba(255,255,255,.08); }
.tank-item:not(.owned) { filter: saturate(.55); }
.tank-item:not(.owned) canvas { opacity: .75; }
.tank-thumb { display: flex; align-items: center; justify-content: center; }
.tank-item-name { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-align: center; }
.tank-item-stats { font-size: 11.5px; color: #8b98a9; letter-spacing: .02em; }
.tank-grade {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  border-radius: 5px; padding: 2px 7px;
  border: 1px solid transparent;
  line-height: 1.2;
}
.tank-grade.grade-light {
  color: #b8d4f0; border-color: #3a5570; background: rgba(30, 48, 68, .9);
}
.tank-grade.grade-medium {
  color: #ffe08a; border-color: #7a6420; background: rgba(48, 40, 16, .9);
}
.tank-grade.grade-heavy {
  color: #ffb08a; border-color: #7a4030; background: rgba(52, 28, 20, .9);
}
.tank-grade.grade-elite {
  color: #e8c6ff; border-color: #6a4088; background: rgba(40, 22, 56, .92);
}
.tank-grade.grade-epic {
  color: #f0e6c8; border-color: #2a2a2a; background: #0a0a0a;
}
.tank-item-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 10px; color: var(--green);
  border: 1px solid #2f4d3d; border-radius: 4px; padding: 1px 5px;
  background: rgba(20,30,25,.8);
}
.tank-btn { width: 100%; margin-top: 6px; font-size: 13.5px; font-weight: 800; padding: 9px 4px; letter-spacing: .03em; }
.tank-btn.btn-ing { color: var(--gold-hi); border-color: #7a6420; background: linear-gradient(180deg, #33301f, #1c1a12); }

/* ---------------- 批次分页器 ---------------- */
.batch-pager { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.pager-btn {
  width: 44px; height: 44px; border-radius: 12px;
  font-size: 24px; font-weight: 900; color: var(--gold-hi);
  display: flex; align-items: center; justify-content: center; padding: 0 0 3px;
}
.pager-btn:disabled { color: #5c6878; }
.batch-label {
  font-size: 15px; font-weight: 700; color: #c4cedd; letter-spacing: .06em;
  background: linear-gradient(180deg, #1d2530, #131a23);
  border: 1px solid #334056; border-radius: 10px; padding: 10px 18px;
}

.hidden { display: none !important; }

/* ============================================================
   手机适配
   ============================================================ */
@media (max-width: 720px) {
  .hangar-main { grid-template-columns: 1fr; overflow-y: auto; }
  .hangar-left { flex-direction: row; }
  .tank-card { flex: 1.2; }
  .upgrade-col { flex: 1; justify-content: center; }
  .hangar-stats { min-height: 300px; }
  .btn-xl { font-size: 19px; padding: 15px 30px; letter-spacing: .2em; }
  .btn-lg { font-size: 16px; padding: 15px 22px; }
  .hangar-bottom { gap: 10px; }
  .joystick { left: 16px; bottom: 20px; width: 112px; height: 112px; }
  .fire-btn { right: 18px; bottom: 24px; width: 84px; height: 84px; font-size: 19px; }
  .hp-bar { width: 30vw; }
  #hudLevelName { font-size: 12px; }
  .game-title { letter-spacing: .12em; }
  .tank-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .garage-title, .levels-title { font-size: 24px; }
  .level-num { width: 46px; height: 46px; font-size: 20px; }
  .batch-label { font-size: 13px; padding: 9px 12px; }
}

/* ============================================================
   结算奖状
   ============================================================ */
.award-cert {
  margin: 0 auto 14px;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: 14px;
  text-align: center;
  animation: award-pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes award-pop {
  0% { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.award-ribbon { font-size: 40px; line-height: 1.1; }
.award-name { font-size: 20px; font-weight: 900; letter-spacing: .12em; margin: 4px 0 2px; }
.award-desc { font-size: 13px; opacity: .85; }
.award-perfect {
  background: linear-gradient(160deg, rgba(255,211,77,.22), rgba(255,158,44,.1));
  border: 2px solid #ffd34d;
  box-shadow: 0 0 24px rgba(255,211,77,.35), inset 0 0 18px rgba(255,211,77,.12);
  color: #ffe9a8;
}
.award-perfect .award-name { color: #ffd34d; text-shadow: 0 0 12px rgba(255,211,77,.6); }
.award-normal {
  background: linear-gradient(160deg, rgba(120,200,255,.14), rgba(120,200,255,.05));
  border: 2px solid #6db3e8;
  color: #cfe6fb;
}
.award-normal .award-name { color: #8fc8ff; }
.award-lose {
  background: linear-gradient(160deg, rgba(160,170,185,.12), rgba(160,170,185,.04));
  border: 2px solid #6a7686;
  color: #c6d0dd;
}
.award-lose .award-name { color: #aab8ca; }
.award-consolation {
  background: linear-gradient(160deg, rgba(255,140,200,.16), rgba(255,211,77,.08));
  border: 2px dashed #ff9ed2;
  box-shadow: 0 0 20px rgba(255,158,210,.25);
  color: #ffd7ec;
}
.award-consolation .award-name { color: #ff9ed2; }

/* ============================================================
   联机大厅
   ============================================================ */
#screen-lobby {
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(77,163,255,.09), transparent 60%),
    linear-gradient(180deg, #0d1420, #0a0e15);
  overflow-y: auto;
}
.lobby-title {
  text-align: center; font-size: 34px; letter-spacing: .22em; margin: 26px 0 6px;
  background: linear-gradient(180deg, #d8ecff, #4da3ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lobby-tip { text-align: center; color: #7e8ea3; font-size: 13px; margin-bottom: 14px; }
.lobby-room-bar {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 0 16px 14px;
}
.room-code-input {
  width: min(140px, 36vw); height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid #4a5a70; background: #0f1620; color: #e8eef6;
  font-size: 14px; font-weight: 700; letter-spacing: .12em; outline: none;
}
.room-code-input:focus { border-color: #4da3ff; }
.room-list-wrap {
  width: min(820px, 94%); margin: 0 auto 22px;
  background: linear-gradient(180deg, rgba(22,30,42,.9), rgba(12,16,24,.9));
  border: 1px solid #334056; border-radius: 14px; padding: 14px 16px;
}
.room-list-title {
  font-size: 14px; font-weight: 800; letter-spacing: .18em; color: #9ecbff; margin-bottom: 10px;
}
.room-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; }
.room-card {
  display: flex; align-items: center; gap: 12px;
  background: #151c26; border: 1px solid #2f3d52; border-radius: 12px; padding: 12px 14px;
}
.room-card-info { flex: 1; min-width: 0; }
.room-card-name { font-size: 16px; font-weight: 800; color: #e8eef6; }
.room-card-meta { font-size: 12px; color: #8b98a9; margin-top: 3px; }
.room-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.room-card-actions .btn { font-size: 12px; padding: 7px 10px; }
.room-members {
  text-align: left; min-height: 80px; margin: 12px 0;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: #b8c2d1;
}
.room-members .host { color: #ffd34d; }
.room-members .spec { color: #8fa1b8; }
.room-overlay-btns { display: flex; flex-direction: column; gap: 8px; }
.room-panel { width: min(400px, 90vw); }

/* ============================================================
   房间大厅 · 全屏帝国时代风格（黑底）
   ============================================================ */
.aoe-lobby {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column;
  background: #000;
  color: #d6d0c0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}
.aoe-lobby.hidden { display: none !important; }
.aoe-lobby-bar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 16px;
  background: linear-gradient(180deg, #2a2418, #14100c);
  border-bottom: 2px solid #5a4a28;
}
.aoe-lobby-title {
  font-size: clamp(18px, 2.4vw, 26px); font-weight: 900;
  color: #f0e2b0; letter-spacing: .12em;
}
.aoe-lobby-meta {
  margin-top: 2px; font-size: 13px; color: #b8a878; letter-spacing: .06em;
}
.aoe-lobby-bar-right { display: flex; gap: 10px; }
.aoe-btn {
  min-width: 96px; height: 36px; padding: 0 14px;
  border: 2px solid #6a5a30;
  background: linear-gradient(180deg, #3a3220, #1c1810);
  color: #e8dcb0; font-size: 14px; font-weight: 800;
  letter-spacing: .08em; cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255,230,160,.18), inset -1px -1px 0 rgba(0,0,0,.55);
}
.aoe-btn:hover { filter: brightness(1.12); }
.aoe-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.aoe-btn-start {
  min-width: 120px; height: 40px;
  border-color: #8a7020;
  background: linear-gradient(180deg, #6a5418, #2e240a);
  color: #ffe9a0;
}
.aoe-btn-sm { min-width: 72px; height: 30px; font-size: 12px; }
.aoe-lobby-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
  gap: 0;
}
.aoe-col {
  min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  border-left: 1px solid #2a2418;
}
.aoe-col-players { border-left: none; }
.aoe-panel {
  display: flex; flex-direction: column; min-height: 0;
  background: #050505;
  border-bottom: 1px solid #2a2418;
  padding: 0;
}
.aoe-panel-head {
  flex: none;
  padding: 8px 12px;
  background: linear-gradient(180deg, #221c12, #100e0a);
  border-bottom: 1px solid #3a3020;
  color: #d4c28a; font-size: 13px; font-weight: 900; letter-spacing: .2em;
}
.aoe-players-panel { flex: 1.45; }
.aoe-chat-panel { flex: 1; border-bottom: none; }
.aoe-map-panel { flex: 1.6; }
.aoe-opts-panel { flex: none; border-bottom: none; padding-bottom: 12px; }
.aoe-slot-head, .aoe-slot {
  display: grid;
  grid-template-columns: 28px minmax(180px, 1.5fr) minmax(150px, 1.3fr) 108px;
  gap: 10px; align-items: center;
  padding: 0 12px;
}
.aoe-slot-head {
  flex: none; height: 32px;
  color: #8a8070; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  border-bottom: 1px solid #1a1814;
}
.aoe-slots {
  flex: 1; min-height: 0; overflow: auto;
}
.aoe-slot {
  min-height: 52px;
  border-bottom: 1px solid #161410;
  background: #080808;
}
.aoe-slot:nth-child(even) { background: #0c0c0c; }
.aoe-slot.host { background: #12100a; box-shadow: inset 3px 0 0 #c9a227; }
.aoe-slot.ai { color: #9a9488; }
.aoe-slot .team-dot {
  width: 18px; height: 18px; border-radius: 2px;
  border: 1px solid #000; display: block;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.aoe-slot .slot-name {
  font-size: 15px; font-weight: 800; color: #ece6d4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aoe-slot .slot-name small {
  display: block; margin-top: 1px; font-size: 11px; color: #8a8070; font-weight: 700;
}
.aoe-slot .slot-status { font-size: 12px; font-weight: 800; color: #b8a878; }
.aoe-slot select, .aoe-opt select {
  width: 100%; max-width: 100%; height: 32px;
  background: #15120c; color: #e8dcb0;
  border: 1px solid #4a3e24; font-size: 13px; font-weight: 700;
  padding: 0 6px; outline: none;
}
.aoe-slot select[data-act="team"] {
  font-size: 13px; font-weight: 800; color: #ffe9a0;
  border-color: #6a5a30;
}
.aoe-slot select:disabled, .aoe-opt select:disabled {
  opacity: .5; cursor: not-allowed;
}
.aoe-chat-log {
  flex: 1; min-height: 120px; overflow: auto;
  padding: 10px 12px; font-size: 13px; line-height: 1.55;
  color: #c8c0a8; background: #030303;
}
.aoe-chat-line { margin-bottom: 4px; word-break: break-word; }
.aoe-chat-line .who { color: #e0c060; font-weight: 800; margin-right: 6px; }
.aoe-chat-line.sys { color: #7a7464; font-style: italic; }
.aoe-chat-form {
  flex: none; display: flex; gap: 8px;
  padding: 8px 12px; border-top: 1px solid #221c12;
}
.aoe-chat-form input {
  flex: 1; height: 32px; border: 1px solid #4a3e24;
  background: #12100c; color: #e8dcb0; padding: 0 10px;
  font-size: 13px; outline: none;
}
.aoe-slot.open .slot-name, .aoe-slot.closed .slot-name { color: #7a7464; }
.aoe-slot .slot-type { font-size: 12px; font-weight: 800; color: #b8a878; }
.aoe-map-preview {
  position: relative; flex: none;
  height: clamp(160px, 28vh, 260px);
  margin: 12px; border: 2px solid #4a3e24;
  overflow: hidden; background: #0a0c10;
}
.aoe-map-preview canvas {
  display: block; width: 100%; height: 100%;
  image-rendering: pixelated;
}
.aoe-map-preview-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.82));
  color: #f0e2b0; font-size: clamp(18px, 2.4vw, 26px); font-weight: 900;
  letter-spacing: .14em; text-shadow: 0 2px 0 #000;
  pointer-events: none;
}
.aoe-map-list {
  flex: 1; min-height: 0; overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; padding: 0 12px 12px; align-content: start;
}
.aoe-map-opt {
  text-align: left; min-height: 38px;
  border: 1px solid #3a3020; background: #12100c;
  color: #d6d0c0; padding: 8px 10px;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.aoe-map-opt:hover:not(:disabled) { border-color: #8a7020; background: #1a160e; }
.aoe-map-opt.active {
  border-color: #c9a227; background: #221c10; color: #ffe9a0;
  box-shadow: inset 0 0 0 1px rgba(201,162,39,.35);
}
.aoe-map-opt:disabled { opacity: .45; cursor: not-allowed; }
.aoe-opt {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 12px;
  font-size: 14px; font-weight: 800; color: #d6d0c0;
}
.aoe-opt select { width: 140px; }
.aoe-seat-controls {
  flex: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  padding: 10px 12px;
  background: #0a0907;
  border-bottom: 1px solid #2a2418;
}
.aoe-seat-ctrl {
  display: inline-flex; align-items: center; gap: 8px;
}
.aoe-seat-ctrl-label {
  font-size: 13px; font-weight: 800; color: #d4c28a; letter-spacing: .08em;
  white-space: nowrap;
}
.aoe-seat-ctrl-hint {
  font-size: 11px; font-weight: 700; color: #6a6458;
}
.aoe-stepper {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid #4a3e24; background: #15120c;
}
.aoe-stepper button {
  width: 34px; height: 32px; border: none;
  background: linear-gradient(180deg, #3a3220, #1c1810);
  color: #e8dcb0; font-size: 18px; font-weight: 900; cursor: pointer;
}
.aoe-stepper button:hover { filter: brightness(1.15); }
.aoe-stepper button:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.aoe-stepper b {
  min-width: 40px; text-align: center;
  color: #ffe9a0; font-size: 16px; font-weight: 900;
}
.aoe-seat-total {
  margin-left: auto;
  font-size: 13px; font-weight: 800; color: #b8a878; letter-spacing: .06em;
}
.aoe-hint {
  padding: 4px 12px 0; font-size: 12px; color: #7a7464; line-height: 1.4;
}
@media (max-width: 900px) {
  .aoe-lobby-body { grid-template-columns: 1fr; }
  .aoe-col-settings { border-left: none; border-top: 1px solid #2a2418; max-height: 48vh; }
  .aoe-map-preview { height: 120px; }
  .aoe-slot-head, .aoe-slot {
    grid-template-columns: 24px minmax(120px, 1.3fr) minmax(100px, 1fr) 88px;
  }
}
.lobby-modes {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px;
  padding: 0 20px 40px; max-width: 980px; margin: 0 auto;
}
.mode-card {
  width: 280px; padding: 22px 20px 18px; border-radius: 16px;
  background: linear-gradient(165deg, rgba(38,50,68,.92), rgba(20,28,40,.92));
  border: 1px solid #33465e;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.mode-card:hover { transform: translateY(-4px); border-color: #5f83ad; box-shadow: 0 16px 32px rgba(0,0,0,.5); }
.mode-icon { font-size: 38px; }
.mode-name {
  font-size: 21px; font-weight: 900; letter-spacing: .14em; color: #e8f2fd;
}
.mode-desc { font-size: 12.5px; color: #8fa1b8; text-align: center; line-height: 1.7; min-height: 42px; }
.mode-config { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.cfg-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: #b9c8da;
  background: rgba(10,14,20,.55); border: 1px solid #2a3850;
  border-radius: 10px; padding: 7px 12px;
}
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper b { min-width: 24px; text-align: center; font-size: 17px; color: #ffd34d; }
.stepper button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid #4a5f7d;
  background: linear-gradient(180deg, #33425a, #223046); color: #dce8f6;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
.stepper button:hover { border-color: #7fa3cc; }
.mode-start { width: 100%; margin-top: 6px; }

/* 匹配遮罩 */
.match-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(5,8,13,.82); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.match-panel {
  width: min(360px, 88vw); padding: 26px 24px; border-radius: 18px;
  background: linear-gradient(165deg, #1b2636, #101722);
  border: 1px solid #3a4e6a; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.match-title { font-size: 19px; font-weight: 900; letter-spacing: .1em; color: #e8f2fd; }
.match-count { font-size: 15px; color: #ffd34d; font-weight: 800; margin: 8px 0 10px; }
.match-bar {
  height: 10px; border-radius: 5px; overflow: hidden;
  background: rgba(10,14,20,.8); border: 1px solid #2a3850;
}
#matchFill {
  height: 100%; width: 0%; border-radius: 5px;
  background: linear-gradient(90deg, #4da3ff, #8fc8ff);
  transition: width .18s;
}
.match-names {
  min-height: 96px; margin: 14px 0 12px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 3px;
}
.match-name-in {
  font-size: 13px; color: #9fd08a; animation: name-in .3s ease-out;
}
@keyframes name-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (max-width: 700px) {
  .lobby-title { font-size: 26px; }
  .mode-card { width: min(340px, 92vw); }
}

/* ============================================================
   通用游戏内菜单 / Toast（替代浏览器 alert / prompt）
   ============================================================ */
.game-menu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5, 8, 13, .78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.game-menu.hidden { display: none; }
.game-menu-panel {
  width: min(420px, 94vw);
  background: linear-gradient(165deg, #1b2636, #101722);
  border: 1px solid #3a4e6a; border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.game-menu-title {
  font-size: 20px; font-weight: 900; letter-spacing: .14em;
  color: #e8f2fd; text-align: center; margin-bottom: 14px;
}
.game-menu-body { display: flex; flex-direction: column; gap: 10px; }
.game-menu-hint {
  color: #8a97ab; font-size: 13px; text-align: center; line-height: 1.5;
  margin-bottom: 2px;
}
.game-menu-field {
  display: flex; flex-direction: column; gap: 6px;
}
.game-menu-field label {
  color: var(--gold-hi); font-size: 12px; font-weight: 800; letter-spacing: .14em;
}
.game-menu-field input {
  height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid #4a5a70; background: #0f1620;
  color: #e8eef6; font-size: 15px; font-weight: 700; outline: none;
}
.game-menu-field input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,179,1,.18);
}
.menu-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left;
  background: #151c26; border: 1px solid #334056; border-radius: 12px;
  padding: 12px 14px; color: #e8eef6; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700;
  transition: border-color .15s, background .15s;
}
.menu-opt:hover:not(:disabled) { border-color: #7fa3cc; background: #1a2432; }
.menu-opt.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(245,179,1,.12), rgba(245,179,1,.04));
  box-shadow: inset 0 0 0 1px rgba(245,179,1,.25);
}
.menu-opt:disabled { opacity: .45; cursor: not-allowed; }
.menu-opt .menu-opt-main { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.menu-opt .menu-opt-title { letter-spacing: .08em; }
.menu-opt .menu-opt-sub { font-size: 12px; font-weight: 600; color: #7a8799; letter-spacing: .04em; }
.menu-opt .menu-opt-badge {
  min-width: 36px; padding: 3px 10px; border-radius: 8px;
  background: linear-gradient(180deg, #ffd34d, #f5b301);
  color: #1a1400; font-weight: 900; font-size: 15px;
  letter-spacing: .08em; text-align: center;
}
.menu-opt.active .menu-opt-badge,
.menu-opt .menu-opt-check { color: #1a1400; }
.menu-mode-grid {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.game-menu-actions {
  display: flex; gap: 10px; margin-top: 16px;
}
.game-menu-actions .btn { flex: 1; }
.game-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  transform: translateX(-50%) translateY(12px);
  max-width: min(420px, 90vw);
  padding: 12px 18px; border-radius: 12px;
  background: linear-gradient(180deg, #243246, #151d2a);
  border: 1px solid #4a6284;
  color: #e8f2fd; font-size: 14px; font-weight: 700;
  letter-spacing: .04em; text-align: center; line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.game-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.game-toast.hidden { display: none; }
