html {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 30px;
}

#scale-wheel {
    width: 100%;
    max-width: 600px;
    height: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: grab;
    touch-action: none;
}

#scale-wheel:active {
    cursor: grabbing;
}

.segment {
    stroke: #333;
    stroke-width: 1;
    transition: fill 0.2s;
}

.segment.in-scale {
    fill: #4CAF50;
}

.segment.out-of-scale {
    fill: #ddd;
}

.segment.root-segment {
    stroke: #E91E63;
    stroke-width: 5;
}

.note-label {
    font-size: 18px;
    font-weight: bold;
    user-select: none;
    pointer-events: none;
}

.note-label.in-scale {
    fill: #333;
}

.note-label.out-of-scale {
    fill: #999;
}

.scale-type-label {
    font-size: 16px;
    font-weight: bold;
    fill: #fff;
    user-select: none;
    pointer-events: none;
}

#scale-info {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#scale-name {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

#scale-notes {
    margin: 0;
    color: #666;
    font-size: 18px;
}

#chords-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

#chords-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
}

#chords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.chord-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.chord-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.chord-degree {
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

.chord-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 80px;
    min-width: 80px;
}

.chord-button:hover {
    background-color: #45a049;
}

.chord-button:active {
    transform: scale(0.95);
    background-color: #3d8b40;
}

.chord-button.selected {
    border: 3px solid #E91E63;
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.5);
}

#chord-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #333;
    font-size: 18px;
    text-align: center;
}

#fretboard-container {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#fretboard-container h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.fret-line {
    stroke: #333;
    stroke-width: 2;
}

.string-line {
    stroke: #666;
    stroke-width: 1.5;
}

.fretboard-note {
    fill: #4CAF50;
    stroke: #333;
    stroke-width: 1;
}

.fretboard-note.non-chord-note {
    fill: #ccc;
}

.fretboard-note.root-note {
    stroke: #E91E63;
    stroke-width: 3;
}

.fret-number {
    font-size: 14px;
    fill: #666;
    user-select: none;
}

#fretboard {
    width: 100%;
    height: auto;
    touch-action: pan-x pan-y;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .container {
        max-width: 100%;
    }

    #scale-wheel {
        max-width: 90vw;
    }

    #scale-info {
        margin-top: 20px;
        padding: 15px;
    }

    #scale-name {
        font-size: 20px;
    }

    #scale-notes {
        font-size: 16px;
    }

    #fretboard-container {
        margin-top: 20px;
        padding: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #fretboard-container h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    #fretboard {
        min-width: 600px;
        display: block;
    }
}
