/* ==========================================================================
   AI 坦克大乱斗 · Tank Trouble Arena - 全局视觉样式表
   设计语言：战术指挥台高级感 × 《坦克动荡》清爽工程图纸美学
   零外部字体/CDN依赖，支持 file:// 离线秒开
   ========================================================================== */

:root {
  --bg-page: #edf2f7;
  --bg-grid-line: rgba(148, 163, 184, 0.16);
  --bg-surface: #ffffff;
  --bg-surface-soft: #f8fafc;
  --bg-surface-muted: #f1f5f9;
  --bg-code: #0f172a;

  --border-light: #e2e8f0;
  --border-base: #cbd5e1;
  --border-strong: #94a3b8;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --accent-primary: #6d28d9;
  --accent-primary-hover: #5b21b6;
  --accent-primary-soft: rgba(109, 40, 217, 0.09);

  --accent-battle: #e11d48;
  --accent-battle-hover: #be123c;
  --accent-amber: #d97706;
  --accent-amber-soft: #fef3c7;
  --accent-emerald: #16a34a;
  --accent-emerald-soft: #dcfce7;
  --accent-blue: #2563eb;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.18);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-main);
  background-color: var(--bg-page);
  background-image:
    linear-gradient(to right, var(--bg-grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

input,
textarea,
select {
  font-family: inherit;
  user-select: text;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-root {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ==================== 通用按钮体系 ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  line-height: 1.2;
  transition: all 0.16s ease;
  white-space: nowrap;
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn:active {
  transform: translateY(1px);
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn-xxs {
  padding: 3.5px 8px;
  font-size: 11.5px;
  border-radius: 5px;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

.btn-icon-subtle {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-base);
  background: var(--bg-surface);
  font-size: 16px;
}

.btn-icon-subtle:hover {
  background: var(--bg-surface-muted);
  border-color: var(--border-strong);
}

.btn-soft {
  background: var(--bg-surface-muted);
  border-color: var(--border-base);
  color: var(--text-secondary);
}

.btn-soft:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-surface-muted);
  border-color: var(--border-base);
  color: var(--text-main);
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-outline-primary {
  background: var(--bg-surface);
  border: 1.5px solid #7c3aed;
  color: #6d28d9;
  height: 38px;
}

.btn-outline-primary:hover {
  background: var(--accent-primary-soft);
}

.btn-outline-accent {
  background: #ffffff;
  border: 1px solid #8b5cf6;
  color: #6d28d9;
}

.btn-outline-accent:hover,
.btn-outline-accent.is-placing {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}

.btn-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 1px solid #b45309;
  height: 38px;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.25);
}

.btn-amber:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.btn-battle-cta {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 55%, #be123c 100%);
  color: #ffffff;
  border: 1px solid #9f1239;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.32);
}

.btn-battle-cta:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.42);
}

.cta-en {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.86;
  letter-spacing: 0.6px;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: #7c3aed;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.badge-subtle {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
}

/* ==================== 视图 ①：赛前战术沙盘配置大厅 ==================== */

.view-lobby {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lobby-header {
  height: 64px;
  flex-shrink: 0;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  z-index: 20;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-titles {
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.brand-sub-en {
  font-size: 12px;
  font-weight: 700;
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.08);
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.4px;
}

.brand-tagline {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 随机按钮触发旋转反馈动画 */
@keyframes diceSpinPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.06) rotate(-3deg); }
  70% { transform: scale(1.04) rotate(2deg); }
  100% { transform: scale(1); }
}

.btn-dice-anim {
  animation: diceSpinPulse 0.42s ease;
}

/* 左右分栏主工作区 */
.lobby-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 490px 1fr;
  gap: 16px;
  padding: 14px 18px;
  overflow: hidden;
}

/* 左侧配置台 */
.config-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.module-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.module-tab {
  border: 1px solid transparent;
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.module-tab:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.module-tab.active {
  background: var(--accent-primary-soft);
  border-color: rgba(109, 40, 217, 0.35);
  color: var(--accent-primary);
}

.tab-step {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.78;
}

.config-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.config-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.config-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.config-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.config-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 模块卡片通用结构 */
.config-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 13px 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.config-scroll .dual-sliders > *,
.config-scroll .corridor-scale-grid > *,
.config-scroll .preset-size-grid > *,
.config-scroll .shape-grid > *,
.config-scroll .items-arsenal-grid > *,
.config-scroll .trap-pills-grid > *,
.config-scroll .escape-time-pills > *,
.config-scroll .maze-scale-pills > *,
.config-scroll .exit-mode-grid > *,
.config-scroll .rule-switches-grid > * {
  min-width: 0;
  box-sizing: border-box;
}

.config-card.card-flash {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--border-light);
  flex-wrap: wrap;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #1e293b;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}

.card-header-btns {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.field-block {
  margin-bottom: 13px;
}

.field-block.compact-bottom {
  margin-bottom: 0;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.field-hint-badge {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: #6d28d9;
  background: var(--accent-primary-soft);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

/* 5 档地图尺寸卡片 */
.preset-size-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.size-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 4px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-base);
  background: var(--bg-surface-soft);
  color: var(--text-secondary);
  transition: all 0.14s ease;
  gap: 2px;
}

.size-card-btn:hover {
  border-color: #8b5cf6;
  background: #ffffff;
}

.size-card-btn.active {
  background: #f5f3ff;
  border-color: #7c3aed;
  color: #5b21b6;
  box-shadow: 0 0 0 1px #7c3aed;
}

.size-card-title {
  font-size: 12px;
  font-weight: 700;
}

.size-card-dim {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.size-card-btn.active .size-card-dim {
  color: #6d28d9;
}

/* 双列滑块通用布局 */
.dual-sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.slider-item {
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 7px 9px;
}

.slider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.mono-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #cbd5e1;
  border-radius: 999px;
  outline: none;
  margin: 4px 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #6d28d9;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
  cursor: pointer;
  transition: transform 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #6d28d9;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
  cursor: pointer;
}

.slider-scale-marks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}

/* 8 种地图几何形状选择器 */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.shape-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-base);
  background: var(--bg-surface-soft);
  color: var(--text-secondary);
  transition: all 0.14s ease;
}

.shape-btn:hover {
  background: #ffffff;
  border-color: #8b5cf6;
}

.shape-btn.active {
  background: #f5f3ff;
  border-color: #7c3aed;
  color: #5b21b6;
  box-shadow: 0 0 0 1px #7c3aed;
}

.shape-icon {
  font-size: 17px;
  line-height: 1;
}

.shape-name {
  font-size: 11.5px;
  font-weight: 600;
}

