* {
    user-select: none;
    transition: filter 1s ease-in-out, opacity 1s ease-in-out, color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: var(--nb-canvas);
}

body > .navbar {
    width: 100%;
    flex-shrink: 0;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

#mainTitle {
    background: -webkit-linear-gradient(#000000, #7a7a7a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    display: flex;
    flex-direction: column; /* Alinea los elementos en una columna */
    align-items: center;    /* Centra los elementos horizontalmente */
    justify-content: center; /* Centra los elementos verticalmente */
    text-align: center;     /* Alinea el texto al centro */
}

.checkbox-container {
    display: flex;
    flex-direction: row; /* Alinea los checkboxes en fila */
    align-items: center;  /* Centra los checkboxes verticalmente */
    justify-content: center; /* Centra los checkboxes horizontalmente */
    gap: 10px;
}

.showHideTransition {
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
}

.showHideTransition.show {
    opacity: 1;
}

#answerContainer, #userAnswerContainer {
    background: rgba(255, 255, 255, .75);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    border-radius: 60px;
    corner-shape: squircle;
}

.scroll {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

.title-note {
    margin-left: 10px;
    margin-right: 10px;
    /*color: var(--nb-accent);*/
    background: -webkit-linear-gradient(var(--nb-accent), var(--nb-accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.answerNote {
    cursor: pointer;
}

.card {
    border-width: 0px;
    background-color: var(--nb-surface);
    border-radius: 20px;
    margin-bottom: 10px;
}

.card-header, .card-header:first-child {
    border-width: 0px;
    /* Was #b1b1b1  2.03:1 on this paper, a WCAG failure and, with nine
       cards side by side, the reason there was nothing to scan the panel by.
       Muted Slate reads at 4.98:1 and is already the palette's caption
       colour. The header stays quiet through weight and placement, not
       through being too faint to read. */
    color: var(--nb-ink-muted);
    background-color: var(--nb-surface);
    font-weight: bold;
    text-align: start;
    border-radius: 60px !important;
    corner-shape: squircle;
}

.card-body {
    border-width: 0px;
    background-color: var(--nb-surface);
    text-align: start;
    padding-top: 0px;
    border-radius: 30px !important;
    corner-shape: squircle;
}

a {
    color: azure;
}

button {
    margin: .25rem .125rem;
    corner-shape: squircle;
    border-radius: 3rem !important;
}

.toggleButton {
    border-radius: 60px;
    corner-shape: squircle;
}

#footerInfo {
    background: -webkit-linear-gradient(left, var(--nb-accent), #14aaca);
    box-shadow: 0 0 15px rgba(83, 83, 83, 0.68);
    corner-shape: squircle;
    border-radius: 2rem !important;
}

.highlight-note {
    animation-name: highlight-note-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

.highlight-note-path {
    animation-name: highlight-path-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease;
}

.highlight-text-shadow {
    animation-name: highlight-text-shadow-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease;
}

.highlight-text-color {
    animation-name: highlight-text-color-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

.highlight-answer-text-shadow {
    animation-name: highlight-answer-text-shadow-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease;
    display: inline-block;
}

.highlight-answer-text-color {
    animation-name: highlight-answer-text-color-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

.muzieknootjes {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0px solid #000000;
    z-index: 50;
    pointer-events: none;
    overflow: hidden;
}

/* The floating notes are Unicode "Musical Symbols" (U+1D100 block) plus
   flat, natural and sharp. Windows draws them with Segoe UI Symbol; macOS
   and iOS have no font that covers the block, so Safari showed boxes or
   stand-ins. Noto Music (SIL OFL, public/fonts/noto-music-OFL.txt) is
   served from our own origin, as the CSP's font-src asks, and only for
   these characters, so pages without a floating note never fetch it. */
@font-face {
    font-family: 'Noto Music';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(/fonts/noto-music.woff2) format('woff2');
    unicode-range: U+2669-266F, U+1D100-1D126, U+1D129-1D1EA;
}

.noot {
    position: absolute;
    animation: notes 4s infinite linear;
    font-size: 35px;
    opacity: 0;
    color: deepskyblue;
    font-family: 'Noto Music', 'Segoe UI Symbol', 'Apple Symbols', serif;
    font-style: normal;
    font-weight: 400;
    /* Text glyphs, never Apple's colour emoji for the same code point. */
    font-variant-emoji: text;
    line-height: 1;
}

/* The revealed answer writes rests as the same Unicode symbols. Noto Music
   comes last, so letters keep the body font and only the glyphs the system
   lacks (all of them on Apple devices) are drawn with it. */
.answerNote {
    font-family: var(--bs-body-font-family), 'Noto Music';
}

.noot-1 {
    top: 60%;
    left: 10%;
    animation-delay: 0.5s;
}

.noot-2 {
    top: 20%;
    left: 30%;
    animation-delay: 1s;
}

.noot-3 {
    top: 50%;
    left: 60%;
    animation-delay: 1.5s;
}

.noot-4 {
    top: 35%;
    left: 90%;
    animation-delay: 2s;
}

.noot-5 {
    top: 70%;
    left: 70%;
    animation-delay: 2.5s;
}

@keyframes notes {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0;
    }
    50% {
        opacity: 1;
        transform: scale(1.5) translate(50%, -50%);
    }
    80% {
        opacity: 0;
        transform: scale(1.5) translate(100%, -100%);
    }
    100% {
        transform: scale(1.5) translate(100%, -100%);
        opacity: 0;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes highlight-note-animation {
    0% {
        filter: drop-shadow(0px 0px 0px transparent);
    }
    50% {
        filter: drop-shadow(2px 4px 6px black);
    }
    100% {
        filter: drop-shadow(0px 0px 0px transparent);
    }
}

@keyframes highlight-path-animation {
    0% {
        stroke: black;
        fill: black;

    }
    50% {
        stroke: var(--nb-accent);
        fill: var(--nb-accent);

    }
    100% {
        stroke: black;
        fill: black;
    }
}

@keyframes highlight-text-shadow-animation {
    0% {
        filter: drop-shadow(0px 0px 0px transparent);
        stroke: black;
        fill: black;
    }
    50% {
        filter: drop-shadow(2px 4px 6px black);
        stroke: var(--nb-accent);
        fill: var(--nb-accent);
    }
    100% {
        filter: drop-shadow(0px 0px 0px transparent);
        stroke: black;
        fill: black;
    }
}

@keyframes highlight-text-color-animation {
    0% {
        stroke: black;
        fill: black;
    }
    50% {
        stroke: var(--nb-accent);
        fill: var(--nb-accent);
    }
    100% {
        stroke: black;
        fill: black;
    }
}

@keyframes highlight-answer-text-shadow-animation {
    0% {
        filter: drop-shadow(0px 0px 0px transparent);
        color: black;
        transform: translateY(0);
    }
    50% {
        filter: drop-shadow(2px 4px 6px black);
        color: var(--nb-accent);
        transform: translateY(-5px);
    }
    100% {
        filter: drop-shadow(0px 0px 0px transparent);
        color: black;
        transform: translateY(0);
    }
}

@keyframes highlight-answer-text-color-animation {
    0% {
        color: black;
    }
    50% {
        color: var(--nb-accent);
    }
    100% {
        color: black;
    }
}

.semibreveAnswer {
    font-weight: bold;
}

.minimAnswer {
    font-style: italic;
}

.crotchetAnswer {

}

.quaverAnswer {
    text-decoration: underline;
}

.semiquaverAnswer {
    text-decoration-line: underline;
    text-decoration-style: double;
}

/* A dotted note: the augmentation dot right after its name. Inline-block so
   the figure's underline does not run under it. */
.answerDot {
    display: inline-block;
    margin-left: .08em;
    font-size: .45em;
    vertical-align: .35em;
    text-decoration: none;
}

/* A triplet: its three names under a bracket with a 3, as in the score. */
.answerTriplet {
    position: relative;
    display: inline-block;
    margin-top: .8em;
    padding: .15em .2em 0;
    line-height: 1.2;
}
.answerTriplet::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: .35em;
    border: 2px solid currentColor;
    border-bottom: 0;
    pointer-events: none;
}
.answerTriplet::before {
    content: "3";
    position: absolute;
    top: -1.15em;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    font-size: .55em;
    font-style: italic;
    font-weight: 700;
    line-height: 1;
}

.form-range::-webkit-slider-thumb:active {
    background-color: #ffffff;
}
.form-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 0.5rem;
    color: transparent;
    cursor: pointer;
    background-color: #ffffff;
    border-color: transparent;
    border-radius: 1rem;
}

.form-range::-webkit-slider-thumb {
    background-color: var(--nb-accent);
}

li {
    margin:0;
    padding:0;
    list-style:none;
    position:relative;
    float:left;
}

ul.piano .white {
    height:10em; width:4em; z-index:1;
    border-left:1px solid #bbb;
    border-bottom:1px solid #bbb;
    border-radius:0 0 30px 30px;
    corner-shape: squircle;
    box-shadow:-1px 0 0 rgba(255,255,255,0.8) inset, 0 0 5px #ccc inset, 0 0 3px rgba(0,0,0,0.2);
    background: linear-gradient(to bottom, #eee 0%,#fff 100%);
}

ul.piano .white:active, ul.piano .white.activated {
    border-top:1px solid #777;
    border-left:1px solid #999;
    border-bottom:1px solid #999;
    box-shadow:2px 0 3px rgba(0,0,0,0.1) inset, -5px 5px 20px rgba(0,0,0,0.2) inset,0 0 3px rgba(0,0,0,0.2);
    background: linear-gradient(to bottom, #fff 0%,#e9e9e9 100%);
}

.black {
    height:5em; width:2em; margin:0 0 0 -1em; z-index:2;
    border:1px solid #000;
    border-radius:0 0 18px 18px;
    corner-shape: squircle;
    box-shadow:-1px -1px 2px rgba(255,255,255,0.2) inset, 0 -5px 2px 3px rgba(0,0,0,0.6) inset, 0 2px 4px rgba(0,0,0,0.5);
    background:linear-gradient(45deg, #222 0%,#555 100%);
}

.black:active {
    box-shadow:-1px -1px 2px rgba(255,255,255,0.2) inset, 0 -2px 2px 3px rgba(0,0,0,0.6) inset, 0 1px 2px rgba(0,0,0,0.5);
    background:linear-gradient(to bottom, #444 0%,#222 100%);
}

.piano {
    padding-left: 16px;
}

#octaveSelector .octave-btn {
    border-radius: 50% !important;
    width: 2.5em;
    height: 2.5em;
    padding: 0;
    font-weight: bold;
    margin: 0 0.2em;
}

.a,.g,.d,.c,.e,.b { margin:0 0 0 -1em;  }

ul.piano li:first-child {
    border-radius:30px 0 30px 30px;
    corner-shape: squircle;
}
ul.piano li:last-child {
    border-radius:0 30px 30px 30px;
    corner-shape: squircle;
}

.keyText {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translate(-50%, 0%);
    /* Was var(--nb-accent)  1.96:1 against the key face. These letters name the note
       under the finger on the app's signature control, so they are a label,
       not ornament, and the palette's own test sends them to teal (5.53:1). */
    color: var(--nb-primary);
    font-weight: bold;
    user-select: none;
}

.figureButtonLabel {
    align-content: end;
    display: inline-block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    background: white;
}

.figureButtonLabel:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.key {
    transform-origin:top center;
    display: inline-block;
    transition: transform 0.3s ease;
    z-index: 1;
}

.key.black {
    z-index: 5;
}

.key:hover, .key.hovered {
    transform: scale(1.05);
}

.key.white:hover, .key.white.hovered {
    z-index: 2;
}

/* ── Note-selection mini piano ─────────────────────────────────────────────── */
ul.note-sel-piano {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: flex-start;
    flex: 1;
    width: 0;
}

ul.note-sel-piano > li {
    position: relative;
    flex: 1;
}

ul.note-sel-piano input[type=checkbox] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

ul.note-sel-piano .ns-white {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 5.5em;
    padding-bottom: 3px;
    border: 1px solid #bbb;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(to bottom, #eee 0%, #fff 100%);
    box-shadow: -1px 0 0 rgba(255,255,255,0.8) inset, 0 0 3px #ccc inset;
    cursor: pointer;
    font-size: 0.55rem;
    font-weight: bold;
    color: var(--nb-accent);
    user-select: none;
    transition: background 0.15s, color 0.15s;
    position: relative;
    z-index: 1;
}

ul.note-sel-piano .ns-black {
    display: block;
    width: 55%;
    height: 1.7rem;
    background: linear-gradient(45deg, #222 0%, #555 100%);
    border: 1px solid #000;
    border-radius: 0 0 8px 8px;
    box-shadow: -1px -1px 2px rgba(255,255,255,0.2) inset, 0 -3px 2px 2px rgba(0,0,0,0.6) inset;
    cursor: pointer;
    position: absolute;
    z-index: 2;
    top: 0;
    right: -27.5%;
    transition: background 0.15s;
}

ul.note-sel-piano > li:first-child .ns-white {
    border-top-left-radius: 6px;
}

ul.note-sel-piano > li:last-child .ns-white {
    border-top-right-radius: 6px;
}

ul.note-sel-piano input:checked + .ns-white {
    background: linear-gradient(to bottom, var(--nb-accent) 0%, var(--nb-accent-deep) 100%);
    color: #fff;
    border-color: var(--nb-accent-deep);
}

ul.note-sel-piano input:checked + .ns-black {
    background: linear-gradient(to bottom, var(--nb-accent) 0%, var(--nb-accent-deep) 100%);
    border-color: var(--nb-accent-deep);
}

.note-correct {
    animation-name: note-correct-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes note-correct-animation {
    0% {
        background: white;
    }
    50% {
        background: #a5ffa4;
    }
    100% {
        background: white;
    }
}

.note-error {
    animation-name: note-error-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes note-error-animation {
    0% {
        background: white;
    }
    50% {
        background: #ffcb67;
    }
    100% {
        background: white;
    }
}

.figure-correct {
    animation-name: figure-correct-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes figure-correct-animation {
    0% {
        background: var(--nb-accent);
    }
    50% {
        background: #a5ffa4;
    }
    100% {
        background: var(--nb-accent);
    }
}

.figure-error {
    animation-name: figure-error-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes figure-error-animation {
    0% {
        background: var(--nb-accent);
    }
    50% {
        background: #ffcb67;
    }
    100% {
        background: var(--nb-accent);
    }
}

.figure-buttons-error {
    animation-name: figure-buttons-error-animation;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes figure-buttons-error-animation {
    0% {
        filter: drop-shadow(0px 0px 0px transparent);
    }
    50% {
        filter: drop-shadow(0px 0px 25px #f18e09);
    }
    100% {
        filter: drop-shadow(0px 0px 0px transparent);
    }
}

/* Was the accent cyan: 1.96:1 against white, on sixty-one controls whose whole
   job is to show whether they are on. The Two Blues Rule decides it  a thing
   that can be clicked wears the deep teal  and WCAG 1.4.11 wants 3:1 for the
   state of a UI component, which cyan never reached. */
.form-check-input:checked {
    background-color: var(--nb-primary);
    border-color: var(--nb-primary);
}

/* Selected note highlight in user answer pentagram */
g.vf-stavenote.vf-selected path,
g.vf-stavenote.vf-selected rect {
    fill: #1e40af;
    stroke: #1e40af;
}

.card {
    transform-origin:top center;
    /* No display override. It used to be inline-block, which shrinks a card to
       its own content and lets the surrounding text-align place it: on a phone,
       where each settings card has a column to itself, they came out five
       different widths, each centred on its own, and the controls inside sat
       visibly off to one side. Bootstrap's own display — a block-level flex
       column — fills the column, which is what a card in a grid should do.
       The hover transform works the same either way. */
    transition: transform 0.6s ease-out, box-shadow 0.6s ease-out;
}

.card:hover {
    box-shadow: 0 0 25px rgba(83, 83, 83, 0.68);
}


::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: #9fe3f3;
    border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #60d2e3;
}

.highlight-correct-answer-text-color {
    animation-name: highlight-correct-answer-text-color-animation;
    animation-duration: 0.5s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes highlight-correct-answer-text-color-animation {
    0% {
        stroke: black;
        fill: black;
    }
    100% {
        stroke: var(--nb-answer-correct);
        fill: var(--nb-answer-correct);
    }
}

.highlight-correct-answer-text {
    stroke: var(--nb-answer-correct);
    fill: var(--nb-answer-correct);
}

.highlight-wrong-answer-text-color {
    animation-name: highlight-wrong-answer-text-color-animation;
    animation-duration: 0.5s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes highlight-wrong-answer-text-color-animation {
    0% {
        stroke: black;
        fill: black;
    }
    100% {
        stroke: var(--nb-answer-wrong);
        fill: var(--nb-answer-wrong);
    }
}

.highlight-wrong-answer-text {
    stroke: var(--nb-answer-wrong);
    fill: var(--nb-answer-wrong);
}

.highlight-correct-answer-note-path {
    animation-name: highlight-correct-answer-path-animation;
    animation-duration: 0.5s;
    animation-iteration-count: 1;
    animation-timing-function: ease;
}

@keyframes highlight-correct-answer-path-animation {
    0% {
        stroke: black;
        fill: black;

    }
    100% {
        stroke: #3DA53CFF;
        fill: #3DA53CFF;

    }
}

.highlight-correct-answer-end-path {
    stroke: var(--nb-answer-correct);
    fill: var(--nb-answer-correct);
}

.highlight-wrong-answer-note-path {
    animation-name: highlight-wrong-answer-path-animation;
    animation-duration: 0.5s;
    animation-iteration-count: 1;
    animation-timing-function: ease;
}

@keyframes highlight-wrong-answer-path-animation {
    0% {
        stroke: black;
        fill: black;

    }
    100% {
        stroke: var(--nb-answer-wrong);
        fill: var(--nb-answer-wrong);

    }
}

.highlight-wrong-answer-end-path {
    stroke: var(--nb-answer-wrong);
    fill: var(--nb-answer-wrong);
}

#feedbackContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    left: 10px;
    bottom: 10px;
    /*transform: translate(-50%, -50%);*/
    /*height: 100px;*/
    /*width: 100px;*/
    z-index: 110;
}

#metronomeContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    right: 100px;
    bottom: 100px;
    /*transform: translate(-50%, -50%);*/
    /*height: 100px;*/
    /*width: 100px;*/
    pointer-events: none;
    z-index: 110;
}

.metronome {
    position: absolute;
    border-radius: 50%;
}

.metronome-animation {
    animation: metronome-animation-4 4s infinite;
}

.metronome:nth-child(1) {
    width: 40px;
    height: 40px;
    animation: metronome-animation-4 4s infinite;
    animation-delay: 0.1s;
    z-index: 90;
    background-color: rgba(13, 202, 240, 0.84);
}

.metronome:nth-child(2) {
    width: 30px;
    height: 30px;
    animation: metronome-animation-4 4s infinite;
    animation-delay: 0.1s;
    z-index: 91;
    background-color: rgba(10, 154, 181, 0.73);
}

.metronome:nth-child(3) {
    width: 20px;
    height: 20px;
    animation: metronome-animation-4 4s infinite;
    animation-delay: 0.2s;
    z-index: 92;
    background-color: rgba(15, 98, 115, 0.61);
}

@keyframes metronome-animation-4 {
    0% {
        transform: translate(0, 200%);
    }
    25% {
        transform: translate(-200%, 0);
    }
    50% {
        transform: translate(200%,0);
    }
    75% {
        transform: translate(0, -200%);
    }
    100% {
        transform: translate(0, 200%);
    }
}

@keyframes metronome-animation-2 {
    0% {
        transform: translate(0, 200%);
    }
    50% {
        transform: translate(0, -200%);
    }
    100% {
        transform: translate(0, 200%);
    }
}

@keyframes metronome-animation-3 {
    0% {
        transform: translate(0, 200%);
    }
    33% {
        transform: translate(200%, 0);
    }
    66% {
        transform: translate(0, -200%);
    }
    100% {
        transform: translate(0, 200%);
    }
}

@keyframes metronome-animation-6 {
    0% {
        transform: translate(0, 200%);
    }
    /*16% {*/
    /*    transform: translate(200%, 200%);*/
    /*}*/
    33% {
        transform: translate(200%, 0);
    }
    66% {
        transform: translate(0, -200%);
    }
    100% {
        transform: translate(0, 200%);
    }
}

@keyframes metronome-animation-9 {

    0% {
        transform: translate(0, 200%);
    }
    33% {
        transform: translate(200%, 0);
    }
    66% {
        transform: translate(0, -200%);
    }
    100% {
        transform: translate(0, 200%);
    }
}

@keyframes metronome-animation-12 {

    0% {
        transform: translate(0, 200%);
    }
    33% {
        transform: translate(200%, 0);
    }
    66% {
        transform: translate(0, -200%);
    }
    100% {
        transform: translate(0, 200%);
    }
}

.gradient-background {
    position: relative;
    box-shadow: inset 0 0 5em rgba(0,0,0,.5);
}

.gradient-background::before {
    content: '';
    position: fixed;
    inset: 0;
    width: 600%;
    background-image: linear-gradient(to right, var(--nb-dawn-sand), var(--nb-dawn-sky), var(--nb-dawn-leaf), var(--nb-dawn-clay), var(--nb-dawn-sand));
    will-change: transform;
    animation: gradients 100s linear infinite;
    z-index: -1;
}

.background-help {
    /*background: #dcc7af !important;*/
    /*transition: background 0.5s ease-in-out, filter 0.5s ease-in-out;*/
}

@keyframes gradients {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-83.33%); }
}

.tooltip-inner {
    background-color: var(--nb-primary-tooltip);
}

.bs-tooltip-top .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
    border-top-color: var(--nb-primary-tooltip) !important;
}

.bs-tooltip-bottom .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
    border-bottom-color: var(--nb-primary-tooltip) !important;
}

.bs-tooltip-left .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before {
    border-left-color: var(--nb-primary-tooltip) !important;
}

.bs-tooltip-right .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
    border-right-color: var(--nb-primary-tooltip) !important;
}

.glow-effect {
    -webkit-box-shadow:0px 0px 0px 9px var(--nb-surface), 0px 0px 8px 15px rgba(48, 179, 184, 0.9);
    -moz-box-shadow: 0px 0px 0px 9px var(--nb-surface), 0px 0px 8px 15px rgba(48, 179, 184, 0.9);
    box-shadow: 0px 0px 0px 9px var(--nb-surface), 0px 0px 8px 15px rgba(48, 179, 184, 0.9);

    corner-shape: squircle;
    border: 0px solid rgba(48, 179, 184, 0.9); /* Adjust thickness and color */
    border-radius: 15px; /* Adjust for desired roundness */
    /*padding: 10px; !* Optional: adds space between the border and content *!*/
    box-sizing: border-box; /* Ensures padding and border are included in the element's total width and height */

    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.block-mouse:hover {
    cursor: help !important;
}
.block-mouse:active {
    pointer-events: none !important;
    cursor: help  !important;
}

.opacity-50 {
    filter: alpha(opacity=50);
    transition: opacity 0.5s ease-in-out;
}

.opacity-100 {
    filter: alpha(opacity=100) !important;
    transition: opacity 0.5s ease-in-out;
}

.hue-help {
    filter: hue-rotate(215deg);
    transition: filter 0.5s ease-in-out;
}

.versionText {
    color: #777777;
}

/* ── Google sign-in button ───────────────────────────────────────────────── */
.btn-google {
    background-color: #fff;
    color: #444;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
}

.btn-google:hover {
    background-color: #f7f7f7;
    border-color: #bbb;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,.18);
}

.google-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

#userAuthArea {
    font-size: 0.8rem;
}

#userAvatar {
    object-fit: cover;
}

/* ── Songs UI ────────────────────────────────────────────────────────────── */
#songsRow {
    margin-top: 0.4rem;
}

#mySongsModal .modal-content {
    border-radius: 1rem;
    overflow: hidden;
}

#mySongsModal .modal-header {
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    border-bottom: none;
}

#songsList .list-group-item {
    padding: 0.75rem 1rem;
    transition: background-color 0.15s ease;
}

#songsList .list-group-item:hover {
    background-color: #f0fbff;
}

.song-item-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* ── Song list items (shared between app modal and library) ── */
.song-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .75rem;
    transition: background .15s;
}
.song-item:hover { background: #f0f7ff; }
.song-item .song-info { flex: 1; min-width: 0; overflow: hidden; }
.song-item .song-info .fw-semibold {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.song-item .song-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.song-item .song-actions .btn { padding: .2rem .4rem; font-size: .78rem; }

@view-transition {
    navigation: auto;
}
/* �"��"� Button roles �"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"�
   The dictation page spent nine Bootstrap variants across thirty-nine
   buttons, so hue carried no information: "Solve song", "All", "Connect
   MIDI" and "Reset" all shared one cyan while the action that starts
   everything was green. These five roles replace that. Colour now answers
   one question � what does pressing this do to my exercise?

   Built on Bootstrap 5.3's --bs-btn-* variables rather than on new rules, so
   every role inherits the existing hover, active, focus-ring and disabled
   machinery and only the colours change.

   Every outline role carries an OPAQUE white ground. The page background is
   a gradient in permanent motion, and measured against its five stops no
   outline text clears 4.5:1 unaided � var(--nb-primary) lands between 3.39:1 and
   4.59:1 depending which stop is passing behind. A translucent ground would
   make legibility depend on the animation frame; an opaque one cannot. The
   landing page's outline button already solved it this way.
   ���������������������������������������������������������������������������������������������������������������������������������������������������� */

/* Advance � the two actions that move the student forward: generate an
   exercise, mark an answer. The only filled teal on the page. They never
   compete, because the page already disables whichever one is not live. */
.btn-advance {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--nb-primary);
    --bs-btn-border-color: var(--nb-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nb-primary-pressed);
    --bs-btn-hover-border-color: var(--nb-primary-pressed);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary-pressed);
    --bs-btn-active-border-color: var(--nb-primary-deep);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--nb-primary-disabled);
    --bs-btn-disabled-border-color: var(--nb-primary-disabled);
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}

/* Assist � reversible helpers on the exercise you already have: hear it
   again, stop it, play the rhythm, take one note back. Nothing here costs
   the student anything, so nothing here is red. */
.btn-assist {
    --bs-btn-color: var(--nb-primary);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--nb-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nb-primary);
    --bs-btn-hover-border-color: var(--nb-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary-pressed);
    --bs-btn-active-border-color: var(--nb-primary-pressed);
    --bs-btn-disabled-color: var(--nb-primary-disabled);
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #d7e2e6;
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}

/* Utility � settings plumbing: All, None, Save, Load, Reset, Connect MIDI,
   Help. These must be findable and must never be the loudest thing on
   screen, so they are slate until touched and teal once they are. */
.btn-utility {
    --bs-btn-color: var(--nb-ink-muted);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--nb-border-faint);
    --bs-btn-hover-color: var(--nb-primary);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: var(--nb-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary);
    --bs-btn-active-border-color: var(--nb-primary);
    --bs-btn-disabled-color: #adb5bd;
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #e9ecef;
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}

