* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #07070c;
  color: #e8e8f2;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

body { display: flex; }

#game {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 8px;
  gap: 6px;
}

#hud {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.label {
  flex: 0 0 auto;
  width: 54px;
  color: #9aa0c0;
  text-align: right;
}

.bar {
  flex: 1 1 auto;
  height: 14px;
  background: #16161f;
  border: 1px solid #2e2e44;
  border-radius: 8px;
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 100%;
  border-radius: 8px;
  transition: width 0.12s linear;
}

#timerRow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffd23f;
}

#timerRow .label { width: 54px; }

#timer.bump {
  animation: scoreBump 0.18s ease-out;
}

@keyframes scoreBump {
  0% { transform: scale(1); color: #ffd23f; }
  40% { transform: scale(1.28); color: #ffffff; }
  100% { transform: scale(1); color: #ffd23f; }
}

.fast-tag {
  display: none;
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #7effb0;
}

.fast-tag.on { display: inline; }

.fill.boss { background: linear-gradient(90deg, #1ee0a8, #4fd1ff); }
.fill.player { background: linear-gradient(90deg, #ff3b5c, #ffd23f); }

#stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  border: 2px solid #262640;
  border-radius: 12px;
  overflow: hidden;
  background: #0b0b13;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 6, 12, 0.86);
  text-align: center;
}

#overlay.show { display: flex; }

.panel {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#ovTitle {
  margin: 0;
  font-size: 22px;
  letter-spacing: 1px;
  color: #ffd23f;
  text-shadow: 0 0 14px rgba(255, 210, 63, 0.45);
}

#ovHint {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #9aa0c0;
}

button {
  margin-top: 4px;
  padding: 10px 26px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  color: #07070c;
  background: linear-gradient(90deg, #4fd1ff, #1ee0a8);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

button:active { transform: translateY(1px); }
