/* Guitar tuner — compact vintage hi-fi style */

.tuner-page {
  min-height: 100vh;
  padding: 94px 16px 32px;
  display: grid;
  place-items: start center;
  background:
    radial-gradient(circle at top left, rgba(214, 168, 79, .10), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(124, 139, 111, .10), transparent 30rem),
    linear-gradient(180deg, #0f1110 0%, #141713 52%, #0b0d0c 100%);
}

.tuner-card {
  width: min(960px, 100%);
  padding: clamp(14px, 2.4vw, 24px);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(245, 239, 228, .045), rgba(245, 239, 228, .02)),
    var(--panel);
  box-shadow: var(--shadow);
}

.tuner-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.back-link {
  color: var(--muted);
  font-weight: 800;
}

.back-link:hover {
  color: var(--accent-soft);
}

.status-pill {
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 228, .045);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.active {
  border-color: rgba(124, 139, 111, .42);
  background: rgba(124, 139, 111, .14);
  color: #b9c9aa;
}

.tuner-header {
  text-align: center;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tuner-header h1 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: clamp(34px, 5.8vw, 58px);
  line-height: .95;
  text-transform: uppercase;
}

.tuner-header .lead {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.actions-top {
  margin: 0 0 12px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid transparent;
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .25s ease;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #17110a;
  box-shadow: 0 0 24px rgba(214, 168, 79, .16);
}

.primary-button:hover {
  background: transparent;
  border-color: var(--accent-soft);
  color: var(--accent-soft);
}

.secondary-button {
  background: transparent;
  border-color: rgba(245, 239, 228, .48);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--accent-soft);
  color: var(--accent-soft);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

/* Main layout */

.instrument-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 8px;
}

.side-instruments {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

/* Right string panel */

.string-display,
.vu-meter {
  padding: 12px;
  border: 1px solid rgba(214, 168, 79, .24);
  background:
    linear-gradient(180deg, rgba(245, 239, 228, .075), rgba(245, 239, 228, .02)),
    #10120f;
  box-shadow:
    inset 0 1px 0 rgba(245, 239, 228, .08),
    inset 0 -22px 50px rgba(0, 0, 0, .26),
    0 18px 44px rgba(0, 0, 0, .18);
}

.side-title,
.vu-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  color: rgba(58, 47, 33, .68);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.side-title {
  grid-template-columns: 1fr auto;
  color: var(--muted-2);
}

.side-title span {
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 16px;
}

.side-title strong,
.vu-labels strong {
  color: #7a4f1d;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
}

.string-readout {
  min-height: 120px;
  padding: 14px;
  border: 1px solid rgba(245, 239, 228, .10);
  background:
    radial-gradient(circle at 50% 35%, rgba(214, 168, 79, .10), transparent 70%),
    #080a09;
  display: grid;
  align-content: center;
  gap: 10px;
}

.detected-note {
  color: var(--accent-soft);
  font-family: var(--font-heading);
  font-size: 62px;
  line-height: .9;
  text-align: center;
  text-shadow: 0 0 24px rgba(214, 168, 79, .16);
}

.target-note {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.frequency-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
}

/* VU meters */

.vu-meter-main {
  padding: 12px;
}

.vu-labels span:first-child {
  text-align: left;
}

.vu-labels span:last-child {
  text-align: right;
}

.vu-window {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(77, 58, 34, .28);
}

.light-face {
  background:
    radial-gradient(circle at 50% 92%, rgba(255, 210, 124, .40), transparent 44%),
    linear-gradient(180deg, #fff8df 0%, #ecd9ad 58%, #c8a968 100%);
  box-shadow:
    inset 0 0 28px rgba(255, 236, 176, .42),
    inset 0 -26px 44px rgba(129, 86, 32, .22),
    0 0 28px rgba(214, 168, 79, .18);
}

.main-face {
  height: 202px;
}

.small-face {
  height: 112px;
}

.vu-glass {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255,255,255,.34), transparent 32%, transparent 68%, rgba(255,255,255,.10)),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.22), transparent 58%);
  pointer-events: none;
  z-index: 20;
}

.vu-backlight {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 78%, rgba(255, 176, 61, .26), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.12), transparent);
  pointer-events: none;
  z-index: 1;
}

.vu-arc {
  position: absolute;
  left: 50%;
  bottom: -102px;
  width: 280px;
  height: 280px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(74, 53, 28, .55);
  z-index: 2;
}

.main-face .vu-arc {
  display: none;
}

.vu-marks {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 1px;
  height: 1px;
  z-index: 5;
}

.small-face .vu-marks {
  bottom: 10px;
}

.vu-marks i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 126px;
  transform-origin: bottom center;
  transform: rotate(var(--r));
}

.small-face .vu-marks i {
  height: 72px;
}

.vu-marks i::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 15px;
  background: rgba(47, 34, 18, .78);
}

.small-face .vu-marks i::before {
  height: 10px;
}

.vu-marks i.center::before {
  height: 26px;
  width: 2px;
  background: #5f3b17;
}

.small-face .vu-marks i.center::before {
  height: 16px;
}