/* Concede � the solve ladder. Amber rather than teal because revealing an
   answer is not progress, and this is the same family as the colour a
   revealed note turns on the staff.

   The three steps lose weight as they cost more: Solve note is bordered and
   obvious, Solve measure is faint, Solve song carries no border at all. A
   stuck student should meet the smallest help first, so the smallest help is
   the easiest to reach for. The text colour never changes, so the ladder
   still reads as one group. */
.btn-concede {
    --bs-btn-color: var(--nb-concede);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nb-concede);
    --bs-btn-hover-border-color: var(--nb-concede);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-concede-pressed);
    --bs-btn-active-border-color: var(--nb-concede-pressed);
    --bs-btn-disabled-color: var(--nb-concede-disabled);
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: transparent;
    --bs-btn-focus-shadow-rgb: 154, 74, 6;
}
.btn-concede-1 { --bs-btn-border-color: var(--nb-concede); }
.btn-concede-2 { --bs-btn-border-color: var(--nb-concede-border-soft); }

/* Destructive � one button on the page genuinely throws work away. It is the
   only red, so red still means something. */
.btn-destructive {
    --bs-btn-color: var(--nb-destructive);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--nb-destructive);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nb-destructive);
    --bs-btn-hover-border-color: var(--nb-destructive);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-destructive-pressed);
    --bs-btn-active-border-color: var(--nb-destructive-pressed);
    --bs-btn-disabled-color: var(--nb-destructive-disabled);
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #eed6d8;
    --bs-btn-focus-shadow-rgb: 176, 42, 55;
}

