/* GOONS - erhu (/play/erhu) : shared/js/goons-erhu.js */

.app-hero--instrument { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 10px 0 56px; }
.app-hero--instrument h1 { margin: 14px 0 10px; font-size: clamp(30px, 4vw, 46px); }
.app-hero--instrument .lede { max-width: 110ch; margin: 0 0 16px; font-size: 16px; line-height: 1.6; }
.app-hero--instrument .app-hero-actions { margin-bottom: 18px; }

.eh {
    --eh-jade: #4fd1a1;
    --eh-red: #e0563f;
    --eh-gold: #e7c072;
    --eh-ink: #f3ece0;
    --eh-mute: #b6aa98;
    display: flex; flex-direction: column; gap: 14px;
    margin: 22px 0 8px; padding: 18px; border-radius: 20px; color: var(--eh-ink);
    background:
        radial-gradient(70% 70% at 80% 30%, rgba(224, 86, 63, .16), transparent 70%),
        radial-gradient(70% 70% at 10% 100%, rgba(79, 209, 161, .1), transparent 70%),
        #150d0b;
    box-shadow: inset 0 0 0 1px rgba(231, 192, 114, .2), 0 24px 50px -22px rgba(0, 0, 0, .8);
    user-select: none; -webkit-user-select: none;
}
.eh:empty { min-height: calc(min(1150px, 100vw - 72px) * .25 + 330px); }
.eh :where(button, select) { font: inherit; color: inherit; }
.eh :where(button) { cursor: pointer; }
.eh button:focus-visible, .eh select:focus-visible { outline: 2px solid var(--eh-jade); outline-offset: 2px; }
.eh-svg { display: block; width: 100%; height: auto; touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .5)); }
.eh-str { transition: stroke .1s; }
.eh-str.is-on { stroke: #fff6d8; animation: eh-saw .09s linear infinite; }
@keyframes eh-saw { 50% { transform: translateY(.6px); } }
.eh-mark rect { fill: rgba(243, 236, 224, .92); }
.eh-mark circle:not(.eh-dot) { fill: rgba(243, 236, 224, .8); }
.eh-mark.is-tonic rect, .eh-mark.is-tonic circle:not(.eh-dot) { fill: var(--eh-red); }
.eh-mark.is-tonic .eh-mlab { fill: #fff; }
.eh-mark.is-half rect { fill: rgba(243, 236, 224, .35); }
.eh-mark.is-hit rect { animation: eh-hit .5s ease-out; }
@keyframes eh-hit { 0% { fill: var(--eh-gold); } }
.eh-mark.is-next rect { fill: var(--eh-jade); animation: eh-pulse 1s ease-in-out infinite; }
@keyframes eh-pulse { 50% { opacity: .55; } }
.eh-mlab { pointer-events: none; font: 800 14px/1 'Inter', system-ui, sans-serif; fill: #2a160c; }
.eh-dot { fill: var(--eh-gold); pointer-events: none; }
.eh-open { pointer-events: none; font: 800 15px/1 'Inter', system-ui, sans-serif; fill: var(--eh-gold); }
.eh-now { pointer-events: none; font: 800 22px/1 'Inter', system-ui, sans-serif; fill: var(--eh-jade); }
.eh-finger { fill: rgba(79, 209, 161, .3); stroke: var(--eh-jade); stroke-width: 2; opacity: 0; pointer-events: none; transition: opacity .2s; }
.eh-finger.is-on { opacity: 1; transition: none; }
.eh-bow { transition: transform .5s ease-out; }
.eh-bow.is-on { animation: eh-bow-a 1.6s ease-in-out infinite alternate; }
.eh-bow.is-on.is-up { animation-name: eh-bow-b; }
@keyframes eh-bow-a { from { transform: translateX(-28px); } to { transform: translateX(34px); } }
@keyframes eh-bow-b { from { transform: translateX(34px); } to { transform: translateX(-28px); } }

.eh-hint { margin: 0; font-size: 13.5px; color: var(--eh-mute); }
.eh-bar, .eh-songs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 240, 220, .05); }
.eh-songs { display: grid; gap: 8px; }
.eh-song-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eh select {
    appearance: none; -webkit-appearance: none; padding: 9px 32px 9px 12px; border: 0; border-radius: 10px;
    background: rgba(0, 0, 0, .35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234fd1a1'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-size: 14px; font-weight: 700; color: var(--eh-ink);
}
.eh select option { background: #241612; }
.eh-song-ctl select { flex: 1 1 220px; }
.eh-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .35); }
.eh-seg-b { border: 0; padding: 7px 11px; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 700; color: var(--eh-mute); }
.eh-seg-b[aria-checked=true] { background: var(--eh-jade); color: #062419; }
.eh-tog { position: relative; border: 0; border-radius: 10px; padding: 9px 14px 9px 28px; font-size: 14px; font-weight: 700; background: rgba(0, 0, 0, .35); }
.eh-tog::before { content: ''; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #4a3c33; }
.eh-tog[aria-pressed=true]::before { background: var(--eh-jade); box-shadow: 0 0 8px var(--eh-jade); }
.eh-play { border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 800; background: var(--eh-red); color: #fff; }
.eh-play--guide { background: var(--eh-jade); color: #062419; }
.eh-play:disabled { opacity: .4; cursor: not-allowed; }
.eh-play[aria-pressed=true] { box-shadow: 0 0 0 2px #fff inset; }
.eh-info { margin: 0; font-size: 13px; color: var(--eh-mute); }
.eh-tab { display: flex; gap: 5px; align-items: center; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: thin; font: 800 19px/1 'IBM Plex Mono', ui-monospace, monospace; }
.eh-tok { position: relative; flex: none; min-width: 28px; padding: 12px 6px 9px; border-radius: 7px; text-align: center; background: rgba(0, 0, 0, .3); }
.eh-tok i { position: absolute; left: 0; right: 0; font-style: normal; font-size: 11px; line-height: 1; color: var(--eh-gold); }
.eh-tok .eh-up { top: 2px; }
.eh-tok .eh-down { bottom: 0; }
.eh-tok.is-slide::before { content: ''; position: absolute; left: -6px; top: 50%; width: 8px; border-top: 2px solid var(--eh-jade); transform: rotate(-30deg); }
.eh-tok.is-done { opacity: .4; }
.eh-tok.is-now { background: var(--eh-jade); color: #062419; }
.eh-sep { flex: none; width: 2px; height: 26px; margin: 0 4px; background: rgba(231, 192, 114, .4); }
@media (max-width: 600px) {
    .eh { padding: 12px 10px; gap: 10px; border-radius: 16px; }
    .eh-wrap { overflow-x: auto; margin: 0 -10px; padding: 0 10px 4px; scrollbar-width: thin; }
    .eh-svg { min-width: 900px; touch-action: pan-x; }
    .eh:empty { min-height: 760px; }
}
@media (prefers-reduced-motion: reduce) { .eh-str.is-on, .eh-bow.is-on, .eh-mark.is-hit rect, .eh-mark.is-next rect { animation: none; } }
