* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --field-green: #2e7d32;
  --red-team: #ef4444;
  --blue-team: #3b82f6;
  --highlight: #fbbf24;
  --bg-dark: #1a1a1a;
  --panel-bg: rgba(30, 30, 30, 0.95);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: white;
  -webkit-text-size-adjust: 100%;
}

#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  width: clamp(80px, 15vw, 240px);
  background-color: #202020;
  display: flex;
  flex-direction: column;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  flex-shrink: 0;
  max-width: 25%;
  -webkit-overflow-scrolling: touch;
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar h3 {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  position: relative;
}

.sidebar h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--red-team);
}

.sidebar-right h3::after {
  background: var(--blue-team);
}

.formation-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
}

.red-btn, .blue-btn {
  padding: clamp(4px, 0.8vw, 8px) 0;
  font-size: clamp(8px, 1vw, 12px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.red-btn:hover { background: var(--red-team); border-color: var(--red-team); }
.blue-btn:hover { background: var(--blue-team); border-color: var(--blue-team); }

.player-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}

.field-area {
  flex: 1;
  background-color: #151515;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.toggle-floating-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: rgba(37, 37, 37, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  color: white;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.toggle-floating-btn:hover { background: rgba(59, 130, 246, 0.8); transform: scale(1.1); }
.toggle-floating-btn:active { cursor: grabbing; }

.floating-controls {
  position: absolute;
  top: clamp(4px, 1vh, 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(37, 37, 37, 0.92);
  backdrop-filter: blur(12px);
  padding: clamp(4px, 0.6vh, 6px) clamp(6px, 1vw, 8px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.5vw, 4px);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: default;
  flex-wrap: nowrap;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tool-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: clamp(2px, 0.5vw, 5px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.tool-btn svg {
  width: clamp(12px, 2vw, 18px);
  height: clamp(12px, 2vw, 18px);
}

.tool-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.tool-btn.active { background: rgba(251, 191, 36, 0.2); color: var(--highlight); }

.control-divider-v {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.control-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: clamp(2px, 0.5vw, 5px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.control-btn svg {
  width: clamp(12px, 2vw, 18px);
  height: clamp(12px, 2vw, 18px);
}

.btn-label {
  font-size: clamp(8px, 1.2vw, 11px);
  margin-left: 2px;
  white-space: nowrap;
  font-weight: 600;
}

.control-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.control-btn.active { background: rgba(255, 255, 255, 0.2); color: var(--highlight); }

.line-type-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: clamp(2px, 0.4vw, 4px);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.line-type-btn svg {
  width: clamp(10px, 1.5vw, 16px);
  height: clamp(10px, 1.5vw, 16px);
}

.line-type-btn:hover { background: rgba(255, 255, 255, 0.15); }
.line-type-btn.active { background: rgba(251, 191, 36, 0.2); border-color: var(--highlight); color: var(--highlight); }

.color-swatches {
  display: flex;
  gap: clamp(2px, 0.3vw, 3px);
  align-items: center;
}

.color-swatch {
  width: clamp(10px, 1.2vw, 14px);
  height: clamp(10px, 1.2vw, 14px);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.color-swatch.active { border-color: white; transform: scale(1.2); }
.color-swatch[data-color="#ff0000"] { background-color: #ff0000; }
.color-swatch[data-color="#ff8800"] { background-color: #ff8800; }
.color-swatch[data-color="#ffff00"] { background-color: #ffff00; }
.color-swatch[data-color="#00ff00"] { background-color: #00ff00; }
.color-swatch[data-color="#00ffff"] { background-color: #00ffff; }
.color-swatch[data-color="#0000ff"] { background-color: #0000ff; }
.color-swatch[data-color="#8800ff"] { background-color: #8800ff; }
.color-swatch[data-color="#ffffff"] { background-color: #ffffff; }

.thickness-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  padding: clamp(2px, 0.4vw, 4px) clamp(3px, 0.6vw, 6px);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.thickness-btn:hover { background: rgba(255, 255, 255, 0.15); }
.thickness-btn.active { background: rgba(251, 191, 36, 0.2); border-color: var(--highlight); }

.thickness-indicator { background: white; border-radius: 2px; }
.thickness-indicator.thin { width: clamp(8px, 1vw, 12px); height: 1px; }
.thickness-indicator.medium { width: clamp(8px, 1vw, 12px); height: 2px; }
.thickness-indicator.thick { width: clamp(8px, 1vw, 12px); height: 4px; }

.fill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: clamp(2px, 0.4vw, 4px);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.fill-btn svg {
  width: clamp(10px, 1.5vw, 16px);
  height: clamp(10px, 1.5vw, 16px);
}

.fill-btn:hover { background: rgba(255, 255, 255, 0.15); }
.fill-btn.active { background: rgba(251, 191, 36, 0.2); border-color: var(--highlight); color: var(--highlight); }

.eraser-size-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: clamp(2px, 0.4vw, 4px);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.eraser-size-btn svg {
  width: clamp(10px, 1.5vw, 16px);
  height: clamp(10px, 1.5vw, 16px);
}

.eraser-size-btn:hover { background: rgba(255, 255, 255, 0.15); }
.eraser-size-btn.active { background: rgba(251, 191, 36, 0.2); border-color: var(--highlight); color: var(--highlight); }

/* 工具选项面板 - 类似下拉菜单风格 */
.tool-panel {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  min-width: auto;
  width: max-content;
}

/* 小箭头 */
.tool-panel::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(30, 30, 30, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.tool-panel.show { display: block; animation: panelFadeIn 0.15s ease-out; }

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
}

.panel-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#field-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(35px, 6vh, 50px) clamp(10px, 3vw, 20px) clamp(10px, 2vh, 20px);
  overflow: hidden;
}

#field {
  background-color: var(--field-green);
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  cursor: default;
  flex-shrink: 0;
}

.goal {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18%;
  background: white;
  z-index: 5;
}

.goal-left { left: -3px; }
.goal-right { right: -3px; }

.field-lines { position: absolute; inset: 0; pointer-events: none; }

.player {
  width: clamp(20px, 3vw, 40px);
  height: clamp(20px, 3vw, 40px);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s;
  position: relative;
  font-size: clamp(6px, 0.8vw, 10px);
  z-index: 60;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.player:active { cursor: grabbing; }
.player:hover { box-shadow: 0 0 15px rgba(255, 255, 255, 0.4); }

.player-red {
  background: var(--red-team);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
}

.player-blue {
  background: var(--blue-team);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
}

.player .player-label { font-size: clamp(5px, 0.6vw, 8px); line-height: 1; margin-top: 1px; }
.player-num { font-size: clamp(7px, 1vw, 12px); line-height: 1; }

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#edit-modal {
  background: #2a2a2a;
  padding: 24px;
  border-radius: 16px;
  width: 280px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#edit-modal h3 { margin-bottom: 16px; font-size: 16px; }

#edit-modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 13px;
}

.modal-buttons { display: flex; gap: 8px; margin-top: 8px; }

.modal-buttons button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.modal-buttons button:first-child { background: var(--highlight); color: black; }
.modal-buttons button:last-child { background: rgba(255, 255, 255, 0.1); color: white; }

#rules-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.rules-content {
  background: #2a2a2a;
  padding: 28px;
  border-radius: 16px;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-content h3 { margin-bottom: 12px; color: var(--highlight); }
.rules-content ul { list-style: disc; padding-left: 20px; margin-bottom: 16px; }
.rules-content li { margin-bottom: 6px; font-size: 12px; line-height: 1.5; color: rgba(255, 255, 255, 0.8); }

.rules-content button {
  width: 100%;
  padding: 10px;
  background: var(--highlight);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: black;
  -webkit-tap-highlight-color: transparent;
}

/* 底部悬浮元素 - AI 按钮 */
.bottom-float {
  position: fixed;
  bottom: clamp(10px, 2.5vh, 25px);
  left: clamp(12px, 2.5vw, 30px);
  z-index: 1001;
}

.bottom-ai {
  background: linear-gradient(135deg, rgba(80, 160, 255, 0.9), rgba(120, 200, 255, 0.95));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: clamp(8px, 1.5vw, 14px);
  width: clamp(50px, 8vw, 100px);
  height: clamp(50px, 8vw, 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(80, 160, 255, 0.4), 0 0 40px rgba(80, 160, 255, 0.15);
  animation: aiPulse 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.bottom-ai::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 70%);
  pointer-events: none;
}

@keyframes aiPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(80, 160, 255, 0.4), 0 0 40px rgba(80, 160, 255, 0.15); }
  50% { box-shadow: 0 4px 25px rgba(80, 160, 255, 0.6), 0 0 60px rgba(80, 160, 255, 0.25); }
}

.bottom-ai span:first-child {
  font-size: clamp(14px, 2.5vw, 30px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

.bottom-ai .ai-text {
  font-size: clamp(7px, 1.2vw, 13px);
  opacity: 0.95;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.bottom-ai:hover {
  background: linear-gradient(135deg, rgba(100, 180, 255, 1), rgba(140, 220, 255, 1));
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(80, 160, 255, 0.7), 0 0 80px rgba(80, 160, 255, 0.35);
  animation: none;
}

.bottom-ai:active {
  transform: translateY(-1px) scale(0.98);
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 (iPad, Android平板) */
@media (max-width: 1024px) and (min-width: 769px) {
  .sidebar { width: 150px; max-width: 22%; }
  .formation-buttons { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .red-btn, .blue-btn { padding: 6px 0; font-size: 10px; }
  .player { width: 28px; height: 28px; }
  .player-num { font-size: 8px; }
  .floating-controls { padding: 4px 8px; gap: 3px; }
  .control-divider-v { height: 18px; }
  .bottom-ai {
    width: clamp(50px, 7vw, 75px);
    height: clamp(50px, 7vw, 75px);
  }
  #field-container { padding: 40px 10px 12px; }
}

/* 平板设备 (iPad, Android平板) */
@media (max-width: 768px) and (min-width: 481px) {
  .sidebar { width: 140px; max-width: 20%; }
  .formation-buttons { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .red-btn, .blue-btn { padding: 6px 0; font-size: 9px; }
  .player { width: 26px; height: 26px; }
  .player-num { font-size: 7px; }
  .floating-controls { padding: 4px 6px; gap: 2px; }
  .control-divider-v { height: 16px; }
  .color-swatch { width: 10px; height: 10px; }
  .bottom-ai {
    width: clamp(45px, 7vw, 70px);
    height: clamp(45px, 7vw, 70px);
  }
  #field-container { padding: 40px 8px 12px; }
}

/* 手机设备 (iPhone, Android手机) - 侧边栏改为悬浮面板 */
@media (max-width: 480px) {
  .sidebar {
    position: fixed;
    top: 0;
    width: 200px;
    height: 100%;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: none;
    max-width: none;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .sidebar-right {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }
  
  .sidebar.show-left {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.6);
  }
  
  .sidebar-right.show-right {
    transform: translateX(0);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.6);
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 499;
  }
  
  .sidebar-overlay.show { display: block; }
  
  .sidebar-toggle-btn {
    position: fixed;
    bottom: clamp(10px, 2.5vh, 20px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 501;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
  }
  
  .sidebar-toggle-btn:active { transform: scale(0.92); }
  
  .sidebar-toggle-btn.toggle-red {
    left: 10px;
    background: var(--red-team);
  }
  
  .sidebar-toggle-btn.toggle-blue {
    right: 10px;
    background: var(--blue-team);
  }
  
  .formation-buttons { grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 8px; }
  .red-btn, .blue-btn { padding: 6px 0; font-size: 10px; }
  .player { width: 28px; height: 28px; }
  .player-num { font-size: 8px; }
  .floating-controls { flex-wrap: wrap; justify-content: center; gap: 2px; padding: 3px; }
  .control-btn { padding: 3px; }
  .control-btn svg { width: 14px; height: 14px; }
  .bottom-ai {
    width: clamp(40px, 10vw, 55px);
    height: clamp(40px, 10vw, 55px);
  }
  .bottom-ai span:first-child { font-size: clamp(12px, 4vw, 18px); }
  .bottom-ai .ai-text { font-size: clamp(6px, 1.5vw, 9px); }
  #field-container { padding: 35px 6px 10px; }
  
  /* 隐藏默认AI按钮，用悬浮按钮替代 */
  .bottom-float { display: none; }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
  .main-content { flex-direction: column; }
  .sidebar { width: 100%; height: auto; max-height: 80px; flex-direction: row; overflow-x: auto; }
  .formation-buttons { grid-template-columns: repeat(4, 1fr); }
  .player-grid { display: none; }
  #field-container { padding: 40px 10px 10px; }
  .bottom-float { bottom: 5px; left: 10px; }
}

/* 小窗口适配（电脑小窗） */
@media (max-width: 992px) and (min-width: 769px) {
  .sidebar { width: 160px; max-width: 20%; }
  .formation-buttons { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .player { width: 30px; height: 30px; }
  .floating-controls { padding: 5px 8px; gap: 3px; }
  #field-container { padding: 45px 15px 15px; }
}

/* 超小窗口适配 */
@media (max-width: 600px) {
  .floating-controls {
    top: 4px;
    left: 4px;
    right: 4px;
    padding: 2px 4px;
  }
  .control-item {
    gap: 2px;
  }
  .control-btn {
    padding: 2px;
  }
  .control-btn svg {
    width: 12px;
    height: 12px;
  }
  .bottom-float {
    bottom: 10px;
    left: 10px;
    right: 10px;
  }
}

/* Windows 触屏设备 (Surface等) */
@media (pointer: coarse) and (hover: none) {
  .player { cursor: grab; padding: 2px; }
  .control-btn { padding: 8px; }
  .formation-buttons button { padding: 10px 0; font-size: 11px; }
  .toggle-floating-btn { width: 44px; height: 44px; }
}

/* macOS/iOS Safari 特定优化 */
@supports (-webkit-touch-callout: none) {
  .floating-controls, .player-grid, .sidebar { -webkit-overflow-scrolling: touch; }
  html, body { -webkit-text-size-adjust: 100%; }
  .control-btn, .formation-buttons button { -webkit-tap-highlight-color: transparent; }
}

/* 安卓Chrome特定优化 */
@supports (-webkit-appearance: none) {
  .main-content { overflow: hidden; }
  .bottom-float { padding-bottom: env(safe-area-inset-bottom, 0); }
}

/* 大屏设备 (桌面宽屏) */
@media (min-width: 1400px) {
  .sidebar { width: 240px; }
  .formation-buttons { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .player { width: 40px; height: 40px; }
  .player-num { font-size: 11px; }
  .bottom-ai {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(80, 160, 255, 0.5), 0 0 50px rgba(80, 160, 255, 0.2);
  }
  .bottom-ai span:first-child { font-size: 28px; }
  .bottom-ai .ai-text { font-size: 12px; }
}

/* 超大屏设备 */
@media (min-width: 1920px) {
  .bottom-ai {
    width: 110px;
    height: 110px;
    border-radius: 16px;
  }
  .bottom-ai span:first-child { font-size: 34px; }
  .bottom-ai .ai-text { font-size: 14px; }
}