/* ���� Toggles ����������������������������������������������������������������������������������������������������������������������������
   btn-info / btn-outline-info is already this codebase's on/off pair �
   logic.js and editor.js swap between them for octave, rest, dot, triplet
   and tie. Kept as the pair it is and only recoloured, so no script
   changes: on is the brand teal, off recedes to slate. Every plain action
   button that was borrowing btn-info has moved to a role above, so the pair
   now means selection and nothing else. */
.btn-info {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--nb-primary);
    --bs-btn-border-color: var(--nb-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nb-primary-pressed);
    --bs-btn-hover-border-color: var(--nb-primary-pressed);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary-pressed);
    --bs-btn-active-border-color: var(--nb-primary-deep);
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}
.btn-outline-info {
    --bs-btn-color: var(--nb-ink-muted);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--nb-border-faint);
    --bs-btn-hover-color: var(--nb-primary);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: var(--nb-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary);
    --bs-btn-active-border-color: var(--nb-primary);
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}

/* ���� Bootstrap defaults that were never chosen ��������������������������������������������������������
   #0d6efd shipped on the nav Sign in button, Save song, the library and the
   consent bar simply because nobody overrode it. Remapping the variant here
   rather than editing each call site fixes every page at once. */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--nb-primary);
    --bs-btn-border-color: var(--nb-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nb-primary-pressed);
    --bs-btn-hover-border-color: var(--nb-primary-pressed);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary-pressed);
    --bs-btn-active-border-color: var(--nb-primary-deep);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--nb-primary-disabled);
    --bs-btn-disabled-border-color: var(--nb-primary-disabled);
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}
.btn-outline-primary {
    --bs-btn-color: var(--nb-primary);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--nb-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nb-primary);
    --bs-btn-hover-border-color: var(--nb-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary-pressed);
    --bs-btn-active-border-color: var(--nb-primary-pressed);
    --bs-btn-disabled-color: var(--nb-primary-disabled);
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #d7e2e6;
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}
.btn-secondary, .btn-outline-secondary {
    --bs-btn-color: var(--nb-ink-muted);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--nb-border-faint);
    --bs-btn-hover-color: var(--nb-primary);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: var(--nb-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nb-primary);
    --bs-btn-active-border-color: var(--nb-primary);
    --bs-btn-disabled-color: #adb5bd;
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #e9ecef;
    --bs-btn-focus-shadow-rgb: 26, 110, 138;
}

