:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --accent: #e63946;
    --accent-soft: rgba(230, 57, 70, 0.1);
    --blue: #457b9d;
    --blue-soft: rgba(69, 123, 157, 0.1);
    --teal: #2a9d8f;
    --teal-soft: rgba(42, 157, 143, 0.1);
    --orange: #f4a261;
    --orange-soft: rgba(244, 162, 97, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Station pages need bottom padding for the fixed mixer */
body.has-mixer {
    padding-bottom: 280px;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Main Content */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

/* Group Selection Grid */
.group-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 600px) {
    .group-grid {
        grid-template-columns: 1fr;
    }
}

.group-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.group-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-hover);
}

.group-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.group-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.group-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Section Cards */
.video-container,
.interactive-section,
.pattern-overview-section,
.pattern-selection,
.lyrics-container,
.intro-section,
.instructions-section,
.practice-strategy-section,
.song-scroll-container,
.keyboard-explanation-section,
.drum-machine-section,
.difficulty-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title,
h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Pattern Overview Cards */
.pattern-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.pattern-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border-left: 3px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pattern-card:hover {
    box-shadow: var(--shadow);
}

.pattern-card.active {
    border-left-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.pattern-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pattern-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* 16-Step Pattern Grid */
.pattern-16-container {
    background: #1a1a1a;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin: 1rem 0;
}

.pattern-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.row-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

.row-label {
    width: 60px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-align: right;
    padding-right: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.pattern-16-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
    flex: 1;
}

.step-16 {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    transition: background 0.15s;
}

.step-16.active-step { color: white; }

.beat-numbers {
    display: grid;
    grid-template-columns: 80px repeat(16, 1fr);
    gap: 2px;
    margin-top: 0.5rem;
}

.beat-numbers span {
    text-align: center;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* Chord Timeline */
.chord-timeline-container {
    background: #1a1a1a;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin: 1rem 0;
}

.chord-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chord-timeline-row {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.chord-timeline-row-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.chord-beat {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 1rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.chord-beat.active-beat {
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.beat-numbers-beats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.beat-numbers-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 0 8px;
}

.beat-numbers-row span {
    text-align: center;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* Mini Pattern */
.mini-pattern {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
    margin-top: 0.75rem;
}

.mini-pattern span {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    border-radius: 2px;
    background: var(--border);
}

.mini-instrument { color: white; }

/* Keyboard */
.keyboard-container {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin: 1rem 0;
    overflow-x: auto;
    padding: 1rem;
}

.white-key {
    width: 44px;
    height: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    transition: background 0.1s;
}

.white-key:hover { background: var(--border-light); }
.white-key.playing { background: var(--accent-soft); border-color: var(--accent); }

.black-key {
    width: 26px;
    height: 100px;
    background: #1a1a1a;
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    margin-left: -14px;
    margin-right: -14px;
    z-index: 10;
    transition: background 0.1s;
}

.black-key:hover { background: #333; }
.black-key.playing { background: var(--blue); }

/* Drum Pads */
.drum-pads {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 360px;
    margin: 1rem auto;
}

.drum-pad {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
    font-weight: 600;
    color: white;
    font-size: 1rem;
}

.drum-pad:active { transform: scale(0.96); }
.drum-pad small { font-size: 0.625rem; opacity: 0.8; margin-top: 0.25rem; }

/* Pattern Legend */
.pattern-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Chord Display */
.chords-display {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.chord-box {
    background: var(--text);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.chord-box:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Chord Legend */
.chord-legend {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.legend-chord {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    font-size: 0.8125rem;
}

/* Xylophon */
.xylophon-container {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 1rem 0;
    padding: 1rem;
}

.xylophon-bar {
    width: 36px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.1s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.xylophon-bar:active { transform: scale(1.05); }

/* Lyrics */
.lyrics {
    line-height: 1.8;
    font-size: 1rem;
}

.lyrics .highlight {
    background: var(--accent-soft);
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s;
}

.lyrics .highlight:hover {
    background: var(--accent);
    color: white;
}

.lyrics .verse { margin-bottom: 1.5rem; }

/* Song Sections */
.song-section {
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    transition: opacity 0.3s, transform 0.3s;
}

.song-section.active {
    transform: scale(1.01);
    box-shadow: var(--shadow-hover);
}

.song-section.dimmed {
    opacity: 0.3;
    transform: scale(0.99);
}

.verse-section {
    background: var(--teal-soft);
    border-left: 3px solid var(--teal);
}

.chorus-section {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
}

.interlude-section {
    background: #1a1a1a;
    border-left: 3px solid var(--orange);
}

.interlude-bar {
    position: relative;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.interlude-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--orange);
    transition: width 0.1s linear;
}

.interlude-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 100%;
    color: white;
}

.interlude-icon { font-size: 1.5rem; }
.interlude-label { font-size: 1rem; font-weight: 600; }

.interlude-countdown {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.interlude-countdown.warning {
    background: var(--accent);
    animation: pulse-warning 0.5s ease-in-out infinite;
}

.section-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.verse-text {
    line-height: 1.8;
    font-size: 1rem;
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Difficulty Cards */
.difficulty-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.difficulty-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.difficulty-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow);
}

.difficulty-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.difficulty-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    color: white;
}

.difficulty-header.level-1 { background: var(--teal); }
.difficulty-header.level-2 { background: var(--blue); }
.difficulty-header.level-3 { background: var(--orange); }
.difficulty-header.level-4 { background: var(--accent); }

.level-number { font-size: 1.5rem; font-weight: 700; }
.level-title { font-size: 1rem; font-weight: 600; }
.stars { font-size: 0.75rem; }

.difficulty-content {
    padding: 1.25rem;
}

.difficulty-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.difficulty-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Instruction Cards */
.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.instruction-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    border-left: 3px solid var(--blue);
}

.instruction-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.instruction-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.instruction-card p,
.instruction-card li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.instruction-card ul {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.instruction-card li {
    padding: 0.25rem 0;
}

.instruction-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Practice Strategy Box */
.practice-strategy-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.practice-strategy-box h2 {
    margin-bottom: 0.5rem;
}

.practice-strategy-box > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Practice Circles */
.practice-circles {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0;
}

.practice-circle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.practice-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    color: white;
    font-weight: 600;
    position: relative;
    transition: transform 0.3s;
}

.practice-circle:hover { transform: scale(1.05); }
.practice-circle.circle-1 { background: var(--teal); }
.practice-circle.circle-2 { background: var(--blue); }
.practice-circle.circle-3 { background: var(--orange); }

.circle-number {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.circle-text { font-size: 0.8125rem; line-height: 1.4; }

.circle-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin: 0;
}

.circle-arrow {
    font-size: 1.5rem;
    color: var(--border);
    align-self: center;
    margin-top: 2.5rem;
}

.written-instructions {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.written-instructions h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.written-instructions p,
.written-instructions li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.written-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
}

.written-instructions li {
    padding: 0.375rem 0 0.375rem 1.5rem;
    position: relative;
}

.written-instructions li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 600;
}

/* Mixer (Bottom Fixed) */
.mixer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-top: 2px solid #334155;
    padding: 0.75rem 1rem;
    z-index: 1000;
    transition: transform 0.3s ease, padding 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mixer.collapsed {
    transform: translateY(calc(100% - 28px));
    padding: 0.25rem 1rem;
}

.mixer-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    padding: 0.25rem;
    margin-bottom: 0.5rem;
}

.mixer.collapsed .mixer-header {
    margin-bottom: 0;
}

.mixer-toggle-icon {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.mixer.collapsed .mixer-toggle-icon {
    transform: rotate(180deg);
}

.mixer h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mixer-content {
    transition: opacity 0.2s ease;
}

.mixer.collapsed .mixer-content {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

/* Transport Controls */
.transport-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.btn-transport {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-play {
    background: var(--teal);
    color: white;
}

.btn-play:hover {
    transform: scale(1.08);
    opacity: 0.9;
}

.btn-pause {
    background: var(--accent);
    color: white;
}

.btn-pause:hover {
    transform: scale(1.08);
    opacity: 0.9;
}

/* Mixer Tempo Controls */
.mixer-tempo-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
}

.tempo-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tempo-buttons {
    display: flex;
    gap: 0.375rem;
}

.btn-tempo {
    padding: 0.375rem 0.75rem;
    border: 1px solid #475569;
    border-radius: 4px;
    background: #334155;
    color: #e2e8f0;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tempo:hover {
    border-color: #64748b;
    background: #475569;
}

.btn-tempo.active {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

/* Timeline */
.player-timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.time-display {
    font-size: 0.75rem;
    min-width: 40px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.timeline-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #475569;
    border-radius: 2px;
    outline: none;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

/* Verse/Interlude Buttons */
.verse-buttons {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.btn-section {
    width: 40px;
    height: 40px;
    border: 1px solid #475569;
    border-radius: 50%;
    background: #334155;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.btn-section:hover {
    border-color: #64748b;
    background: #475569;
}

.btn-section.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Mixer Channels */
.mixer-channels {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Mixer Tooltips/Hints */
.mixer-hint {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    margin-bottom: 0.375rem;
}

.mixer-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1e293b;
}

.mixer-channel:hover .mixer-hint,
.mixer-hint-container:hover .mixer-hint,
[data-tooltip]:hover .mixer-hint {
    opacity: 1;
}

/* Hint for section with hint text below */
.mixer-section-with-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.mixer-section-hint {
    font-size: 0.625rem;
    color: #64748b;
    text-align: center;
    line-height: 1.3;
}

/* Button-based tooltips */
.btn-section,
.btn-transport,
.btn-tempo,
.btn-mute,
.btn-solo {
    position: relative;
}

.btn-section::before,
.btn-transport::before,
.btn-tempo::before,
.btn-mute::before,
.btn-solo::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.btn-section:hover::before,
.btn-transport:hover::before,
.btn-tempo:hover::before,
.btn-mute:hover::before,
.btn-solo:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* Special tooltips for timeline */
.timeline-slider {
    position: relative;
}

.mixer-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    min-width: 70px;
}

.mixer-channel label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
}

.channel-controls {
    display: flex;
    gap: 0.25rem;
}

.btn-mute, .btn-solo {
    width: 32px;
    height: 24px;
    border: 1px solid #475569;
    border-radius: 4px;
    background: #334155;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.625rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

.btn-mute:hover, .btn-solo:hover {
    border-color: #64748b;
    background: #475569;
}

.btn-mute.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-solo.active {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

input[type="range"] {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    background: #475569;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #e2e8f0;
    border-radius: 50%;
    cursor: pointer;
}

/* Drum Machine */
.drum-machine {
    background: #1a1a1a;
    border-radius: var(--radius);
    padding: 1.5rem;
}

.machine-display {
    background: #222;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.machine-screen {
    background: #0a0a0a;
    border-radius: 4px;
    padding: 1rem;
    min-height: 160px;
}

.screen-pattern {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 0.375rem;
}

.screen-row {
    display: grid;
    grid-template-columns: 50px repeat(16, 1fr);
    gap: 2px;
    align-items: center;
}

.screen-row-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-align: right;
    padding-right: 0.375rem;
    color: rgba(255, 255, 255, 0.4);
}

.screen-step {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.screen-step.active {
    box-shadow: 0 0 8px currentColor;
}

.screen-step.inst-dim { opacity: 0.3; }

/* Playing state for visual beat progression */
.screen-step.playing {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    z-index: 1;
}

.machine-pads {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.machine-pad {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.machine-pad:active { transform: scale(0.95); }
.machine-pad img { width: 40px; height: 40px; object-fit: contain; filter: brightness(0) invert(1); }
.pad-icon { font-size: 0.6875rem; font-weight: 600; color: white; }


/* Practice Controls */
.practice-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 0.875rem;
    background: #545353;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.practice-controls.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.practice-controls.disabled .practice-btn,
.practice-controls.disabled input[type="range"] {
    cursor: not-allowed;
}

.pattern-selector,
.tempo-control {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.pattern-selector label,
.tempo-control label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
}

.pattern-selector select {
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    border: none;
    background: #333;
    color: white;
    font-size: 0.8125rem;
}

.tempo-control input[type="range"] {
    width: 200px;
    height: 10px;
    background: #333;
}

#tempo-display {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
    font-variant-numeric: tabular-nums;
}

.practice-buttons {
    display: flex;
    gap: 0.375rem;
}

.practice-btn {
    padding: 0.375rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.practice-btn:hover { opacity: 0.9; }

.start-btn {
    background: var(--teal);
    color: white;
}

.start-btn.active {
    background: var(--accent);
}

.stop-btn {
    background: #444;
    color: white;
}

.preview-btn {
    background: #2a9d8f;
    color: white;
}

.preview-btn.active {
    background: var(--accent);
}

/* Step Indicators */
.step-indicator {
    display: grid;
    grid-template-columns: 50px repeat(16, 1fr);
    gap: 2px;
    margin-top: 0.375rem;
}

.step-indicator-spacer {
    /* Empty spacer to align with screen-row labels */
    visibility: hidden;
}

.step-light {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.step-light.active {
    background: rgba(42, 157, 143, 0.6);
    box-shadow: 0 0 4px rgba(42, 157, 143, 0.4);
}

.step-indicator-small {
    display: grid;
    gap: 0;
    margin: 1rem auto;
    max-width: 480px;
}

.step-light-small {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.step-light-small.active {
    background: var(--accent);
}

/* Instrument Toggles */
.instrument-toggles {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.toggle-label input[type="checkbox"] { display: none; }

.toggle-switch {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    position: relative;
    background: #444;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(16px);
}


/* Keyboard Explanation */
.explanation-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .explanation-content {
        flex-direction: column;
    }
}

.explanation-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.mini-keyboard {
    position: relative;
    display: flex;
    background: #333;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.mini-white-key {
    width: 32px;
    height: 100px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
}

.mini-black-key-group-1,
.mini-black-key-group-2 {
    position: absolute;
    display: flex;
    top: 8px;
}

.mini-black-key-group-1 { left: 40px; }
.mini-black-key-group-2 { left: 120px; }

.mini-black-key {
    width: 16px;
    height: 60px;
    background: #333;
    border-radius: 0 0 3px 3px;
    margin-right: 12px;
}

.explanation-text { flex: 2; }
.explanation-text h3 { font-size: 0.9375rem; font-weight: 600; margin: 0.75rem 0 0.375rem; }
.explanation-text p { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.375rem; }

.explanation-text ul {
    list-style: none;
    padding: 0;
    margin-bottom: 0.75rem;
}

.explanation-text li {
    padding: 0.25rem 0;
    font-size: 0.8125rem;
}

.tip-box {
    background: var(--teal);
    color: white;
    padding: 0.875rem;
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Chord Keyboard */
.chord-keyboard-wrapper {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.chord-keyboard-wrapper .chord-label {
    text-align: center;
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.chord-keyboard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.chord-keyboard-wrapper[data-chord="F"] .chord-keyboard { border-color: var(--accent); }
.chord-keyboard-wrapper[data-chord="Gm"] .chord-keyboard { border-color: var(--blue); }
.chord-keyboard-wrapper[data-chord="Bb"] .chord-keyboard { border-color: var(--teal); }
.chord-keyboard-wrapper[data-chord="C"] .chord-keyboard { border-color: var(--orange); }

.chord-keyboard .white-key { width: 28px; height: 110px; cursor: default; }
.chord-keyboard .black-key { width: 18px; height: 70px; margin-left: -10px; margin-right: -10px; cursor: default; }

.chord-keyboard .chord-highlight,
.chord-keyboard .white-key.chord-highlight,
.chord-keyboard .black-key.chord-highlight {
    background: var(--accent) !important;
}

/* Practice Keyboard - Red Highlighted Keys */
.practice-keyboard .white-key.chord-highlight {
    background: var(--accent) !important;
    border-color: #c1121f !important;
    box-shadow: 0 0 12px var(--accent);
}

.practice-keyboard .black-key.chord-highlight {
    background: var(--accent) !important;
    box-shadow: 0 0 12px var(--accent);
}

/* Chord note highlighting in chord diagrams */
.chord-keyboard .white-key.chord-note {
    background: var(--accent) !important;
    border-color: #c1121f !important;
    box-shadow: 0 0 8px rgba(230, 57, 70, 0.4);
}

.chord-keyboard .black-key.chord-note {
    background: var(--accent) !important;
    box-shadow: 0 0 8px rgba(230, 57, 70, 0.4);
}

/* Practice Section */
.practice-section,
.keyboard-practice-section {
    background: var(--teal-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #000;
}

.practice-section h2,
.keyboard-practice-section h2 {
    color: #000;
    margin-bottom: 0.25rem;
}

.practice-section p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.current-chord-display {
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

#current-chord-name {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.375rem 1.5rem;
    border-radius: var(--radius-sm);
}

.practice-keyboard-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.practice-keyboard {
    max-width: 100%;
    margin: 0.75rem auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    overflow-x: auto;
}

/* Melody Notes */
.melody-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: center;
    margin: 0.75rem 0;
}

.note-box {
    background: var(--blue);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.note-box:hover { transform: scale(1.05); }
.note-box.active {
    transform: scale(1.05);
    background: var(--accent);
}

.melody-timeline {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
}

.melody-beat {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
}

/* Pattern Selector */
.pattern-selector-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.pattern-selector-wrapper label {
    font-weight: 500;
    color: var(--text-secondary);
}

.pattern-selector-wrapper select {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--surface);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.back-btn:hover {
    border-color: var(--text-muted);
}

/* Pitch Exercise */
.pitch-exercise {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 0.75rem 0;
}

.pitch-btn {
    padding: 1.5rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s;
}

.pitch-btn:hover { transform: scale(1.05); }
.pitch-btn.high { background: var(--orange); color: white; }
.pitch-btn.low { background: var(--blue); color: white; }

/* Instruments Grid */
.instruments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.instrument-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.instrument-card:hover { transform: translateY(-3px); }
.instrument-card img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 0.375rem; }
.instrument-card h3 { font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.125rem; }
.instrument-card p { font-size: 0.6875rem; color: var(--text-secondary); }

/* Instrument-Card Playing State */
.instrument-card.playing {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Video Container */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
}

/* Pattern Display */
.pattern-display {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin: 0.75rem 0;
}

.pattern-step {
    aspect-ratio: 1;
    background: var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
}

.pattern-step.active {
    background: var(--accent);
    color: white;
}

/* Audio Wake-Up Overlay */
.audio-wake-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

.audio-wake-content {
    text-align: center;
    color: white;
    animation: pulse 2s infinite;
}

.audio-wake-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.audio-wake-content p { font-size: 1.125rem; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Song Scroll Container */
.song-scroll-container {
    max-height: 60vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Responsive */
@media (max-width: 768px) {
    header { padding: 2rem 1.5rem; }
    header h1 { font-size: 1.5rem; }
    main { padding: 1.5rem; }

    .white-key { width: 28px; height: 110px; }
    .black-key { width: 18px; height: 70px; margin-left: -10px; margin-right: -10px; }

    .chord-keyboard .white-key { width: 22px; height: 90px; }
    .chord-keyboard .black-key { width: 14px; height: 56px; margin-left: -8px; margin-right: -8px; }

    .mixer-channel { min-width: 60px; }
    input[type="range"] { width: 60px; }

    .practice-circle { width: 130px; height: 130px; }
    .practice-circles { gap: 0.5rem; }
}

/* Xylophon Practice Grid */
.xylophon-practice-grid {
    background: #1a1a1a;
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.xylophon-grid {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 2px;
    margin-top: 0.5rem;
}

#xylophon-practice-display .step-16 {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    transition: background 0.15s, box-shadow 0.15s;
}

#xylophon-practice-display .step-16.active {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

#xylophon-practice-display .beat-numbers-beats {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 2px;
}

#xylophon-practice-display .beat-numbers-beats span {
    text-align: center;
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* Takt-Markierung für jedes Viertel (jeder 4. Step) */
#xylophon-practice-display .beat-numbers-beats span:nth-child(4n + 1),
#xylophon-practice-display .beat-numbers-beats span:nth-child(4n + 1)::after {
    color: rgba(255, 255, 255, 0.5);
}

/* Connected note blocks */
#xylophon-practice-display .step-16.note-start {
    border-radius: 2px 0 0 2px;
}

#xylophon-practice-display .step-16.note-continue {
    border-radius: 0;
}

#xylophon-practice-display .step-16.note-end {
    border-radius: 0 2px 2px 0;
}

#xylophon-practice-display .step-16.note-single {
    border-radius: 2px;
}

/* Pattern Showcase - "So übst du richtig" */
.pattern-showcase {
    margin-bottom: 1.5rem;
}

.pattern-showcase-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pattern-showcase-header .level-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid;
}

.pattern-showcase-header.level-1 .level-number { border-color: var(--accent); color: var(--accent); }
.pattern-showcase-header.level-2 .level-number { border-color: var(--blue); color: var(--blue); }
.pattern-showcase-header.level-3 .level-number { border-color: var(--teal); color: var(--teal); }

.pattern-showcase-header .level-title {
    font-weight: 600;
    font-size: 1rem;
}

.pattern-showcase-header .stars {
    margin-left: auto;
}

.pattern-showcase-content {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.pattern-showcase-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pattern-showcase-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Pattern Showcase Grids */
#pattern-showcase-1,
#pattern-showcase-2,
#pattern-showcase-3 {
    background: #1a1a1a;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

#pattern-showcase-1 .xylophon-grid,
#pattern-showcase-2 .xylophon-grid,
#pattern-showcase-3 .xylophon-grid {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 2px;
    margin-top: 0.5rem;
}

#pattern-showcase-1 .step-16,
#pattern-showcase-2 .step-16,
#pattern-showcase-3 .step-16 {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: 600;
    color: white;
}

#pattern-showcase-1 .beat-numbers-beats,
#pattern-showcase-2 .beat-numbers-beats,
#pattern-showcase-3 .beat-numbers-beats {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 2px;
}

#pattern-showcase-1 .beat-numbers-beats span,
#pattern-showcase-2 .beat-numbers-beats span,
#pattern-showcase-3 .beat-numbers-beats span {
    text-align: center;
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* Connected note blocks for showcase */
#pattern-showcase-1 .step-16.note-start,
#pattern-showcase-2 .step-16.note-start,
#pattern-showcase-3 .step-16.note-start {
    border-radius: 2px 0 0 2px;
}

#pattern-showcase-1 .step-16.note-continue,
#pattern-showcase-2 .step-16.note-continue,
#pattern-showcase-3 .step-16.note-continue {
    border-radius: 0;
}

#pattern-showcase-1 .step-16.note-end,
#pattern-showcase-2 .step-16.note-end,
#pattern-showcase-3 .step-16.note-end {
    border-radius: 0 2px 2px 0;
}

#pattern-showcase-1 .step-16.note-single,
#pattern-showcase-2 .step-16.note-single,
#pattern-showcase-3 .step-16.note-single {
    border-radius: 2px;
}

/* Drums Pattern Showcase Grids */
.drums-pattern-showcase-grid {
    background: #1a1a1a;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.drums-pattern-showcase-grid .drums-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
    margin-top: 0.5rem;
}

.drums-pattern-showcase-grid .step-16 {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: 600;
    color: white;
}

/* Drums pattern showcase — colors applied via inline styles */

/* ========== Stem Split Animation ========== */

.split-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    margin-top: 1rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    flex-wrap: wrap;
}

.split-anim-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.split-anim-arrows {
    color: var(--text-muted);
    animation: splitArrowPulse 2s ease-in-out infinite;
}

@keyframes splitArrowPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(3px); }
}

/* --- Input bar (the full mix) --- */

.split-bar-input {
    width: 200px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: all 0.6s ease;
}

.split-bar-active .split-bar-wave {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0.1) 100%);
    animation: wavePulse 1.5s ease-in-out infinite;
}