.vu-numbers {
  position: absolute;
  left: 50%;
  bottom: 64px;
  width: 82%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  color: rgba(44, 31, 16, .72);
  font-size: 13px;
  font-weight: 900;
  z-index: 6;
}

.small-face .vu-numbers {
  bottom: 30px;
  font-size: 10px;
}

.vu-numbers.compact {
  width: 70%;
}

.vu-scale-caption {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  color: rgba(44, 31, 16, .55);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  z-index: 6;
}

.vu-needle {
  --needle-angle: 0deg;
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 2px;
  height: 142px;
  background: #24170b;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(var(--needle-angle));
  box-shadow: none;
  transition: transform .055s linear;
  z-index: 10;
}

.small-face .vu-needle {
  bottom: 10px;
  height: 78px;
}

.vu-pivot {
  position: absolute;
  left: 50%;
  bottom: 11px;
  width: 26px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #4a3420, #1f1408 64%, #0a0603 100%);
  box-shadow:
    0 0 0 4px rgba(73, 47, 21, .16),
    0 8px 20px rgba(0, 0, 0, .22);
  z-index: 12;
}

.small-face .vu-pivot {
  bottom: 3px;
  width: 20px;
  height: 20px;
}

.vu-lamps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 8px;
}

.vu-lamps span {
  padding: 7px 6px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 228, .035);
  color: var(--muted-2);
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#stabilityLamp.active {
  border-color: rgba(124, 139, 111, .62);
  background: rgba(124, 139, 111, .17);
  color: #c7d8b7;
  box-shadow:
    0 0 22px rgba(124, 139, 111, .18),
    inset 0 0 18px rgba(124, 139, 111, .08);
}

/* Tune LED strip */

.tune-led-strip {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 5px;
  margin-top: 9px;
  padding: 8px;
  border: 1px solid rgba(245, 239, 228, .12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.10)),
    #080a09;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, .46),
    0 10px 26px rgba(0, 0, 0, .16);
}

.tune-led-strip span {
  height: 18px;
  border: 1px solid rgba(245, 239, 228, .08);
  background: rgba(245, 239, 228, .06);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .42);
  transition: background .08s linear, box-shadow .08s linear, border-color .08s linear;
}

.tune-led-strip span.center {
  background: rgba(124, 139, 111, .13);
}

