/* Logic Guide: lessons, the main-window map, shortcuts, quizzes, the first-song checklist and tips (lg-*).
   Colours only from style.css tokens, so light and dark both work. */

/* Seven sections in the phone tab bar: slightly smaller labels so "First song" and "Shortcuts" fit. */
@media (max-width: 959px) {
  .nav-tabbar a { font-size: 10.5px; padding-left: 0; padding-right: 0; }
  .nav-tabbar a span { white-space: nowrap; }
}
@media (max-width: 380px) {
  .nav-tabbar a { font-size: 10px; letter-spacing: -0.01em; }
}

/* ---------- shared pieces ---------- */
.lg-callout-body { display: flex; flex-direction: column; gap: 6px; }
.lg-keys { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; vertical-align: middle; }
.lg-keys kbd { font-size: 12px; line-height: 1.5; padding: 0 6px; color: var(--fg); white-space: nowrap; }
.lg-plus { font-size: 11px; color: var(--muted); }
.lg-empty { padding: 24px 0; text-align: center; grid-column: 1 / -1; }
.lg-search { max-width: 460px; }
.lg-search input { width: 100%; }
.lg-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-chip-btn {
  font: 500 13px var(--font-body); padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 34px;
  background: var(--surface-2); color: var(--muted); border: 1px solid transparent;
}
.lg-chip-btn:hover { color: var(--fg); border-color: var(--line); }
.lg-chip-btn.on { background: var(--accent); color: var(--accent-ink); }
.lg-disclaimer { font-size: 13px; color: var(--muted); max-width: 62ch; }

