

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(env(safe-area-inset-top) + 1rem);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
  scrollbar-width: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  margin-inline: auto;
  width: min(700px, 90%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 0;
}

.settings-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.accidental-toggle {
  display: flex;
  gap: 2px;
  background: #0a0a0a;
  border-radius: 6px;
  overflow: hidden;
}

.acc-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  color: #666;
  background: transparent;
  border: none;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  touch-action: manipulation;
}

.acc-btn:hover { color: #e0e0e0; }
.acc-btn.active {
  color: #fff;
  background: #1a1a1a;
}

.ref-toggle {
  display: flex;
  gap: 2px;
  background: #0a0a0a;
  border-radius: 6px;
  overflow: hidden;
}

.ref-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: #666;
  background: transparent;
  border: none;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  touch-action: manipulation;
}

.ref-btn:hover { color: #e0e0e0; }
.ref-btn.active {
  color: #fff;
  background: #1a1a1a;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.settings-row {
  animation: motion-slide-down 0.35s cubic-bezier(0.32, 0.72, 0, 1) both;
}

#noteDisplay {
  animation: motion-slide-up 0.45s cubic-bezier(0.32, 0.72, 0, 1) 0.08s both;
}

#frequency {
  animation: motion-slide-up 0.45s cubic-bezier(0.32, 0.72, 0, 1) 0.16s both;
}

#centSection {
  animation: motion-slide-up 0.45s cubic-bezier(0.32, 0.72, 0, 1) 0.24s both;
}

#noteDisplay {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  line-height: 1;
}

@keyframes note-pop {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

#noteLetter {
  font-size: 8rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.03em;
  transition: color 0.15s;
}

#noteLetter.pop {
  animation: note-pop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#noteLetter.idle { color: #333; }

#noteLetter.mic-blocked {
  display: flex;
  align-items: center;
  justify-content: center;
}

#noteLetter.mic-blocked svg {
  width: 8rem;
  height: 8rem;
}

#noteOctave {
  font-size: 2.5rem;
  font-weight: 300;
  color: #666;
  margin-left: 0.15em;
  margin-top: 0.6em;
}

#frequency {
  font-size: 1.2rem;
  font-weight: 300;
  color: #888;
  letter-spacing: 0.02em;
}

#centSection {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

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

#centBar {
  position: absolute;
  top: 0;
  height: 100%;
  background: #555;
  border-radius: 2px;
  transition: width 0.08s ease, left 0.08s ease;
}

#centCenter {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 10px;
  background: #555;
  transform: translateX(-50%);
}

#centIndicator {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #888;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.08s ease;
  box-shadow: 0 0 8px rgba(136,136,136,0.25);
  z-index: 1;
}

.centLabel {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 400;
  color: #666;
  line-height: 1;
  z-index: 1;
}

.centLabel.sideLeft {
  left: -0.9rem;
  top: 50%;
  transform: translateY(-50%);
}

.centLabel.sideRight {
  right: -0.9rem;
  top: 50%;
  transform: translateY(-50%);
}

#centValue {
  font-size: 0.9rem;
  font-weight: 400;
  color: #888;
}

@media (max-width: 768px) {
  #app { padding: 1.5rem 5%; }
  #noteLetter { font-size: 6rem; }
  #noteLetter.mic-blocked svg { width: 6rem; height: 6rem; }
  #noteOctave { font-size: 2rem; }
  #centSection { max-width: 100%; }
}

@media (display-mode: standalone) {
  body {
    padding-top: calc(env(safe-area-inset-top) + 1.25rem);
    padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
  }
  #app {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
}