.tune-led-strip span.on-lock {
  border-color: rgba(175, 226, 142, .80);
  background: linear-gradient(180deg, #dff0c9, #7c8b6f);
  box-shadow:
    0 0 22px rgba(124, 139, 111, .52),
    inset 0 0 10px rgba(255,255,255,.22);
}

.tune-led-strip span.on-near {
  border-color: rgba(175, 226, 142, .58);
  background: linear-gradient(180deg, #cfe8b6, #7c8b6f);
  box-shadow:
    0 0 16px rgba(124, 139, 111, .36),
    inset 0 0 8px rgba(255,255,255,.14);
}

.tune-led-strip span.on-flat,
.tune-led-strip span.on-sharp {
  border-color: rgba(214, 168, 79, .48);
  background: linear-gradient(180deg, #f4d37b, #d6a84f);
  box-shadow:
    0 0 14px rgba(214, 168, 79, .35),
    inset 0 0 8px rgba(255,255,255,.16);
}

.tune-led-strip span.hot {
  border-color: rgba(220, 98, 56, .64);
  background: linear-gradient(180deg, #ffb26c, #b94d2e);
  box-shadow:
    0 0 18px rgba(220, 98, 56, .40),
    inset 0 0 8px rgba(255,255,255,.12);
}

/* Feedback */

.vu-meter-main.is-near .main-face {
  box-shadow:
    inset 0 0 32px rgba(255, 236, 176, .48),
    inset 0 -26px 44px rgba(129, 86, 32, .22),
    0 0 30px rgba(214, 168, 79, .22);
}

.vu-meter-main.is-locked .main-face {
  box-shadow:
    inset 0 0 38px rgba(255, 236, 176, .55),
    inset 0 -26px 44px rgba(129, 86, 32, .20),
    0 0 36px rgba(124, 139, 111, .42);
}

.vu-meter-main.is-locked .vu-scale-caption {
  color: #31502f;
}

.vu-meter-main.is-locked .vu-scale-caption::after {
  content: "  LOCK";
  color: #31502f;
  font-weight: 900;
}

.hint {
  margin: 8px auto 10px;
  min-height: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.hint.ok {
  color: #c7d8b7;
}

.hint.near {
  color: var(--accent-soft);
}

.hint.bad {
  color: #d9b37f;
}

/* Buttons */

.strings {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.string-button {
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 228, .045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: .25s ease;
}

.string-button:hover {
  border-color: rgba(214, 168, 79, .34);
  color: var(--text);
  background: rgba(214, 168, 79, .08);
}

.string-button.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(214, 168, 79, .14);
  box-shadow: 0 12px 34px rgba(214, 168, 79, .10);
}

/* Fretboard */

.fretboard-panel {
  margin: 0;
}

.fretboard-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.fretboard-title strong {
  color: var(--accent);
}

.fretboard {
  position: relative;
  height: 98px;
  overflow: hidden;
  border: 1px solid rgba(214, 168, 79, .24);
  background:
    linear-gradient(90deg, rgba(0,0,0,.20), transparent 18%, transparent 82%, rgba(0,0,0,.22)),
    linear-gradient(180deg, #3a2415 0%, #6f4423 48%, #2b1a10 100%);
  box-shadow:
    inset 0 18px 44px rgba(255, 217, 147, .08),
    inset 0 -22px 54px rgba(0, 0, 0, .38);
}

.fretboard::before {
  content: "";
  position: absolute;
  left: 34px;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, #d8c09b, #fff1cc, #8a704c);
  box-shadow: 0 0 20px rgba(255, 235, 184, .18);
  z-index: 4;
}

.fretboard-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 35%, rgba(255, 213, 143, .12), transparent 18rem),
    radial-gradient(circle at 72% 68%, rgba(0, 0, 0, .20), transparent 20rem);
  pointer-events: none;
  z-index: 1;
}

.fret-wires {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.fret-wires span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(90deg, #6a573c, #f4dfae, #7b6546);
  opacity: .88;
  box-shadow: 0 0 16px rgba(255, 225, 169, .16);
}

.inlay {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff4c9, #b99552 62%, #54361a 100%);
  opacity: .82;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 18px rgba(255, 222, 160, .18);
}

.inlay-1 { left: 26%; }
.inlay-2 { left: 50%; }
.inlay-3 { left: 74%; }

.fretboard-strings {
  position: absolute;
  inset: 10px 0 10px;
  z-index: 5;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
}

.fret-string {
  position: relative;
}

.fret-string::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(141,128,102,.9), rgba(255,255,255,.30));
  box-shadow: 0 2px 5px rgba(0, 0, 0, .38);
}

.fret-string.thin::before {
  height: 2px;
}

.fret-string.thick::before {
  height: 5px;
}

.fret-string span {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 38px;
  padding: 2px 7px;
  border: 1px solid rgba(245, 239, 228, .18);
  background: rgba(15, 17, 16, .72);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  z-index: 6;
}

.fret-string.active::before {
  background:
    linear-gradient(180deg, #fff1b9, var(--accent), #8d642b);
  box-shadow:
    0 0 18px rgba(214, 168, 79, .48),
    0 2px 5px rgba(0, 0, 0, .38);
}

.fret-string.active span {
  border-color: rgba(214, 168, 79, .65);
  color: var(--accent-soft);
}

@media (max-width: 980px) {
  .instrument-panel {
    grid-template-columns: 1fr;
  }

  .side-instruments {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .strings {
    grid-template-columns: repeat(2, 1fr);
  }

  .string-button.is-auto {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .tuner-page {
    padding-top: 96px;
  }

  .tuner-card {
    padding: 16px 12px;
  }

  .tuner-top {
    flex-direction: column;
    align-items: center;
  }

  .instrument-panel {
    gap: 10px;
  }

  .side-instruments {
    grid-template-columns: 1fr;
  }

  .main-face {
    height: 178px;
  }

  .vu-needle {
    height: 120px;
  }

  .strings {
    grid-template-columns: 1fr;
  }

  .string-button.is-auto {
    grid-column: auto;
  }

  .fretboard {
    height: 92px;
  }
}


/* Taller and denser tuning LED strip */
.tune-led-strip {
  grid-template-columns: repeat(25, minmax(0, 1fr));
  gap: 3px;
  padding: 8px;
}

.tune-led-strip span {
  height: 34px;
  min-width: 0;
}

.tune-led-strip span.warn {
  border-color: rgba(239, 143, 68, .65);
  background: linear-gradient(180deg, #ffc47a, #d26d2f);
  box-shadow:
    0 0 16px rgba(239, 143, 68, .40),
    inset 0 0 8px rgba(255,255,255,.14);
}

.tune-led-strip span.hot {
  border-color: rgba(220, 70, 46, .72);
  background: linear-gradient(180deg, #ff8d67, #a93624);
  box-shadow:
    0 0 20px rgba(220, 70, 46, .46),
    inset 0 0 8px rgba(255,255,255,.12);
}

@media (max-width: 680px) {
  .tune-led-strip {
    gap: 2px;
    padding: 7px;
  }

  .tune-led-strip span {
    height: 28px;
  }
}

/* Tuner rounded corners refinement */
.tuner-card,
.vu-meter,
.string-display,
.vu-window,
.tune-led-strip,
.fretboard,
.string-readout {
  border-radius: var(--radius-lg, 22px);
}

.tune-led-strip span {
  border-radius: 7px;
}

.primary-button,
.secondary-button,
.string-button,
.status-pill,
.fret-string span,
.vu-lamps span {
  border-radius: var(--radius-pill, 999px);
}

/* Radius correction */
.tuner-card,
.vu-meter,
.string-display,
.vu-window,
.tune-led-strip,
.fretboard,
.string-readout {
  border-radius: 14px !important;
}

.primary-button,
.secondary-button,
.string-button,
.status-pill,
.fret-string span,
.vu-lamps span {
  border-radius: 10px !important;
}

.tune-led-strip span {
  border-radius: 4px !important;
}
