/* ════════════════════════════════════════════════════════════════════════
   MENU SHEET — left-side launcher. True glass, neutral tones.
   The left FAB lives here too, so the player + menu FAB CSS feel matched.
   ════════════════════════════════════════════════════════════════════════ */

.menu-fab {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.75rem);
  left:   calc(env(safe-area-inset-left,   0px) + 1.75rem);
  /* Sized off Respira's launcher pair, the house reference: 6rem desktop,
     5rem on a phone — well clear of the 44pt minimum. Solid white with a
     black glyph: the presence comes from the fill and the drop shadow, so
     nothing blurs a live backdrop on always-visible chrome. */
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  border: 1px solid rgba(19, 18, 26, 0.10);
  background: #fff;
  color: #13121a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  z-index: 850;
  /* Own compositing layer — keeps the fixed button from blanking out on
     iOS Safari over a scrolling page. */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
  box-shadow: 0 0.6rem 1.6rem  rgba(0, 0, 0, 0.45),
              0 1.5rem 3rem    rgba(0, 0, 0, 0.28),
              inset 0 -2px 6px rgba(19, 18, 26, 0.06);
}
.menu-fab svg {
  width: 2.25rem;
  height: 2.25rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 0.8rem 2rem    rgba(0, 0, 0, 0.50),
              0 2rem   3.6rem  rgba(0, 0, 0, 0.32),
              inset 0 -2px 6px rgba(19, 18, 26, 0.06);
}
.menu-fab.open {
  background: #ece8f4;
  border-color: rgba(19, 18, 26, 0.22);
  transform: rotate(45deg) scale(1.04);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}
.menu-overlay.open { pointer-events: all; }

.menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: opacity 0.30s ease;
}
.menu-overlay.open .menu-backdrop { opacity: 1; }

/* Same glass treatment as the player sheet. */
.menu-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  /* Half the screen, asked for by name. svh so a phone's browser chrome
     is accounted for rather than promised away. */
  height: 50vh;
  height: 50svh;
  max-height: 50svh;
  background: rgba(12, 12, 18, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 0.75rem 1.5rem calc(env(safe-area-inset-bottom, 0px) + 1.75rem);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.30s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: #f0f0f4;
  box-shadow: 0 -1rem 2.5rem rgba(0, 0, 0, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.menu-overlay.open .menu-sheet { transform: translateY(0); }
.menu-sheet::-webkit-scrollbar { width: 2px; }
.menu-sheet::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 2px; }

.menu-handle {
  width: 2.5rem;
  height: 3px;
  background: rgba(255, 255, 255, 0.30);
  border-radius: 2px;
  align-self: center;
  flex-shrink: 0;
  margin-bottom: 0.25rem;
}

.menu-wordmark {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  padding: 0.31rem 0 0.625rem;
}

.menu-grid {
  display: grid;
  /* auto-FIT, not auto-fill. auto-fill keeps the empty tracks, so two tiles
     sat in the left corner of a full-width row instead of sharing it. */
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  grid-auto-rows: minmax(5.5rem, auto);
  align-content: start;
  gap: 0.7rem;
}

.menu-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0.6rem;
  /* The SHEET keeps its glass; the tiles are what go solid. White with a
     black glyph, the same family as the FAB pair. */
  background: #fff;
  border: 1px solid rgba(19, 18, 26, 0.10);
  border-radius: 0.875rem;
  text-decoration: none;
  color: #13121a;
  box-shadow: 0 0.4rem 1.1rem rgba(0, 0, 0, 0.32);
  transition: transform 0.15s, box-shadow 0.18s;
  cursor: pointer;
}
.menu-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.7rem 1.7rem rgba(0, 0, 0, 0.40);
}
.menu-tile.active {
  background: #ece8f4;
  border-color: rgba(19, 18, 26, 0.22);
}
.menu-tile svg {
  width: 1.6rem;
  height: 1.6rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-tile span {
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 300;
}

@media (max-width: 600px) {
  .menu-fab {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
    left:   calc(env(safe-area-inset-left,   0px) + 1.25rem);
    width: 5rem;
    height: 5rem;
  }
  .menu-fab svg { width: 1.85rem; height: 1.85rem; }
  .menu-sheet {
    height: 50svh;
    max-height: 50svh;
    padding: 0.5rem 0.9rem calc(env(safe-area-inset-bottom, 0px) + 1.2rem);
  }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
}
