/* MIDI Studio — full-viewport MuseScore / YouTube-style stage */

body:has(.ms-studio) {
  background: #12151a;
}

.ms-main-bleed {
  max-width: none !important;
}

.ms-studio {
  --ms-stage: #1a1e26;
  --ms-chrome: #12151a;
  --ms-chrome-border: #2a303a;
  --ms-paper: #fffef9;
  --ms-ink: #1a1a1a;
  --ms-muted: #9aa3ad;
  --ms-accent: #6eb6ff;
  --ms-play: #3d9a64;
  --ms-top-h: 52px;
  --ms-bot-h: 64px;
  --ms-lib-w: 280px;
  --ms-nav-offset: 56px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  /* Full viewport under the site navbar — YouTube-style player */
  height: calc(100dvh - var(--ms-nav-offset));
  min-height: 480px;
  max-height: calc(100dvh - var(--ms-nav-offset));
  background: var(--ms-stage);
  color: #e8ecf1;
  position: relative;
  overflow: hidden;
}

.ms-studio-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .ms-studio {
    --ms-nav-offset: 72px;
  }
}

/* —— Top chrome —— */
.ms-chrome-top {
  flex: 0 0 var(--ms-top-h);
  height: var(--ms-top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.85rem;
  background: var(--ms-chrome);
  border-bottom: 1px solid var(--ms-chrome-border);
  z-index: 5;
}

.ms-track-meta {
  min-width: 0;
  flex: 1;
}

.ms-track-meta h1,
.ms-track-meta .ms-track-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #f3f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.ms-track-meta .ms-author {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ms-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-chrome-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Thin progress seam under title — between chrome and sheet */
.ms-seek-seam {
  flex: 0 0 3px;
  height: 3px;
  position: relative;
  background: #252a34;
  z-index: 6;
}

.ms-seek-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #3d9a64, #6eb6ff);
  pointer-events: none;
}

.ms-seek-range {
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  width: 100%;
  height: 14px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.ms-seek-seam:hover .ms-seek-fill,
.ms-seek-seam:focus-within .ms-seek-fill {
  box-shadow: 0 0 0 1px rgba(110, 182, 255, 0.35);
}

.ms-seek-range:disabled {
  cursor: default;
}

.ms-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: #c5ccd4;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.ms-icon-btn:hover,
.ms-icon-btn[aria-pressed="true"],
.ms-icon-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ms-icon-btn span {
  display: none;
}

@media (min-width: 768px) {
  .ms-icon-btn span {
    display: inline;
  }
}

/* —— Stage —— */
.ms-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.65rem 0.75rem;
  position: relative;
  background:
    radial-gradient(ellipse at center, #242a35 0%, var(--ms-stage) 70%);
}

.ms-empty-player {
  margin: auto;
  text-align: center;
  color: var(--ms-muted);
  padding: 2rem;
}

.ms-empty-player[hidden],
.ms-player-area[hidden] {
  display: none !important;
}

.ms-empty-player i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.65rem;
  opacity: 0.45;
}

.ms-player-area {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0.5rem;
  position: relative;
}

.ms-studio.ms-lyrics-open .ms-player-area {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
}

.ms-studio.ms-study-open .ms-player-area {
  grid-template-rows: minmax(0, 1fr) minmax(170px, 38%);
}

.ms-sheet-row {
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  grid-column: 1;
  grid-row: 1;
}

.ms-studio.ms-lyrics-open .ms-sheet-row {
  /* sheet stays in column 1; lyrics is separate grid cell */
}

