/* public/piano.css — piano virtual */
.pn-launch { position: fixed; right: 16px; bottom: 86px; z-index: 9985; width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.25); background: linear-gradient(135deg, #2b1d12, #1a1008); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.45); }
.pn-launch.has-dev { border-color: #3ddc84; box-shadow: 0 0 0 3px rgba(61,220,132,.25), 0 8px 22px rgba(0,0,0,.45); }
.pn-launch.has-dev::after { content: ''; position: absolute; top: 4px; right: 4px; width: 11px; height: 11px; border-radius: 50%; background: #3ddc84; }
.pn-launch.is-open { opacity: .0; pointer-events: none; }
.pn-toast { position: fixed; right: 16px; bottom: 150px; z-index: 9986; max-width: min(320px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 12px; background: #0f2a1a; color: #d9ffe8; border: 1px solid #3ddc84; font-size: 13px; cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.pn-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.pn-drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; max-height: 78vh; overflow: auto; background: linear-gradient(180deg, #17110c, #0c0805); border-top: 2px solid #ff7a2f; box-shadow: 0 -12px 40px rgba(0,0,0,.6); padding: 10px 14px 14px; display: grid; gap: 8px; color: #fff; }
.pn-drawer[hidden] { display: none; }
@media (min-width: 900px) { html:not(.is-phone) .pn-drawer { left: 236px; } }
.pn-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pn-title { font-size: 15px; }
.pn-status { flex: 1 1 200px; font-size: 12.5px; opacity: .8; min-width: 0; }
.pn-status.is-bad { color: #ff8a7a; opacity: 1; }
.pn-btn { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: inherit; border-radius: 9px; padding: 6px 11px; min-height: 34px; cursor: pointer; font-size: 12.5px; font-family: inherit; line-height: 1.2; }
.pn-btn:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.pn-btn:focus-visible, .pn-drawer select:focus-visible, .pn-drawer input:focus-visible { outline: 2px solid #ffb74d; outline-offset: 1px; }
.pn-btn.is-on { background: #ff4d6d; border-color: #ff4d6d; }
.pn-btn:disabled { opacity: .4; cursor: default; }
.pn-devs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.pn-dev { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.pn-read { display: grid; gap: 2px; justify-items: center; text-align: center; background: #07070c; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 8px 10px; min-height: 76px; align-content: center; }
.pn-notes { font: 800 clamp(20px, 4vw, 30px)/1.1 ui-monospace, Consolas, monospace; color: #ffd27a; overflow-wrap: anywhere; }
.pn-chord { font-size: clamp(14px, 2.4vw, 18px); font-weight: 700; color: #6fe3a0; min-height: 1.2em; overflow-wrap: anywhere; }
.pn-sub { font-size: 12px; opacity: .6; }
.pn-tuner { position: relative; width: min(320px, 90%); height: 8px; border-radius: 4px; background: linear-gradient(90deg, #ff4d4d, #ffc93c 35%, #3ddc84 50%, #ffc93c 65%, #ff4d4d); margin-top: 6px; }
.pn-needle { position: absolute; top: -4px; width: 4px; height: 16px; background: #fff; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 6px #fff; transition: left .08s; }
.pn-needle.is-ok { background: #3ddc84; box-shadow: 0 0 10px #3ddc84; }
.pn-ctl, .pn-audio { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12.5px; }
.pn-ctl label, .pn-audio label { display: flex; gap: 6px; align-items: center; }
.pn-ctl select, .pn-audio select { max-width: 200px; min-width: 0; }
.pn-chk { cursor: pointer; }
.pn-pedal.is-on { background: #46b6ff; border-color: #46b6ff; color: #04202e; font-weight: 700; }
.pn-vol { width: 90px; }
.pn-astat { font-size: 12px; opacity: .85; }
.pn-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; border-radius: 8px; touch-action: pan-x; }
.pn-keys { position: relative; height: 150px; touch-action: none; user-select: none; }
.pn-key { position: absolute; top: 0; box-sizing: border-box; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; }
.pn-white { height: 100%; background: linear-gradient(#f4f1ea, #fff 70%); border: 1px solid #1a1008; border-radius: 0 0 6px 6px; color: #1a1008; z-index: 1; }
.pn-black { height: 62%; background: linear-gradient(#2a2a30, #000); border-radius: 0 0 4px 4px; z-index: 2; color: #fff; }
.pn-key i { position: absolute; bottom: 4px; font-size: 10px; font-style: normal; opacity: .8; font-weight: 700; }
.pn-key b { position: absolute; bottom: 18px; font-size: 10px; font-weight: 800; pointer-events: none; }
.pn-white.is-on { background: linear-gradient(#ffb74d, #ff7a2f); }
.pn-black.is-on { background: linear-gradient(#ff9a4d, #d9480f); }
.pn-key[data-src="midi"].is-on { filter: hue-rotate(0deg); }
.pn-key[data-src="audio"].is-on.pn-white { background: linear-gradient(#7de8ff, #1fb6e0); }
.pn-key[data-src="audio"].is-on.pn-black { background: linear-gradient(#46c9e8, #0a7da0); }
.pn-key[data-src="mouse"].is-on.pn-white, .pn-key[data-src="pc"].is-on.pn-white { background: linear-gradient(#a5f0b8, #3ddc84); }
.pn-key[data-src="mouse"].is-on.pn-black, .pn-key[data-src="pc"].is-on.pn-black { background: linear-gradient(#52d080, #178a45); }


/* ---- ordenes nuevos: ajustes plegables, juego de notas, no tapar las teclas ---- */
html.pn-open .howto-fab, html.pn-open .va-fab { display: none !important; }
.pn-more { display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.04); font-size: 12.5px; }
.pn-more label { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pn-more[hidden], .pn-gamepanel[hidden], .pn-fall[hidden] { display: none; }
.pn-ctl .pn-moretoggle.is-on { background: rgba(255,255,255,.22); }
.pn-key.is-auto.pn-white { background: linear-gradient(#d9c2ff, #9a62ff); }
.pn-key.is-auto.pn-black { background: linear-gradient(#b48aff, #5a24c9); }
.pn-key.pn-hint { box-shadow: inset 0 -26px 22px -8px rgba(255,170,60,.95); animation: pnPulse .5s ease-in-out infinite alternate; }
@keyframes pnPulse { from { filter: brightness(1); } to { filter: brightness(1.25); } }
.pn-fall { display: block; width: 100%; height: 210px; border-radius: 10px 10px 0 0; background: #07070c; touch-action: none; }
.pn-drawer.is-game .pn-read { min-height: 0; padding: 4px 8px; }
.pn-drawer.is-game .pn-sub, .pn-drawer.is-game .pn-tuner { display: none; }
.pn-drawer.is-game .pn-notes { font-size: clamp(15px, 3vw, 20px); }
.pn-drawer.is-game .pn-scroll { margin-top: -8px; }
.pn-gamepanel { display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); font-size: 12.5px; }
.pg-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pg-row label { display: flex; gap: 5px; align-items: center; min-width: 0; }
.pg-row select { max-width: 52vw; min-width: 0; }
.pg-info { opacity: .75; min-width: 0; overflow-wrap: anywhere; }
.pg-chip { padding: 3px 9px; border: 1.5px solid; border-radius: 999px; background: rgba(255,255,255,.06); }
.pg-ctl .pg-seek { flex: 1 1 120px; min-width: 90px; }
.pg-hud { display: flex; gap: 10px; align-items: baseline; font-weight: 800; }
.pg-hud b { font-size: 17px; color: #ffd27a; min-width: 2ch; }
.pg-hud .pg-acc { color: #6fe3a0; }
.pg-play { min-width: 96px; }
@media (max-width: 640px) {
  .pn-launch { bottom: 96px; }
  .pn-keys { height: 130px; }
  .pn-fall { height: 150px; }
  .pn-drawer { padding: 8px 10px 12px; max-height: 86vh; }
  .pn-status { flex-basis: 100%; order: 9; font-size: 12px; }
  .pn-read { min-height: 52px; padding: 5px 8px; }
  .pn-ctl .pn-vol { width: 70px; }
}

.pg-chip { font-size: 12px; }
.pg-top .pg-songlab { flex: 1 1 180px; }
.pg-top .pg-song { flex: 1; width: 100%; max-width: none; }
@media (max-width: 640px) {
  .pn-head { gap: 6px 8px; }
  .pn-head .pn-btn { padding: 5px 9px; }
  .pn-title { font-size: 14px; }
  .pn-fall { height: 130px; }
  .pn-drawer.is-game .pn-read, .pn-drawer.is-game .pn-status { display: none; }
  .pn-gamepanel { padding: 6px 8px; gap: 5px; }
  .pg-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pg-opts label { min-width: 0; }
  .pg-opts select { width: 100%; max-width: none; font-size: 12px; }
  .pg-opts .pg-l-mode, .pg-opts .pg-l-diff, .pg-opts .pg-l-speed { display: none; }
  .pg-opts .pg-audiochk { grid-column: 1 / -1; }
  .pg-info { font-size: 11.5px; flex-basis: 100%; }
  .pg-top .pg-file { padding: 5px 8px; }
}
@media (max-width: 640px) {
  .pn-ctl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; align-items: center; }
  .pn-ctl > label { grid-column: span 2; min-width: 0; }
  .pn-ctl > label select, .pn-ctl > label input[type=range] { flex: 1; min-width: 0; width: 100%; max-width: none; }
  .pn-ctl .pn-pedal, .pn-ctl .pn-dl { grid-column: span 2; }
  .pn-ctl .pn-btn { min-width: 0; padding: 5px 4px; font-size: 12px; white-space: nowrap; }
  .pg-opts select { padding-inline: 4px; }
}
.pn-pedals { display: flex; flex-wrap: wrap; gap: 8px; }
.pn-pedals .pn-btn.is-on { background: #46b6ff; border-color: #46b6ff; color: #04202e; font-weight: 700; }
.pn-credit { font-size: 11px; opacity: .7; }
.pn-more select { max-width: 100%; }

/* La caja que muestra las notas mide siempre lo mismo. Antes crecia cuando aparecia el acorde, o cuando la linea de notas no cabia
   y se partia en dos, y todo el piano saltaba. Ahora cada linea se queda en una sola (se recorta con "…" si no cabe). */
.pn-read { grid-template-columns: minmax(0, 1fr); height: 112px; min-height: 112px; box-sizing: border-box; overflow: hidden; }
.pn-read > .pn-notes, .pn-read > .pn-chord, .pn-read > .pn-sub { max-width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.pn-read > .pn-notes { min-height: 1.1em; }
.pn-read > .pn-sub { min-height: 1.3em; }
.pn-drawer.is-game .pn-read { height: 60px; min-height: 60px; }
@media (max-width: 640px) {
  .pn-read { height: 92px; min-height: 92px; }
  .pn-drawer.is-game .pn-read { display: none; }
}

/* Efectos del modo "notas que caen" (pianogame.js): teclas que brillan del color de la nota y se hunden un poquito */
.pn-drawer.pn-fxon .pn-key.is-on, .pn-drawer.pn-fxon .pn-key.is-auto { z-index: 2; }
.pn-drawer.pn-fxon .pn-white.is-on, .pn-drawer.pn-fxon .pn-white.is-auto { background: linear-gradient(color-mix(in srgb, var(--fx, #ff7a2f) 40%, #fff), var(--fx, #ff7a2f)); box-shadow: 0 0 16px 2px var(--fx, #ff7a2f), inset 0 -10px 16px rgba(0, 0, 0, .16); transform: translateY(2px) scaleY(.985); transform-origin: top; }
.pn-drawer.pn-fxon .pn-black.is-on, .pn-drawer.pn-fxon .pn-black.is-auto { background: linear-gradient(color-mix(in srgb, var(--fx, #ff7a2f) 72%, #000), color-mix(in srgb, var(--fx, #ff7a2f) 88%, #000)); box-shadow: 0 0 14px 2px var(--fx, #ff7a2f); transform: translateY(1px) scaleY(.985); transform-origin: top; }
.pn-drawer.pn-fxon .pn-key.is-on::after, .pn-drawer.pn-fxon .pn-key.is-auto::after { content: ''; position: absolute; left: 12%; right: 12%; top: -5px; height: 7px; border-radius: 6px; background: var(--fx, #ff7a2f); filter: blur(4px); opacity: .9; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .pn-drawer.pn-fxon .pn-white.is-on, .pn-drawer.pn-fxon .pn-white.is-auto, .pn-drawer.pn-fxon .pn-black.is-on, .pn-drawer.pn-fxon .pn-black.is-auto { transform: none; } }
