.mobile-tabbar {
  display: none;
}

@media (max-width: 760px) {
  body.has-mobile-tabbar {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .mobile-tabbar {
    position: fixed;
    z-index: 80;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    min-height: 64px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 50px rgba(35, 42, 58, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .mobile-tabbar a {
    min-width: 0;
    min-height: 52px;
    padding: 5px 4px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 18px;
    color: #667280;
    font-size: 10px;
    font-weight: 680;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
  }

  .mobile-tabbar a[aria-current="page"] {
    color: #d93470;
    background: linear-gradient(135deg, rgba(255, 79, 139, 0.13), rgba(255, 138, 91, 0.1));
  }

  .mobile-tabbar a:focus-visible {
    outline: 3px solid rgba(255, 79, 139, 0.32);
    outline-offset: 1px;
  }

  .mobile-tabbar-icon {
    width: 22px;
    height: 22px;
    display: block;
    background: currentColor;
    -webkit-mask: var(--mobile-tab-icon) center / contain no-repeat;
    mask: var(--mobile-tab-icon) center / contain no-repeat;
  }

  .mobile-tabbar [data-mobile-tab="drops"] .mobile-tabbar-icon {
    --mobile-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5v-13Zm3 1v11h10v-11H7Zm1.5 8 2.2-2.7 1.8 2.1 1.4-1.6 1.6 2.2h-7Z'/%3E%3C/svg%3E");
  }

  .mobile-tabbar [data-mobile-tab="following"] .mobile-tabbar-icon {
    --mobile-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 21s-8-4.6-8-11.2A4.8 4.8 0 0 1 12 6a4.8 4.8 0 0 1 8 3.8C20 16.4 12 21 12 21Z'/%3E%3C/svg%3E");
  }

  .mobile-tabbar [data-mobile-tab="progress"] .mobile-tabbar-icon {
    --mobile-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a9 9 0 1 1-8.5 6h3.3A6 6 0 1 0 12 6V3Zm-1.5 4h3v5.1l3.2 2-1.6 2.5-4.6-2.9V7Z'/%3E%3C/svg%3E");
  }

  .mobile-tabbar [data-mobile-tab="profile"] .mobile-tabbar-icon {
    --mobile-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Zm0 2c-5 0-8 2.6-8 6v1h16v-1c0-3.4-3-6-8-6Z'/%3E%3C/svg%3E");
  }

  :root[data-theme="night"] .mobile-tabbar,
  body[data-theme="night"] .mobile-tabbar {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(16, 21, 31, 0.92);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.38);
  }

  :root[data-theme="night"] .mobile-tabbar a,
  body[data-theme="night"] .mobile-tabbar a {
    color: #91a0b2;
  }

  :root[data-theme="night"] .mobile-tabbar a[aria-current="page"],
  body[data-theme="night"] .mobile-tabbar a[aria-current="page"] {
    color: #ff7aa6;
    background: linear-gradient(135deg, rgba(255, 79, 139, 0.2), rgba(255, 138, 91, 0.12));
  }

  body.mobile-nav-hidden .mobile-tabbar,
  body.is-gameplay .mobile-tabbar {
    pointer-events: none;
    opacity: 0;
    transform: translateY(calc(100% + 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-tabbar,
  .mobile-tabbar a {
    transition: none;
  }
}
