/* fingerpicking.css — /fingerpicking page. Builds on songs.css (theme vars, header, bottom nav). */

.fp-main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: var(--header-h);
    padding-bottom: var(--nav-h);
}
.fp-view { max-width: 860px; margin: 0 auto; padding: 18px 16px 24px; }
/* Practice view uses the full width on a laptop/desktop so the tab shows a whole loop; text and
   video stay at a comfortable size. */
#fp-practice { max-width: 1600px; padding-left: 24px; padding-right: 24px; }
#fp-practice .fp-tip { max-width: 900px; }
#fp-practice .fp-video { max-width: 760px; }
.hidden { display: none !important; }
.fp-home-link { display: flex; }

/* ── Library ─────────────────────────────────────────── */
.fp-hero h1 { font-size: 28px; letter-spacing: -0.02em; margin: 4px 0 6px; }
.fp-hero p { color: var(--text-muted); margin: 0 0 8px; font-size: 15px; }
.fp-section { margin-top: 22px; }
.fp-sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fp-sec-head h2 { font-size: 18px; margin: 0; }
.fp-sec-head span { color: var(--text-muted); font-size: 13px; }

.fp-today { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fp-today-card {
    display: flex; flex-direction: column; gap: 4px; padding: 14px;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    color: var(--text); text-decoration: none; border-top: 3px solid var(--accent);
}
.fp-today-card b { font-size: 16px; }
.fp-why { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.fp-today-meta { font-size: 12.5px; color: var(--text-muted); }
.fp-start { margin-top: 12px; }

.fp-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fp-chip {
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.fp-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.fp-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fp-row {
    display: grid; grid-template-columns: 34px 1fr auto 52px; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-sm);
    color: var(--text); text-decoration: none;
}
.fp-row:hover { box-shadow: var(--shadow-md); }
.fp-num {
    width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
    background: var(--accent-dim); color: var(--accent); font-weight: 700; font-size: 13px;
}
.fp-row-main { display: flex; flex-direction: column; min-width: 0; }
.fp-row-main b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-row-meta { font-size: 12px; color: var(--text-muted); }
.fp-row-bpm { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fp-row-bpm small { font-weight: 500; color: var(--text-muted); font-size: 10px; margin-left: 2px; }
.fp-diff { letter-spacing: -1px; color: var(--accent); font-size: 10px; }
.fp-diff span { color: var(--border); }
.fp-status { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st-new      { background: var(--bg); color: var(--text-muted); }
.st-learning { background: rgba(0, 85, 200, .1); color: var(--blue); }
.st-solid    { background: rgba(30, 138, 64, .12); color: var(--green); }
.st-too_hard { background: rgba(196, 43, 43, .1); color: var(--red); }
.fp-empty { color: var(--text-muted); padding: 12px; }
.fp-credit { color: var(--text-muted); font-size: 12px; margin-top: 18px; line-height: 1.5; }
.fp-credit a { color: inherit; }

/* ── Practice ────────────────────────────────────────── */
.fp-top { display: flex; justify-content: space-between; align-items: center; }
.fp-back { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.fp-step a {
    display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 6px; border-radius: 8px;
    background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; font-size: 18px;
}
.fp-title { font-size: 26px; letter-spacing: -0.02em; margin: 10px 0 2px; }
.fp-title span { color: var(--accent); }
.fp-sub { color: var(--text-muted); font-size: 13.5px; }
.fp-tip { margin: 10px 0 14px; line-height: 1.5; font-size: 15px; }
.fp-links { font-size: 13px; color: var(--text-muted); margin: -4px 0 14px; }
.fp-links a { color: var(--accent); }

.fp-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; margin-top: 12px; flex-wrap: wrap; }
.fp-seg button { border: 0; background: none; color: var(--text-muted); padding: 6px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.fp-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.fp-seg-sm { margin: 0; }
.fp-seg-sm button { padding: 4px 9px; font-size: 12.5px; }

.fp-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; margin-bottom: 14px; }
.fp-video { padding: 0; overflow: hidden; }
.fp-yt-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; }
.fp-yt-wrap iframe, .fp-yt-wrap > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fp-video-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.fp-clip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fp-clip b { color: var(--text); font-weight: 600; }
.fp-clip button[data-k] { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; }

.fp-prog-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fp-prog-row label { font-weight: 600; font-size: 14px; }
.fp-prog-row select, .fp-custom select, .fp-toggles select {
    flex: 1; min-width: 0; font-size: 14px; padding: 7px 8px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.fp-custom { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }

/* The tab: one column per 16th step */
.fp-tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px 4px; scroll-behavior: smooth; }
.fp-tab { display: flex; font: 13px/18px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 0; }
.fp-col { display: flex; flex-direction: column; flex: 1 0 21px; max-width: 44px; position: relative; }
.fp-col > div { height: 18px; text-align: center; position: relative; }
.fp-chord { font: 700 13px/18px system-ui, sans-serif; text-align: left !important; white-space: nowrap; overflow: visible; }
.fp-chord i { font: italic 600 12px Georgia, serif; color: var(--text-muted); display: block; text-align: center; }
.fp-str::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; border-top: 1px solid var(--border); }
.fp-str span { position: relative; background: var(--surface); padding: 0 2px; font-weight: 600; }
.fp-col.bar .fp-str::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid var(--text-muted); }
.fp-col.beat .fp-str::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px dashed var(--border); }
/* Rhythm notation: stems down from the tab, beams joining the notes of each beat */
.fp-col > .fp-rhy { height: 22px; }
.fp-rhy span { position: absolute; background: var(--text); }
.fp-rhy .st { left: 50%; top: 2px; bottom: 0; width: 1.5px; }
.fp-rhy .b { height: 3px; }
.fp-rhy .b1 { bottom: 0; }
.fp-rhy .b2 { bottom: 5px; }
.fp-rhy .r { left: 50%; right: 0; }
.fp-rhy .l { left: 0; right: calc(50% - 1.5px); }
.fp-rhy .lr { left: 0; right: 0; }
.fp-rhy .fl { left: 50%; bottom: 1px; width: 11px; height: 2px; transform-origin: left center; transform: rotate(-55deg); }
.fp-rhy .fl.f2 { bottom: 6px; }
.fp-rhy .dt { left: calc(50% + 5px); bottom: 9px; width: 3px; height: 3px; border-radius: 50%; }
.fp-cnt { margin-top: 6px; font: 600 12px/18px system-ui, sans-serif; color: var(--border); }
.fp-cnt.b { font-size: 13.5px; }
.fp-dir { font: 12px/16px system-ui, sans-serif; color: var(--border); }
.fp-col.hit .fp-cnt { color: var(--text); }
.fp-col.hit .fp-dir { color: var(--accent); font-weight: 700; }
.fp-col.now { background: var(--accent-dim); border-radius: 4px; }
.fp-col.now .fp-str span { background: transparent; }
.fp-legend { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.fp-legend b { color: var(--accent); }
.fp-strong { color: var(--text); font-weight: 600; }

/* Speed ladder */
.fp-ladder-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.fp-ladder-head h3 { margin: 0; font-size: 16px; }
.fp-ladder-head span { font-size: 13px; color: var(--text-muted); }
.fp-ladder-head b { color: var(--text); }
.fp-meter { height: 6px; background: var(--bg); border-radius: 3px; margin: 10px 0; overflow: hidden; }
.fp-meter span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.fp-ladder-help { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; }
.fp-ladder-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fp-pips { display: flex; gap: 6px; margin-right: auto; }
.fp-pips span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); }
.fp-pips span.on { background: var(--green); border-color: var(--green); }
.fp-ladder-tip { margin-top: 10px; font-size: 13.5px; background: var(--accent-bg); padding: 8px 10px; border-radius: 8px; }