/*
  Paper hymn sheet — OpenSheetMusicDisplay renders paginated MusicXML pages
  (systems wrap to the page width; extra music continues on page 2, 3, …).
*/
.ms-sheet {
  background: var(--ms-paper);
  color: var(--ms-ink);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 18px 48px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
  width: min(100%, 960px);
  height: 100%;
  min-height: 260px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.ms-sheet-canvas {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: auto;
  padding: 1.1rem 1rem 1.35rem;
  background: var(--ms-paper);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.ms-osmd {
  width: 100%;
  min-height: 220px;
}

.ms-osmd svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1.1rem;
  background: var(--ms-paper);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.ms-sheet-msg {
  margin: 2rem 1rem;
  text-align: center;
  color: #5c6b79;
  font-size: 0.95rem;
}

/* Native player: audio engine only — UI seek lives under the title */
.ms-native-player {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0);
}

/* Lyrics side panel — hidden by default; can stay open with chords */
.ms-side-drawer {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 0;
  background: #161a21;
  border: 1px solid var(--ms-chrome-border);
  border-radius: 0.45rem;
  display: flex;
  flex-direction: column;
  animation: ms-slide-in 0.2s ease;
  overflow: hidden;
}

.ms-studio.ms-study-open .ms-side-drawer {
  grid-row: 1 / span 3;
}

.ms-side-drawer[hidden] {
  display: none !important;
}

@keyframes ms-slide-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

.ms-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--ms-chrome-border);
  font-size: 0.85rem;
  color: #e8ecf1;
  flex-shrink: 0;
}

.ms-drawer-close {
  border: 0;
  background: transparent;
  color: var(--ms-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.ms-drawer-close:hover {
  color: #fff;
}

.ms-lyrics {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0.85rem 1rem 1.25rem;
  white-space: pre-wrap;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #e4e8ee;
}

.ms-lyrics .ms-verse {
  margin-bottom: 1.1rem;
}

.ms-hint {
  font-size: 0.78rem;
  color: var(--ms-muted);
  margin: 0 0 0.65rem;
  padding: 0 0.85rem;
}

/* Study drawer (piano / guitar) — sits under the sheet; works with lyrics open */
.ms-study-drawer {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  background: #161a21;
  border: 1px solid var(--ms-chrome-border);
  border-radius: 0.55rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ms-study-drawer[hidden] {
  display: none !important;
}

.ms-study-drawer #ms-panel-piano,
.ms-study-drawer #ms-panel-guitar {
  overflow: auto;
  padding: 0 0.85rem 0.85rem;
}

.ms-study-drawer #ms-panel-piano:not([hidden]) + #ms-panel-guitar:not([hidden]) {
  border-top: 1px solid var(--ms-chrome-border);
  padding-top: 0.65rem;
}

.ms-chord-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ms-chord-pill {
  display: inline-flex;
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  background: #222833;
  border: 1px solid #343b48;
  font-weight: 600;
  color: var(--ms-accent);
  font-size: 0.9rem;
}

.ms-guitar-grid,
.ms-piano-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}

.ms-piano-card {
  text-align: center;
  border: 1px solid #d8dde5;
  border-radius: 0.45rem;
  padding: 0.45rem 0.4rem 0.55rem;
  background: #fffef9;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ms-piano-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #0d3b66;
  font-size: 0.9rem;
}

.ms-piano-card svg {
  width: 100%;
  max-width: 150px;
  height: auto;
}

.ms-piano-card.is-active {
  border-color: #3d9a64;
  box-shadow: 0 0 0 2px rgba(61, 154, 100, 0.35);
  transform: translateY(-1px);
  background: #f3faf6;
}

.ms-guitar-card {
  text-align: center;
  border: 1px solid #d8dde5;
  border-radius: 0.45rem;
  padding: 0.45rem 0.3rem 0.55rem;
  background: #fffef9;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ms-guitar-card strong {
  display: block;
  margin-bottom: 0.3rem;
  color: #0d3b66;
  font-size: 0.9rem;
}

.ms-guitar-card svg {
  width: 100%;
  max-width: 90px;
  height: auto;
}

.ms-guitar-card.is-active {
  border-color: #0d3b66;
  box-shadow: 0 0 0 2px rgba(13, 59, 102, 0.3);
  transform: translateY(-1px);
  background: #f3f7fb;
}

