/* ── Fingerpicking Studio & Interactive Learning Module ── */

.finger-studio-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.finger-studio-wrap > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Mode Selection Header Tabs ── */
.fp-mode-bar {
    display: flex;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 4px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    box-sizing: border-box;
}

.fp-mode-bar::-webkit-scrollbar {
    display: none;
}

.fp-mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--r-full);
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
}

.fp-mode-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.fp-mode-tab.active {
    color: #ffffff;
    background: var(--accent-fill);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* ── Interactive Plucking Stage Card ── */
.plucking-stage-card {
    position: relative;
    background: radial-gradient(ellipse at 50% 15%, #1e2538 0%, #0b0f19 80%);
    border: 1px solid var(--border);
    border-radius: var(--r-lg, 20px);
    padding: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.stage-pattern-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-level-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.level-beginner { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.level-intermediate { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.level-advanced { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* ── Active Prompt & Feedback HUD ── */
.plucking-prompt-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-md, 14px);
    padding: 12px 18px;
    margin-bottom: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.prompt-cue-text {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-cue-finger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
}

.prompt-feedback-badge {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.prompt-feedback-badge.perfect { color: #34d399; }
.prompt-feedback-badge.good { color: #60a5fa; }
.prompt-feedback-badge.early { color: #fbbf24; }
.prompt-feedback-badge.late { color: #f87171; }

/* ── Interactive Virtual Stringboard ── */
.virtual-stringboard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-md, 14px);
    padding: 18px 14px;
    touch-action: pan-y;
}

.string-lane {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px; /* Touch target >= 48px for capacitive screen accessibility */
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 10px;
    transition: background 0.12s ease;
    user-select: none;
    -webkit-user-select: none;
}

.string-lane:hover,
.string-lane:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.string-lane.target-lane {
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.25) inset;
}

.string-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 60px;
}

.string-badge-num {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 700;
}

.string-badge-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.string-wire-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    height: 24px;
}

.string-wire {
    width: 100%;
    border-radius: 2px;
    transition: transform 0.08s ease, box-shadow 0.15s ease;
    background: #cbd5e1;
}

.string-lane.bass .string-wire {
    background: linear-gradient(90deg, #ca8a04 0%, #eab308 50%, #ca8a04 100%);
}

.string-lane.treble .string-wire {
    background: linear-gradient(90deg, #94a3b8 0%, #f1f5f9 50%, #94a3b8 100%);
}

.string-lane.vibrating .string-wire {
    animation: stringVibe 0.18s ease-in-out infinite alternate;
    box-shadow: 0 0 12px #60a5fa;
}

@keyframes stringVibe {
    0% { transform: translateY(-2px); }
    100% { transform: translateY(2px); }
}

.string-target-cue {
    position: absolute;
    right: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 99px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.15s ease;
}

.string-lane.target-lane .string-target-cue {
    opacity: 1;
    transform: scale(1);
}

/* ── PIMA Right Hand Guide ── */
.pima-hand-guide {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pima-tab-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md, 14px);
    padding: 8px 16px;
    min-width: 68px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pima-tab-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.pima-tab-btn.active-target {
    border-color: var(--accent-fill);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
}

.pima-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 800;
}

.pima-name {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ── Playback & Pattern Rhythm Ribbon ── */
.rhythm-ribbon-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md, 14px);
    padding: 16px 20px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.rhythm-ribbon-slots {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(44px, 1fr);
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
    max-width: 100%;
    box-sizing: border-box;
}

.rhythm-ribbon-slots::-webkit-scrollbar {
    display: none;
}

.ribbon-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 4px;
    min-height: 60px;
    transition: all 0.12s ease;
}

.ribbon-slot.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-fill);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ribbon-slot-finger {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
}

.ribbon-slot-string {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ── Studio Controls Bar ── */
.studio-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md, 14px);
    padding: 14px 20px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
}

.tempo-pacer-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
}

.tempo-pacer-group input[type="range"] {
    max-width: 100px;
    width: 100%;
}

.bpm-display {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 58px;
}

/* ── Pattern Selection Grid ── */
.pattern-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.fp-pattern-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md, 14px);
    padding: 18px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fp-pattern-card:hover {
    border-color: var(--accent-fill);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.fp-pattern-card.selected {
    border-color: var(--accent-fill);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 2px var(--accent-fill);
}

/* ── Performance Stats & Streak Card ── */
.fp-stats-card {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md, 14px);
    padding: 16px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.stat-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

/* ── Mobile Breakpoints ── */
@media (max-width: 640px) {
    .plucking-stage-card {
        padding: 14px 12px;
    }
    .stage-pattern-title {
        font-size: 1.25rem;
        flex-wrap: wrap;
    }
    .virtual-stringboard {
        padding: 14px 8px;
    }
    .string-lane {
        padding: 4px 6px;
        gap: 8px;
    }
    .pima-hand-guide {
        gap: 6px;
    }
    .pima-tab-btn {
        padding: 6px 8px;
        min-width: 44px;
    }
    .studio-controls-bar {
        padding: 12px 14px;
        gap: 12px;
    }
    .controls-left, .controls-right {
        width: 100%;
        justify-content: space-between;
    }
    .tempo-pacer-group input[type="range"] {
        max-width: 70px;
    }
    .rhythm-ribbon-card {
        padding: 12px 14px;
    }
    .fp-stats-card {
        flex-direction: row;
        gap: 8px;
        padding: 12px 8px;
    }
    .stat-val {
        font-size: 1.3rem;
    }
}
