* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  color: #eee;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

h1 { font-size: 3rem; letter-spacing: 0.1em; }
.accent { color: #e94560; }
.subtitle { font-size: 1.2rem; color: #888; margin: 0.5rem 0 2rem; }

.btn {
  padding: 0.8rem 2.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  margin: 0.3rem;
}
.btn-primary { background: #e94560; color: #fff; }
.btn-secondary { background: #333; color: #ccc; }

/* Stage Select */
.stage-list {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  justify-content: center;
  max-width: 600px; margin: 1rem 0;
}
.stage-btn {
  width: 100px; height: 80px;
  background: #16213e;
  border: 2px solid #0f3460;
  border-radius: 8px;
  color: #eee; font-size: 1rem;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.stage-btn.locked { opacity: 0.4; pointer-events: none; }
.stage-btn.cleared { border-color: #e94560; }
.stage-stars { font-size: 0.7rem; color: #e94560; margin-top: 4px; }

/* Game Screen */
#screen-game {
  flex-direction: column;
  padding: 0;
}
#game-canvas {
  flex: 1;
  width: 100%;
}
.tap-area {
  display: flex;
  height: 25vh;
  min-height: 80px;
  width: 100%;
}
.tap-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  transition: background 0.08s;
}
.tap-left {
  background: #0f3460;
  border-right: 2px solid #1a1a2e;
}
.tap-right {
  background: #533483;
  border-left: 2px solid #1a1a2e;
}
.tap-btn.hit { filter: brightness(1.8); }

/* Result */
.result-stars { font-size: 2.5rem; margin: 1rem 0; }
.result-stats { font-size: 1rem; color: #aaa; margin-bottom: 1.5rem; text-align: center; line-height: 1.8; }

/* Ad Banner */
.ad-banner {
  width: 320px;
  height: 50px;
  margin: 0.5rem auto;
}

@media (orientation: portrait) {
  #screen-title::after {
    content: '横画面にしてね！';
    position: fixed; inset: 0;
    background: #1a1a2e;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; z-index: 999;
  }
}