/* ���� Note-selection keyboard ��������������������������������������������������������������������������������������������
   Both states of this control failed contrast: the letters measured 1.96:1
   unselected (var(--nb-accent) on a near-white key) and 1.96:1 again selected (white
   on that same cyan). Cyan is the ornament colour and cannot carry a label,
   and these letters name the note being switched on, which makes them the
   most load-bearing text on the app's smartest control. Teal takes the two
   states to 5.53:1 and 7.81:1.

   NOTE: these labels are still 0.55rem (8.8px), under the 11px floor. Left
   alone here because the keys are narrow and a size change needs checking at
   phone width, which this pass could not render. */
ul.note-sel-piano .ns-white { color: var(--nb-primary); }
ul.note-sel-piano input:checked + .ns-white {
    background: linear-gradient(to bottom, var(--nb-primary) 0%, var(--nb-primary-pressed) 100%);
    border-color: var(--nb-primary-pressed);
}
ul.note-sel-piano input:checked + .ns-black {
    background: linear-gradient(to bottom, var(--nb-primary) 0%, var(--nb-primary-pressed) 100%);
    border-color: var(--nb-primary-pressed);
}

/* ���� Failure, told calmly ��������������������������������������������������������������������������������������������������
   Replaces two window.alert() calls and a #error div that carried .d-none
   and was never un-hidden, so notation failures were written somewhere
   nobody could see.

   Not red. A generator that cannot be reached is not the student's mistake,
   and the audience includes ten-year-olds practising alone; an alarm here
   would add exactly the tension this interface exists without. Red stays
   reserved for the one control that throws work away.

   Opaque white, like every other surface that floats over the moving
   gradient � a translucent panel would make its own text legibility depend
   on which gradient stop is passing behind it. */
