* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  overflow: hidden;
  background: #0d1117;
  font-family: 'Bricolage Grotesque', sans-serif;
  touch-action: none;
}

#canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  pointer-events: none;
  z-index: 10;
}

#hud-left {
  display: flex;
  flex-direction: column;
}

#cut-number {
  font-size: 18px;
  font-weight: 800;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
}

#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#accuracy-text {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s, transform 0.4s;
  transform: scale(0.5);
}

#accuracy-text.show {
  opacity: 1;
  transform: scale(1);
}

#rating-text {
  font-size: 32px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.3s ease 0.15s, transform 0.4s ease 0.15s;
  transform: scale(0.3) translateY(10px);
}

#rating-text.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

#hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

#best-label, #streak-label {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.3);
  letter-spacing: 2px;
  text-transform: uppercase;
}

#best-score {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
}

#streak-count {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
}

#instructions-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(8px);
  transition: opacity 0.5s;
}

#instructions-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#instructions-box {
  text-align: center;
  color: #fff;
}

#instructions-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#instructions-sub {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}

#instructions-hint {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255,255,255,0.4);
  margin-bottom: 24px;
}

#instructions-arrow {
  font-size: 48px;
  animation: bob 1.5s ease-in-out infinite;
}

#instructions-tap {
  margin-top: 32px;
  font-size: 14px;
  color: rgba(255,255,255,0.25);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-10deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}

#reset-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.4);
  font-size: 22px;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#reset-btn:hover {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  transform: rotate(-180deg);
}

#footer-wrap {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
}

#watermark {
  font-size: 14px;
  opacity: 0.3;
}

#remix-link {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  text-decoration: none;
  pointer-events: all;
  transition: color 0.2s;
}

#remix-link:hover {
  color: rgba(255,255,255,0.5);
}