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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notes-config-wrapper {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.btn-toggle {
    width: 100%;
    background: #f7fafc;
    color: #4a5568;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-toggle:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.notes-config {
    background: #f7fafc;
    padding: 20px;
    border-radius: 0 0 10px 10px;
    border: 2px solid #e2e8f0;
    border-top: none;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.notes-config.collapsed {
    max-height: 0;
    padding: 0 20px;
    border: none;
}

.note-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.note-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-control label {
    font-size: 0.9rem;
}

.note-control span {
    color: #667eea;
    font-weight: 700;
}

.note-control.accent-volume-control {
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

label {
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
}

#bpm-value {
    color: #667eea;
    font-weight: 700;
}

.note-division-select {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.note-division-select:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.note-division-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="range"] {
    width: 250px;
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #5568d3;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #5568d3;
    transform: scale(1.1);
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary.playing {
    background: #f56565;
}

.btn-primary.playing:hover {
    background: #e53e3e;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.time-signature {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.signature {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.note-info {
    font-size: 1rem;
    color: #718096;
    font-weight: 500;
}

.strum-grid {
    margin-bottom: 30px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 10px;
    background: #f7fafc;
    padding: 10px;
    border-radius: 10px;
}

.strum-cell {
    aspect-ratio: 1;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    font-size: 1.5rem;
    font-weight: 700;
    user-select: none;
    position: relative;
}

.strum-cell .beat-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: #4a5568;
    display: none;
}

.strum-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.strum-cell.down {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.strum-cell.up {
    background: #4299e1;
    color: white;
    border-color: #3182ce;
}

.strum-cell.off {
    background: #f7fafc;
    color: #cbd5e0;
    border-color: #e2e8f0;
}

.strum-cell.active {
    box-shadow: 0 0 0 4px #fbbf24;
    transform: scale(1.1);
}

.strum-cell.accented {
    position: relative;
}

.strum-cell.accented::after {
    content: '★';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    color: #fbbf24;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.strum-cell.beat-start {
    border-left-width: 4px;
    border-left-color: #4a5568;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-symbol {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid;
}

.legend-symbol.down {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.legend-symbol.up {
    background: #4299e1;
    color: white;
    border-color: #3182ce;
}

.legend-symbol.off {
    background: #f7fafc;
    color: #cbd5e0;
    border-color: #e2e8f0;
}

.legend-symbol.accented-symbol {
    background: white;
    color: #fbbf24;
    border-color: #fbbf24;
    font-size: 1.8rem;
}

.instructions {
    text-align: center;
    color: #718096;
    font-size: 0.95rem;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
}

.instructions p {
    margin: 5px 0;
}

.instructions strong {
    color: #4a5568;
    font-weight: 700;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.accent-mode-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-accent-mode {
    padding: 12px 30px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    color: #4a5568;
}

.btn-accent-mode:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-accent-mode.active {
    background: #fbbf24;
    color: white;
    border-color: #f59e0b;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
    }

    input[type="range"] {
        width: 100%;
    }

    .note-division-select {
        width: 100%;
    }

    .grid-container {
        gap: 14px;
        row-gap: 30px;
        padding: 30px 12px 12px 12px;
        margin-top: 25px;
    }
    
    .grid-container.division-4 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .grid-container.division-8 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .grid-container.division-16 {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .strum-cell {
        font-size: 2rem;
        min-width: 0;
        border-radius: 10px;
        border-width: 3px;
        padding: 4px;
    }

    .strum-cell .beat-number {
        display: block;
    }

    .strum-cell.accented::after {
        font-size: 0.9rem;
        top: 2px;
        right: 2px;
    }

    .legend {
        gap: 15px;
    }

    .legend-item {
        font-size: 0.85rem;
    }

    .legend-symbol {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .instructions {
        font-size: 0.85rem;
        padding: 12px;
    }

    button {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .btn-accent-mode {
        width: 100%;
        padding: 14px 24px;
    }
}
