@font-face { font-family: "Cinzel"; font-weight: 500 700; font-display: swap; src: url(fonts/cinzel-latin-500-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 400 800; font-display: swap; src: url(fonts/nunito-latin-400-800-normal.woff2) format("woff2"); }
:root {
  --deep: #150f29; --night: #1a1330; --night-2: #261b45; --night-3: #3a2a68; --ink: #f6efe0; --dim: #a99cd0;
  --accent: #e6b84f; --on-accent: #2a1f10; --accent-shadow: #8a6a1c; --good: #5fe08a; --bad: #ff7a90; --warn: #ffb35c;
  --shade: #0e0920; --scrim: rgba(10, 6, 24, .6);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--deep); color: var(--ink); }
body { min-height: 100dvh; font-size: 16px; line-height: 1.4; overflow-x: hidden; }
.sky { position: fixed; inset: 0; z-index: -1; background: radial-gradient(900px 500px at 50% -10%, #3b2a6e 0%, transparent 70%), linear-gradient(#1a1330, #120c24); }
.app { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
h1 { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 1.5rem; letter-spacing: .06em; margin: 4px 0 8px; display: flex; align-items: center; gap: 10px; color: var(--accent); }
.logo { width: 30px; height: 30px; color: var(--accent); }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; white-space: nowrap; font-size: .95rem; font: inherit; font-weight: 700; color: var(--dim); background: transparent; border: 0; border-bottom: 3px solid var(--night-3); padding: 10px 4px; min-height: 44px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button:disabled { opacity: .55; cursor: not-allowed; }
.tabs i { font-style: normal; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-left: 2px; }
.card { background: linear-gradient(var(--night-2), #20173d); border: 1px solid var(--night-3); border-radius: 18px; padding: 14px; }
.btn { font: inherit; font-weight: 800; color: var(--ink); background: var(--night-3); border: 2px solid #4b3a86; border-radius: 99px; padding: 10px 18px; min-height: 46px; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: var(--accent); color: var(--on-accent); border-color: #f3d27f; box-shadow: 0 3px 0 var(--accent-shadow); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.round { width: 46px; padding: 0; font-size: 1.4rem; line-height: 1; }
.btn:focus-visible, select:focus-visible, input:focus-visible, .chips button:focus-visible, .tabs button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* input */
.in-row { display: flex; gap: 10px; align-items: center; }
.meter { position: relative; flex: 1; height: 16px; border-radius: 99px; background: var(--deep); border: 1px solid var(--night-3); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #3fbf6f, #e6d44f 75%, #ff6b6b); border-radius: 99px; }
.meter b { position: absolute; top: 0; bottom: 0; width: 3px; left: 0; background: var(--ink); opacity: .85; }
.in-pick { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 10px; }
.in-pick label { display: grid; gap: 4px; font-size: .78rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; min-width: 0; }
select, input[type=number] { font: inherit; font-size: 1rem; color: var(--ink); background: var(--deep); border: 2px solid var(--night-3); border-radius: 12px; padding: 9px 10px; min-height: 44px; width: 100%; text-transform: none; letter-spacing: 0; }
.status { margin: 10px 0 0; color: var(--dim); font-size: .92rem; }
.status.ok { color: var(--good); }
.help { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid #6b3a4a; background: #3a1d2e; color: #ffd8df; font-size: .94rem; }
.inset { margin-top: 8px; }
.inset > summary { cursor: pointer; font-weight: 700; color: var(--dim); min-height: 32px; }
.lat { margin-top: 10px; border-top: 1px solid var(--night-3); padding-top: 8px; }
.lat summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.lat small { color: var(--dim); font-weight: 400; }
.lat p { color: var(--dim); font-size: .9rem; margin: 6px 0; }

/* tuner */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { font: inherit; font-weight: 700; font-size: .92rem; color: var(--dim); background: var(--night-2); border: 2px solid var(--night-3); border-radius: 99px; padding: 8px 14px; min-height: 42px; cursor: pointer; }
.chips button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: #f3d27f; }
.gauge { padding: 10px 10px 16px; text-align: center; transition: box-shadow .2s, border-color .2s; }
.gauge.intune { border-color: var(--good); box-shadow: 0 0 28px rgba(95, 224, 138, .28); }
.gauge.idle .needle { opacity: .35; }
.dial { width: 100%; max-height: 46vh; display: block; }
.zone { fill: none; stroke: rgba(95, 224, 138, .35); stroke-width: 16; }
.dial .tick { stroke: var(--dim); stroke-width: 2; }
.dial .tick.mid { stroke: var(--ink); stroke-width: 3; }
.dial text { fill: var(--dim); font-size: 12px; text-anchor: middle; font-family: "Nunito", sans-serif; font-weight: 700; }
.needle { transform-origin: 160px 165px; transform: rotate(0deg); transition: opacity .2s; }
.needle line { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.needle circle { fill: var(--accent); }
.intune .needle line, .intune .needle circle { stroke: var(--good); fill: var(--good); }
.readout { margin-top: -6px; }
.note { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: clamp(4rem, 22vw, 6.5rem); line-height: 1; }
.note sup { font-size: .38em; color: var(--dim); vertical-align: top; position: relative; top: .35em; margin-left: 2px; }
.intune .note { color: var(--good); }
.idle .note { color: var(--night-3); }
.sub { font-size: 1.1rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.sub .dot { margin: 0 8px; }
.hint { margin-top: 6px; min-height: 1.6em; font-weight: 800; font-size: 1.15rem; color: var(--accent); }
.intune .hint { color: var(--good); }
.strings { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.str { font: inherit; display: grid; gap: 2px; justify-items: center; color: var(--ink); background: var(--deep); border: 2px solid var(--night-3); border-radius: 14px; padding: 10px 2px; min-height: 66px; cursor: pointer; }
.str b { font-family: "Cinzel", serif; font-size: 1.3rem; }
.str small { color: var(--dim); font-size: .7rem; white-space: nowrap; }
.str.near { border-color: var(--accent); background: #35265f; }
.str.done { border-color: var(--good); background: #1d3a34; }
.tiny { color: var(--dim); font-size: .82rem; margin: 10px 0 0; }
.range-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.range-row span { color: var(--dim); }
.range-row b { font-family: "Cinzel", serif; font-size: 1.3rem; flex: 1; }
.a4-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.a4-row input { width: 76px; text-align: center; font-weight: 800; }
.foot { text-align: center; color: var(--dim); font-size: .84rem; }
.foot p { margin: 4px 0; }
.foot a { color: var(--accent); }
.chip-btn { font: inherit; }
@media (min-width: 760px) { .app { max-width: 620px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.str sub { font-size: .55em; color: var(--dim); }

/* Ad-prep: the footer's Report a bug link is a proper tap target (at least 44px tall) */
.foot a#bug { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }

/* ===== Song Coach ===== */
.c-lead { margin: 0; color: var(--dim); }
.c-pick { display: grid; gap: 12px; }
.c-song { display: grid; gap: 4px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; position: relative; padding: 16px 16px 14px; border: 2px solid var(--night-3); width: 100%; }
button.c-song:hover, button.c-song:focus-visible { border-color: var(--accent); outline: none; }
.c-title { font-family: "Cinzel", Georgia, serif; font-size: 1.25rem; color: var(--accent); padding-right: 64px; }
.c-sub { color: var(--ink); } .c-meta { color: var(--dim); font-size: .86rem; } .c-stars { color: var(--accent); font-weight: 800; letter-spacing: .08em; font-size: .9rem; }
.c-stars.big { font-size: 2.2rem; text-align: center; letter-spacing: .2em; }
.c-badge { position: absolute; top: 14px; right: 14px; background: var(--good); color: #0d2a18; font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; border-radius: 99px; padding: 3px 10px; }
.c-badge.dim { background: var(--night-3); color: var(--dim); }
.c-locked-row { display: grid; gap: 10px; }
.c-song.locked { opacity: .55; cursor: default; border-style: dashed; min-height: 68px; }
.c-song.locked .c-title { color: var(--dim); font-size: 1rem; } .c-song.locked .c-sub { color: var(--dim); font-size: .88rem; }
.c-lock { position: absolute; right: 16px; bottom: 12px; font-size: 1rem; filter: grayscale(1); }
.c-screen { display: grid; gap: 10px; }
.c-head { display: flex; align-items: center; gap: 10px; }
.c-head h2 { margin: 0; font-family: "Cinzel", Georgia, serif; font-size: 1.05rem; color: var(--accent); line-height: 1.25; }
.c-modes button { flex: 1; min-height: 46px; }
.c-modehelp { margin: 0; color: var(--dim); font-size: .92rem; min-height: 1.3em; }
.c-opts { display: grid; gap: 10px; padding: 12px; }
.c-opts.running { display: none; }
.c-opt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.c-opt > span { width: 84px; color: var(--dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.c-opt output { min-width: 62px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.c-opt select { width: auto; flex: 1; min-width: 0; }
.c-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.c-check input { width: 24px; height: 24px; accent-color: var(--accent); }
.c-opts .tiny { margin: 0; }
.c-stage { position: relative; padding: 8px; overflow: hidden; }
.c-hud { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; padding: 2px 6px 6px; min-height: 1.9em; }
.c-hl { color: var(--ink); font-size: 1.05rem; } .c-hr { color: var(--accent); font-size: 1.05rem; }
.c-prog { height: 5px; border-radius: 99px; background: var(--deep); margin: 0 4px 8px; overflow: hidden; }
.c-prog i { display: block; height: 100%; width: 0; background: var(--accent); }
#c-hw { display: block; width: 100%; height: clamp(230px, 46dvh, 380px); border-radius: 12px; background: var(--deep); touch-action: manipulation; }
.c-count { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 6rem; color: var(--accent); text-shadow: 0 0 30px rgba(230, 184, 79, .6); pointer-events: none; }
.c-result { position: absolute; inset: 0; background: rgba(14, 9, 32, .98); display: grid; align-content: center; gap: 8px; padding: 16px; text-align: center; overflow: auto; }
.c-result h3 { margin: 0; font-family: "Cinzel", Georgia, serif; color: var(--accent); font-size: 1.3rem; }
.c-result dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0; }
.c-result dl div { background: var(--night-2); border: 1px solid var(--night-3); border-radius: 12px; padding: 8px; }
.c-result dt { color: var(--dim); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; } .c-result dd { margin: 0; font-size: 1.5rem; font-weight: 800; }
.c-resrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.c-tip { margin: 0; min-height: 1.4em; color: var(--dim); text-align: center; font-weight: 700; }
.c-ctl { display: flex; gap: 8px; flex-wrap: wrap; } .c-ctl .btn { flex: 1; min-width: 120px; }
.c-nomic { border: 1px solid #6b3a4a; background: #3a1d2e; border-radius: 14px; padding: 10px 14px; color: #ffd8df; } .c-nomic p { margin: 0 0 8px; }
/* while a song is running the input panel and footer step aside so the highway gets the screen */
/* fretboard under the highway */
.c-fbwrap { margin-top: 8px; }
.c-fbhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 6px; }
.c-fbtext { font-weight: 800; font-size: 1.05rem; color: var(--accent); min-height: 1.4em; }
.c-fbhead .btn { flex: none; min-height: 34px; padding: 4px 12px; font-size: .82rem; }
#c-fb { display: block; width: 100%; border-radius: 12px; background: var(--deep); }
.c-tab { margin: 0; overflow-x: auto; background: var(--deep); border: 1px solid var(--night-3); border-radius: 12px; padding: 10px; font: 600 .8rem/1.25 ui-monospace, Consolas, monospace; color: var(--ink); max-height: 40dvh; }
body.has-fret #c-hw { height: clamp(190px, 34dvh, 300px); }
body.coach-live #input, body.coach-live .foot, body.coach-live .c-head, body.coach-live .c-modehelp { display: none; }
@media (orientation: landscape) and (max-height: 520px) {
  #c-hw { height: clamp(130px, 58dvh, 260px); }
  body.has-fret #c-hw { height: clamp(120px, 30dvh, 170px); }
  .c-fbhead { padding-bottom: 2px; } .c-fbtext { font-size: .95rem; min-height: 1.2em; }
  .c-stage { padding: 6px 8px; } .c-hud { padding-bottom: 2px; min-height: 1.5em; } .c-prog { margin-bottom: 4px; }
  body.coach-live .top { display: none; }
  .c-count { font-size: 3.5rem; }
}
