:root {
    --accent-color: saddlebrown;
    --background-color: #0e0e0e;
    --background-light-accent-color: rgba(255, 255, 255, .3);
    --primary-text-color: #c0c0c0;
    --secondary-text-color: #919191;
    --opposite-theme-color: white;
    --hover-color: #181818;
    --modal-background-color: rgba(3, 10, 0, 0.85);
    --icon-filter: invert(70%);
}

@font-face {
    font-family: VarelaRound;
    src: url(../fonts/VarelaRound-Regular.ttf);
    font-weight: 400;
}

@font-face {
    font-family: SF-Pro-Text;
    src: url(../fonts/SF-Pro-Text-Bold.otf);
    font-weight: bold;
}

@media (min-width: 100px) {
    * {
        box-sizing: border-box;
        font-family: VarelaRound, sans-serif, serif;
    }

    :not(.normal-font-size):not(h1):not(h2):not(h3):not(h4) {
        font-size: 20px;
    }

    body, html {
        min-height: 100vh;
        margin: 0;
        padding: 0;
    }

    body {
        background: var(--background-color);
        color: var(--secondary-text-color);
    }

    h2, h3, h4 {
        color: var(--primary-text-color);
    }

    a {
        color: var(--accent-color);
    }
    a:hover{
        filter: brightness(120%);
    }

    header, #config-div {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        width: 100%;
        align-items: center;
    }

    header > div {
        display: flex;
        align-items: center;
        /*gap: 20px;*/
        justify-content: space-between;
        /*background: #a46d49;*/
        /*border-radius: 30px;*/
        padding: 3vh 0;
        width: 90%;
        border-bottom: 10px dotted var(--accent-color);
    }

    .stay-active-button img {
        filter: var(--icon-filter) drop-shadow(0 0 5px rgba(0, 0, 0, 0.38));
    }

    .stay-active-button {
        background: #1f2425;
        border: 3px solid #3c4143;
        /*padding: 10px;*/
        width: 55px;
        height: 55px;
        /*box-shadow: inset 0 -10px 20px 0 rgba(0, 0, 0, 0.4), inset 0 10px 20px 0 rgba(0, 0, 0, 0.4);*/
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: border-color 0.3s ease, background-color 0.3s ease; /* This makes the color change smoothly */

        /*min-height: 40px;*/
    }
    .stay-active-button:hover{
        border-color: var(--accent-color);
    }

    .stay-active-button.selected {
        background-color: var(--accent-color);
        border-color: var(--accent-color);
    }

    .checkbox-button {
        display: inline-flex;
        align-items: center;
        gap: 0.5em;
        padding: 4px 12px 4px 8px;
        background: #1f2425;
        border: 3px solid #3c4143;
        /*border: 3px solid  var(--accent-color);*/
        /*box-shadow: inset 0 -10px 20px 0 rgba(0, 0, 0, 0.7), inset 0 10px 20px 0 rgba(0, 0, 0, 0.7);*/
        /*background: #525252;*/
        /*background: var(--accent-color);*/
        /*border: 0px solid #3c4143;*/
        /*padding: 5px 14px 5px 10px;*/
        /*box-shadow: inset 0 -10px 20px 0 rgba(0, 0, 0, 0.4), inset 0 10px 20px 0 rgba(0, 0, 0, 0.4);*/
        border-radius: 20px;
        cursor: pointer;
        min-height: 40px;
    }

    #info-game-mode {
        padding: 4px 12px 4px 12px;
    }

    #info-game-mode input {

    }

    .checkbox-button:hover {
        /*box-shadow: 0 0 10px 0 #3c4143;*/
    }

    .checkbox-button span {
        font-size: 16px;
    }

    #config-div {
        /*Awesome trick to transition from height 0 https://www.youtube.com/watch?v=B_n4YONte5A*/
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.5s ease-in-out;
    }

    #config-div.expanded {
        grid-template-rows: 1fr;
        /* Delayed animation to prevent showing the scrollbar while config-div is expanding */
        animation: enableScroll 0.5s ease 0.5s forwards;
    }

    #config-inner-div {
        overflow: hidden;
        height: 100%;
    }

    #config-inner-div > div, #config-inner-div > details > div {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        width: 100%;
        align-items: center;
    }

    /*Enable scroll in case there are more buttons than 200px height*/
    @keyframes enableScroll {
        to {
            overflow: auto; /* Apply overflow: auto after the delay */
        }
    }
    /*#config-div.expanded label{*/
    /*    margin-top: ;*/
    /*}*/
    #settings-toggle-btn {
        cursor: pointer;
    }

    input {
        accent-color: var(--accent-color);
    }

    #bpm-input {
        font-size: 20px;
        text-align: center;
        background: transparent;
        /*color: #c0c0c0;*/
        color: var(--secondary-text-color);
        border: none;
        border-bottom: 2px dashed #8a8a8a;
        padding: 5px 10px;
        width: 90px;
    }

    .icon {
        width: 30px;
        /*height: 30px;*/
        filter: var(--icon-filter);
    }

    #game-start-instruction .icon, .game-instructions .icon {
        width: 20px;
        margin: 0 5px;
    }

    #start-stop-btn {
        padding: 8px 8px;
        border-radius: 10px;
        cursor: pointer;
        width: 40px;
        margin-right: 10px;
    }

    #start-stop-btn:hover {
        /*border-bottom: 2px dotted #8a8a8a;*/
        background: rgba(255, 255, 255, .1);
    }

    .button-icon {
        width: 30px;
        height: 30px;
        filter: var(--icon-filter);
    }

    #note-and-string-container {
        display: flex;
        align-items: stretch;
        justify-content: center;
        /*column-gap: 50px;*/
        flex-wrap: wrap;
        width: 100%;
    }

    #note-and-string-container > div {
        height: 100%;
        width: 45%;
    }

    .note-value-span {
        height: 100%;
        /*Set line height to more than 100% to compensate ♭ char that takes up more space than regular letters*/
        line-height: 130%;
    }

    /* Class name twice to increase specificity */
    .note-value-span.note-value-span {
        font-size: 100px;
        font-weight: bold;
        color: var(--primary-text-color);
    }

    #string-span.treble-clef-enabled {
        height: 200px;
        line-height: 200px;
    }

    #treble-clef-output {
        height: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
    }

    #treble-clef-output svg {
        display: block;
        height: 100%;
    }

    .text {
        color: var(--primary-text-color);
    }

    #game-start-instruction, .game-instructions {
        width: 100%;
        justify-content: center;
        color: var(--primary-text-color);
        text-align: center;
        gap: 0;
        max-width: 975px;
        /*margin-top: 10px;*/
    }

    #game-start-instruction p, .game-instructions p {
        margin: 14px;
    }

    #game-start-instruction details, .game-instructions details {
        width: 100%;
        margin-top: 20px;
    }

    .roadmap-image {
        width: 100%;
        margin: 10px auto;
        /*filter: invert(90%);*/
        border-radius: 10px;
    }

    details summary {
        cursor: pointer;
        margin-bottom: 20px;
    }

    details summary > * {
        display: inline;
    }

    details summary h3 {
        margin-left: 10px;
    }

    #metronome-game-mode {
        cursor: pointer;
    }

    #game-container {
        display: flex;
        align-items: center;
        justify-content: space-around;
        flex-wrap: wrap;
        width: 100%;
        height: 100%;
        text-align: center;
        margin-top: 20px;
        gap: 30px;
    }

    #game-container > div {
        /*display: flex;*/
        /*flex-wrap: wrap;*/
        /*gap: 15px;*/
    }

    #note-and-string-container div span {
        width: 100%;
        /*So that they are on top of each other inside div*/
        display: block;
    }

    .label {
        color: var(--secondary-text-color);
    }

    #lower-bpm-btn {
        /*transform: rotate(90deg);*/
    }

    #higher-bpm-input {
        /*transform: rotate(-90deg);*/
    }

    .lvl-icon {
        width: 43px;
        padding: 15px;
        cursor: pointer;
    }

    .center-flexbox {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /*Score*/
    #score {
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #score span {
        width: fit-content;
        padding: 0 20px;
        font-size: 30px;
        font-weight: bold;
    }

    #correct-count, #incorrect-count {
        width: fit-content;
        padding: 0;
    }

    #incorrect-count {
        color: darkred;
    }

    #correct-count {
        color: green;
    }

    /* Detected note */
    #detected-note-div {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    #detected-note {
        line-height: 20px;
        font-size: 45px;
        position: relative;
        display: inline-block;
        padding: 0 20px;
        /*width: 400px; !* Adjust the width as per your preference *!*/
        overflow: visible;
        color: #a96f00;
    }

    #detected-note::before,
    #detected-note::after {
        color: #a96f00;
        content: '';
        position: absolute;
        top: 50%;
        height: 8px; /* Maximum height of the bar */
        background-color: var(--background-light-accent-color); /* Set the color of the growing accent bar */
        transition: width 0.3s ease; /* Adjust the transition duration as per your preference */
        border-radius: 99px;
    }

    #detected-note::before {
        left: 0;
        /* Left and right bar width set by javascript depending on the length oft bar (cent amount) */
        width: var(--left-bar-width, 0%);
        transform: translate(-100%, -50%);
    }

    #detected-note::after {
        right: 0;
        transform: translate(100%, -50%);
        /* Left and right bar width set by javascript depending on the length oft bar (cent amount) */
        width: var(--right-bar-width, 0%);
    }

    #frequency-bars {
        position: fixed;
        bottom: 0;
        z-index: -1;
    }

    #game-progress-div {
        width: 90%;
    }

    #progress-bar-title-div {
        width: 100%;
        margin-bottom: 10px;
    }

    #game-container #progress-bar-container {
        width: 100%;
        display: flex;
        margin: auto;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        color: var(--secondary-text-color);
        line-height: 1.1em;
    }

    #game-container #progress-bar-container span {
        width: fit-content;
        height: 1em;
    }

    #progress-bar-container .meter {
        width: 100%;
    }

    .meter span {
        color: greenyellow;
        text-align: right;
        padding-right: 5px;
    }

    .hidden {
        display: none !important;
    }


    /*#current-key-and-string .icon {*/
    /*    width: 20px;*/
    /*    margin-right: 20px§;*/
    /*    cursor: pointer;*/
    /*    filter: invert(60%);*/
    /*}*/
    /*.option-for-game-mode {*/
    /*    display: none;*/
    /*}*/
    .options-title-span {
        width: 100%;
    }

    .config-number-input {
        background: rgba(255, 255, 255, 0.2);
        width: 60px;
        border: none;
        padding: 5px;
        border-radius: 10px;
        text-align: center;
        color: var(--primary-text-color);
    }

    .label-text {
        /*font-family: SF-Pro-Text, CenturyGothic, Geneva, AppleGothic, sans-serif;*/
        font-size: 13px;
        text-align: center;
        /*display: block;*/
        display: list-item; /*For collapsible summary*/
        margin-top: 15px;
        margin-bottom: 10px;
    }

    .btn-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .btn-container button, .btn {
        background-color: var(--background-color);
        color: var(--primary-text-color);
        /*font-weight: bold;*/
        font-size: 18px;
        border: 2px dotted var(--accent-color);
        padding: 10px 20px;
        border-radius: 10px;
        filter: brightness(2);
    }

    .btn-container button:hover, .btn:hover {
        background-color: var(--hover-color);
        cursor: pointer;
    }

    #sensitivity-range-slider {
        width: 350px;
        max-width: 100%;
        direction: rtl;
    }

    #mic-sensitivity-option#mic-sensitivity-option {
        flex-wrap: nowrap;
    }

    #mic-sensitivity-option span {
        font-size: 15px;
    }

    /*summary::marker{*/
    /*    content: none;*/
    /*}*/
    /*details>summary {*/
    /*  list-style: none;*/
    /*}*/
    /*summary::-webkit-details-marker {*/
    /*  display: none*/
    /*}*/
    /*summary::after {*/
    /*  content: ' ►';*/
    /*}*/
    /*details[open] summary:after {*/
    /*  content: " ▼";*/
    /*}*/
}

