body {
    --content-max-width: 1200px;

    --foreground-color: white;
    --background-color: #efeff7;

    --primary-color: #f50041;
    --primary-light-color: #fdd4d4;
    --secondary-color: #758bfd;
    --secondary-dark-color: #4a60cc;

    --text-color: black;
    --text-inverted-color: white;
    --border-color: rgb(150, 150, 150);

    --white-key-width: calc(100% / 8);
    --black-key-width: calc(var(--white-key-width) / 2);
    --black-key-left-offset:   calc(var(--white-key-width) / 5);  /* slight right bias */
    --black-key-center-offset: calc(var(--white-key-width) / 4);  /* centered */
    --black-key-right-offset:  calc(var(--white-key-width) / 3);  /* slight left bias */

    --white-key-color: white;
    --white-key-border-color: black;
    --white-key-root-color: var(--primary-color);
    --white-key-hover-color: var(--primary-light-color);
    --white-key-secondary-color: var(--secondary-color);
    --white-key-label-color: black;

    --black-key-color: black;
    --black-key-border-color: black;
    --black-key-root-color: var(--primary-color);
    --black-key-hover-color: var(--primary-light-color);
    --black-key-secondary-color: var(--secondary-dark-color);
    --black-key-label-color: white;
    --black-key-hover-label-color: black;

    --extras-button-hover-color: var(--primary-color);

    --keybind-row-odd-color:  rgba(127, 127, 160, 0.3);
    --keybind-row-even-color: rgba(127, 127, 160, 0.1);

    --pc-key-color: #535369;
    --pc-key-shadow-color: rgba(140,140,160,0.75);
    --pc-key-text-color: var(--text-inverted-color);

    margin: 0;
    font-family: Roboto;
    color: var(--text-color);
    background-color: var(--background-color);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
}

ul {
    padding-left: 0;
    margin: 0;
}

#content {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 16px;
}

#fortuna-name {
    margin: 0;
    font-size: 20pt;
}

/* -- keyboard -- */

#keyboard {
    width: 85%;
    margin: 0 auto;
    height: 52vh;
    display: flex;
    flex-direction: row;
    position: relative;
    transition:
        width 0.2s ease,
        height 0.2s ease,
        max-height 0.2s ease;
}

.key {
    width: var(--white-key-width);
    cursor: pointer;
    border: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    transition: background-color ease 0.05s;
    display: flex;
    justify-content: center;
    align-items: end;
}

.key.white {
    background-color: var(--white-key-color);
    border: 2px solid var(--white-key-border-color);
    border-width: 4px 2px 4px 2px;
}


.key.white:first-of-type {
    border-left-width: 4px;
}

.key.white:last-of-type {
    border-right-width: 4px;
}

.key.white:hover {
    background-color: var(--white-key-hover-color);
}

.key.white.root {
    background-color: var(--white-key-root-color);
}

.key.white.secondary {
    background-color: var(--white-key-secondary-color);
}

.key.black {
    border-top: 4px solid var(--black-key-border-color);
    height: 60%;
    width: var(--black-key-width);
    background-color: var(--black-key-color);
    position: absolute;
    z-index: 2;
}

.key.black:hover {
    background-color: var(--black-key-hover-color);
}

.key.black:not(.root):not(.secondary):hover .note-label {
    color: var(--black-key-hover-label-color);
}

.key.black.root {
    background-color: var(--black-key-root-color);
}

.key.black.secondary {
    background-color: var(--black-key-secondary-color);
}

.key[data-note="c#"] {
    left: calc(var(--white-key-width) - var(--black-key-left-offset));
}

.key[data-note="d#"] {
    left: calc((var(--white-key-width)*2) - var(--black-key-right-offset));
}

/* no black e# key */

.key[data-note="f#"] {
    left: calc((var(--white-key-width)*4) - var(--black-key-left-offset));
}

.key[data-note="g#"] {
    left: calc((var(--white-key-width)*5) - var(--black-key-center-offset));
}

.key[data-note="a#"] {
    left: calc((var(--white-key-width)*6) - var(--black-key-right-offset));
}

/* no black b# key */

.key > .note-label {
    margin-bottom: 32px;
    font-size: 28pt;
    color: var(--white-key-label-color);
    user-select: none;
}

.key.black > .note-label {
    font-size: 18pt;
    color: var(--black-key-label-color);
    transition: color ease 0.05s;
}


#bottom-panel {
    max-width: var(--content-max-width);
    background-color: var(--foreground-color);
    padding: 24px;
    border-radius: 16px;
    position: relative;
    margin: 0 24px 24px 24px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    transition: width 0.2s ease;
}

#bottom-panel-header {
    display: flex;
    flex-direction: row;
    column-gap: 24px;
    align-items: center;
    margin: 8px 0 24px 0;
    justify-content: space-between;
}

#bottom-panel-title {
    margin: 0;
}

#bottom-panel-hide {
    height: fit-content;
    background: none;
    border: none;
    cursor: pointer;
}