/* OSMD playback cursor */
.ms-osmd .cursor,
.ms-osmd [class*="cursor"] {
  fill: rgba(61, 154, 100, 0.28) !important;
  stroke: #3d9a64 !important;
}

/* —— Bottom transport —— */
.ms-chrome-bottom {
  flex: 0 0 var(--ms-bot-h);
  height: var(--ms-bot-h);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.85rem;
  background: var(--ms-chrome);
  border-top: 1px solid var(--ms-chrome-border);
  z-index: 5;
}

.ms-tb-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0.15rem;
  color: var(--ms-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ms-tb-ctrl select {
  appearance: none;
  -webkit-appearance: none;
  background: #1c212b 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='%239aa3ad'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
  background-size: 8px 5px;
  border: 1px solid #343b48;
  color: #e8ecf1;
  border-radius: 0.35rem;
  padding: 0.28rem 1.35rem 0.28rem 0.5rem;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  min-width: 3.6rem;
}

.ms-tb-ctrl select:focus-visible {
  outline: 2px solid var(--ms-accent);
  outline-offset: 1px;
}

@media (max-width: 575px) {
  .ms-tb-ctrl span { display: none; }
}

.ms-tb-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: #252a34;
  color: #e8ecf1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.ms-tb-btn:hover {
  background: #323844;
}

.ms-tb-btn:active {
  transform: scale(0.94);
}

.ms-tb-btn:focus-visible {
  outline: 2px solid var(--ms-accent);
  outline-offset: 2px;
}

/* Primary play ↔ stop toggle */
.ms-play-toggle {
  width: 48px;
  height: 48px;
  background: var(--ms-play);
  color: #fff;
  box-shadow: 0 4px 14px rgba(61, 154, 100, 0.35);
  position: relative;
}

.ms-play-toggle:hover {
  background: #48b078;
  box-shadow: 0 6px 18px rgba(61, 154, 100, 0.45);
}

.ms-play-toggle .fa-play {
  margin-left: 2px; /* optical center for triangle */
}

.ms-play-toggle.is-playing {
  background: #c45c4a;
  box-shadow: 0 4px 14px rgba(196, 92, 74, 0.4);
}

.ms-play-toggle.is-playing:hover {
  background: #d46a58;
}

.ms-play-toggle.is-playing::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(196, 92, 74, 0.45);
  animation: ms-play-ring 1.4s ease-out infinite;
  pointer-events: none;
}

@keyframes ms-play-ring {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.18); opacity: 0; }
}

.ms-play-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.ms-play-toggle:disabled:hover {
  background: var(--ms-play);
}

.ms-play-toggle:disabled.is-playing:hover {
  background: #c45c4a;
}

.ms-tb-text {
  width: auto;
  border-radius: 999px;
  padding: 0 0.9rem;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.ms-tb-spacer {
  flex: 1;
}

.ms-play-count {
  font-size: 0.78rem;
  color: var(--ms-muted);
  white-space: nowrap;
  margin-right: 0.35rem;
}

/* —— Always-on library (desktop docked) —— */
.ms-library-panel {
  flex: 0 0 var(--ms-lib-w);
  width: var(--ms-lib-w);
  background: #161a21;
  border-right: 1px solid var(--ms-chrome-border);
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ms-library-panel[hidden] {
  display: none !important;
}

.ms-library-hide-mobile {
  display: none;
}

.ms-library-show-mobile {
  display: none;
}

.ms-sort-toggle {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.75rem 0.45rem;
}

.ms-sort-btn {
  flex: 1;
  border: 1px solid #343b48;
  background: #1c212b;
  color: #9aa3ad;
  font-size: 0.72rem;
  padding: 0.4rem 0.35rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.ms-sort-btn.is-active,
.ms-sort-btn[aria-selected="true"] {
  background: #243044;
  border-color: #3d5a80;
  color: #e8ecf1;
  font-weight: 600;
}

.ms-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 15;
}

.ms-backdrop[hidden] {
  display: none !important;
}

/* Crawlable SEO copy below the studio */
.ms-seo {
  background: #f7f8fa;
  border-top: 1px solid #e5e9ef;
  color: #2b3542;
}

.ms-seo-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.ms-seo h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: #15202b;
}

.ms-seo h2 {
  font-size: 1.15rem;
  font-weight: 650;
  margin: 1.75rem 0 0.55rem;
  color: #1c2834;
}

.ms-seo-lead,
.ms-seo p {
  margin: 0 0 0.85rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #3d4a59;
}

.ms-seo a {
  color: #2a6f4e;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.ms-seo a:hover {
  color: #1f563c;
}

.ms-seo-features {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: #3d4a59;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ms-seo-features li + li {
  margin-top: 0.35rem;
}

.ms-seo-faq details {
  border-top: 1px solid #e5e9ef;
  padding: 0.7rem 0;
}

.ms-seo-faq details:last-child {
  border-bottom: 1px solid #e5e9ef;
}

.ms-seo-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: #1c2834;
  list-style: none;
}