@media (min-width: 641px) {
    #game-container {
        margin-top: 40px;
        justify-content: center;
        column-gap: 20vw;
    }

    header > div {
        width: 60%;
        justify-content: space-around;
        /*justify-content: center;*/
        /*column-gap: 60px;*/
    }

    #start-stop-btn {
        margin-right: 0;
    }

    #game-progress-div {
        width: 75%;
    }

    #game-container #note-and-string-container {
        column-gap: 100px;
    }

    #treble-clef-output {
        width: 200px;
        height: auto;
    }

    #string-span.treble-clef-enabled {
        height: 260px;
        line-height: 260px;
    }

    #note-and-string-container > div {
        /* Treble clef staff is 200px wide */
        width: 200px;
    }
}

@media (max-height: 500px) {
    #detected-note {
        margin-top: 0;
    }
}

@media (min-width: 641px) and (min-height: 600px) {
    .note-value-span.note-value-span {
        font-size: 130px;
    }

    #game-container.no-guitar .note-value-span.note-value-span {
        font-size: 100px;
    }
}

@media (min-width: 961px) {
    header > div {
        width: 50%;
    }

    #game-container {
        gap: 40px;
    }

    .roadmap-image {
        width: 70%;
    }

    #game-progress-div {
        width: 60%;
    }
}

/*Has to be after min-width 961 */
@media (max-height: 600px) {
    /*#game-container {*/
    /*    gap: 0;*/
    /*}*/
}

@media (max-height: 660px) {
    #game-container {
        gap: 20px;
    }
}

@media (min-height: 720px) {
    #game-container {
        gap: 50px;
    }

    #game-container.no-guitar {
        gap: 20px;
    }
}


@media (min-width: 1250px) {
    #game-progress-div {
        width: 50%;
    }

}