/* Fretwise — warm acoustic palette: walnut darks, honey amber, sunburst. */
:root {
  --bg: #191109;
  --panel: #241a12;
  --panel2: #30241a;
  --ink: #f4ecdd;
  --muted: #b7a68d;
  --accent: #e9a227;       /* honey */
  --accent2: #c9702c;      /* burnt orange */
  --good: #7fc97f;
  --bad: #e26d5c;
  --root: #7fc97f;         /* scale/chord root */
  --note: #e9a227;
  --blue: #7cc0e0;
  --border: #40301f;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 520px at 70% -10%, rgba(233,162,39,.08), transparent),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 Georgia, "Times New Roman", serif;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  overscroll-behavior-y: none;
}
a { color: var(--accent); }
button, .fb-cell, .chord-card, .lesson-tile, .routine-row, nav, .choice, .step-chip, .pat-cell {
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}

header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--border);
  padding-top: calc(10px + env(safe-area-inset-top));
}
.brand { font-size: 20px; font-weight: 700; }
.brand span { color: var(--accent); font-style: italic; }
.brand small { color: var(--muted); font-size: 11px; font-style: normal; margin-left: 6px; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button {
  background: transparent; color: var(--muted); border: none;
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit;
}
nav button:hover { color: var(--ink); background: var(--panel2); }
nav button.active { color: var(--ink); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
.mic-status { font-size: 12px; color: var(--muted); }

main { flex: 1; padding: 22px; max-width: 1080px; margin: 0 auto; width: 100%; }
h1 { font-size: 26px; margin: 0 0 4px; font-style: italic; }
h2 { font-size: 18px; margin: 20px 0 8px; color: var(--accent); }
.muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.btn { background: linear-gradient(180deg, var(--accent), var(--accent2)); color: #201404; border: none;
  font-weight: 700; padding: 10px 18px; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 15px; }
.btn:hover { filter: brightness(1.08); }
.ghost { background: var(--panel2); color: var(--ink); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-family: inherit; font-size: 14px; }
.ghost:hover { border-color: var(--accent); }
.pill { display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 99px;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--border); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
select, input[type=range] { background: var(--panel2); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-family: inherit; }

.today-card { border-left: 3px solid var(--accent); }
.ch-bar { fill: var(--panel2); stroke: var(--border); stroke-width: .5; }
.ch-ok { fill: var(--good); opacity: .85; }
.ch-lab { fill: var(--muted); font-size: 11px; }

/* lessons */
.level-title { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--accent2); margin: 18px 0 8px; }
.lesson-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lesson-tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: .15s; }
.lesson-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.lesson-tile h3 { margin: 0 0 4px; font-size: 15px; }
.lesson-tile .meta { font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: var(--border); margin-right: 5px; }
.dot.on { background: var(--good); }
.lesson-body p { margin: 9px 0; }
.lesson-body ul, .lesson-body ol { margin: 8px 0; padding-left: 22px; }
.lesson-body li { margin: 5px 0; }