#bottom-panel-hide svg {
    fill: var(--text-color);
}

#bottom-panel-content {
    display: flex;
    flex-direction: row;
    column-gap: 48px;
    max-height: 300px;
    max-width: 1000px;
    overflow: hidden;
    /* widen, then heighten */
    transition:
        max-width 0.4s ease-in-out,
        max-height 0.2s ease 0.3s;
}

/* restrict hiding the bottom panel to PCs only */
@media screen and (min-width: 769px) {
    body.hiding-bottom-panel #keyboard {
        width: 95%;
        max-height: 80vh;
        height: 80vh;
    }

    body.hiding-bottom-panel #bottom-panel-header {
        margin: 8px 0;
    }

    body.hiding-bottom-panel #bottom-panel-content {
        max-height: 0;
        max-width: 0;
        /* shorten, then narrow */
        transition:
            max-height 0.2s ease,
            max-width 0.4s ease-in-out 0.1s;
    }
}


/* -- options -- */

#options {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 8px 24px;
    font-size: 16pt;
}

#options label {
    font-size: 12pt;
}

#options select {
    color: var(--text-color);
    width: 100%;
    font-size: 16pt;
    display: block;
    padding: 4px 8px;
    background-color: var(--foreground-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#options input {
    width: 18px;
    height: 18px;
}

/* -- extras -- */

#extras {
    display: flex;
    flex-direction: column;
    row-gap: 8px;
    font-size: 14pt;
}

#extras button {
    font-size: inherit;
    color: inherit;
    background-color: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    column-gap: 4px;
    transition: background-color 0.1s ease, color 0.1s ease;
}

#extras button svg {
    fill: var(--text-color);
    flex-shrink: 0;
    transition: fill 0.1s ease;
}

#extras button:hover {
    background-color: var(--extras-button-hover-color);
    color: var(--text-inverted-color);
}

#extras button:hover svg {
    fill: var(--text-inverted-color);
}

#extra-spacer {
    flex: 1;
}

#language-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#language-wrapper svg {
    fill: var(--text-color);
    position: absolute;
    left: 16px;
}

#language-picker {
    font-size: inherit;
    color: inherit;
    padding: 8px 16px 8px calc(16px + 24px + 4px);  /* left = padding+icon+spacing */
    cursor: pointer;
    background-color: transparent;
    border: none;
    z-index: 1;
}


/* -- howto modal -- */

#modal-howto h3 {
    font-size: 12pt;
}

#keybinds {
    list-style-type: none;
    font-size: 11pt;
}

#keybinds li {
    display: flex;
    flex-direction: row;
    padding: 8px 16px;
    align-items: center;
}

#keybinds li:first-of-type {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#keybinds li:last-of-type {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

#keybinds li:nth-child(odd) {
    background-color: var(--keybind-row-odd-color);
}

#keybinds li:nth-child(even) {
    background-color: var(--keybind-row-even-color);
}

#keybinds li > * {
    flex: 1;
}

.pc-key {
    display: inline-block;
    background-color: var(--pc-key-color);
    padding: 8px;
    min-width: 16px;
    text-align: center;
    border-radius: 4px;
    color: var(--pc-key-text-color);
    box-shadow: 0px -4px 0px 0px var(--pc-key-shadow-color) inset;
    user-select: none;
}

/* some pc-keys contain an svg instead */
.pc-key svg {
    width: 11pt;  /* match the font-size */
    height: 11pt;
    fill: var(--pc-key-text-color);
}

#down-arrow-icon {
    /* the icon itself is a bit too high. adjust it */
    position: relative;
    top: 2px;
}


/* -- about modal -- */

#modal-about-content {
    margin-bottom: 0;
}

#about-logo {
    width: 192px;
    height: 192px;
}

#about-separator {
    fill: var(--secondary-color);
    width: 32px;
    height: 32px;
}

#github-links {
    display: flex;
    flex-direction: row;
    column-gap: 32px;
}

.link {
    display: flex;
    flex-direction: row;
    align-items: center;
    border-radius: 8px;
    flex: 1;
    padding: 12px 24px;
}

.link > img,
.link > svg {
    width: 64px;
    height: 64px;
}

.link-info {
    display: flex;
    flex-direction: column;
    row-gap: 8px;
    flex: 1;
    text-align: center;
}

.link-info h2, .link-info p {
    margin: 0;
}

.link-info h2 {
    font-size: 14pt;
}

.link-info p {
    font-size: 11pt;
    opacity: 0.8;
}

.link-icon-wrapper {
    display: flex;
    align-content: center;
    text-align: right;
}

/* -- project link -- */

#link-project {
    background-color: black;
    color: white;
}

/* -- profile link -- */

#link-profile {
    background-color: #1e1f38;
    color: white;
}

#link-profile img {
    border-radius: 100%;
}

#link-profile #profile-name {
    font-family: monospace;
    color: #7dff7d;
}