.ms-seo-faq summary::-webkit-details-marker {
  display: none;
}

.ms-seo-faq details p {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
}

.ms-page-ad-wrap {
  max-width: 960px;
  margin: 1.25rem auto 0.5rem;
  padding: 0 1rem;
  text-align: center;
}

.ms-page-ad-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.ms-search-wrap {
  position: relative;
  padding: 0.5rem 0.75rem;
}

.ms-search-wrap input {
  padding-left: 2rem;
  background: #1c212b;
  border-color: #343b48;
  color: #e8ecf1;
}

.ms-search-wrap input::placeholder {
  color: #7a8490;
}

.ms-search-wrap .ms-search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7a8490;
  font-size: 0.8rem;
  pointer-events: none;
}

.ms-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ms-muted);
  margin: 0.25rem 0.85rem 0.35rem;
}

.ms-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}

.ms-result-list li button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-bottom: 1px solid #222833;
  padding: 0.65rem 0.85rem;
  display: block;
  color: inherit;
  cursor: pointer;
}

.ms-result-list li button:hover,
.ms-result-list li button.is-active {
  background: #1e2430;
}

.ms-result-list .ms-r-title {
  font-weight: 600;
  color: #eef2f6;
  display: block;
  font-size: 0.92rem;
}

.ms-result-list .ms-r-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  margin-top: 0.15rem;
}

.ms-result-list .ms-r-author {
  font-size: 0.78rem;
  color: var(--ms-muted);
}

.ms-result-list .ms-r-plays {
  font-size: 0.72rem;
  color: #7a93b0;
  font-variant-numeric: tabular-nums;
}

/* Hymn info modal */
#msInfoModal {
  z-index: 1080;
}

.ms-info-modal-content {
  border: 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.ms-info-author {
  font-size: 0.92rem;
  margin-top: -0.25rem;
}

.ms-info-dl {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7.5rem) 1fr;
  gap: 0.45rem 0.85rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.ms-info-dl dt {
  margin: 0;
  color: #6b7a8a;
  font-weight: 600;
}

.ms-info-dl dd {
  margin: 0;
  color: #1f2933;
  word-break: break-word;
}

.ms-info-desc {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid #e8edf3;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #3a4654;
  white-space: pre-wrap;
}

/* Download prepare modal — keep ads boxed so they cannot overlay the UI */
#msDownloadModal {
  z-index: 1080;
}

#msDownloadModal .modal-dialog {
  pointer-events: auto;
  z-index: 1081;
}

.ms-dl-modal-content {
  overflow: hidden;
  border: 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

#msDownloadModal .modal-body {
  min-height: 200px;
  overflow: hidden;
  position: relative;
}

.ms-prepare-countdown {
  font-variant-numeric: tabular-nums;
  color: #5c6b79;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.ms-dl-progress {
  height: 6px;
  border-radius: 99px;
  background: #e8edf3;
  overflow: hidden;
}

