* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-canvas {
  display: block;
  background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
  max-width: 100%;
  max-height: 100%;
}

#ui {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
  z-index: 10;
}

#score-display {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

#high-score {
  font-size: 16px;
  font-weight: 600;
  color: #e94560;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  align-self: flex-start;
  background: rgba(0,0,0,0.3);
  padding: 8px 16px;
  border-radius: 20px;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(26, 26, 46, 0.95);
  z-index: 20;
  text-align: center;
  padding: 20px;
}

.screen.hidden {
  display: none;
}

.screen h1 {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  text-shadow: 0 4px 20px rgba(233, 69, 96, 0.5);
}

.screen p {
  font-size: 20px;
  color: #a0a0a0;
  margin-bottom: 10px;
}

.screen p.sub {
  font-size: 16px;
  color: #666;
  margin-bottom: 40px;
}

#final-score {
  font-size: 32px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

#new-high-score {
  font-size: 18px;
  color: #ffd700;
  font-weight: 600;
  margin-bottom: 30px;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

button {
  background: linear-gradient(135deg, #e94560 0%, #c73e54 100%);
  color: white;
  border: none;
  padding: 18px 50px;
  font-size: 20px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(233, 69, 96, 0.5);
}

button:active {
  transform: translateY(0);
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .screen h1 {
    font-size: 36px;
  }
  
  .screen p {
    font-size: 18px;
  }
  
  #score-display {
    font-size: 36px;
  }
  
  button {
    padding: 16px 40px;
    font-size: 18px;
  }
}

/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
  .screen h1 {
    font-size: 28px;
    margin-bottom: 10px;
  }
  
  .screen p.sub {
    margin-bottom: 20px;
  }
  
  button {
    padding: 12px 30px;
    font-size: 16px;
  }
}
