* {
    box-sizing: border-box;
}
:root {
    /* Dur-Familie (stabil, grün) */
    --color-major:        #4caf50;
    --color-maj7:         #66bb6a;
    --color-add6:         #81c784;
    --color-add9:         #a5d6a7;
    --color-add11:        #c8e6c9;

    /* Moll-Familie (weich, blau) */
    --color-minor:        #2196f3;
    --color-min7:         #42a5f5;
    --color-madd6:        #64b5f6;
    --color-madd9:        #90caf9;
    --color-minMaj7:      #1e88e5;

    /* Dominant / alteriert (orange → rotorange) */
    --color-dom7:         #ff9800;
    --color-7b5:          #fb8c00;
    --color-7sharp5:      #f57c00;
    --color-7b9:          #ef6c00;
    --color-7sharp9:      #e65100;
    --color-7b9b5:        #ff7043;

    /* Diminished-Familie (rot / rotviolett) */
    --color-diminished:   #f44336;
    --color-dim7:         #e53935;
    --color-halfdim7:     #d81b60;

    /* Suspended (violett) */
    --color-sus2:         #ab47bc;
    --color-sus4:         #8e24aa;

    /* Quartal / Quintal / Power (türkis / petrol / grau) */
    --color-quartal:      #009688;
    --color-quintal:      #00796b;
    --color-power5:       #757575;

    /* Bestehende UI-Farben */
    --light-gray: #eee;
    --white: #fff;
    --diatonic-hightlight: rgba(0, 255, 0, 0.3);
    --functional-hightlight: rgba(255, 165, 0, 0.3);
    --relative-hightlight: rgba(0, 0, 255, 0.3);
    --chromatic-hightlight: rgba(255, 0, 0, 0.3);
    --key-border-color: rgba(0,0,0,0.2);
}


html, body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}
#toolbar {
    background: var(--light-gray);
    padding: 1em;
    display: flex;
    gap: 1em;
    justify-content: center;
}
label select {
    clear: both;
    margin-top: 0.5em;
    width: 100%;
    border-radius: 5px;
    padding:3px;
}
article {
    padding: 1em;
    margin:0 auto 0 auto;
    width: 90%;
    max-width: 1200px;
}
#fullchordhistory {
    display: none;
}
#currently {
    display: grid;
    gap: 1%;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
#chordhistory a {
    display: inline-block;
    padding: 0.2em 0.5em;
    margin: 0.1em;
    border-radius: 4px;
    text-decoration: none;
}
ul {
    list-style: none;
    padding-left: 0;
}
#currentchord {
    font-size: 1.5em;
    font-weight: bold;
}
#currentchord a {
    text-decoration: none;
    padding: 0.5em;
    display: inline-block;
    border-radius: 4px;
}
a.major {
    background: var(--color-major);
    color: var(--white);
}
a.minor {
    background: var(--color-minor);
    color: var(--white);
}
a.diminished {
    background: var(--color-diminished);
    color: var(--white);
}
a.augmented {
    background: var(--color-augmented);
    color: var(--white);
}
a.sus2, a.sus4 {
    background: var(--color-suspended);
    color: var(--white);
}
a.quartal {
    background: var(--color-quartal);
    color: var(--white);
}
#probablekey ul {
    display: block;
}
#probablekey li {
    display: inline-block;
    cursor:pointer;
    margin: 0.2em;
    padding: 0.2em 0.5em;
    border-radius: 50px;
    position: relative;
    color:var(--white);
}
li.key_score_major {
    background: var(--color-major);
}
li.key_score_minor {
    background: var(--color-minor);
}
li.key_score_1 {
    font-size:0.6em;
    opacity: 0.6;
}
li.key_score_2 {
    font-size:0.7em;
    opacity: 0.65;
}
li.key_score_3 {
    font-size:0.75em;
    opacity: 0.7;
}
li.key_score_4 {
    font-size:0.8em;
    opacity: 0.75;
}
li.key_score_5 {
    font-size:1.1em;
    opacity: 0.8;
}
li.key_score_6 {
    font-size:1.4em;
    opacity: 0.85;
}
li.key_score_7 {
    font-size:1.7em;
    opacity: 0.9;
}
li.key_score_8 {
    font-size:2em;
    opacity: 1;
}
li.key_score_9 {
    font-size:2.5em;
    opacity: 1;
}
#probablekey li sup {
    font-size: 0.5em;
    position: absolute;
    top: -0.5em;
    right: -0.5em;
    background: var(--color-augmented);
    color: #000;
    padding: 0.1em 0.3em;
    border-radius: 50%;
}
.bassmodeselector span {
    display:block;
    margin-bottom:10px;
}
input[type="radio"] {
    margin:0;
}
#nextchords>ul {
    display:grid;
    gap:1%;
    grid-template-columns: 100%; /* repeat(auto-fit, minmax(150px, 1fr)) */;
}
#nextchords>ul>li {
    font-weight: bold;
}
#nextchords>ul>li>ul {
    font-weight: normal;
    margin-top:15px;
    display: block;
}
#nextchords>ul>li>ul>li {
    display: inline-block;
    margin: 0;
    padding:0;
}
#nextchords .chordlink {
    display: inline-block;
    align-items: center;
    justify-content: center;

    padding: 0.6em;
    margin: 0.4em;

    border-radius: 5px;
    border: 2px solid var(--light-gray);

    color: black;

    text-decoration: none;
    font-weight: 600;

    transition: 
        font-size 0.2s ease,
        opacity 0.2s ease,
        transform 0.2s ease;
}