.app-status {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    max-width: 34rem;
    margin: 1rem auto 0;
    padding: .85rem 1.25rem;
    background: #fff;
    border-radius: 30px;
    corner-shape: squircle;
    text-align: start;
    /* The one shadow here is doing what the elevation doctrine allows: this
       panel genuinely arrives above the page rather than sitting in it. */
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.app-status-icon {
    flex: 0 0 auto;
    font-size: 1.35rem;
    /* Teal, not amber or red. The icon carries the meaning alongside the
       words so the panel never depends on colour alone. */
    color: var(--nb-primary);
}

.app-status-text {
    flex: 1 1 14rem;
    min-width: 0;
}

.app-status-text strong {
    display: block;
    color: var(--nb-ink);
    line-height: 1.3;
}

#appStatusDetail {
    display: block;
    font-size: .875rem;
    color: var(--nb-ink-muted);
    line-height: 1.45;
    /* German runs about a third longer than English and these are full
       sentences, so the panel grows rather than truncating. */
    overflow-wrap: break-word;
}

#appStatusRetry {
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .app-status {
        margin-inline: 1rem;
        padding: .85rem 1rem;
    }
    /* On a phone the button drops to its own row and spans it, so it clears
       the 44px touch target instead of being squeezed beside the text. */
    #appStatusRetry {
        flex: 1 0 100%;
    }
}

