/* Phoebe's Tuner 样式 */
.tuner-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 10px 0 30px;
  width: 100%;
}

/* 上栏：音高/偏移提示 — 深色高对比卡片 */
.tuner-meter {
  width: 100%;
  background:
    linear-gradient(145deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 60%),
    #1f1a18;
  border: 1px solid rgba(255, 243, 230, .12);
  border-radius: 22px;
  padding: 18px 16px 16px;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 参考图风格的细网格背景 */
.tuner-meter::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.tuner-meter-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.tuner-note {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 58px;
  text-align: center;
  flex: none;
  border: 2px solid rgba(255, 255, 255, .25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.tuner-note.tuner-note--flat {
  background: #3a86ff;
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 0 18px rgba(58, 134, 255, .55);
}

.tuner-note.tuner-note--sharp {
  background: #e84a5f;
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 0 18px rgba(232, 74, 95, .55);
}

.tuner-note.tuner-note--in {
  background: #2bb6a8;
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 0 18px rgba(43, 182, 168, .55);
}

.tuner-status {
  font-size: 16px;
  font-weight: 700;
  color: #fff3e6;
  flex: 1;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* 偏移仪表盘 */
.tuner-gauge {
  margin: 8px 0;
  position: relative;
  z-index: 1;
}

.tuner-gauge-track {
  position: relative;
  height: 36px;
  border-radius: 18px;
  background: linear-gradient(90deg,
    #3a86ff 0%, #3a86ff 14%,
    #2bb6a8 42%, #f9c80e 50%,
    #e84a5f 86%, #e84a5f 100%);
  overflow: hidden;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,.35),
    0 0 12px rgba(43, 182, 168, .25);
}

.tuner-gauge-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  transform: translateX(-50%);
  background: rgba(255,255,255,.85);
  z-index: 2;
}

.tuner-gauge-needle {
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 4px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(255,255,255,.8), 0 0 4px rgba(0,0,0,.5);
  transition: left .12s ease-out;
  z-index: 3;
}

.tuner-gauge-needle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,.7);
}

.tuner-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 243, 230, .65);
  margin-top: 7px;
  padding: 0 4px;
}

.tuner-gauge-mid {
  font-weight: 700;
  color: #fff3e6;
}

.tuner-readout {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.tuner-cent {
  font-size: 22px;
  font-weight: 800;
  color: #fff3e6;
  min-width: 72px;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.tuner-hz {
  font-size: 14px;
  color: rgba(255, 243, 230, .65);
  font-variant-numeric: tabular-nums;
}

/* 中栏：吉他琴颈图 + 弦钮按钮 */
.tuner-headstock-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  flex: none;
}

.tuner-neck-img {
  width: 80%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .35));
}

.tuner-peg {
  position: absolute;
  width: clamp(40px, 12vw, 52px);
  height: clamp(40px, 12vw, 52px);
  border-radius: 50%;
  border: 2px solid rgba(255, 243, 230, .7);
  background: rgba(31, 26, 24, .75);
  color: #fff3e6;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%);
}

.tuner-peg:active {
  transform: translate(-50%, -50%) scale(.95);
}

.tuner-peg.on {
  border-color: #2bb6a8;
  background: #2bb6a8;
  color: #fff;
  box-shadow: 0 4px 16px rgba(43, 182, 168, .45);
}

.tuner-peg.done {
  border-color: #2bb6a8;
  background: transparent;
  color: #2bb6a8;
  box-shadow: 0 0 0 3px rgba(43, 182, 168, .25), 0 4px 14px rgba(43, 182, 168, .25);
}

.tuner-peg.done.on {
  background: #2bb6a8;
  color: #fff;
  box-shadow: 0 4px 16px rgba(43, 182, 168, .45);
}

/* 弦钮位置：分布在琴颈图两侧，与真实弦钮中心对齐 */
/* 左侧：4 弦 D / 5 弦 A / 6 弦 E */
.tuner-peg--l1 { left: 5%; top: 25%; }
.tuner-peg--l2 { left: 5%; top: 45%; }
.tuner-peg--l3 { left: 5%; top: 65%; }
/* 右侧：3 弦 G / 2 弦 B / 1 弦 E */
.tuner-peg--r1 { left: 95%; top: 25%; }
.tuner-peg--r2 { left: 95%; top: 45%; }
.tuner-peg--r3 { left: 95%; top: 65%; }

/* 操作区 */
.tuner-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.tuner-mic-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--purple);
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-family: inherit;
}

.tuner-mic-btn:active {
  transform: scale(.98);
}

.tuner-mic-btn.on {
  background: #2bb6a8;
}

.tuner-mic-btn:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

.tuner-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* 响应式微调 */
@media (max-width: 360px) {
  .tuner-note {
    width: 54px;
    height: 54px;
    font-size: 26px;
    line-height: 54px;
  }
  .tuner-status {
    font-size: 15px;
  }
  .tuner-peg {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
}