.ms-dl-progress .progress-bar {
  background: linear-gradient(90deg, #3d9a64, #6eb6ff);
  transition: width 0.95s linear;
}

.ms-dl-ad-wrap {
  width: 300px;
  max-width: 100%;
  height: 250px;
  max-height: 250px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  border-radius: 0.45rem;
  background: #f4f6f8;
  border: 1px solid #e2e8f0;
}

.ms-dl-ad-wrap .adsbygoogle,
.ms-dl-ad-wrap iframe {
  max-width: 100% !important;
  max-height: 250px !important;
}

.ms-dl-anim {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.ms-dl-anim[hidden] {
  display: none !important;
}

.ms-dl-scene {
  position: relative;
  height: 140px;
  margin: 0.25rem auto 0.75rem;
  max-width: 280px;
}

.ms-dl-icons {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  display: flex;
  justify-content: center;
  gap: 1.1rem;
}

.ms-dl-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  animation: ms-dl-float 2.2s ease-in-out forwards;
}

.ms-dl-icon-note { background: #3d9a64; animation-delay: 0s; }
.ms-dl-icon-piano { background: #0d3b66; animation-delay: 0.12s; }
.ms-dl-icon-guitar { background: #c45c4a; animation-delay: 0.24s; }

.ms-dl-beam {
  position: absolute;
  left: 50%;
  top: 52px;
  width: 3px;
  height: 36px;
  margin-left: -1.5px;
  border-radius: 99px;
  background: linear-gradient(180deg, #6eb6ff, #3d9a64);
  opacity: 0;
  animation: ms-dl-beam 2.2s ease-in-out forwards;
}

.ms-dl-drive {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #1a2332;
}

.ms-dl-drive i {
  font-size: 2.1rem;
  color: #334155;
  animation: ms-dl-drive-pulse 2.2s ease-in-out forwards;
}

.ms-dl-drive-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.ms-dl-anim-text {
  margin: 0;
  font-size: 0.95rem;
  color: #334155;
  font-weight: 600;
}

@keyframes ms-dl-float {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  55% { transform: translateY(42px) scale(0.72); opacity: 0.85; }
  100% { transform: translateY(58px) scale(0.35); opacity: 0; }
}

@keyframes ms-dl-beam {
  0%, 15% { opacity: 0; transform: scaleY(0.2); }
  40% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0.35; transform: scaleY(0.85); }
}

@keyframes ms-dl-drive-pulse {
  0%, 30% { transform: scale(1); }
  55% { transform: scale(1.08); color: #3d9a64; }
  100% { transform: scale(1); color: #3d9a64; }
}

@media (prefers-reduced-motion: reduce) {
  .ms-dl-icon,
  .ms-dl-beam,
  .ms-dl-drive i {
    animation: none;
  }
  .ms-dl-icon { opacity: 0.35; transform: translateY(40px) scale(0.5); }
}

@media (max-width: 899px) {
  .ms-studio {
    flex-direction: column;
  }

  .ms-library-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 92vw);
    flex: none;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.35);
  }

  .ms-library-hide-mobile {
    display: inline-block;
  }

  .ms-library-show-mobile {
    display: inline-flex;
  }

  .ms-sheet {
    width: 100%;
    max-width: none;
  }

  .ms-studio.ms-lyrics-open .ms-player-area {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(160px, 36%);
  }

  .ms-studio.ms-lyrics-open.ms-study-open .ms-player-area {
    grid-template-rows: minmax(0, 1fr) minmax(120px, 28%) minmax(140px, 30%);
  }

  .ms-side-drawer {
    grid-column: 1;
    grid-row: 2;
    border-radius: 0.45rem;
  }

  .ms-studio.ms-lyrics-open .ms-study-drawer {
    grid-row: 3;
  }

  .ms-studio.ms-lyrics-open.ms-study-open .ms-side-drawer {
    grid-row: 2;
  }
}
