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

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111;
  color: #eee;
}

#app {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

#circle-stage {
  width: 80vmin;
  max-width: 320px;
  max-height: 320px;
}

#controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#piece-count {
  width: 64px;
  padding: 8px;
  border-radius: 999px;
  border: none;
  background: #222;
  color: #eee;
  text-align: center;
  font-size: 14px;
  outline: none;
}

#bpm-input {
  width: 72px;
  padding: 8px;
  border-radius: 999px;
  border: none;
  background: #222;
  color: #eee;
  text-align: center;
  font-size: 14px;
  outline: none;
}

.segment {
  fill: #333;
  stroke: #111;
  stroke-width: 2;
  transition: fill 0.15s ease-out, transform 0.15s ease-out;
  transform-origin: 150px 150px;
}

.segment-active {
  fill: #e85c3b;
  transform: scale(1.03);
}

.segment-past {
  fill: #555;
}

.big-circle-outline {
  fill: none;
  stroke: #666;
  stroke-width: 3;
}

.small-circle {
  fill: #f2f2f2;
  stroke: #111;
  stroke-width: 1;
  transition: cx 0.15s ease-out, cy 0.15s ease-out;
}

.small-circle.fast-light {
  fill: #ffd700;
  stroke: #ffec8b;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.9))
          drop-shadow(0 0 12px rgba(255, 215, 0, 0.7));
}

.light-trail {
  fill: rgba(255, 215, 0, 0.7);
  stroke: none;
  animation: trail-fade 0.4s ease-out forwards;
}

@keyframes trail-fade {
  0% {
    opacity: 0.9;
    r: 10;
  }
  100% {
    opacity: 0;
    r: 2;
  }
}

#go-button {
  border: none;
  padding: 12px 28px;
  border-radius: 999px;
  background: #e85c3b;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  min-width: 120px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease-out, transform 0.1s ease-out, box-shadow 0.1s ease-out, opacity 0.15s;
}

#go-button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

#go-button:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}