/* ���� Reduced motion ��������������������������������������������������������������������������������������������������������������
   This stylesheet had no @media rule of any kind, so the background gradient
   (100s, infinite) and the floating notes (4s, infinite, over the whole
   viewport) animated for everyone � including the readers who ask their
   system not to. The four guards that existed lived in the Learn pages and
   never reached the dictation page, the editor or the library.

   Both animations are ornament: the gradient still reads as the same warm
   wash when it stops, and the notes rest at opacity 0, so switching their
   animation off removes them rather than freezing them mid-flight. Nothing
   here is load-bearing, which is exactly why none of it should move for
   someone who asked for stillness. */
@media (prefers-reduced-motion: reduce) {
    .gradient-background::before {
        animation: none;
    }

    .noot {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }

    /* The global rule at the top of this file transitions colour, background,
       border and shadow on every element for .15s, and filter and opacity for
       a full second. A second is long enough to feel like waiting, so the slow
       pair is shortened  but only that pair, and only transitions.

       An earlier version of this block clamped every animation on the page to
       .01ms as well. That killed fifteen feedback classes: highlight-note,
       highlight-path, figure-correct-animation, figure-error-animation and the
       rest  the animations that show which note is playing and whether an
       answer was right. Combined with feedback that is already carried by
       colour, a reduced-motion reader lost both channels at once. What people
       who ask for less motion are avoiding is large-area continuous movement,
       not a one-second colour change on a notehead. */
    *, *::before, *::after {
        transition-duration: .15s !important;
    }
}

/* ���� The marking, in words ������������������������������������������������������������������������������������������������
   A wrong dictation used to produce a buzzer and a colour on the noteheads
   and nothing else, in a product whose stated purpose is a student who can
   take a dictation they could not take before.

   Teal, never red, and never green either. This is a practice exercise, not
   a mark: the colour of the panel should not be the thing that tells you how
   you did � the sentence does that. Colour here only separates the verdict
   from the score it sits under. */
.answer-verdict {
    margin: 0 .75rem .75rem;
    padding: .65rem .9rem;
    background: #fff;
    border-radius: 30px;
    corner-shape: squircle;
    text-align: center;
}

.answer-verdict-score {
    margin: 0;
    font-weight: 700;
    color: var(--nb-ink);
}

.answer-verdict-hint {
    margin: .15rem 0 0;
    font-size: .9rem;
    color: var(--nb-ink-muted);
    /* German runs a third longer and these are whole sentences. */
    overflow-wrap: break-word;
}

.answer-verdict.is-correct .answer-verdict-score {
    color: var(--nb-primary);
}

#answerVerdictSolve {
    margin-top: .5rem;
}

/* A wrong note name is underlined as well as recoloured, so being wrong is
   never carried by hue alone � the previous marking was var(--nb-answer-correct) against
   var(--nb-answer-wrong), the canonical deuteranopia pair, with no second channel. The wavy
   underline is the convention every reader already knows from a spell
   checker, and it survives greyscale, low contrast and colour blindness. */
.answer-mark-wrong {
    text-decoration: underline wavy;
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
}

@media (max-width: 575.98px) {
    .answer-verdict {
        margin-inline: .5rem;
    }
    /* Full-width so the smallest rung of the help ladder clears 44px. */
    #answerVerdictSolve {
        display: block;
        width: 100%;
    }
}