/* questions */
.q-wrap { text-align: center; }
.q-prompt { font-size: 18px; margin: 10px 0 14px; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.choice { background: var(--panel2); border: 1px solid var(--border); color: var(--ink);
  padding: 12px 18px; border-radius: 10px; cursor: pointer; font-size: 15px; min-width: 110px; font-family: inherit; }
.choice:hover { border-color: var(--accent); }
.choice.correct { border-color: var(--good); background: rgba(127,201,127,.12); color: var(--good); }
.choice.wrong { border-color: var(--bad); background: rgba(226,109,92,.12); color: var(--bad); }
.feedback { margin: 14px 0; min-height: 24px; }
.feedback.ok { color: var(--good); }
.feedback.no { color: var(--bad); }
.grade-row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.session-bar { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.entered-notes { margin: 8px 0; min-height: 20px; color: var(--muted); }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat .n { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
table { border-collapse: collapse; width: 100%; margin-top: 8px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); }
.bend-progress { width: 200px; height: 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.bend-progress > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--good), #b6e3b6); transition: width .1s; }
.cents-read { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cents-read.ok { color: var(--good); }

/* fretboard */
.fretboard { overflow-x: auto; padding: 6px 0; }
.fb-grid { display: grid; gap: 3px; min-width: 720px;
  background: linear-gradient(180deg, #3a2b1a, #2c2013); padding: 8px; border-radius: 10px; border: 1px solid var(--border); }
.fb-strlabel { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding-right: 8px; line-height: 1.05; }
.fb-strlabel b { color: var(--accent); font-size: 15px; }
.fb-strlabel span { color: var(--muted); font-size: 10px; }
.fb-cell { background: #4a3722; border: 1px solid #5a442b; border-radius: 5px; min-height: 30px;
  cursor: pointer; color: var(--ink); font-family: inherit; padding: 0; transition: .08s; position: relative; }
.fb-cell:hover { background: #5c4529; }
.fb-cell.open { background: #2c2013; border-style: dashed; }
.fb-note { font-size: 12px; color: #e8dcc4; }
.fb-cell.hl { background: var(--note); color: #201404; border-color: var(--note); }
.fb-cell.hl .fb-note { color: #201404; }
.fb-cell.hl-root { background: var(--root); color: #10240f; border-color: var(--root); }
.fb-cell.hl-root .fb-note { color: #10240f; }
.fb-cell.hl-target { outline: 3px solid var(--accent); background: rgba(233,162,39,.35); }
.fb-corner {}
.fb-fretno { text-align: center; color: var(--muted); font-size: 11px; padding-top: 2px; }
.fb-mk { color: var(--accent); }

/* chord diagrams */
.chord-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.chord-grid.mini { gap: 8px; }
.chord-card { width: 88px; text-align: center; }
.chord-card.now { outline: 2px solid var(--accent); border-radius: 10px; }
.chord-name { font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.chord-diagram { width: 88px; height: auto; display: block; }
.cd-line { stroke: #7a5f3d; stroke-width: 1.4; }
.cd-nut { fill: #d9c39a; }
.cd-dot { fill: var(--accent); }
.cd-barre { fill: var(--accent); opacity: .9; }
.cd-fing { fill: #201404; font: 700 9px Georgia; }
.cd-open { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.cd-mut { fill: var(--muted); font: 700 12px Georgia; }
.cd-fretlab { fill: var(--muted); font: 10px Georgia; }

/* tuner */
.tuner-meter { position: relative; height: 26px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 99px; margin: 12px auto; max-width: 340px; overflow: hidden; }
.tuner-meter.big { height: 40px; max-width: 420px; }
.tuner-zone { position: absolute; left: 46%; right: 46%; top: 0; bottom: 0; background: rgba(127,201,127,.2); border-left: 1px solid var(--good); border-right: 1px solid var(--good); }
.tuner-needle { position: absolute; top: 3px; bottom: 3px; width: 4px; left: 50%; transform: translateX(-50%);
  background: var(--accent); border-radius: 2px; transition: left .06s linear; box-shadow: 0 0 8px var(--accent); }
.tuner-needle.good { background: var(--good); box-shadow: 0 0 10px var(--good); }
.tuner-note { font-size: 54px; font-weight: 700; color: var(--accent); line-height: 1; }
.tuner-target { margin-top: 6px; }

/* rhythm */
.beat-lights { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.beat-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--border); }
.beat-dot.on { background: var(--good); box-shadow: 0 0 10px var(--good); }
.pattern-view { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.pat-cell { width: 40px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); }
.pat-cell.rest { color: var(--muted); }
.pat-cell.on { border-color: var(--accent); background: rgba(233,162,39,.2); transform: scale(1.08); }

/* step chips (tab) */
.steps { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.step-chip { min-width: 42px; padding: 6px 8px; text-align: center; background: var(--panel2);
  border: 1px solid var(--border); border-radius: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.step-chip.playing { border-color: var(--accent); background: rgba(233,162,39,.2); transform: scale(1.08); }

/* daily routine */
.routine-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.routine-row:last-child { border-bottom: none; }
.routine-check { font-size: 18px; color: var(--accent); width: 22px; text-align: center; }
.routine-row.done .routine-label { text-decoration: line-through; color: var(--muted); }
.routine-label { flex: 1; }
.routine-go { padding: 4px 12px; }

@media (max-width: 720px) {
  main { padding: 12px; padding-bottom: 92px; }
  h1 { font-size: 22px; }
  .lesson-list { grid-template-columns: 1fr; }
  .mic-status { display: none; }
  header { padding-bottom: 6px; }
  nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--panel); border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; gap: 0;
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  }
  nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 9px; padding: 4px 2px; flex: 1; min-width: 0; }
  nav button::before { content: attr(data-icon); font-size: 18px; }
  nav button.active { box-shadow: none; background: transparent; color: var(--accent); }
}
@media (pointer: coarse) {
  .choice { padding: 14px 16px; }
  .ghost, .btn { padding: 11px 16px; }
  .fb-cell { min-height: 36px; }
}