/* 画笔编辑工具栏 */
.brush-toolbar {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.brush-mode-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.brush-tip-icon {
  font-size: 11.5px;
  font-weight: 700;
  color: #5b21b6;
}

.pill-btn {
  border: 1px solid #c4b5fd;
  background: #ffffff;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.pill-btn.active {
  background: #6d28d9;
  color: #ffffff;
  border-color: #6d28d9;
}

.brush-quick-btns {
  display: flex;
  gap: 4px;
}

/* 行内小开关 */
.inline-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.inline-switch input {
  display: none;
}

.switch-slider {
  position: relative;
  width: 32px;
  height: 18px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.18s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.inline-switch input:checked + .switch-slider {
  background: #7c3aed;
}

.inline-switch input:checked + .switch-slider::after {
  transform: translateX(14px);
}

/* ==================== 模块 2：12 种道具军火库网格 ==================== */

.items-arsenal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.item-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-base);
  background: var(--bg-surface-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.item-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: #ffffff;
}

.item-card.enabled {
  background: #ffffff;
  border-color: var(--item-color, #6d28d9);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.item-card:not(.enabled) {
  opacity: 0.52;
  filter: grayscale(0.55);
}

.item-icon-box {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--item-bg, #f1f5f9);
  color: var(--item-color, #334155);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.item-meta-text {
  min-width: 0;
  flex: 1;
}

.item-name-line {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub-line {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-check-mark {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: transparent;
}

.item-card.enabled .item-check-mark {
  background: var(--item-color, #16a34a);
  color: #ffffff;
}

/* ==================== 模块 3：玩家参战卡片 & AI 阵容列表 ==================== */

.player-join-card {
  border: 1.5px solid var(--border-base);
  border-radius: 10px;
  padding: 11px 12px;
  background: var(--bg-surface-soft);
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.player-join-card.active {
  border-color: #22c55e;
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.35) 0%, #ffffff 48%);
}

.player-join-card.placing-highlight,
.ai-slot-card.placing-highlight {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24) !important;
}

.player-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.role-human {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.switch-lg {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.switch-lg input {
  display: none;
}

.switch-slider-lg {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.switch-slider-lg::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.switch-lg input:checked + .switch-slider-lg {
  background: #16a34a;
}

.switch-lg input:checked + .switch-slider-lg::after {
  transform: translateX(20px);
}

.player-off-hint {
  margin: 8px 0 2px;
  font-size: 12px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 7px 10px;
  border-radius: 6px;
}

.player-settings-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-base);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.roster-form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.flex-1 {
  flex: 1;
  min-width: 120px;
}

.full-width {
  width: 100%;
}

.mini-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.mini-label-inline {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-sm,
.select-sm {
  height: 31px;
  padding: 0 9px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-base);
  background: #ffffff;
  font-size: 12.5px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.input-sm:focus,
.select-sm:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

/* 操控模式 3 选 1 卡片 */
.control-scheme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.scheme-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-base);
  background: #ffffff;
  text-align: left;
  gap: 2px;
  transition: all 0.14s ease;
}

.scheme-btn strong {
  font-size: 11.5px;
  color: var(--text-main);
}

.scheme-btn span {
  font-size: 10px;
  color: var(--text-muted);
}

.scheme-btn:hover {
  border-color: #16a34a;
}

.scheme-btn.active {
  background: #f0fdf4;
  border-color: #16a34a;
  box-shadow: 0 0 0 1px #16a34a;
}

.scheme-btn.active strong {
  color: #15803d;
}

/* 颜色圆点选择器 */
.color-picker-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-swatches {
  display: flex;
  align-items: center;
  gap: 4px;
}

.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
  padding: 0;
  transition: transform 0.12s ease;
}

.swatch-dot:hover {
  transform: scale(1.18);
}

.swatch-dot.active {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px #0f172a;
}

.native-color-input {
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-base);
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

/* 位置部署栏 */
.spawn-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.pos-status-pill {
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.pos-status-pill.is-fixed {
  color: #b45309;
}

.spawn-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* AI 参战列表 */
.ai-roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mini-muted {
  font-size: 11px;
  color: var(--text-muted);
}

.ai-roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-slot-card {
  position: relative;
  border: 1px solid var(--border-base);
  border-left: 5px solid var(--tank-color, #8b5cf6);
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-slot-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-slot-index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
}

.ai-model-select {
  flex: 1;
  min-width: 110px;
  font-weight: 600;
}

.btn-remove-slot {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-light);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-slot:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.ai-slot-mid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
}

.roster-footer-actions {
  margin-bottom: 12px;
}

.btn-dashed-add {
  width: 100%;
  border: 1.5px dashed #94a3b8;
  background: var(--bg-surface-soft);
  color: var(--text-secondary);
  padding: 8px;
}

.btn-dashed-add:hover {
  border-color: #6d28d9;
  color: #6d28d9;
  background: #f5f3ff;
}

/* 赛制规则子面板 */
.rules-subpanel {
  padding-top: 11px;
  border-top: 1px dashed var(--border-base);
}

.match-mode-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.mode-pill {
  padding: 6px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-base);
  background: var(--bg-surface-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.14s ease;
}

.mode-pill:hover {
  border-color: #8b5cf6;
  background: #ffffff;
}

.mode-pill.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

.rule-switches-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-surface-soft);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
}

.rule-check-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.rule-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #6d28d9;
  cursor: pointer;
}

/* ==================== 右侧：大型实时交互式迷宫预览沙盘 ==================== */

.sandbox-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sandbox-banner {
  min-height: 44px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sandbox-banner.mode-normal {
  background: var(--bg-surface-soft);
  color: var(--text-secondary);
}

.sandbox-banner.mode-placing {
  background: #fffbeb;
  border-bottom-color: #fde68a;
  color: #92400e;
}

.sandbox-banner.mode-brush {
  background: #f5f3ff;
  border-bottom-color: #ddd6fe;
  color: #5b21b6;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.mode-placing .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.mode-brush .status-dot {
  background: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.22);
}

.preview-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, #f8fafc 0%, #eef2f6 100%);
  padding: 12px;
  overflow: hidden;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
}

.sandbox-footer {
  padding: 8px 14px;
  background: var(--bg-surface-soft);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
}

.sandbox-stats {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
}

.sandbox-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-wall-outer {
  display: inline-block;
  width: 14px;
  height: 4px;
  background: #1e293b;
  border-radius: 1px;
}

.legend-wall-inner {
  display: inline-block;
  width: 14px;
  height: 3px;
  background: #475569;
  border-radius: 1px;
}

.legend-spawn-fixed {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
}

.legend-spawn-rand {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px dashed #64748b;
}

/* ==================== 视图 ②：全屏沉浸式激战观战舞台 ==================== */

.view-battle {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #e9eef4;
  overflow: hidden;
}

.battle-topbar {
  min-height: 62px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  z-index: 30;
}

.battle-round-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.round-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.round-rule {
  font-size: 10.5px;
  color: #cbd5e1;
  white-space: nowrap;
}

/* 横向电竞计分徽章板（安全居中 + 隐藏原生滚动条） */
.battle-scoreboard {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 4px;
}

.battle-scoreboard::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.score-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 165px;
  max-width: 245px;
  padding: 5px 11px 5px 9px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid var(--border-base);
  border-left: 6px solid var(--tank-color, #8b5cf6);
  box-shadow: var(--shadow-xs);
  transition: opacity 0.22s ease, transform 0.2s ease, filter 0.22s ease;
  flex-shrink: 0;
}

.score-badge:first-child {
  margin-left: auto;
}

.score-badge:last-child {
  margin-right: auto;
}

.score-badge.is-dead {
  opacity: 0.48;
  filter: grayscale(0.45);
  background: #f1f5f9;
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.24); }
  100% { transform: scale(1); }
}

.score-badge.score-up .score-wins {
  animation: scoreBump 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  color: #e11d48;
}

.score-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.score-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-badge.is-dead .score-name {
  text-decoration: line-through;
}