.split-bar-dissolving {
    opacity: 0.4;
    transform: scaleY(0.6);
    filter: blur(2px);
}

.split-bar-gone {
    opacity: 0;
    width: 0;
    margin: 0;
    padding: 0;
}

/* --- Output bars (individual stems) --- */

.split-bar-output {
    width: 0;
    height: 24px;
    background: var(--stem-color);
    border-radius: 3px;
    opacity: 0;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.split-bar-appearing {
    width: 160px;
    opacity: 0.85;
    animation: stemAppear 0.6s ease forwards;
}

.split-bar-done {
    width: 160px;
    opacity: 1;
}

.split-bar-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease 0.4s;
    white-space: nowrap;
}

.split-bar-done .split-bar-label {
    opacity: 1;
}

@keyframes stemAppear {
    0% { width: 0; opacity: 0; }
    60% { opacity: 0.9; }
    100% { width: 160px; opacity: 0.85; }
}

/* Stagger each stem bar */
.split-bar-output:nth-child(1) { animation-delay: 0s; }
.split-bar-output:nth-child(2) { animation-delay: 0.12s; }
.split-bar-output:nth-child(3) { animation-delay: 0.24s; }
.split-bar-output:nth-child(4) { animation-delay: 0.36s; }
.split-bar-output:nth-child(5) { animation-delay: 0.48s; }
.split-bar-output:nth-child(6) { animation-delay: 0.60s; }