/* ���� Status surfaces sit above the ornament layer ��������������������������������������������������
   `.muzieknootjes` is fixed over the whole viewport at z-index 50, so the
   drifting note glyphs paint on top of every ordinary element on the page.
   Measured at 375px: a glyph landed across "Solve note" in the verdict panel.

   The two surfaces that tell the student something � what the marking found,
   and why an exercise failed to load � are the last things that should be
   obscured by decoration, so they are raised above it. The ornaments keep
   drifting over everything else, which is the identity working as intended.

   The general question (should purely atmospheric glyphs be above content at
   all?) is left alone here: the layer is shared by fifteen pages and changing
   it is not this fix's business. */
   A child's z-index cannot help here: #answerContainer and
   #userAnswerContainer both set backdrop-filter, which creates a stacking
   context, so anything inside them is trapped below whatever the container
   itself competes with. The containers have to be raised, not their
   contents. */
#answerContainer,
#userAnswerContainer,
.app-status,
/* Same reason: a drifting glyph was measured landing across the #00042 tag.
   This is the third place patched this way, which says the real fault is that
   a purely decorative layer sits at z-index 50 above every element on every
   page. Fixing that properly means deciding whether the notes should ever
   cross content at all  a look decision, not a bug fix, so it is left alone
   and recorded here rather than changed in passing. */
#prefGrid .card {
    position: relative;
    z-index: 51;
}

/* At 375px this button is the smallest rung of the help ladder offered at
   the one moment it is wanted, so it gets a real touch target rather than
   the 31px a btn-sm would give it. */
@media (max-width: 575.98px) {
    #answerVerdictSolve {
        min-height: 44px;
    }

    /* A fixed 100px inset from the bottom-right is a corner on a desktop and
       the middle of the content column on a 375px screen  measured, the beat
       circles landed on top of the verdict panel at z-index 110. Tucked into
       the actual corner on a phone, where the pulse is still visible and
       nothing is behind it. */
    #metronomeContainer {
        right: .5rem;
        bottom: .5rem;
        margin: 0 !important;
    }
}

/* ���� The public tag ��������������������������������������������������������������������������������������������������������������
   #00042 is assigned by Postgres and never editable, so it is presented as a
   fact next to the address rather than as a field. Monospace and tabular so a
   column of them would line up, and because a fixed-width identifier that
   reflows as the digits change reads as unstable. */
.pref-tag {
    display: inline-block;
    margin-top: .15rem;
    padding: .05rem .4rem;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    color: var(--nb-primary);
    background: var(--nb-surface);
    border-radius: .5rem;
    corner-shape: round;
    user-select: text;
}

/* ���� Touch targets ����������������������������������������������������������������������������������������������������������������
   44px is a guideline for fingers, not for pointers, so it is applied where
   a finger is actually used. `pointer: coarse` asks the device rather than
   guessing from width � a tablet with a mouse keeps the compact controls, a
   phone-sized window on a desktop does not get them by accident.

   Measured before this: 75 controls under 44x44 at 375px, 58 even at 1440px.
   `!important` is needed against Bootstrap's own .btn-sm padding. */
@media (pointer: coarse) {
    .btn,
    .form-select,
    .form-control {
        min-height: 44px;
    }

    .btn-sm,
    .form-select-sm,
    .form-control-sm {
        min-height: 44px !important;
        padding-block: .5rem !important;
    }

    /* Square controls grow in both directions or they stop being square. */
    #octaveSelector .octave-btn,
    #helpButton,
    #feedbackButton {
        min-width: 44px;
        min-height: 44px;
    }

    /* The alteration bar sits inside a crowded toolbar; the buttons still need
       to be hittable without zooming. */
    .editor-alt-btn {
        min-width: 44px;
    }
}

/* ── A page opened as a class exercise ────────────────────────────────────────
   Fixed to the bottom rather than pushed into the page: six different pages
   point here, each with its own layout, and none of them left room. Bottom and
   not top, where every one of them already has a navigation bar.            */

.class-exercise {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 120;

    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: calc(100vw - 2rem);
    flex-wrap: wrap;
    justify-content: center;

    padding: .5rem .9rem;
    border: 1px solid var(--nb-border-faint);
    border-radius: 50px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    font-size: .85rem;
}

.class-exercise-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .7rem;
    color: var(--nb-primary-deep);
}

.class-exercise-state { color: var(--nb-ink-muted); }
.class-exercise-back { font-weight: 600; color: var(--nb-primary); text-decoration: none; }

/* The bar floats over the bottom of the page; room is made for it so the
   last controls on the page are not hidden underneath. */
body.has-class-exercise { padding-bottom: 5rem; }
.class-exercise-back:hover { text-decoration: underline; }

/* The count towards the teacher's goal: a number and a thin bar that fills. */
.class-exercise-progress { display: inline-flex; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }
.class-exercise-progress[hidden] { display: none; }
.class-exercise-count { font-weight: 600; color: var(--nb-ink); }
.class-exercise-track {
    width: 5rem;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, .08);
    overflow: hidden;
}
.class-exercise-fill {
    display: block;
    height: 100%;
    background: var(--nb-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease-out;
}

/* The end of the exercise: a card over the page. */
.class-exercise-finish {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(20, 30, 40, .35);
    backdrop-filter: blur(3px);
    animation: class-finish-in .2s ease-out;
}
.class-exercise-finish-box {
    width: min(100%, 22rem);
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
    text-align: center;
    animation: class-finish-pop .25s cubic-bezier(.16, 1, .3, 1);
}
.class-exercise-finish-icon { font-size: 2rem; color: var(--nb-primary); margin-bottom: .5rem; }
.class-exercise-finish-box h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: .35rem; }
.class-exercise-finish-box p { color: var(--nb-ink-muted); margin-bottom: 1.25rem; }
.class-exercise-finish-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.class-exercise-finish-actions .btn { border-radius: 3rem; padding-inline: 1.1rem; }
@keyframes class-finish-in { from { opacity: 0; } }
@keyframes class-finish-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (prefers-reduced-motion: reduce) {
    .class-exercise-finish, .class-exercise-finish-box { animation: none; }
    .class-exercise-fill { transition: none; }
}

@media (max-width: 480px) {
    .class-exercise { left: 1rem; right: 1rem; transform: none; max-width: none; }
}

