/* =========================================================================
   V3 — background motion (nightclub + drifting Z coins), compact app nav,
   bottom-sheet mobile menu
   ========================================================================= */

/* ---------------- global background motion ---------------- */
.bg-motion { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bgm-club {
  position: absolute; left: -22%; top: 12%; width: 145%; max-width: none;
  opacity: 0.09; filter: saturate(1.15);
  animation: clubPan 64s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes clubPan {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-4%, -3%) scale(1.12); }
}
.bgm-coin {
  position: absolute; bottom: -140px; opacity: 0.13;
  filter: drop-shadow(0 0 12px rgba(160, 85, 255, 0.35));
  will-change: transform;
  animation: coinDrift linear infinite;
}
.bgm-c1 { left: 7%;  width: 84px;  animation-duration: 52s; animation-delay: -6s; }
.bgm-c2 { left: 78%; width: 60px;  animation-duration: 66s; animation-delay: -30s; opacity: 0.10; }
.bgm-c3 { left: 34%; width: 46px;  animation-duration: 58s; animation-delay: -44s; opacity: 0.09; }
.bgm-c4 { left: 60%; width: 100px; animation-duration: 74s; animation-delay: -18s; }
@keyframes coinDrift {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(calc(-100vh - 300px)) rotate(340deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bgm-club, .bgm-coin { animation: none; }
  .bgm-coin { bottom: auto; top: 30%; }
}
@media (max-width: 820px) {
  .bgm-club { opacity: 0.07; }
  .bgm-c3 { display: none; }
}

/* slow ken-burns motion on section artwork */
.sec-art img { animation: kenburns 46s ease-in-out infinite alternate; will-change: transform; }
@keyframes kenburns {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.12) translate(-2.5%, -2%); }
}
@media (prefers-reduced-motion: reduce) { .sec-art img { animation: none; } }

/* ================= compact app bottom nav (smaller v3) ================= */
@media (max-width: 820px) {
  .bottom-nav {
    width: min(384px, calc(100% - 24px));
    bottom: 7px;
    border-radius: 16px;
    padding: 3px 4px calc(3px + env(safe-area-inset-bottom, 0px));
  }
  .bn-item {
    min-height: 41px;
    font-size: 7.6px; letter-spacing: 0.04em;
    gap: 1px; padding: 4px 2px 3px; border-radius: 11px;
  }
  .bn-item svg { width: 17px; height: 17px; }
  .bn-item.active { background: rgba(140, 70, 250, 0.16); box-shadow: inset 0 0 0 1px rgba(190, 130, 255, 0.22); }
  .bn-hub { transform: translateY(-6px); }
  .bn-hub-btn {
    width: 37px; height: 37px; border-width: 1.5px;
    box-shadow: 0 0 12px rgba(160, 85, 255, 0.55), 0 4px 9px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
  .bn-hub-btn img { width: 23px; height: 23px; }
  body { padding-bottom: 62px; }
  .toast { bottom: 72px; }
  footer { padding-bottom: 30px; }
}

/* ================= bottom-sheet mobile menu (phones) ================= */
@media (max-width: 820px) {
  body.menu-open::before {
    content: ''; position: fixed; inset: 0; z-index: 98;
    background: rgba(3, 0, 14, 0.62);
    backdrop-filter: blur(3px);
  }
  .mobile-menu {
    inset: auto 12px calc(62px + env(safe-area-inset-bottom, 0px)) 12px;
    max-width: 384px; margin: 0 auto;
    border-radius: 20px;
    max-height: 62vh; overflow: auto;
    padding: 14px 12px 12px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start;
    border: 1.5px solid transparent;
    background:
      linear-gradient(160deg, rgba(30, 11, 62, 0.97), rgba(12, 4, 32, 0.99)) padding-box,
      linear-gradient(160deg, rgba(240, 220, 255, 0.75), rgba(139, 61, 255, 0.65) 35%, rgba(70, 25, 140, 0.5) 65%, rgba(190, 130, 255, 0.75)) border-box;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6), 0 0 26px rgba(139, 61, 255, 0.35);
    transform: translateY(14px);
    transition: opacity 0.24s ease, transform 0.24s ease;
  }
  .mobile-menu.open { transform: none; }
  .mobile-menu a {
    font-family: var(--font-lbl); font-weight: 700; font-size: 14px; letter-spacing: 0.08em;
    color: var(--lav-2); text-align: center;
    padding: 11px 8px; border-radius: 11px;
    background: rgba(140, 70, 250, 0.10);
    border: 1px solid rgba(170, 100, 255, 0.18);
    opacity: 1; transform: none; transition: background 0.2s;
  }
  .mobile-menu a:active { background: rgba(140, 70, 250, 0.26); }
  .mobile-menu .btn { grid-column: 1 / -1; margin-top: 4px; opacity: 1; min-height: 44px; font-size: 13.5px; }
  .mobile-menu .menu-close { display: none; }
}