#nextchords .chordlink:hover {
    transform: scale(1.1);
}

/* dur */
#nextchords .chordlink.type_major,
#currentchord a.current-chord.type_major,
#chordhistory a.history-chord.type_major {
    background: var(--color-major);
    color: var(--white);
}

#nextchords .chordlink.type_maj7,
#currentchord a.current-chord.type_maj7,
#chordhistory a.history-chord.type_maj7 {
    background: var(--color-maj7);
    color: var(--white);
}

#nextchords .chordlink.type_add6,
#currentchord a.current-chord.type_add6,
#chordhistory a.history-chord.type_add6 {
    background: var(--color-add6);
    color: var(--white);
}

#nextchords .chordlink.type_add9,
#currentchord a.current-chord.type_add9,
#chordhistory a.history-chord.type_add9 {
    background: var(--color-add9);
    color: var(--white);
}

#nextchords .chordlink.type_add11,
#currentchord a.current-chord.type_add11,
#chordhistory a.history-chord.type_add11 {
    background: var(--color-add11);
    color: var(--white);
}


/* moll */
#nextchords .chordlink.type_minor,
#currentchord a.current-chord.type_minor,
#chordhistory a.history-chord.type_minor {
    background: var(--color-minor);
    color: var(--white);
}

#nextchords .chordlink.type_min7,
#currentchord a.current-chord.type_min7,
#chordhistory a.history-chord.type_min7 {
    background: var(--color-min7);
    color: var(--white);
}

#nextchords .chordlink.type_madd6,
#currentchord a.current-chord.type_madd6,
#chordhistory a.history-chord.type_madd6 {
    background: var(--color-madd6);
    color: var(--white);
}

#nextchords .chordlink.type_madd9,
#currentchord a.current-chord.type_madd9,
#chordhistory a.history-chord.type_madd9 {
    background: var(--color-madd9);
    color: var(--white);
}

#nextchords .chordlink.type_minMaj7,
#currentchord a.current-chord.type_minMaj7,
#chordhistory a.history-chord.type_minMaj7 {
    background: var(--color-minMaj7);
    color: var(--white);
}

/* Dominant / alteriert */
#nextchords .chordlink.type_dom7,
#currentchord a.current-chord.type_dom7,
#chordhistory a.history-chord.type_dom7 {
    background: var(--color-dom7);
    color: var(--white);
}

#nextchords .chordlink.type_7b5,
#currentchord a.current-chord.type_7b5,
#chordhistory a.history-chord.type_7b5 {
    background: var(--color-7b5);
    color: var(--white);
}

#nextchords .chordlink.type_7sharp5,
#currentchord a.current-chord.type_7sharp5,
#chordhistory a.history-chord.type_7sharp5 {
    background: var(--color-7sharp5);
    color: var(--white);
}