/* --- Wave pattern inside bars --- */

.split-bar-wave {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
}

.split-bar-active .split-bar-wave,
.split-bar-appearing .split-bar-wave {
    animation: wavePulse 1.5s ease-in-out infinite;
}

@keyframes wavePulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Done phase: subtle glow --- */

.split-phase-done .split-bar-output {
    box-shadow: 0 0 8px var(--stem-color);
}

/* ========== ToDo-Liste Styles ========== */

.todo-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.todo-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: all 0.2s;
    position: relative;
}

.todo-item.completed {
    background: rgba(42, 157, 143, 0.08);
    border-color: var(--teal);
    opacity: 0.7;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-item.completed .todo-description,
.todo-item.completed .todo-meta,
.todo-item.completed .todo-criteria-box {
    opacity: 0.5;
}

.todo-item.current {
    border-color: var(--blue);
    background: rgba(69, 123, 157, 0.06);
    box-shadow: 0 0 0 1px var(--blue);
}

.todo-item.locked {
    opacity: 0.4;
    pointer-events: none;
}

.todo-checkbox {
    width: 22px;
    height: 22px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: var(--teal);
    flex-shrink: 0;
}

.todo-checkbox:disabled {
    cursor: not-allowed;
}

.todo-content {
    flex: 1;
    min-width: 0;
}

.todo-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text);
    line-height: 1.3;
}

