/* Container reset */
#grid {
    min-height: 150px;
    align-items: center;
    scrollbar-width: thin;
    scrollbar-color: #4b5563 #1f2937;
}

/* --- SELECTION HEADER LAYOUT --- */
.top-selection-area {
    margin-bottom: 2rem;
    background: #111827;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #374151;
}

.selection-row-label {
    font-size: 10px;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: block;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 1.5rem;
}

/* Ensemble Cards (Blue Theme) */
.ens-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 10px 4px;
    font-size: 11px;
    font-weight: bold;
    color: #9ca3af;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.ens-card:hover { border-color: #3b82f6; color: white; }
.ens-card.selected {
    background: #1d4ed8;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* Style Cards (Teal/Slate Theme) */
.style-card {
    background: #334155; 
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 8px 4px;
    font-size: 10px;
    font-weight: bold;
    color: #cbd5e1;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.style-card:hover { border-color: #2dd4bf; color: white; }
.style-card.selected {
    background: #0f766e; 
    border-color: #2dd4bf; 
    color: white;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

/* --- INSTRUMENT MIXER --- */
#instrumentVis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
}

.inst-card {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.inst-header {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: #9ca3af;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
    background: #1f2937;
    transition: background 0.05s;
    cursor: default;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inst-active .inst-header { background: #3b82f6; color: white; box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }

.control-row { display: flex; justify-content: space-between; align-items: center; }
.control-label { font-size: 8px; color: #6b7280; text-transform: uppercase; }

input[type=range].tiny-slider {
    width: 65%;
    height: 4px;
    -webkit-appearance: none;
    background: #374151;
    border-radius: 2px;
    outline: none;
}
input[type=range].tiny-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
}

.mute-btn { font-size: 9px; background: #374151; color: #9ca3af; border: 1px solid #4b5563; border-radius: 3px; width: 100%; margin-top: 2px; cursor: pointer; }
.mute-btn.muted { background: #7f1d1d; color: #fca5a5; border-color: #ef4444; }

.remove-inst-btn { position: absolute; top: -5px; right: -5px; background: #ef4444; color: white; border-radius: 50%; width: 16px; height: 16px; font-size: 10px; line-height: 16px; text-align: center; cursor: pointer; border: none; display: none; }
.inst-card:hover .remove-inst-btn { display: block; }

.add-inst-card { border: 2px dashed #374151; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #4b5563; font-weight: bold; font-size: 24px; transition: all 0.2s; }
.add-inst-card:hover { border-color: #60a5fa; color: #60a5fa; }

/* Timeline Cards */
.chord-block {
    min-width: 100px;
    height: 90px;
    background: linear-gradient(145deg, #1f2937, #111827);
    border: 2px solid #374151;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: popIn 0.5s forwards ease-out;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.chord-block:hover { border-color: #60a5fa; transform: translateY(-2px); }
.chord-block.playing { border-color: #ffffff !important; background: #374151; transform: scale(1.05); box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); z-index: 10; }
@keyframes popIn { to { opacity: 1; transform: translateY(0); } }

/* DRAG & DROP */
.draggable-item { cursor: grab; transition: transform 0.1s; }
.draggable-item:active { cursor: grabbing; }
.draggable-item.dragging { opacity: 0.5; background: #374151; border: 1px dashed #60a5fa; }

/* EASTER EGG TILE */
.easter-egg-section {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 50%, #b45309 100%);
    border: 1px solid #fcd34d;
    color: #451a03;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    font-weight: bold;
}
.easter-egg-section input, .easter-egg-section select, .easter-egg-section label { display: none; }