/* ---------- lessons ---------- */
.lg-ln-meta { gap: 8px 12px; margin-top: -8px; }
.lg-ln-lesson { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lg-ln-lesson > .prose:first-child h2:first-child { margin-top: 0; }
.lg-steps { display: flex; flex-direction: column; gap: 12px; max-width: 72ch; }
.lg-step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lg-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.lg-step .step-num { width: 28px; height: 28px; font-size: 14px; }
.lg-step-body { min-width: 0; flex: 1; padding-top: 2px; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.lg-table { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lg-table table { width: 100%; }
.lg-table th, .lg-table td { vertical-align: top; padding: 9px 12px; }
.lg-table tr:last-child td { border-bottom: 0; }
.lg-table td { min-width: 7.5em; }
@media (max-width: 600px) { .lg-table th, .lg-table td { padding: 8px 9px; font-size: 14px; } }
.lg-related { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.lg-related h2 { font-size: 20px; }
.lg-ln-complete {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.lg-ln-complete .btn.primary { max-width: 100%; white-space: normal; text-align: left; }

/* ---------- main-window map ---------- */
.lg-map { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lg-map-wrap { width: 100%; max-width: 760px; }
.lg-map-svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.lg-map-frame { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.lg-map-pane { fill: var(--surface); stroke: var(--line); }
.lg-map-line { fill: var(--line); }
.lg-map-btn { fill: var(--surface-2); stroke: var(--line); stroke-width: 0.8; }
.lg-map-ink { fill: var(--muted); }
.lg-map-ink-line { stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; }
.lg-map-rec { fill: var(--bad); }
.lg-map-lcd { fill: var(--cool-soft); stroke: var(--cool); stroke-width: 0.8; }
.lg-map-lcdtxt { font: 600 7px var(--font-mono); fill: var(--cool); white-space: pre; }
.lg-map-ruler { fill: var(--surface-2); }
.lg-map-cycle { fill: var(--accent); opacity: 0.55; }
.lg-map-head { fill: var(--surface-2); }
.lg-map-reg { stroke-width: 0.8; }
.lg-map-reg.drum { fill: var(--accent-soft); stroke: var(--accent); }
.lg-map-reg.midi { fill: var(--good-soft); stroke: var(--good); }
.lg-map-reg.audio { fill: var(--cool-soft); stroke: var(--cool); }
.lg-map-note { fill: var(--fg); opacity: 0.5; }
.lg-map-note.big { fill: var(--good); opacity: 0.85; }
.lg-map-wave { fill: none; stroke: var(--cool); stroke-width: 0.9; }
.lg-map-playhead { fill: var(--fg); opacity: 0.7; }
.lg-map-tab { fill: var(--surface-2); stroke: var(--line); stroke-width: 0.8; }
.lg-map-tabtxt { font: 600 6.8px var(--font-body); fill: var(--muted); }
.lg-map-meter { fill: var(--good); opacity: 0.7; }
.lg-map-knob { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.2; }

.lg-map-spot { cursor: pointer; outline: none; }
.lg-map-hit { fill: transparent; stroke: transparent; stroke-width: 1.5; transition: fill .15s, stroke .15s; }
.lg-map-spot:hover .lg-map-hit { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: color-mix(in srgb, var(--accent) 60%, transparent); stroke-dasharray: 3 2; }
.lg-map-spot:focus-visible .lg-map-hit { stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: none; }
.lg-map-spot.on .lg-map-hit { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: var(--accent); stroke-dasharray: none; }
.lg-map-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; }
.lg-map-spot.on .lg-map-dot { fill: var(--fg); }
.lg-map-num { font: 700 9px var(--font-body); fill: var(--accent-ink); text-anchor: middle; pointer-events: none; }
.lg-map-spot.on .lg-map-num { fill: var(--bg); }
.lg-map-num.two { font-size: 7.5px; letter-spacing: -0.04em; }

.lg-map-info {
  display: flex; flex-direction: column; gap: 6px; min-height: 108px;
  background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px;
}
.lg-map-info p { font-size: 15px; }
.lg-map-info-head { gap: 8px 10px; }
.lg-map-link { font-size: 14px; font-weight: 600; text-decoration: none; width: fit-content; }
.lg-map-link:hover { text-decoration: underline; }
.lg-map-legend {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 6px;
}
.lg-map-legend-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; text-align: left;
  font: 600 14px var(--font-body); color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; cursor: pointer;
}
.lg-map-legend-btn:hover { border-color: var(--muted); }
.lg-map-legend-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lg-map-legend-n {
  width: 22px; height: 22px; border-radius: 999px; flex: none; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 700 12px var(--font-body);
}
.lg-home-map .lg-map-info { min-height: 132px; }

/* ---------- shortcuts ---------- */
.lg-sc-list { display: flex; flex-direction: column; gap: 22px; }
.lg-sc-group { display: flex; flex-direction: column; gap: 6px; }
.lg-sc-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lg-sc-row {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 6px 14px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.lg-sc-row:last-child { border-bottom: 0; }
.lg-sc-action { display: flex; flex-direction: column; font-size: 15px; min-width: 0; }
.lg-sc-action small { font-size: 13px; }
@media (max-width: 520px) {
  .lg-sc-row { grid-template-columns: 8.75rem minmax(0, 1fr); padding: 9px 10px; gap: 6px 10px; }
  .lg-sc-action { font-size: 14px; }
}

/* ---------- quizzes ---------- */
.lg-q { gap: 12px; }
.lg-q-prompt { font-size: clamp(20px, 3.2vw, 27px); line-height: 1.25; overflow-wrap: anywhere; }
.lg-q-keys .lg-keys { gap: 6px; }
.lg-q-keys .lg-keys kbd { font-size: clamp(18px, 4vw, 24px); padding: 4px 12px; border-bottom-width: 3px; border-radius: 8px; }
.lg-q-keys .lg-plus { font-size: 18px; }
.lg-q-answers { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.lg-q-answers.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lg-q-ans { justify-content: space-between; text-align: left; white-space: normal; gap: 10px; }
.lg-q-ans[disabled] { opacity: 1; cursor: default; }
.lg-q-label { min-width: 0; overflow-wrap: anywhere; }
.lg-q-key { flex: none; }
.lg-q-explain { color: var(--muted); max-width: 62ch; }
.lg-q-explain:empty { display: none; }

/* ---------- first song walkthrough ---------- */
.lg-walk-progress { gap: 10px; }
.lg-walk-count { font: 700 20px/1.2 var(--font-display); }
.lg-walk-stage { display: flex; flex-direction: column; gap: 10px; }
.lg-walk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lg-walk-step {
  display: flex; flex-direction: column; gap: 6px; scroll-margin: 90px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px;
  transition: border-color .15s, background .15s;
}
.lg-walk-step.done { border-color: var(--good); background: color-mix(in srgb, var(--good-soft) 55%, var(--surface)); }
.lg-walk-check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.lg-walk-check input { width: 22px; height: 22px; flex: none; margin: 0; }
.lg-walk-check strong { font-size: 16.5px; }
.lg-walk-step.done .lg-walk-check strong { color: var(--good); }
.lg-walk-num { font: 600 13px var(--font-mono); color: var(--muted); min-width: 1.6em; }
.lg-walk-body { display: flex; flex-direction: column; gap: 8px; padding-left: 64px; min-width: 0; }
.lg-walk-body p { font-size: 15.5px; overflow-wrap: anywhere; }
.lg-walk-links { gap: 4px 14px; }
.lg-walk-links a { font-weight: 600; text-decoration: none; }
.lg-walk-links a:hover { text-decoration: underline; }
@media (max-width: 520px) { .lg-walk-body { padding-left: 0; } }

/* ---------- tips & about ---------- */
.lg-totd { display: flex; flex-direction: column; gap: 10px; background: var(--accent-soft); border-radius: var(--radius); padding: 18px; }
.lg-tip { display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.lg-tip p { color: var(--muted); font-size: 15px; }
.lg-tip .lg-tip-link { margin-top: auto; font-size: 14px; font-weight: 600; text-decoration: none; }
.lg-tip .lg-tip-link:hover { text-decoration: underline; }
.lg-tip-featured { border-color: var(--accent); }
.lg-tip-featured h2 { font-size: clamp(24px, 5vw, 32px); }
.lg-tip-featured p { color: var(--fg); font-size: 17px; max-width: 62ch; }
.lg-tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.lg-about h3 { margin-top: 4px; }
.lg-about p { max-width: 68ch; }
.lg-about-list { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
