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

body {
  background: #0f0f0f;
  color: #ddd;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  width: min(400px, 100vw);
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

/* Title */
.app-title {
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #555;
}

/* Note display */
.note-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.15em;
  line-height: 1;
}

#note {
  font-size: 8rem;
  font-weight: 700;
  color: #f0f0f0;
  transition: color 0.12s;
  min-width: 1.1ch;
  text-align: center;
}

#note.in-tune { color: #22c55e; }
#note.sharp   { color: #f97316; }
#note.flat    { color: #60a5fa; }

#octave {
  font-size: 2.2rem;
  font-weight: 300;
  color: #888;
  padding-bottom: 0.45em;
}

/* Frequency */
.freq {
  font-size: 0.95rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

/* Meter */
.meter {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.meter-labels {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #555;
}

.meter-track {
  width: 100%;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  position: relative;
}

.meter-center-line {
  position: absolute;
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
  background: #444;
  transform: translateX(-50%);
}

.needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #777;
  transform: translate(-50%, -50%);
  transition: left 0.08s ease-out, background 0.12s, box-shadow 0.12s;
}

.needle.in-tune { background: #22c55e; box-shadow: 0 0 10px #22c55e55; }
.needle.sharp   { background: #f97316; box-shadow: 0 0 8px #f9731644; }
.needle.flat    { background: #60a5fa; box-shadow: 0 0 8px #60a5fa44; }

.cents-text {
  font-size: 0.75rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

/* Guitar strings */
.strings {
  display: flex;
  gap: 0.55rem;
}

.str {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #555;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.str.active {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
}

/* Button */
#btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid #252525;
  background: none;
  color: #555;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#btn:hover {
  border-color: #444;
  color: #999;
}

#btn.active {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

/* Reference */
.ref {
  font-size: 0.68rem;
  color: #444;
}
