/* GOONS - tambourin (/play/tambourine) : shared/js/goons-tambourine.js. Mise en page reprise du cajón (goons-cajon.css). */

.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; }

.tb {
    --tb-red: #e76f51;
    --tb-sand: #e9c46a;
    --tb-teal: #2ec4b6;
    --tb-ink: #f7ede0;
    --tb-mute: #c4ad95;
    display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 14px 24px;
    margin: 22px 0 8px; padding: 18px; border-radius: 20px; color: var(--tb-ink);
    background:
        radial-gradient(70% 70% at 12% 35%, rgba(233, 196, 106, .16), transparent 70%),
        radial-gradient(60% 60% at 92% 90%, rgba(46, 196, 182, .12), transparent 70%),
        #17100a;
    box-shadow: inset 0 0 0 1px rgba(242, 197, 124, .22), 0 24px 50px -22px rgba(0, 0, 0, .8);
    user-select: none; -webkit-user-select: none;
}
.tb:empty { min-height: 500px; }
.tb :where(button, select) { font: inherit; color: inherit; }
.tb :where(button) { cursor: pointer; }
.tb button:focus-visible, .tb select:focus-visible, .tb input:focus-visible { outline: 2px solid var(--tb-sand); outline-offset: 2px; }
.tb-stage { position: relative; }
.tb-drum { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; touch-action: none; -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .5)); }
.tb-zlab { pointer-events: none; font: 800 13px/1 'Inter', system-ui, sans-serif; fill: #7a5a2c; letter-spacing: .04em; }
.tb-zlab--frame { fill: #f4d98c; font-size: 11px; }
.tb-head, .tb-frame, .tb-slot { cursor: pointer; }
.tb-jingle { transform-box: fill-box; transform-origin: center; }
.tb-drum.is-jingle .tb-jingle { animation: tb-jingle .2s ease-out; }
.tb-drum.is-rolling .tb-jingle { animation: tb-jingle .09s linear infinite; }
.tb-drum.is-jingle .tb-jingle--b, .tb-drum.is-rolling .tb-jingle--b { animation-direction: reverse; }
@keyframes tb-jingle { 0% { transform: translateX(0); } 30% { transform: translateX(2.5px); } 70% { transform: translateX(-2.5px); } 100% { transform: translateX(0); } }
.tb-ripple { fill: none; stroke: var(--tb-red); stroke-width: 6; opacity: .95; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: tb-ripple .45s ease-out forwards; }
.tb-ripple--T { stroke: var(--tb-teal); stroke-width: 4; }
.tb-ripple--S { stroke: var(--tb-sand); stroke-width: 4; }
@keyframes tb-ripple { 0% { transform: scale(.35); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; stroke-width: 1; } }
.tb-status { position: absolute; left: 0; right: 0; bottom: -4px; margin: 0; text-align: center; font-size: 12.5px; color: var(--tb-mute); }
.tb-side { display: grid; gap: 10px; }
.tb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 236, 214, .05); }
.tb 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='%23e4572e'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-size: 14px; font-weight: 700; color: var(--tb-ink);
}
.tb select option { background: #2a150c; }
.tb-play { border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 800; background: var(--tb-red); color: #fff; }
.tb-play[aria-pressed=true] { background: var(--tb-sand); color: #2a1406; }
.tb-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); }
.tb-tog::before { content: ''; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #4d3828; }
.tb-tog[aria-pressed=true]::before { background: var(--tb-teal); box-shadow: 0 0 8px var(--tb-teal); }
.tb-roll { border: 0; border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 800; background: #7b4fa0; color: #fff; touch-action: none; }
.tb-roll:active { background: #9a6bc2; }
.tb-tempo { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--tb-mute); }
.tb-tempo input { width: 110px; accent-color: var(--tb-red); }
.tb-tempo output { min-width: 64px; color: var(--tb-ink); font-variant-numeric: tabular-nums; }
.tb-grid { display: grid; grid-template-columns: 74px repeat(var(--tb-cols, 16), minmax(0, 1fr)); gap: 4px; align-items: center; }
.tb-lane { font-size: 12px; font-weight: 700; color: var(--tb-mute); }
.tb-lane.is-muted { color: var(--tb-teal); }
.tb-cell { position: relative; display: grid; place-items: center; height: 34px; border-radius: 7px; background: rgba(0, 0, 0, .3); font-size: 12px; font-weight: 800; transition: box-shadow .08s; }
.tb-cell.is-beat::before { content: ''; position: absolute; top: -5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--tb-mute); }
.tb-cell.is-H { background: #b8482d; color: #fff; }
.tb-cell.is-T { background: rgba(46, 196, 182, .28); color: #bff3ee; }
.tb-cell.is-S { background: var(--tb-sand); color: #2a1a06; }
.tb-cell.is-R { background: #7b4fa0; color: #fff; }
.tb-cell.is-K { background: #3a2c22; color: #d9c7b2; }
.tb-cell.is-C { background: #57483b; color: #f1e4d2; }
.tb-cell.is-mine { box-shadow: inset 0 0 0 1.5px rgba(46, 196, 182, .55); }
.tb-cell.is-now { box-shadow: 0 0 0 2px #fff; }
.tb-cell.is-good { animation: tb-good .35s ease-out; }
.tb-cell.is-off { animation: tb-off .35s ease-out; }
@keyframes tb-good { 0% { box-shadow: 0 0 0 3px var(--tb-teal), 0 0 14px var(--tb-teal); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes tb-off { 0% { box-shadow: 0 0 0 3px #ff5d5d; } 100% { box-shadow: 0 0 0 0 transparent; } }
.tb-score { min-height: 1.4em; margin: 0; font-size: 14px; font-weight: 800; color: var(--tb-teal); font-variant-numeric: tabular-nums; }
.tb-score:empty { display: none; }
.tb-info { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--tb-mute); }
.tb-info b { color: var(--tb-red); }
.tb-hint { grid-column: 1 / -1; margin: 0; font-size: 13.5px; color: var(--tb-mute); }
@media (max-width: 900px) { .tb { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .tb { padding: 12px 10px; gap: 10px; border-radius: 16px; }
    .tb-drum { max-width: 250px; }
    .tb-grid { grid-template-columns: 64px repeat(var(--tb-cols, 16), minmax(0, 1fr)); gap: 2px; }
    .tb-cell { height: 28px; font-size: 10px; border-radius: 5px; }
    .tb-lane { font-size: 10.5px; }
    .tb-tempo input { width: 90px; }
    .tb:empty { min-height: 900px; }
}
@media (prefers-reduced-motion: reduce) {
    .tb-ripple, .tb-cell.is-good, .tb-cell.is-off, .tb-drum.is-jingle .tb-jingle, .tb-drum.is-rolling .tb-jingle { animation: none; }
    .tb-ripple { opacity: .7; }
}
