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

.tuner-page {
  min-height: 100vh;
  padding: 108px 16px 54px;
  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(980px, 100%);
  padding: clamp(18px, 3vw, 30px);
  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: 16px;
}

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

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

.status-pill {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 228, .045);
  color: var(--muted);
  font-size: 14px;
  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: 16px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-family: "Anton", Impact, sans-serif;
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tuner-header h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(40px, 7vw, 70px);
  line-height: .95;
  text-transform: uppercase;
}

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

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

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

.primary-button,
.secondary-button {
  min-height: 50px;
  padding: 0 28px;
  border: 1px solid transparent;
  font-family: "Anton", Impact, sans-serif;
  font-size: 16px;
  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;
}

.tuner-readout {
  margin: 0 auto 14px;
  max-width: 760px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 228, .03);
}

.note-main {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.note-label {
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.detected-note {
  color: var(--text);
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(56px, 9vw, 88px);
  line-height: .9;
  letter-spacing: -.04em;
}

.target-box {
  text-align: right;
}

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

.frequency-row {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 800;
}

/* Layout */

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

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

/* VU meters */

.vu-meter,
.signal-panel {
  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);
}

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

.vu-labels,
.side-title {
  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);
}

.vu-labels strong,
.side-title strong {
  color: #7a4f1d;
  font-family: "Anton", Impact, sans-serif;
  font-size: 16px;
  font-weight: 400;
}

.side-title span {
  color: var(--accent);
  font-family: "Anton", Impact, sans-serif;
  font-size: 16px;
}

.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, .54), transparent 44%),
    linear-gradient(180deg, #fff6d7 0%, #ead6a9 56%, #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: 238px;
}

.small-face {
  height: 126px;
}

.vu-glass {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255,255,255,.44), transparent 34%, transparent 64%, rgba(255,255,255,.16)),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.28), 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, .38), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.12), transparent);
  pointer-events: none;
  z-index: 1;
}

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

.small-face .vu-arc {
  bottom: -112px;
  width: 300px;
  height: 300px;
}

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

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

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

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

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

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

.vu-marks i.center::before {
  height: 27px;
  width: 2px;
  background: #6c4218;
  box-shadow: 0 0 12px rgba(108, 66, 24, .18);
}

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

.vu-numbers {
  position: absolute;
  left: 50%;
  bottom: 58px;
  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: 34px;
  font-size: 10px;
}

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

.vu-scale-caption {
  position: absolute;
  left: 50%;
  bottom: 34px;
  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: 24px;
  width: 2px;
  height: 162px;
  background: #26180b;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(var(--needle-angle));
  box-shadow: 0 0 8px rgba(38, 24, 11, .22);
  transition: transform .08s linear;
  z-index: 10;
}

.small-face .vu-needle {
  bottom: 12px;
  height: 88px;
  width: 2px;
}

.vu-pivot {
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 28px;
  height: 28px;
  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: 4px;
  width: 20px;
  height: 20px;
}

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

.vu-lamps.single {
  grid-template-columns: 1fr;
}

.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;
}

.vu-lamps span.active {
  border-color: rgba(214, 168, 79, .62);
  background: rgba(214, 168, 79, .16);
  color: var(--accent-soft);
  box-shadow:
    0 0 22px rgba(214, 168, 79, .18),
    inset 0 0 18px rgba(214, 168, 79, .08);
}

#okLamp.active,
#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);
}

/* Signal EQ */

.signal-panel {
  min-height: 132px;
}

.eq-bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  align-items: end;
  height: 54px;
  padding: 8px;
  border: 1px solid rgba(245, 239, 228, .10);
  background: #080a09;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .44);
}

.eq-bars span {
  height: 100%;
  min-height: 7px;
  background: rgba(245, 239, 228, .08);
  box-shadow: inset 0 0 8px rgba(0,0,0,.4);
  transition: .08s linear;
}

.eq-bars span.on {
  background: linear-gradient(180deg, #f4d37b, #d6a84f);
  box-shadow:
    0 0 12px rgba(214, 168, 79, .38),
    inset 0 0 8px rgba(255,255,255,.16);
}

.eq-bars span.hot {
  background: linear-gradient(180deg, #f2a45f, #b66b2e);
  box-shadow:
    0 0 14px rgba(242, 164, 95, .42),
    inset 0 0 8px rgba(255,255,255,.12);
}

.eq-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

/* Hint */

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

.hint.ok {
  color: #c7d8b7;
}

.hint.bad {
  color: #d9b37f;
}

/* String buttons */

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

.string-button {
  min-height: 42px;
  padding: 8px 9px;
  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 0 16px;
}

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

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

.fretboard {
  position: relative;
  height: 122px;
  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: 17px;
  height: 17px;
  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: 14px 0 14px;
  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);
}

.microcopy {
  max-width: 760px;
  margin: 14px auto 0;
  color: var(--muted-2);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

@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: 102px;
  }

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

  .tuner-top,
  .note-main,
  .frequency-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .target-box {
    text-align: center;
  }

  .frequency-row {
    justify-content: center;
  }

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

  .main-face {
    height: 190px;
  }

  .vu-needle {
    height: 128px;
  }

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

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

  .fretboard {
    height: 112px;
  }
}

/* Clean main TUNE indicator: no big circle, only scale and needle */
.main-face .vu-arc {
  display: none;
}

.main-face {
  background:
    radial-gradient(circle at 50% 82%, rgba(255, 210, 124, .34), transparent 42%),
    linear-gradient(180deg, #fff8df 0%, #ecd9ad 58%, #c8a968 100%);
}

.main-face .vu-marks i::before {
  background: rgba(47, 34, 18, .78);
}

.main-face .vu-marks i.center::before {
  background: #5f3b17;
  box-shadow: none;
}

.main-face .vu-numbers {
  bottom: 70px;
}

.main-face .vu-scale-caption {
  bottom: 45px;
}

.main-face .vu-needle {
  background: #24170b;
  box-shadow: none;
}

.main-face .vu-glass {
  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%);
}

/* Smoother analog needle movement */
.vu-needle {
  transition: transform .18s cubic-bezier(.22, .72, .22, 1);
}

/* More responsive but still analog needle */
.vu-needle {
  transition: transform .09s cubic-bezier(.2, .75, .25, 1);
}

/* Clear tuning 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.near {
  color: var(--accent-soft);
}

#okLamp.active {
  color: #dff0c9;
  border-color: rgba(124, 139, 111, .78);
  background: rgba(124, 139, 111, .24);
  box-shadow:
    0 0 28px rgba(124, 139, 111, .28),
    inset 0 0 18px rgba(124, 139, 111, .12);
}