.team-dot-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.team-red { background: #fee2e2; color: #b91c1c; }
.team-blue { background: #dbeafe; color: #1d4ed8; }
.team-green { background: #dcfce7; color: #15803d; }
.team-yellow { background: #fef9c3; color: #a16207; }

.score-status-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  min-height: 16px;
  white-space: nowrap;
}

.score-kills {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.weapon-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--wpn-bg, #fef2f2);
  color: var(--wpn-color, #dc2626);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

.buff-mini-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.score-wins {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
  padding-left: 4px;
  flex-shrink: 0;
}

/* 右上角赛事控制栏 */
.battle-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.battle-controls::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.battle-controls .ctrl-seg,
.ctrl-seg {
  display: inline-flex;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-base);
  border-radius: 7px;
  padding: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.battle-controls .seg-btn,
.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 5px;
  transition: all 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.seg-btn:hover {
  color: var(--text-main);
}

.seg-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.battle-controls .ctrl-actions,
.ctrl-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.battle-controls .ctrl-btn,
.ctrl-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border-base);
  background: #ffffff;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.14s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ctrl-btn:hover {
  background: var(--bg-surface-muted);
  border-color: var(--border-strong);
}

.ctrl-btn-lobby {
  background: #f8fafc;
  color: #475569;
  padding: 0 11px;
  font-size: 12.5px;
}

.ctrl-btn-lobby:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

/* 战场中央画布舞台 */
.battle-arena-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, #f4f7fa 0%, #e2e8f0 100%);
}

#battleCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 单局结算轻横幅 */
.round-banner {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 26px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  color: #ffffff;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
  z-index: 22;
  animation: bannerSlideDown 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bannerSlideDown {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.round-banner-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.round-banner-sub {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-top: 2px;
}

/* 暂停覆盖层 */
.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
}

.pause-box {
  background: #ffffff;
  padding: 24px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 1px solid var(--border-base);
}

.pause-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.pause-box h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.pause-box p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

/* 左下角玩家操控提示微胶囊 */
.maze-watch-panel {
  position: absolute;
  z-index: 19;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(52%, 26rem);
  padding: 6px 11px;
  border: 1px solid #536575;
  border-radius: 8px;
  color: #edf5f7;
  background: #152631;
  font-size: 12px;
  line-height: 1.45;
}
#trialClueControl:not([hidden]) { display: grid; gap: 5px; }
#trialClueControl[hidden] { display: none; }
#trialClueMode { width: 100%; }
#mazeClueHelp, #campDutyHelp { white-space: pre-line; }
#mazeClueHelp:empty, #campDutyHelp:empty { display: none; }
.maze-watch-panel[open] { max-height: 55%; overflow-y: auto; }
.maze-watch-panel summary { cursor: pointer; }
.maze-watch-panel summary:focus-visible { outline: 2px solid #93c5fd; }
#mazeWatchIntent:not(:empty)::after { content: ' · '; color: #a5b7be; }
.maze-watch-panel[data-tone="alert"] #mazeWatchStatus { color: #ffca80; }
.maze-watch-panel[data-tone="covered"] #mazeWatchStatus { color: #8de6bb; }
.maze-watch-panel p { margin: 5px 0 0; }
@media (max-width: 740px) {
  .maze-watch-panel { bottom: max(6px, env(safe-area-inset-bottom)); max-width: min(72%, 22rem); }
  .battle-arena-wrap.has-mobile-controls .maze-watch-panel { max-width: calc(100% - 155px); }
}

.player-hud-hint {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 18;
}

/* 右下角实时战况播报浮层 (Kill Feed) */
.kill-feed-container {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 440px;
  pointer-events: none;
  z-index: 20;
}

.kill-feed-item {
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 12.5px;
  line-height: 1.35;
  border-right: 4px solid var(--feed-accent, #8b5cf6);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  animation: feedSlideIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.kill-feed-item.fading-out {
  opacity: 0;
  transform: translateX(18px);
}

@keyframes feedSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.kf-name {
  font-weight: 800;
}

.kf-weapon {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
  font-size: 11.5px;
}

.kf-bounce-highlight {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 3px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
}

/* ==================== 模态框通用样式 ==================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-dialog {
  width: 100%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-lg {
  max-width: 820px;
}

.modal-championship {
  max-width: 720px;
}

.modal-sm {
  max-width: 440px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
  font-size: 14px;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface-muted);
  border-bottom: 1px solid var(--border-base);
  padding: 6px 16px 0;
  gap: 8px;
}

.modal-tab {
  padding: 10px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.modal-tab.active {
  background: #ffffff;
  color: #6d28d9;
  border-color: var(--border-base);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.import-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.import-label-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 220px;
}

.import-file-btns {
  display: flex;
  gap: 6px;
}

.code-editor {
  width: 100%;
  height: 220px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #334155;
  background: var(--bg-code);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.code-editor:focus {
  border-color: #8b5cf6;
}

.prompt-viewer {
  height: 270px;
  background: #0f172a;
  color: #f1f5f9;
}

.import-feedback {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 600;
}

.import-feedback.is-ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.import-feedback.is-err {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.import-submit-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.registered-models-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-base);
}

.section-mini-title {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.registered-ai-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.reg-ai-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-base);
  background: var(--bg-surface-soft);
}

.reg-ai-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reg-ai-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reg-ai-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reg-ai-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: var(--text-secondary);
}

/* Tab 2 槽位指南 */
.slot-guide-box {
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.guide-desc {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-desc code {
  background: #e2e8f0;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.slot-files-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.slot-file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--border-base);
  font-size: 12px;
}

.slot-file-chip.occupied {
  border-color: #22c55e;
  background: #f0fdf4;
}

.slot-file-chip code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #334155;
}

.slot-file-chip span {
  font-size: 11px;
  color: var(--text-muted);
}

.slot-file-chip.occupied span {
  color: #15803d;
  font-weight: 700;
}

.exam-card {
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.exam-card .guide-desc { margin: 3px 0 0; }
.exam-card summary { cursor: pointer; color: #334155; }
.exam-card details[open] summary { margin-bottom: 8px; }

.prompt-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* ==================== 冠军结算大屏 ==================== */

.champion-hero {
  padding: 24px 20px 20px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%);
  color: #ffffff;
  text-align: center;
}

.crown-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.champion-title {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}

.champion-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: #c7d2fe;
}

.honor-awards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.honor-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-base);
  text-align: center;
}

.honor-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.honor-winner {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin: 4px 0 2px;
}

.honor-metric {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: #6d28d9;
  font-weight: 700;
}

.summary-table-wrap {
  border: 1px solid var(--border-base);
  border-radius: 10px;
  overflow: hidden;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.summary-table th {
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-base);
}

.summary-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-light);
}

.summary-table tr:last-child td {
  border-bottom: none;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11.5px;
  background: #e2e8f0;
  color: #334155;
}

.rank-1 { background: #fef08a; color: #854d0e; border: 1px solid #facc15; }
.rank-2 { background: #e2e8f0; color: #1e293b; }
.rank-3 { background: #ffedd5; color: #9a3412; }

.modal-footer-center {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.modal-footer-right {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-msg {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ==================== 全局 Toast 提示 ==================== */

.toast-container {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 200;
}

body.in-battle-view .toast-container,
body:has(#battleView:not(.hidden)) .toast-container {
  top: 112px;
}

.toast-msg {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: bannerSlideDown 0.2s ease;
  transition: opacity 0.25s ease;
}

/* ==================== 双模式切换器 & 逃离与迷雾法则配置区 ==================== */

.game-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 9px 10px 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-base);
  flex-shrink: 0;
}

.game-mode-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1.5px solid var(--border-base);
  background: #ffffff;
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-xs);
}

.game-mode-btn:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.game-mode-btn .gm-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.game-mode-btn .gm-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.game-mode-btn .gm-text strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.game-mode-btn .gm-text small {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 乱斗模式激活态 */
.game-mode-btn[data-game-mode="brawl"].active {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 70%);
  border-color: #e11d48;
  box-shadow: 0 3px 12px rgba(225, 29, 72, 0.16), 0 0 0 1px rgba(225, 29, 72, 0.35);
}

.game-mode-btn[data-game-mode="brawl"].active .gm-text strong {
  color: #be123c;
}

.game-mode-btn[data-game-mode="brawl"].active .gm-text small {
  color: #e11d48;
}

/* 逃离模式激活态 */
.game-mode-btn[data-game-mode="escape"].active {
  background: linear-gradient(135deg, #ecfeff 0%, #eff6ff 75%);
  border-color: #0284c7;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.2), 0 0 0 1px rgba(2, 132, 199, 0.38);
}

.game-mode-btn[data-game-mode="escape"].active .gm-text strong {
  color: #0369a1;
}

.game-mode-btn[data-game-mode="escape"].active .gm-text small {
  color: #0284c7;
}

/* 顶部主开战按钮在逃离模式下的青蓝极光主题 */
.btn-battle-cta.is-escape-cta {
  background: linear-gradient(135deg, #06b6d4 0%, #0284c7 52%, #4f46e5 100%);
  border-color: #0369a1;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.34);
}

.btn-battle-cta.is-escape-cta:hover {
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

/* 逃离与迷雾法则卡片 */
.escape-rules-card {
  border: 1.5px solid #7dd3fc;
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.45) 0%, #ffffff 36%);
}

.escape-index {
  background: linear-gradient(135deg, #0891b2, #2563eb);
  font-size: 12px;
}

.fairness-badge {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0369a1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.exit-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.exit-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-base);
  background: #ffffff;
  text-align: left;
  transition: all 0.15s ease;
}

.exit-mode-btn:hover {
  border-color: #0284c7;
  background: #f8fafc;
}

.exit-mode-btn.active {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.35);
}

.exit-mode-btn.is-placing {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24) !important;
}

.exit-mode-btn .em-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.exit-mode-btn .em-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.exit-mode-btn .em-info strong {
  font-size: 12px;
  color: var(--text-main);
}

.exit-mode-btn.active .em-info strong {
  color: #0369a1;
}

.exit-mode-btn .em-info small {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.escape-time-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 6px;
}

.time-pill {
  padding: 5px 2px;
  border-radius: 5px;
  border: 1px solid var(--border-base);
  background: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  transition: all 0.14s ease;
}

.time-pill:hover {
  border-color: #0284c7;
}

.time-pill.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.escape-switches {
  background: rgba(240, 249, 255, 0.72);
  border-color: #bae6fd;
}

/* 沙盘出口放置提示条与撤离门图例 */
.sandbox-banner.mode-exit-placing {
  background: #ecfeff;
  border-bottom-color: #67e8f9;
  color: #0e7490;
}

.mode-exit-placing .status-dot {
  background: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.25);
}

.legend-exit-chip {
  color: #0369a1;
  font-weight: 700;
}

.legend-exit-gate {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 25%, #06b6d4 75%);
  border: 1.5px solid #0284c7;
}

/* ==================== 计分板专属纹章头像 & 点击切换主视角 ==================== */

.tank-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 1px 3px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.tank-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tank-avatar-dead-mark {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.62);
  color: #f87171;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.score-badge.is-dead .tank-avatar {
  filter: grayscale(0.88);
}

.score-badge.is-dead .tank-avatar-dead-mark {
  display: flex;
}

.score-badge.is-clickable {
  cursor: pointer;
}

.score-badge.is-clickable:hover {
  transform: translateY(-1px);
  border-color: #64748b;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.score-badge.is-locked-pov {
  cursor: not-allowed;
}

@keyframes povGlowPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.34), 0 4px 12px rgba(14, 165, 233, 0.16);
  }
  50% {
    box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.48), 0 4px 16px rgba(245, 158, 11, 0.24);
  }
}

