html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

body {
  background-color: #1a1a2e;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  padding: 20px 0 10px 0;
}

#game-title {
  font-size: 2rem;
  margin: 0;
  text-align: center;
  letter-spacing: 2px;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 16px 20px 16px;
}

.score-panel {
  display: flex;
  gap: 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 12px 32px;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-label {
  font-size: 0.8rem;
  color: #8888aa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 1.6rem;
  font-weight: bold;
  font-family: "Courier New", monospace;
  color: #00ff88;
  transition: transform 0.15s ease;
}

.score-value.pop {
  transform: scale(1.3);
  color: #ffd700;
}

.game-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.15), 0 0 60px rgba(0, 0, 0, 0.4);
}

#game-canvas {
  display: block;
  background-color: #0f0f23;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
  z-index: 10;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.overlay-text {
  font-size: 1.2rem;
  color: #ccccdd;
  margin: 0;
}

.overlay-title {
  font-size: 2rem;
  font-weight: bold;
  color: #ff4444;
  margin: 0;
}

.final-score {
  font-size: 1.4rem;
  color: #00ff88;
  margin: 0;
  font-family: "Courier New", monospace;
}

.new-record {
  font-size: 1.2rem;
  color: #ffd700;
  margin: 0;
  animation: pulse 0.8s ease-in-out infinite alternate;
}

.new-record.hidden {
  display: none;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.game-btn {
  padding: 12px 36px;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 1px;
}

.game-btn:hover {
  transform: scale(1.05);
}

.game-btn:active {
  transform: scale(0.95);
}

.btn-start {
  background: #00ff88;
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.btn-resume {
  background: #ffd700;
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-restart {
  background: #ff6b6b;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.mobile-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.controls-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ctrl-btn {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.ctrl-btn:active {
  background: rgba(0, 255, 136, 0.3);
  transform: scale(0.9);
}

.btn-pause {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
}

@media (max-width: 768px) {
  .mobile-controls {
    display: flex;
  }

  #game-title {
    font-size: 1.5rem;
  }

  .score-panel {
    gap: 24px;
    padding: 10px 24px;
  }

  .score-value {
    font-size: 1.3rem;
  }
}

footer {
  margin-top: auto;
  padding: 16px 0;
}

.page-info {
  text-align: center;
  font-size: 0.8rem;
  color: #555577;
}

.page-info a {
  color: #7777aa;
  text-decoration: none;
}

.page-info a:hover {
  color: #00ff88;
}
