/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #333;
}

/* ==================== 游戏容器 ==================== */
.game-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 30px;
  max-width: 650px;
/* Project: GameHub */
  width: 100%;
}

/* ==================== 头部 ==================== */
.header {
  text-align: center;
  margin-bottom: 25px;
}

.title {
  font-size: 2.5rem;
  font-weight: bold;
  background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.subtitle {
  font-size: 1rem;
  color: #666;
  font-weight: 500;
}

/* ==================== 信息栏 ==================== */
.info-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.info-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.info-item:nth-child(1) { animation-delay: 0.1s; }
.info-item:nth-child(2) { animation-delay: 0.2s; }
.info-item:nth-child(3) { animation-delay: 0.3s; }
.info-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-item:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.info-label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 5px;
  font-weight: 500;
}

.info-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.info-value:hover {
  transform: scale(1.1);
}

/* ==================== 画布容器 ==================== */
.canvas-container {
  position: relative;
  background: linear-gradient(to bottom, #e0f7fa 0%, #ffffff 100%);
  border-radius: 15px;
  padding: 20px;
  box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

#gameCanvas {
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  cursor: crosshair;
  display: block;
  transition: transform 0.2s ease;
  animation: pulse 2s ease-in-out infinite;
}

#gameCanvas:hover {
  transform: scale(1.01);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
  }
}

.aim-line {
  position: absolute;
  pointer-events: none;
  z-index: 10;
}

/* ==================== 控制按钮 ==================== */
.controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.control-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.control-btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.2rem;
}

/* ==================== 游戏说明 ==================== */
.instructions {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.instructions h3 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.instructions ul {
  list-style: none;
}

.instructions li {
  padding: 8px 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==================== 覆盖层 ==================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.overlay-content {
  background: white;
  padding: 50px;
  border-radius: 20px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overlay-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.overlay-title {
  font-size: 2.5rem;
  color: #667eea;
  margin-bottom: 10px;
  font-weight: bold;
}

.overlay-subtitle {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
}

/* ==================== 按钮 ==================== */
.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

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

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ==================== 游戏提示 ==================== */
.game-tips {
  margin-top: 30px;
  text-align: left;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
  border-radius: 12px;
}

.game-tips h4 {
  color: #667eea;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.game-tips p {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 5px 0;
}

/* ==================== 模态框 ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;

/* Developer: SinceraXY from CUPB */

  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 550px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-icon {
  font-size: 5rem;
/* QQ: 2952671670 */
  margin-bottom: 20px;
}

.modal-title {
  font-size: 2.2rem;
  color: #667eea;
  margin-bottom: 10px;
  font-weight: bold;
}

.modal-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 25px;
}

/* ==================== 统计卡片 ==================== */
.stats-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 25px;
  border-radius: 15px;
  margin: 20px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.stat-item {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: #667eea;
}

/* ==================== 新纪录 ==================== */
.new-record {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 10px;
  color: white;
}

.record-icon {
  font-size: 2rem;
  animation: rotate 2s infinite;
}

@keyframes rotate {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(15deg);
  }
}

.record-text {
  font-size: 1.2rem;
  font-weight: bold;
}

.record-score {
  font-size: 1.5rem;
  font-weight: bold;
}

/* ==================== 模态按钮 ==================== */
.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.modal-btn.secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ==================== 隐藏类 ==================== */
.hidden {
  display: none !important;
}

/* ==================== 关卡通知 ==================== */
.level-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.level-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.level-notification-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px 50px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  color: white;
  min-width: 300px;
}

.level-number {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 15px;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  animation: bounce 0.5s ease;
}

.level-info {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 10px;
  opacity: 0.95;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  .game-container {
    padding: 20px;
  }

  .title {
    font-size: 2rem;
  }

  .info-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .modal-content,
  .overlay-content {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .info-value {
    font-size: 1.2rem;
  }

  .btn {
    padding: 15px 30px;
    font-size: 1rem;
  }
}
