* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  background: #1a1a2e;
  color: #eee;
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  overflow: hidden;
  touch-action: none;
}

#game-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  text-align: center;
  touch-action: none;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 1.1rem;
  font-weight: bold;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

#hud-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

#lives { font-size: 1.2rem; }
#shield-icon { font-size: 1.2rem; }
#shield-icon.hidden { display: none; }

#score {
  color: #ffd700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

#effect-indicator {
  font-size: 0.85rem;
  color: #aaa;
}

canvas {
  display: block;
  width: 100%;
  height: 100dvh;
  max-width: 500px;
  max-height: 800px;
  background: linear-gradient(180deg, #16213e 0%, #0f3460 100%);
  touch-action: none;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  z-index: 20;
  gap: 12px;
  padding: 24px;
}

#overlay.hidden {
  display: none;
}

#overlay-title {
  font-size: 2rem;
  color: #ffd700;
  font-weight: bold;
}

#overlay-sub {
  font-size: 1rem;
  color: #ccc;
}

#overlay-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 1.5rem;
}

#btn-next {
  padding: 14px 48px;
  font-size: 1.2rem;
  border: none;
  border-radius: 12px;
  background: #e94560;
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
}

#btn-next:active {
  opacity: 0.7;
}

.flash {
  animation: flashAnim 0.3s ease-out;
}

@keyframes flashAnim {
  0% { filter: brightness(3); }
  100% { filter: brightness(1); }
}
