/* Shared responsive controls for the ButtonBass guitar family. */
.bb-mobile-fretboard,
.bb-mobile-tools-shell,
.bb-mobile-strum-launch,
.bb-mobile-strummer,
.bb-pwa-install {
  display: none;
}

.bb-mobile-strummer[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  html,
  body {
    max-width: 100%;
    min-width: 0 !important;
    overflow-x: clip;
  }

  .piano-drop-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .piano-drop-container h1 {
    font-size: clamp(1.45rem, 7vw, 1.8rem) !important;
    line-height: 1.15 !important;
  }

  .bb-mobile-strum-launch {
    display: block;
    width: 100%;
    max-width: 720px;
    margin: 8px auto 18px;
  }

  #bb-mobile-strum-launch {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 78px;
    padding: 13px 16px;
    border: 1px solid rgba(181, 255, 194, 0.85);
    border-radius: 18px;
    color: #08240f;
    background: linear-gradient(135deg, #a7efaf 0%, #68d77c 48%, #35b85a 100%);
    box-shadow: 0 12px 28px rgba(32, 176, 76, 0.3), inset 0 1px rgba(255, 255, 255, 0.72);
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #bb-mobile-strum-launch:active {
    transform: translateY(1px) scale(0.995);
  }

  #bb-mobile-strum-launch:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
  }

  .bb-mobile-strum-launch-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(7, 55, 18, 0.13);
    font-size: 1.65rem;
  }

  .bb-mobile-strum-launch-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .bb-mobile-strum-launch-copy strong {
    font-size: 1.15rem;
    line-height: 1.15;
    letter-spacing: 0.1px;
    text-transform: uppercase;
  }

  .bb-mobile-strum-launch-copy small {
    margin-top: 4px;
    color: rgba(7, 39, 14, 0.78);
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .bb-mobile-strum-launch-arrow {
    font-size: 1.7rem;
    line-height: 1;
  }

  .bb-pwa-install {
    display: block;
    width: 100%;
    max-width: 720px;
    margin: -7px auto 20px;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
  }

  .bb-pwa-install-button {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 68px;
    padding: 11px 15px;
    border: 1px solid rgba(255, 210, 92, 0.72);
    border-radius: 16px;
    color: #fff9e8;
    background: linear-gradient(135deg, #322b14, #1f2718 68%, #15311d);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .bb-pwa-install-button:active {
    transform: translateY(1px);
  }

  .bb-pwa-install-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
  }

  .bb-pwa-install.is-ready .bb-pwa-install-button {
    border-color: rgba(168, 255, 182, 0.9);
    background: linear-gradient(135deg, #17351f, #1d4828 62%, #28653a);
    box-shadow: 0 8px 24px rgba(40, 172, 75, 0.28), inset 0 1px rgba(255, 255, 255, 0.12);
  }

  .bb-pwa-install.is-ready .bb-pwa-install-icon {
    background: #9bf0aa;
  }

  .bb-pwa-install.is-waiting .bb-pwa-install-button {
    border-color: rgba(255, 210, 92, 0.5);
  }

  .bb-pwa-install-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #112018;
    background: #ffd970;
    font-size: 1.25rem;
    font-weight: 900;
  }

  .bb-pwa-install-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .bb-pwa-install-copy strong {
    font-size: 1rem;
    line-height: 1.15;
  }

  .bb-pwa-install-copy small {
    margin-top: 3px;
    color: #cbd8c8;
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .bb-pwa-install-arrow {
    color: #ffd970;
    font-size: 1.35rem;
  }

  .bb-pwa-install-help {
    margin: 8px 3px 0;
    color: #dbe6d9;
    font-size: 0.78rem;
    line-height: 1.35;
  }

}

/* The player itself remains fully styled if the Fullscreen API changes the
   viewport width beyond the mobile breakpoint (common in browser emulation and
   on large tablets). The launch button still only appears on small screens. */
html.bb-strum-open,
html.bb-strum-open body {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

.bb-mobile-strummer {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100%;
    box-sizing: border-box;
    color: #f5fff6;
    background: #090e0a;
    opacity: 0;
    transform: scale(1.01);
    transition: opacity 0.16s ease, transform 0.16s ease;
    overflow: hidden;
    overscroll-behavior: none;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
  }

  .bb-mobile-strummer.is-open {
    opacity: 1;
    transform: none;
  }

.bb-mobile-strummer:fullscreen {
    width: 100%;
    height: 100%;
  }

  .bb-mobile-strummer.is-app-mode .bb-strum-header {
    justify-content: flex-start;
  }

  .bb-app-install-help {
    position: fixed;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    z-index: 2147483600;
    margin: 0 auto;
    max-width: 480px;
    padding: 12px 15px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 217, 112, 0.62);
    border-radius: 14px;
    color: #fff9e8;
    background: rgba(26, 31, 24, 0.96);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    font: 700 0.86rem/1.4 'Outfit', 'Segoe UI', sans-serif;
    text-align: center;
  }

  .bb-strum-rotate-notice {
    display: none;
  }

  .bb-strum-instruments {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(126, 200, 138, 0.16);
    background: #0c160f;
  }

  .bb-strum-instrument {
    min-width: 0;
    min-height: 42px;
    padding: 7px 4px;
    border: 1px solid rgba(157, 205, 165, 0.24);
    border-radius: 11px;
    color: #c9d8cb;
    background: #17231a;
    font: 750 clamp(0.68rem, 2.8vw, 0.82rem) 'Outfit', 'Segoe UI', sans-serif;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .bb-strum-instrument[aria-pressed='true'] {
    color: #09200e;
    border-color: #a9efb2;
    background: linear-gradient(135deg, #9be9a6, #57c66d);
    box-shadow: 0 0 14px rgba(91, 208, 112, 0.24);
  }

  .bb-strum-theme-electric .bb-strum-instrument[aria-pressed='true'] {
    color: #071925;
    border-color: #a7ddff;
    background: linear-gradient(135deg, #9fe2ff, #4fb4ef);
    box-shadow: 0 0 14px rgba(74, 174, 238, 0.3);
  }

  .bb-strum-theme-distorted .bb-strum-instrument[aria-pressed='true'] {
    color: #2b0905;
    border-color: #ffc0a5;
    background: linear-gradient(135deg, #ffb486, #ed6546);
    box-shadow: 0 0 14px rgba(237, 91, 63, 0.32);
  }

  .bb-strum-theme-bass .bb-strum-instrument[aria-pressed='true'] {
    color: #1d0d27;
    border-color: #e0b8ff;
    background: linear-gradient(135deg, #ddb0ff, #a164d2);
    box-shadow: 0 0 14px rgba(166, 96, 218, 0.3);
  }

  .bb-strum-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 14px 6px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(126, 200, 138, 0.18);
    background: linear-gradient(180deg, #142317, #0c150e);
  }

  .bb-strum-header > div {
    display: flex;
    flex-direction: column;
  }

  .bb-strum-eyebrow {
    color: #83b88a;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    line-height: 1;
    text-transform: uppercase;
  }

  #bb-strum-chord-name {
    margin-top: 3px;
    color: #f2fff4;
    font-size: 1.2rem;
    line-height: 1.1;
  }

  .bb-strum-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    font: 400 2rem/1 'Segoe UI', sans-serif;
    cursor: pointer;
  }

  .bb-strum-close:focus-visible,
  .bb-strum-instrument:focus-visible,
  .bb-strum-chord:focus-visible,
  .bb-strum-string:focus-visible {
    outline: 3px solid #b9f4c1;
    outline-offset: -3px;
  }

  .bb-strum-chords {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    overflow: visible;
    background: #101912;
  }

  .bb-strum-chord {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 9px 10px;
    border: 1px solid rgba(126, 200, 138, 0.22);
    border-radius: 14px;
    color: #d8ebda;
    background: #1c2a1f;
    font: 700 1rem 'Outfit', 'Segoe UI', sans-serif;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .bb-strum-chord[aria-pressed='true'] {
    color: #08200e;
    border-color: #a9efb2;
    background: linear-gradient(135deg, #9be9a6, #57c66d);
    box-shadow: 0 0 16px rgba(91, 208, 112, 0.3);
  }

  @media (orientation: portrait) and (max-height: 700px) {
    .bb-strum-header {
      min-height: 50px;
      padding-top: calc(4px + env(safe-area-inset-top, 0px));
      padding-bottom: 4px;
    }

    .bb-strum-chords {
      gap: 6px;
      padding: 7px;
    }

    .bb-strum-instruments {
      gap: 5px;
      padding: 6px 7px;
    }

    .bb-strum-instrument {
      min-height: 36px;
      padding: 5px 3px;
      font-size: 0.66rem;
    }

    .bb-strum-chord {
      min-height: 44px;
      padding: 6px 8px;
    }
  }

  .bb-strum-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    isolation: isolate;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: none;
    background:
      radial-gradient(ellipse at 50% 48%, rgba(255, 227, 164, 0.16), transparent 37%),
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 7px),
      linear-gradient(90deg, #8b4c20 0%, #c47b37 22%, #d4944c 50%, #be6f31 78%, #7b3f1c 100%);
  }

  .bb-strum-theme-electric .bb-strum-stage {
    background:
      radial-gradient(ellipse at 50% 48%, rgba(178, 228, 255, 0.2), transparent 37%),
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 8px),
      linear-gradient(90deg, #142d3d 0%, #2773a0 24%, #4296bd 50%, #276b92 78%, #102636 100%);
  }

  .bb-strum-theme-distorted .bb-strum-stage {
    background:
      radial-gradient(ellipse at 50% 48%, rgba(255, 158, 118, 0.2), transparent 37%),
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0, rgba(255, 255, 255, 0.022) 1px, transparent 1px, transparent 8px),
      linear-gradient(90deg, #29100d 0%, #722b20 24%, #a34a34 50%, #692319 78%, #210b09 100%);
  }

  .bb-strum-theme-bass .bb-strum-stage {
    background:
      radial-gradient(ellipse at 50% 48%, rgba(229, 191, 255, 0.18), transparent 37%),
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0, rgba(255, 255, 255, 0.022) 1px, transparent 1px, transparent 8px),
      linear-gradient(90deg, #25142c 0%, #5a3367 24%, #81518d 50%, #52305e 78%, #1e1125 100%);
  }

  .bb-strum-stage::before,
  .bb-strum-stage::after {
    content: '';
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(180deg, #ead7a5, #957344);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.38);
  }

  .bb-strum-stage::before { top: 3%; }
  .bb-strum-stage::after { bottom: 3%; transform: rotate(180deg); }

  .bb-strum-soundhole {
    position: absolute;
    z-index: 0;
    top: 48%;
    left: 50%;
    width: min(68vw, 310px);
    aspect-ratio: 1;
    border: clamp(7px, 2vw, 13px) solid #3c2113;
    border-radius: 50%;
    background: radial-gradient(circle, #080706 0 53%, #24130c 54% 60%, #d5a05b 61% 63%, #3e2213 64% 100%);
    box-shadow: 0 0 0 3px rgba(255, 218, 148, 0.35), inset 0 0 42px #000, 0 8px 24px rgba(0, 0, 0, 0.36);
    transform: translate(-50%, -50%);
  }

  .bb-strum-bridge {
    position: absolute;
    z-index: 1;
    left: 9%;
    right: 9%;
    bottom: 10%;
    height: 40px;
    border-radius: 9px;
    background: linear-gradient(180deg, #4b2816, #28150d);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.46);
  }

  .bb-strum-strings {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(var(--bb-string-count, 6), minmax(0, 1fr));
  }

  .bb-strum-string {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #f5e8c7;
    background: transparent;
    box-shadow: none;
    cursor: none;
    touch-action: none;
    appearance: none;
    -webkit-appearance: none;
    transition: none;
    -webkit-tap-highlight-color: transparent;
  }

  .bb-mobile-strummer .bb-strum-string:hover,
  .bb-mobile-strummer .bb-strum-string:active,
  .bb-mobile-strummer .bb-strum-string:focus {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    filter: none;
    transform: none;
  }

  .bb-strum-string::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: var(--bb-string-width, 2px);
    background: linear-gradient(90deg, #6e5c3f, #fff5c7 45%, #8e7347 100%);
    box-shadow: 1px 0 rgba(0, 0, 0, 0.46), 0 0 3px rgba(255, 240, 194, 0.34);
    transform: translateX(-50%);
    transform-origin: center;
  }

  .bb-strum-string-1 { --bb-string-width: 5px; }
  .bb-strum-string-2 { --bb-string-width: 4px; }
  .bb-strum-string-3 { --bb-string-width: 3px; }
  .bb-strum-string-4 { --bb-string-width: 2.5px; }
  .bb-strum-string-5 { --bb-string-width: 2px; }
  .bb-strum-string-6 { --bb-string-width: 1.5px; }

  .bb-strum-string > span {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: calc(4% + env(safe-area-inset-bottom, 0px));
    min-width: 34px;
    padding: 4px 5px;
    border-radius: 999px;
    color: #29180e;
    background: rgba(255, 238, 194, 0.88);
    font-size: 0.65rem;
    font-weight: 800;
    transform: translateX(-50%);
  }

  .bb-strum-string.is-muted {
    opacity: 0.42;
  }

  .bb-strum-string.is-muted > span::after {
    content: ' ×';
  }

  .bb-strum-string.is-ringing::before {
    animation: bb-string-ring 0.22s ease-out;
  }

  .bb-strum-instruction {
    position: absolute;
    z-index: 2;
    top: 20%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(72%, 300px);
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: #fff7e9;
    background: rgba(38, 20, 10, 0.56);
    backdrop-filter: blur(5px);
    text-align: center;
    pointer-events: none;
    transform: translateX(-50%);
  }

  .bb-strum-instruction strong {
    font-size: 1rem;
  }

  .bb-strum-instruction span {
    margin-top: 2px;
    font-size: 0.72rem;
    opacity: 0.82;
  }

  .bb-strum-pick {
    position: absolute;
    z-index: 8;
    width: 34px;
    height: 42px;
    margin: -21px 0 0 -17px;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 52% 52% 52% 16%;
    background: linear-gradient(145deg, #b8f4bf, #4bc465);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.7);
    opacity: 0;
    pointer-events: none;
    transform: rotate(45deg) scale(0.72);
    transition: opacity 0.1s ease, transform 0.1s ease;
  }

  .bb-strum-pick::after {
    content: 'BB';
    position: absolute;
    top: 11px;
    left: 8px;
    color: #15351c;
    font-size: 0.55rem;
    font-weight: 900;
    transform: rotate(-45deg);
  }

  .bb-strum-pick.is-visible {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }

@keyframes bb-string-ring {
    0% { transform: translateX(-50%) scaleX(1); filter: brightness(1); }
    30% { transform: translateX(-50%) scaleX(4.5); filter: brightness(1.8); }
    60% { transform: translateX(-50%) scaleX(0.6); }
    100% { transform: translateX(-50%) scaleX(1); filter: brightness(1); }
  }

/* If a browser refuses the Screen Orientation lock (notably iPhone Safari),
   never swap the instrument to the wide layout. Ask for portrait instead. */
@media (orientation: landscape) and (max-height: 900px) {
  html.bb-strum-open .bb-mobile-strummer.is-mobile-device .bb-strum-chords,
  html.bb-strum-open .bb-mobile-strummer.is-mobile-device .bb-strum-stage {
    display: none;
  }

  html.bb-strum-open .bb-mobile-strummer.is-mobile-device .bb-strum-rotate-notice {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 0;
    padding: 24px;
    box-sizing: border-box;
    color: #effff1;
    background: radial-gradient(circle at 50% 44%, #24452b, #0b140d 68%);
    text-align: center;
  }

  html.bb-strum-open .bb-mobile-strummer.is-mobile-device .bb-strum-rotate-notice > span {
    font-size: clamp(2.6rem, 11vh, 5rem);
    transform: rotate(-12deg);
  }

  html.bb-strum-open .bb-mobile-strummer.is-mobile-device .bb-strum-rotate-notice strong {
    font-size: clamp(1.25rem, 5vh, 2rem);
  }

  html.bb-strum-open .bb-mobile-strummer.is-mobile-device .bb-strum-rotate-notice p {
    margin: 0;
    color: #a9cbae;
    font-size: 0.9rem;
  }
}

/* A desktop browser can enter a wide fullscreen viewport after the launch
   button was opened from a narrow window. Give it a purpose-built landscape
   instrument instead of treating the computer like a rotated phone. */
@media (orientation: landscape) and (min-width: 700px) {
  html.bb-strum-open .bb-mobile-strummer.is-desktop-device {
    display: grid;
    grid-template-columns: clamp(240px, 22vw, 330px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    background: #08100a;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device.is-app-mode {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device.is-app-mode .bb-strum-instruments {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 8px 22px;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device.is-app-mode .bb-strum-instrument {
    min-height: 42px;
    font-size: 0.82rem;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-header {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 72px;
    padding: 10px 22px;
    border-bottom-color: rgba(146, 220, 157, 0.24);
    background:
      radial-gradient(circle at 22% 0, rgba(83, 184, 103, 0.14), transparent 34%),
      linear-gradient(180deg, #132719, #0a150d);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-eyebrow {
    font-size: 0.72rem;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device #bb-strum-chord-name {
    font-size: 1.45rem;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-close {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-chords {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto repeat(3, minmax(58px, 1fr));
    gap: clamp(8px, 1.2vh, 13px);
    align-content: center;
    min-height: 0;
    padding: clamp(18px, 3vh, 34px) clamp(14px, 1.8vw, 25px);
    box-sizing: border-box;
    border-right: 1px solid rgba(146, 220, 157, 0.18);
    background:
      radial-gradient(circle at 50% 18%, rgba(73, 160, 91, 0.2), transparent 38%),
      linear-gradient(145deg, #14251a, #0b140e 70%);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.25);
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-chords::before {
    content: 'QUICK CHORDS\A Choose a chord, then drag across the strings';
    grid-column: 1 / -1;
    align-self: end;
    margin-bottom: clamp(5px, 1vh, 11px);
    color: #8ed09a;
    font-size: clamp(0.68rem, 0.8vw, 0.78rem);
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.55;
    white-space: pre;
    text-align: center;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-chord {
    height: 100%;
    min-height: 58px;
    max-height: 88px;
    padding: 10px 6px;
    border-color: rgba(150, 215, 160, 0.28);
    border-radius: 16px;
    font-size: clamp(1rem, 1.35vw, 1.25rem);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.045), 0 5px 14px rgba(0, 0, 0, 0.18);
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-stage {
    grid-column: 2;
    grid-row: 2;
    display: block;
    min-width: 0;
    min-height: 0;
    border: clamp(12px, 1.2vw, 22px) solid #2c170d;
    border-top: 0;
    border-bottom: 0;
    box-sizing: border-box;
    box-shadow: inset 0 0 80px rgba(34, 13, 4, 0.45);
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device.is-app-mode .bb-strum-chords,
  html.bb-strum-open .bb-mobile-strummer.is-desktop-device.is-app-mode .bb-strum-stage {
    grid-row: 3;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-soundhole {
    width: min(32vw, 430px);
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-instruction {
    top: 10%;
    width: min(48%, 390px);
    padding: 12px 18px;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-instruction strong {
    font-size: 1.12rem;
  }

  html.bb-strum-open .bb-mobile-strummer.is-desktop-device .bb-strum-rotate-notice {
    display: none;
  }
}

@media (max-width: 1100px) {

  .piano-drop-container .guitarcontainer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .piano-drop-container .guitarforms,
  .piano-drop-container .guitarforms form {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    float: none !important;
    width: 100% !important;
    max-width: 720px !important;
    height: auto !important;
    margin: 0 auto 12px !important;
    overflow: visible !important;
  }

  .piano-drop-container #bb-songpick-wrap {
    width: 100% !important;
    margin: 0 auto 10px !important;
  }

  .piano-drop-container #bb-songpick-select {
    flex: 1 1 220px !important;
    width: min(100%, 420px) !important;
    min-width: 0 !important;
    max-width: 420px !important;
    min-height: 44px !important;
  }

  .piano-drop-container #PlayNotes {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 82px !important;
    min-height: 64px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    resize: vertical !important;
    overflow: auto !important;
    font-size: 1rem !important;
  }

  .piano-drop-container #songtitle {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    margin: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
    text-align: center !important;
  }

  .piano-drop-container .guitarforms > #bb-songshare-btn {
    position: static !important;
    align-self: center !important;
    width: auto !important;
    min-height: 44px !important;
    margin: 0 auto !important;
    padding: 9px 14px !important;
    box-sizing: border-box !important;
  }

  html body .piano-drop-container .guitarbuttons {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 10px !important;
    float: none !important;
    width: 100% !important;
    max-width: 720px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 12px auto !important;
    padding: 12px !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    border: 1px solid rgba(126, 200, 138, 0.2) !important;
    background: linear-gradient(180deg, rgba(20, 30, 20, 0.72), rgba(10, 16, 10, 0.72)) !important;
  }

  html body .piano-drop-container .guitarbuttons > :empty,
  html body .piano-drop-container .guitarbuttons > .bb-empty-control-shell,
  html body .piano-drop-container .guitarbuttons > #bb-glow-wrap {
    display: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .piano-drop-container .guitarbuttons > button,
  html body .piano-drop-container .guitarbuttons > form,
  html body .piano-drop-container .guitarbuttons > span,
  html body .piano-drop-container .guitarbuttons > label,
  html body .piano-drop-container .guitarbuttons > #bb-volume-wrap,
  html body .piano-drop-container .guitarbuttons > #bb-glow-wrap {
    position: static !important;
    top: auto !important;
    left: auto !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 44px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  html body .piano-drop-container .guitarbuttons > button {
    padding: 10px 8px !important;
  }

  html body .piano-drop-container .guitarbuttons > form {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html body .piano-drop-container .guitarbuttons > #bb-volume-wrap {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .piano-drop-container .bb-bpm-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .piano-drop-container .bb-bpm-label {
    color: #bfe7c5;
    font: 700 0.78rem 'Outfit', 'Segoe UI', sans-serif;
    letter-spacing: 0.4px;
  }

  .piano-drop-container #bb-bpm {
    position: static !important;
    width: 72px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  .piano-drop-container .guitardiv,
  .piano-drop-container .electricguitardiv,
  .piano-drop-container .banjodiv {
    display: none !important;
  }

  .bb-mobile-fretboard {
    display: block;
    width: 100%;
    max-width: 720px;
    margin: 14px auto 24px;
    padding: 12px;
    box-sizing: border-box;
    color: #eef8ef;
    border: 1px solid rgba(126, 200, 138, 0.26);
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(31, 49, 33, 0.96), rgba(9, 16, 10, 0.98));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  }

  .bb-mobile-fretboard-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px 10px;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
  }

  .bb-mobile-fretboard-head h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #f5fff6;
  }

  .bb-mobile-fretboard-head p {
    margin: 0;
    color: #a8bfac;
    font-size: 0.78rem;
    line-height: 1.25;
    text-align: right;
  }

  .bb-mobile-fret-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-color: #4a8f56 #101a11;
    scrollbar-width: thin;
    border-radius: 12px;
    background: #111a12;
  }

  .bb-mobile-fret-scroll:focus-visible {
    outline: 2px solid #7ec88a;
    outline-offset: 3px;
  }

  .bb-mobile-fret-grid {
    display: grid;
    grid-template-columns: 58px repeat(13, 50px);
    grid-template-rows: 32px repeat(var(--bb-string-count, 6), 48px);
    width: max-content;
    min-width: 100%;
    padding: 6px;
    box-sizing: border-box;
    gap: 4px;
    background-image: repeating-linear-gradient(90deg, transparent 0, transparent 53px, rgba(214, 224, 215, 0.1) 54px, transparent 55px);
  }

  .bb-mobile-fret-corner,
  .bb-mobile-fret-number,
  .bb-mobile-string-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-weight: 700;
  }

  .bb-mobile-fret-corner,
  .bb-mobile-string-label {
    position: sticky;
    left: 0;
    z-index: 3;
    color: #dff6e2;
    background: #17261a;
    border-right: 1px solid rgba(126, 200, 138, 0.3);
  }

  .bb-mobile-fret-corner {
    z-index: 4;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px 0 0 0;
  }

  .bb-mobile-string-label {
    font-size: 0.78rem;
  }

  .bb-mobile-fret-number {
    position: relative;
    color: #91aa95;
    font-size: 0.69rem;
  }

  .bb-mobile-fret-number.is-marker::after {
    content: '';
    position: absolute;
    bottom: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #7ec88a;
  }

  .bb-mobile-fret {
    position: relative;
    min-width: 48px;
    min-height: 46px;
    padding: 0;
    border: 1px solid rgba(217, 226, 218, 0.18);
    border-radius: 10px;
    color: #eaf7ec;
    background: linear-gradient(160deg, #29382b, #19251b);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 2px 5px rgba(0, 0, 0, 0.25);
    font: 700 0.76rem 'Outfit', 'Segoe UI', sans-serif;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .bb-mobile-fret.is-open {
    color: #122016;
    border-color: rgba(126, 200, 138, 0.8);
    background: linear-gradient(160deg, #9de0a6, #5eae6c);
  }

  .bb-mobile-fret:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 1px;
  }

  .bb-mobile-fret.is-playing {
    color: #102114;
    background: #c9f7ce;
    border-color: #f0fff2;
    transform: scale(0.94);
    box-shadow: 0 0 0 3px rgba(126, 200, 138, 0.24), 0 0 16px rgba(126, 200, 138, 0.62);
  }

  .bb-mobile-tools-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 720px;
    margin: 4px auto 14px;
  }

  #bb-mobile-tools-toggle {
    width: 100%;
    min-height: 48px;
    padding: 11px 16px;
    border: 1px solid rgba(126, 200, 138, 0.42);
    border-radius: 13px;
    color: #eaf8ec;
    background: linear-gradient(135deg, #25372a, #152019);
    font: 700 0.95rem 'Outfit', 'Segoe UI', sans-serif;
    cursor: pointer;
  }

  #bb-mobile-tools-toggle[aria-expanded='true'] {
    color: #09200d;
    background: linear-gradient(135deg, #7ed28c, #44a658);
  }

  #bb-mobile-tools-toggle:disabled {
    cursor: wait;
    opacity: 0.72;
  }

  .bb-mobile-tools-status {
    min-height: 1em;
    color: #b8cbbb;
    font: 600 0.75rem 'Outfit', 'Segoe UI', sans-serif;
  }

  html:not(.bb-mobile-tools-open) #bb-deck {
    display: none !important;
  }

  html.bb-mobile-tools-open #bb-deck {
    display: block !important;
    width: 100% !important;
    max-width: 720px !important;
    margin: 8px auto 14px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  html.bb-mobile-tools-open #bb-deck .bb-deck-rail {
    max-height: 55vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 7px;
  }

  html.bb-mobile-tools-open #bb-deck .bb-deck-group-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  html.bb-mobile-tools-open #bb-deck .bb-deck-tab {
    align-self: stretch !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 9px 7px !important;
    white-space: normal !important;
    line-height: 1.15 !important;
    text-align: center !important;
  }

  html.bb-mobile-tools-open #bb-deck .bb-deck-stage {
    padding: 10px !important;
    overflow: hidden;
  }

  html.bb-mobile-tools-open #bb-deck .bb-deck-panel,
  html.bb-mobile-tools-open #bb-deck input,
  html.bb-mobile-tools-open #bb-deck select,
  html.bb-mobile-tools-open #bb-deck textarea {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 480px) {
  .bb-mobile-fretboard-head {
    display: block;
  }

  .bb-mobile-fretboard-head p {
    margin-top: 4px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bb-mobile-fret {
    transition: none !important;
  }
}