.todo-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.todo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.todo-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.6;
}

.todo-meta-tag.strategy {
    background: var(--blue-soft, rgba(69,123,157,0.1));
    color: var(--blue);
}

.todo-meta-tag.level {
    background: var(--teal-soft, rgba(42,157,143,0.1));
    color: var(--teal);
}

.todo-meta-tag.assignee {
    background: var(--orange-soft, rgba(244,162,97,0.15));
    color: var(--orange);
}

.todo-meta-tag.observer {
    background: rgba(108,92,231,0.1);
    color: #6c5ce7;
}

.todo-criteria-box {
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.75rem;
    margin-top: 0.5rem;
    border-left: 3px solid var(--teal);
}

.todo-criteria-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.todo-criteria-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.todo-tempo-hint {
    font-size: 0.8rem;
    color: var(--blue);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--blue-soft, rgba(69,123,157,0.08));
    border-radius: var(--radius-sm);
}

.todo-help-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0.25rem;
    line-height: 1;
}

.todo-help-btn:hover {
    opacity: 1;
}

.btn-reset {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-reset:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* ========== Decision Modal ========== */

.todo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.todo-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.todo-modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-hover);
    max-height: 90vh;
    overflow-y: auto;
}

.todo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.todo-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.todo-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0.25rem;
    line-height: 1;
}

