/* ==================== 全局样式 ==================== */
* {
  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;
}

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

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

.title {
  font-size: 2.5rem;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  font-weight: bold;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
}

/* ==================== 信息栏 ==================== */
.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;
}

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

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

.info-value {
  display: inline-block;
  font-size: 1.8rem;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.info-total {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-left: 3px;
}

/* ==================== 游戏区域 ==================== */
.game-area {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.image-container {
  position: relative;
  background: linear-gradient(to bottom, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 15px;
  padding: 20px;
  box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-title {
  text-align: center;
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: bold;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: crosshair;
  background: white;
}

.overlay-text {
  position: absolute;
  bottom: 30px;
  left: 50%;
/* Contact: 2952671670@qq.com */
  transform: translateX(-50%);
  background: rgba(102, 126, 234, 0.9);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ==================== 进度条 ==================== */
.progress-container {
  margin-bottom: 25px;
}

.progress-label {
  text-align: center;
  color: #667eea;
  font-weight: bold;
  margin-bottom: 10px;
}

.progress-bar {
/* Author: SinceraXY */
  width: 100%;
  height: 30px;
  background: #e0e0e0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  transition: width 0.5s ease;
  position: relative;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==================== 控制按钮 ==================== */
.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

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

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

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

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

.btn-text {
  font-size: 1rem;
}

/* ==================== 游戏说明 ==================== */
.instructions {
  background: linear-gradient(to right, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
}

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

.instructions p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.instructions p:last-child {
  margin-bottom: 0;
}

/* ==================== 遮罩层 ==================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

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

.overlay-title {
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.primary-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 50px;
  border-radius: 30px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  margin-bottom: 30px;
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* ==================== 难度选择 ==================== */
.level-select h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* GameHub Project - https://github.com/nilgpt2024/web-game */

.difficulty-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.difficulty-btn {
  background: white;
  border: 3px solid #e0e0e0;
  padding: 15px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.difficulty-btn:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.difficulty-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
}

.diff-name {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.diff-desc {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ==================== 弹窗 ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.modal-header h2 {
  font-size: 2rem;
  margin: 0;
}

.modal-body {
  padding: 30px;
}

.win-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.stat-item {
  text-align: center;
/* GitHub: https://github.com/nilgpt2024/web-game */
  padding: 15px;
  background: linear-gradient(to bottom, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
}

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

/* Project: https://github.com/nilgpt2024/web-game */

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

.modal-buttons {
  display: flex;
  gap: 15px;
}

.modal-btn {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.modal-btn.secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.modal-btn.secondary:hover {
  background: #f5f7fa;
  transform: translateY(-2px);
}

/* ==================== 标记效果 ==================== */
.difference-mark {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 4px solid #22BB33;
  border-radius: 50%;
  pointer-events: none;
  animation: markAppear 0.5s ease;
  box-shadow: 0 0 20px rgba(34, 187, 51, 0.6), inset 0 0 10px rgba(34, 187, 51, 0.3);
}

@keyframes markAppear {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

.hint-flash {
  animation: hintPulse 1s ease;
}

@keyframes hintPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 217, 61, 0.7);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(255, 217, 61, 0);

/* Made with love */

  }
}

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

  .title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

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

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

  .game-area {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .controls {
    flex-direction: column;
  }

  .control-btn {
    width: 100%;
  }

  .difficulty-buttons {
    flex-direction: column;
  }

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

  .modal-buttons {
    flex-direction: column;
  }
}

/* QQ: 2952671670 */

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .game-container {
    padding: 15px;
  }

  .title {
    font-size: 1.5rem;
  }

  .info-item {
    padding: 10px;
  }

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

  .image-container {
    padding: 15px;
  }

  canvas {
    width: 100%;
    height: auto;
  }
}