#nextchords .chordlink.type_7b9,
#currentchord a.current-chord.type_7b9,
#chordhistory a.history-chord.type_7b9 {
    background: var(--color-7b9);
    color: var(--white);
}

#nextchords .chordlink.type_7sharp9,
#currentchord a.current-chord.type_7sharp9,
#chordhistory a.history-chord.type_7sharp9 {
    background: var(--color-7sharp9);
    color: var(--white);
}

#nextchords .chordlink.type_7b9b5,
#currentchord a.current-chord.type_7b9b5,
#chordhistory a.history-chord.type_7b9b5 {
    background: var(--color-7b9b5);
    color: var(--white);
}


/* Diminished-Familie */
#nextchords .chordlink.type_diminished,
#currentchord a.current-chord.type_diminished,
#chordhistory a.history-chord.type_diminished {
    background: var(--color-diminished);
    color: var(--white);
}

#nextchords .chordlink.type_dim7,
#currentchord a.current-chord.type_dim7,
#chordhistory a.history-chord.type_dim7 {
    background: var(--color-dim7);
    color: var(--white);
}

#nextchords .chordlink.type_halfdim7,
#currentchord a.current-chord.type_halfdim7,
#chordhistory a.history-chord.type_halfdim7 {
    background: var(--color-halfdim7);
    color: var(--white);
}

/* Suspended */
#nextchords .chordlink.type_sus2,
#currentchord a.current-chord.type_sus2,
#chordhistory a.history-chord.type_sus2 {
    background: var(--color-sus2);
    color: var(--white);
}

#nextchords .chordlink.type_sus4,
#currentchord a.current-chord.type_sus4,
#chordhistory a.history-chord.type_sus4 {
    background: var(--color-sus4);
    color: var(--white);
}

/* Quartal / Quintal / Power */
#nextchords .chordlink.type_quartal,
#currentchord a.current-chord.type_quartal,
#chordhistory a.history-chord.type_quartal {
    background: var(--color-quartal);
    color: var(--white);
}

#nextchords .chordlink.type_quintal,
#currentchord a.current-chord.type_quintal,
#chordhistory a.history-chord.type_quintal {
    background: var(--color-quintal);
    color: var(--white);
}

#nextchords .chordlink.type_power5,
#currentchord a.current-chord.type_power5,
#chordhistory a.history-chord.type_power5 {
    background: var(--color-power5);
    color: var(--white);
}

#nextchords .chordlink.prob_100 { font-size: 1.4em; opacity: 1.0; }
#nextchords .chordlink.prob_90  { font-size: 1.2em; opacity: 0.95; }
#nextchords .chordlink.prob_80  { font-size: 1.15em; opacity: 0.90; }
#nextchords .chordlink.prob_70  { font-size: 1.1em; opacity: 0.85; }
#nextchords .chordlink.prob_60  { font-size: 1.05em; opacity: 0.80; }
#nextchords .chordlink.prob_50  { font-size: 1em; opacity: 0.78; }
#nextchords .chordlink.prob_40  { font-size: 0.95em; opacity: 0.75; }
#nextchords .chordlink.prob_30  { font-size: 0.9em; opacity: 0.72; }
#nextchords .chordlink.prob_20  { font-size: 0.85em; opacity: 0.70; }
#nextchords .chordlink.prob_10  { font-size: 0.8em; opacity: 0.65; }
#nextchords .chordlink.prob_0   { font-size: 0.75em; opacity: 0.60; }

#nextchords .chordlink.group_diatonic {
    box-shadow: 0 0 0 3px var(--diatonic-hightlight);
}

#nextchords .chordlink.group_functional {
    box-shadow: 0 0 0 3px var(--functional-hightlight);
}

#nextchords .chordlink.group_relative {
    box-shadow: 0 0 0 3px var(--relative-hightlight);
}

#nextchords .chordlink.group_chromatic {
    box-shadow: 0 0 0 3px var(--chromatic-hightlight);
}

#nextchords .chordlink[class*="key_"] {
    border-style: solid;
    border-width: 2px;
    border-color: var(--key-border-color);
}

#allnotesoff, #passingchord {
    background: var(--light-gray);
    color: black;
    background-color: var(--white);
    border: 1px solid #333;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    margin-top:0.5em;
}