/* Endless Melody — the instrument (shortcodes/endless-melody.html).
   Grammar as site-wide: the mode switch reads like the nav (ink options,
   pink current), Play is the one filled pink button, readouts and labels
   are gold metadata, the critical line is green structure. */

.em { margin: 1.6rem 0 2.6rem; font-family: var(--mono); }

.em-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    margin-bottom: 0.7rem;
}

.em-modes {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
}
.em-modes button {
    font: inherit;
    font-size: 0.88rem;
    color: var(--heading);
    background: none;
    border: 0;
    border-right: 1px solid var(--line-strong);
    padding: 0.35rem 0.75rem;
    cursor: pointer;
}
.em-modes button:last-child { border-right: 0; }
.em-modes button:hover { color: #fff; background: var(--pink); }
.em-modes button[aria-pressed="true"] { color: var(--pink); font-weight: 700; }
.em-modes button[aria-pressed="true"]:hover { color: var(--pink); background: none; }

.em-play {
    font: inherit;
    font-size: 0.95rem;
    min-width: 7.5em;
    background: var(--pink);
    color: #fff;
    border: 1px solid var(--pink);
    border-radius: 2px;
    padding: 0.4rem 1.1rem;
    cursor: pointer;
}
.em-play:hover { background: var(--heading); border-color: var(--heading); }

.em-canvas {
    display: block;
    width: 100%;
    height: 440px;
    background: #fff;
    border: 1px solid var(--line);
}

.em-under {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.4rem 1rem;
    margin-top: 0.5rem;
}
.em-readout {
    flex: 1 1 20rem;
    min-height: 2.6em;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.em-readout p { margin: 0; }
.em-settings {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}
/* Rhythm switch: the nav's Kerned / Mono grammar (ink options, pink
   current, pink-on-hover); greyed while the chord plays. */
.em-rhythm {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--gold);
}
.em-rhythm button {
    font: inherit;
    color: var(--heading);
    background: none;
    border: 0;
    padding: 0 0.15rem;
    cursor: pointer;
}
.em-rhythm button:hover { color: #fff; background: var(--pink); }
.em-rhythm button[aria-pressed="true"] { color: var(--pink); font-weight: 700; }
.em-rhythm button[aria-pressed="true"]:hover { color: var(--pink); background: none; }
.em-rhythm button:disabled,
.em-rhythm button:disabled:hover { color: var(--muted); background: none; font-weight: 400; cursor: default; }
.em-sep { color: var(--muted); }
.em-tempo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gold);
}
.em-tempo-label {
    font-family: var(--mono-under);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.em-tempo input { accent-color: var(--pink); width: 7rem; }
.em-tempo output { min-width: 2.6em; font-variant-numeric: tabular-nums; }

.em-noscript { font-style: italic; color: var(--secondary); }

@media (max-width: 520px) {
    .em-settings { align-items: flex-start; }
    .em-canvas { height: 400px; }
    .em-modes button { padding: 0.35rem 0.55rem; font-size: 0.82rem; }
}