/* ── Back to Exercises ──
   The translucent squircle pill of the home footer, pinned to the top-left
   corner of every exercise. On a phone the title starts at the left edge, so
   the pill takes its own line above the page instead. */
.back-pill {
    display: inline-flex; align-items: center; gap: .1rem;
    font-size: .85rem; font-weight: 500; color: #636e72; text-decoration: none;
    padding: .5rem .9rem; border-radius: 2rem; corner-shape: squircle;
    background: rgba(255, 255, 255, .55); box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    transition: background-color .2s, color .2s;
}
.back-pill:hover { background: rgba(255, 255, 255, .85); color: #1a6e8a; }
.back-pill:focus-visible { outline: 2px solid #1a6e8a; outline-offset: 2px; }

/* Outside <main> and placed against the page: a short page is centred in the
   window and <main> moves down with it. 4.4rem clears the 56px fixed navbar. */
.back-corner { position: absolute; top: 4.4rem; left: 1rem; z-index: 5; }
@media (max-width: 767.98px) {
    .back-corner { position: static; align-self: flex-start; margin: .75rem 0 0 1rem; }
}

/* ── Theory and practice, linked both ways (Base.astro, related.js) ── */
/* An exercise's theory: the back pill's twin in the top-right corner. */
.theory-corner { position: absolute; top: 4.4rem; right: 1rem; z-index: 5; border: 0; margin: 0; }
@media (max-width: 767.98px) {
    /* On a phone the back pill takes its own row; this sits at the other end of it. */
    .theory-corner { top: calc(56px + .75rem); }
}

.theory-dialog {
    width: min(920px, calc(100vw - 2rem));
    height: min(88vh, 1100px);
    padding: 0;
    border: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.theory-dialog[open] { display: flex; flex-direction: column; }
.theory-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.theory-dialog-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .9rem .65rem 1.1rem;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
}
.theory-dialog-head h2 { color: #1a6e8a; font-weight: 700; }
.theory-dialog iframe { flex: 1 1 auto; width: 100%; border: 0; background: var(--nb-canvas); }
@media (max-width: 575.98px) {
    .theory-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .theory-dialog-head .btn span { display: none; }
}

/* A theory page's exercises, at its end. */
.related-exercises {
    width: 100%;
    max-width: 820px;
    margin: 1rem auto 2.5rem;
    padding: 0 .75rem;
    text-align: left;
}
.related-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .6;
    margin-bottom: .75rem;
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.related-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .75rem .9rem;
    border-radius: .9rem;
    background: rgba(255, 255, 255, .78);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .05);
}
.related-icon {
    flex: 0 0 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: .55rem;
    background: rgba(26, 110, 138, .1);
    color: #1a6e8a;
}
.related-icon .svg-icon { width: 1em; height: 1em; }
.related-body { display: flex; flex-direction: column; min-width: 0; }
.related-name { font-weight: 600; line-height: 1.3; }
.related-desc { font-size: .8rem; opacity: .68; line-height: 1.4; }
.related-go { margin-left: auto; opacity: .25; font-size: .8rem; }
.related-card:hover, .related-card:focus-visible {
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1), 0 10px 28px rgba(0, 0, 0, .09);
}
.related-card:hover .related-go, .related-card:focus-visible .related-go { opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
    .related-card { transition: box-shadow .15s ease, transform .15s ease; }
    .related-card:hover, .related-card:focus-visible { transform: translateY(-2px); }
}

/* Hidden from Preferences (Base.astro sets the class before the page paints). */
.hide-theory .theory-corner { display: none; }

/* Inside an exercise's theory dialog: the page's content and nothing else. */
.is-embedded body > .navbar,
.is-embedded .navbar-spacer,
.is-embedded .skip-link,
.is-embedded .back-corner,
.is-embedded .theory-corner,
.is-embedded .related-exercises,
.is-embedded #cookieBanner { display: none !important; }

/* A warning dropping in under the nav, as the editor's toast (editor.css):
   dark, rounded, centred, gone by itself (chord-transitions.js). */
.notice-toast {
    position: fixed;
    top: 4.75rem;
    left: 50%;
    z-index: 1080;
    display: flex;
    align-items: center;
    gap: .7rem;
    /* Its own width: left: 50% would leave it only half the window. */
    width: max-content;
    max-width: min(32rem, calc(100vw - 2rem));
    padding: .65rem 1rem;
    border-radius: 1rem;
    background: #1f2a30;
    color: #fff;
    font-size: .9rem;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -10px);
    transition: opacity .18s ease, transform .18s ease;
}
.notice-toast.is-shown {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.notice-toast-icon { color: #fbbf24; flex: none; }
@media (prefers-reduced-motion: reduce) {
    .notice-toast { transition: none; }
}

/* A list as a white pill, like the site's buttons: a faint border that takes
   the primary colour on hover, in muted ink (the editor's song bar, the
   exercises' settings). Over Bootstrap's .form-select. */
.pill-select {
    height: 31px;
    padding: 0 2rem 0 .85rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23636e72' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-position: right .7rem center;
    background-size: 10px 10px;
    border: 1px solid var(--nb-border-faint);
    corner-shape: squircle;
    border-radius: 3rem !important;
    color: var(--nb-ink-muted);
    font-size: .85rem;
    cursor: pointer;
    transition: border-color .15s, color .15s, box-shadow .15s;
}
.pill-select:hover {
    border-color: var(--nb-primary);
    color: var(--nb-primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%231a6e8a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.pill-select:focus {
    border-color: var(--nb-primary);
    box-shadow: 0 0 0 .2rem rgba(26, 110, 138, .2);
}

/* The Sign in button where a page needs an account: a filled pill, as
   round as the dropdowns, with its icon at text size beside the words. */
.signin-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.4rem;
    border-radius: 3rem;
    corner-shape: squircle;
    font-weight: 600;
}

/* A setting a teacher fixed for a class exercise: still shown, not changeable. */
.is-set-by-teacher { cursor: not-allowed; }

/* Said when the server could not send an exercise's questions (exercise-api.js). */
.exercise-api-problem {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 1200;
    max-width: min(32rem, calc(100% - 2rem));
    padding: .65rem 1rem;
    border-radius: .75rem;
    background: #fff4f4;
    border: 1px solid #f1b0b7;
    color: #842029;
    font-size: .9rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.exercise-api-problem[hidden] { display: none; }
