body {
  font-family: Inter, sans-serif;
}

.tool-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .04);
}

/* ── Camera wrapper — bleed to card edges, no side whitespace ── */
.camera-wrapper {
  position: relative;
  width: calc(100% + 3rem);
  /* cancel out the card's 1.5rem side padding */
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  aspect-ratio: 16/9;
  background: #0a0f1a;
  border-radius: 0.625rem 0.625rem 0 0;
  /* match card top corners only */
  overflow: hidden;
}

/* On phones, use a taller ratio so the camera area is larger */
@media (max-width: 600px) {
  .camera-wrapper {
    aspect-ratio: 3/4;
  }
}

#videoEl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: none;
}

#overlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* NOTE: do NOT mirror the canvas — strings are drawn in canvas space,
     mirroring happens via the video underneath. Canvas draws on top un-flipped
     so string x-positions match the mirrored video naturally. */
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #6b7280;
  cursor: pointer;
}

/* ── Mode / count buttons ── */
.mode-btn {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mode-btn.active {
  background: #fff;
  color: #065f46;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

/* ── Status dots ── */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  display: inline-block;
  transition: background .3s;
}

.dot.active {
  background: #10b981;
}

.dot.detecting {
  background: #f59e0b;
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .25
  }
}

/* ── Last note display ── */
#lastNote {
  transition: color 0.2s, transform 0.1s;
}

#lastNote.plucked {
  color: #059669;
  transform: scale(1.15);
}