/* GOONS - guimbarde (/play/jaw-harp) : shared/js/goons-jaw-harp.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; }

/* acier, curcuma, vert paon */
.jh {
    --jh-steel: #b8c2cc;
    --jh-turmeric: #f2c14e;
    --jh-peacock: #1fb5a6;
    --jh-ink: #eef2f5;
    --jh-mute: #a6b0ba;
    display: grid; gap: 12px;
    margin: 22px 0 8px; padding: 16px 18px 18px; border-radius: 20px; color: var(--jh-ink);
    background:
        radial-gradient(55% 65% at 70% 40%, rgba(31, 181, 166, .16), transparent 70%),
        radial-gradient(45% 55% at 10% 90%, rgba(242, 193, 78, .1), transparent 70%),
        #0e1316;
    box-shadow: inset 0 0 0 1px rgba(184, 194, 204, .2), 0 24px 50px -22px rgba(0, 0, 0, .8);
    user-select: none; -webkit-user-select: none;
}
.jh:empty { min-height: 600px; }
.jh :where(button, select) { font: inherit; color: inherit; }
.jh :where(button) { cursor: pointer; }
.jh button:focus-visible, .jh select:focus-visible, .jh input:focus-visible { outline: 2px solid var(--jh-turmeric); outline-offset: 2px; }
.jh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(238, 242, 245, .05); }
.jh select {
    appearance: none; -webkit-appearance: none; max-width: 100%; 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='%23f2c14e'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-size: 14px; font-weight: 700; color: var(--jh-ink);
}
.jh select option { background: #1a2127; }
.jh-play { border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 800; background: var(--jh-turmeric); color: #2a1d00; }
.jh-play--auto { background: var(--jh-peacock); color: #04211e; }
.jh-play--mine { background: #c9d2db; color: #12181d; }
.jh-play[aria-pressed=true] { background: var(--jh-ink); color: #12181d; box-shadow: 0 0 0 2px var(--jh-turmeric); }
.jh-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--jh-mute); cursor: pointer; }
.jh-check input { accent-color: var(--jh-peacock); }
.jh-tempo { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--jh-mute); }
.jh-tempo input { width: 110px; accent-color: var(--jh-turmeric); }
.jh-tempo output { min-width: 64px; color: var(--jh-ink); font-variant-numeric: tabular-nums; }

.jh-stage { display: grid; grid-template-columns: minmax(120px, 2fr) minmax(0, 8fr); gap: 14px; align-items: stretch; }
.jh-harp { display: block; width: 100%; height: auto; max-height: 280px; cursor: pointer; }
.jh-frame { fill: none; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.jh-ring { fill: rgba(0, 0, 0, .25); stroke: none; pointer-events: none; }
.jh-label { font: 800 14px/1 'Inter', system-ui, sans-serif; fill: var(--jh-mute); }
.jh-tongue { transform-box: view-box; transform-origin: 110px 48px; }
.jh-tongue.is-on { animation: jh-twang .5s ease-out; }
@keyframes jh-twang { 0% { transform: rotate(4deg); } 15% { transform: rotate(-3.5deg); } 30% { transform: rotate(2.5deg); } 45% { transform: rotate(-1.6deg); } 60% { transform: rotate(1deg); } 100% { transform: rotate(0); } }

.jh-pad {
    position: relative; min-height: 260px; border-radius: 16px; overflow: hidden; touch-action: none; cursor: crosshair;
    -webkit-tap-highlight-color: transparent;
    background:
        linear-gradient(180deg, rgba(31, 181, 166, .2), rgba(31, 181, 166, 0) 55%),
        linear-gradient(90deg, rgba(242, 193, 78, .12), rgba(31, 181, 166, .12));
    box-shadow: inset 0 0 0 1px rgba(238, 242, 245, .14);
}
.jh-rung { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed rgba(238, 242, 245, .16); pointer-events: none; }
.jh-rung b, .jh-rung span, .jh-rung kbd { position: absolute; left: 0; transform: translateX(-50%); white-space: nowrap; }
.jh-rung b { top: 8px; font-size: 15px; font-weight: 800; color: var(--jh-ink); }
.jh-rung span { top: 28px; font-size: 12px; font-weight: 700; color: var(--jh-mute); }
.jh-rung kbd { bottom: 30px; padding: 0 6px; border-radius: 5px; background: rgba(0, 0, 0, .35); font: 700 11px/1.6 'Inter', system-ui, sans-serif; color: var(--jh-mute); }
.jh-rung.is-on { border-left: 2px solid var(--jh-turmeric); }
.jh-rung.is-on b { color: var(--jh-turmeric); }
.jh-vowels { position: absolute; left: 4%; right: 4%; bottom: 8px; display: flex; justify-content: space-between; pointer-events: none; }
.jh-vowels span { font-size: 13px; font-weight: 800; color: rgba(238, 242, 245, .45); }
.jh-cursor { position: absolute; width: 64px; height: 44px; margin: -22px 0 0 -32px; pointer-events: none; transition: left .06s linear, top .06s linear; }
.jh-cursor svg { width: 100%; height: 100%; overflow: visible; }
.jh-lip-up, .jh-lip-low { fill: #e8786b; stroke: #fff; stroke-width: 1.5; }
.jh-cursor.is-on svg { animation: jh-buzz .35s ease-out; }
@keyframes jh-buzz { 0% { filter: drop-shadow(0 0 12px var(--jh-turmeric)); transform: scale(1.12); } 100% { filter: none; transform: scale(1); } }
.jh-pad-hint { position: absolute; right: 12px; top: 52px; margin: 0; font-size: 12px; color: var(--jh-mute); pointer-events: none; }
.jh-pad::after { content: 'clear'; position: absolute; left: 10px; top: 54px; font-size: 11px; font-weight: 700; color: rgba(238, 242, 245, .4); pointer-events: none; }
.jh-pad::before { content: 'soft'; position: absolute; left: 10px; bottom: 50px; font-size: 11px; font-weight: 700; color: rgba(238, 242, 245, .4); pointer-events: none; }

.jh-lane { display: flex; flex-wrap: wrap; gap: 6px; }
.jh-cell { display: grid; place-items: center; min-width: 64px; padding: 9px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); font-size: 16px; font-weight: 800; color: var(--jh-mute); }
.jh-cell.is-accent { color: var(--jh-turmeric); }
.jh-cell.is-now { box-shadow: 0 0 0 2px #fff; color: var(--jh-ink); }
.jh.is-mine .jh-cell { outline: 1px solid rgba(31, 181, 166, .45); outline-offset: -1px; }
.jh-cell.is-good { animation: jh-good .35s ease-out; }
.jh-cell.is-off { animation: jh-off .35s ease-out; }
@keyframes jh-good { 0% { box-shadow: 0 0 0 3px var(--jh-peacock), 0 0 14px var(--jh-peacock); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes jh-off { 0% { box-shadow: 0 0 0 3px #ff5d5d; } 100% { box-shadow: 0 0 0 0 transparent; } }
.jh-score { min-height: 1.4em; margin: 0; font-size: 14px; font-weight: 800; color: var(--jh-peacock); }
.jh-score:empty { display: none; }
.jh-hint { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--jh-mute); }
@media (max-width: 720px) {
    .jh { padding: 12px 10px; border-radius: 16px; }
    .jh-stage { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .jh-harp { max-height: 120px; }
    .jh-pad { min-height: 240px; }
    .jh-rung kbd { display: none; }
    .jh-rung span { font-size: 11px; }
    .jh-tempo input { width: 90px; }
    .jh-cell { min-width: 52px; padding: 8px; font-size: 15px; }
    .jh:empty { min-height: 720px; }
}
@media (prefers-reduced-motion: reduce) { .jh-tongue.is-on, .jh-cursor.is-on svg, .jh-cell.is-good, .jh-cell.is-off { animation: none; } .jh-cursor { transition: none; } }
