/* SOMOS - Piano Roll */
.pr-grade { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.pr-grade > * { min-width: 0; }

.pr-palco {
    max-width: 100%;
    background: #0B0D14; border: 1px solid var(--borda); border-radius: var(--raio);
    overflow: hidden; display: flex; flex-direction: column;
}
.pr-barra { display: flex; align-items: center; gap: .5rem; padding: .6rem; border-bottom: 1px solid var(--borda); background: rgba(22, 24, 34, .85); }
.pr-barra .btn { min-width: 104px; justify-content: center; }
.pr-barra .btn-redondo { width: 36px; height: 36px; flex-shrink: 0; }
.pr-barra .btn-redondo .ic { width: 18px; height: 18px; }
.pr-barra .btn-redondo.ligado { color: #0F1117; background: var(--accent); border-color: var(--accent); }
.pr-progresso { flex: 1; height: 8px; border-radius: 999px; background: var(--input); border: 1px solid var(--borda); cursor: pointer; overflow: hidden; min-width: 60px; }
.pr-progresso div { height: 100%; width: 0; background: var(--accent); border-radius: 999px; }
.pr-tempo { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

.pr-rolo { position: relative; height: clamp(260px, 52vh, 560px); }
.pr-rolo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pr-teclas { display: block; width: 100%; height: 150px; touch-action: none; cursor: pointer; background: #111; }
/* no celular, não pinta a tecla de azul ao tocar (destaque padrão do navegador) */
.pr-palco, .pr-palco * { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.pr-proxima {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2;
    display: flex; align-items: center; gap: .7rem; padding: .45rem 1rem; border-radius: 14px; white-space: nowrap;
    background: rgba(15, 17, 23, .88); border: 1px solid var(--borda); box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
.pr-proxima strong { font-size: 1.35rem; font-weight: 900; color: #FBBF24; }
.pr-contagem {
    position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; pointer-events: none;
    font-size: 6rem; font-weight: 900; color: rgba(var(--accent-rgb), .85); text-shadow: 0 0 40px rgba(var(--accent-rgb), .6);
}
.pr-fim {
    position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
    background: rgba(11, 13, 20, .86); text-align: center; padding: 1rem;
}
.pr-fim h3 { font-size: 1.6rem; margin: 0; color: var(--accent); }
.pr-fim p { color: var(--texto); margin: 0 0 .8rem; }

.pr-legenda { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: .55rem .8rem; font-size: .74rem; color: var(--muted); border-top: 1px solid var(--borda); }
.pr-legenda i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.pr-cor-dir { background: #4ADE80; }
.pr-cor-esq { background: #60A5FA; }
#placar { margin-left: auto; color: var(--texto-forte); font-weight: 700; }

.pr-lado { display: flex; flex-direction: column; gap: .8rem; }
.pr-lado .card-campo { padding: .95rem 1rem; }
.pr-info { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .76rem; color: var(--muted); margin-top: .55rem; }
.pr-info strong { color: var(--accent); }
.pr-link-arquivo { display: inline-flex; align-items: center; gap: .35rem; margin-top: .6rem; font-size: .76rem; color: var(--muted); cursor: pointer; font-weight: 600; }
.pr-link-arquivo:hover { color: var(--accent); }
.pr-link-arquivo .ic { width: 15px; height: 15px; }
.chips-tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.chips-tres .chip { padding: .5rem .3rem; font-size: .74rem; text-align: center; }
.pr-check { display: flex; align-items: center; gap: .5rem; font-size: .8rem; margin-top: .6rem; cursor: pointer; color: var(--texto); }
.pr-check input { flex-shrink: 0; }
.pr-entrada { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .5rem; margin-top: .6rem; }
.pr-entrada .btn { flex: 1 1 auto; justify-content: flex-start; max-width: 100%; }
.pr-entrada .btn .ic { width: 16px; height: 16px; }
.pr-status { font-size: .72rem; color: var(--muted2); font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.pr-status.erro { flex-basis: 100%; }
.pr-lado .card-campo { min-width: 0; overflow-wrap: anywhere; }
.pr-grade, .pr-lado { max-width: 100%; }
.pr-status.ok { color: #4ADE80; }
.pr-status.erro { color: var(--perigo); }
.pr-mic { margin-top: .7rem; }
.pr-mic .medidor { height: 8px; }

/* Tela cheia: palco ocupa a tela toda */
.pr-palco:fullscreen { border-radius: 0; border: 0; width: 100%; height: 100%; }
.pr-palco:fullscreen .pr-rolo { flex: 1; height: auto; }
.pr-palco:fullscreen .pr-teclas { height: 24vh; }
.pr-palco:-webkit-full-screen { border-radius: 0; border: 0; width: 100%; height: 100%; }
.pr-palco:-webkit-full-screen .pr-rolo { flex: 1; height: auto; }
.pr-palco:-webkit-full-screen .pr-teclas { height: 24vh; }

@media (max-width: 1000px) {
    .pr-grade { grid-template-columns: minmax(0, 1fr); }
    .pr-lado { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .pr-lado { grid-template-columns: minmax(0, 1fr); }
    .pr-rolo { height: 46vh; min-height: 230px; }
    .pr-teclas { height: 120px; }
    .pr-barra { gap: .35rem; padding: .5rem; }
    .pr-barra .btn { min-width: 0; }
    .pr-proxima { top: 8px; padding: .35rem .7rem; }
    .pr-proxima strong { font-size: 1.1rem; }
    .pr-tempo { display: none; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .pr-rolo { height: 62vh; }
    .pr-teclas { height: 26vh; }
}
