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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    min-height: 100vh;
    padding: 20px;
}

.sound-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.playback-section {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.play-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(6, 182, 212, 0.4);
}

.play-button:active {
    transform: translateY(0);
}

.play-icon {
    font-size: 1.3rem;
}

.playback-info {
    display: flex;
    gap: 20px;
}

.canvas-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.canvas-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
}

.canvas-section canvas {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.canvas-info {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #475569;
}

.info-item span:last-child {
    color: #06b6d4;
    font-weight: 700;
}

.spectrum-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #475569;
}

.legend-bar {
    width: 30px;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
    border-radius: 2px;
}

.controls-panel {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.controls-panel h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-group h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #06b6d4;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #475569;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 15px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #06b6d4;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #06b6d4;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.preset-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(6, 182, 212, 0.4);
}

.preset-btn:active {
    transform: translateY(0);
}

.note-info {
    margin-top: 15px;
    padding: 10px;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #06b6d4;
    font-size: 0.9rem;
    color: #0369a1;
}

.timbre-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.timbre-btn {
    padding: 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #475569;
}

.timbre-btn:hover {
    border-color: #06b6d4;
    background: #f0f9ff;
}

.timbre-btn.active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #06b6d4;
    color: white;
}

.timbre-btn small {
    font-size: 0.75rem;
    opacity: 0.8;
    display: block;
    margin-top: 4px;
}

.timbre-description {
    margin-top: 15px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #06b6d4;
}

.timbre-description p {
    font-size: 0.85rem;
    color: #0369a1;
    line-height: 1.5;
}

.formulas-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.formulas-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
}

.formula-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.formula-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #06b6d4;
}

.formula-label {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
    min-width: 180px;
}

.formula {
    font-family: 'Times New Roman', serif;
    font-size: 1rem;
    color: #334155;
    font-style: italic;
}

.instructions {
    background: #fef3c7;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.instructions h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 12px;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #78350f;
    line-height: 1.5;
}

.instructions li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #f59e0b;
    font-weight: bold;
}

.explanation {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.explanation h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #06b6d4;
}

.explanation h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #334155;
    margin-top: 25px;
    margin-bottom: 12px;
}

.explanation p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    header .subtitle {
        font-size: 0.9rem;
    }

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

    .playback-info {
        justify-content: center;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .timbre-buttons {
        grid-template-columns: 1fr;
    }

    .canvas-info {
        flex-direction: column;
        gap: 10px;
    }

    .formula-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .formula-label {
        min-width: auto;
    }
}
