#jo-midi-wrapper {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 20px auto;
    color: #eee;
    --active-color: #4caf50; 
}

.jo-toolbar {
    margin-bottom: 0; 
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    border: 1px solid #333;
    border-bottom: none;
}

.jo-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}
.jo-row:last-child { margin-bottom: 0; }

.jo-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jo-group.hidden { display: none; }

.jo-group label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jo-select, .jo-select-small {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #333;
    color: #fff;
    font-size: 0.9rem;
}
.jo-select-small { width: 60px; }

/* Onboarding Modal */
.jo-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(5px);
}
.jo-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.jo-modal-content {
    background: #2a2a2a;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    border: 1px solid #444;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}
.jo-modal-overlay.visible .jo-modal-content {
    transform: translateY(0);
}
.jo-modal-title {
    margin-top: 0;
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 300;
}
.jo-handwriting {
    font-family: 'Caveat', cursive;
    color: var(--active-color);
    font-weight: 700;
    font-size: 2.2rem;
}
.jo-modal-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 25px;
}
.jo-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.jo-modal-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.jo-modal-btn.primary { background: #4caf50; color: white; }
.jo-modal-btn.secondary { background: #444; color: #ddd; border: 1px solid #555; }

/* Sliders */
.jo-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    opacity: 0.8;
}
.jo-slider:hover { opacity: 1; }
.jo-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
}

.jo-input-num {
    background: #333;
    border: 1px solid #444;
    color: #fff;
    padding: 5px;
    width: 50px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Metronome Styles */
.jo-metronome-container {
    background: rgba(0,0,0,0.2);
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #333;
    gap: 12px;
}
.jo-metro-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="color"]#jo-custom-color {
    background: none; border: none; width: 30px; height: 30px; cursor: pointer; padding: 0;
}

.jo-toggle-wrapper {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

/* Sound Warning Tooltip */
.jo-tooltip {
    position: absolute;
    right: 110%; 
    top: 30%;
    transform: translateY(-50%);
    background: #d63638;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.jo-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    margin-top: -6px;
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent #d63638;
}
.jo-tooltip.visible { 
    opacity: 1; 
    animation: jo-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes jo-shake {
  10%, 90% { transform: translate3d(-1px, -50%, 0); }
  20%, 80% { transform: translate3d(2px, -50%, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, -50%, 0); }
  40%, 60% { transform: translate3d(4px, -50%, 0); }
}

.jo-btn {
    background: #0073aa;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.jo-btn.muted { background: #d63638; }
.jo-btn-secondary { background: #444; color: #ccc; }
.jo-btn-active { background: #28a745; color: white; box-shadow: 0 0 10px rgba(40, 167, 69, 0.5); }

.jo-title-label {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: #aaa;
    margin-top: 15px; 
    transform: rotate(-2deg); 
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.jo-info-bar {
    border-top: 1px solid #333;
    padding-top: 15px;
    justify-content: space-between;
}

.jo-chord-box {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.jo-label { color: #888; font-size: 0.8rem; text-transform: uppercase; }
.jo-chord-text {
    font-size: 1.5rem; font-weight: 700; color: var(--active-color); 
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.jo-status-box {
    font-size: 0.8rem; color: #666; display: flex; gap: 10px; align-items: center;
}

.jo-pill {
    background: var(--active-color);
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.7rem;
}
.jo-pill.hidden { display: none; }

.jo-labels-layer {
    height: 25px; 
    width: 100%;
    background: #111;
    display: flex;
    position: relative;
    overflow: hidden;
    border-left: 5px solid #000;
    border-right: 5px solid #000;
}

.jo-note-label {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: #fff;
    opacity: 0; 
    transition: opacity 0.05s, color 0.1s;
    user-select: none;
}

.jo-note-label.visible {
    opacity: 1;
    color: var(--active-color); 
    text-shadow: 0 0 5px var(--active-color);
}

.jo-piano {
    position: relative;
    height: 240px;
    width: 100%;
    overflow: hidden; 
    background: #111;
    border-top: 2px solid #000;
    border-radius: 0 0 8px 8px;
    display: flex;
    user-select: none;
}

.jo-key {
    position: relative;
    box-sizing: border-box;
    z-index: 1;
    cursor: pointer;
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end; 
    justify-content: center;
    padding-bottom: 8px;
}

.jo-key-octave {
    color: #555;
    font-size: 0.65rem;
    font-weight: 600;
    pointer-events: none;
}

.jo-key-white {
    height: 100%;
    background: linear-gradient(to bottom, #fff 0%, #eee 100%);
    border: 1px solid #999;
    border-top: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.jo-key-white.active {
    background: var(--active-color);
    border-bottom: 4px solid rgba(0,0,0,0.3);
    box-shadow: inset 0 -5px 15px rgba(0,0,0,0.3);
}
.jo-key-white.active .jo-key-octave { color: rgba(0,0,0,0.5); }

.jo-key-black {
    height: 60%;
    background: linear-gradient(to bottom, #333 0%, #000 100%);
    border: 1px solid #000;
    border-bottom: 1px solid #444;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    z-index: 2;
    margin-left: 0; margin-right: 0;
}

.jo-key-black.active {
    background: var(--active-color);
    border-color: rgba(0,0,0,0.3);
    box-shadow: inset 0 -2px 10px rgba(0,0,0,0.5);
}
