:root {
  color-scheme: dark;
  --bg: #10140f;
  --panel: #1a2018;
  --line: #313b2e;
  --text: #f4f1e7;
  --muted: #aab2a5;
  --green: #73e187;
  --amber: #ffca66;
  --red: #ff7b6f;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at 80% 0%, rgba(115, 225, 135, .11), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 12px calc(env(safe-area-inset-bottom) + 24px);
}

header { display: flex; align-items: center; gap: 9px; margin: 0 2px 15px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #496044; border-radius: 12px; color: var(--green); font-size: 26px; }
h1 { margin: 0; font-size: 21px; letter-spacing: -.5px; }
header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.hero { text-align: center; margin: 9px 0 12px; }
.compact-status #instruction { margin: 4px auto 0; max-width: 420px; color: #7f897b; font-size: 10px; line-height: 1.3; }
.start-icon { appearance: none; display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; margin-left: auto; padding: 0; border: 1px solid rgba(115,225,135,.55); border-radius: 50%; background: var(--green); color: #0d180f; box-shadow: 0 6px 20px rgba(61,173,81,.16); touch-action: manipulation; }
.start-icon svg { width: 23px; height: 23px; fill: currentColor; stroke: currentColor; }
.start-icon .start-stop { display: none; }
.start-icon.stop { background: #313a2f; color: var(--text); border-color: #566052; box-shadow: none; }
.start-icon.stop .start-play { display: none; }
.start-icon.stop .start-stop { display: block; }
.start-icon:active { transform: scale(.95); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: #151a14; }
.mode { appearance: none; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; padding: 9px 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; touch-action: manipulation; }
.mode.active { background: #2a3427; color: var(--text); }
.mode svg, .tuning-mode svg, .visual-choice svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode svg { width: 21px; height: 21px; }
.tuning-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: min(100%, 300px); margin: 0 auto 12px; padding: 3px; border-radius: 12px; background: #151a14; }
.tuning-mode { appearance: none; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 9px; padding: 8px 7px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tuning-mode svg { width: 25px; height: 19px; }
.tuning-mode.active { background: #263024; color: var(--text); }
#status { min-height: 17px; margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.meter { height: 3px; overflow: hidden; margin: 7px 4px 0; border-radius: 9px; background: #252c23; }
.meter span { display: block; width: 4%; height: 100%; border-radius: inherit; background: var(--green); transition: width .12s ease; }
.signal-quality { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.signal-quality[hidden] { display: none; }
.quality-dot { width: 8px; height: 8px; border-radius: 50%; background: #778073; }
.signal-quality.good { color: #bfeac5; border-color: rgba(115,225,135,.35); }
.signal-quality.good .quality-dot { background: var(--green); }
.signal-quality.weak, .signal-quality.noisy { color: #ffe0a1; border-color: rgba(255,202,102,.38); }
.signal-quality.weak .quality-dot, .signal-quality.noisy .quality-dot { background: var(--amber); }
.signal-quality.clipping { color: #ffc0ba; border-color: rgba(255,123,111,.4); }
.signal-quality.clipping .quality-dot { background: var(--red); }

.strings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.string-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-areas: "note reading" "track track";
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 8px 10px 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(26, 32, 24, .88);
  transition: border-color .2s ease, background .2s ease;
}
.note { grid-area: note; font-size: 23px; font-weight: 750; }
.octave { color: var(--muted); font-size: 12px; font-weight: 500; }
.track { grid-area: track; position: relative; height: 22px; }
.track::before { content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 2px; background: #394236; }
.track::after { content: ""; position: absolute; top: 5px; left: 50%; width: 2px; height: 12px; background: #879282; }
.needle { position: absolute; top: 4px; left: 50%; width: 14px; height: 14px; border: 3px solid var(--muted); border-radius: 50%; background: var(--panel); transform: translateX(-50%); transition: left .45s cubic-bezier(.22,.61,.36,1), border-color .2s ease; will-change: left; }
.reading { grid-area: reading; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.cents { display: block; font-size: 15px; font-weight: 700; }
.direction { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.string-card.good { border-color: rgba(115, 225, 135, .65); background: rgba(34, 57, 34, .9); }
.string-card.good .needle { border-color: var(--green); }
.string-card.close .needle { border-color: var(--amber); }
.string-card.far .needle { border-color: var(--red); }
.string-card.waiting { opacity: .62; }
.string-card.sustaining { opacity: .82; }

.single-tuner[hidden] { display: none; }
.strings[hidden], .tuning-mode-switch[hidden] { display: none !important; }
.single-card { display: grid; justify-items: center; padding: 22px 18px 24px; border: 1px solid var(--line); border-radius: 22px; background: rgba(26,32,24,.9); overflow: hidden; }
.single-string { color: var(--muted); font-size: 13px; font-weight: 700; }
.single-note { display: flex; align-items: baseline; margin: 13px 0 10px; }
.single-note strong { font-size: 64px; line-height: 1; letter-spacing: -4px; }
.single-note span { margin-left: 5px; color: var(--muted); font-size: 18px; }
.visual-selector { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; width: min(100%,330px); padding: 3px; border-radius: 11px; background: #131812; }
.visual-choice { appearance: none; display: grid; justify-items: center; gap: 3px; border: 0; border-radius: 8px; padding: 6px 5px; background: transparent; color: var(--muted); font: inherit; font-size: 9px; font-weight: 700; touch-action: manipulation; }
.visual-choice svg { width: 25px; height: 17px; }
.visual-choice.active { background: #2b3528; color: var(--text); }
.single-visuals { width: min(100%,390px); margin: 17px 0 14px; }
.single-visual { position: relative; width: 100%; height: 92px; overflow: hidden; border: 1px solid #394536; border-radius: 15px; background: #121711; }
.single-visual[hidden] { display: none; }
.needle-scale { position: absolute; inset: 17px 14px; border-bottom: 2px solid #465342; }
.needle-scale::before { content: ""; position: absolute; left: 50%; bottom: -8px; width: 2px; height: 50px; background: var(--green); opacity: .65; }
.needle-scale span { position: absolute; bottom: 8px; color: var(--muted); font-size: 17px; }
.scale-flat { left: 0; } .scale-sharp { right: 0; }
#single-needle { position: absolute; left: 50%; bottom: -8px; width: 4px; height: 58px; border-radius: 4px; background: var(--green); box-shadow: 0 0 12px rgba(115,225,135,.5); transform: translateX(-50%); transition: left .55s cubic-bezier(.22,.61,.36,1), background .25s; }
.stream-band { --stream-duration: 1s; position: absolute; inset: 20px 0; width: 140%; left: -20%; background: repeating-linear-gradient(90deg,#263024 0 12px,var(--green) 12px 20px,#263024 20px 32px); opacity: .9; will-change: transform; backface-visibility: hidden; }
.stream-band.flat { animation: stream-left var(--stream-duration) linear infinite; }
.stream-band.sharp { animation: stream-right var(--stream-duration) linear infinite; }
.stream-band.tuned { animation: none; background: linear-gradient(90deg,#263024 0 47%,var(--green) 47% 53%,#263024 53%); }
.stream-band.idle { opacity: .25; }
.stream-center { position: absolute; top: 10px; bottom: 10px; left: 50%; width: 2px; background: rgba(244,241,231,.65); }
.mirror-visual { display: grid; grid-template-columns: 1fr 4px 1fr; align-items: center; padding: 18px; gap: 6px; }
.mirror-visual > i { height: 58px; border-radius: 4px; background: var(--green); box-shadow: 0 0 12px rgba(115,225,135,.45); }
.mirror-side { display: flex; align-items: center; height: 34px; }
.mirror-side.left { justify-content: flex-end; } .mirror-side.right { justify-content: flex-start; }
.mirror-side span { width: 0%; height: 100%; border-radius: 6px; transition: width .6s cubic-bezier(.22,.61,.36,1); }
#mirror-left { background: linear-gradient(90deg,#664f22,var(--amber)); }
#mirror-right { background: linear-gradient(90deg,var(--red),#66312d); }
.single-cents { font-size: 27px; font-variant-numeric: tabular-nums; }
.single-direction { min-height: 20px; margin-top: 6px; color: var(--muted); font-size: 14px; font-weight: 650; }
.single-direction.flat { color: var(--amber); }
.single-direction.sharp { color: var(--red); }
.single-direction.tuned { color: var(--green); }
.fast-tuner { display: grid; grid-template-columns: 42px 1fr 46px; align-items: center; gap: 8px; width: min(100%,390px); margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.fast-track { position: relative; height: 17px; }
.fast-track::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; border-radius: 2px; background: #394236; }
.fast-track::after { content: ""; position: absolute; top: 3px; left: 50%; width: 2px; height: 12px; background: var(--green); opacity: .65; }
#fast-needle { position: absolute; z-index: 1; top: 2px; left: 50%; width: 4px; height: 14px; border-radius: 4px; background: #778073; transform: translateX(-50%); transition: left .12s linear, background .12s; will-change: left; }
#fast-cents { color: var(--text); text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
@keyframes stream-left { from { transform: translate3d(0,0,0); } to { transform: translate3d(-32px,0,0); } }
@keyframes stream-right { from { transform: translate3d(0,0,0); } to { transform: translate3d(32px,0,0); } }

.playing { display: grid; gap: 10px; }
.playing[hidden] { display: none; }
.chord-card, .notes-card, .fretboard-card { padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(26, 32, 24, .88); }
.eyebrow { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#chord-name { display: block; color: var(--green); font-size: 52px; line-height: 1; letter-spacing: -2px; }
#chord-detail { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.played-notes, .fret-positions { display: flex; flex-wrap: wrap; gap: 7px; }
.note-pill, .fret-pill { padding: 7px 10px; border: 1px solid #40503c; border-radius: 999px; background: #222a20; font-size: 13px; font-weight: 700; }
.note-pill small { margin-left: 3px; color: var(--muted); font-weight: 500; }
.fretboard-card p { margin: 12px 0 0; color: #7f897b; font-size: 11px; line-height: 1.4; }
.empty { color: var(--muted); }

details { margin-top: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--muted); font-size: 14px; }
summary { color: var(--text); cursor: pointer; }
li { margin: 8px 0; line-height: 1.4; }
.privacy { margin: 18px 12px 0; color: #778073; text-align: center; font-size: 11px; line-height: 1.4; }

@media (min-width: 560px) {
  main { padding-left: 18px; padding-right: 18px; }
  .strings { gap: 10px; }
}

/* Pedal enclosure skin: code-native gradients keep this crisp and lightweight. */
body {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% -15%, #263126 0, #0a0d0a 58%);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}
.pedal-shell {
  position: relative;
  width: min(calc(100% - 10px), 720px);
  margin: 5px auto;
  border: 1px solid #3d463d;
  border-radius: 18px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.035), transparent 24%, rgba(0,0,0,.18) 72%),
    repeating-linear-gradient(0deg, #171c17 0 2px, #151a15 2px 4px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -3px 8px rgba(0,0,0,.5), 0 14px 38px rgba(0,0,0,.5);
}
.case-screw { position: absolute; z-index: 5; width: 10px; height: 10px; border: 1px solid #090b09; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a0a59f 0 10%, #626761 24%, #242824 68%); box-shadow: 0 1px 2px #000; }
.case-screw::after { content: ""; position: absolute; top: 4px; left: 1px; width: 6px; height: 1px; background: #171a17; transform: rotate(-24deg); }
.screw-tl { top: 8px; left: 8px; } .screw-tr { top: 8px; right: 8px; }
.screw-bl { bottom: 8px; left: 8px; } .screw-br { bottom: 8px; right: 8px; }
header { margin-left: 10px; margin-right: 7px; padding: 0 5px 10px; border-bottom: 1px solid #333b33; }
.brand-mark { border-color: #556255; background: #101410; box-shadow: inset 0 0 10px #050705; text-shadow: 0 0 8px rgba(115,225,135,.55); }
h1 { font-family: Impact, "Arial Narrow", sans-serif; font-size: 23px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
header p { color: #788278; font-size: 9px; letter-spacing: .11em; }
.start-icon {
  position: relative;
  width: 46px;
  height: 46px;
  border: 2px solid #1b1e1b;
  background: radial-gradient(circle at 38% 30%, #f1f2ef 0 7%, #a8aca7 28%, #5e635e 62%, #303430 76%);
  color: #182018;
  box-shadow: inset 0 1px 2px #fff, inset 0 -4px 5px rgba(0,0,0,.35), 0 3px 0 #151815, 0 6px 10px rgba(0,0,0,.45);
}
.start-icon.stop { background: radial-gradient(circle at 38% 30%, #dadbd8 0 7%, #8f938e 30%, #494e49 65%); color: #202520; transform: translateY(2px); }
.switch-led { position: absolute; top: -9px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #243025; transform: translateX(-50%); box-shadow: inset 0 0 2px #000; }
.start-icon.stop .switch-led { background: var(--red); box-shadow: 0 0 8px var(--red); }
.tuning-mode-switch { border: 1px solid #303730; background: #0d110d; box-shadow: inset 0 2px 5px #050705; }
.tuning-mode { letter-spacing: .04em; text-transform: uppercase; }
.tuning-mode.active { background: linear-gradient(#303a30,#242c24); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px #000; color: #d8f8dc; }
.single-card, .string-card {
  border-color: #050705;
  background: linear-gradient(145deg, #0c110c, #121812);
  box-shadow: inset 0 0 0 2px #252d25, inset 0 0 22px rgba(0,0,0,.7), 0 2px 2px rgba(255,255,255,.035);
}
.single-string, .eyebrow { color: #8b988b; letter-spacing: .08em; text-transform: uppercase; }
.single-note strong, .single-cents, .cents { color: #a8ffb3; text-shadow: 0 0 7px rgba(115,225,135,.45); }
.visual-selector { border: 1px solid #070907; background: #090c09; box-shadow: inset 0 1px 5px #000; }
.visual-choice { color: #687368; letter-spacing: .05em; text-transform: uppercase; }
.visual-choice.active { color: #d5f6d9; background: linear-gradient(#303830,#202720); box-shadow: inset 0 1px rgba(255,255,255,.06); }
.single-visual { border: 2px solid #050705; background: linear-gradient(#070b07,#0d130d); box-shadow: inset 0 0 18px #000, 0 1px 0 #333b33; }
.needle-scale { border-color: #405040; }
.single-direction { letter-spacing: .03em; text-transform: uppercase; }
.fast-tuner { letter-spacing: .05em; text-transform: uppercase; }
.string-card.good { background: linear-gradient(145deg,#102010,#152515); box-shadow: inset 0 0 0 2px #294529, inset 0 0 18px rgba(0,0,0,.65); }
.signal-quality { background: #0d110d; box-shadow: inset 0 1px 4px #000; text-transform: uppercase; letter-spacing: .04em; }
details { background: #111611; border-color: #343c34; box-shadow: inset 0 1px 4px rgba(0,0,0,.4); }
.privacy { padding: 0 12px; }
