@media (max-width: 620px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 10px;
    gap: 10px;
  }

  .command-panel {
    display: contents;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .brand-block,
  .auth-card,
  .mobile-bubble-divider,
  .mobile-jump-tabs,
  .tab-panel,
  .bubble-stage,
  .network-panel,
  .rank-panel,
  .rules-panel,
  .support-panel {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    min-width: 0;
  }

  .brand-block {
    order: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background:
      linear-gradient(135deg, rgba(0, 245, 106, 0.13), transparent 36%),
      linear-gradient(245deg, rgba(141, 53, 255, 0.14), transparent 34%),
      rgba(12, 17, 27, 0.92);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  }

  .brand-block h1 {
    max-width: 100%;
    margin-top: 8px;
    font-size: clamp(1.45rem, 7vw, 2.05rem);
  }

  .round-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-top: 8px;
    overflow: hidden;
  }

  .round-feed span:last-child {
    grid-column: 1 / -1;
  }

  .round-feed span {
    min-width: 0;
    min-height: 32px;
    padding: 6px 5px;
    font-size: 0.66rem;
    overflow-wrap: anywhere;
  }

  .auth-card {
    order: 2;
  }

  .mobile-jump-tabs {
    order: 4;
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px;
    background:
      radial-gradient(circle at 10% 0%, rgba(0, 245, 106, 0.15), transparent 34%),
      radial-gradient(circle at 92% 100%, rgba(141, 53, 255, 0.16), transparent 38%),
      linear-gradient(135deg, rgba(85, 214, 194, 0.1), transparent 40%),
      rgba(10, 14, 22, 0.96);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(16px);
    overflow: hidden;
  }

  .mobile-bubble-divider {
    order: 3;
    position: relative;
    display: block;
    height: 38px;
    overflow: hidden;
    border: 1px solid rgba(85, 214, 194, 0.16);
    border-radius: 999px;
    background:
      radial-gradient(circle at 18% 50%, rgba(0, 245, 106, 0.18), transparent 18%),
      linear-gradient(90deg, rgba(85, 214, 194, 0.06), rgba(141, 53, 255, 0.12), rgba(255, 46, 108, 0.08));
  }

  .mobile-bubble-divider::before {
    content: "";
    position: absolute;
    inset: 50% 12px auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  }

  .mobile-bubble-divider span {
    position: absolute;
    bottom: 5px;
    width: 13px;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
      radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.98), transparent 16%),
      radial-gradient(circle at 52% 56%, rgba(0, 245, 106, 0.78), rgba(85, 214, 194, 0.28) 56%, rgba(255, 255, 255, 0.08));
    box-shadow: 0 0 18px rgba(85, 214, 194, 0.35);
    animation: mobileBubbleDrift 3.8s ease-in-out infinite;
  }

  .mobile-bubble-divider span:nth-child(1) {
    left: 12%;
    animation-delay: -0.2s;
  }

  .mobile-bubble-divider span:nth-child(2) {
    left: 30%;
    width: 18px;
    background:
      radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.98), transparent 16%),
      radial-gradient(circle at 52% 56%, rgba(141, 53, 255, 0.8), rgba(85, 214, 194, 0.28) 58%, rgba(255, 255, 255, 0.08));
    animation-delay: -1s;
  }

  .mobile-bubble-divider span:nth-child(3) {
    left: 49%;
    width: 11px;
    animation-delay: -1.7s;
  }

  .mobile-bubble-divider span:nth-child(4) {
    left: 67%;
    width: 20px;
    background:
      radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.98), transparent 16%),
      radial-gradient(circle at 52% 56%, rgba(255, 216, 0, 0.88), rgba(255, 46, 108, 0.32) 58%, rgba(255, 255, 255, 0.08));
    animation-delay: -2.4s;
  }

  .mobile-bubble-divider span:nth-child(5) {
    left: 84%;
    width: 14px;
    animation-delay: -3s;
  }

  @keyframes mobileBubbleDrift {
    0%,
    100% {
      transform: translate3d(0, 7px, 0) scale(0.9);
      opacity: 0.55;
    }

    45% {
      transform: translate3d(8px, -9px, 0) scale(1.08);
      opacity: 1;
    }
  }

  .mobile-jump-tabs button {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px;
    padding: 8px 7px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
      rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  }

  .mobile-jump-tabs button::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 6px;
    width: 18px;
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translateX(-50%) scale(0.5);
    background:
      radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95), transparent 18%),
      radial-gradient(circle, rgba(85, 214, 194, 0.48), rgba(141, 53, 255, 0.24) 60%, transparent 70%);
    opacity: 0;
    pointer-events: none;
  }

  .mobile-jump-tabs button span {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 900;
    margin-top: 4px;
    text-transform: uppercase;
  }

  .mobile-jump-tabs button.is-active,
  .mobile-jump-tabs button:nth-child(4),
  .mobile-jump-tabs button:nth-child(5),
  .mobile-jump-tabs button:nth-child(7) {
    border-color: rgba(85, 214, 194, 0.45);
    background: linear-gradient(135deg, rgba(85, 214, 194, 0.18), rgba(141, 53, 255, 0.12));
  }

  .mobile-jump-tabs button.is-active {
    border-color: rgba(0, 245, 106, 0.72);
    background:
      linear-gradient(135deg, rgba(0, 245, 106, 0.2), rgba(85, 214, 194, 0.1)),
      rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(0, 245, 106, 0.18), 0 10px 24px rgba(0, 245, 106, 0.12);
    transform: translateY(-1px);
  }

  .mobile-jump-tabs button.is-active::before {
    opacity: 1;
    animation: activeTabBubble 1.8s ease-in-out infinite;
  }

  @keyframes activeTabBubble {
    0%,
    100% {
      transform: translateX(-50%) translateY(2px) scale(0.5);
    }

    50% {
      transform: translateX(-50%) translateY(-2px) scale(0.7);
    }
  }

  .mobile-jump-tabs button[hidden] {
    display: none;
  }

  .auth-card.is-mobile-collapsed {
    padding: 8px;
  }

  .auth-card.is-mobile-collapsed #authFields {
    gap: 0;
  }

  .auth-card.is-mobile-collapsed .auth-tabs {
    gap: 6px;
  }

  .auth-card.is-mobile-collapsed .auth-tabs button {
    min-height: 34px;
    font-size: 0.82rem;
  }

  .auth-card.is-mobile-collapsed label,
  .auth-card.is-mobile-collapsed .input-row,
  .auth-card.is-mobile-collapsed #emailField,
  .auth-card.is-mobile-collapsed .ghost-action,
  .auth-card.is-mobile-collapsed #authStatus {
    display: none;
  }

  .account-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .account-card > span,
  .account-card small {
    display: none;
  }

  .account-card strong {
    font-size: 1.05rem;
  }

  #logoutButton {
    grid-column: 2;
    grid-row: 1;
    min-height: 34px;
  }

  .verify-row {
    grid-column: 1 / -1;
  }

  .bubble-stage {
    order: 4;
    min-height: 455px;
    padding: 14px;
  }

  .stage-controls .account-tabs {
    display: none !important;
  }

  .bubble-stage::before {
    inset: 104px 12px 96px;
  }

  .top-bar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .stage-controls {
    align-items: stretch;
    flex-direction: row;
    gap: 8px;
  }

  .stage-controls .account-tabs {
    flex-basis: auto;
    min-width: 0;
  }

  .account-tabs {
    grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  }

  .account-tabs button[hidden] {
    display: none;
  }

  .stage-controls .account-tabs button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  .bubble-meter {
    min-width: 76px;
    width: auto;
    padding: 7px 9px;
  }

  .stage-copy {
    top: 126px;
    left: 16px;
    max-width: 42%;
  }

  .stage-copy strong {
    font-size: 1.62rem;
    max-width: 8ch;
  }

  .bubble-visual {
    inset: 148px 12px 128px;
  }

  .bubble-core {
    width: min(var(--bubble-size), 50vw);
  }

  .bubble-ring {
    width: min(calc(var(--bubble-size) * 1.32), 68vw);
  }

  .metrics-row {
    left: 12px;
    right: 12px;
    bottom: 12px;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metrics-row > div {
    min-height: 58px;
    padding: 9px 7px;
  }

  .metrics-row span {
    font-size: 0.62rem;
  }

  .metrics-row strong {
    font-size: 0.9rem;
  }

  .tab-panel {
    order: 5;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: rgba(15, 21, 32, 0.9);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  }

  .wallet-grid {
    order: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .join-options {
    order: 2;
  }

  .action-stack {
    order: 3;
  }

  .status-card {
    order: 4;
  }

  .payment-card {
    order: 5;
    max-height: 300px;
    overflow: auto;
  }

  .branch-card {
    order: 6;
  }

  .network-panel {
    order: 6;
  }

  .rank-panel {
    order: 7;
  }

  .rules-panel {
    order: 6;
  }

  .support-panel {
    order: 8;
  }

  body.mobile-tab-bubble .network-panel,
  body.mobile-tab-bubble .rank-panel,
  body.mobile-tab-bubble .rules-panel,
  body.mobile-tab-profile .tab-panel,
  body.mobile-tab-profile .network-panel,
  body.mobile-tab-profile .rank-panel,
  body.mobile-tab-profile .rules-panel,
  body.mobile-tab-tree .bubble-stage,
  body.mobile-tab-tree .tab-panel,
  body.mobile-tab-tree .rank-panel,
  body.mobile-tab-tree .rules-panel,
  body.mobile-tab-ranks .bubble-stage,
  body.mobile-tab-ranks .tab-panel,
  body.mobile-tab-ranks .network-panel,
  body.mobile-tab-ranks .rules-panel,
  body.mobile-tab-payouts .bubble-stage,
  body.mobile-tab-payouts .tab-panel,
  body.mobile-tab-payouts .network-panel,
  body.mobile-tab-payouts .rules-panel,
  body.mobile-tab-rules .bubble-stage,
  body.mobile-tab-rules .tab-panel,
  body.mobile-tab-rules .network-panel,
  body.mobile-tab-rules .rank-panel,
  body.mobile-tab-support .bubble-stage,
  body.mobile-tab-support .tab-panel,
  body.mobile-tab-support .network-panel,
  body.mobile-tab-support .rank-panel,
  body.mobile-tab-support .rules-panel {
    display: none;
  }

  body.mobile-tab-profile .bubble-stage {
    min-height: auto;
  }

  body.mobile-tab-profile .stage-bubble-content,
  body.mobile-tab-profile .bubble-meter,
  body.mobile-tab-payouts .rank-panel > .section-head,
  body.mobile-tab-payouts .rank-explainer,
  body.mobile-tab-payouts .rank-advantage,
  body.mobile-tab-ranks .dollar-payouts {
    display: none;
  }

  body.mobile-tab-payouts .dollar-payouts {
    margin-top: 0;
  }

  .search-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tree-wrap {
    max-height: 330px;
    padding: 10px 8px;
  }

  .branch-tree {
    min-width: 460px;
  }

  .node,
  .branch-node {
    width: 136px;
    min-height: 64px;
    padding: 8px;
  }

  .branch-children {
    grid-template-columns: repeat(3, minmax(112px, 1fr));
    gap: 7px;
  }
}

@media (min-width: 621px) {
  .mobile-jump-tabs,
  .mobile-bubble-divider {
    display: none;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 8px;
    gap: 8px;
  }

  .mobile-jump-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-block,
  .auth-card,
  .mobile-bubble-divider,
  .mobile-jump-tabs,
  .tab-panel,
  .bubble-stage,
  .network-panel,
  .rank-panel,
  .rules-panel,
  .support-panel {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  .brand-block h1 {
    font-size: clamp(1.35rem, 7vw, 1.82rem);
  }

  .bubble-stage {
    min-height: 420px;
    padding: 10px;
  }

  .bubble-stage::before {
    inset: 104px 10px 90px;
  }

  .stage-copy {
    top: 124px;
    left: 14px;
    max-width: 40%;
  }

  .stage-copy strong {
    font-size: 1.35rem;
  }

  .bubble-visual {
    inset: 148px 8px 114px;
  }

  .bubble-core {
    width: min(var(--bubble-size), 46vw);
  }

  .bubble-ring {
    width: min(calc(var(--bubble-size) * 1.22), 62vw);
  }

  .ring-b {
    width: min(calc(var(--bubble-size) * 1.4), 70vw);
  }

  .metrics-row {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .metrics-row > div {
    min-height: 54px;
    padding: 8px 5px;
  }
}
