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

body {
  background: #0F1117;
  color: #fff;
  font-family: system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
}

#app {
  position: relative;
  width: min(560px, 100vw);
  height: min(660px, 100vh);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #1a3a1a;
}

#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(15,17,23,0.88);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  z-index: 5;
}

.hud-block { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.hud-block.right { align-items: flex-end; }
.hud-label { font-size: 10px; font-weight: 700; color: #305CDE; letter-spacing: 1px; }
.hud-score { font-size: 1.6rem; font-weight: 800; }
.hud-shots { font-size: 12px; letter-spacing: 2px; color: #aaa; }

.hud-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#phaseLabel { font-size: 12px; font-weight: 700; color: #FFD700; letter-spacing: 1px; }
#shotCount { font-size: 11px; color: #aaa; }

#overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,17,23,0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 10;
}
#overlay.active { opacity: 1; pointer-events: all; }

h1 { font-size: 2.2rem; font-weight: 800; }
p { color: #aaa; text-align: center; line-height: 1.6; }
.hint { font-size: 12px; color: #555; }

button {
  background: #305CDE;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
button:hover { background: #4a70e8; transform: translateY(-2px); }

#resultBanner {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 2rem;
  font-weight: 900;
  text-shadow: 0 0 30px currentColor;
  pointer-events: none;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), opacity 0.4s;
  white-space: nowrap;
  z-index: 8;
  opacity: 0;
}
#resultBanner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
#resultBanner.hide { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
