html {
    height: var(--mc-vvh, 100svh);
    max-height: var(--mc-vvh, 100svh);
    overflow: hidden;
    overscroll-behavior: none;
}

body.qwerty-page {
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    background-color: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: var(--mc-vvh, 100svh);
    height: var(--mc-vvh, 100svh);
    max-height: var(--mc-vvh, 100svh);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 920px;
    padding: 16px 20px;
    margin-inline: auto;
    flex-shrink: 0;
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 24px;
}

.subtitle {
    font-size: 10pt;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    color: #000000;
}

.title {
    font-family: "Dancing Script", cursive;
    font-weight: 700;
    color: #000000;
    font-size: 3em;
    margin: 0;
    line-height: 1.1;
}

.mode-selector {
    margin-bottom: 22px;
    width: 100%;
    max-width: min(340px, 100%);
}

.mode-selector select {
    width: 100%;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #000000;
    background-color: #ffffff;
    border: 2px solid #000000;
    border-radius: 5px;
    padding: 10px 42px 10px 16px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M7 9L0 0h14L7 9z' fill='%23000000'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 11px 7px;
    transition: background-color 0.2s, color 0.2s;
}

.mode-selector select:hover {
    background-color: #000000;
    color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M7 9L0 0h14L7 9z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.mode-selector select:focus {
    outline: none;
}

.mode-selector select:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

.mode-selector select option {
    font-family: Arial, sans-serif;
    font-weight: 600;
    background-color: #ffffff;
    color: #000000;
}

.keyboard-outer {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    display: flex;
    justify-content: center;
    padding: 0;
}

.keyboard {
    display: flex;
    justify-content: center;
    align-items: center;
    width: max-content;
    margin-inline: auto;
    height: auto;
    flex-shrink: 0;
    padding: 28px 24px 20px;
}

.key-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.key-caption {
    margin-top: 12px;
    font-family: "Noto Music", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #c0c0c0;
    line-height: 1;
    pointer-events: none;
}

.key {
    display: inline-block;
    flex-shrink: 0;
    width: 60px;
    height: 200px;
    margin: 5px;
    color: #ffffff;
    text-align: center;
    line-height: 200px;
    font-size: 24px;
    font-family: "Noto Music", Arial, sans-serif;
    font-weight: 700;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    position: relative;
    scale: 1;
    transform-origin: 50% 100%;
    transition: scale 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s, box-shadow 0.2s;
}

.color-0 { background-color: #F46C3F; }
.color-1 { background-color: #e36f46; }
.color-2 { background-color: #e3c33b; color: #222; }
.color-3 { background-color: #8BC34A; color: #222; }
.color-4 { background-color: #22b4be; }
.color-6 { background-color: #5B8DEF; }
.color-7 { background-color: #9B59B6; }
.color-8 { background-color: #FF5C8A; }
.color-9 { background-color: #FF8C42; }
.color-10 { background-color: #1D929A; }

@media (hover: hover) and (pointer: fine) {
    .key:hover {
        scale: 1.1;
        z-index: 2;
    }
}

.key.active {
    scale: 1.1;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
    z-index: 2;
}

.key span,
.key .note {
    display: block;
    white-space: nowrap;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
}

.key .note {
    display: none;
}

.key.show-note .note {
    display: block;
}

.key.show-note span {
    display: none;
}

body.qwerty-page > p.note {
    color: #000000;
    margin-top: 10px;
    font-size: 12px;
    display: none;
}

@media (max-width: 767px) {
    .subtitle { font-size: 8pt; }
    .title { font-size: 2em; }
    .title-container { margin-bottom: 16px; }

    body.qwerty-page .container {
        display: none;
    }

    body.qwerty-page > p.note {
        display: block;
        font-size: 12px;
        text-align: center;
        color: #000000;
        padding: 0 20px;
    }
}