.fp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
}
.fp-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.fp-btn-ok { background: var(--green); border-color: var(--green); color: #fff; }
.fp-next { width: 100%; margin-bottom: 14px; }
.fp-link { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }

/* Transport: sticks to the bottom of the scroll area, above the nav */
.fp-transport {
    position: sticky; bottom: 8px; z-index: 5;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); padding: 10px 12px; margin-top: 6px;
}
.fp-play {
    width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--accent); color: #fff; font-size: 22px; flex: none;
}
.fp-play.on { background: var(--text); color: var(--surface); }
.fp-bpm { display: flex; align-items: center; gap: 6px; }
.fp-bpm button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 20px; cursor: pointer; }
.fp-bpm-val { display: flex; flex-direction: column; align-items: center; min-width: 46px; }
.fp-bpm-val b { font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1; }
.fp-bpm-val span { font-size: 10px; color: var(--text-muted); letter-spacing: .08em; }
.fp-toggles { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; margin-left: auto; }
.fp-toggles label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.fp-toggles select { flex: none; padding: 5px 6px; }

.fp-toast {
    position: fixed; left: 50%; bottom: calc(var(--nav-h) + 90px); transform: translate(-50%, 20px);
    background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: 90vw; text-align: center;
}
.fp-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
    .fp-row { grid-template-columns: 30px 1fr auto; }
    .fp-row-bpm { display: none; }
    .fp-toggles { margin-left: 0; width: 100%; justify-content: space-between; }
    .fp-title { font-size: 22px; }
    #fp-practice { padding-left: 16px; padding-right: 16px; }
}
