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

body {
  background: #000;
  overflow: hidden;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#gameCanvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.panel {
  background: linear-gradient(135deg, rgba(20, 10, 40, 0.95), rgba(10, 20, 50, 0.95));
  border: 2px solid rgba(100, 150, 255, 0.4);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  color: #e0e8ff;
  box-shadow: 0 0 40px rgba(80, 120, 255, 0.2), inset 0 0 20px rgba(80, 120, 255, 0.05);
  max-width: 420px;
  width: 90%;
}

.panel h1 {
  font-size: 28px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #a0c4ff, #ffafaf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel .subtitle {
  font-size: 14px;
  color: rgba(160, 196, 255, 0.6);
  margin-bottom: 20px;
  letter-spacing: 4px;
}

.instructions {
  text-align: left;
  margin: 16px 0;
  font-size: 14px;
  line-height: 2;
  color: rgba(200, 220, 255, 0.8);
}

.btn {
  background: linear-gradient(135deg, #4a6cf7, #7c3aed);
  color: white;
  border: none;
  padding: 12px 40px;
  font-size: 18px;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(74, 108, 247, 0.4);
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(74, 108, 247, 0.6);
}

.btn:active {
  transform: scale(0.98);
}

/* Evolution screen */
.evolve-hint {
  font-size: 14px;
  color: rgba(200, 220, 255, 0.6);
  margin-bottom: 16px;
}

.evolve-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evolve-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(100, 150, 255, 0.3);
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.evolve-card:hover {
  background: rgba(100, 150, 255, 0.15);
  border-color: rgba(100, 150, 255, 0.7);
  transform: scale(1.02);
}

.evolve-card .evo-name {
  font-size: 16px;
  font-weight: bold;
  color: #a0c4ff;
}

.evolve-card .evo-desc {
  font-size: 12px;
  color: rgba(200, 220, 255, 0.6);
  margin-top: 4px;
}

/* HUD */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  pointer-events: none;
  z-index: 50;
}

#hud.hidden {
  display: none;
}

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

#hud span {
  font-size: 14px;
  color: rgba(200, 220, 255, 0.9);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(100, 150, 255, 0.2);
}

.boost-bar-container {
  width: 80px;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(100, 150, 255, 0.3);
}

.boost-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4a6cf7, #a78bfa);
  border-radius: 6px;
  transition: width 0.1s;
}

#finalStats {
  margin: 16px 0;
  text-align: left;
  font-size: 16px;
  line-height: 2;
}

#finalStats span {
  color: #a0c4ff;
  font-weight: bold;
}

/* ============================================================
   移动端适配 - 触摸操作说明
   ============================================================ */
.touch-instructions {
  display: none;
}
.desktop-instructions {
  display: block;
}

/* ============================================================
   移动端媒体查询 (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* 触摸/桌面说明切换 */
  .desktop-instructions {
    display: none;
  }
  .touch-instructions {
    display: block;
  }

  /* HUD 放大 */
  #hud {
    padding: 16px 20px;
  }
  #hud span {
    font-size: 18px;
    padding: 8px 14px;
    border-radius: 14px;
  }
  .hud-left, .hud-right {
    gap: 16px;
  }
  .boost-bar-container {
    width: 100px;
    height: 16px;
    border-radius: 8px;
  }
  .boost-bar {
    border-radius: 8px;
  }

  /* 面板适配 */
  .panel {
    padding: 28px 24px;
    max-width: 92%;
    border-radius: 14px;
  }
  .panel h1 {
    font-size: 24px;
  }
  .panel .subtitle {
    font-size: 12px;
    margin-bottom: 14px;
  }

  /* 按钮增大触摸区域 */
  .btn {
    padding: 16px 48px;
    font-size: 20px;
    border-radius: 30px;
    min-width: 44px;
    min-height: 44px;
    margin-top: 20px;
  }

  /* 操作说明文字放大 */
  .instructions {
    font-size: 15px;
    line-height: 2.2;
    margin: 12px 0;
  }

  /* 进化卡片全宽布局 */
  .evolve-options {
    flex-direction: column;
    gap: 12px;
  }
  .evolve-card {
    padding: 18px 22px;
    min-height: 44px;
  }
  .evolve-card .evo-name {
    font-size: 18px;
  }
  .evolve-card .evo-desc {
    font-size: 14px;
  }
  .evolve-hint {
    font-size: 15px;
    margin-bottom: 14px;
  }

  /* 结算面板 */
  #finalStats {
    font-size: 17px;
    line-height: 2.2;
  }
}

/* ============================================================
   小屏手机媒体查询 (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
  /* HUD 进一步调整 */
  #hud {
    padding: 12px 14px;
  }
  #hud span {
    font-size: 15px;
    padding: 6px 10px;
  }
  .hud-left, .hud-right {
    gap: 10px;
  }
  .boost-bar-container {
    width: 70px;
    height: 12px;
  }

  /* 面板紧凑 */
  .panel {
    padding: 20px 16px;
    max-width: 95%;
    border-radius: 12px;
  }
  .panel h1 {
    font-size: 20px;
    margin-bottom: 4px;
  }
  .panel .subtitle {
    font-size: 11px;
    margin-bottom: 10px;
    letter-spacing: 2px;
  }

  /* 按钮 */
  .btn {
    padding: 14px 36px;
    font-size: 17px;
    min-width: 44px;
    min-height: 44px;
    margin-top: 14px;
  }

  /* 操作说明 */
  .instructions {
    font-size: 13px;
    line-height: 2;
    margin: 8px 0;
  }

  /* 进化卡片 */
  .evolve-card {
    padding: 14px 16px;
    min-height: 44px;
  }
  .evolve-card .evo-name {
    font-size: 16px;
  }
  .evolve-card .evo-desc {
    font-size: 12px;
  }
  .evolve-hint {
    font-size: 13px;
    margin-bottom: 10px;
  }

  /* 结算 */
  #finalStats {
    font-size: 15px;
    line-height: 2;
  }
}
