/**
 * Emperor Keys Studio - Modern Studio Styling
 * Zero Cumulative Layout Shift (Static Rigid Layout)
 * Features Fallboard Note Banner and Scale-Aware Enharmonics
 * Learn with Liberty
 */

:root {
    --bg-primary: #0a0d14;
    --bg-secondary: #131926;
    --bg-surface: #1a2234;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Key Colors */
    --white-key-bg: linear-gradient(to bottom, #ffffff 0%, #f1f5f9 85%, #e2e8f0 100%);
    --white-key-border: #cbd5e1;
    --black-key-bg: linear-gradient(to bottom, #2b3240 0%, #151922 75%, #0d1017 100%);
    --black-key-border: #0a0c10;

    /* Press & Sustain Highlights */
    --press-bass-color: #ea1c24;
    --press-bass-glow: rgba(234, 28, 36, 0.8);
    --press-treble-color: #f59e0b;
    --press-treble-glow: rgba(245, 158, 11, 0.8);
    --sustain-color: #10b981;
    --sustain-glow: rgba(16, 185, 129, 0.6);

    /* Pedals & Metals */
    --pedal-brass: linear-gradient(135deg, #fcd34d 0%, #d97706 60%, #b45309 100%);
    --pedal-brass-active: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #d97706 100%);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- THEMES --- */

/* 1. Emperor Keys Theme (Default) */
body.theme-emperor {
    --bg-primary: #0c0507;
    --bg-secondary: #170b0e;
    --bg-surface: #241116;
    --border-color: rgba(234, 28, 36, 0.2);
    --border-highlight: rgba(234, 28, 36, 0.55);
    --press-bass-color: #ea1c24;
    --press-bass-glow: rgba(234, 28, 36, 0.85);
    --press-treble-color: #f59e0b;
    --press-treble-glow: rgba(245, 158, 11, 0.85);
    --sustain-color: #10b981;
    --sustain-glow: rgba(16, 185, 129, 0.65);
}

/* 2. Studio Dark Theme */
body.theme-studio {
    --bg-primary: #0a0d14;
    --bg-secondary: #131926;
    --bg-surface: #1a2234;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.3);
    --press-bass-color: #06b6d4;
    --press-bass-glow: rgba(6, 182, 212, 0.8);
    --press-treble-color: #8b5cf6;
    --press-treble-glow: rgba(139, 92, 246, 0.8);
    --sustain-color: #10b981;
    --sustain-glow: rgba(16, 185, 129, 0.6);
}

/* 3. Gospel Gold Theme */
body.theme-gospel {
    --bg-primary: #0f0a05;
    --bg-secondary: #1c140a;
    --bg-surface: #2b1f10;
    --border-color: rgba(245, 158, 11, 0.2);
    --border-highlight: rgba(245, 158, 11, 0.5);
    --press-bass-color: #f59e0b;
    --press-bass-glow: rgba(245, 158, 11, 0.85);
    --press-treble-color: #fbbf24;
    --press-treble-glow: rgba(251, 191, 36, 0.85);
    --sustain-color: #f97316;
    --sustain-glow: rgba(249, 115, 22, 0.65);
}

/* 4. Classroom Light Theme */
body.theme-classroom {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-surface: #e2e8f0;
    --border-color: rgba(0, 0, 0, 0.12);
    --border-highlight: rgba(37, 99, 235, 0.4);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --white-key-bg: linear-gradient(to bottom, #ffffff 0%, #f8fafc 85%, #e2e8f0 100%);
    --white-key-border: #94a3b8;
    --press-bass-color: #ea1c24;
    --press-bass-glow: rgba(234, 28, 36, 0.6);
    --press-treble-color: #2563eb;
    --press-treble-glow: rgba(37, 99, 235, 0.6);
    --sustain-color: #059669;
    --sustain-glow: rgba(5, 150, 105, 0.5);
}

/* 5. Midnight OLED Theme */
body.theme-oled {
    --bg-primary: #000000;
    --bg-secondary: #080808;
    --bg-surface: #121212;
    --border-color: #222222;
    --press-bass-glow: rgba(234, 28, 36, 0.9);
    --press-treble-glow: rgba(245, 158, 11, 0.9);
}

/* 6. Green Screen Chroma Key (OBS / Stream Overlay Mode) */
body.theme-chroma {
    --bg-primary: #00ff00 !important;
    --bg-secondary: rgba(19, 25, 38, 0.95);
    background: #00ff00 !important;
}

/* --- Base Layout --- */

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

html, body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    user-select: none;
    -webkit-user-select: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 10px 18px 20px;
    gap: 12px;
}

.is-hidden {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* --- Top Header with Emperor Keys Branding --- */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 12px;
    gap: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    height: 58px;
    min-height: 58px;
    max-height: 58px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(234, 28, 36, 0.3);
}

.brand-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #ffffff;
    line-height: 1.1;
}

.brand-tagline {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.controls-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

select.ui-select {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    height: 32px;
    box-sizing: border-box;
}

select.ui-select:focus {
    border-color: var(--border-highlight);
    box-shadow: 0 0 0 2px rgba(234, 28, 36, 0.2);
}

.ui-btn {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    box-sizing: border-box;
    white-space: nowrap;
}

.ui-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.ui-btn.primary {
    background: linear-gradient(135deg, #ea1c24 0%, #b91c1c 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(234, 28, 36, 0.35);
}

.ui-btn.primary:hover {
    filter: brightness(1.15);
}

.ui-btn.muted {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.status-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0 8px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.status-tag.connected {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-tag.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.volume-slider {
    width: 60px;
    accent-color: #ea1c24;
    cursor: pointer;
}

/* --- Hero Chord Display Section (STATIC LOCKED HEIGHT) --- */

.chord-hero-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    height: 108px;
    min-height: 108px;
    max-height: 108px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chord-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--press-bass-color), var(--press-treble-color), #ec4899);
}

.chord-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    overflow: hidden;
    box-sizing: border-box;
}

.chord-name-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
}

.chord-name {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
    min-width: 140px;
}

.chord-name.idle {
    color: var(--text-muted);
    font-size: 2.4rem;
    text-shadow: none;
}

.tag-badge {
    font-size: 0.78rem;
    font-weight: 800;
    height: 26px;
    line-height: 24px;
    padding: 0 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    white-space: nowrap;
    transition: opacity 0.1s ease;
}

.quality-badge {
    background: rgba(234, 28, 36, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(234, 28, 36, 0.45);
}

.inversion-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.formula-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #38bdf8;
    font-weight: 700;
    height: 24px;
    line-height: 24px;
    white-space: nowrap;
}

.chord-details-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    box-sizing: border-box;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.notes-chips-container {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
}

.notes-chips-container::-webkit-scrollbar {
    display: none;
}

.chip-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.note-pill {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 8px;
    height: 22px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.78rem;
    font-family: var(--font-mono);
}

.empty-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 24px;
}

.keyboard-legend {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- History Progression Tape (STATIC LOCKED HEIGHT) --- */

.history-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.history-label-group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.history-title {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-mini {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.68rem;
    text-decoration: underline;
}

.btn-mini:hover {
    color: var(--text-primary);
}

.history-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    flex: 1;
    height: 28px;
    white-space: nowrap;
}

.history-strip::-webkit-scrollbar {
    display: none;
}

.history-placeholder {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 28px;
}

.history-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0 8px;
    height: 26px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    box-sizing: border-box;
}

.history-item:hover {
    border-color: var(--border-highlight);
    background: rgba(234, 28, 36, 0.15);
}

.history-chord {
    font-weight: 800;
    font-size: 0.8rem;
    color: #ffffff;
}

.history-quality {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --- Upper Mid Section: Grand Staff & Controllers Split (STATIC LOCKED HEIGHT) --- */

.middle-deck {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 12px;
    height: 185px;
    min-height: 185px;
    max-height: 185px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.staff-deck {
    height: 100%;
}

.staff-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 185px;
    max-height: 185px;
    box-sizing: border-box;
    overflow: hidden;
}

#grand-staff-svg {
    width: 100%;
    height: 100%;
    max-height: 165px;
}

.staff-bg {
    fill: rgba(0, 0, 0, 0.2);
}

.staff-brace {
    stroke: var(--text-secondary);
    stroke-width: 2;
}

.staff-lines line {
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 1.5;
}

body.theme-classroom .staff-lines line {
    stroke: rgba(0, 0, 0, 0.25);
}

.clef-symbol {
    font-size: 52px;
    fill: var(--text-primary);
    opacity: 0.85;
    font-family: serif;
}

.middle-c-guide {
    stroke: rgba(245, 158, 11, 0.25);
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

.staff-label {
    fill: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
}

.ledger-line {
    stroke: var(--text-primary);
    stroke-width: 2;
}

.accidental-text {
    fill: #38bdf8;
    font-size: 19px;
    font-weight: bold;
}

.note-head {
    transition: all 0.08s ease-out;
}

/* --- Controllers: Sustain Pedal & Wheels (STATIC LOCKED HEIGHT) --- */

.controllers-deck {
    height: 100%;
}

.controllers-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 185px;
    max-height: 185px;
    box-sizing: border-box;
}

.controller-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.pedal-card {
    cursor: pointer;
    height: 105px;
    min-height: 105px;
    max-height: 105px;
    flex: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 20px;
}

.card-title {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.pedal-status-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0 6px;
    height: 18px;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    box-sizing: border-box;
    transition: all 0.12s;
}

.pedal-status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    border: 1px solid rgba(16, 185, 129, 0.6);
}

.pedal-stage {
    perspective: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
}

.piano-pedal-box {
    width: 84px;
    height: 44px;
    background: #090c12;
    border-radius: 6px;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #1a2234;
}

.pedal-lever {
    width: 30px;
    height: 38px;
    background: var(--pedal-brass);
    border-radius: 4px 4px 10px 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    transform-origin: top center;
    transition: transform 0.06s ease-out, filter 0.06s;
}

.pedal-card.pedal-down .pedal-lever {
    transform: rotateX(24deg) translateY(3px);
    background: var(--pedal-brass-active);
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.pedal-footer {
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.pedal-meter-bar {
    height: 3px;
    background: var(--bg-surface);
    border-radius: 2px;
    overflow: hidden;
}

.pedal-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.06s ease-out;
}

.pedal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.pedal-value {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.shortcut-tag kbd {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0 4px;
    border-radius: 3px;
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.wheel-card {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    flex: none;
}

.wheel-stage {
    display: flex;
    align-items: center;
    height: 16px;
}

.wheel-groove {
    width: 100%;
    height: 12px;
    background: #090c12;
    border-radius: 6px;
    position: relative;
    border: 1px solid #1e293b;
    overflow: hidden;
}

.wheel-center-notch {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
}

.wheel-traveler {
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 18px;
    margin-left: -9px;
    left: 50%;
    background: linear-gradient(to bottom, #94a3b8, #475569);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: left 0.05s ease-out;
}

.wheel-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    height: 14px;
}

.wheel-val {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: #60a5fa;
    font-weight: 600;
}

/* --- Piano Keyboard Section (WITH TOP FALLBOARD BANNER STRIP) --- */

.keyboard-deck {
    background: #090c14;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 10px 12px 10px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
    position: relative;
    border-top: 4px solid #1e293b;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 1. Top Fallboard Note Banner (Two-Row Dedicated Display) */
.keyboard-note-banner {
    position: relative;
    width: 100%;
    height: 54px;
    min-height: 54px;
    max-height: 54px;
    background: linear-gradient(to bottom, #141b29 0%, #0d121c 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Divider between Row 1 (Black Keys) and Row 2 (White Keys) */
.keyboard-note-banner::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 27px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.banner-indicator {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    white-space: nowrap;
    transition: all 0.08s ease;
    pointer-events: none;
}

/* ROW 1: Black Keys (Accidentals / Sharps & Flats) */
.banner-indicator.is-black {
    top: 3px;
    height: 21px;
    z-index: 2;
}

.banner-indicator.is-black .banner-label {
    background: #090c12;
    color: #e2e8f0;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* ROW 2: White Keys (Naturals) */
.banner-indicator.is-white {
    top: 30px;
    height: 21px;
    z-index: 1;
}

.banner-indicator.is-white .banner-label {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Banner Active States */
.banner-indicator.is-active.bass-zone .banner-label {
    background: var(--press-bass-color) !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px var(--press-bass-glow);
    font-weight: 900;
    border-color: transparent !important;
}

.banner-indicator.is-active.treble-zone .banner-label,
.banner-indicator.is-active .banner-label {
    background: var(--press-treble-color) !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px var(--press-treble-glow);
    font-weight: 900;
    border-color: transparent !important;
}

.banner-indicator.is-sustained .banner-label {
    background: var(--sustain-color) !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px var(--sustain-glow);
    font-weight: 900;
    border-color: transparent !important;
}

/* 2. Physical Piano Keyboard (CLEAN: No text inside keys) */
.piano-keyboard-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    overflow: hidden;
    user-select: none;
    box-sizing: border-box;
}

.white-keys-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 1;
}

.black-keys-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* White Key (Clean Acoustic Ivory) */
.piano-key.white-key {
    height: 100%;
    background: var(--white-key-bg);
    border: 1px solid var(--white-key-border);
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.06s, box-shadow 0.06s;
}

.piano-key.white-key.middle-c::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

/* Black Key (Clean Acoustic Ebony) */
.piano-key.black-key {
    position: absolute;
    top: 0;
    height: 62%;
    background: var(--black-key-bg);
    border: 1px solid var(--black-key-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.1), 2px 4px 6px rgba(0, 0, 0, 0.7);
    pointer-events: auto;
    cursor: pointer;
    z-index: 3;
    box-sizing: border-box;
    transition: background 0.06s, box-shadow 0.06s;
}

/* KEY STATES: Pressed vs Sustained */

/* 1. Physically Pressed (Bass / Left Hand) */
.piano-key.is-pressed.bass-zone {
    background: var(--press-bass-color) !important;
    box-shadow: 0 0 20px var(--press-bass-glow), inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* 2. Physically Pressed (Treble / Right Hand) */
.piano-key.is-pressed.treble-zone,
.piano-key.is-pressed {
    background: var(--press-treble-color) !important;
    box-shadow: 0 0 20px var(--press-treble-glow), inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* 3. Sustained by Pedal */
.piano-key.white-key.is-sustained {
    background: linear-gradient(to bottom, #ecfdf5 0%, #a7f3d0 100%) !important;
    border-color: var(--sustain-color) !important;
    box-shadow: 0 0 16px var(--sustain-glow), inset 0 -3px 0 var(--sustain-color) !important;
}

.piano-key.black-key.is-sustained {
    background: linear-gradient(to bottom, #064e3b 0%, #047857 100%) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 16px var(--sustain-glow) !important;
}
