/* Scoped piano layout; other ButtonBass instruments keep their own styles. */
.virtual-piano-page { font-family: 'Outfit', 'Segoe UI', sans-serif; }
.virtual-piano-page .instrument-nav,
.virtual-piano-page .instrument-nav .nav-category,
.virtual-piano-page .instrument-nav .nav-grid { width: 100%; max-width: none; float: none; }
.virtual-piano-page .piano-drop-container {
  width: calc(100% - 32px); max-width: 1100px; margin: 32px auto;
  padding: 0; border: 0; background: none; box-shadow: none; color: #eff6f3;
}
.piano-hero { text-align: center; margin: 0 auto 24px; max-width: 740px; }
.piano-eyebrow { color: #72d9b0; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 8px; }
.piano-hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -1.8px; margin: 0 0 12px; color: #f4f8f6; }
.piano-hero h1 .piano-h1-sub { display: block; margin-top: 8px; font-size: clamp(16px, 2.2vw, 22px); font-weight: 600; letter-spacing: -0.2px; color: #b9d8ca; }
.piano-intro { color: #b0bcb9; max-width: 630px; font-size: 16px; line-height: 1.6; margin: 0 auto 12px; }
.piano-hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; color: #91a39b; font-size: 12px; }
.virtual-piano-page a { text-underline-offset: 3px; }
.piano-hero-links a, .piano-quickstart a, .piano-guide a { color: #8ce3bb; }
.virtual-piano-page .pianobackground {
  width: 100%; box-sizing: border-box; padding: 20px;
  border: 1px solid #35463e; border-radius: 18px;
  background: linear-gradient(150deg, #202b27, #121916 70%);
  box-shadow: 0 18px 55px #0005, inset 0 1px 0 #ffffff09; text-align: left;
}
.piano-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.piano-panel-heading strong { display: block; font-size: 13px; font-weight: 600; letter-spacing: 2px; }
.piano-panel-heading small { display: block; font-size: 11px; color: #8fa69a; margin-top: 5px; }
#piano-sound-status { font-size: 12px; color: #b3c9bd; text-align: right; max-width: 48%; }
.piano-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.piano-volume-control, .piano-toggles { display: flex; align-items: center; gap: 10px; }
.piano-toggles { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.piano-volume-control { font-size: 12px; color: #c2cfc8; }
#piano-volume { width: 110px; accent-color: #7ed9ad; cursor: pointer; }
#piano-volume-value { min-width: 32px; font-variant-numeric: tabular-nums; }
.piano-drop-container button, .piano-drop-container select, .piano-drop-container input, .piano-drop-container textarea { font: inherit; }
.piano-drop-container button, .piano-drop-container select, .piano-toggle-label {
  box-sizing: border-box; min-height: 42px; border: 1px solid #41534a; border-radius: 8px;
  background: #24322b; color: #e3eee7; padding: 9px 13px; font-size: 13px; font-weight: 500;
}
.piano-drop-container button, .piano-drop-container select { cursor: pointer; }
.piano-drop-container button:hover { background: #30443a; border-color: #6a917e; }
.piano-drop-container button[aria-pressed="true"] { background: #305b45; color: #c8ffdf; border-color: #6cac8a; }
.piano-drop-container button:disabled { opacity: .45; cursor: default; }
.piano-drop-container :is(button, input, select, textarea, summary, [role="button"], .piano-keyboard-viewport):focus-visible {
  outline: 3px solid #a7efce; outline-offset: 3px;
}
.piano-toggles button { font-size: 12px; min-height: 36px; padding: 7px 11px; }
.piano-sound-control { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #c2cfc8; }
.piano-sound-control select { font-size: 12px; min-height: 36px; padding: 6px 10px; }
.piano-keyboard-viewport { overflow-x: auto; overflow-y: hidden; border-radius: 5px; border-top: 5px solid #527360; box-shadow: 0 5px 15px #0005; scrollbar-width: thin; scrollbar-color: #698674 #18271e; overscroll-behavior-x: contain; }
.virtual-piano-page .piano { display: flex; align-items: flex-start; position: relative; width: 100%; padding: 0 0 5px; box-sizing: border-box; }
.piano .key { box-sizing: border-box; position: relative; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.piano .white { flex: 0 0 calc(100% / 29); height: 194px; background: linear-gradient(90deg, #e8e9df, #fffef7 25%, #fffef7 78%, #e1e3d8); border: 1px solid #7d857d; border-top: 0; border-radius: 0 0 5px 5px; box-shadow: inset 0 -6px 0 #cbd0c1; color: #3c5045; }
.piano .black { flex: 0 0 calc(100% / 29 * .62); height: 121px; margin-left: calc(100% / 29 * -.31); margin-right: calc(100% / 29 * -.31); background: linear-gradient(180deg, #222a25, #171e19 72%, #111713); border: 1px solid #070d09; border-top: 0; border-radius: 0 0 3px 3px; box-shadow: inset 1px 0 0 #ffffff0b, inset -1px 0 0 #0005, inset 0 -5px 0 #050c08, 2px 4px 4px #0007; z-index: 2; color: #d9e6de; }
.piano .key .bottom { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font: 600 14px/1 'Segoe UI', sans-serif; pointer-events: none; }
.piano .key .piano-note-name { position: absolute; bottom: 38px; left: 0; right: 0; text-align: center; font: 11px/1 'Segoe UI', sans-serif; opacity: .7; pointer-events: none; }
.piano .black .piano-note-name { font-size: 9px; }
.piano .white:is(.active, .is-held) { background: linear-gradient(#baf4d4, #6bdb9f); box-shadow: inset 0 -3px 0 #459c6c, 0 0 14px #70e2a533; border-color: #399762; }
.piano .black:is(.active, .is-held) { background: linear-gradient(#326b49, #60bb82); box-shadow: inset 0 -3px 0 #255438; }
.piano .key:focus-visible { z-index: 3; outline-offset: -3px; }
.piano-scroll-tools { display: none; }
.piano-key-hint { color: #a0b4a8; font-size: 11px; line-height: 1.6; text-align: center; margin: 12px 0 18px; }
.piano-key-hint kbd, .piano-guide kbd { font-family: 'Consolas', monospace; color: #dfefe5; }
.piano-btn-group { display: flex; flex-wrap: wrap; gap: 8px; }
#piano-controls-primary { display: grid; grid-template-columns: minmax(180px, 1fr) 116px 96px 76px 180px; grid-template-rows: 16px 44px 16px; gap: 6px 8px; align-items: center; }
#piano-controls-primary > * { min-width: 0; }
.piano-song-choice { display: grid; grid-column: 1; grid-row: 1 / 4; grid-template-rows: 16px 44px 16px; gap: 6px; margin: 0; color: #9eafa5; font-size: 10px; line-height: 16px; letter-spacing: 1px; text-transform: uppercase; }
#songpicker { width: 100%; max-width: 100%; font-size: 13px; letter-spacing: 0; text-transform: none; height: 44px; }
#piano-controls-primary > button { grid-row: 2; height: 44px; margin: 0; }
#start { background: #a6e5bd; border-color: #a6e5bd; color: #102e1e; font-weight: 700; }
#start:hover { background: #c1f7d4; }
#stop { background: #342b29; border-color: #674840; }
#practice { background: #3a3220; border-color: #8a6a1a; color: #ffe8a3; font-weight: 600; }
#practice:hover, #practice[aria-pressed="true"] { background: #4d4126; border-color: #c99a1f; }
.piano .white.practice-target { background: linear-gradient(#ffe8a3, #f2c94c); border-color: #c99a1f; box-shadow: inset 0 -3px 0 #b8860b, 0 0 16px #f2c94c66; }
.piano .black.practice-target { background: linear-gradient(#8a6a1a, #d4a93a); box-shadow: inset 0 -3px 0 #6b5110; }
.piano .key.practice-target { animation: practicePulse 1s ease-in-out infinite; }
@keyframes practicePulse { 50% { filter: brightness(1.18); } }
.piano-tempo { display: grid; grid-column: 5; grid-row: 1 / 4; grid-template-rows: 16px 44px 16px; gap: 6px; margin: 0; color: #aebfb5; font-size: 12px; letter-spacing: 0; text-transform: none; }
.piano-speed-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; line-height: 16px; letter-spacing: 1px; text-transform: uppercase; }
#piano-speed-value { flex: 0 0 auto; color: #d1efdf; font-size: 12px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.piano-tempo input[type="range"] { display: block; width: 100%; box-sizing: border-box; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; accent-color: #7ed9ad; cursor: pointer; }
.piano-speed-scale { display: flex; justify-content: space-between; gap: 8px; color: #91a79a; font-size: 11px; line-height: 16px; }
.piano-song-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; color: #a1b5a8; font-size: 12px; }
#tempo-help { margin-left: auto; text-align: right; }
#songtitle { color: #c4d9cd; font-size: 12px; }
.piano-song-step { display: flex; gap: 6px; }
.piano-song-step button { min-height: 32px; padding: 5px 9px; font-size: 11px; }
.piano-studio { margin-top: 18px; border-top: 1px solid #ffffff13; padding-top: 14px; }
.piano-studio summary { cursor: pointer; color: #cad9cf; font-size: 13px; padding: 4px 0; }
.piano-studio summary span { font-size: 11px; color: #8da295; margin-left: 8px; }
.piano-studio-body { padding-top: 14px; }
.piano-script-label { display: block; margin-bottom: 8px; font-size: 12px; color: #c6d9cd; }
.piano-script-help { font-size: 12px; line-height: 1.6; color: #9fb4a7; margin: 8px 0 12px; }
.piano-script-help a { color: #8bdaad; }
.notefield { box-sizing: border-box; display: block; width: 100%; min-height: 80px; max-height: 320px; resize: vertical; background: #0c1510; color: #bedac9; border: 1px solid #41534a; border-radius: 8px; padding: 12px; font: 12px/1.7 'Consolas', monospace !important; }
.piano-script-wrap { position: relative; }
/* Note highlight: a transparent copy of the script laid over the textarea; only the playing step shows. */
.piano-script-follow { position: absolute; top: 0; left: 0; box-sizing: border-box; overflow: hidden; pointer-events: none; user-select: none; color: transparent; background: transparent; border-style: solid; border-color: transparent; white-space: pre-wrap; overflow-wrap: break-word; }
.piano-script-follow mark { color: transparent; background: rgba(107, 219, 159, .4); outline: 1px solid rgba(107, 219, 159, .85); border-radius: 3px; }
.piano-toggle-label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.piano-toggle-label input { accent-color: #8bdaad; }
.piano-library { margin-top: 10px; }
#library-select { min-width: 170px; max-width: 320px; font-size: 13px; }
.piano-share-panel { margin-top: 12px; padding: 14px; border: 1px solid #41534a; border-radius: 10px; background: #0f1913; }
.piano-share-panel .piano-script-label { margin-top: 10px; }
.piano-share-panel .piano-script-label:first-child { margin-top: 0; }
.piano-share-input { box-sizing: border-box; display: block; width: 100%; min-height: 42px; padding: 9px 12px; background: #0c1510; color: #c9e5d4; border: 1px solid #41534a; border-radius: 8px; font-size: 14px; }
.piano-share-input[readonly] { color: #9fb4a7; font-size: 12px; }
.piano-share-panel .piano-btn-group { margin-top: 12px; }
.piano-drop-container button.piano-share-submit { background: #a6e5bd; border-color: #a6e5bd; color: #102e1e; font-weight: 700; }
.piano-drop-container button.piano-share-submit:hover { background: #c1f7d4; }
.piano-drop-container button.piano-share-submit:disabled { opacity: .55; }
.piano-recording { padding-top: 14px; margin-top: 14px; border-top: 1px solid #ffffff13; }
/* Community songs strip, laid out like the Player Piano's (#commStrip) in this page's palette. */
#commStrip { box-sizing: border-box; width: 100%; margin: 14px 0 0; padding: 10px 14px 8px; background: linear-gradient(150deg, #1b2622, #111714 70%); border: 1px solid #35463e; border-radius: 14px; text-align: left; }
#commStrip .comm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#commStrip .comm-title { font-size: 12px; font-weight: 700; color: #cde6d8; text-transform: uppercase; letter-spacing: 2px; }
#commStrip .comm-all { font-size: 12px; color: #8bdaad; text-decoration: none; white-space: nowrap; }
#commStrip .comm-all:hover { text-decoration: underline; }
#commStrip .comm-list { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #41534a transparent; min-height: 52px; align-items: stretch; padding-bottom: 6px; }
#commStrip .comm-list::-webkit-scrollbar { height: 6px; }
#commStrip .comm-list::-webkit-scrollbar-track { background: transparent; }
#commStrip .comm-list::-webkit-scrollbar-thumb { background: #41534a; border-radius: 3px; }
#commStrip .comm-empty { font-size: 12px; color: #8da295; align-self: center; }
.piano-drop-container #commStrip .comm-card { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; width: 180px; min-height: 52px; padding: 7px 12px; text-align: left; }
#commStrip .comm-t { font-size: 13px; font-weight: 700; color: #e9f3ee; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#commStrip .comm-m { font-size: 11px; color: #9fb4a7; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
#commStrip .comm-m b { color: #8bdaad; font-weight: 700; }
@media (max-width: 600px) {
  #commStrip .comm-list { scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-bottom: 0; }
  #commStrip .comm-list::-webkit-scrollbar { display: none; }
}
#record::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f58989; margin-right: 7px; }
.piano-quickstart { display: flex; justify-content: center; gap: 8px 24px; flex-wrap: wrap; font-size: 12px; line-height: 1.7; color: #a6b8ad; margin: 18px 0 0; }
.virtual-piano-page .piano-guide { max-width: 1000px; margin: 30px auto; width: calc(100% - 32px); padding: 30px; }
.piano-guide h2 { text-align: left; color: #d6efe1; margin: 28px 0 14px; font-size: 22px; }
.piano-guide h2:first-child { margin-top: 0; }
.piano-guide h3 { border: 0; color: #d6efe1; font-size: 16px; }
.piano-guide p, .piano-guide li { color: #abbeb2; font-size: 14px; line-height: 1.8; }
.piano-guide ol { padding-left: 22px; }
.piano-guide code { color: #d6efe1; background: #0c1710; padding: 3px 7px; border-radius: 4px; }
.piano-guide details { border-top: 1px solid #ffffff15; padding: 14px 0; }
.piano-guide details summary { color: #d5e7db; cursor: pointer; font-size: 14px; }
.piano-guide details p { margin-bottom: 0; }
.virtual-piano-page :is(main, h2)[id] { scroll-margin-top: 80px; }
.piano-skip-link { position: fixed; left: 12px; top: -100px; z-index: 9000; padding: 12px; border-radius: 5px; background: #bdf6d2; color: #123522; }
.piano-skip-link:focus { top: 8px; }
@media (max-width: 900px) {
  .virtual-piano-page .piano { width: 1015px; }
  .piano-scroll-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; font-size: 11px; color: #98b2a1; }
  .piano-scroll-tools button { min-height: 40px; font-size: 12px; }
}
@media (max-width: 800px) {
  #piano-controls-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto auto; gap: 8px; }
  #piano-controls-primary > button { align-self: stretch; height: auto; min-height: 44px; padding: 9px 8px; }
  .piano-song-choice { grid-column: 1 / -1; grid-row: 1; grid-template-rows: 16px 44px; }
  #piano-controls-primary .piano-tempo { grid-column: 1 / -1; grid-row: 3; }
  #piano-controls-primary .piano-tempo { margin-top: 6px; }
}
@media (max-width: 600px) {
  .virtual-piano-page .piano-drop-container { margin-top: 22px; }
  .piano-hero { margin-bottom: 20px; }
  .piano-intro { font-size: 14px; }
  .piano-hero-links { font-size: 11px; gap: 8px 14px; }
  .virtual-piano-page .pianobackground { padding: 12px; border-radius: 12px; }
  .piano-panel-heading { gap: 10px; margin-bottom: 14px; }
  .piano-panel-heading strong { font-size: 11px; }
  #piano-sound-status { font-size: 10px; }
  .piano-toolbar { gap: 12px; }
  .piano-toggles { width: 100%; }
  .piano-toggles button { min-height: 42px; }
  .piano-studio summary span { display: block; margin: 5px 0 0 16px; }
  .piano-studio .piano-btn-group > * { flex: 1 1 125px; }
  .piano-song-meta { gap: 10px; }
  #tempo-help { flex-basis: 100%; margin-left: 0; text-align: left; }
  .piano-guide { padding: 20px !important; }
}
@media (prefers-reduced-motion: reduce) { .piano-keyboard-viewport { scroll-behavior: auto; } .piano .key.practice-target { animation: none; } }