.todo-modal-close:hover {
    opacity: 1;
}

.todo-modal-body {
    margin: 1rem 0;
}

.todo-modal-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.todo-modal-criteria-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.todo-modal-criteria {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0 1rem 0;
}

.todo-modal-criteria-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.todo-modal-criteria-item:last-child {
    margin-bottom: 0;
}

.todo-modal-criteria-check {
    color: var(--teal);
    flex-shrink: 0;
}

.todo-modal-tempo-hint {
    background: var(--blue-soft);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--blue);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.todo-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.todo-modal-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 1rem;
}

.todo-modal-btn:hover {
    transform: translateY(-2px);
}

.todo-modal-btn.continue {
    background: var(--teal);
    color: white;
}

.todo-modal-btn.repeat {
    background: var(--orange);
    color: white;
}

.todo-modal-btn.cancel {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

/* Responsive für Mobile */
@media (max-width: 600px) {
    .todo-modal-content {
        padding: 1.5rem;
    }

    .todo-modal-actions {
        flex-direction: column;
    }

    .todo-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .todo-item {
        flex-direction: column;
    }

    .todo-checkbox {
        align-self: flex-start;
    }
}

/* ========== Keyboard Griffbilder Interaktiv ========== */

.btn-play-chord {
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.btn-play-chord:hover {
    background: var(--teal-soft);
    border-color: var(--teal);
    transform: translateY(-1px);
}

.btn-play-chord:active {
    transform: translateY(0);
    background: var(--teal);
    color: white;
}

/* Markierte Tasten klickbar machen */
.chord-keyboard .chord-note {
    cursor: pointer;
    position: relative;
}

/* Transform nur bei weißen Tasten, schwarze Tasten nicht verschieben */
.chord-keyboard .white-key.chord-note:hover {
    transform: scale(1.05);
}

.chord-keyboard .black-key.chord-note:hover {
    filter: brightness(1.1);
}

.chord-keyboard .white-key.chord-note:active {
    transform: scale(0.95);
}

.chord-keyboard .black-key.chord-note:active {
    filter: brightness(1.2);
}

/* ========== Bass Fretboard ========== */

#bass-fretboard {
    max-width: 700px;
    margin: 1rem auto;
}

.bass-fretboard-surface {
    position: relative;
    width: 100%;
    height: 180px;
    background: linear-gradient(to bottom,
        #8B4513 0%,
        #A0522D 10%,
        #CD853F 50%,
        #A0522D 90%,
        #8B4513 100%);
    border: 3px solid #3d2817;
    border-radius: 5px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.bass-nut {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(to right, #f5f5dc 0%, #fffacd 50%, #f5f5dc 100%);
    border-right: 2px solid #d4d4aa;
    z-index: 10;
}

.bass-fret {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to right, #c0c0c0 0%, #ffffff 50%, #c0c0c0 100%);
    box-shadow: 1px 0 3px rgba(0,0,0,0.3);
    z-index: 5;
}

.bass-string {
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 8;
    border-radius: 1px;
}

.bass-str-E {
    background: linear-gradient(to bottom, #808080 0%, #606060 50%, #404040 100%);
}

.bass-str-A {
    background: linear-gradient(to bottom, #909090 0%, #707070 50%, #505050 100%);
}

.bass-str-D {
    background: linear-gradient(to bottom, #b0b0b0 0%, #909090 50%, #707070 100%);
}

.bass-str-G {
    background: linear-gradient(to bottom, #d0d0d0 0%, #b0b0b0 50%, #909090 100%);
}

.bass-inlay {
    position: absolute;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #ffffff 0%, #e0e0e0 100%);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.5);
    z-index: 3;
}

.bass-inlay-wrap {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 20px;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.bass-inlay-wrap .bass-inlay {
    position: relative;
    transform: none;
}

.bass-dot {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e63946;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 15;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(230, 57, 70, 0.4);
    user-select: none;
}

.bass-dot.active-beat {
    transform: translate(-50%, -50%) scale(1.35);
    box-shadow: 0 0 18px rgba(230, 57, 70, 0.85);
}

.bass-dot.preview-beat {
    opacity: 0.5;
}

.bass-dot.hidden-dot {
    opacity: 0;
    pointer-events: none;
}

.bass-hitzone {
    position: absolute;
    z-index: 20;
    cursor: pointer;
    border-radius: 2px;
}

.bass-hitzone:hover {
    background: rgba(230, 57, 70, 0.15);
}

.bass-fret-nums {
    position: absolute;
    bottom: -24px;
    left: 0;
    width: 100%;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 500;
}

.bass-fret-nums span {
    position: absolute;
    transform: translateX(-50%);
}

.bass-str-labels {
    display: flex;
    justify-content: space-between;
    padding: 10px 0 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 700;
}

.bass-pattern-section {
    max-width: 700px;
    margin: 1rem auto;
}

.bass-practice-section {
    max-width: 600px;
    margin: 1rem auto;
}

/* Visual feedback beim Abspielen */
.chord-keyboard .chord-note.playing {
    filter: brightness(1.3);
    transform: scale(1.1);
}
