* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #1a1a24;
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  touch-action: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 480px;
  max-height: 800px;
  background-color: #0f0f17;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#hud {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 1px;
}

#high-score-hud {
  color: #f1c40f;
}

.overlay-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 23, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

.overlay-screen h1 {
  font-size: 2.2rem;
  color: #00d2d3;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(0, 210, 211, 0.5);
}

#game-over h1 {
  color: #ff4757;
  text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.overlay-screen p {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #ccc;
}

#high-score-start {
  color: #f1c40f;
  font-weight: bold;
  margin-bottom: 20px;
}

#new-record {
  color: #2ed573;
  font-weight: bold;
  font-size: 1.3rem;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.game-btn {
  padding: 12px 35px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  background: #2ed573;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(46, 213, 115, 0.4);
  transition: transform 0.1s, background-color 0.2s;
}

.game-btn:active {
  transform: scale(0.95);
  background: #26af5f;
}

/* スマホ用コントロールガイドUI */
#touch-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
  pointer-events: auto;
}

.touch-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
}