/* 小鸟飞行游戏 - 清新天空风格 */
:root {
  --sky-top: #87ceeb;
  --sky-bottom: #e0f6ff;
  --cloud: rgba(255, 255, 255, 0.9);
  --pipe: #2d8a3e;
  --pipe-dark: #1e5c2a;
  --pipe-highlight: #3da854;
  --ground: #deb887;
  --text: #2c3e50;
  --accent: #e74c3c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  font-family: 'Noto Sans SC', 'Fredoka', system-ui, sans-serif;
  padding: 1rem;
}

.game-wrapper {
  width: 100%;
  max-width: 400px;
}

.game-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.15);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.game-header h1 {
  font-size: 1.5rem;
  color: var(--text);
}

.score-display {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 1.25rem;
  font-weight: 700;
}

.game-canvas {
  position: relative;
  width: 100%;
  height: 400px;
  background: linear-gradient(180deg, #87ceeb 0%, #b8e4f0 70%, var(--ground) 70%);
  border-radius: 12px;
  overflow: hidden;
}

.bird {
  position: absolute;
  width: 40px;
  height: 30px;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(160deg, #fff9c4 0%, #ffeb3b 35%, #ffc107 70%, #ff9800 100%);
  border-radius: 50% 50% 48% 48%;
  box-shadow: 
    inset 3px 2px 6px rgba(255, 255, 255, 0.6),
    inset -2px -2px 4px rgba(255, 200, 50, 0.4),
    inset 6px 0 10px -2px rgba(255, 152, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
  transition: transform 0.1s;
  border: 1px solid rgba(255, 193, 7, 0.5);
}

/* 嘴巴 */
.bird::before {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left-color: #ff8f00;
  border-right: 0;
  filter: drop-shadow(1px 0 0 rgba(0,0,0,0.15));
}

/* 眼睛 */
.bird::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 7px;
  width: 10px;
  height: 10px;
  background: #37474f;
  border-radius: 50%;
  box-shadow: 
    inset -1px -1px 2px rgba(0, 0, 0, 0.4),
    inset 2px 2px 2px rgba(255, 255, 255, 0.3);
  border: 1.5px solid #263238;
}

.bird.flap {
  transform: translateY(-50%) rotate(-25deg);
}

.bird.fall {
  transform: translateY(-50%) rotate(15deg);
}

.obstacles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pipe {
  position: absolute;
  width: 45px;
  background: linear-gradient(90deg, var(--pipe-dark), var(--pipe), var(--pipe-highlight));
  border: 3px solid var(--pipe-dark);
  border-radius: 4px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.pipe::before {
  content: '';
  position: absolute;
  left: -6px;
  width: 65px;
  height: 25px;
  background: var(--pipe-dark);
  border-radius: 4px;
  border: 3px solid var(--pipe-dark);
}

.pipe-top::before {
  bottom: -5px;
}

.pipe-bottom::before {
  top: -5px;
}

.pipe-top {
  top: 0;
  border-radius: 0 0 8px 8px;
}

.pipe-bottom {
  bottom: 60px;
  border-radius: 8px 8px 0 0;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(135, 206, 235, 0.85);
  z-index: 20;
  color: var(--text);
}

.overlay.hidden {
  display: none;
}

.overlay p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.overlay .hint {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.overlay h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

#finalScore {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e67e22;
}

#restartBtn {
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  font-family: inherit;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

#restartBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
}

.game-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #7f8c8d;
}