.score-badge.is-following,
.score-badge.is-inspected {
  border-color: #0284c7;
  background: linear-gradient(135deg, #f0f9ff 0%, #fffbeb 100%);
  animation: povGlowPulse 2.2s ease-in-out infinite;
}

.pov-slot {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.pov-slot:empty {
  display: none;
}

.pov-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
  flex-shrink: 0;
}

.pov-mini-badge.pov-follow {
  background: linear-gradient(135deg, #d97706, #ea580c);
}

/* ==================== 激战舞台顶栏逃离倒计时 & 主视角导播栏 ==================== */

.battle-left-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.escape-timer-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1.5px solid #0284c7;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

.escape-timer-box .et-icon {
  font-size: 14px;
  line-height: 1;
}

@keyframes collapseAlertBlink {
  0%, 100% {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border-color: #f59e0b;
    color: #fef08a;
    transform: scale(1);
  }
  50% {
    background: linear-gradient(135deg, #dc2626, #ea580c);
    border-color: #fde047;
    color: #ffffff;
    transform: scale(1.04);
  }
}

.escape-timer-box.is-collapsing {
  animation: collapseAlertBlink 0.75s ease-in-out infinite;
}

.perspective-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
  color: #0c4a6e;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perspective-pill .exit-locked-tag {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #b45309;
  font-size: 10.5px;
  font-weight: 800;
}

.ctrl-btn.is-active {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.ctrl-btn.ctrl-btn-follow.is-active {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
}

.ctrl-btn.ctrl-btn-joy.is-active {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

.ctrl-btn.is-locked {
  opacity: 0.52;
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.kf-escape-tag {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 4px;
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
}

/* ==================== 手机端多点触控虚拟摇杆手柄 (#mobileControls) ==================== */

.mobile-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 21;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px max(20px, env(safe-area-inset-right, 20px)) max(18px, env(safe-area-inset-bottom, 18px)) max(20px, env(safe-area-inset-left, 20px));
  user-select: none;
  -webkit-user-select: none;
}

/* 左下角 360° 全向矢量虚拟摇杆热区 */
.touch-joystick-zone {
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
  position: relative;
  width: 164px;
  height: 164px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.joystick-base {
  position: relative;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.34) 0%, rgba(15, 23, 42, 0.56) 100%);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25), inset 0 0 14px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.joystick-base.state-aim {
  border-color: rgba(251, 191, 36, 0.85);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35), inset 0 0 14px rgba(251, 191, 36, 0.18);
}

.joystick-base.state-move {
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.38), inset 0 0 16px rgba(34, 197, 94, 0.2);
}

/* 28% 微调瞄准分界环 */
.joystick-aim-ring {
  position: absolute;
  width: 46%;
  height: 46%;
  border-radius: 50%;
  border: 1.2px dashed rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

/* 12% 中心死区环 */
.joystick-dead-ring {
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.joystick-crosshair {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.joystick-crosshair.ch-h {
  width: 82%;
  height: 1px;
}

.joystick-crosshair.ch-v {
  width: 1px;
  height: 82%;
}

.joystick-knob {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f8fafc 0%, #cbd5e1 55%, #64748b 100%);
  border: 2.5px solid #0f172a;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  pointer-events: none;
}

.joystick-base.state-aim .joystick-knob {
  border-color: #f59e0b;
}

.joystick-base.state-move .joystick-knob {
  border-color: #16a34a;
}

.knob-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf8 0%, #2563eb 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.65);
}

.joystick-state-tag {
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: rgba(248, 250, 252, 0.9);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  pointer-events: none;
  white-space: nowrap;
}

/* 右下角双触控动作键区域 */
.touch-action-zone {
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 6px;
}

.touch-btn {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.touch-btn-reverse {
  width: 60px;
  height: 60px;
  background: rgba(15, 23, 42, 0.64);
  border: 2px solid rgba(255, 255, 255, 0.42);
  color: #f8fafc;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.3);
  gap: 1px;
}

.touch-btn-reverse .touch-rev-icon {
  font-size: 18px;
  line-height: 1;
}

.touch-btn-reverse .touch-rev-label {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.92;
}

.touch-btn-reverse.is-pressed {
  transform: scale(0.91);
  background: rgba(217, 119, 6, 0.85);
  border-color: #fde68a;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.55);
}

.touch-btn-fire {
  --fire-accent: #e11d48;
  width: 88px;
  height: 88px;
  background: radial-gradient(circle at 35% 30%, rgba(244, 63, 94, 0.88) 0%, rgba(190, 18, 60, 0.9) 100%);
  border: 3px solid rgba(255, 255, 255, 0.68);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.42), 0 0 0 5px rgba(225, 29, 72, 0.18);
  gap: 2px;
}

.touch-btn-fire.has-special-weapon {
  background: radial-gradient(circle at 35% 30%, var(--fire-accent) 0%, rgba(15, 23, 42, 0.92) 100%);
  border-color: #fde047;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.45), 0 0 0 5px rgba(250, 204, 21, 0.28);
}

.touch-btn-fire.is-pressed {
  transform: scale(0.9);
  filter: brightness(1.14);
  box-shadow: 0 0 24px var(--fire-accent), 0 0 0 8px rgba(255, 255, 255, 0.25);
}

.touch-fire-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.touch-fire-ammo {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 当屏幕底部虚拟手柄激活时，自动避让左下提示胶囊、右下开火区与右上角雷达小地图（移至左上角） */
.battle-arena-wrap.has-mobile-controls .player-hud-hint {
  display: none !important;
}

.battle-arena-wrap.has-mobile-controls .kill-feed-container {
  top: 10px;
  left: 10px;
  right: auto;
  bottom: auto;
  align-items: flex-start;
  max-width: min(320px, calc(100vw - 165px));
}

.battle-arena-wrap.has-mobile-controls .kill-feed-item {
  border-right: none;
  border-left: 4px solid var(--feed-accent, #8b5cf6);
  padding: 5px 10px;
  font-size: 11.5px;
}

#battleCanvas,
#previewCanvas {
  touch-action: none;
}

/* ==================== 响应式断点兼容（桌面中屏 / 平板 / 手机竖屏 / 手机横屏全覆盖） ==================== */

/* 1440×900 等中宽桌面与平板竖屏：双层优雅顶栏，第2行100%全宽安全居中展示选手头像与全名 */
@media (max-width: 1520px) and (min-height: 520px) {
  .battle-topbar {
    flex-wrap: wrap;
    min-height: 0;
    padding: 5px 12px;
    gap: 6px 10px;
  }

  .battle-left-hud {
    order: 1;
  }

  .battle-controls {
    order: 2;
    margin-left: auto;
  }

  .battle-scoreboard {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
  }
}

@media (max-width: 1220px) {
  .lobby-main {
    grid-template-columns: 440px 1fr;
    gap: 12px;
    padding: 10px 12px;
  }
  .brand-tagline {
    display: none;
  }
  .perspective-pill {
    max-width: 220px;
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  .app-root {
    height: auto;
    min-height: 100dvh;
  }

  /* 大厅手机/平板单列顺滑布局：沙盘置顶 (42vh) + 配置区自然滚动 */
  .view-lobby {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .lobby-header {
    position: sticky;
    top: 0;
    height: auto;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-sub-en {
    display: none;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
  }

  .header-actions .btn {
    flex: 1 1 auto;
    min-height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .header-actions .btn-icon-subtle {
    flex: 0 0 38px;
  }

  .cta-en {
    display: none;
  }

  .lobby-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
    overflow: visible;
  }

  /* 沙盘置顶，方便手机边调配置边看地图与单指点选部署 */
  .sandbox-stage {
    order: -1;
    height: 42vh;
    min-height: 255px;
    max-height: 390px;
    flex-shrink: 0;
  }

  .sandbox-banner {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .preview-canvas-wrap {
    padding: 6px;
  }

  .sandbox-footer {
    padding: 6px 10px;
    font-size: 10.5px;
    gap: 6px;
  }

  .config-sidebar {
    max-height: none;
    overflow: visible;
  }

  .config-scroll {
    overflow: visible;
    max-height: none;
    padding: 10px;
  }

  /* 触控热区友好增强 */
  input[type="range"] {
    height: 8px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  /* 激战舞台在手机竖屏下严格锁死 100dvh 零溢出 */
  .view-battle {
    position: fixed;
    inset: 0;
    height: 100dvh;
    z-index: 50;
  }

  .battle-topbar {
    flex-wrap: wrap;
    min-height: 0;
    padding: 5px 10px;
    gap: 6px 8px;
  }

  .battle-left-hud {
    order: 1;
    gap: 6px;
    min-width: 0;
  }

  .perspective-pill {
    max-width: 190px;
    font-size: 10.5px;
    padding: 3px 8px;
  }

  .battle-controls {
    order: 2;
    margin-left: auto;
    gap: 5px;
    overflow-x: auto;
    max-width: 100%;
  }

  .battle-scoreboard {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 0 2px;
  }

  .score-badge {
    min-width: 142px;
    max-width: 195px;
    padding: 4px 8px 4px 6px;
    gap: 7px;
  }

  .tank-avatar {
    width: 28px;
    height: 28px;
  }

  .score-name {
    font-size: 12px;
  }

  .score-wins {
    font-size: 19px;
  }

  .speed-group .seg-btn {
    padding: 3px 5px;
    font-size: 11px;
  }

  .zoom-group .seg-btn {
    padding: 3px 6px;
    font-size: 11px;
  }

  .ctrl-btn {
    height: 29px;
    min-width: 29px;
    padding: 0 6px;
    font-size: 11.5px;
  }

  /* 弹窗移动端适配 */
  .modal-backdrop {
    padding: 10px;
  }

  .modal-dialog {
    max-height: 92dvh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 12px 14px;
  }

  .modal-tabs {
    grid-template-columns: 1fr;
    padding: 6px 10px;
    gap: 4px;
  }

  .modal-tab {
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 7px 10px;
    font-size: 12px;
  }

  .registered-ai-list,
  .slot-files-grid {
    grid-template-columns: 1fr;
  }

  .honor-awards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-table-wrap {
    overflow-x: auto;
  }

  .summary-table {
    min-width: 520px;
  }
}

/* 窄视口控制组统一精简内边距与辅助副文案 */
@media (max-width: 920px) {
  .battle-controls {
    gap: 4px;
  }

  .battle-controls .seg-btn,
  .seg-btn {
    padding: 2px 5px;
    font-size: 10.5px;
  }

  .battle-controls .ctrl-actions,
  .ctrl-actions {
    gap: 3px;
  }

  .battle-controls .ctrl-btn,
  .ctrl-btn {
    height: 27px;
    min-width: 27px;
    padding: 0 5px;
    font-size: 11px;
    gap: 2px;
  }

  .ctrl-btn .ctrl-sub {
    display: none;
  }
}

/* 手机竖屏（390×844 等）：三行紧凑精致顶栏，所有按钮单行清晰不折行、隐藏滚动条 */
@media (max-width: 760px) and (min-height: 500px) {
  body.in-battle-view .toast-container,
  body:has(#battleView:not(.hidden)) .toast-container {
    top: 138px;
  }

  .battle-topbar {
    flex-wrap: wrap;
    min-height: 0;
    padding: 4px 6px;
    gap: 4px 6px;
  }

  .battle-left-hud {
    order: 1;
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    gap: 4px;
    overflow: hidden;
  }

  .round-rule,
  .perspective-pill {
    display: none !important;
  }

  .battle-round-box,
  .escape-timer-box {
    padding: 2px 6px;
    font-size: 11px;
    flex-shrink: 0;
  }

  #mazeCycleBadge.maze-cycle-badge {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 108px);
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 6px;
    font-size: 10.5px;
    gap: 4px;
  }

  #mazeCycleBadge .mc-lbl {
    display: none;
  }

  .battle-controls {
    order: 2;
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    overflow-x: auto;
    margin-left: 0;
    gap: 3px;
    scrollbar-width: none;
  }

  .battle-controls .seg-btn,
  .seg-btn {
    padding: 2px 3.5px;
    font-size: 10px;
  }

  .battle-controls .ctrl-actions,
  .ctrl-actions {
    gap: 3px;
  }

  .battle-controls .ctrl-btn,
  .ctrl-btn {
    height: 26px;
    min-width: 25px;
    padding: 0 4px;
    font-size: 10.5px;
  }

  .ctrl-btn-vision .ctrl-txt,
  .ctrl-btn-follow .ctrl-txt,
  .ctrl-btn-joy .ctrl-txt,
  .ctrl-btn .ctrl-sub {
    display: none;
  }

  .ctrl-btn-lobby {
    padding: 0 5px;
    font-size: 10.5px;
  }

  .battle-scoreboard {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    gap: 6px;
    border-top: none;
    padding-top: 0;
  }

  .score-badge {
    min-width: 124px;
    max-width: 172px;
    padding: 3px 7px 3px 5px;
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .preset-size-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dual-sliders {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .items-arsenal-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .control-scheme-grid {
    grid-template-columns: 1fr;
  }

  .exit-mode-grid {
    grid-template-columns: 1fr;
  }

  .ai-slot-mid {
    grid-template-columns: 1fr 1fr auto;
  }

  .header-actions .btn-label-text {
    font-size: 12px;
  }

  /* 手机竖屏手柄紧凑间距 */
  .mobile-controls {
    padding: 10px max(12px, env(safe-area-inset-right, 12px)) max(14px, env(safe-area-inset-bottom, 14px)) max(12px, env(safe-area-inset-left, 12px));
  }

  .touch-joystick-zone {
    width: 142px;
    height: 142px;
  }

  .joystick-base {
    width: 112px;
    height: 112px;
  }

  .joystick-knob {
    width: 46px;
    height: 46px;
  }

  .touch-btn-reverse {
    width: 54px;
    height: 54px;
  }

  .touch-btn-fire {
    width: 78px;
    height: 78px;
  }
}

/* 手机横屏黄金战斗比例（max-height: 519px，如 844×390）专项优化：保持紧凑单行留足迷宫高度 */
@media (max-height: 519px) {
  html,
  body {
    overflow: hidden;
    height: 100%;
  }

  .view-lobby {
    height: 100dvh;
    overflow: hidden;
  }

  .lobby-header {
    height: 46px;
    padding: 0 12px;
    flex-wrap: nowrap;
  }

  .header-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  .lobby-main {
    display: grid;
    grid-template-columns: 360px 1fr;
    flex: 1;
    min-height: 0;
    padding: 6px 10px;
    gap: 8px;
    overflow: hidden;
  }

  .sandbox-stage {
    order: 0;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .config-sidebar {
    min-height: 0;
    overflow: hidden;
  }

  .config-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
  }

  body.in-battle-view .toast-container,
  body:has(#battleView:not(.hidden)) .toast-container {
    top: 54px;
  }

  .view-battle {
    position: fixed;
    inset: 0;
    height: 100dvh;
  }

  .battle-topbar {
    flex-wrap: nowrap;
    min-height: 42px;
    padding: 3px 6px;
    gap: 5px;
  }

  .battle-left-hud {
    order: 0;
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    gap: 4px;
    overflow: hidden;
  }

  .round-rule,
  .perspective-pill {
    display: none !important;
  }

  .battle-round-box,
  .escape-timer-box {
    padding: 2px 6px;
    font-size: 11px;
    flex-shrink: 0;
  }

  #mazeCycleBadge.maze-cycle-badge {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 6px;
    font-size: 10.5px;
    gap: 4px;
  }

  #mazeCycleBadge .mc-lbl {
    display: none;
  }

  .battle-scoreboard {
    order: 0;
    flex: 1 1 150px;
    width: auto;
    min-width: 135px;
    gap: 4px;
    justify-content: flex-start;
    border-top: none;
    padding-top: 1px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .battle-controls {
    order: 0;
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }

  .battle-controls .seg-btn,
  .seg-btn {
    padding: 2px 4px;
    font-size: 10px;
  }

  .battle-controls .ctrl-actions,
  .ctrl-actions {
    gap: 3px;
  }

  .battle-controls .ctrl-btn,
  .ctrl-btn {
    height: 25px;
    min-width: 25px;
    padding: 0 4px;
    font-size: 10.5px;
  }

  .ctrl-btn-vision .ctrl-txt,
  .ctrl-btn-follow .ctrl-txt,
  .ctrl-btn-joy .ctrl-txt,
  .ctrl-btn .ctrl-sub {
    display: none;
  }

  .ctrl-btn-lobby {
    padding: 0 6px;
    font-size: 10.5px;
  }

  .score-badge {
    min-width: 112px;
    max-width: 146px;
    padding: 2px 6px 2px 4px;
    gap: 5px;
  }

  .score-name {
    font-size: 11.5px;
  }

  .tank-avatar {
    width: 22px;
    height: 22px;
  }

  .score-wins {
    font-size: 15px;
  }

  .mobile-controls {
    padding: 8px max(18px, env(safe-area-inset-right, 18px)) max(10px, env(safe-area-inset-bottom, 10px)) max(18px, env(safe-area-inset-left, 18px));
  }

  .touch-joystick-zone {
    width: 128px;
    height: 128px;
  }

  .joystick-base {
    width: 102px;
    height: 102px;
  }

  .joystick-knob {
    width: 42px;
    height: 42px;
  }

  .joystick-state-tag {
    display: none;
  }

  .touch-btn-reverse {
    width: 50px;
    height: 50px;
  }

  .touch-btn-fire {
    width: 72px;
    height: 72px;
  }

  .touch-fire-icon {
    font-size: 22px;
  }
}

/* ==========================================================================
   v3.0 升级样式：256×256 百格迷城 ·《移动迷宫》机关怪物 · 战报与模型进化工坊
   ========================================================================== */

/* 顶栏战报按钮与进化 CTA 按钮 */
.btn-outline-teal {
  background: var(--bg-surface);
  border: 1.5px solid #0d9488;
  color: #0f766e;
  height: 38px;
}

.btn-outline-teal:hover {
  background: rgba(13, 148, 136, 0.09);
  border-color: #0f766e;
}

.badge-teal {
  background: #0d9488;
}

.btn-evo-cta {
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 60%, #4f46e5 100%);
  color: #ffffff;
  border: 1px solid #0f766e;
  height: 40px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
}

.btn-evo-cta:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.38);
}

.btn-danger-hover:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.match-end-footer-wrap {
  flex-wrap: wrap;
}

/* 多档战场尺寸卡片自适应排布（兼容 7~9 档百格/二百格预设） */
.preset-size-grid {
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
}

.shape-btn[data-shape-id="maze_runner"] {
  border-color: rgba(13, 148, 136, 0.48);
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}

.shape-btn[data-shape-id="maze_runner"].active {
  background: linear-gradient(135deg, #ccfbf1 0%, #f0fdfa 100%);
  border-color: #0d9488;
  color: #0f766e;
  box-shadow: 0 0 0 1px #0d9488;
}

.shape-btn[data-shape-id="maze_runner"] .shape-name {
  font-size: 10.5px;
  letter-spacing: -0.2px;
}

/* 行列滑块旁精准数字输入框 (6 ~ 256) */
.dim-input-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dim-num-input {
  width: 56px;
  height: 24px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--border-base);
  background: #ffffff;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.dim-num-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.dim-unit-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* 🏛️ 《移动迷宫》电影原版试炼专区 + 4 档真实宏伟尺度胶囊 */
.maze-runner-preset-box {
  margin-bottom: 13px;
  padding: 9px;
  border-radius: 10px;
  background: linear-gradient(145deg, #0f172a 0%, #134e4a 65%, #115e59 100%);
  border: 1px solid #0d9488;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-maze-runner-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid rgba(94, 234, 212, 0.36);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  text-align: left;
  transition: all 0.16s ease;
}

.btn-maze-runner-banner:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #5eead4;
  transform: translateY(-1px);
}

.mr-banner-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.mr-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mr-banner-body strong {
  font-size: 13px;
  font-weight: 800;
  color: #f0fdfa;
  letter-spacing: 0.2px;
}

.mr-banner-body small {
  font-size: 10.5px;
  color: #99f6e4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mr-banner-tag {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.maze-scale-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.mr-scale-pill {
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid rgba(153, 246, 228, 0.25);
  background: rgba(15, 23, 42, 0.42);
  color: #ccfbf1;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  transition: all 0.14s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mr-scale-pill:hover {
  background: rgba(20, 184, 166, 0.28);
  border-color: #5eead4;
  color: #ffffff;
}

.mr-scale-pill.active {
  background: #14b8a6;
  border-color: #99f6e4;
  color: #042f2e;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(153, 246, 228, 0.45);
}

/* 7 档逃离时限胶囊布局 */
.escape-time-pills-v3 {
  grid-template-columns: repeat(4, 1fr);
}

.escape-limit-input, .custom-phase-fields:not([hidden]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}
.escape-limit-input { margin-top: 8px; }
.escape-limit-input input, .custom-phase-fields input { width: 78px; }
.custom-phase-fields { flex-basis: 100%; }
.escape-limit-input input:invalid, .custom-phase-fields input:invalid {
  border-color: #b91c1c;
}

/* 🦂 迷宫昼夜轮回、怪物猎杀与四大机关陷阱配置区 */
.maze-hazard-panel {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid #bae6fd;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hazard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hazard-row-split {
  padding-top: 7px;
  border-top: 1px dashed #e2e8f0;
}

.mini-seg-pills {
  display: inline-flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 6px;
  gap: 2px;
}

.mini-seg-pills.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.mini-seg-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.mini-seg-pill.active {
  background: #dc2626;
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.hazard-traps-block {
  flex-direction: column;
  align-items: stretch;
  padding-top: 7px;
  border-top: 1px dashed #e2e8f0;
  gap: 6px;
}

.hazard-traps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trap-pills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  transition: opacity 0.16s ease;
}

.trap-pills-grid.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.trap-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px dashed var(--border-base);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  transition: all 0.14s ease;
}

.trap-pill:hover {
  border-color: #64748b;
  color: var(--text-main);
}

.trap-pill.active[data-trap="spike"] {
  border-style: solid;
  border-color: #475569;
  background: #f1f5f9;
  color: #1e293b;
}

.trap-pill.active[data-trap="mire"] {
  border-style: solid;
  border-color: #65a30d;
  background: #ecfccb;
  color: #3f6212;
}

.trap-pill.active[data-trap="saw"] {
  border-style: solid;
  border-color: #e11d48;
  background: #ffe4e6;
  color: #9f1239;
}

.trap-pill.active[data-trap="laser_trip"] {
  border-style: solid;
  border-color: #f43f5e;
  background: #fff1f2;
  color: #be123c;
}

/* 沙盘百格预览右上角微缩缩放平移悬浮工具条 */
.sandbox-zoom-bar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-base);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.sb-zoom-btn,
.sb-zoom-reset {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  height: 25px;
  border-radius: 5px;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.sb-zoom-btn {
  width: 26px;
  font-size: 13px;
}

.sb-zoom-reset {
  padding: 0 8px;
}

.sb-zoom-btn:hover,
.sb-zoom-reset:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.sb-zoom-reset.is-zoomed {
  background: #0f172a;
  color: #ffffff;
}

/* 激战顶栏 HUD 昼夜轮回与存活鬼火兽微胶囊 (#mazeCycleBadge) */
.battle-left-hud {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.battle-left-hud::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.maze-cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  border: 1.5px solid #10b981;
  background: #ecfdf5;
  color: #065f46;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.maze-cycle-badge.phase-day {
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border-color: #10b981;
  color: #065f46;
}

@keyframes duskPulseWarn {
  0%, 100% {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
  }
  50% {
    background: #fef3c7;
    border-color: #ea580c;
    color: #9a3412;
  }
}

.maze-cycle-badge.phase-dusk {
  animation: duskPulseWarn 0.9s ease-in-out infinite;
}

.maze-cycle-badge.phase-night {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border-color: #818cf8;
  color: #e0e7ff;
  box-shadow: 0 2px 8px rgba(30, 27, 75, 0.26);
}

.maze-cycle-badge.phase-monsters-only {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.mc-time-mono {
  font-family: var(--font-mono);
  font-weight: 900;
}

.mc-monster-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.maze-cycle-badge.phase-night .mc-monster-chip {
  background: rgba(239, 68, 68, 0.28);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

/* ==================== 模态框 3：📊 历史对战记录与坦克模型进化工坊 (#recordsModal) ==================== */

.modal-xl {
  max-width: 980px;
}

.records-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.records-tabs-bar {
  grid-template-columns: repeat(3, 1fr);
}

.records-modal-body {
  min-height: 380px;
  background: #f8fafc;
}

/* Tab 1: KPI 概览卡片与生涯模型列表 */
.rec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.rec-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
}

.rec-kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.rec-kpi-val {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
}

.rec-kpi-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-light);
}

.rec-profiles-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-empty-box {
  background: #ffffff;
  border: 1.5px dashed var(--border-base);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
}

.rec-empty-box h4 {
  margin: 8px 0 6px;
  font-size: 15px;
  color: var(--text-main);
}

.rec-empty-box p {
  margin: 0;
  font-size: 12.5px;
}

.rec-profile-card {
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-left: 5px solid var(--prof-color, #8b5cf6);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}

.rec-prof-main {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rec-prof-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rec-prof-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--prof-color, #8b5cf6);
  flex-shrink: 0;
}

.rec-prof-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.rec-prof-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}

.rec-prof-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.rec-prof-metrics strong {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.rec-prof-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.weakness-chip,
.cause-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--chip-bg, #f1f5f9);
  color: var(--chip-color, #334155);
  border: 1px solid rgba(15, 23, 42, 0.08);
  white-space: nowrap;
}

.btn-evo-mini {
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  color: #ffffff;
  border: 1px solid #0f766e;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.22);
}

.btn-evo-mini:hover {
  filter: brightness(1.08);
}

/* Tab 2: 每局详细战报回溯 */
.rec-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-radius: 9px;
  flex-wrap: wrap;
}

.rec-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rec-rounds-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-round-card {
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-radius: 9px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.rec-round-summary {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.rec-round-summary:hover {
  background: #f8fafc;
}

.rec-round-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.rec-round-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.rec-mode-badge {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.rec-mode-badge.is-escape {
  background: #e0f2fe;
  color: #0369a1;
}

.rec-mode-badge.is-brawl {
  background: #ffe4e6;
  color: #be123c;
}

.rec-mode-badge.is-maze {
  background: #ccfbf1;
  color: #0f766e;
}

.rec-round-meta-right {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rec-round-tanks-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rec-tank-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  font-size: 11.5px;
}

.rec-tank-pill.is-winner {
  background: #f0fdf4;
  border-color: #86efac;
}

.rec-round-detail {
  padding: 10px 12px 12px;
  border-top: 1px dashed var(--border-base);
  background: #f8fafc;
  font-size: 12px;
}

.rec-timeline-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rec-timeline-list code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #0369a1;
}

/* Tab 3: 🧬 模型升级 Prompt 生成器 */
.evo-controls-card {
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}

.evo-ctrl-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.evo-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.evo-field-model {
  flex: 1;
  min-width: 220px;
}

.evo-model-select {
  height: 35px;
  font-weight: 700;
}

.evo-focus-pills {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.evo-focus-pill {
  padding: 7px 11px;
  border-radius: 7px;
  border: 1px solid var(--border-base);
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.14s ease;
}

.evo-focus-pill:hover {
  border-color: #0d9488;
  background: #ffffff;
}

.evo-focus-pill.active {
  background: #0d9488;
  border-color: #0f766e;
  color: #ffffff;
}

.evo-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
  flex-wrap: wrap;
}

.evo-diagnosis-panel {
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}

.cause-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  display: flex;
  margin: 8px 0;
}

.cause-bar-seg {
  height: 100%;
  transition: width 0.25s ease;
}

.cause-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.evo-rx-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.evo-rx-card {
  padding: 9px 11px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-left: 4px solid #0d9488;
}

.evo-rx-card.sev-high {
  border-left-color: #e11d48;
  background: #fff1f2;
}

.evo-rx-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.evo-rx-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.evo-prompt-box {
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
}

.evo-action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.evo-prompt-textarea {
  height: 250px;
  margin-top: 8px;
}

.records-modal-footer {
  padding: 10px 18px;
  background: #ffffff;
  border-top: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.records-maint-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* v3.0 移动端与小视口响应式精细调优 */
@media (max-width: 900px) {
  .rec-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .records-tabs-bar {
    grid-template-columns: 1fr;
  }

  .maze-cycle-badge {
    padding: 3px 8px;
    font-size: 11px;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .maze-scale-pills,
  .trap-pills-grid {
    grid-template-columns: 1fr;
  }

  .escape-time-pills-v3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .sandbox-zoom-bar {
    top: 8px;
    right: 8px;
  }
}

@media (max-height: 519px) {
  .maze-cycle-badge {
    padding: 2px 7px;
    font-size: 11px;
  }
}

/* ==================== v3.5 千格百万迷城 · 走廊宽度卡片与血月/密钥 HUD ==================== */
.corridor-scale-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.corridor-card-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border-base);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  box-shadow: var(--shadow-xs);
  position: relative;
}

.corridor-card-btn:hover {
  border-color: #93c5fd;
  background: #f8fafc;
  transform: translateY(-1px);
}

.corridor-card-btn.active {
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.14);
}

.corridor-card-btn[data-corridor="cinema"].active {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.18);
}

.corridor-card-btn[data-corridor="colossus"].active {
  border-color: #d97706;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.18);
}

.cc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.cc-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.cc-size-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
  flex-shrink: 0;
}

.corridor-card-btn.active .cc-size-pill {
  background: #dbeafe;
  color: #1d4ed8;
}

.corridor-card-btn[data-corridor="cinema"].active .cc-size-pill {
  background: #d1fae5;
  color: #065f46;
}

.corridor-card-btn[data-corridor="colossus"].active .cc-size-pill {
  background: #fde68a;
  color: #92400e;
}

.cc-sub {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* 第 3 夜血月破门警报与密钥破译进度胶囊 */
.maze-cycle-badge.phase-bloodmoon {
  background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
  border-color: #ef4444;
  color: #fecaca;
  animation: pulseBloodMoon 0.85s ease-in-out infinite alternate;
}

@keyframes pulseBloodMoon {
  from {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
  }
  to {
    box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.65);
  }
}

.mc-cipher-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #0e7490;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.maze-cycle-badge.phase-night .mc-cipher-chip,
.maze-cycle-badge.phase-bloodmoon .mc-cipher-chip {
  background: rgba(34, 211, 238, 0.22);
  border-color: rgba(103, 232, 249, 0.55);
  color: #a5f3fc;
}

.mc-cipher-chip.unlocked {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.55);
  color: #047857;
}

.maze-cycle-badge.phase-night .mc-cipher-chip.unlocked,
.maze-cycle-badge.phase-bloodmoon .mc-cipher-chip.unlocked {
  color: #6ee7b7;
}

@media (max-width: 560px) {
  .corridor-scale-grid {
    grid-template-columns: 1fr;
  }
}


/* 逃离规则、涂装与多视角观战 */
.v4-escape-rules, .v4-escape-rules label, .roster-shortcuts, .ai-skin-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.v4-escape-rules label, .corridor-tuners label { font-size: 12px; font-weight: 600; }
.roster-shortcuts { margin-bottom: 12px; }
.corridor-tuners {
  display: grid; grid-template-columns: auto minmax(60px, 1fr) 64px;
  align-items: center; gap: 6px 14px; margin-top: 12px;
}
.corridor-tuners input { width: 100%; min-width: 0; }
.skin-gallery-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin: 6px 0; }
.skin-gallery-grid button {
  min-width: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 3px; padding: 4px; border: 1px solid var(--border-base); border-radius: 7px;
  background: white; color: #475569; font-size: 11px; cursor: pointer;
}
.skin-gallery-grid button[aria-pressed="true"] { background: #f5f3ff; border-color: #8b5cf6; color: #5b21b6; }
.skin-gallery-grid svg, .ai-skin-avatar svg { width: 26px; height: 26px; display: block; }
.ai-skin-row { margin: 6px 0; }
.ai-skin-row select { flex: 1; min-width: 0; }
.champion-avatars svg { width: 42px; height: 42px; margin: 4px; }
#perspectiveStatusPill { white-space: nowrap; max-width: 310px; overflow: hidden; text-overflow: ellipsis; }
.armor-meter { width: 35px; height: 7px; vertical-align: middle; }
.pip-wall-container {
  position: absolute; left: 8px; top: 8px; z-index: 5; display: grid;
  grid-template-columns: minmax(0, min(188px, 21vw)); gap: 4px; max-height: 75%; overflow: auto;
}
.pip-wall-container.matrix { grid-template-columns: repeat(2, minmax(0, min(154px, 16vw))); }
.pip-card {
  position: relative; background: #172033; color: white; border: 1px solid #475569;
  border-radius: 6px; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
}
.pip-card:focus-visible, .pip-card:hover:enabled { outline: 2px solid var(--tank-color); outline-offset: -2px; }
.pip-canvas { display: block; width: 100%; height: auto; aspect-ratio: 18 / 11; }
.pip-info {
  position: absolute; top: 0; left: 0; right: 0; background: rgba(15,23,42,.85);
  display: flex; align-items: center; justify-content: space-between; gap: 3px;
  padding: 2px 5px; border-left: 3px solid var(--tank-color); font-size: 10px;
}
.pip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pip-info small { flex-shrink: 0; }
.pip-hp { position: absolute; bottom: 3px; left: 5%; width: 90%; height: 5px; }
.pip-message { display: none; }
.pip-locked { cursor: default; background: repeating-linear-gradient(135deg,#182235 0px,#182235 5px,#1e293b 5px,#1e293b 9px); }
.pip-locked canvas { visibility: hidden; }
.pip-locked .pip-message { display: block; position: absolute; top: 53%; width: 100%; text-align: center; font-size: 10px; }
@media (max-width: 920px) and (max-height: 500px) {
  .battle-topbar { padding: 4px 8px; gap: 6px; }
  .battle-controls .ctrl-btn .ctrl-txt { display: none; }
  .battle-controls .seg-btn { padding-inline: 2px; }
  .pip-wall-container { max-height: 48%; }
}
@media (max-width: 480px) {
  .battle-controls .ctrl-btn, .battle-controls .seg-btn { padding-inline: 2px; font-size: 11px; }
  .battle-controls .ctrl-actions { gap: 1px; }
  .battle-controls .ctrl-btn { min-width: 22px; }
  .battle-controls .ctrl-btn .ctrl-txt { display: none; }
  .pip-wall-container { grid-template-columns: minmax(0,27vw); }
  .pip-wall-container.matrix { grid-template-columns: repeat(2,minmax(0,22vw)); }
}

@media (max-width: 370px) {
  .battle-controls { flex-wrap: wrap; }
}

.remote-driver {
  border-top: 1px solid #dbe4ef;
  padding: 6px 0 0;
  font-size: 12px;
  color: #334155;
}
.remote-driver summary { cursor: pointer; font-weight: 650; }
.remote-driver label { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.remote-driver label .input-sm { flex: 1; min-width: 0; }
.remote-driver small { display: block; margin-top: 6px; line-height: 1.5; }
.remote-status { color: #075985; }

.battle-speed-status { display: block; font: 600 11px/1.35 system-ui, sans-serif; color: #15556b; font-variant-numeric: tabular-nums; }
.large-map-size-hint { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: #475569; font-size: 12px; }
